public static List <RpcUpdateGameData> Deserialize(HazelBinaryReader reader)
        {
            var items = new List <RpcUpdateGameData>();

            while (reader.HasBytesLeft())
            {
                var msg    = new RpcUpdateGameData();
                var length = reader.ReadInt16();
                var body   = new HazelBinaryReader(reader.ReadBytes(length));
                reader.ReadByte();

                msg.playerId = body.ReadByte();
                msg.name     = body.ReadString();

                msg.color   = body.ReadByte();
                msg.hat     = (Hat)body.ReadByte();
                msg.pet     = (Pet)body.ReadByte();
                msg.skin    = (Skin)body.ReadByte();
                msg.unknown = body.ReadByte();

                items.Add(msg);
            }

            return(items);
        }
Beispiel #2
0
        public static RpcSetName Deserialize(HazelBinaryReader reader)
        {
            var msg = new RpcSetName();

            msg.name = reader.ReadString();

            return(msg);
        }
Beispiel #3
0
        public static RpcSendChat Deserialize(HazelBinaryReader reader)
        {
            var msg = new RpcSendChat();

            msg.text = reader.ReadString();

            return(msg);
        }
Beispiel #4
0
        public static SceneChange Deserialize(HazelBinaryReader reader)
        {
            var msg = new SceneChange();

            msg.clientId  = reader.ReadPackedInt32();
            msg.sceneName = reader.ReadString();

            return(msg);
        }
Beispiel #5
0
        public static HelloHandshake Deserialize(HazelBinaryReader reader)
        {
            var msg = new HelloHandshake();

            msg.Nonce         = reader.ReadUInt16();
            msg.Version       = reader.ReadByte();
            msg.ClientVersion = reader.ReadInt32();
            msg.Name          = reader.ReadString();

            return(msg);
        }
Beispiel #6
0
 public void Deserialize(HazelBinaryReader reader)
 {
     PlayerName = reader.ReadString();
     ColorId    = reader.ReadByte();
     HatId      = (Hat)reader.ReadPackedUInt32();
     SkinId     = (Skin)reader.ReadPackedUInt32();
     Flags      = (PlayerInfoFlags)reader.ReadByte();
     Tasks      = reader.ReadList(read => {
         var task = new TaskInfo();
         task.Deserialize(read);
         return(task);
     });
     unknown = reader.ReadByte();
 }
            public static GameListItem Deserialize(HazelBinaryReader reader)
            {
                var msg = new GameListItem();

                msg.adress     = reader.ReadInt32();
                msg.port       = reader.ReadUInt16();
                msg.code       = reader.ReadInt32();
                msg.name       = reader.ReadString();
                msg.players    = reader.ReadByte();
                msg.age        = reader.ReadPackedInt32();
                msg.mapid      = reader.ReadByte();
                msg.imposters  = reader.ReadByte();
                msg.maxplayers = reader.ReadByte();
                return(msg);
            }