Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirKhil committed Feb 22, 2024
2 parents f2c8c23 + 5288567 commit 720cb1e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
Expand Down
40 changes: 40 additions & 0 deletions src/SIGame/SIGame.ViewModel/ViewModel/SIOnlineViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<AppSettingsCore>)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(
Expand Down

0 comments on commit 720cb1e

Please sign in to comment.