コード例 #1
0
ファイル: GroupManager.cpp プロジェクト: jason83/mmoserver
//======================================================================================================================
// Leader has chosen a new mode
void GroupManager::_processGroupLootModeResponse(Message* message, DispatchClient* client)
{
    gLogger->log(LogManager::DEBUG,"_processGroupLootModeResponse\n");

    Player* player = gChatManager->getPlayerByAccId(client->getAccountId());
    if(player == NULL)
    {
        gLogger->log(LogManager::DEBUG,"GroupManager::_processGroupBaselineRequest player not found\n");
        return;
    }

    GroupObject* group = getGroupById(player->getGroupId());

    if(group == NULL)
    {
        gChatMessageLib->sendSystemMessage(player, L"@group:disbanded");
        gChatMessageLib->sendIsmGroupCREO6deltaGroupId(0,player);
        return;
    }

    if(player != group->getLeader())
    {
        gChatMessageLib->sendSystemMessage(player, L"@group:must_be_leader");
        return;
    }

    // set and send
    group->changeLootMode(message->getUint32());
    gChatMessageLib->sendGroupSystemMessage(mLootModeMessages[group->getLootMode()], group, true);

}
コード例 #2
0
ファイル: GroupManager.cpp プロジェクト: jason83/mmoserver
//======================================================================================================================
// someone requests to change the loot mode
void GroupManager::_processGroupLootModeRequest(Message* message, DispatchClient* client)
{
    gLogger->log(LogManager::DEBUG,"_processGroupLootModeRequest\n");
    Player* player = gChatManager->getPlayerByAccId(client->getAccountId());

    if(player == NULL)
    {
        gLogger->log(LogManager::DEBUG,"GroupManager::_processGroupBaselineRequest player not found\n");
        return;
    }

    GroupObject* group = getGroupById(player->getGroupId());

    if(group == NULL)
    {
        gChatMessageLib->sendSystemMessage(player, L"@group:disbanded");
        gChatMessageLib->sendIsmGroupCREO6deltaGroupId(0,player);
        return;
    }

    if(player != group->getLeader())
    {
        gChatMessageLib->sendSystemMessage(player, mLootModeNotAllowedMessages[group->getLootMode()]);
        return;
    }

    gChatMessageLib->sendIsmGroupLootModeResponse(player);
    // ok to change loot mode

}