DayZ 1.30
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 строка 527

528 {
529 // Nothing to clean
530 if (!m_IsInitialized)
531 return;
532
533 m_IsCleanup = true;
534
535 // There should not be anything in here on server
536 if (g_Game && g_Game.IsHeadlessOrDedicatedServer())
537 {
538 if (m_ParamsMap.Count() > 0)
539 ErrorEx(string.Format("SEffectManager containing SoundParams on server."), ErrorExSeverity.WARNING);
540
541 if (m_EffectsMap.Count() > 0)
542 ErrorEx(string.Format("SEffectManager containing Effect on server."), ErrorExSeverity.WARNING);
543 }
544
545 // These are intentionally cached, just clear them
546 m_ParamsMap.Clear();
547
548 // These might not be intentionally still here, so log how many there are
549 #ifdef DEVELOPER
550 Print("--- SEffectManager Cleanup dump - Begin ------------------------");
551 Print(string.Format("Effect count: %1", m_EffectsMap.Count()));
552 #endif
553
554 // Best to call the unregister event before clearing the map
555 // In case some ref is still being held elsewhere and will still be kept alive
556 foreach (int id, Effect eff : m_EffectsMap)
557 {
558 eff.Event_OnUnregistered();
559 #ifdef SFXM_DUMP
560 Print(string.Format( "%1 :: %2 :: %3", eff, typename.EnumToString(EffectType, eff.GetEffectType()), eff.GetDebugName() ));
561 #endif
562 }
563
564 foreach (int i, EffecterBase effecter : m_EffectersMap)
565 {
566 effecter.Delete();
567 }
568
569 #ifdef DEVELOPER
570 Print("--- SEffectManager Cleanup dump - End --------------------------");
571 #endif
572
573 // Now we can clear it
574 m_EffectsMap.Clear();
575 m_EffectersMap.Clear();
576
577 // Reset the state
579 Event_OnFrameUpdate.Clear();
580 m_IsCleanup = false;
581 }
DayZGame g_Game
Определения DayZGame.c:4074
EffectType
Enum to determine what type of effect the Effect is.
Определения Effect.c:3
void Effect()
ctor
Определения Effect.c:72
void EffecterBase()
Определения EffectManager.c:704
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
ErrorExSeverity
Определения EnDebug.c:62
proto void Print(void var)
Prints content of variable to console/log.
enum ShapeType ErrorEx

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

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