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 }
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)); }
public static void HandleLoginResponse(IPacket packet, MultiPlayerClient client) { client.EntityId = ((LoginResponsePacket)packet).EntityId; client.QueuePacket(new PlayerGroundedPacket()); }