public override void SendPacket(MinecraftServer server, MinecraftClient client) { if (Entity.Data != 0) { client.SendData(CreateBuffer( DataUtility.CreateInt32(Entity.Id), new[] { Entity.EntityType }, DataUtility.CreateAbsoluteInteger(Entity.Position.X), DataUtility.CreateAbsoluteInteger(Entity.Position.Y), DataUtility.CreateAbsoluteInteger(Entity.Position.Z), DataUtility.CreateInt32(Entity.Data), DataUtility.CreateInt16((short)Entity.Velocity.X), DataUtility.CreateInt16((short)Entity.Velocity.Y), DataUtility.CreateInt16((short)Entity.Velocity.Z))); } else { client.SendData(CreateBuffer( DataUtility.CreateInt32(Entity.Id), new[] { Entity.EntityType }, DataUtility.CreateAbsoluteInteger(Entity.Position.X), DataUtility.CreateAbsoluteInteger(Entity.Position.Y), DataUtility.CreateAbsoluteInteger(Entity.Position.Z), DataUtility.CreateInt32(Entity.Data))); } }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { client.SendData(CreateBuffer( new[] {WindowId}, DataUtility.CreateInt16(Index), Slot.GetData())); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { client.SendData(CreateBuffer( DataUtility.CreateString(Channel), DataUtility.CreateInt16((short)Message.Length), Message)); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { byte[] payload = new byte[] { PacketId, (byte)EntityIds.Length }; foreach (int id in EntityIds) payload = payload.Concat(DataUtility.CreateInt32(id)).ToArray(); client.SendData(payload); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { client.SendData(CreateBuffer( DataUtility.CreateInt32(EntityId), DataUtility.CreateInt16(SlotIndex), Item.GetData())); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { client.SendData(CreateBuffer( DataUtility.CreateInt16(Health), DataUtility.CreateInt16(Food), DataUtility.CreateFloat(FoodSaturation))); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { byte[] payload = new byte[] { PacketId, WindowId } .Concat(DataUtility.CreateInt16(Index)) .Concat(Slot.GetData()).ToArray(); client.SendData(payload); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { byte[] data = new byte[] {PacketId} .Concat(DataUtility.CreateInt32(EntityId)) .Concat(new byte[] {(byte)Animation}).ToArray(); client.SendData(data); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { // TODO: Refactor like mad var buffer = new List<byte>(); buffer.Add(PacketId); buffer.AddRange(DataUtility.CreateInt32(Item.Id)); if (Item.Item.Empty) buffer.AddRange(DataUtility.CreateInt16(-1)); else { buffer.AddRange(DataUtility.CreateInt16((short)Item.Item.Id)); // TODO: Make slots use signed shorts buffer.Add(Item.Item.Count); buffer.AddRange(DataUtility.CreateInt16((short)Item.Item.Metadata)); buffer.AddRange(DataUtility.CreateInt16(-1)); // TODO: Nbt appears to be sent here } buffer.AddRange(DataUtility.CreateAbsoluteInteger(Item.Position.X)); buffer.AddRange(DataUtility.CreateAbsoluteInteger(Item.Position.Y)); buffer.AddRange(DataUtility.CreateAbsoluteInteger(Item.Position.Z)); buffer.AddRange(DataUtility.CreatePackedByte(Item.Pitch)); buffer.AddRange(DataUtility.CreatePackedByte(Item.Pitch)); buffer.AddRange(DataUtility.CreatePackedByte(Item.Yaw)); client.SendData(buffer.ToArray()); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { client.SendData(CreateBuffer( DataUtility.CreateInt32((int)SpawnPosition.X), DataUtility.CreateInt32((int)SpawnPosition.Y), DataUtility.CreateInt32((int)SpawnPosition.Z))); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { byte[] payload = new byte[] { PacketId } .Concat(DataUtility.CreateInt32(EntityId)) .Concat(new byte[] { (byte)DeltaX, (byte)DeltaY, (byte)DeltaZ }).ToArray(); client.SendData(payload); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { client.SendData(CreateBuffer( DataUtility.CreateString(PlayerName), DataUtility.CreateBoolean(Online), DataUtility.CreateInt16(Ping))); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { byte[] data = new[] {PacketId} .Concat(DataUtility.CreateString(Channel)) .Concat(DataUtility.CreateInt16((short)Message.Length)) .Concat(Message).ToArray(); client.SendData(data); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { if (!Reason.Contains("§")) server.Log("Disconnected client: " + Reason); byte[] buffer = new[] { PacketId }.Concat(DataUtility.CreateString(Reason)).ToArray(); client.SendData(buffer); client.IsDisconnected = true; }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { if (!Reason.Contains("§")) LogProvider.Log("Disconnected client: " + Reason); client.SendData(CreateBuffer(DataUtility.CreateString(Reason))); client.IsDisconnected = true; }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { byte[] payload = new byte[] { PacketId, WindowId } .Concat(DataUtility.CreateInt16((short)Slots.Length)).ToArray(); foreach (var slot in Slots) payload = payload.Concat(slot.GetData()).ToArray(); client.SendData(payload); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { byte[] payload = new byte[] { PacketId } .Concat(DataUtility.CreateInt64(0)) // TODO: What is this field for .Concat(DataUtility.CreateInt64(Time)) .ToArray(); client.SendData(payload); }
public override void SendPacket(MinecraftServer Server, MinecraftClient Client) { byte[] buffer = new byte[] { PacketID } .Concat(CreateString(PlayerName)) .Concat(CreateBoolean(Online)) .Concat(CreateShort(Ping)).ToArray(); Client.SendData(buffer); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { byte[] buffer = new[] {PacketId} .Concat(DataUtility.CreateString(PlayerName)) .Concat(DataUtility.CreateBoolean(Online)) .Concat(DataUtility.CreateInt16(Ping)).ToArray(); client.SendData(buffer); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { client.SendData(CreateBuffer( DataUtility.CreateInt32(EntityId), DataUtility.CreateBoolean(true), DataUtility.CreateAbsoluteInteger(Position.X), DataUtility.CreateAbsoluteInteger(Position.Y), DataUtility.CreateAbsoluteInteger(Position.Z))); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { client.SendData(CreateBuffer( DataUtility.CreateInt32(EntityId), new byte[] {0}, DataUtility.CreateInt32((int)HeadboardPosition.X), new[] {(byte)HeadboardPosition.Y}, DataUtility.CreateInt32((int)HeadboardPosition.Z))); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { byte[] payload = new byte[] { PacketId } .Concat(DataUtility.CreateInt32((int)SpawnPosition.X)) .Concat(DataUtility.CreateInt32((int)SpawnPosition.Y)) .Concat(DataUtility.CreateInt32((int)SpawnPosition.Z)) .ToArray(); client.SendData(payload); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { byte[] payload = new byte[] {PacketId} .Concat(DataUtility.CreateInt16(Health)) .Concat(DataUtility.CreateInt16(Food)) .Concat(DataUtility.CreateFloat(FoodSaturation)) .ToArray(); client.SendData(payload); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { client.SendData(CreateBuffer( DataUtility.CreateInt32((int)Position.X), new[] {(byte)Position.Y}, DataUtility.CreateInt32((int)Position.Z), DataUtility.CreateUInt16(Value.Id), new[] {Value.Metadata})); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { client.SendData(CreateBuffer( DataUtility.CreateString(SoundName), DataUtility.CreateInt32((int)(Position.X * 8)), DataUtility.CreateInt32((int)(Position.Y * 8)), DataUtility.CreateInt32((int)(Position.Z * 8)), DataUtility.CreateFloat(Volume), new[] { Pitch })); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { // Send packet and enable encryption client.SendData(CreateBuffer( DataUtility.CreateInt16((short)SharedSecret.Length), SharedSecret, DataUtility.CreateInt16((short)VerifyToken.Length), VerifyToken)); client.EncryptionEnabled = true; }
public override void SendPacket(MinecraftServer Server, MinecraftClient Client) { byte[] buffer = new byte[] { PacketID } .Concat(CreateInt((int)Position.X)) .Concat(new byte[] { (byte)Position.Y }) .Concat(CreateInt((int)Position.Z)) .Concat(CreateShort((short)Value.BlockID)) .Concat(new byte[] { Value.Metadata }).ToArray(); Client.SendData(buffer); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { byte[] payload = new byte[] { PacketId } .Concat(DataUtility.CreateInt32(EntityId)) .Concat(DataUtility.CreateBoolean(true)) .Concat(DataUtility.CreateAbsoluteInteger(Position.X)) .Concat(DataUtility.CreateAbsoluteInteger(Position.Y)) .Concat(DataUtility.CreateAbsoluteInteger(Position.Z)).ToArray(); client.SendData(payload); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { client.SendData(CreateBuffer( DataUtility.CreateInt32(EntityId), new[] { (byte)DeltaX, (byte)DeltaY, (byte)DeltaZ })); }
public override void SendPacket(MinecraftServer server, MinecraftClient client) { byte[] payload = new byte[] { PacketId } .Concat(DataUtility.CreateInt32((int)Dimension)) .Concat(new byte[] { (byte)Difficulty, (byte)GameMode }) .Concat(DataUtility.CreateInt16(WorldHeight)) .Concat(DataUtility.CreateString(server.GetClientWorld(client).LevelType)) .ToArray(); client.SendData(payload); }