private void onConnection(BaseEvent evt) { bool flag = (bool)evt.Params["success"]; string text = (string)evt.Params["errorMessage"]; if (flag) { if (mt.UseEncryption) { mt.TriggerInitCrypto = true; } else { mt.login(); } return; } if (mt.ConnectionAttempts < 3) { mt.reconnect(); return; } Log.LogNetworkErrorFormatted(this, "Failed to connect after {0} attempts with error: {1}. Will trigger a ROOM_JOIN_ERROR", mt.ConnectionAttempts, text); RoomJoinError roomJoinError = default(RoomJoinError); roomJoinError.roomName = mt.JoinRoomDataRoom; roomJoinError.errorMessage = text; mt.teardown(); mt.triggerEvent(GameServerEvent.ROOM_JOIN_ERROR, roomJoinError); }