コード例 #1
0
 public void Update(BasicTimeMessage msg)
 {
     if (msg == null)
     {
         throw new ArgumentNullException("msg");
     }
     ServerTimeOffset    = new TimeSpan(0, 0, msg.timezoneOffset, 0);
     ServerTimeReference = msg.timestamp.UnixTimestampToDateTime();
 }
コード例 #2
0
        public static void BasicTimeMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            BasicTimeMessage btmsg = (BasicTimeMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                btmsg.Deserialize(reader);
            }
            //double serverTimeLag = btmsg.timestamp + btmsg.timezoneOffset * 60 * 1000; // - ((new DateTime(1970, 1, 1, 0, 0, 0, System.DateTimeKind.Utc) - DateTime.MinValue) + DateTime.MinValue).TotalMilliseconds;
            //DateTime epoch = new System.DateTime(1970, 1, 1, 0, 0, 0, System.DateTimeKind.Utc);
            ////System.DateTime date = System.DateTime.FromOADate(msg.subscriptionEndDate);
            ////epoch.AddSeconds(msg.subscriptionEndDate / 1000) + 3600);
            //epoch = epoch.AddMilliseconds(account.serverTimeLag + serverTimeLag);
            //if (epoch.Minute > 0)
            //{
            //    // account.AboDofLabel.Text = date.Date.ToString();
            //    account.Log(new BotTextInformation(epoch.Date.ToShortDateString()), 0);
            //}
            //account.serverTimeLag = serverTimeLag;
        }
コード例 #3
0
 private void BasicTimeMessageHandler(DofusClient client, BasicTimeMessage message)
 {
     //
 }
コード例 #4
0
 public static void HandleBasicTimeMessage(Bot bot, BasicTimeMessage message)
 {
     bot.ClientInformations.Update(message);
 }