예제 #1
0
        public static bool TryGetAttrValue(this XmlNode node, string name, out DateTime result)
        {
            long timestamp;

            if (node.TryGetAttrValue(name, out timestamp))
            {
                result = TimeUtils.ConvertFromUnixTimestamp(timestamp);
                return(true);
            }
            else
            {
                var dateStr = string.Empty;
                if (node.TryGetAttrValue(name, out dateStr))
                {
                    if (DateTime.TryParseExact(dateStr, "yyyy-MM-dd HH-mm", CultureInfo.InvariantCulture, DateTimeStyles.None, out result))
                    {
                        return(true);
                    }
                    else if (DateTime.TryParseExact(dateStr, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out result))
                    {
                        return(true);
                    }
                }
            }
            result = DateTime.MinValue;
            return(false);
        }
예제 #2
0
 public override void Decode(BinaryReader reader)
 {
     errorCode = reader.ReadInt16();
     if (Succeeded)
     {
         MailId = reader.ReadInt32();
         int time = reader.ReadInt32();
         ReceiveTime = TimeUtils.ConvertFromUnixTimestamp(time);
         Content     = ReadString(reader);
         int count = reader.ReadByte();
         Attachments = new List <MailAttachmentVo>();
         for (int i = 0; i < count; i++)
         {
             MailAttachmentVo mav = new MailAttachmentVo();
             mav.itemId = ReadString(reader);
             mav.amount = reader.ReadInt32();
             Attachments.Add(mav);
         }
     }
 }
예제 #3
0
    public static void CheckMonthCard()
    {
        DateTime lastTime = TimeUtils.ConvertFromUnixTimestamp(PlayerInfo.Instance.lastMonthCardTime);

        DateTime BeginDay = new DateTime(lastTime.Year, lastTime.Month, lastTime.Day);
        TimeSpan span     = TimeUtils.GetPSTDateTime() - BeginDay;

        if (span.Days >= 1)
        {
            PlayerInfo.Instance.haveClaimMonthCardToday = false;
            PreMonthCard();
        }
        else
        {
            //if(!PlayerInfoManager.Singleton.AccountProfile._haveClaimMonthCardToday)
            {
                PreMonthCard();
            }
        }
    }
예제 #4
0
 public override void Decode(BinaryReader reader)
 {
     errorCode = reader.ReadInt16();
     if (Succeeded)
     {
         MaxMailId = reader.ReadInt32();
         int num = reader.ReadInt16();
         MailVos = new MailVo[num];
         for (int i = 0; i < num; i++)
         {
             MailVo mv = new MailVo();
             mv.MailId = reader.ReadInt32();
             mv.Title  = ReadString(reader);
             int status = reader.ReadByte();
             mv.HasRead     = (status & (1 << 0)) != 0;
             mv.Collectable = (status & (1 << 1)) != 0;
             int expireTime = reader.ReadInt32();
             mv.ExpireTime = TimeUtils.ConvertFromUnixTimestamp(expireTime);
             mv.IsComplete = false;
             MailVos[i]    = mv;
         }
     }
 }