Ejemplo n.º 1
0
        // This method is called whenever a player joins the game
        public override void UserJoined(Player player)
        {
            player.Name = player.JoinData["name"];

            // Send join message for all users in the room to player
            foreach (var p in Players)
            {
                if (p.Id != player.Id)
                {
                    player.Send("join", p.Id, p.Name);
                }
            }

            // Send a join message to everybody
            Message m = Message.Create("join");

            m.Add(player.Id);
            m.Add(player.Name);
            Broadcast(m);
        }