44using System . Text ;
55using System . Threading . Tasks ;
66using MineCase . Serialization ;
7+ using Orleans . Concurrency ;
78
89namespace MineCase . Protocol
910{
10- public struct UncompressedPacket
11+ [ Immutable ]
12+ public class UncompressedPacket
1113 {
1214 [ SerializeAs ( DataType . VarInt ) ]
1315 public uint Length ;
@@ -34,7 +36,7 @@ public async Task SerializeAsync(Stream stream)
3436
3537 public static async Task < UncompressedPacket > DeserializeAsync ( Stream stream )
3638 {
37- var packet = default ( UncompressedPacket ) ;
39+ var packet = new UncompressedPacket ( ) ;
3840 int packetIdLen ;
3941 using ( var br = new BinaryReader ( stream , Encoding . UTF8 , true ) )
4042 {
@@ -48,7 +50,8 @@ public static async Task<UncompressedPacket> DeserializeAsync(Stream stream)
4850 }
4951 }
5052
51- public struct CompressedPacket
53+ [ Immutable ]
54+ public class CompressedPacket
5255 {
5356 [ SerializeAs ( DataType . VarInt ) ]
5457 public uint PacketLength ;
@@ -75,7 +78,7 @@ public async Task SerializeAsync(Stream stream)
7578
7679 public static async Task < CompressedPacket > DeserializeAsync ( Stream stream )
7780 {
78- var packet = default ( CompressedPacket ) ;
81+ var packet = new CompressedPacket ( ) ;
7982 int dataLengthLen ;
8083 using ( var br = new BinaryReader ( stream , Encoding . UTF8 , true ) )
8184 {
0 commit comments