private static void UpdateAgentData(AgentItem ag, long logTime, ushort instid)
 {
     if (ag.InstID == 0)
     {
         ag.SetInstid(instid);
     }
     if (ag.FirstAware == 0)
     {
         ag.OverrideAwareTimes(logTime, logTime);
     }
     else
     {
         ag.OverrideAwareTimes(ag.FirstAware, logTime);
     }
 }
        private static bool UpdateAgentData(AgentItem ag, long logTime, ushort instid, bool checkInstid)
        {
            if (instid != 0)
            {
                if (ag.InstID == 0)
                {
                    ag.SetInstid(instid);
                }
                else if (checkInstid && ag.InstID != instid)
                {
                    return(false);
                }
            }

            if (ag.FirstAware == 0)
            {
                ag.OverrideAwareTimes(logTime, logTime);
            }
            else
            {
                ag.OverrideAwareTimes(Math.Min(ag.FirstAware, logTime), Math.Max(ag.LastAware, logTime));
            }
            return(true);
        }