示例#1
0
        public static void HandlePositionAndLook(IPacket packet, MultiPlayerClient client)
        {
            var position = (SetPlayerPositionPacket)packet;

            client._Position = new Vector3((float)position.X, (float)position.Y, (float)position.Z);
            client.QueuePacket(position);
            client.LoggedIn = true;
            // TODO: Pitch and yaw
        }
示例#2
0
        public static void HandleHandshake(IPacket packet, MultiPlayerClient client)
        {
            if (((HandshakeResponsePacket)packet).ConnectionHash != "-")
            {
                Console.WriteLine("Online mode is not supported");
                Process.GetCurrentProcess().Kill();
            }

            // TODO: Authentication
            client.QueuePacket(new LoginRequestPacket(PacketReader.Version, client.User.Username));
        }
示例#3
0
 public static void HandleLoginResponse(IPacket packet, MultiPlayerClient client)
 {
     client.EntityId = ((LoginResponsePacket)packet).EntityId;
     client.QueuePacket(new PlayerGroundedPacket());
 }