diff --git a/src/SIGame/SIGame.ViewModel/ViewModel/ConnectionDataViewModel.cs b/src/SIGame/SIGame.ViewModel/ViewModel/ConnectionDataViewModel.cs index e9361021..2af02b6f 100644 --- a/src/SIGame/SIGame.ViewModel/ViewModel/ConnectionDataViewModel.cs +++ b/src/SIGame/SIGame.ViewModel/ViewModel/ConnectionDataViewModel.cs @@ -234,7 +234,7 @@ protected async Task ConnectCoreAsync(bool upgrade) private async void Join_Executed(object? arg) => await JoinGameAsync(null, (GameRole)arg); - protected virtual async Task JoinGameAsync(GameInfo gameInfo, GameRole role, bool host = false, CancellationToken cancellationToken = default) + protected virtual async Task JoinGameAsync(GameInfo? gameInfo, GameRole role, bool host = false, CancellationToken cancellationToken = default) { IsProgress = true; @@ -259,7 +259,7 @@ protected virtual async Task JoinGameAsync(GameInfo gameInfo, GameRole role, boo } public virtual async Task JoinGameCoreAsync( - GameInfo gameInfo, + GameInfo? gameInfo, GameRole role, bool isHost = false, CancellationToken cancellationToken = default) diff --git a/src/SIGame/SIGame.ViewModel/ViewModel/SIOnlineViewModel.cs b/src/SIGame/SIGame.ViewModel/ViewModel/SIOnlineViewModel.cs index 076a135e..eeee1bd7 100644 --- a/src/SIGame/SIGame.ViewModel/ViewModel/SIOnlineViewModel.cs +++ b/src/SIGame/SIGame.ViewModel/ViewModel/SIOnlineViewModel.cs @@ -921,6 +921,46 @@ protected override void Prepare(GameSettingsViewModel gameSettings) GameSettings.Message = Resources.Creating; + + // TODO: enable after server update + //settings.AppSettings.Culture = Thread.CurrentThread.CurrentUICulture.Name; + + //var runGameResponse = await _gameServerClient.RunGameAsync( + // new SI.GameServer.Contract.RunGameRequest(( + // GameSettingsCore)settings, + // packageInfo, + // computerAccounts.Select(ca => ca.Account).ToArray()), + // cancellationToken); + + //if (!runGameResponse.IsSuccess) + //{ + // throw new Exception(GetMessage(runGameResponse.ErrorType)); + //} + + // GameSettings.Message = Resources.GameEntering; + + //var name = Human.Name; + + //_password = settings.NetworkGamePassword; + + //var game = new GameInfo + //{ + // HostUri = runGameResponse.HostUri, + // GameID = runGameResponse.GameId, + // Owner = name + //}; + + //await JoinGameAsync(game, settings.Role, runGameResponse.IsHost, cancellationToken); + + //if (_host == null) + //{ + // return null; + //} + + //_host.Connector?.SetGameID(runGameResponse.GameId); + + //return (_node, _host); + if (_userSettings.UseSignalRConnection) { var gameCreatingResult2 = await _gameServerClient.CreateAndJoinGame2Async(