Пример #1
0
 private void SendNewTick(RealmTime time)
 {
     var sendEntities = new List<Entity>();
     foreach (Entity i in clientEntities)
     {
         if (i.UpdateCount > lastUpdate[i])
         {
             sendEntities.Add(i);
             lastUpdate[i] = i.UpdateCount;
         }
     }
     if (questEntity != null &&
         (!lastUpdate.ContainsKey(questEntity) || questEntity.UpdateCount > lastUpdate[questEntity]))
     {
         sendEntities.Add(questEntity);
         lastUpdate[questEntity] = questEntity.UpdateCount;
     }
     var p = new NewTickPacket();
     tickId++;
     p.TickId = tickId;
     p.TickTime = time.thisTickTimes;
     p.UpdateStatuses = sendEntities.Select(_ => _.ExportStats()).ToArray();
     client.SendPacket(p);
 }
 private void SendNewTick(RealmTime time)
 {
     var sendEntities = new List<Entity>();
     try
     {
         foreach (var i in clientEntities.Where(i => i.UpdateCount > lastUpdate[i]))
         {
             sendEntities.Add(i);
             lastUpdate[i] = i.UpdateCount;
         }
     }
     catch (Exception e)
     {
         log.Error(e);
     }
     if (Quest != null &&
         (!lastUpdate.ContainsKey(Quest) || Quest.UpdateCount > lastUpdate[Quest]))
     {
         sendEntities.Add(Quest);
         lastUpdate[Quest] = Quest.UpdateCount;
     }
     var p = new NewTickPacket();
     tickId++;
     p.TickId = tickId;
     p.TickTime = time.thisTickTimes;
     p.UpdateStatuses = sendEntities.Select(_ => _.ExportStats()).ToArray();
     Client.SendPacket(p);
 }
Пример #3
0
        private void SendNewTick(RealmTime time)
        {
            var sendEntities = new List<Entity>();
            try
            {
                foreach (var i in clientEntities)
                {
                    if (i.UpdateCount > lastUpdate[i])
                    {
                        sendEntities.Add(i);
                        lastUpdate[i] = i.UpdateCount;
                    }
                }
            }
            catch
            {
                Program.logger.Error("Crash halted - Nobody likes death...");
            }
            if (questEntity != null && (!lastUpdate.ContainsKey(questEntity) || questEntity.UpdateCount > lastUpdate[questEntity]))
            {
                sendEntities.Add(questEntity);
                lastUpdate[questEntity] = questEntity.UpdateCount;
            }
            NewTickPacket p = new NewTickPacket();
            tickId++;
            p.TickId = tickId;
            p.TickTime = time.thisTickTimes;
            p.UpdateStatuses = sendEntities.Select(_ => _.ExportStats()).ToArray();
            client.SendPacket(p);

            SaveToCharacter();
        }