public override void Decode(ByteStream stream)
        {
            this.SessionId     = stream.ReadLongLong();
            this.AvatarChanges = new LogicArrayList <AvatarChange>();

            for (int i = stream.ReadVInt(); i > 0; i--)
            {
                this.AvatarChanges.Add(AvatarChangeFactory.Decode(stream));
            }

            this.LogicClientAvatar = new LogicClientAvatar();
            this.LogicClientAvatar.Decode(stream);

            if (stream.ReadBoolean())
            {
                this.ExecutedServerCommands = new LogicArrayList <LogicServerCommand>();

                for (int i = stream.ReadVInt(); i > 0; i--)
                {
                    this.ExecutedServerCommands.Add((LogicServerCommand)LogicCommandManager.DecodeCommand(stream));
                }

                this.SaveTime              = stream.ReadVInt();
                this.RemainingShieldTime   = stream.ReadVInt();
                this.RemainingGuardTime    = stream.ReadVInt();
                this.NextPersonalBreakTime = stream.ReadVInt();
                this.HomeJSON              = stream.ReadBytes(stream.ReadBytesLength(), 900000);
            }
        }
        public override void Encode(ByteStream stream)
        {
            stream.WriteLongLong(this.SessionId);
            stream.WriteVInt(this.AvatarChanges.Size());

            for (int i = 0; i < this.AvatarChanges.Size(); i++)
            {
                AvatarChangeFactory.Encode(stream, this.AvatarChanges[i]);
            }

            this.LogicClientAvatar.Encode(stream);

            if (this.HomeJSON != null)
            {
                stream.WriteBoolean(true);
                stream.WriteVInt(this.ExecutedServerCommands.Size());

                for (int i = 0; i < this.ExecutedServerCommands.Size(); i++)
                {
                    LogicCommandManager.EncodeCommand(stream, this.ExecutedServerCommands[i]);
                }

                stream.WriteVInt(this.SaveTime);
                stream.WriteVInt(this.RemainingShieldTime);
                stream.WriteVInt(this.RemainingGuardTime);
                stream.WriteVInt(this.NextPersonalBreakTime);
                stream.WriteBytes(this.HomeJSON, this.HomeJSON.Length);
            }
            else
            {
                stream.WriteBoolean(false);
            }
        }
Example #3
0
        public override void Decode(ByteStream stream)
        {
            this.MemberId      = stream.ReadLong();
            this.AvatarChanges = new LogicArrayList <AvatarChange>();

            for (int i = stream.ReadVInt(); i > 0; i--)
            {
                this.AvatarChanges.Add(AvatarChangeFactory.Decode(stream));
            }
        }
Example #4
0
        public override void Encode(ByteStream stream)
        {
            stream.WriteLong(this.MemberId);
            stream.WriteVInt(this.AvatarChanges.Size());

            for (int i = 0; i < this.AvatarChanges.Size(); i++)
            {
                AvatarChangeFactory.Encode(stream, this.AvatarChanges[i]);
            }
        }