Пример #1
0
void WorldSession::SendNotification(int32 string_id,...)
{
    char const* format = GetOregonString(string_id);
    if (format)
    {
        va_list ap;
        char szStr [1024];
        szStr[0] = '\0';
        va_start(ap, string_id);
        vsnprintf(szStr, 1024, format, ap);
        va_end(ap);

        WorldPacket data(SMSG_NOTIFICATION, (strlen(szStr)+1));
        data << szStr;
        SendPacket(&data);
    }
}
Пример #2
0
void WorldSession::SendBattlegroundOrArenaJoinError(uint8 err)
{
    WorldPacket data;
    int32 msg;
    switch (err)
    {
    case BG_JOIN_ERR_OFFLINE_MEMBER:
        msg = LANG_BG_GROUP_OFFLINE_MEMBER;
        break;
    case BG_JOIN_ERR_GROUP_TOO_MANY:
        msg = LANG_BG_GROUP_TOO_LARGE;
        break;
    case BG_JOIN_ERR_MIXED_FACTION:
        msg = LANG_BG_GROUP_MIXED_FACTION;
        break;
    case BG_JOIN_ERR_MIXED_LEVELS:
        msg = LANG_BG_GROUP_MIXED_LEVELS;
        break;
    case BG_JOIN_ERR_GROUP_MEMBER_ALREADY_IN_QUEUE:
        msg = LANG_BG_GROUP_MEMBER_ALREADY_IN_QUEUE;
        break;
    case BG_JOIN_ERR_GROUP_DESERTER:
        msg = LANG_BG_GROUP_MEMBER_DESERTER;
        break;
    case BG_JOIN_ERR_ALL_QUEUES_USED:
        msg = LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS;
        break;
    case BG_JOIN_ERR_GROUP_NOT_ENOUGH:
    case BG_JOIN_ERR_MIXED_ARENATEAM:
    default:
        return;
        break;
    }
    ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, NULL, 0, GetOregonString(msg), NULL);
    SendPacket(&data);
    return;
}