本文整理汇总了C#中GameClients.GetHabboDataContainer方法的典型用法代码示例。如果您正苦于以下问题:C# GameClients.GetHabboDataContainer方法的具体用法?C# GameClients.GetHabboDataContainer怎么用?C# GameClients.GetHabboDataContainer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameClients
的用法示例。
在下文中一共展示了GameClients.GetHabboDataContainer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SerializeClub
internal void SerializeClub(ServerMessage Message, GameClients.GameClient Session)
{
try
{
Message.AddInt32((int)this.ID);
Message.AddString(catalogName);
Message.AddInt32(this.creditCost);
Message.AddBoolean(true); // don't know
int Days = 0;
int Months = 0;
if (catalogName.Contains("HABBO_CLUB_VIP_"))
{
if (catalogName.Contains("_DAY"))
{
Days = int.Parse(catalogName.Split('_')[3]);
}
else if (catalogName.Contains("_MONTH"))
{
Months = int.Parse(catalogName.Split('_')[3]);
Days = 31 * Months;
}
}
else if (catalogName.Equals("deal_vip_1_year_and_badge"))
{
Months = 12;
Days = 31 * Months;
}
else if (catalogName.Equals("HABBO_CLUB_VIP_5_YEAR"))
{
Months = 5 * 12;
Days = 31 * Months;
}
DateTime future = DateTime.Now;
if (Session.GetHabboDataContainer().GetSubscriptionManager().HasSubscription())
{
Double Expire = Session.GetHabboDataContainer().GetSubscriptionManager().GetSubscription().ExpireTime;
Double TimeLeft = Expire - ButterflyEnvironment.GetUnixTimestamp();
int TotalDaysLeft = (int)Math.Ceiling(TimeLeft / 86400);
future = DateTime.Now.AddDays(TotalDaysLeft);
}
future = future.AddDays(Days);
Message.AddInt32(Months); // months
Message.AddInt32(Days); // days
Message.AddInt32(Days); // wtf
Message.AddInt32(future.Year); // year
Message.AddInt32(future.Month); // month
Message.AddInt32(future.Day); // day
}
catch
{
//Console.WriteLine("Unable to load club item " + Id + ": " + Name);
}
}