Exemple #1
0
 private void HandleGameJoined(GameJoined gameJoined)
 {
     foreach (var handler in gameJoinedHandlers.ToArray())
     {
         handler(gameJoined);
     }
 }
    private void OnGameJoined(GameJoined gameJoined)
    {
        Debug.Log("OnGameJoined: " + gameJoined.GUID);
        CurrentGame = new Game(gameJoined.Players);

        foreach (var player in gameJoined.Players)
        {
            Debug.Log($"OnGameJoined Player {player.Guid}: {player.Nickname}");
        }
    }
Exemple #3
0
        private void On(GameJoined @event)
        {
            var entry = Dict[@event.ID];

            if (@event.AccountID != entry.Receiver && entry.PlayerWhite == default)
            {
                entry.PlayerWhite = @event.AccountID;
            }
            else
            {
                entry.PlayerBlack = @event.AccountID;
            }
        }
        public void JoinGame(IGameModel game, IUserModel user)
        {
            var message = new GameJoined()
            {
                User2Id = user.Id,
                GameId  = game.Id
            };

            var changed = this.ModelUpdaterResolver.GetUpdater <IUpdatableGame, GameJoined>().Update(this.model.Games.FirstOrDefault(x => x.Id == message.GameId), message);

            if (changed)
            {
                this.ServiceClient.PublishAsync <GameJoined>(message);
            }
        }
Exemple #5
0
 internal void RaiseGameJoined(KgsGame ongame)
 {
     GameJoined?.Invoke(this, ongame);
 }
Exemple #6
0
 private void OnGameJoined(GameJoined gameJoined)
 {
     SwitchScreen(ScreenStates.GameJoin);
 }