private void CheckAction(PlugItem plugItem) { if (DateTime.Now < plugItem.NextRunTime) { return; } try { ThreadPool.QueueUserWorkItem((x) => { var pl = (PlugItem)x; try { pl.Item.RunOnce(); } catch (Exception ex) { WritePlugErrorLog(pl, ex); } }, plugItem); } finally { plugItem.NextRunTime = DateTime.Now.Add(plugItem.EachTime); } }
public bool DeepEquals(InventoryItemSocketsBlockIntrinsicSocket other) { return(other != null && DefaultVisible == other.DefaultVisible && PlugItem.DeepEquals(other.PlugItem) && SocketType.DeepEquals(other.SocketType)); }
public bool DeepEquals(PlugSetReusablePlugItem other) { return(other != null && Weight == other.Weight && AlternateWeight == other.AlternateWeight && PlugItem.DeepEquals(other.PlugItem) && CurrentlyCanRoll == other.CurrentlyCanRoll); }
private void WritePlugErrorLog(PlugItem plug, Exception ex) { if (DateTime.Now.Subtract(plug.LastErrorTime).TotalMinutes <= PlugErrorMin) { return; } plug.LastErrorTime = DateTime.Now; operationLogBll.AddLog(new Model.OperationLog() { Createtime = DateTime.Now, Module = "PlugManager", OperationName = "SYS", OperationTitle = plug.Item.ToString(), OperationContent = ex.Message, Id = 0 }); }