SetGroupleader converted to QueryDatabase

This commit is contained in:
Arthur Ice 2014-10-07 10:55:04 -07:00
parent dfcddac2ef
commit 11e08c9b67

View File

@ -168,21 +168,13 @@ void Raid::MoveMember(const char *name, uint32 newGroup)
void Raid::SetGroupLeader(const char *who, bool glFlag) void Raid::SetGroupLeader(const char *who, bool glFlag)
{ {
char errbuf[MYSQL_ERRMSG_SIZE]; std::string query = StringFormat("UPDATE raid_members SET isgroupleader = %lu WHERE name = '%s'",
char* query = 0; (unsigned long)glFlag, who);
MYSQL_RES *result; auto results = database.QueryDatabase(query);
if (database.RunQuery(query,MakeAnyLenString(&query, "UPDATE raid_members SET isgroupleader=%lu WHERE name='%s'", (unsigned long)glFlag, who),errbuf,&result)){
mysql_free_result(result);
}
safe_delete_array(query);
LearnMembers(); LearnMembers();
VerifyRaid(); VerifyRaid();
//if(glFlag == true){ //we're setting the flag
//this->SendMakeGroupLeaderPacket(who);
//}
ServerPacket *pack = new ServerPacket(ServerOP_RaidGroupLeader, sizeof(ServerRaidGeneralAction_Struct)); ServerPacket *pack = new ServerPacket(ServerOP_RaidGroupLeader, sizeof(ServerRaidGeneralAction_Struct));
ServerRaidGeneralAction_Struct *rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer; ServerRaidGeneralAction_Struct *rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
rga->rid = GetID(); rga->rid = GetID();