private static void OnGameStartFakeAttackMessageReceived(GameStartFakeAttackMessage message) { if (GameSessionManager.TryGet(message.SessionId, out GameSession session)) { if (message.AccountId != null) { ServerRequestManager.Create(new GameAvatarRequestMessage { AccountId = message.AccountId }, ServerManager.GetDocumentSocket(9, message.AccountId)).OnComplete = args => { if (session.IsDestructed()) { return; } if (args.ErrorCode == ServerRequestError.Success && args.ResponseMessage.Success) { GameState currentGameState = session.GameState; if (currentGameState != null && currentGameState.GetGameStateType() == GameStateType.HOME) { GameAvatarResponseMessage gameAvatarResponseMessage = (GameAvatarResponseMessage)args.ResponseMessage; GameDocument document = gameAvatarResponseMessage.Document; AvailableServerCommandMessage availableServerCommandMessage = new AvailableServerCommandMessage(); availableServerCommandMessage.SetServerCommand(new LogicMatchmakingCommand()); session.SendPiranhaMessage(availableServerCommandMessage, 1); session.FakeAttackState = new GameFakeAttackState { Home = document.LogicClientHome, HomeOwnerAvatar = document.LogicClientAvatar, PlayerAvatar = session.GameAvatar.LogicClientAvatar, SaveTime = document.SaveTime, MaintenanceTime = document.MaintenanceTime }; } } else { AttackHomeFailedMessage attackHomeFailedMessage = new AttackHomeFailedMessage(); attackHomeFailedMessage.SetReason(AttackHomeFailedMessage.Reason.GENERIC); session.SendPiranhaMessage(attackHomeFailedMessage, 1); } }; } else { GameState currentGameState = session.GameState; if (currentGameState != null && currentGameState.GetGameStateType() == GameStateType.HOME) { AvailableServerCommandMessage availableServerCommandMessage = new AvailableServerCommandMessage(); availableServerCommandMessage.SetServerCommand(new LogicMatchmakingCommand()); session.SendPiranhaMessage(availableServerCommandMessage, 1); session.FakeAttackState = new GameFakeAttackState { Home = GameBaseGenerator.GenerateBase((LogicGameObjectData)message.ArgData), HomeOwnerAvatar = GameBaseGenerator.HomeOwnerAvatar, PlayerAvatar = session.GameAvatar.LogicClientAvatar, SaveTime = TimeUtil.GetTimestamp(), MaintenanceTime = -1 }; } } } }