Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
game.c
Go to the documentation of this file.
1 
5 static int GAME_STORAGE_VERSION = 135;
6 
7 class CGame
8 {
9  // enableDebugMonitor in server config
10  int m_DebugMonitorEnabled;
11 
12  ScriptModule GameScript;
13 
14  private ref array<ref Param> m_ParamCache;
15 
16  //analytics
17  ref AnalyticsManagerServer m_AnalyticsManagerServer;
18  ref AnalyticsManagerClient m_AnalyticsManagerClient;
19  ref MenuDefaultCharacterData m_CharacterData;
20 
21  #ifdef DIAG_DEVELOPER
22  ref array<ComponentEnergyManager> m_EnergyManagerArray;
23  void EnableEMPlugs(bool enable)
24  {
25  for (int i = 0; i < GetGame().m_EnergyManagerArray.Count(); ++i)
26  {
27  if (GetGame().m_EnergyManagerArray[i])
28  GetGame().m_EnergyManagerArray[i].SetDebugPlugs(enable);
29  }
30  }
31  #endif
32 
33  void CGame()
34  {
35  Math.Randomize(-1);
36 
37  LogManager.Init();
38  m_ParamCache = new array<ref Param>;
39  m_ParamCache.Insert(null);
40 
41  //analytics
42  m_AnalyticsManagerServer = new AnalyticsManagerServer;
43  m_AnalyticsManagerClient = new AnalyticsManagerClient;
44 
45  //m_CharacterData = new MenuCharacrerData;
46 
47  // actual script version - increase by one when you make changes
48  StorageVersion(GAME_STORAGE_VERSION);
49 
50  #ifdef DIAG_DEVELOPER
51  m_EnergyManagerArray = new array<ComponentEnergyManager>;
52  #endif
53 
54  if (!IsDedicatedServer())
55  {
56  SEffectManager.Init();
57  AmmoEffects.Init();
58  VONManager.Init();
59  }
60  }
61 
62  private void ~CGame()
63  {
64  // Clean these up even if it is dedicated server, just to be safe
65  SEffectManager.Cleanup();
66  AmmoEffects.Cleanup();
67  VONManager.CleanupInstance();
68 
69  // Is initialized in StartupEvent
70  ParticleManager.CleanupInstance();
71  }
72 
73  proto native WorkspaceWidget GetWorkspace();
74  proto native WorkspaceWidget GetLoadingWorkspace();
75 
77 
82  void OnEvent(EventType eventTypeId, Param params)
83  {
84  }
85 
86  //PLM Type: 0 == RESUMED, 1 == SUSPENDED
87  void OnProcessLifetimeChanged(int plmtype)
88  {
89 
90  }
91 
92  void OnLicenseChanged()
93  {
94 
95  }
96 
100  void OnAfterCreate()
101  {
102  }
103 
107  void OnActivateMessage()
108  {
109  }
110 
114  void OnDeactivateMessage()
115  {
116  }
117 
121  bool OnInitialize()
122  {
123  return false;
124  }
125 
129  void OnDeviceReset()
130  {
131  }
132 
138  void OnUpdate(bool doSim, float timeslice)
139  {
140  }
141 
147  void OnPostUpdate(bool doSim, float timeslice)
148  {
149  }
150 
155  void OnKeyPress(int key)
156  {
157  }
158 
163  void OnKeyRelease(int key)
164  {
165  }
166 
171  void OnMouseButtonPress(int button)
172  {
173  }
174 
179  void OnMouseButtonRelease(int button)
180  {
181  }
182 
186  UIScriptedMenu CreateScriptedMenu( int id ) { }
187 
191  UIScriptedWindow CreateScriptedWindow( int id ) { }
192 
199  void OnRPC(PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx)
200  {
201  }
202 
206  proto native void RequestExit( int code );
207 
211  proto native void RequestRestart(int code);
212 
216  proto native bool IsAppActive();
217 
221  proto bool GetHostAddress( out string address, out int port );
222 
226  proto owned string GetHostName();
227 
231  proto GetServersResultRow GetHostData();
232 
240  proto native int Connect( UIScriptedMenu parent , string IpAddress, int port, string password );
245  proto native int ConnectLastSession( UIScriptedMenu parent , int selectedCharacter = -1 );
249  proto native void DisconnectSession();
250 
254  proto native void DisconnectSessionForce();
255 
256  // profile functions
267  proto native void GetProfileStringList(string name, out TStringArray values);
268 
275  proto bool GetProfileString(string name, out string value);
276 
282  proto native void SetProfileStringList(string name, TStringArray values);
283 
289  proto native void SetProfileString(string name, string value);
290 
294  proto native void SaveProfile();
295 
300  proto void GetPlayerName(out string name);
301 
307  proto void GetPlayerNameShort(int maxLength, out string name);
308 
313  proto native void SetPlayerName(string name);
314 
320  proto native Entity CreatePlayer(PlayerIdentity identity, string name, vector pos, float radius, string spec);
321 
328  proto native void SelectPlayer(PlayerIdentity identity, Object player);
329 
337  proto void GetPlayerNetworkIDByIdentityID( int playerIdentityID, out int networkIdLowBits, out int networkIdHightBits );
338 
344  proto native Object GetObjectByNetworkId( int networkIdLowBits, int networkIdHighBits );
345 
351  proto native bool RegisterNetworkStaticObject(Object object);
352 
359  proto native void SelectSpectator(PlayerIdentity identity, string spectatorObjType, vector position);
360 
365  proto native void UpdateSpectatorPosition(vector position);
366 
373  proto native void SendLogoutTime(Object player, int time);
374 
379  proto native void DisconnectPlayer(PlayerIdentity identity, string uid = "");
380 
386  proto native void AddToReconnectCache(PlayerIdentity identity);
387 
393  proto native void RemoveFromReconnectCache(string uid);
394 
399  proto native void ClearReconnectCache();
400 
401 
405  proto native void StorageVersion( int iVersion );
406 
410  proto native int LoadVersion();
411 
415  proto native int SaveVersion();
416 
420  proto native float GetDayTime();
421 
422  // config functions
429  proto bool ConfigGetText(string path, out string value);
430 
438  proto bool ConfigGetTextRaw(string path, out string value);
439 
445  string ConfigGetTextOut(string path)
446  {
447  string ret_s;
448  ConfigGetText(path, ret_s);
449  return ret_s;
450  }
451 
457  bool FormatRawConfigStringKeys(inout string value)
458  {
459  int ret;
460  ret = value.Replace("$STR_","#STR_");
461  return ret > 0;
462  }
463 
469  string GetModelName(string class_name)
470  {
471  if ( class_name != "" )
472  {
473  string cfg = "CfgVehicles " + class_name + " model";
474  string model_path;
475  if ( GetGame().ConfigGetText(cfg, model_path) )
476  {
477  int to_substring_end = model_path.Length() - 4; // -4 to leave out the '.p3d' suffix
478  int to_substring_start = 0;
479 
480  // Currently we have model path. To get the name out of it we need to parse this string from the end and stop at the first found '\' sign
481  for (int i = to_substring_end; i > 0; i--)
482  {
483  string sign = model_path.Get(i);
484  if ( sign == "\\" )
485  {
486  to_substring_start = i + 1;
487  break
488  }
489  }
490 
491  string model_name = model_path.Substring(to_substring_start, to_substring_end - to_substring_start);
492  return model_name;
493  }
494  }
495 
496  return "UNKNOWN_P3D_FILE";
497  }
498 
504  proto native float ConfigGetFloat(string path);
505 
506 
512  proto native vector ConfigGetVector(string path);
513 
519  proto native int ConfigGetInt(string path);
520 
526  proto native int ConfigGetType(string path);
527 
538  proto native void ConfigGetTextArray(string path, out TStringArray values);
539 
551  proto native void ConfigGetTextArrayRaw(string path, out TStringArray values);
552 
558  proto native void ConfigGetFloatArray(string path, out TFloatArray values);
559 
565  proto native void ConfigGetIntArray(string path, out TIntArray values);
566 
574  proto bool ConfigGetChildName(string path, int index, out string name);
575 
582  proto bool ConfigGetBaseName(string path, out string base_name);
583 
591  proto native int ConfigGetChildrenCount(string path);
592  proto native bool ConfigIsExisting(string path);
593 
594  proto native void ConfigGetFullPath(string path, out TStringArray full_path);
595  proto native void ConfigGetObjectFullPath(Object obj, out TStringArray full_path);
596 
597  proto native void GetModInfos(notnull out array<ref ModInfo> modArray);
598  proto native bool GetModToBeReported();
599 
608  string ConfigPathToString(TStringArray array_path)
609  {
610  string return_path = "";
611  int count = array_path.Count();
612 
613  for (int i = 0; i < count; i++)
614  {
615  return_path += array_path.Get(i);
616 
617  if ( i < count - 1 )
618  {
619  return_path += " ";
620  }
621  }
622 
623  return return_path;
624  }
625 
641  proto bool CommandlineGetParam(string name, out string value);
642 
643  proto native void CopyToClipboard(string text);
644  proto void CopyFromClipboard(out string text);
645 
646  proto native void BeginOptionsVideo();
647  proto native void EndOptionsVideo();
648 
649  proto native void AdminLog(string text);
650 
651  // entity functions
658  proto native bool PreloadObject( string type, float distance );
659 
660  proto native Object CreateStaticObjectUsingP3D(string p3dFilename, vector position, vector orientation, float scale = 1.0, bool createLocal = false);
661 
671  proto native Object CreateObject( string type, vector pos, bool create_local = false, bool init_ai = false, bool create_physics = true );
672  proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local = false);
673  proto native SoundWaveOnVehicle CreateSoundWaveOnObject(Object source, SoundObject soundObject, AbstractWave soundWave);
674 
683  proto native Object CreateObjectEx( string type, vector pos, int iFlags, int iRotation = RF_DEFAULT );
684 
685  proto native void ObjectDelete( Object obj );
686  proto native void ObjectDeleteOnClient( Object obj );
687  proto native void RemoteObjectDelete( Object obj );
688  proto native void RemoteObjectTreeDelete( Object obj );
689  proto native void RemoteObjectCreate( Object obj );
690  proto native void RemoteObjectTreeCreate( Object obj );
691  proto native int ObjectRelease( Object obj );
692  proto void ObjectGetType( Object obj, out string type );
693  proto void ObjectGetDisplayName( Object obj, out string name );
694  proto native vector ObjectGetSelectionPosition(Object obj, string name);
695  proto native vector ObjectGetSelectionPositionLS(Object obj, string name);
696  proto native vector ObjectGetSelectionPositionMS(Object obj, string name);
697  proto native vector ObjectGetSelectionPositionWS(Object obj, string name);
698  proto native vector ObjectModelToWorld(Object obj, vector modelPos);
699  proto native vector ObjectWorldToModel(Object obj, vector worldPos);
701  proto native bool IsObjectAccesible(EntityAI item, Man player);
702 
703  // input
704  proto native Input GetInput();
705 
706  // camera
707  proto native vector GetCurrentCameraPosition();
708  proto native vector GetCurrentCameraDirection();
709 
710  // sound
711  proto native AbstractSoundScene GetSoundScene();
712 
713  // noise
714  proto native NoiseSystem GetNoiseSystem();
715 
716  // inventory
717  proto native bool AddInventoryJuncture(Man player, notnull EntityAI item, InventoryLocation dst, bool test_dst_occupancy, int timeout_ms);
718 
719  bool AddInventoryJunctureEx(Man player, notnull EntityAI item, InventoryLocation dst, bool test_dst_occupancy, int timeout_ms)
720  {
721  bool result = AddInventoryJuncture(player, item, dst, test_dst_occupancy, timeout_ms/*10000000*/);
722  #ifdef DEVELOPER
723  if ( LogManager.IsInventoryReservationLogEnable() )
724  {
725  Debug.InventoryReservationLog("STS = " + player.GetSimulationTimeStamp() + " result: " + result + " item:" + item + " dst: " + InventoryLocation.DumpToStringNullSafe(dst), "n/a" , "n/a", "AddInventoryJuncture",player.ToString() );
726  }
727  #endif
728  //Print("Juncture - STS = " + player.GetSimulationTimeStamp() + " item:" + item + " dst: " + InventoryLocation.DumpToStringNullSafe(dst));
729  return result;
730  }
731 
732  //Has inventory juncture for any player
733  proto native bool HasInventoryJunctureItem(notnull EntityAI item);
734 
735  proto native bool HasInventoryJunctureDestination(Man player, notnull InventoryLocation dst);
736  proto native bool AddActionJuncture(Man player, notnull EntityAI item, int timeout_ms);
737  proto native bool ExtendActionJuncture(Man player, notnull EntityAI item, int timeout_ms);
738  proto native bool ClearJuncture(Man player, notnull EntityAI item);
739 
740  bool ClearJunctureEx(Man player, notnull EntityAI item)
741  {
742  #ifdef DEVELOPER
743  if ( LogManager.IsInventoryReservationLogEnable() )
744  {
745  Debug.InventoryReservationLog("STS = " + player.GetSimulationTimeStamp()+ " item:" + item, "n/a" , "n/a", "ClearJuncture",player.ToString() );
746  }
747  #endif
748  return ClearJuncture( player, item);
749  }
750 
751  // support
753  proto native bool ExecuteEnforceScript(string expression, string mainFnName);
755  proto native void DumpInstances(bool csvFormatting);
756 
757  proto native bool ScriptTest();
759  proto native void GetDiagModeNames(out TStringArray diag_names);
761  proto native void SetDiagModeEnable(int diag_mode, bool enabled);
763  proto native bool GetDiagModeEnable(int diag_mode);
764 
766  proto native void GetDiagDrawModeNames(out TStringArray diag_names);
768  proto native void SetDiagDrawMode(int diag_draw_mode);
770  proto native int GetDiagDrawMode();
771 
773  proto native bool IsPhysicsExtrapolationEnabled();
774 
779  proto native float GetFps();
780 
785  proto native float GetTickTime();
786 
787  proto void GetInventoryItemSize(InventoryItem item, out int width, out int height);
794  proto native void GetObjectsAtPosition(vector pos, float radius, out array<Object> objects, out array<CargoBase> proxyCargos);
801  proto native void GetObjectsAtPosition3D(vector pos, float radius, out array<Object> objects, out array<CargoBase> proxyCargos);
802  proto native World GetWorld();
803  proto void GetWorldName( out string world_name );
804 
805  string GetWorldName()
806  {
807  string world_name;
808  g_Game.GetWorldName(world_name);
809  return world_name;
810  }
811 
812  proto native bool VerifyWorldOwnership( string sWorldName );
813  proto native bool GoBuyWorldDLC( string sWorldName );
814 
815  proto void FormatString( string format, string params[], out string output);
816  proto void GetVersion( out string version );
817  proto native UIManager GetUIManager();
818  proto native DayZPlayer GetPlayer();
819  proto native void GetPlayers( out array<Man> players );
820  DayZPlayer GetPlayerByIndex(int index = 0)
821  {
822  array<Man> players();
823  GetPlayers(players);
824  if (index >= players.Count())
825  return null;
826  return DayZPlayer.Cast(players[index]);
827  }
828 
830  proto native void StoreLoginData(ParamsWriteContext ctx);
831 
833  proto native vector GetPointerDirection();
835  proto native vector GetWorldDirectionFromScreen(vector world_pos);
837  proto native vector GetScreenPos(vector world_pos);
839  proto native vector GetScreenPosRelative(vector world_pos);
840 
842  proto native MenuData GetMenuData();
885  proto native void RPC(Object target, int rpcType, notnull array<ref Param> params, bool guaranteed,PlayerIdentity recipient = null);
887  void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient = null)
888  {
889  m_ParamCache.Set(0, param);
890  RPC(target, rpc_type, m_ParamCache, guaranteed, recipient);
891  }
893  proto native void RPCSelf(Object target, int rpcType, notnull array<ref Param> params);
894  void RPCSelfSingleParam(Object target, int rpcType, Param param)
895  {
896  m_ParamCache.Set(0, param);
897  RPCSelf(target, rpcType, m_ParamCache);
898  }
899 
901  proto native void ProfilerStart(string name);
903  proto native void ProfilerStop(string name);
904 
905 
915  proto native void Chat(string text, string colorClass);
916  proto native void ChatMP(Man recipient, string text, string colorClass);
917  proto native void ChatPlayer(string text);
923  proto native void MutePlayer(string muteUID, string playerUID, bool mute);
924 
930  proto native void MuteAllPlayers(string listenerId, bool mute);
931 
937  proto native void EnableVoN(Object player, bool enable);
938 
945  proto native void SetVoiceEffect(Object player, int effect, bool enable);
946 
951  proto native void SetVoiceLevel(int level);
952 
956  proto native int GetVoiceLevel(Object player = null);
957 
962  proto native void EnableMicCapture(bool enable);
963 
967  proto native bool IsMicCapturing();
968 
972  proto native bool IsInPartyChat();
973 
974  // mission
975  proto native Mission GetMission();
976  proto native void SetMission(Mission mission);
977 
978 
980  proto native void StartRandomCutscene(string world);
982  proto native void PlayMission(string path);
983 
985  proto protected native void CreateMission(string path);
986  proto native void RestartMission();
988  proto native void AbortMission();
989  proto native void RespawnPlayer();
990  proto native bool CanRespawnPlayer();
991  proto native void SetLoginTimerFinished();
992 
993  proto native void SetMainMenuWorld(string world);
994  proto native owned string GetMainMenuWorld();
995 
997  proto native void LogoutRequestTime();
998  proto native void LogoutRequestCancel();
999 
1000  proto native bool IsMultiplayer();
1001  proto native bool IsClient();
1002  proto native bool IsServer();
1007  proto native bool IsDedicatedServer();
1008 
1010  proto native int ServerConfigGetInt(string name);
1011 
1012  // Internal build
1013  proto native bool IsDebug();
1014 
1015 //#ifdef PLATFORM_XBOX
1016  static bool IsDigitalCopy()
1017  {
1018  return OnlineServices.IsGameActive(false);
1019  }
1020 //#endif
1021 
1022  /*bool IsNewMenu()
1023  {
1024  return m_ParamNewMenu;
1025  }*/
1026 
1027  void SetDebugMonitorEnabled(int value)
1028  {
1029  m_DebugMonitorEnabled = value;
1030  }
1031 
1032  bool IsDebugMonitor()
1033  {
1034  return IsServer() && m_DebugMonitorEnabled;
1035  }
1036 
1037  proto native void GetPlayerIndentities( out array<PlayerIdentity> identities );
1038 
1039  proto native float SurfaceY(float x, float z);
1040  proto native float SurfaceRoadY(float x, float z, RoadSurfaceDetection rsd = RoadSurfaceDetection.LEGACY);
1041  proto native float SurfaceRoadY3D(float x, float y, float z, RoadSurfaceDetection rsd);
1042  proto void SurfaceGetType(float x, float z, out string type);
1043  proto void SurfaceGetType3D(float x, float y, float z, out string type);
1044  proto void SurfaceUnderObject(notnull Object object, out string type, out int liquidType);
1045  proto void SurfaceUnderObjectEx(notnull Object object, out string type, out string impact, out int liquidType);
1046  proto void SurfaceUnderObjectByBone(notnull Object object, int boneType, out string type, out int liquidType);
1047  proto native float SurfaceGetNoiseMultiplier(Object directHit, vector pos, int componentIndex);
1048  proto native vector SurfaceGetNormal(float x, float z);
1049  proto native float SurfaceGetSeaLevel();
1050  proto native bool SurfaceIsSea(float x, float z);
1051  proto native bool SurfaceIsPond(float x, float z);
1052  proto native float GetWaterDepth(vector posWS);
1053 
1054  proto native void UpdatePathgraphRegion(vector regionMin, vector regionMax);
1055 
1057  float GetHighestSurfaceYDifference( array<vector> positions)
1058  {
1059  float high = -9999999;
1060  float low = 99999999;
1061 
1062  for (int i = 0; i < positions.Count(); i++)
1063  {
1064  vector pos = positions.Get(i);
1065  pos[1] = SurfaceRoadY( pos[0], pos[2]);
1066  float y = pos[1];
1067 
1068  if ( y > high )
1069  high = y;
1070 
1071  if ( y < low )
1072  low = y;
1073 
1074  ;
1075  }
1076 
1077  return high - low;
1078  }
1079 
1081  vector GetSurfaceOrientation(float x, float z)
1082  {
1083  vector normal = GetGame().SurfaceGetNormal(x, z);
1084  vector angles = normal.VectorToAngles();
1085  angles[1] = angles[1]+270; // This fixes rotation of item so it stands vertically. Feel free to change, but fix existing use cases.
1086 
1087  //Hack because setorientation and similar functions break and flip stuff upside down when using exactly this vector ¯\_(ツ)_/¯ (note: happens when surface is flat)
1088  if (angles == "0 540 0")
1089  angles = "0 0 0";
1090  return angles;
1091  }
1092 
1094  bool IsSurfaceDigable(string surface)
1095  {
1096  return ConfigGetInt("CfgSurfaces " + surface + " isDigable");
1097  }
1098 
1100  bool IsSurfaceFertile(string surface)
1101  {
1102  return ConfigGetInt("CfgSurfaces " + surface + " isFertile");
1103  }
1104 
1105  void UpdatePathgraphRegionByObject(Object object)
1106  {
1107  if ( object )
1108  {
1109  vector pos = object.GetPosition();
1110  vector min_max[2];
1111  float radius = object.ClippingInfo ( min_max );
1112  vector min = Vector ( pos[0] - radius, pos[1], pos[2] - radius );
1113  vector max = Vector ( pos[0] + radius, pos[1], pos[2] + radius );
1114  UpdatePathgraphRegion( min, max );
1115  }
1116  }
1117 
1145  proto native bool IsBoxColliding(vector center, vector orientation, vector edgeLength, array<Object> excludeObjects, array<Object> collidedObjects = NULL);
1146 
1177  proto native bool IsBoxCollidingGeometry(vector center, vector orientation, vector edgeLength, int iPrimaryType, int iSecondaryType, array<Object> excludeObjects, array<Object> collidedObjects = NULL);
1178 
1179  proto native bool IsBoxCollidingGeometryProxy(notnull BoxCollidingParams params, array<Object> excludeObjects, array<ref BoxCollidingResult> collidedObjects = NULL);
1180 
1182  proto native Weather GetWeather();
1183 
1185  proto native void SetEVUser(float value);
1186 
1187  proto native void OverrideDOF(bool enable, float focusDistance, float focusLength, float focusLengthNear, float blur, float focusDepthOffset);
1188 
1189  proto native void AddPPMask(float ndcX, float ndcY, float ndcRadius, float ndcBlur);
1190 
1191  proto native void ResetPPMask();
1192 
1200  proto native void OverrideInventoryLights(vector diffuse, vector ambient, vector ground, vector dir);
1201 
1207  proto native void NightVissionLightParams(float lightIntensityMul, float noiseIntensity);
1208 
1209 
1210  proto native void OpenURL(string url);
1211 
1213  proto native void InitDamageEffects(Object effect);
1214 
1215 //-----------------------------------------------------------------------------
1216 // persitence
1217 //-----------------------------------------------------------------------------
1218 
1221 
1229  proto native EntityAI GetEntityByPersitentID( int b1, int b2, int b3, int b4 );
1230 
1231 //-----------------------------------------------------------------------------
1232 
1245  bool IsKindOf(string cfg_class_name, string cfg_parent_name)
1246  {
1247  TStringArray full_path = new TStringArray;
1248 
1249  ConfigGetFullPath("CfgVehicles " + cfg_class_name, full_path);
1250 
1251  if (full_path.Count() == 0)
1252  {
1253  ConfigGetFullPath("CfgAmmo " + cfg_class_name, full_path);
1254  }
1255 
1256  if (full_path.Count() == 0)
1257  {
1258  ConfigGetFullPath("CfgMagazines " + cfg_class_name, full_path);
1259  }
1260 
1261  if (full_path.Count() == 0)
1262  {
1263  ConfigGetFullPath("cfgWeapons " + cfg_class_name, full_path);
1264  }
1265 
1266  if (full_path.Count() == 0)
1267  {
1268  ConfigGetFullPath("CfgNonAIVehicles " + cfg_class_name, full_path);
1269  }
1270 
1271  cfg_parent_name.ToLower();
1272  for (int i = 0; i < full_path.Count(); i++)
1273  {
1274  string tmp = full_path.Get(i);
1275  tmp.ToLower();
1276  if (tmp == cfg_parent_name)
1277  {
1278  return true;
1279  }
1280  }
1281 
1282  return false;
1283  }
1284 
1297  bool ObjectIsKindOf(Object object, string cfg_parent_name)
1298  {
1299  TStringArray full_path = new TStringArray;
1300  ConfigGetObjectFullPath(object, full_path);
1301 
1302  cfg_parent_name.ToLower();
1303 
1304  for (int i = 0; i < full_path.Count(); i++)
1305  {
1306  string tmp = full_path.Get(i);
1307  tmp.ToLower();
1308  if (tmp == cfg_parent_name)
1309  {
1310  return true;
1311  }
1312  }
1313 
1314  return false;
1315  }
1316 
1325  int ConfigFindClassIndex(string config_path, string searched_member)
1326  {
1327  int class_count = ConfigGetChildrenCount(config_path);
1328  for (int index = 0; index < class_count; index++)
1329  {
1330  string found_class = "";
1331  ConfigGetChildName(config_path, index, found_class);
1332  if (found_class == searched_member)
1333  {
1334  return index;
1335  }
1336  }
1337  return -1;
1338  }
1339 
1341  proto int GetTime();
1342 
1356  ScriptCallQueue GetCallQueue(int call_category) {}
1357 
1358  ScriptInvoker GetUpdateQueue(int call_category) {}
1359 
1360  ScriptInvoker GetPostUpdateQueue(int call_category) {}
1368  TimerQueue GetTimerQueue(int call_category) {}
1369 
1373  DragQueue GetDragQueue() {}
1374 
1376  string CreateDefaultPlayer() {}
1377 
1379  string CreateRandomPlayer() {}
1380 
1382  TStringArray ListAvailableCharacters() {}
1383 
1384  bool IsInventoryOpen()
1385  {
1386  }
1387 
1388  proto native BiosUserManager GetUserManager();
1389 
1391  proto native ContentDLC GetContentDLCService();
1392 
1394  bool IsMissionMainMenu()
1395  {
1396  return (g_Game.GetMissionState() == DayZGame.MISSION_STATE_MAINMENU);
1397  }
1398 
1399  MenuDefaultCharacterData GetMenuDefaultCharacterData(bool fill_data = true)
1400  {
1401  //Print("GetMenuDefaultCharacterData");
1402  //DumpStack();
1403  //if used on server, creates an empty container to be filled by received data
1404  if (!m_CharacterData)
1405  {
1406  m_CharacterData = new MenuDefaultCharacterData;
1407  if (fill_data)
1408  GetGame().GetMenuData().RequestGetDefaultCharacterData(); //fills the structure
1409  }
1410  return m_CharacterData;
1411  }
1412 
1413  //Analytics Manager
1414  AnalyticsManagerServer GetAnalyticsServer()
1415  {
1416  return m_AnalyticsManagerServer;
1417  }
1418 
1419  AnalyticsManagerClient GetAnalyticsClient()
1420  {
1421  return m_AnalyticsManagerClient;
1422  }
1423 };
RF_DEFAULT
const int RF_DEFAULT
Definition: centraleconomy.c:65
GetGame
proto native CGame GetGame()
UIScriptedMenu
Definition: dayzgame.c:63
mission
Mission mission
Definition: displaystatus.c:28
LogManager
Definition: debug.c:734
Mission
Mission class.
Definition: gameplay.c:670
Param
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition: param.c:11
TStringArray
array< string > TStringArray
Definition: enscript.c:685
AnalyticsManagerServer
Definition: analyticsmanagerserver.c:1
AnalyticsManagerClient
Definition: analyticsmanagerclient.c:1
Chat
Definition: chat.c:14
y
Icon y
InventoryLocation
InventoryLocation.
Definition: inventorylocation.c:27
SoundObject
class SoundObjectBuilder SoundObject(SoundParams soundParams)
World
Definition: world.c:1
InventoryItem
Definition: itembase.c:13
DayZPlayer
Definition: dayzplayerimplement.c:72
ContentDLC
ContentDLC is for query installed DLC (only as entitlement keys, not content)
Definition: contentdlc.c:10
Serializer
Serialization general interface. Serializer API works with:
Definition: serializer.c:55
PlayerIdentity
The class that will be instanced (moddable)
Definition: gameplay.c:377
EventType
TypeID EventType
Definition: enwidgets.c:55
UIManager
Definition: uimanager.c:1
MenuDefaultCharacterData
Definition: gameplay.c:960
vector
Definition: enconvert.c:105
g_Game
DayZGame g_Game
Definition: dayzgame.c:3727
Object
Definition: objecttyped.c:1
class_name
class OptionSelectorMultistate extends OptionSelector class_name
UIScriptedWindow
Definition: uiscriptedwindow.c:1
CGame
Definition: dayzgame.c:874
BiosUserManager
Definition: biosusermanager.c:16
array< ref Param >
Input
Definition: input.c:10
WorkspaceWidget
Definition: enwidgets.c:176
NoiseSystem
Definition: noise.c:1
BoxCollidingParams
Class that holds parameters to feed into CGame.IsBoxCollidingGeometryProxy.
Definition: isboxcollidinggeometryproxyclasses.c:2
name
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
x
Icon x
AmmoEffects
Static data holder for certain ammo config values.
Definition: ammoeffects.c:5
AbstractSoundScene
enum WaveKind AbstractSoundScene()
Definition: sound.c:18
MenuData
Definition: gameplay.c:895
ScriptModule
Module containing compiled scripts.
Definition: enscript.c:130
Debug
Definition: debug.c:13
Entity
Definition: camera.c:1
VONManager
Manager class which handles Voice-over-network functionality while player is connected to a server.
Definition: vonmanager.c:275
ScriptCallQueue
ScriptCallQueue Class provide "lazy" calls - when we don't want to execute function immediately but l...
Definition: tools.c:52
Math
Definition: enmath.c:6
ParticleManager
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Definition: particlemanager.c:84
AbstractWave
Definition: sound.c:118
SEffectManager
Manager class for managing Effect (EffectParticle, EffectSound)
Definition: effectmanager.c:5
Weather
Definition: weather.c:154
OnlineServices
Definition: onlineservices.c:1
Vector
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
EntityAI
Definition: building.c:5
path
string path
Definition: optionselectormultistate.c:135
ScriptInvoker
ScriptInvoker Class provide list of callbacks usage:
Definition: tools.c:115