mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
server crash fix
This commit is contained in:
parent
a569a1b8b1
commit
f38c5f50ef
3 changed files with 4 additions and 2 deletions
|
|
@ -53,6 +53,7 @@ public:
|
|||
ServerInfo_User(const ServerInfo_User *other, bool complete = true);
|
||||
static SerializableItem *newItem() { return new ServerInfo_User; }
|
||||
QString getName() const { return static_cast<SerializableItem_String *>(itemMap.value("name"))->getData(); }
|
||||
void setName(const QString &_name) { static_cast<SerializableItem_String *>(itemMap.value("name"))->setData(_name); }
|
||||
int getUserLevel() const { return static_cast<SerializableItem_Int *>(itemMap.value("userlevel"))->getData(); }
|
||||
void setUserLevel(int _userLevel) { static_cast<SerializableItem_Int *>(itemMap.value("userlevel"))->setData(_userLevel); }
|
||||
QString getRealName() const { return static_cast<SerializableItem_String *>(itemMap.value("real_name"))->getData(); }
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ AuthenticationResult Server::loginUser(Server_ProtocolHandler *session, QString
|
|||
while (users.contains(tempName) || userExists(tempName))
|
||||
tempName = name + "_" + QString::number(++i);
|
||||
name = tempName;
|
||||
data->setName(name);
|
||||
}
|
||||
|
||||
session->setUserInfo(data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue