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

◆ RunDayZBat()

void DayZTool::RunDayZBat ( string filepath,
bool wait = false )
inlineprivate

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

4 {
5 if (filepath.Length() < 2) return;
6
7 filepath.Replace("\\", "/");
8
9 if (filepath[1] != ":")
10 {
11 string cwd;
12 Workbench.GetCwd(cwd);
13 filepath = cwd + "/" + filepath;
14 }
15
16 int index = filepath.IndexOf("/");
17 int last_index = index;
18
19 while(index != -1)
20 {
21 last_index = index;
22 index = filepath.IndexOfFrom(last_index + 1, "/");
23 }
24
25 if (last_index == -1) return;
26
27 string path = filepath.Substring(0, last_index);
28 string bat = filepath.Substring(last_index + 1, filepath.Length() - last_index - 1);
29 /*Print(filepath);
30 Print(path);
31 Print(bat);*/
32 Workbench.RunCmd("cmd /c \"cd " + path + " & call " + bat + "\"", wait);
33 }
string path
Определения OptionSelectorMultistate.c:142
proto native int Length()
Returns length of string.
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.
proto native int IndexOfFrom(int start, string sample)
Finds 'sample' in 'str' from 'start' position. Returns -1 when not found.
proto native int IndexOf(string sample)
Finds 'sample' in 'str'. Returns -1 when not found.

Перекрестные ссылки Workbench::GetCwd(), string::IndexOf(), string::IndexOfFrom(), string::Length(), path, string::Replace(), Workbench::RunCmd() и string::Substring().

Используется в KillDayzTool::Run() и RestartDayzTool::Run().