DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ LoadData()

static bool CfgGameplayHandler::LoadData ( )
inlinestaticprivate

we are allowed to read the file, so we replace the default data with data from json

См. определение в файле CfgGameplayHandler.c строка 44

45 {
46 if (!FileExist(m_Path))
47 {
48 m_Path = "";
50 m_Path = string.Format("dz/worlds/%1/ce/cfggameplay.json", m_Path);
51 }
52
53 bool cfgGameplayFileEnabled = GetGame().ServerConfigGetInt( "enableCfgGameplayFile" );
54
55 #ifdef DIAG_DEVELOPER
56 if (!GetGame().IsDedicatedServer())
57 {
58 cfgGameplayFileEnabled = true;
59 }
60 #endif
61
62 if (!cfgGameplayFileEnabled || !FileExist(m_Path))
63 {
64 m_Data.InitServer();//legacy call
65 InitData();
66 OnLoaded();
67 return false;
68 }
69
70 string errorMessage;
71 if (!JsonFileLoader<CfgGameplayJson>.LoadFile(m_Path, m_Data, errorMessage))
72 ErrorEx(errorMessage);
73
75 OnLoaded();
76
77 return true;
78 }
proto void GetWorldName(out string world_name)
proto native int ServerConfigGetInt(string name)
Server config parsing. Returns 0 if not found.
static void InitData()
Определения CfgGameplayHandler.c:29
static ref CfgGameplayJson m_Data
Определения CfgGameplayHandler.c:6
static void OnLoaded()
Определения CfgGameplayHandler.c:81
static string m_Path
Определения CfgGameplayHandler.c:3
static void ValidateItems()
Определения CfgGameplayHandler.c:14
proto native CGame GetGame()
enum ShapeType ErrorEx
proto bool FileExist(string name)
Check existence of file.

Перекрестные ссылки ErrorEx, FileExist(), GetGame(), CGame::GetWorldName(), InitData(), m_Data, m_Path, OnLoaded(), CGame::ServerConfigGetInt() и ValidateItems().

Используется в MissionBase::OnInit().