5 static int GAME_STORAGE_VERSION = 135;
10 int m_DebugMonitorEnabled;
23 void EnableEMPlugs(
bool enable)
25 for (
int i = 0; i <
GetGame().m_EnergyManagerArray.Count(); ++i)
27 if (
GetGame().m_EnergyManagerArray[i])
28 GetGame().m_EnergyManagerArray[i].SetDebugPlugs(enable);
39 m_ParamCache.Insert(
null);
48 StorageVersion(GAME_STORAGE_VERSION);
54 if (!IsDedicatedServer())
87 void OnProcessLifetimeChanged(
int plmtype)
92 void OnLicenseChanged()
107 void OnActivateMessage()
114 void OnDeactivateMessage()
138 void OnUpdate(
bool doSim,
float timeslice)
147 void OnPostUpdate(
bool doSim,
float timeslice)
155 void OnKeyPress(
int key)
163 void OnKeyRelease(
int key)
171 void OnMouseButtonPress(
int button)
179 void OnMouseButtonRelease(
int button)
206 proto native
void RequestExit(
int code );
211 proto native
void RequestRestart(
int code);
216 proto native
bool IsAppActive();
221 proto
bool GetHostAddress( out
string address, out
int port );
226 proto owned
string GetHostName();
231 proto GetServersResultRow GetHostData();
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();
254 proto native
void DisconnectSessionForce();
267 proto native
void GetProfileStringList(
string name, out
TStringArray values);
275 proto
bool GetProfileString(
string name, out
string value);
289 proto native
void SetProfileString(
string name,
string value);
294 proto native
void SaveProfile();
300 proto
void GetPlayerName(out
string name);
307 proto
void GetPlayerNameShort(
int maxLength, out
string name);
313 proto native
void SetPlayerName(
string name);
337 proto
void GetPlayerNetworkIDByIdentityID(
int playerIdentityID, out
int networkIdLowBits, out
int networkIdHightBits );
344 proto native
Object GetObjectByNetworkId(
int networkIdLowBits,
int networkIdHighBits );
351 proto native
bool RegisterNetworkStaticObject(
Object object);
359 proto native
void SelectSpectator(
PlayerIdentity identity,
string spectatorObjType,
vector position);
365 proto native
void UpdateSpectatorPosition(
vector position);
373 proto native
void SendLogoutTime(
Object player,
int time);
379 proto native
void DisconnectPlayer(
PlayerIdentity identity,
string uid =
"");
393 proto native
void RemoveFromReconnectCache(
string uid);
399 proto native
void ClearReconnectCache();
405 proto native
void StorageVersion(
int iVersion );
410 proto native
int LoadVersion();
415 proto native
int SaveVersion();
420 proto native
float GetDayTime();
429 proto
bool ConfigGetText(
string path, out
string value);
438 proto
bool ConfigGetTextRaw(
string path, out
string value);
445 string ConfigGetTextOut(
string path)
448 ConfigGetText(
path, ret_s);
457 bool FormatRawConfigStringKeys(inout
string value)
460 ret = value.Replace(
"$STR_",
"#STR_");
473 string cfg =
"CfgVehicles " +
class_name +
" model";
475 if (
GetGame().ConfigGetText(cfg, model_path) )
477 int to_substring_end = model_path.Length() - 4;
478 int to_substring_start = 0;
481 for (
int i = to_substring_end; i > 0; i--)
483 string sign = model_path.Get(i);
486 to_substring_start = i + 1;
491 string model_name = model_path.Substring(to_substring_start, to_substring_end - to_substring_start);
496 return "UNKNOWN_P3D_FILE";
504 proto native
float ConfigGetFloat(
string path);
512 proto native
vector ConfigGetVector(
string path);
519 proto native
int ConfigGetInt(
string path);
526 proto native
int ConfigGetType(
string path);
551 proto native
void ConfigGetTextArrayRaw(
string path, out
TStringArray values);
558 proto native
void ConfigGetFloatArray(
string path, out
TFloatArray values);
565 proto native
void ConfigGetIntArray(
string path, out
TIntArray values);
574 proto
bool ConfigGetChildName(
string path,
int index, out
string name);
582 proto
bool ConfigGetBaseName(
string path, out
string base_name);
591 proto native
int ConfigGetChildrenCount(
string path);
592 proto native
bool ConfigIsExisting(
string path);
594 proto native
void ConfigGetFullPath(
string path, out
TStringArray full_path);
598 proto native
bool GetModToBeReported();
610 string return_path =
"";
611 int count = array_path.Count();
613 for (
int i = 0; i < count; i++)
615 return_path += array_path.Get(i);
641 proto
bool CommandlineGetParam(
string name, out
string value);
643 proto native
void CopyToClipboard(
string text);
644 proto
void CopyFromClipboard(out
string text);
646 proto native
void BeginOptionsVideo();
647 proto native
void EndOptionsVideo();
649 proto native
void AdminLog(
string text);
658 proto native
bool PreloadObject(
string type,
float distance );
660 proto native
Object CreateStaticObjectUsingP3D(
string p3dFilename,
vector position,
vector orientation,
float scale = 1.0,
bool createLocal =
false);
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);
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 );
701 proto native
bool IsObjectAccesible(
EntityAI item, Man player);
704 proto native
Input GetInput();
707 proto native
vector GetCurrentCameraPosition();
708 proto native
vector GetCurrentCameraDirection();
717 proto native
bool AddInventoryJuncture(Man player, notnull
EntityAI item,
InventoryLocation dst,
bool test_dst_occupancy,
int timeout_ms);
719 bool AddInventoryJunctureEx(Man player, notnull
EntityAI item,
InventoryLocation dst,
bool test_dst_occupancy,
int timeout_ms)
721 bool result = AddInventoryJuncture(player, item, dst, test_dst_occupancy, timeout_ms);
723 if (
LogManager.IsInventoryReservationLogEnable() )
725 Debug.InventoryReservationLog(
"STS = " + player.GetSimulationTimeStamp() +
" result: " + result +
" item:" + item +
" dst: " +
InventoryLocation.DumpToStringNullSafe(dst),
"n/a" ,
"n/a",
"AddInventoryJuncture",player.ToString() );
733 proto native
bool HasInventoryJunctureItem(notnull
EntityAI item);
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);
740 bool ClearJunctureEx(Man player, notnull
EntityAI item)
743 if (
LogManager.IsInventoryReservationLogEnable() )
745 Debug.InventoryReservationLog(
"STS = " + player.GetSimulationTimeStamp()+
" item:" + item,
"n/a" ,
"n/a",
"ClearJuncture",player.ToString() );
748 return ClearJuncture( player, item);
753 proto native
bool ExecuteEnforceScript(
string expression,
string mainFnName);
755 proto native
void DumpInstances(
bool csvFormatting);
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);
766 proto native
void GetDiagDrawModeNames(out
TStringArray diag_names);
768 proto native
void SetDiagDrawMode(
int diag_draw_mode);
770 proto native
int GetDiagDrawMode();
773 proto native
bool IsPhysicsExtrapolationEnabled();
779 proto native
float GetFps();
785 proto native
float GetTickTime();
787 proto
void GetInventoryItemSize(
InventoryItem item, out
int width, out
int height);
802 proto native
World GetWorld();
803 proto
void GetWorldName( out
string world_name );
805 string GetWorldName()
808 g_Game.GetWorldName(world_name);
812 proto native
bool VerifyWorldOwnership(
string sWorldName );
813 proto native
bool GoBuyWorldDLC(
string sWorldName );
815 proto
void FormatString(
string format,
string params[], out
string output);
816 proto
void GetVersion( out
string version );
819 proto native
void GetPlayers( out
array<Man> players );
824 if (index >= players.Count())
833 proto native
vector GetPointerDirection();
835 proto native
vector GetWorldDirectionFromScreen(
vector world_pos);
839 proto native
vector GetScreenPosRelative(
vector world_pos);
842 proto native
MenuData GetMenuData();
889 m_ParamCache.Set(0, param);
890 RPC(target, rpc_type, m_ParamCache, guaranteed, recipient);
894 void RPCSelfSingleParam(
Object target,
int rpcType,
Param param)
896 m_ParamCache.Set(0, param);
897 RPCSelf(target, rpcType, m_ParamCache);
901 proto native
void ProfilerStart(
string name);
903 proto native
void ProfilerStop(
string name);
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);
930 proto native
void MuteAllPlayers(
string listenerId,
bool mute);
937 proto native
void EnableVoN(
Object player,
bool enable);
945 proto native
void SetVoiceEffect(
Object player,
int effect,
bool enable);
951 proto native
void SetVoiceLevel(
int level);
956 proto native
int GetVoiceLevel(
Object player =
null);
962 proto native
void EnableMicCapture(
bool enable);
967 proto native
bool IsMicCapturing();
972 proto native
bool IsInPartyChat();
975 proto native
Mission GetMission();
980 proto native
void StartRandomCutscene(
string world);
982 proto native
void PlayMission(
string path);
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();
993 proto native
void SetMainMenuWorld(
string world);
994 proto native owned
string GetMainMenuWorld();
997 proto native
void LogoutRequestTime();
998 proto native
void LogoutRequestCancel();
1000 proto native
bool IsMultiplayer();
1001 proto native
bool IsClient();
1002 proto native
bool IsServer();
1007 proto native
bool IsDedicatedServer();
1010 proto native
int ServerConfigGetInt(
string name);
1013 proto native
bool IsDebug();
1016 static bool IsDigitalCopy()
1027 void SetDebugMonitorEnabled(
int value)
1029 m_DebugMonitorEnabled = value;
1032 bool IsDebugMonitor()
1034 return IsServer() && m_DebugMonitorEnabled;
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);
1054 proto native
void UpdatePathgraphRegion(
vector regionMin,
vector regionMax);
1057 float GetHighestSurfaceYDifference(
array<vector> positions)
1059 float high = -9999999;
1060 float low = 99999999;
1062 for (
int i = 0; i < positions.Count(); i++)
1064 vector pos = positions.Get(i);
1065 pos[1] = SurfaceRoadY( pos[0], pos[2]);
1081 vector GetSurfaceOrientation(
float x,
float z)
1084 vector angles = normal.VectorToAngles();
1085 angles[1] = angles[1]+270;
1088 if (angles ==
"0 540 0")
1094 bool IsSurfaceDigable(
string surface)
1096 return ConfigGetInt(
"CfgSurfaces " + surface +
" isDigable");
1100 bool IsSurfaceFertile(
string surface)
1102 return ConfigGetInt(
"CfgSurfaces " + surface +
" isFertile");
1105 void UpdatePathgraphRegionByObject(
Object object)
1109 vector pos =
object.GetPosition();
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 );
1182 proto native
Weather GetWeather();
1185 proto native
void SetEVUser(
float value);
1187 proto native
void OverrideDOF(
bool enable,
float focusDistance,
float focusLength,
float focusLengthNear,
float blur,
float focusDepthOffset);
1189 proto native
void AddPPMask(
float ndcX,
float ndcY,
float ndcRadius,
float ndcBlur);
1191 proto native
void ResetPPMask();
1207 proto native
void NightVissionLightParams(
float lightIntensityMul,
float noiseIntensity);
1210 proto native
void OpenURL(
string url);
1213 proto native
void InitDamageEffects(
Object effect);
1229 proto native
EntityAI GetEntityByPersitentID(
int b1,
int b2,
int b3,
int b4 );
1245 bool IsKindOf(
string cfg_class_name,
string cfg_parent_name)
1249 ConfigGetFullPath(
"CfgVehicles " + cfg_class_name, full_path);
1251 if (full_path.Count() == 0)
1253 ConfigGetFullPath(
"CfgAmmo " + cfg_class_name, full_path);
1256 if (full_path.Count() == 0)
1258 ConfigGetFullPath(
"CfgMagazines " + cfg_class_name, full_path);
1261 if (full_path.Count() == 0)
1263 ConfigGetFullPath(
"cfgWeapons " + cfg_class_name, full_path);
1266 if (full_path.Count() == 0)
1268 ConfigGetFullPath(
"CfgNonAIVehicles " + cfg_class_name, full_path);
1271 cfg_parent_name.ToLower();
1272 for (
int i = 0; i < full_path.Count(); i++)
1274 string tmp = full_path.Get(i);
1276 if (tmp == cfg_parent_name)
1297 bool ObjectIsKindOf(
Object object,
string cfg_parent_name)
1300 ConfigGetObjectFullPath(
object, full_path);
1302 cfg_parent_name.ToLower();
1304 for (
int i = 0; i < full_path.Count(); i++)
1306 string tmp = full_path.Get(i);
1308 if (tmp == cfg_parent_name)
1325 int ConfigFindClassIndex(
string config_path,
string searched_member)
1327 int class_count = ConfigGetChildrenCount(config_path);
1328 for (
int index = 0; index < class_count; index++)
1330 string found_class =
"";
1331 ConfigGetChildName(config_path, index, found_class);
1332 if (found_class == searched_member)
1341 proto
int GetTime();
1368 TimerQueue GetTimerQueue(
int call_category) {}
1373 DragQueue GetDragQueue() {}
1376 string CreateDefaultPlayer() {}
1379 string CreateRandomPlayer() {}
1384 bool IsInventoryOpen()
1391 proto native
ContentDLC GetContentDLCService();
1394 bool IsMissionMainMenu()
1396 return (
g_Game.GetMissionState() == DayZGame.MISSION_STATE_MAINMENU);
1404 if (!m_CharacterData)
1408 GetGame().GetMenuData().RequestGetDefaultCharacterData();
1410 return m_CharacterData;
1416 return m_AnalyticsManagerServer;
1421 return m_AnalyticsManagerClient;