23 for ( i = 0; i < m_PluginsPtrs.Count(); ++i)
25 plugin = m_PluginsPtrs.GetElement(i);
46 RegisterPlugin(
"PluginHorticulture",
true,
true );
47 RegisterPlugin(
"PluginRepairing",
true,
true );
48 RegisterPlugin(
"PluginPlayerStatus",
true,
true );
49 RegisterPlugin(
"PluginMessageManager",
true,
true );
50 RegisterPlugin(
"PluginLifespan",
true,
true );
51 RegisterPlugin(
"PluginVariables",
true,
true );
52 RegisterPlugin(
"PluginObjectsInteractionManager",
false,
true );
53 RegisterPlugin(
"PluginRecipesManager",
true,
true );
54 RegisterPlugin(
"PluginTransmissionAgents",
true,
true );
55 RegisterPlugin(
"PluginAdditionalInfo",
true,
true );
56 RegisterPlugin(
"PluginConfigEmotesProfile",
true,
true );
57 RegisterPlugin(
"PluginPresenceNotifier",
true,
false );
58 RegisterPlugin(
"PluginAdminLog",
false,
true );
61 RegisterPluginDiag(
"PluginKeyBinding",
true,
false );
62 RegisterPluginDiag(
"PluginDeveloper",
true,
true );
63 RegisterPluginDiag(
"PluginDeveloperSync",
true,
true );
64 RegisterPluginDiag(
"PluginDiagMenuClient",
true,
false );
65 RegisterPluginDiag(
"PluginDiagMenuServer",
false,
true );
66 RegisterPluginDiag(
"PluginPermanentCrossHair",
true,
false );
67 RegisterPluginDiag(
"PluginRemotePlayerDebugClient",
true,
false );
68 RegisterPluginDiag(
"PluginRemotePlayerDebugServer",
false,
true );
69 RegisterPluginDiag(
"PluginUniversalTemperatureSourceClient",
true,
false );
70 RegisterPluginDiag(
"PluginUniversalTemperatureSourceServer",
false,
true );
71 RegisterPluginDiag(
"PluginDrawCheckerboard",
true,
false );
72 RegisterPluginDiag(
"PluginItemDiagnostic",
true,
true );
73 RegisterPluginDiag(
"PluginDayZCreatureAIDebug",
true,
true );
76 RegisterPluginDebug(
"PluginConfigViewer",
true,
true );
77 RegisterPluginDebug(
"PluginLocalEnscriptHistory",
true,
true );
78 RegisterPluginDebug(
"PluginLocalEnscriptHistoryServer",
true,
true );
80 RegisterPluginDebug(
"PluginSceneManager",
true,
true );
81 RegisterPluginDebug(
"PluginConfigScene",
true,
true );
82 RegisterPluginDebug(
"PluginMissionConfig",
true,
true );
83 RegisterPluginDebug(
"PluginConfigEmotesProfile",
true,
true );
84 RegisterPluginDebug(
"PluginConfigDebugProfile",
true,
true );
85 RegisterPluginDebug(
"PluginConfigDebugProfileFixed",
true,
true );
87 RegisterPluginDebug(
"PluginDayzPlayerDebug",
true,
true );
88 RegisterPluginDebug(
"PluginDayZInfectedDebug",
true,
true );
89 RegisterPluginDebug(
"PluginDoorRuler",
true,
false );
90 RegisterPluginDebug(
"PluginCharPlacement",
true,
false );
92 RegisterPluginDebug(
"PluginCameraTools",
true,
true );
93 RegisterPluginDebug(
"PluginNutritionDumper",
true,
false );
104 int regCount = m_PluginRegister.Count();
107 pluginPtrs.Reserve(regCount);
109 foreach (
typename pluginType : m_PluginRegister)
111 PluginBase moduleExist = GetPluginByType( pluginType );
114 m_PluginsPtrs.Remove( pluginType );
118 m_PluginsPtrs.Set(pluginType, moduleNew);
119 pluginPtrs.Insert(moduleNew);
134 void MainOnUpdate(
float delta_time)
136 for (
int i = 0; i < m_PluginsPtrs.Count(); ++i)
138 PluginBase plugin = m_PluginsPtrs.GetElement(i);
139 if ( plugin != NULL )
141 plugin.OnUpdate(delta_time);
157 PluginBase GetPluginByType(
typename plugin_type )
159 if ( m_PluginsPtrs.Contains( plugin_type ) )
161 return m_PluginsPtrs.Get( plugin_type );
183 protected void RegisterPlugin(
string plugin_class_name,
bool reg_on_client,
bool reg_on_server,
bool reg_on_release =
true )
185 if ( !reg_on_client )
193 if ( !reg_on_server )
195 if (
GetGame().IsMultiplayer() )
204 if ( !reg_on_release )
212 m_PluginRegister.Insert( plugin_class_name.ToType() );
231 protected void RegisterPluginDebug(
string plugin_class_name,
bool reg_on_client,
bool reg_on_server )
233 RegisterPlugin(plugin_class_name, reg_on_client, reg_on_server,
false);
238 protected void RegisterPluginDiag(
string plugin_class_name,
bool reg_on_client,
bool reg_on_server )
240 #ifdef DIAG_DEVELOPER
241 RegisterPlugin(plugin_class_name, reg_on_client, reg_on_server,
true);
250 protected bool UnregisterPlugin(
string plugin_class_name )
252 typename plugin_type = plugin_class_name.ToType();
254 if ( m_PluginRegister.Find( plugin_type ) != -1 )
256 m_PluginRegister.RemoveItem( plugin_type );
324 if ( plugin ==
null )
326 #ifdef DIAG_DEVELOPER
329 PrintString(
"Module " + plugin_type.ToString() +
" is not Registred in PluginManager.c!");
343 return (
GetPlugin(plugin_type) != NULL );