Example #1
0
void Raid::RemoveMember(const char *c)
{
	char errbuf[MYSQL_ERRMSG_SIZE];
	char* query = 0;
	MYSQL_RES *result;
	if (database.RunQuery(query,MakeAnyLenString(&query, "DELETE FROM raid_members where name='%s'", c ),errbuf,&result)){
		mysql_free_result(result);
	}

	Client *m = entity_list.GetClientByName(c);
	safe_delete_array(query);
	disbandCheck = true;
	SendRaidRemoveAll(c);
	SendRaidDisband(m);
	LearnMembers();
	VerifyRaid();

	if(m){
		m->SetRaidGrouped(false);
	}

	ServerPacket *pack = new ServerPacket(ServerOP_RaidRemove, sizeof(ServerRaidGeneralAction_Struct));
	ServerRaidGeneralAction_Struct *rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
	rga->rid = GetID();
	rga->instance_id = zone->GetInstanceID();
	strn0cpy(rga->playername, c, 64);
	rga->zoneid = zone->GetZoneID();
	worldserver.SendPacket(pack);
	safe_delete(pack);
}
Example #2
0
void Raid::SendRaidMoveAll(const char* who)
{
	Client *c = entity_list.GetClientByName(who);
	SendRaidRemoveAll(who);
	if(c)
		SendRaidCreate(c);
	SendMakeLeaderPacket(leadername);
	SendRaidAddAll(who);
	if(c){
		SendBulkRaid(c);
	if(IsLocked()) { SendRaidLockTo(c); }
	}
}
Example #3
0
void Raid::RemoveMember(const char *characterName)
{
	std::string query = StringFormat("DELETE FROM raid_members where name='%s'", characterName);
	auto results = database.QueryDatabase(query);

	Client *client = entity_list.GetClientByName(characterName);
	disbandCheck = true;
	SendRaidRemoveAll(characterName);
	SendRaidDisband(client);
	LearnMembers();
	VerifyRaid();

	if(client)
		client->SetRaidGrouped(false);

	ServerPacket *pack = new ServerPacket(ServerOP_RaidRemove, sizeof(ServerRaidGeneralAction_Struct));
	ServerRaidGeneralAction_Struct *rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
	rga->rid = GetID();
	rga->instance_id = zone->GetInstanceID();
	strn0cpy(rga->playername, characterName, 64);
	rga->zoneid = zone->GetZoneID();
	worldserver.SendPacket(pack);
	safe_delete(pack);
}