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) { } }
public override async void Encode() { try { ClientHome ownerHome = new ClientHome(Player.GetPlayerAvatar().GetId()); ownerHome.SetShieldTime(Player.GetPlayerAvatar().GetShieldTime); ownerHome.SetProtectionTime(Player.GetPlayerAvatar().GetProtectionTime); ownerHome.SetHomeJSON(JsonBase); List <byte> data = new List <byte>(); data.AddInt32(0); data.AddInt32((int)Player.GetTime().Subtract(new DateTime(1970, 1, 1)).TotalSeconds); data.AddRange(ownerHome.Encode()); data.AddRange(await Player.GetPlayerAvatar().Encode()); data.AddInt32(LevelId); Encrypt(data.ToArray()); } catch (Exception) { } }
public override async void Encode() { try { List <byte> data = new List <byte>(); ClientAvatar p = m_vVisitorLevel.GetPlayerAvatar(); p.State = ClientAvatar.UserState.Visiting; ClientHome ownerHome = new ClientHome(m_vOwnerLevel.GetPlayerAvatar().GetId()); ownerHome.SetShieldTime(m_vOwnerLevel.GetPlayerAvatar().GetShieldTime); ownerHome.SetProtectionTime(m_vOwnerLevel.GetPlayerAvatar().GetProtectionTime); ownerHome.SetHomeJSON(m_vOwnerLevel.SaveToJSON()); data.AddInt32(-1); data.AddInt32((int)TimeSpan.FromSeconds(100).TotalSeconds); data.AddRange(ownerHome.Encode()); data.AddRange(await m_vOwnerLevel.GetPlayerAvatar().Encode()); data.AddInt32(0); data.Add(1); data.AddRange(await m_vVisitorLevel.GetPlayerAvatar().Encode()); Encrypt(data.ToArray()); } catch (Exception) { } }
public override async void Encode() { try { List <byte> data = new List <byte>(); ClientHome ch = new ClientHome(m_vOwnerLevel.GetPlayerAvatar().GetId()); ch.SetShieldTime(m_vOwnerLevel.GetPlayerAvatar().GetShieldTime); ch.SetHomeJSON(m_vOwnerLevel.SaveToJSON()); ch.SetProtectionTime(m_vOwnerLevel.GetPlayerAvatar().GetProtectionTime); data.AddInt32((int)TimeSpan.FromSeconds(100).TotalSeconds); data.AddInt32(-1); data.AddInt32((int)Client.GetLevel().GetTime().Subtract(new DateTime(1970, 1, 1)).TotalSeconds); data.AddRange(ch.Encode()); data.AddRange(await m_vOwnerLevel.GetPlayerAvatar().Encode()); data.AddRange(await m_vVisitorLevel.GetPlayerAvatar().Encode()); data.AddInt32(3); data.AddInt32(0); data.Add(0); Encrypt(data.ToArray()); } catch (Exception) { } }