DayZ 1.24
Loading...
Searching...
No Matches
UndergroundAreaLoader Class Reference
Collaboration diagram for UndergroundAreaLoader:
[legend]

Static Private Member Functions

static JsonUndergroundTriggers GetData ()
 
static void SpawnAllTriggerCarriers ()
 
static void SpawnTriggerCarrier (int index, JsonUndergroundAreaTriggerData data)
 
static void SyncDataSend (PlayerIdentity identity)
 
static void OnRPC (ParamsReadContext ctx)
 

Static Private Attributes

static string m_Path = "$mission:cfgundergroundtriggers.json"
 
static ref JsonUndergroundTriggers m_JsonData
 

Detailed Description

Definition at line 47 of file UndergroundAreaLoader.c.

Member Function Documentation

◆ GetData()

static JsonUndergroundTriggers UndergroundAreaLoader::GetData ( )
inlinestaticprivate

Definition at line 54 of file UndergroundAreaLoader.c.

55 {
56 if (!FileExist(m_Path))
57 {
58 // We fallback to check in data and notify user file was not found in mission
59 PrintToRPT("[WARNING] :: [UndergroundAreaLoader GetData()] :: file not found in MISSION folder, your path is " + m_Path + " Attempting DATA folder");
60
61 string worldName;
62 GetGame().GetWorldName(worldName);
63 m_Path = string.Format("dz/worlds/%1/ce/cfgundergroundtriggers.json", worldName);
64
65 if (!FileExist(m_Path))
66 {
67 PrintToRPT("[WARNING] :: [UndergroundAreaLoader GetData()] ::file not found in DATA folder, your path is " + m_Path);
68 return null; // Nothing could be read, just end here
69 }
70 }
71
72 string errorMessage;
76
77 return data;
78 }
proto native CGame GetGame()
proto void PrintToRPT(void var)
Prints content of variable to RPT file (performance warning - each write means fflush!...
enum ShapeType ErrorEx
proto bool FileExist(string name)
Check existence of file.

References ErrorEx, FileExist(), GetGame(), m_Path, and PrintToRPT().

Referenced by SpawnAllTriggerCarriers().

◆ OnRPC()

static void UndergroundAreaLoader::OnRPC ( ParamsReadContext ctx)
inlinestaticprivate

Definition at line 113 of file UndergroundAreaLoader.c.

114 {
116
117 if (ctx.Read(data))
118 m_JsonData = data.param1;
119 else
120 ErrorEx("UndergroundAreaLoader datasynced - failed to read");
121 }
static ref JsonUndergroundTriggers m_JsonData

References ErrorEx, and m_JsonData.

Referenced by CGame::OnRPC().

◆ SpawnAllTriggerCarriers()

static void UndergroundAreaLoader::SpawnAllTriggerCarriers ( )
inlinestaticprivate

Definition at line 81 of file UndergroundAreaLoader.c.

82 {
83 if (!m_JsonData)
85
86 if (!m_JsonData || !m_JsonData.Triggers)
87 return;
88
89 foreach (int i, auto data: m_JsonData.Triggers)
91 }
ref array< ref JsonUndergroundAreaTriggerData > Triggers
static void SpawnTriggerCarrier(int index, JsonUndergroundAreaTriggerData data)
static JsonUndergroundTriggers GetData()

References GetData(), m_JsonData, and SpawnTriggerCarrier().

Referenced by MissionBase::OnInit().

◆ SpawnTriggerCarrier()

static void UndergroundAreaLoader::SpawnTriggerCarrier ( int index,
JsonUndergroundAreaTriggerData data )
inlinestaticprivate

Definition at line 93 of file UndergroundAreaLoader.c.

94 {
95
96 UndergroundTriggerCarrierBase carrier = UndergroundTriggerCarrierBase.Cast(GetGame().CreateObjectEx("UndergroundTriggerCarrier", data.GetPosition(), ECE_NONE));
97 //Print("spawning trigger carrier at pos :" +data.GetPosition());
98 if (carrier)
99 {
100 carrier.SetIndex(index);
101 carrier.SetOrientation(data.GetOrientation());
102 }
103 }
const int ECE_NONE

References ECE_NONE, and GetGame().

Referenced by SpawnAllTriggerCarriers().

◆ SyncDataSend()

static void UndergroundAreaLoader::SyncDataSend ( PlayerIdentity identity)
inlinestaticprivate

Definition at line 106 of file UndergroundAreaLoader.c.

107 {
108 GetGame().RPCSingleParam(null, ERPCs.RPC_UNDERGROUND_SYNC, new Param1<JsonUndergroundTriggers>(m_JsonData), true, identity);
109 }
ERPCs
Definition ERPCs.c:2

References GetGame(), and m_JsonData.

Referenced by MissionBase::OnEvent().

Member Data Documentation

◆ m_JsonData

◆ m_Path

string UndergroundAreaLoader::m_Path = "$mission:cfgundergroundtriggers.json"
staticprivate

Definition at line 49 of file UndergroundAreaLoader.c.

Referenced by GetData().


The documentation for this class was generated from the following file: