Changeset View
Changeset View
Standalone View
Standalone View
source/lobby/XmppClient.cpp
/* Copyright (C) 2016 Wildfire Games. | /* Copyright (C) 2017 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 782 Lines • ▼ Show 20 Lines | if (presenceType == gloox::Presence::Unavailable) | ||||
if (!participant.newNick.empty() && (participant.flags & (gloox::UserNickChanged | gloox::UserSelf))) | if (!participant.newNick.empty() && (participant.flags & (gloox::UserNickChanged | gloox::UserSelf))) | ||||
{ | { | ||||
// we have a nick change | // we have a nick change | ||||
std::string newNick = participant.newNick.to_string(); | std::string newNick = participant.newNick.to_string(); | ||||
m_PlayerMap[newNick].resize(3); | m_PlayerMap[newNick].resize(3); | ||||
m_PlayerMap[newNick][0] = presenceString; | m_PlayerMap[newNick][0] = presenceString; | ||||
m_PlayerMap[newNick][2] = roleString; | m_PlayerMap[newNick][2] = roleString; | ||||
CreateGUIMessage("chat", "nick", nick, participant.newNick.to_string()); | CreateGUIMessage("chat", "nick", nick, participant.newNick.to_string()); | ||||
DbgXMPP(nick << " is now known as " << participant.newNick.to_string()); | |||||
} | |||||
else if (participant.flags & gloox::UserKicked) | |||||
{ | |||||
DbgXMPP(nick << " was kicked. Reason:" << participant.reason.to_string()); | |||||
Imarok: Space missing | |||||
CreateGUIMessage("chat", "kicked", nick, participant.reason.to_string()); | |||||
} | |||||
else if (participant.flags & gloox::UserBanned) | |||||
{ | |||||
DbgXMPP(nick << " was banned. Reason:" << participant.reason.to_string()); | |||||
ImarokUnsubmitted Not Done Inline ActionsSpace missing Imarok: Space missing | |||||
CreateGUIMessage("chat", "banned", nick, participant.reason.to_string()); | |||||
} | } | ||||
else | else | ||||
{ | |||||
DbgXMPP(nick << " left the room (flags " << flags << participant.flags << ")"); | |||||
CreateGUIMessage("chat", "leave", nick); | CreateGUIMessage("chat", "leave", nick); | ||||
} | |||||
Not Done Inline ActionsThere are some other flags we could test for. For example controlled room shutdown. The case probably doesn't occur, as on maintenance the entire server will be down. elexis: There are some other flags we could test for. For example controlled room shutdown. The case… | |||||
DbgXMPP(nick << " left the room"); | |||||
m_PlayerMap.erase(nick); | m_PlayerMap.erase(nick); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
/* During the initialization process, we recieve join messages for everyone | /* During the initialization process, we recieve join messages for everyone | ||||
* currently in the room. We don't want to display these, so we filter them | * currently in the room. We don't want to display these, so we filter them | ||||
* out. We will always be the last to join during initialization. | * out. We will always be the last to join during initialization. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 289 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Space missing