protected override void OnBeforeWrite(Network.Client client, Server.Core.Stream.ByteBuffer buffer) { buffer.WriteVarint(ID); buffer.WriteInt(client.TheWorld.FlatWorld[Ndx].X); buffer.WriteInt(client.TheWorld.FlatWorld[Ndx].Z); buffer.WriteBoolean(GroundUpContinuous); buffer.WriteLEUShort(PrimaryBitmap); buffer.WriteShort((short)SecondaryBitmap); byte[] chunkData = client.TheWorld.FlatWorld[Ndx].ChunkData; byte[] compressData = new byte[chunkData.Length]; ConcurrentStack <Deflater> DeflaterPool = new ConcurrentStack <Deflater>(); Deflater deflater; DeflaterPool.TryPop(out deflater); if (deflater == null) { deflater = new Deflater(5); } deflater.SetInput(chunkData, 0, chunkData.Length); deflater.Finish(); int length = deflater.Deflate(compressData); deflater.Reset(); DeflaterPool.Push(deflater); buffer.WriteInt(length); buffer.Write(compressData, 0, length); }
protected override void OnBeforeWrite(Network.Client client, Server.Core.Stream.ByteBuffer buffer) { buffer.WriteVarint(ID); buffer.WriteInt((int)client.PlayerPosition.X); buffer.WriteInt((int)client.PlayerPosition.FeetY); buffer.WriteInt((int)client.PlayerPosition.Z); }
protected override void OnBeforeWrite(Network.Client client, Server.Core.Stream.ByteBuffer buffer) { MinecraftServer.Core.Network.Server.ViewModel.Warning("Block Change : Block(" + X + ", " + Y + ", " + Z + "), NewID = " + BlockID); buffer.WriteVarint(ID); buffer.WriteInt(X); buffer.WriteByte(Y); buffer.WriteInt(Z); buffer.WriteVarint(BlockID); buffer.WriteByte(BlockMeta); }
protected override void OnBeforeWrite(Network.Client client, Server.Core.Stream.ByteBuffer buffer) { buffer.WriteVarint(ID); buffer.WriteInt(Id); buffer.WriteByteAngle(Yaw); buffer.WriteByteAngle(Pitch); }
protected override void OnBeforeWrite(Network.Client client, Server.Core.Stream.ByteBuffer buffer) { buffer.WriteVarint(ID); buffer.WriteInt(Dimension); buffer.WriteByte(Difficulty); buffer.WriteByte(Gamemode); buffer.WriteString(LevelType); }
protected override void OnBeforeWrite(Network.Client client, Server.Core.Stream.ByteBuffer buffer) { buffer.WriteVarint(ID); buffer.WriteByte((byte)Entities.Count); foreach (int i in Entities) { buffer.WriteInt(i); } }
protected override void OnBeforeWrite(Network.Client client, Server.Core.Stream.ByteBuffer buffer) { Random r = new Random(); KeepAlive = r.Next(int.MinValue, int.MaxValue); buffer.WriteVarint(ID); buffer.WriteInt(KeepAlive); }
protected override void OnBeforeWrite(Network.Client client, Server.Core.Stream.ByteBuffer buffer) { client.PlayerMetadata.GameMode = 1; buffer.WriteVarint(ID); buffer.WriteInt(4); buffer.WriteByte(1); buffer.WriteByte(0); buffer.WriteByte(1); buffer.WriteByte(32); buffer.WriteString("default"); }
protected override void OnBeforeWrite(Network.Client client, Server.Core.Stream.ByteBuffer buffer) { buffer.WriteVarint(ID); buffer.WriteInt(Id); //buffer.WriteByte(Convert.ToByte(DX)); //buffer.WriteByte(Convert.ToByte(DY)); //buffer.WriteByte(Convert.ToByte(DZ)); //buffer.WriteByte(0); //buffer.WriteByte(0); buffer.WriteFixedPointByte(DX); buffer.WriteFixedPointByte(DY); buffer.WriteFixedPointByte(DZ); }