Example #1
0
        public static EnabledChannelsMessage deserialize(Utils.Objects.Packet sender)
        {
            int nEnabled = sender.ReadShort();
            List<Channel> enabled = new List<Channel>();
            for (int i = 0; i < nEnabled; ++i)
                enabled.Add( (Channel)sender.ReadByte() );

            int nDisabled = sender.ReadShort();
            List<Channel> disabled = new List<Channel>();
            for (int i = 0; i < nDisabled; ++i)
                disabled.Add( (Channel)sender.ReadByte() );

            return new EnabledChannelsMessage(enabled, disabled);
        }
 public static GameMapMovementRequestMessage deserialize(Utils.Objects.Packet sender)
 {
     List<int> path = new List<int>();
     int nCells = sender.ReadShort();
     for (int i = 0; i < nCells; ++i)
         path.Add(sender.ReadCell());
     return new GameMapMovementRequestMessage(path, sender.ReadInt());
 }
Example #3
0
 public static BasicTimeMessage deserialize(Utils.Objects.Packet sender)
 {
     sender.ReadInt(); // timestamp
     sender.ReadShort(); // timezoneOffset
     return new BasicTimeMessage();
 }