Avoid crashes from duplicate usernames
This commit is contained in:
@@ -347,11 +347,19 @@ void LobbyMenu::HandleLoginResponse(ClientPacket* const argPacket) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LobbyMenu::HandleJoinRejection(TextPacket* const argPacket) {
|
void LobbyMenu::HandleJoinRejection(TextPacket* const argPacket) {
|
||||||
//TODO: (9) LobbyMenu::HandleJoinRejection()
|
//NOTE: NEVER HAPPENS
|
||||||
|
throw(std::runtime_error("HandleJoinRejection"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LobbyMenu::HandleLoginRejection(TextPacket* const argPacket) {
|
void LobbyMenu::HandleLoginRejection(TextPacket* const argPacket) {
|
||||||
//TODO: (9) LobbyMenu::HandleLoginRejection
|
config["client.disconnectMessage"] = std::string() + "Join request rejected: " + argPacket->text;
|
||||||
|
SetSceneSignal(SceneSignal::DISCONNECTEDSCREEN);
|
||||||
|
|
||||||
|
//avoid crashes from the heartbeat system
|
||||||
|
ClientPacket newPacket;
|
||||||
|
newPacket.type = SerialPacketType::DISCONNECT_REQUEST;
|
||||||
|
newPacket.clientIndex = clientIndex;
|
||||||
|
network.SendTo(argPacket->srcAddress, &newPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------
|
//-------------------------
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ server.dbname = database.db
|
|||||||
#client.screen.f = false #NOTE: fullscreen option is currently disabled
|
#client.screen.f = false #NOTE: fullscreen option is currently disabled
|
||||||
|
|
||||||
client.username = username
|
client.username = username
|
||||||
|
client.password = password
|
||||||
client.handle = handle
|
client.handle = handle
|
||||||
client.avatar = character2.png
|
client.avatar = character2.png
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user