if else clause turn-around

This commit is contained in:
Kai Philipp
2019-09-09 21:13:40 +02:00
parent df8f38b8a8
commit 8765379a2e
+9 -11
View File
@@ -1427,17 +1427,15 @@ ServerLobbyThread::HandleNetPacketJoinGame(boost::shared_ptr<SessionData> sessio
SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_NOT_INVITED);
} else if (!game->CheckPassword(password)) {
SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_INVALID_PASSWORD);
} else if (tmpData.gameType == GAME_TYPE_RANKING) {
if(!joinGame.spectateonly()
// && session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR
// && session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR_V4V6
// && session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR_V4
// && game->IsClientAddressConnected(session->GetClientAddr())) {
){
SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_IP_BLOCKED);
}else if (!session->IsPlayerAllowedToJoinLimitRank()) {
SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_GAME_INVALID);
}
} else if (tmpData.gameType == GAME_TYPE_RANKING && !session->IsPlayerAllowedToJoinLimitRank()) {
SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_GUEST_FORBIDDEN);
} else if (tmpData.gameType == GAME_TYPE_RANKING && !joinGame.spectateonly()
// && session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR
// && session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR_V4V6
// && session->GetClientAddr() != SERVER_ADDRESS_LOCALHOST_STR_V4
// && game->IsClientAddressConnected(session->GetClientAddr())) {
){
SendJoinGameFailed(session, joinGame.gameid(), NTF_NET_JOIN_IP_BLOCKED);
} else {
MoveSessionToGame(game, session, joinGame.autoleave(), false);
}