DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ TickNotifiers()

void TickNotifiers ( )
private

См. определение в файле NotifiersManager.c строка 113

114 {
115 int notifierCount = m_Notifiers.Count();
116 #ifdef DIAG_NOTIFIER_LOGS
117 if (notifierCount == 0)
118 {
119 ErrorEx("Notifier count is 0", ErrorExSeverity.ERROR);
120 return;
121 }
122 #endif
123
124 // Wrap around if we've reached the end
125 if (m_LastPolledIndex >= notifierCount)
126 {
127 #ifdef DIAG_NOTIFIER_LOGS
128 ErrorEx(string.Format("Last poll index is %1 and notifiers count is %2. Restet poll index!", m_LastPolledIndex, notifierCount), ErrorExSeverity.INFO);
129 #endif
131 }
132
133 int notifierID = m_NotifierIDs[m_LastPolledIndex];
134 #ifdef DIAG_NOTIFIER_LOGS
135 ErrorEx(string.Format("Got notifier ID %1 for poll index %2.", notifierID, m_LastPolledIndex), ErrorExSeverity.INFO);
136 #endif
137 // Get current notifier to process
138 NotifierBase currentNotifier = m_NotifiersStatic[notifierID];
139 if (currentNotifier && currentNotifier.IsActive())
140 {
141 #ifdef DIAG_NOTIFIER_LOGS
142 ErrorEx(string.Format("Got notifier %1 with ID %2.", currentNotifier, notifierID), ErrorExSeverity.INFO);
143 #endif
144 int currentTime = g_Game.GetTime();
145
146 // Only tick if it's time (using the notifier's own interval)
147 if (currentNotifier.IsTimeToTick(currentTime))
148 {
149 #ifdef DIAG_NOTIFIER_LOGS
150 ErrorEx(string.Format("Time to tick notifier %1.", currentNotifier), ErrorExSeverity.INFO);
151 #endif
152 currentNotifier.OnTick(currentTime);
153 }
154 #ifdef DIAG_NOTIFIER_LOGS
155 else
156 {
157 ErrorEx(string.Format("Skip tick of notifier %1 ..", currentNotifier), ErrorExSeverity.INFO);
158 }
159 #endif
160 }
161 #ifdef DIAG_NOTIFIER_LOGS
162 else
163 {
164 if (!currentNotifier)
165 ErrorEx(string.Format("Could not get any notifier with ID %1.", notifierID), ErrorExSeverity.ERROR);
166 else
167 ErrorEx(string.Format("Could get notifier %1 with ID %2 but notifier is inactive!", currentNotifier, notifierID), ErrorExSeverity.INFO);
168 }
169 #endif
170
171 // Move to next notifier for next tick
173 }
DayZGame g_Game
Определения DayZGame.c:3942
ref array< int > m_NotifierIDs
Определения NotifiersManager.c:35
NotifierBase m_NotifiersStatic[MAX_COUNT]
Определения NotifiersManager.c:29
ref array< ref NotifierBase > m_Notifiers
Определения NotifiersManager.c:28
int m_LastPolledIndex
Определения NotifiersManager.c:34
void OnTick(float current_Time)
Определения NotifierBase.c:147
bool IsActive()
Определения NotifierBase.c:64
bool IsTimeToTick(int current_time)
Определения NotifierBase.c:32
Определения NotifierBase.c:2
ErrorExSeverity
Определения EnDebug.c:62
enum ShapeType ErrorEx

Перекрестные ссылки ErrorEx, g_Game, NotifierBase::IsActive(), NotifierBase::IsTimeToTick(), m_LastPolledIndex, m_NotifierIDs, m_Notifiers, m_NotifiersStatic и NotifierBase::OnTick().

Используется в OnScheduledTick().