public void Update(BasicTimeMessage msg) { if (msg == null) { throw new ArgumentNullException("msg"); } ServerTimeOffset = new TimeSpan(0, 0, msg.timezoneOffset, 0); ServerTimeReference = msg.timestamp.UnixTimestampToDateTime(); }
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; }
private void BasicTimeMessageHandler(DofusClient client, BasicTimeMessage message) { // }
public static void HandleBasicTimeMessage(Bot bot, BasicTimeMessage message) { bot.ClientInformations.Update(message); }