public override async void Encode()
        {
            try
            {
                ClientAvatar Avatar = Player.GetPlayerAvatar();
                List <byte>  data   = new List <byte>();
                ClientHome   home   = new ClientHome(Avatar.GetId());

                home.SetShieldTime(Avatar.GetShieldTime);
                home.SetProtectionTime(Avatar.GetProtectionTime);
                home.SetHomeJSON(Player.SaveToJSON());

                data.AddInt32(0);
                data.AddInt32(-1);
                data.AddInt32((int)Player.GetTime().Subtract(new DateTime(1970, 1, 1)).TotalSeconds);
                data.AddRange(home.Encode());
                data.AddRange(await Avatar.Encode());
                if (Avatar.State == ClientAvatar.UserState.Editmode)
                {
                    data.AddInt32(1);
                }
                else
                {
                    data.AddInt32(0);
                }
                data.AddInt32(0);
                data.AddInt64(0);
                data.AddInt64(0);
                data.AddInt64(0);

                Encrypt(data.ToArray());
            } catch (Exception) { }
        }
示例#2
0
        internal override async void Encode()
        {
            try
            {
                ClientAvatar clientAvatar = this.Player.Avatar;

                this.Data.AddString(null);
                this.Data.Add(1);

                this.Data.AddLong(clientAvatar.UserId);

                this.Data.AddString(clientAvatar.UserToken);
                this.Data.AddRange(await clientAvatar.Encode());
            }
            catch (Exception) { }
        }