Greet() публичный Метод

Greets the player and sends the client initial data it needs to get-ingame.
public Greet ( JoinBNetGameMessage message ) : void
message JoinBNetGameMessage
Результат void
Пример #1
0
        public void OnNewPlayer(GameClient client, JoinBNetGameMessage message)
        {           
            client.BnetClient = GameManager.AvailableGames[(ulong)message.GameId].Clients.FirstOrDefault();
            
            if (client.BnetClient == null)
            {
                Logger.Warn("Couldn't find bnet client for joined client/player!");
                return;
            }                

            client.BnetClient.InGameClient = client;
            
            var player = new Player(client, this.Universe, client.BnetClient.CurrentToon);
            client.Player = player;
            this.Players.Add(player);

            player.Greet(message);            
        }
Пример #2
0
        public void OnNewPlayer(GameClient client, JoinBNetGameMessage message)
        {           
            // a hackish way to get client.BnetClient in context -- pretends games has only one client in. when we're done with implementing bnet completely, will get this sorted out. /raist
            client.BnetClient = GameManager.AvailableGames[(ulong)message.GameId].Clients.FirstOrDefault();
            
            if (client.BnetClient == null)
            {
                Logger.Warn("Couldn't find bnet client for joined client/player!");
                return;
            }                

            client.BnetClient.InGameClient = client;
            
            var player = new Player(client, this.Universe, client.BnetClient.CurrentToon);
            client.Player = player;
            this.Players.Add(player);

            player.Greet(message);            
        }