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

◆ Cleanup()

static void SEffectManager::Cleanup ( )
inlinestaticprotected

Cleanup method to properly clean up the static data.

Заметки
Will be called when MissionBase is destroyed

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

519 {
520 // Nothing to clean
521 if (!m_IsInitialized)
522 return;
523
524 m_IsCleanup = true;
525
526 // There should not be anything in here on server
527 if (GetGame() && GetGame().IsDedicatedServer())
528 {
529 if (m_ParamsMap.Count() > 0)
530 ErrorEx(string.Format("SEffectManager containing SoundParams on server."), ErrorExSeverity.WARNING);
531
532 if (m_EffectsMap.Count() > 0)
533 ErrorEx(string.Format("SEffectManager containing Effect on server."), ErrorExSeverity.WARNING);
534 }
535
536 // These are intentionally cached, just clear them
537 m_ParamsMap.Clear();
538
539 // These might not be intentionally still here, so log how many there are
540 #ifdef DEVELOPER
541 Print("--- SEffectManager Cleanup dump - Begin ------------------------");
542 Print(string.Format("Effect count: %1", m_EffectsMap.Count()));
543 #endif
544
545 // Best to call the unregister event before clearing the map
546 // In case some ref is still being held elsewhere and will still be kept alive
547 foreach (int id, Effect eff : m_EffectsMap)
548 {
549 eff.Event_OnUnregistered();
550 #ifdef SFXM_DUMP
551 Print(string.Format( "%1 :: %2 :: %3", eff, typename.EnumToString(EffectType, eff.GetEffectType()), eff.GetDebugName() ));
552 #endif
553 }
554
555 foreach (int i, EffecterBase effecter : m_EffectersMap)
556 {
557 effecter.Delete();
558 }
559
560 #ifdef DEVELOPER
561 Print("--- SEffectManager Cleanup dump - End --------------------------");
562 #endif
563
564 // Now we can clear it
565 m_EffectsMap.Clear();
566 m_EffectersMap.Clear();
567
568 // Reset the state
570 Event_OnFrameUpdate.Clear();
571 m_IsCleanup = false;
572 }
EffectType
Enum to determine what type of effect the Effect is.
Определения Effect.c:3
void Effect()
ctor
Определения Effect.c:70
void EffecterBase()
Определения EffectManager.c:690
static ref map< int, EffecterBase > m_EffectersMap
Определения EffectManager.c:26
static ref ScriptInvoker Event_OnFrameUpdate
Static invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay....
Определения EffectManager.c:24
static ref map< int, ref Effect > m_EffectsMap
Static map of all registered effects <id, Effect>
Определения EffectManager.c:8
static int m_HighestFreeEffectID
Counter for quickly getting the next ID if FreeEffectIDs array is empty.
Определения EffectManager.c:12
static bool m_IsCleanup
Bool to check whether Cleanup is happening, which means that the maps should no longer be accessed.
Определения EffectManager.c:16
static bool m_IsInitialized
Bool to check whether Init was called.
Определения EffectManager.c:18
static ref map< string, ref SoundParams > m_ParamsMap
Static map of cached sound params, to prevent having to recreate them.
Определения EffectManager.c:21
proto native CGame GetGame()
ErrorExSeverity
Определения EnDebug.c:62
proto void Print(void var)
Prints content of variable to console/log.
enum ShapeType ErrorEx

Перекрестные ссылки Effect(), EffecterBase(), ErrorEx, Event_OnFrameUpdate, GetGame(), m_EffectersMap, m_EffectsMap, m_HighestFreeEffectID, m_IsCleanup, m_IsInitialized, m_ParamsMap и Print().

Используется в MissionBaseWorld::MissionBase() и CGame::~CGame().