Ejemplo n.º 1
0
        public override void Handle(LoginPacket packet)
        {
            Console.WriteLine("Connected: {0}|{1}|{2}", packet.AccountName, packet.Password, packet.Version);

            if (packet.Version != Packet.Version) {
                pipe.Close(String.Format("Invalid protocol version {0} != {1}", packet.Version, Packet.Version));
                return;
            }

            pipe.SendPacket(new LoginPacket(0, "", "", (long)server.World.Time, -1));
            pipe.SendPacket(new SetSpawnPacket(0, 64, 0));

            var player = server.World.EntityHandler.NewPlayer(pipe, packet.AccountName, packet.Password);
            var ingame = new PlayerHandler(server, pipe, player);
            server.ConnectionHandler.AddPlayer(ingame);
            server.World.EntityHandler.AddPlayer(player);
            IsFinished = true;
        }
Ejemplo n.º 2
0
 public void AddPlayer(PlayerHandler player)
 {
     gameClients.Add(player);
 }