mirror of
https://github.com/araxiaonline/azerothshard-core.git
synced 2026-06-13 02:42:24 -04:00
35 lines
774 B
C++
35 lines
774 B
C++
#include "AzthGroupMgr.h"
|
|
#include "DatabaseEnv.h"
|
|
|
|
AzthGroupMgr::AzthGroupMgr(Group* original)
|
|
{
|
|
group = original;
|
|
|
|
QueryResult result = CharacterDatabase.PQuery("SELECT `MaxlevelGroup`, `MaxGroupSize` FROM `azth_groups` WHERE `guid` = '%u'", group->GetLowGUID());
|
|
if (!result)
|
|
{
|
|
levelMaxGroup = 0;
|
|
groupSize = 1;
|
|
}
|
|
else
|
|
{
|
|
Field* fields = result->Fetch();
|
|
|
|
levelMaxGroup = fields[0].GetUInt32();
|
|
groupSize = fields[1].GetUInt32();
|
|
}
|
|
}
|
|
|
|
AzthGroupMgr::~AzthGroupMgr()
|
|
{
|
|
}
|
|
|
|
void AzthGroupMgr::saveToDb()
|
|
{
|
|
ASSERT(group);
|
|
|
|
CharacterDatabase.PExecute("UPDATE azth_groups SET MaxLevelGroup = %u, MaxGroupSize = %u WHERE leaderGuid = %u", levelMaxGroup, groupSize, this->group->GetLeaderGUID());
|
|
}
|
|
|
|
|