Example #1
0
void WorldSession::HandleMeetingStoneJoinOpcode(WorldPacket & recv_data)
{
    ObjectGuid guid;

    recv_data >> guid;

    DEBUG_LOG("WORLD: Recvd CMSG_MEETINGSTONE_JOIN Message guid: %s", guid.GetString().c_str());

    // ignore for remote control state
    if (!_player->IsSelfMover())
        { return; }

    GameObject *obj = GetPlayer()->GetMap()->GetGameObject(guid);

    if (!obj)
        { return; }

    // Never expect this opcode for some type GO's
    if (obj->GetGoType() != GAMEOBJECT_TYPE_MEETINGSTONE)
    {
        sLog.outError("HandleMeetingStoneJoinOpcode: CMSG_MEETINGSTONE_JOIN for not allowed GameObject type %u (Entry %u), didn't expect this to happen.", obj->GetGoType(), obj->GetEntry());
        return;
    }

    if (Group *grp = _player->GetGroup())
    {
        if (!grp->IsLeader(_player->GetGUID()))
        {
            SendMeetingstoneFailed(MEETINGSTONE_FAIL_PARTYLEADER);

            obj->Use(_player);
            return;
        }

        if (grp->isRaidGroup())
        {
            SendMeetingstoneFailed(MEETINGSTONE_FAIL_RAID_GROUP);

            obj->Use(_player);
            return;
        }

        if (grp->IsFull())
        {
            SendMeetingstoneFailed(MEETINGSTONE_FAIL_FULL_GROUP);

            obj->Use(_player);
            return;
        }
    }

    GameObjectInfo const *gInfo = ObjectMgr::GetGameObjectInfo(obj->GetEntry());

    SendMeetingstoneSetqueue(gInfo->meetingstone.areaID, MEETINGSTONE_STATUS_JOINED_QUEUE);
    obj->Use(_player);
}
Example #2
0
void WorldSession::HandleMeetingStoneLeaveOpcode(WorldPacket & recv_data)
{
	DEBUG_LOG("WORLD: Recvd CMSG_MEETINGSTONE_LEAVE");

	if (Group *grp = _player->GetGroup()) {

	}
	else {
		RemovePlayerFromQueue(_player->GetGUIDLow());
	}

	SendMeetingstoneSetqueue(0, MEETINGSTONE_STATUS_NONE);
}
Example #3
0
void WorldSession::HandleMeetingStoneLeaveOpcode(WorldPacket & recv_data)
{
    DEBUG_LOG("WORLD: Recvd CMSG_MEETINGSTONE_LEAVE");

    SendMeetingstoneSetqueue(0, MEETINGSTONE_STATUS_NONE);
}