mirror of
https://github.com/Tomato-dayZ/DayZ-SA-Tomato.git
synced 2025-07-25 02:50:12 +00:00
Update to Ver. 1.30
This commit is contained in:
14
CHANGELOG.md
14
CHANGELOG.md
@ -2,16 +2,17 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
|
||||
## 15.12.2018 23:00
|
||||
## 01.12.2018 23:00
|
||||
|
||||
### Fixed
|
||||
- No CustomMission is Created anymore this means Init.c File works now (Custom loadout and mods Using this file)
|
||||
- This means there should be no incompatibility with any mod now
|
||||
|
||||
- For 1.0 Update (make sure to kopy the Key from Keys folder again !)
|
||||
|
||||
### Added
|
||||
|
||||
- Teleport Locations Check the Config/List Folder u can add your own Locations to it (Adding Locations from ingame does not work since filewrite is bugged at the moment)
|
||||
## 01.12.2018 23:00
|
||||
|
||||
### Fixed
|
||||
- No CustomMission is Created anymore this means Init.c File works now (Custom loadout and mods Using this file)
|
||||
- This means there should be no incompatibility with any mod now
|
||||
|
||||
## 29.11.2018 23:00
|
||||
|
||||
@ -46,4 +47,3 @@ Addet bikey you should be able to use the mod without Dissableing verifySignatur
|
||||
### Release
|
||||
Initial Release
|
||||
|
||||
|
||||
|
2
DayZ-Sa-Tomato/Config/Admins.txt
Normal file
2
DayZ-Sa-Tomato/Config/Admins.txt
Normal file
@ -0,0 +1,2 @@
|
||||
76561198161388867
|
||||
76561198017833573
|
18
DayZ-Sa-Tomato/Config/List/TeleportLocation.txt
Normal file
18
DayZ-Sa-Tomato/Config/List/TeleportLocation.txt
Normal file
@ -0,0 +1,18 @@
|
||||
Prison Island;2651.42 0.0 1395.8
|
||||
Mogilevka;7572.65 0.0 5182.3
|
||||
Stary Sobor;6192.39 0.0 7666.5
|
||||
Msta;11206.6 0.0 5398.70
|
||||
Solnichniy;13436.5 0.0 6158.7
|
||||
Chernogorsk;6350.99 0.0 2666.12
|
||||
Elektrogorsk;10432.1 0.0 2218.56
|
||||
Berezino;12661.4 0.0 9465.03
|
||||
Tisy;1890.45 0.0 13704.6
|
||||
Gorka;9678.94 0.0 8828.93
|
||||
Balota;4546.92 0.0 2416.4
|
||||
Vybor;3916.85 0.0 8795.59
|
||||
Severograd;8318.51 0.0 12743.4
|
||||
North West Airfield;4835.59 0.0 9667.72
|
||||
Green Mountain;3752.08 0.0 6002.94
|
||||
Zelenogorsk;2542.18 0.0 4994.26
|
||||
Tisy Military Base;1599.15 0.0 14166.66
|
||||
Pavlovo Military Base;2047.82 0.0 3293.36
|
1
DayZ-Sa-Tomato/Config/Test.txt
Normal file
1
DayZ-Sa-Tomato/Config/Test.txt
Normal file
@ -0,0 +1 @@
|
||||
TestString
|
Binary file not shown.
Binary file not shown.
63
DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/config.cpp
Normal file
63
DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/config.cpp
Normal file
@ -0,0 +1,63 @@
|
||||
class CfgPatches
|
||||
{
|
||||
class DayZSATomato
|
||||
{
|
||||
units[]={};
|
||||
weapons[]={};
|
||||
requiredVersion=0.1;
|
||||
requiredAddons[]=
|
||||
{
|
||||
};
|
||||
};
|
||||
};
|
||||
class CfgMods
|
||||
{
|
||||
class DayZSATomato
|
||||
{
|
||||
dir="DayZ-SA-Tomato";
|
||||
picture="";
|
||||
action="";
|
||||
hideName=1;
|
||||
hidePicture=1;
|
||||
name="DayZ-SA-Tomato";
|
||||
credits="";
|
||||
author="DayZ-SA-Tomato";
|
||||
authorID="0";
|
||||
version="1.0";
|
||||
extra=0;
|
||||
type="mod";
|
||||
dependencies[]=
|
||||
{
|
||||
"Game",
|
||||
"World",
|
||||
"Mission"
|
||||
};
|
||||
class defs
|
||||
{
|
||||
class gameScriptModule
|
||||
{
|
||||
value="";
|
||||
files[]=
|
||||
{
|
||||
"com/DayZ-SA-Tomato/scripts/3_Game"
|
||||
};
|
||||
};
|
||||
class worldScriptModule
|
||||
{
|
||||
value="";
|
||||
files[]=
|
||||
{
|
||||
"com/DayZ-SA-Tomato/scripts/4_World"
|
||||
};
|
||||
};
|
||||
class missionScriptModule
|
||||
{
|
||||
value="";
|
||||
files[]=
|
||||
{
|
||||
"com/DayZ-SA-Tomato/scripts/5_Mission"
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -0,0 +1,2 @@
|
||||
const int MENU_Admin = 7000;
|
||||
const int MENU_AdminMessage = 7001;
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
enum ConfigType
|
||||
{
|
||||
false, true, next, custom
|
||||
}
|
@ -0,0 +1,289 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
class FileConfig
|
||||
{
|
||||
ref array< ref FileConfig > Children;
|
||||
string ConfigName;
|
||||
ConfigType IsConfigType;
|
||||
string ConfigData;
|
||||
ref FileConfig Parent;
|
||||
void FileConfig( string name, ConfigType type = true, string data = "", ref FileConfig parent = NULL )
|
||||
{
|
||||
ConfigName = name;
|
||||
IsConfigType = type;
|
||||
ConfigData = data;
|
||||
Parent = parent;
|
||||
|
||||
IsConfigType = ConfigType.next;
|
||||
if ( Parent == NULL )
|
||||
{
|
||||
IsConfigType = ConfigType.true;
|
||||
}
|
||||
|
||||
Children = new ref array< ref FileConfig >;
|
||||
}
|
||||
|
||||
void WriteToFile()
|
||||
{
|
||||
array<string> ConfigNames = new array<string>;
|
||||
array<string> ConfigTypes = new array<string>;
|
||||
string type;
|
||||
for ( int i = 0; i < Children.Count(); i++ )
|
||||
{
|
||||
ConfigNames.Insert(Children[i].ConfigName);
|
||||
|
||||
if(Children[i].IsConfigType == ConfigType.true)
|
||||
{
|
||||
type = "1";
|
||||
}else if(Children[i].IsConfigType == ConfigType.custom)
|
||||
{
|
||||
type = Children[i].ConfigData;
|
||||
}else
|
||||
{
|
||||
type = "0";
|
||||
}
|
||||
ConfigTypes.Insert(type);
|
||||
}
|
||||
|
||||
FileHandle file = OpenFile( GetFileHandler().ConfigFile, FileMode.WRITE );
|
||||
|
||||
if ( file != 0 )
|
||||
{
|
||||
|
||||
for ( int t = 0; t < ConfigNames.Count(); t++ )
|
||||
{
|
||||
string WriteData = ConfigNames[t] + " = " + ConfigTypes[t];
|
||||
FPrintln( file, WriteData );
|
||||
}
|
||||
|
||||
CloseFile(file);
|
||||
|
||||
Print("Wrote Config to File" + GetFileHandler().ConfigFile);
|
||||
} else
|
||||
{
|
||||
Print("Could not open File " + GetFileHandler().ConfigFile + " to Write Config to!");
|
||||
}
|
||||
}
|
||||
|
||||
void ~FileConfig()
|
||||
{
|
||||
//delete Children;
|
||||
}
|
||||
|
||||
bool IsConfig( string Configname )
|
||||
{
|
||||
for ( int i = 0; i < Children.Count(); i++ )
|
||||
{
|
||||
if ( Children[i].ConfigName == Configname && Children[i].IsConfigType == ConfigType.true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
string GetConfigData( string Configname )
|
||||
{
|
||||
string ReturnData = "";
|
||||
for ( int i = 0; i < Children.Count(); i++ )
|
||||
{
|
||||
if ( Children[i].ConfigName == Configname ) //&& Children[i].IsConfigType == ConfigType.custom
|
||||
{
|
||||
ReturnData = Children[i].ConfigData;
|
||||
return ReturnData;
|
||||
}
|
||||
}
|
||||
return ReturnData;
|
||||
}
|
||||
|
||||
void SetConfigType(ConfigType type)
|
||||
{
|
||||
|
||||
IsConfigType = type;
|
||||
//GetFileHandler().RootConfig.WriteToFile()
|
||||
|
||||
}
|
||||
|
||||
void SetConfigData(string data)
|
||||
{
|
||||
ConfigData = data;
|
||||
//GetFileHandler().RootConfig.WriteToFile()
|
||||
}
|
||||
|
||||
void PrintAll()
|
||||
{
|
||||
for ( int i = 0; i < Children.Count(); i++ )
|
||||
{
|
||||
Print(" ");
|
||||
Print("Printing Child with number " + i);
|
||||
Print("Name = " + Children[i].ConfigName);
|
||||
Print("ConfigType = " + Children[i].IsConfigType);
|
||||
Print("ConfigData = " + Children[i].ConfigData);
|
||||
Print("Parent = " + Children[i].Parent);
|
||||
Print("End Of Child with Number " + i);
|
||||
Print(" ");
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigInitialize()
|
||||
{
|
||||
array<string> ConfigLine = new array<string>;
|
||||
array<string> ConfigStringCut = new array<string>;
|
||||
FileHandle file = OpenFile( GetFileHandler().ConfigFile, FileMode.READ );
|
||||
if ( file != 0 )
|
||||
{
|
||||
Print("ConfigInitialize - File Found");
|
||||
string line;
|
||||
|
||||
while ( FGets( file, line ) > 0 )
|
||||
{
|
||||
ConfigLine.Insert( line );
|
||||
}
|
||||
|
||||
CloseFile( file );
|
||||
|
||||
if(Children.Count() == ConfigLine.Count() )
|
||||
{
|
||||
for ( int i = 0; i < ConfigLine.Count(); i++ )
|
||||
{
|
||||
ConfigStringCut.Clear();
|
||||
ConfigLine[i].Split( " = ", ConfigStringCut );
|
||||
ConfigType type;
|
||||
string configData = "";
|
||||
if(ConfigLine.Count() == Children.Count())
|
||||
{
|
||||
int len = ConfigStringCut[1].LengthUtf8();
|
||||
len = len - 2;
|
||||
string ConfigTypeCut = ConfigStringCut[1].Substring(2, len);
|
||||
if(ConfigTypeCut == "1")
|
||||
{
|
||||
type = ConfigType.true;
|
||||
}else if(ConfigTypeCut == "0")
|
||||
{
|
||||
type = ConfigType.false;
|
||||
}else
|
||||
{
|
||||
type = ConfigType.custom;
|
||||
configData = ConfigTypeCut;
|
||||
|
||||
}
|
||||
}else
|
||||
{
|
||||
if(ConfigStringCut[1] == "= 1")
|
||||
{
|
||||
type = ConfigType.true;
|
||||
}else if(ConfigStringCut[1] == "= 0")
|
||||
{
|
||||
type = ConfigType.false;
|
||||
}else
|
||||
{
|
||||
type = ConfigType.custom;
|
||||
configData = ConfigTypeCut;
|
||||
}
|
||||
}
|
||||
//Function needet TODO !
|
||||
Children[i].SetConfigType(type);
|
||||
Children[i].SetConfigData(configData);
|
||||
}
|
||||
WriteToFile();
|
||||
}else
|
||||
{
|
||||
Print("Config File has Wrong number of Configs recreateing file !");
|
||||
WriteToFile();
|
||||
}
|
||||
} else
|
||||
{
|
||||
Print( "File. " + GetFileHandler().ConfigFile + " Not found Creating new one");
|
||||
WriteToFile();
|
||||
}
|
||||
}
|
||||
|
||||
// void LoadConfig( string ConfigString, ConfigType ConfigTypefunc = ConfigType.next )
|
||||
// {
|
||||
|
||||
// array<string> ConfigStringCut = new array<string>;
|
||||
// ConfigString.Split( " = ", ConfigStringCut );
|
||||
|
||||
// ConfigType type;
|
||||
// if (ConfigStringCut.Count() == 2 ) // Loaded will be 1
|
||||
// {
|
||||
// if ( ConfigStringCut[1].Contains( "1" ) )
|
||||
// {
|
||||
// type = ConfigType.true;
|
||||
// } else if ( ConfigStringCut[1].Contains( "0" ) )
|
||||
// {
|
||||
// type = ConfigType.false;
|
||||
// } else
|
||||
// {
|
||||
// type = ConfigType.false;
|
||||
// }
|
||||
// } else if ( ConfigStringCut.Count() < 2 ) //New One will Be Count 1 make Type what it should be
|
||||
// {
|
||||
// type = ConfigTypefunc;
|
||||
|
||||
// } else {
|
||||
// Print( "LoadConfig Error Given String : " + ConfigString + " and should be Config = 1 ");
|
||||
// return;
|
||||
// }
|
||||
|
||||
// CheckIfNewConfig(ConfigStringCut[0], type);
|
||||
|
||||
// }
|
||||
void RegisterNewconfig(string name, string stype, string configdata = "")
|
||||
{
|
||||
Print("RegisterNewConfig Data = " + configdata)
|
||||
ConfigType type;
|
||||
if(stype == "true"){type = ConfigType.true;}
|
||||
else if(stype == "false"){type = ConfigType.false;}
|
||||
else{type = ConfigType.custom;}
|
||||
CheckIfNewConfig(name, type, configdata);
|
||||
}
|
||||
|
||||
void CheckIfNewConfig( string name, ConfigType type, string configData = "" )
|
||||
{
|
||||
Print("CheckIfNewConfig Data = " + configData)
|
||||
ref FileConfig nChild = NULL;
|
||||
|
||||
for ( int i = 0; i < Children.Count(); i++ )
|
||||
{
|
||||
if ( name == Children[i].ConfigName )
|
||||
{
|
||||
nChild = Children[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( nChild == NULL )
|
||||
{
|
||||
nChild = new FileConfig( name, type, configData, this );
|
||||
//nChild.IsConfigType = type;
|
||||
// nChild.ConfigData = configData;
|
||||
Children.Insert( nChild );
|
||||
for ( i = 0; i < Children.Count(); i++ )
|
||||
{
|
||||
if(Children[i].ConfigName == name)
|
||||
{
|
||||
Children[i].SetConfigType(type);
|
||||
Children[i].SetConfigData(configData);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,269 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato,
|
||||
however this File is Execludet from GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007 since it is
|
||||
|
||||
Originally from DayZ-CommunityOnlineTools
|
||||
Link : https://github.com/Jacob-Mango/DayZ-CommunityOnlineTools
|
||||
Created by Jacob-Mango
|
||||
and Published under license (CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/
|
||||
which means this file is under CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/ Licence.
|
||||
*/
|
||||
|
||||
class FPPermission
|
||||
{
|
||||
ref FPPermission Parent;
|
||||
ref array< ref FPPermission > Children;
|
||||
string Name;
|
||||
PermissionType Type;
|
||||
|
||||
|
||||
void FPPermission( string name, ref FPPermission parent = NULL )
|
||||
{
|
||||
Name = name;
|
||||
Parent = parent;
|
||||
|
||||
Type = PermissionType.DISALLOW;
|
||||
|
||||
if ( Parent == NULL )
|
||||
{
|
||||
Type = PermissionType.DISALLOW;
|
||||
}
|
||||
|
||||
Children = new ref array< ref FPPermission >;
|
||||
}
|
||||
|
||||
void SetPermissionType(string name, PermissionType type)
|
||||
{
|
||||
Print("Permission");
|
||||
for ( int i = 0; i < Children.Count(); i++ )
|
||||
{
|
||||
Print("Name 1 = " + Name + " Name 2 = " + name);
|
||||
if(Children[i].Name == name)
|
||||
{
|
||||
Print("Permission Found Changeing");
|
||||
Children[i].SetPermissionInternal(type)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void SetPermissionInternal(PermissionType type)
|
||||
{
|
||||
Print("Type Set");
|
||||
Type = type;
|
||||
}
|
||||
|
||||
void AddPermission( string inp, PermissionType permType = PermissionType.DISALLOW )
|
||||
{
|
||||
array<string> tokens = new array<string>;
|
||||
|
||||
array<string> spaces = new array<string>;
|
||||
inp.Split( " = ", spaces );
|
||||
|
||||
PermissionType type;
|
||||
for ( int i = 0; i < spaces.Count(); i++ )
|
||||
{Print(spaces[i]);}
|
||||
if (spaces.Count() == 2 )
|
||||
{
|
||||
if ( spaces[1].Contains( "1" ) )
|
||||
{
|
||||
type = PermissionType.ALLOW;
|
||||
} else if ( spaces[1].Contains( "0" ) )
|
||||
{
|
||||
type = PermissionType.DISALLOW;
|
||||
} else
|
||||
{
|
||||
type = PermissionType.DISALLOW;
|
||||
}
|
||||
|
||||
spaces[0].Split( "_", tokens );
|
||||
} else if ( spaces.Count() < 2 )
|
||||
{
|
||||
type = permType;
|
||||
|
||||
inp.Split( "_", tokens );
|
||||
} else {
|
||||
Print( "Warning, permission line improperly formatted! Read as \"" + inp + "\" but meant to be in format \"Perm_Perm {n}\"." );
|
||||
return;
|
||||
}
|
||||
|
||||
int depth = tokens.Find( Name );
|
||||
|
||||
if ( depth > -1 )
|
||||
{
|
||||
AddPermissionInternal( tokens, depth + 1, type );
|
||||
} else
|
||||
{
|
||||
AddPermissionInternal( tokens, 0, type );
|
||||
}
|
||||
}
|
||||
|
||||
private ref FPPermission VerifyAddPermission( string name )
|
||||
{
|
||||
ref FPPermission nChild = NULL;
|
||||
|
||||
for ( int i = 0; i < Children.Count(); i++ )
|
||||
{
|
||||
if ( name == Children[i].Name )
|
||||
{
|
||||
nChild = Children[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( nChild == NULL )
|
||||
{
|
||||
nChild = new FPPermission( name, this );
|
||||
nChild.Type = PermissionType.DISALLOW;
|
||||
|
||||
Children.Insert( nChild );
|
||||
}
|
||||
|
||||
return nChild;
|
||||
}
|
||||
|
||||
void ToPermArray( ref array< string > output, string prepend = "" )
|
||||
{
|
||||
for ( int i = 0; i < Children.Count(); i++ )
|
||||
{
|
||||
string serialize = prepend + Children[i].Name;
|
||||
//TODO " = "
|
||||
output.Insert( serialize + " = " + Children[i].Type );
|
||||
|
||||
if ( Children[i].Children.Count() > 0 )
|
||||
{
|
||||
Children[i].ToPermArray( output, serialize + "_" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool HasPermission( string inp )
|
||||
{
|
||||
array<string> tokens = new array<string>;
|
||||
inp.Split( "_", tokens );
|
||||
|
||||
if ( tokens.Count() == 0 ) return false;
|
||||
|
||||
int depth = tokens.Find(Name);
|
||||
|
||||
bool parentDisallowed = false;
|
||||
|
||||
if ( Type == PermissionType.DISALLOW )
|
||||
{
|
||||
parentDisallowed = true;
|
||||
}
|
||||
|
||||
if ( depth > -1 )
|
||||
{
|
||||
return Check( tokens, depth + 1, parentDisallowed );
|
||||
} else
|
||||
{
|
||||
return Check( tokens, 0, parentDisallowed );
|
||||
}
|
||||
}
|
||||
|
||||
bool Check( array<string> tokens, int depth, bool parentDisallowed )
|
||||
{
|
||||
bool ifReturnAs = false;
|
||||
|
||||
if ( Type == PermissionType.ALLOW )
|
||||
{
|
||||
ifReturnAs = true;
|
||||
}
|
||||
|
||||
if ( Type == PermissionType.DISALLOW )
|
||||
{
|
||||
parentDisallowed = true;
|
||||
}
|
||||
|
||||
if ( Type == PermissionType.ALLOW )
|
||||
{
|
||||
parentDisallowed = false;
|
||||
}
|
||||
|
||||
if ( depth < tokens.Count() )
|
||||
{
|
||||
ref FPPermission nChild = NULL;
|
||||
|
||||
for ( int i = 0; i < Children.Count(); i++ )
|
||||
{
|
||||
if ( Children[i].Name == tokens[depth] )
|
||||
{
|
||||
nChild = Children[i];
|
||||
}
|
||||
}
|
||||
|
||||
if ( nChild )
|
||||
{
|
||||
return nChild.Check( tokens, depth + 1, parentDisallowed );
|
||||
}
|
||||
}
|
||||
|
||||
return ifReturnAs;
|
||||
}
|
||||
|
||||
private ref FPPermission Get( array<string> tokens, int depth )
|
||||
{
|
||||
if ( depth < tokens.Count() )
|
||||
{
|
||||
ref FPPermission nChild = NULL;
|
||||
|
||||
for ( int i = 0; i < Children.Count(); i++ )
|
||||
{
|
||||
if ( Children[i].Name == tokens[depth] )
|
||||
{
|
||||
nChild = Children[i];
|
||||
}
|
||||
}
|
||||
|
||||
if ( nChild )
|
||||
{
|
||||
return nChild.Get( tokens, depth + 1 );
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
ref FPPermission GetPermission( string inp )
|
||||
{
|
||||
array<string> tokens = new array<string>;
|
||||
inp.Split( "_", tokens );
|
||||
|
||||
int depth = tokens.Find(Name);
|
||||
|
||||
if ( depth > -1 )
|
||||
{
|
||||
return Get( tokens, depth + 1 );
|
||||
} else
|
||||
{
|
||||
return Get( tokens, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
private void AddPermissionInternal( array<string> tokens, int depth, PermissionType value )
|
||||
{
|
||||
if ( depth < tokens.Count() )
|
||||
{
|
||||
string name = tokens[depth];
|
||||
|
||||
ref FPPermission nChild = VerifyAddPermission( name );
|
||||
|
||||
nChild.AddPermissionInternal( tokens, depth + 1, value );
|
||||
} else {
|
||||
Type = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ~FPPermission()
|
||||
{
|
||||
delete Children;
|
||||
}
|
||||
}
|
@ -0,0 +1,204 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato,
|
||||
however this File is Execludet from GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007 since it is
|
||||
|
||||
Originally from DayZ-CommunityOnlineTools
|
||||
Link : https://github.com/Jacob-Mango/DayZ-CommunityOnlineTools
|
||||
Created by Jacob-Mango
|
||||
and Published under license (CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/
|
||||
which means this file is under CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/ Licence.
|
||||
*/
|
||||
|
||||
class FPPlayer
|
||||
{
|
||||
ref FPPermission RootPermission;
|
||||
|
||||
PlayerBase PlayerObject;
|
||||
PlayerIdentity IdentityPlayer;
|
||||
ref PlayerDataN Data;
|
||||
|
||||
void FPPlayer(ref PlayerDataN data)
|
||||
{
|
||||
PlayerObject = NULL;
|
||||
Data = data;
|
||||
|
||||
if ( Data == NULL )
|
||||
{
|
||||
Data = new ref PlayerDataN;
|
||||
}
|
||||
|
||||
RootPermission = new ref FPPermission( Data.SSteam64ID );
|
||||
|
||||
}
|
||||
|
||||
void SetPermission(string name, PermissionType type)
|
||||
{
|
||||
Print("FPPlayer");
|
||||
RootPermission.SetPermissionType(name , type)
|
||||
}
|
||||
|
||||
string FileReadyStripName( string name )
|
||||
{
|
||||
name.Replace( "\\", "" );
|
||||
name.Replace( "/", "" );
|
||||
name.Replace( "=", "" );
|
||||
name.Replace( "+", "" );
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
bool Load()
|
||||
{
|
||||
string filename = FileReadyStripName( Data.SSteam64ID );
|
||||
Print( "Loading permissions for " + filename );
|
||||
FileHandle file = OpenFile( GetFileHandler().PlayersFolderPath + filename + ".Player", FileMode.READ );
|
||||
|
||||
ref array< string > data = new ref array< string >;
|
||||
|
||||
if ( file != 0 )
|
||||
{
|
||||
string line;
|
||||
|
||||
while ( FGets( file, line ) > 0 )
|
||||
{
|
||||
data.Insert( line );
|
||||
}
|
||||
|
||||
CloseFile( file );
|
||||
|
||||
for ( int i = 0; i < data.Count(); i++ )
|
||||
{
|
||||
AddPermission( data[i] );
|
||||
}
|
||||
} else
|
||||
{
|
||||
Print( "Failed to open the file for the player to read. Attemping to create." );
|
||||
|
||||
Save();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Save()
|
||||
{
|
||||
string filename = FileReadyStripName( Data.SSteam64ID );
|
||||
|
||||
Print( "Saving permissions for " + filename );
|
||||
FileHandle file = OpenFile( GetFileHandler().PlayersFolderPath + filename + ".Player", FileMode.WRITE );
|
||||
//TODO ??
|
||||
ref array< string > data = ToPermArray();
|
||||
|
||||
if ( file != 0 )
|
||||
{
|
||||
string line;
|
||||
|
||||
for ( int i = 0; i < data.Count(); i++ )
|
||||
{
|
||||
FPrintln( file, data[i] );
|
||||
}
|
||||
|
||||
CloseFile(file);
|
||||
|
||||
Print("Wrote to the players");
|
||||
return true;
|
||||
} else
|
||||
{
|
||||
Print("Failed to open the file for the player for writing.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void CopyPermissions( ref FPPermission copy )
|
||||
{
|
||||
ref array< string > data = new ref array< string >;
|
||||
copy.ToPermArray( data );
|
||||
|
||||
for ( int i = 0; i < data.Count(); i++ )
|
||||
{
|
||||
AddPermission( data[i] );
|
||||
}
|
||||
}
|
||||
|
||||
ref array< string > ToPermArray()
|
||||
{
|
||||
Data.APermissions.Clear();
|
||||
|
||||
RootPermission.ToPermArray( Data.APermissions );
|
||||
|
||||
return Data.APermissions;
|
||||
}
|
||||
|
||||
void ToPermData()
|
||||
{
|
||||
for ( int i = 0; i < Data.APermissions.Count(); i++ )
|
||||
{
|
||||
AddPermission( Data.APermissions[i] );
|
||||
}
|
||||
}
|
||||
|
||||
bool HasPermission( string fPPermission )
|
||||
{
|
||||
return RootPermission.HasPermission( fPPermission );
|
||||
}
|
||||
|
||||
void AddPermission( string fPPermission, PermissionType type = PermissionType.DISALLOW )
|
||||
{
|
||||
RootPermission.AddPermission( fPPermission, type);
|
||||
}
|
||||
|
||||
void ClearPermissions()
|
||||
{
|
||||
delete RootPermission;
|
||||
|
||||
RootPermission = new ref FPPermission( Data.SSteam64ID, NULL );
|
||||
}
|
||||
|
||||
void UpdatePlayerDataN()
|
||||
{
|
||||
if ( IdentityPlayer == NULL ) return;
|
||||
|
||||
Data.IPingMin = IdentityPlayer.GetPingMin();
|
||||
Data.IPingMax = IdentityPlayer.GetPingMax();
|
||||
Data.IPingAvg = IdentityPlayer.GetPingAvg();
|
||||
|
||||
Data.SSteam64ID = IdentityPlayer.GetPlainId();
|
||||
Data.SGUID = IdentityPlayer.GetId();
|
||||
Data.SName = IdentityPlayer.GetName();
|
||||
|
||||
if ( PlayerObject == NULL ) return;
|
||||
|
||||
PlayerDataN.Load( Data, PlayerObject );
|
||||
}
|
||||
|
||||
void NewData( ref PlayerDataN newData )
|
||||
{
|
||||
Data = newData;
|
||||
}
|
||||
|
||||
void ~FPPlayer()
|
||||
{
|
||||
delete RootPermission;
|
||||
}
|
||||
|
||||
string GetGUID()
|
||||
{
|
||||
return Data.SGUID;
|
||||
}
|
||||
|
||||
string GetSteam64ID()
|
||||
{
|
||||
return Data.SSteam64ID;
|
||||
}
|
||||
|
||||
string GetName()
|
||||
{
|
||||
return Data.SName;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato,
|
||||
however this File is Execludet from GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007 since it is
|
||||
|
||||
Originally from DayZ-CommunityOnlineTools
|
||||
Link : https://github.com/Jacob-Mango/DayZ-CommunityOnlineTools
|
||||
Created by Jacob-Mango
|
||||
and Published under license (CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/
|
||||
which means this file is under CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/ Licence.
|
||||
*/
|
||||
static ref FPPlayer ClientAuthPlayer;
|
||||
|
||||
static ref array< ref FPPlayer > SELECTED_PLAYERS;
|
||||
|
||||
ref array< ref FPPlayer > GetSelectedPlayers()
|
||||
{
|
||||
if ( SELECTED_PLAYERS == NULL )
|
||||
{
|
||||
SELECTED_PLAYERS = new ref array< ref FPPlayer >;
|
||||
}
|
||||
return SELECTED_PLAYERS;
|
||||
}
|
||||
|
||||
bool PlayerAlreadySelected( ref FPPlayer player )
|
||||
{
|
||||
int position = GetSelectedPlayers().Find( player );
|
||||
|
||||
return position > -1;
|
||||
}
|
||||
|
||||
int RemoveSelectedPlayer( ref FPPlayer player )
|
||||
{
|
||||
int position = GetSelectedPlayers().Find( player );
|
||||
|
||||
if ( position > -1 )
|
||||
{
|
||||
GetSelectedPlayers().Remove( position );
|
||||
}
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
int AddSelectedPlayer( ref FPPlayer player )
|
||||
{
|
||||
int position = GetSelectedPlayers().Find( player );
|
||||
|
||||
if ( position > -1 )
|
||||
return position;
|
||||
|
||||
return GetSelectedPlayers().Insert( player );
|
||||
}
|
||||
|
||||
ref PlayerDataN SerializePlayer( ref FPPlayer player )
|
||||
{
|
||||
player.ToPermArray();
|
||||
|
||||
return player.Data;
|
||||
}
|
||||
|
||||
ref FPPlayer DeserializePlayer( ref PlayerDataN data )
|
||||
{
|
||||
return GetFileHandler().GetPlayer( data );
|
||||
}
|
||||
|
||||
array< ref PlayerDataN > SerializePlayers( ref array< ref FPPlayer > players )
|
||||
{
|
||||
array< ref PlayerDataN > output = new array< ref PlayerDataN >;
|
||||
|
||||
for ( int i = 0; i < players.Count(); i++)
|
||||
{
|
||||
output.Insert( SerializePlayer( players[i] ) );
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
array< ref FPPlayer > DeserializePlayers( ref array< ref PlayerDataN > players )
|
||||
{
|
||||
array< ref FPPlayer > output = new array< ref FPPlayer >;
|
||||
|
||||
for ( int i = 0; i < players.Count(); i++)
|
||||
{
|
||||
output.Insert( DeserializePlayer( players[i] ) );
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
ref array< string > SerializePlayersGUID( array< ref FPPlayer > players )
|
||||
{
|
||||
ref array< string > output = new ref array< string >;
|
||||
|
||||
for ( int i = 0; i < players.Count(); i++)
|
||||
{
|
||||
output.Insert( players[i].GetGUID() );
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
array< ref FPPlayer > DeserializePlayersGUID( ref array< string > guids )
|
||||
{
|
||||
return GetFileHandler().GetPlayers( guids );
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato,
|
||||
however this File is Execludet from GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007 since it is
|
||||
|
||||
Originally from DayZ-CommunityOnlineTools
|
||||
Link : https://github.com/Jacob-Mango/DayZ-CommunityOnlineTools
|
||||
Created by Jacob-Mango
|
||||
and Published under license (CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/
|
||||
which means this file is under CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/ Licence.
|
||||
*/
|
||||
|
||||
enum PermissionType
|
||||
{
|
||||
DISALLOW, ALLOW
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato,
|
||||
however this File is Execludet from GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007 since it is
|
||||
|
||||
Originally from DayZ-CommunityOnlineTools
|
||||
Link : https://github.com/Jacob-Mango/DayZ-CommunityOnlineTools
|
||||
Created by Jacob-Mango
|
||||
and Published under license (CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/
|
||||
which means this file is under CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/ Licence.
|
||||
*/
|
||||
|
||||
// STORE ALL PLAYERS DATA HERE FOR OUTSIDE NETWORK BUBBLE!
|
||||
|
||||
class PlayerDataN
|
||||
{
|
||||
string SName;
|
||||
string SGUID;
|
||||
string SSteam64ID;
|
||||
|
||||
int IPingMax;
|
||||
int IPingMin;
|
||||
int IPingAvg;
|
||||
|
||||
ref array< string > ARoles;
|
||||
ref array< string > APermissions;
|
||||
|
||||
vector VPosition;
|
||||
vector VDirection;
|
||||
vector VOrientation;
|
||||
|
||||
float FHealth;
|
||||
float FBlood;
|
||||
float FShock;
|
||||
|
||||
int IBloodStatType;
|
||||
|
||||
float FEnergy;
|
||||
float FWater;
|
||||
|
||||
float FHeatComfort;
|
||||
|
||||
float FWet;
|
||||
float FTremor;
|
||||
float FStamina;
|
||||
|
||||
int Kills;
|
||||
int TotalKills;
|
||||
|
||||
int ILifeSpanState;
|
||||
bool BBloodyHands;
|
||||
|
||||
void PlayerDataN()
|
||||
{
|
||||
ARoles = new ref array< string >;
|
||||
APermissions = new ref array< string >;
|
||||
}
|
||||
|
||||
static void Load( out PlayerDataN data, ref PlayerBase player )
|
||||
{
|
||||
data.VPosition = player.GetPosition();
|
||||
data.VDirection = player.GetDirection();
|
||||
data.VOrientation = player.GetOrientation();
|
||||
|
||||
data.FHealth = player.GetHealth( "GlobalHealth","Health" );
|
||||
data.FBlood = player.GetHealth( "GlobalHealth", "Blood" );
|
||||
data.FShock = player.GetHealth( "GlobalHealth", "Shock" );
|
||||
data.IBloodStatType = player.GetStatBloodType().Get();
|
||||
data.FEnergy = player.GetStatEnergy().Get();
|
||||
data.FWater = player.GetStatWater().Get();
|
||||
data.FHeatComfort = player.GetStatHeatComfort().Get();
|
||||
data.FWet = player.GetStatWet().Get();
|
||||
data.FTremor = player.GetStatTremor().Get();
|
||||
data.FStamina = player.GetStatStamina().Get();
|
||||
data.ILifeSpanState = player.GetLifeSpanState();
|
||||
data.BBloodyHands = player.HasBloodyHands();
|
||||
}
|
||||
}
|
@ -0,0 +1,187 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
class FileTeleport
|
||||
{
|
||||
ref array< ref FileTeleport > Children;
|
||||
string LocationName;
|
||||
vector LocationPos;
|
||||
bool ok = false;
|
||||
ref FileTeleport Parent;
|
||||
void FileTeleport( string name, ref FileTeleport parent = NULL, vector pos = Vector.Zero())
|
||||
{
|
||||
if(parent == NULL)
|
||||
{
|
||||
ok = true;
|
||||
}
|
||||
LocationName = name;
|
||||
LocationPos = pos;
|
||||
Parent = parent;
|
||||
//Print("Teleport Location = " + LocationName + " LocationPos = " + LocationPos);
|
||||
GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
|
||||
Children = new ref array< ref FileTeleport >;
|
||||
}
|
||||
|
||||
void AddNewLocation(string PosName, vector AdminPos)
|
||||
{
|
||||
for ( int i = 0; i < Children.Count(); i++ )
|
||||
{
|
||||
if ( PosName == Children[i].LocationName )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
//PosName = stringParam.param1;
|
||||
|
||||
vector PosOut;
|
||||
PosOut = Vector(AdminPos[0], 0.0, AdminPos[2]);
|
||||
string stringout = PosOut.ToString(false);
|
||||
AddToFile(PosName, stringout);
|
||||
Load();
|
||||
|
||||
}
|
||||
|
||||
void AddToFile(string name, string pos)
|
||||
{
|
||||
FileHandle file = OpenFile( GetFileHandler().TeleportFile, FileMode.APPEND );
|
||||
if ( file != 0 )
|
||||
{
|
||||
FPrintln(file, name + " = " + pos);
|
||||
}
|
||||
CloseFile(file);
|
||||
}
|
||||
|
||||
void AddChilds(string name, vector pos)
|
||||
{
|
||||
ref FileTeleport nChild = NULL;
|
||||
for ( int i = 0; i < Children.Count(); i++ )
|
||||
{
|
||||
if ( name == Children[i].LocationName )
|
||||
{
|
||||
nChild = Children[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( nChild == NULL )
|
||||
{
|
||||
nChild = new FileTeleport( name, this, pos);
|
||||
|
||||
Children.Insert( nChild );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Load()
|
||||
{
|
||||
Children.Clear();
|
||||
FileHandle file = OpenFile( GetFileHandler().TeleportFile, FileMode.READ );
|
||||
if ( file != 0 )
|
||||
{
|
||||
string line, LocationNameNew;
|
||||
vector LocationPosNew;
|
||||
array<string> TeleportLine = new array<string>;
|
||||
array<string> TeleportLineCut = new array<string>;
|
||||
array<string> TeleportPositions = new array<string>;
|
||||
float X, Y;
|
||||
while ( FGets( file, line ) > 0 )
|
||||
{
|
||||
TeleportLineCut.Clear();
|
||||
TeleportPositions.Clear();
|
||||
line.Split(" = ", TeleportLineCut);
|
||||
int len = TeleportLineCut[1].LengthUtf8();
|
||||
len = len - 2;
|
||||
string LocationPosPreNew = TeleportLineCut[1].Substring(2, len);
|
||||
LocationPosPreNew.Split(" ", TeleportPositions);
|
||||
X = TeleportPositions[0].ToFloat();
|
||||
Y = TeleportPositions[2].ToFloat();
|
||||
|
||||
LocationPosNew = Vector(X, 0.0, Y);
|
||||
LocationNameNew = TeleportLineCut[0];
|
||||
|
||||
NewTeleport(LocationNameNew, LocationPosNew);
|
||||
|
||||
}
|
||||
CloseFile(file);
|
||||
}
|
||||
}
|
||||
|
||||
void NewTeleport(string name, vector loc)
|
||||
{
|
||||
ref FileTeleport nChild = NULL;
|
||||
for ( int i = 0; i < Children.Count(); i++ )
|
||||
{
|
||||
if ( name == Children[i].LocationName )
|
||||
{
|
||||
nChild = Children[i];
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if ( nChild == NULL )
|
||||
{
|
||||
nChild = new FileTeleport( name, this, loc);
|
||||
Children.Insert( nChild );
|
||||
}
|
||||
}
|
||||
|
||||
void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
|
||||
{
|
||||
if(ok)
|
||||
{
|
||||
int ListCount = 0;
|
||||
PlayerBase Admin;
|
||||
//PlayerIdentity AdminIdentity;
|
||||
|
||||
switch(rpc_type)
|
||||
{
|
||||
case M_RPCs.M_Admin_Menu_Teleport_Write:
|
||||
//Param1<string> stringParam;
|
||||
string PosName;
|
||||
vector AdminPos;
|
||||
ctx.Read(PosName);
|
||||
ctx.Read(AdminPos);
|
||||
Print("");
|
||||
Print("Adding Pos");
|
||||
Print(PosName);
|
||||
Print(AdminPos);
|
||||
for ( int i = 0; i < Children.Count(); i++ )
|
||||
{
|
||||
if ( PosName == Children[i].LocationName )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
//PosName = stringParam.param1;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
vector PosOut;
|
||||
PosOut = Vector(AdminPos[0], 0.0, AdminPos[2]);
|
||||
string stringout = PosOut.ToString(false);
|
||||
AddToFile(PosName, stringout);
|
||||
Load();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
class TeleportData
|
||||
{
|
||||
ref array <ref TeleportData> Locations
|
||||
string LocationName;
|
||||
vector LocationPos;
|
||||
ref FileTeleport Parent;
|
||||
|
||||
void TeleportData(ref FileTeleport parent = NULL)
|
||||
{
|
||||
Print("TeleportData");
|
||||
|
||||
GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
|
||||
Parent = parent
|
||||
}
|
||||
|
||||
|
||||
void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
|
||||
{
|
||||
PlayerBase Admin;
|
||||
switch(rpc_type)
|
||||
{
|
||||
// case M_RPCs.M_Admin_Menu_Teleport_RequestData:
|
||||
// GetFileHandler().LoadTeleport();
|
||||
// if ( GetGame().IsServer() )
|
||||
// {
|
||||
// ref array< string > LocationNT = new ref array< string >;
|
||||
// ref array< vector > LocationP = new ref array< vector >;
|
||||
// PlayerIdentity AdminIdentity;
|
||||
// Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||
// if ( Admin != NULL)
|
||||
// {
|
||||
// AdminIdentity = Admin.GetIdentity();
|
||||
// for ( int t = 0; t < GetFileHandler().RootTeleport.Children.Count(); t++ )
|
||||
// {
|
||||
////string name = GetFileHandler().RootTeleport.Children[t].LocationName;
|
||||
// vector pos = GetFileHandler().RootTeleport.Children[t].LocationPos;
|
||||
// string name = GetFileHandler().RootTeleport.Children[t].LocationName;
|
||||
|
||||
// LocationNT.Insert(name);
|
||||
|
||||
// LocationP.Insert(pos);
|
||||
|
||||
// }
|
||||
// Print("Server - Teleport Data Rpc Sent");
|
||||
// ScriptRPC TListDst = new ScriptRPC();
|
||||
// TListDst.Write(LocationNT);
|
||||
// TListDst.Write(LocationP);
|
||||
// TListDst.Send(NULL, M_RPCs.M_Admin_Menu_Teleport_ReciveData, false, AdminIdentity);
|
||||
// }
|
||||
// }
|
||||
|
||||
// if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||
// {
|
||||
|
||||
// }
|
||||
// break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
ref TeleportData Tomato_TeleportData;
|
||||
|
||||
ref TeleportData GetTeleportData()
|
||||
{
|
||||
if( !Tomato_TeleportData )
|
||||
{
|
||||
Tomato_TeleportData = new ref TeleportData();
|
||||
}
|
||||
|
||||
return Tomato_TeleportData;
|
||||
}
|
@ -0,0 +1,296 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
class DeathHandler
|
||||
{
|
||||
string KillFile = "$profile:\\Dayz-Sa-Tomato\\Log\\Kills.txt";
|
||||
|
||||
PlayerBase KPlayerBase;
|
||||
PlayerIdentity KPlayerIdentity;
|
||||
string KName;
|
||||
vector KPos;
|
||||
int Dist;
|
||||
EntityAI KW;
|
||||
ItemBase KWItemBase;
|
||||
string KWName;
|
||||
|
||||
|
||||
PlayerBase VPlayerBase;
|
||||
PlayerIdentity VPlayerIdentity;
|
||||
string VName;
|
||||
vector VPos;
|
||||
|
||||
string OutMessage;
|
||||
|
||||
void DeathHandler()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void log(string log)
|
||||
{
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
if(FileExist(KillFile))
|
||||
{
|
||||
FileHandle file = OpenFile(KillFile, FileMode.APPEND);
|
||||
if (file != 0)
|
||||
{
|
||||
FPrintln(file, LineIn() + log);
|
||||
CloseFile(file);
|
||||
}
|
||||
}else
|
||||
{
|
||||
MakeDirectory(KillFile);
|
||||
if (file != 0)
|
||||
{
|
||||
FPrintln(file, LineIn() + log);
|
||||
CloseFile(file);
|
||||
}
|
||||
Print("Could not create Folder/File " + KillFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string LineIn()
|
||||
{
|
||||
int year, month, day, hour, minute, second;
|
||||
GetYearMonthDay(year, month, day);
|
||||
GetHourMinuteSecond(hour, minute, second);
|
||||
string date = day.ToStringLen(2) + "." + month.ToStringLen(2) + "." + year.ToStringLen(4) + " " + hour.ToStringLen(2) + ":" + minute.ToStringLen(2);
|
||||
string LineIn = "[" + date + "] - ";
|
||||
return LineIn;
|
||||
}
|
||||
void ConnectHandler(PlayerIdentity player)
|
||||
{
|
||||
string msg;
|
||||
if (GetFileHandler().IsConfig("Welcome_Message"))
|
||||
{
|
||||
msg = GetMessage(GetFileHandler().GetConfig("Welcome_Message_Join"), VName);
|
||||
int count = msg.Replace("{Player}", player.GetName());
|
||||
GetGame().ChatPlayer(0, msg);
|
||||
}
|
||||
}
|
||||
void KilledHandler(Object killer, PlayerBase pbKilled)
|
||||
{
|
||||
KPlayerBase = NULL;
|
||||
// Victim
|
||||
VPlayerBase = PlayerBase.Cast(pbKilled);
|
||||
VPlayerIdentity = VPlayerBase.GetIdentity();
|
||||
VName = VPlayerIdentity.GetName();
|
||||
|
||||
OutMessage = "";
|
||||
|
||||
IsMan(killer);
|
||||
SelectKillType();
|
||||
IsAnimal(killer);
|
||||
Send();
|
||||
|
||||
}
|
||||
|
||||
void Send()
|
||||
{
|
||||
if (OutMessage != "")
|
||||
{
|
||||
GetGame().ChatPlayer(0, OutMessage);
|
||||
}
|
||||
}
|
||||
|
||||
void IsAnimal(Object killer)
|
||||
{
|
||||
if (killer.IsKindOf("AnimalBase"))
|
||||
{
|
||||
if (GetFileHandler().IsConfig("KillFeed_Message_Animal"))
|
||||
{
|
||||
OutMessage = GetMessage(GetFileHandler().GetConfig("KillFeed_Animal"), VName);
|
||||
}
|
||||
}
|
||||
else if (killer.IsKindOf("ZombieBase"))
|
||||
{
|
||||
if (GetFileHandler().IsConfig("KillFeed_Message_Zombie")) //TODO
|
||||
{
|
||||
OutMessage = GetMessage(GetFileHandler().GetConfig("KillFeed_Zombie"), VName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetFileHandler().IsConfig("KillFeed_Message_Unknown"))
|
||||
{
|
||||
OutMessage = GetMessage(GetFileHandler().GetConfig("KillFeed_Unknown"), VName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void SelectKillType()
|
||||
{
|
||||
if (KPlayerBase)
|
||||
{
|
||||
if (VPlayerBase == KPlayerBase)
|
||||
{
|
||||
if (GetFileHandler().IsConfig("KillFeed_Message_Suicide"))
|
||||
{
|
||||
OutMessage = GetMessage(GetFileHandler().GetConfig("KillFeed_Suicide"), VName);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
KPlayerIdentity = NULL;
|
||||
KPlayerIdentity = KPlayerBase.GetIdentity();
|
||||
KName = KPlayerIdentity.GetName();
|
||||
KPos = KPlayerBase.GetPosition();
|
||||
VPos = VPlayerBase.GetPosition();
|
||||
Dist = vector.Distance(VPos, KPos);
|
||||
KW = KPlayerBase.GetHumanInventory().GetEntityInHands();
|
||||
|
||||
if (KW.IsItemBase())
|
||||
{
|
||||
KWItemBase = ItemBase.Cast(KW);
|
||||
KWName = KWItemBase.GetDisplayName();
|
||||
|
||||
if (KPlayerBase.GetDisplayName() == KWName)
|
||||
{
|
||||
if(GetFileHandler().IsConfig("KillFeed_LogToFile"))
|
||||
{
|
||||
string Lmessage = GetMessage(GetFileHandler().GetConfig("KillFeed_ByPlayerHand"), VName, KName)
|
||||
log(Lmessage);
|
||||
}
|
||||
|
||||
if (GetFileHandler().IsConfig("KillFeed_Message_PlayerHand"))
|
||||
{
|
||||
OutMessage = GetMessage(GetFileHandler().GetConfig("KillFeed_ByPlayerHand"), VName, KName);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if(GetFileHandler().IsConfig("KillFeed_LogToFile"))
|
||||
{
|
||||
Lmessage = GetMessage(GetFileHandler().GetConfig("KillFeed_ByPlayerWeapon"), VName, KName, KWName, Dist.ToString())
|
||||
log(Lmessage);
|
||||
}
|
||||
|
||||
if (GetFileHandler().IsConfig("KillFeed_Message_PlayerWeapon")
|
||||
{
|
||||
OutMessage = GetMessage(GetFileHandler().GetConfig("KillFeed_ByPlayerWeapon"), VName, KName, KWName, Dist.ToString());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void IsMan(Object killer)
|
||||
{
|
||||
if (killer.IsMan())
|
||||
{
|
||||
if (killer.IsKindOf("SurvivorBase"))
|
||||
{
|
||||
KPlayerBase = PlayerBase.Cast(killer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (killer.IsItemBase())
|
||||
{
|
||||
KWItemBase = ItemBase.Cast(killer);
|
||||
KPlayerBase = PlayerBase.Cast(KWItemBase.GetHierarchyRootPlayer());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledHandlerOld(Object killer, PlayerBase pbKilled)
|
||||
{
|
||||
string Killername;
|
||||
string Killedname;
|
||||
SurvivorBase sbKilled = SurvivorBase.Cast(pbKilled);
|
||||
if (killer.IsMan()) {
|
||||
|
||||
Man manKiller = Man.Cast(killer);
|
||||
|
||||
if (sbKilled.GetPFullName() == manKiller.GetIdentity().GetName()) {
|
||||
|
||||
string KilledBySuicide = GetFileHandler().GetConfig("KillFeed_Suicide");
|
||||
Killedname = sbKilled.GetPFullName();
|
||||
GetGame().ChatPlayer( 0, GetMessage(KilledBySuicide, Killedname));
|
||||
// TL.all(GetMessage(KilledBySuicide, Killedname));
|
||||
// TL.all(sbKilled.GetPFullName() + " took his own life");
|
||||
|
||||
} else
|
||||
{
|
||||
SurvivorBase sbKiller = SurvivorBase.Cast(killer);
|
||||
string KilledByPlayer = GetFileHandler().GetConfig("KillFeed_ByPlayer");
|
||||
Killername = sbKiller.GetPFullName();
|
||||
Killedname = sbKilled.GetPFullName();
|
||||
GetGame().ChatPlayer( 0, GetMessage(KilledByPlayer, Killedname , Killername));
|
||||
// TL.all(GetMessage(KilledByPlayer, Killedname, Killername));
|
||||
}
|
||||
} else
|
||||
{
|
||||
string KilledByBleed = GetFileHandler().GetConfig("KillFeed_Bleeding_Zombie");
|
||||
Killedname = sbKilled.GetPFullName();
|
||||
GetGame().ChatPlayer( 0, GetMessage(KilledByBleed, Killedname));
|
||||
// TL.all(GetMessage(KilledByBleed, Killedname));
|
||||
}
|
||||
}
|
||||
|
||||
string GetMessage(string input, string killed, string killer = "" , string weap = "", string dist = "")
|
||||
{
|
||||
int count = input.Replace("{Killed}", killed);
|
||||
if(killer != "")
|
||||
{
|
||||
count = input.Replace("{Killer}", killer);
|
||||
}
|
||||
|
||||
if(weap != "")
|
||||
{
|
||||
count = input.Replace("{Weapon}", weap);
|
||||
}
|
||||
|
||||
if(dist != "")
|
||||
{
|
||||
count = input.Replace("{Distance}", dist);
|
||||
}
|
||||
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ref DeathHandler Tomato_DeathHandler;
|
||||
|
||||
// ref DeathHandler GetDeathHandler()
|
||||
// {
|
||||
// if( !Tomato_DeathHandler )
|
||||
// {
|
||||
// Tomato_DeathHandler = new ref DeathHandler();
|
||||
// }
|
||||
|
||||
// return Tomato_DeathHandler;
|
||||
// }
|
@ -0,0 +1,435 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class LogHandler
|
||||
{
|
||||
string LogFolderPath = GetFileHandler().LogFolderPath;
|
||||
|
||||
|
||||
string LineIn()
|
||||
{
|
||||
int year, month, day, hour, minute, second;
|
||||
GetYearMonthDay(year, month, day);
|
||||
GetHourMinuteSecond(hour, minute, second);
|
||||
string date = day.ToStringLen(2) + "." + month.ToStringLen(2) + "." + year.ToStringLen(4) + " " + hour.ToStringLen(2) + ":" + minute.ToStringLen(2);
|
||||
string LineIn = "[" + date + "] - ";
|
||||
return LineIn;
|
||||
}
|
||||
|
||||
|
||||
void LogHandler()
|
||||
{
|
||||
GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
|
||||
}
|
||||
|
||||
ref PlayerBase GetPlayerBaseByName(string name)
|
||||
{
|
||||
|
||||
array<Man> players = new array<Man>;
|
||||
|
||||
PlayerBase selectedPlayer;
|
||||
PlayerIdentity selectedIdentity;
|
||||
|
||||
GetGame().GetPlayers( players );
|
||||
for ( int a = 0; a < players.Count(); ++a )
|
||||
{
|
||||
selectedPlayer = PlayerBase.Cast(players.Get(a));
|
||||
selectedIdentity = selectedPlayer.GetIdentity();
|
||||
if ( selectedIdentity.GetName() == name )
|
||||
{
|
||||
return selectedPlayer;
|
||||
}
|
||||
}
|
||||
return selectedPlayer;
|
||||
}
|
||||
|
||||
ref PlayerIdentity GetIdent(string name)
|
||||
{
|
||||
|
||||
array<Man> players = new array<Man>;
|
||||
|
||||
PlayerBase selectedPlayer;
|
||||
PlayerIdentity selectedIdentity;
|
||||
|
||||
GetGame().GetPlayers( players );
|
||||
for ( int a = 0; a < players.Count(); ++a )
|
||||
{
|
||||
selectedPlayer = PlayerBase.Cast(players.Get(a));
|
||||
selectedIdentity = selectedPlayer.GetIdentity();
|
||||
if ( selectedIdentity.GetName() == name )
|
||||
{
|
||||
return selectedIdentity;
|
||||
}
|
||||
}
|
||||
return selectedIdentity;
|
||||
}
|
||||
|
||||
void status(PlayerIdentity ident, string msg)
|
||||
{
|
||||
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_MessageStatus, new Param1<string>( msg ), false, ident );
|
||||
}
|
||||
|
||||
void playern(PlayerIdentity ident, string msg)
|
||||
{
|
||||
Param1<string> Msgparam = new Param1<string>( msg );
|
||||
GetGame().RPCSingleParam(NULL , ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam, true, ident);
|
||||
}
|
||||
|
||||
void player(PlayerIdentity ident, string msg)
|
||||
{
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
GetGame().RPCSingleParam(NULL, M_RPCs.M_Admin_Message, new Param1<string>(msg), true, ident);
|
||||
}else{
|
||||
GetGame().GetMission().OnEvent(ChatMessageEventTypeID, new ChatMessageEventParams(0, "", msg, ""));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void playerSetup()
|
||||
{
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
|
||||
}else{
|
||||
GetGame().RPCSingleParam(NULL, M_RPCs.M_Admin_Message_Setup, new Param1<string>(""), true, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void all(string msg)
|
||||
{
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
|
||||
ref array< Man > allPlayers = new ref array< Man >;
|
||||
GetGame().GetWorld().GetPlayerList(allPlayers);
|
||||
foreach( Man man : allPlayers )
|
||||
{
|
||||
PlayerBase playerBase = PlayerBase.Cast(man);
|
||||
playerBase.RPCSingleParam(ERPCs.RPC_USER_ACTION_MESSAGE, new Param1<string>(msg), false, playerBase.GetIdentity());
|
||||
}
|
||||
}else{
|
||||
ScriptRPC Rpc = new ScriptRPC();
|
||||
Rpc.Write(msg);
|
||||
Rpc.Send(NULL, M_RPCs.M_Admin_Log_all, true, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void allWhite(string msg)
|
||||
{
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
|
||||
GetGame().ChatPlayer(0, msg);
|
||||
}else{
|
||||
ScriptRPC Rpc = new ScriptRPC();
|
||||
Rpc.Write(msg);
|
||||
Rpc.Send(NULL, M_RPCs.M_Admin_Log_all_White, true, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void cons(string log)
|
||||
{
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
Debug.Log(log)
|
||||
}else{
|
||||
ScriptRPC Rpc = new ScriptRPC();
|
||||
Rpc.Write(log);
|
||||
Rpc.Send(NULL, M_RPCs.M_Admin_Log_con, true, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void dbug(string log)
|
||||
{
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
if(FileExist(LogFolderPath))
|
||||
{
|
||||
FileHandle file = OpenFile(LogFolderPath + "Debug.txt", FileMode.APPEND);
|
||||
if (file != 0)
|
||||
{
|
||||
FPrintln(file, LineIn() + log);
|
||||
CloseFile(file);
|
||||
}
|
||||
}else
|
||||
{
|
||||
MakeDirectory(LogFolderPath);
|
||||
if (file != 0)
|
||||
{
|
||||
FPrintln(file, LineIn() + log);
|
||||
CloseFile(file);
|
||||
}
|
||||
Print("Could not create Folder/File " + LogFolderPath + "Debug.txt");
|
||||
}
|
||||
}else
|
||||
{
|
||||
ScriptRPC Rpc = new ScriptRPC();
|
||||
Rpc.Write(log);
|
||||
Rpc.Send(NULL, M_RPCs.M_Admin_Menu_Log_Debug, true, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void kill(string log)
|
||||
{
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
if(FileExist(LogFolderPath))
|
||||
{
|
||||
FileHandle file = OpenFile(LogFolderPath + "Kills.txt", FileMode.APPEND);
|
||||
if (file != 0)
|
||||
{
|
||||
FPrintln(file, LineIn() + log);
|
||||
CloseFile(file);
|
||||
}
|
||||
}else
|
||||
{
|
||||
MakeDirectory(LogFolderPath);
|
||||
if (file != 0)
|
||||
{
|
||||
FPrintln(file, LineIn() + log);
|
||||
CloseFile(file);
|
||||
}
|
||||
Print("Could not create Folder/File " + LogFolderPath + "Kills.txt");
|
||||
}
|
||||
}else
|
||||
{
|
||||
ScriptRPC Rpc = new ScriptRPC();
|
||||
Rpc.Write(log);
|
||||
Rpc.Send(NULL, M_RPCs.M_Admin_Menu_Log_Debug, true, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void admin(string log)
|
||||
{
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
if(FileExist(LogFolderPath))
|
||||
{
|
||||
FileHandle file = OpenFile(LogFolderPath + "Admin.txt", FileMode.APPEND);
|
||||
if (file != 0)
|
||||
{
|
||||
FPrintln(file, LineIn() + log);
|
||||
CloseFile(file);
|
||||
}
|
||||
}else{
|
||||
MakeDirectory(LogFolderPath + "Admin.txt");
|
||||
if (file != 0)
|
||||
{
|
||||
FPrintln(file, LineIn() + log);
|
||||
CloseFile(file);
|
||||
}
|
||||
}
|
||||
}else
|
||||
{
|
||||
ScriptRPC Rpc = new ScriptRPC();
|
||||
Rpc.Write(log);
|
||||
Rpc.Send(NULL, M_RPCs.M_Admin_Menu_Log_Admin, true, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void error(string log)
|
||||
{
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
if(FileExist(LogFolderPath))
|
||||
{
|
||||
FileHandle file = OpenFile(LogFolderPath + "Error.txt", FileMode.APPEND);
|
||||
if (file != 0)
|
||||
{
|
||||
FPrintln(file, LineIn() + log);
|
||||
CloseFile(file);
|
||||
}
|
||||
}else{
|
||||
MakeDirectory(LogFolderPath + "Error.txt");
|
||||
if (file != 0)
|
||||
{
|
||||
FPrintln(file, LineIn() + log);
|
||||
CloseFile(file);
|
||||
}
|
||||
Print("Could not create Folder/File " + LogFolderPath + "Error.txt");
|
||||
}
|
||||
}else
|
||||
{
|
||||
ScriptRPC Rpc = new ScriptRPC();
|
||||
Rpc.Write(log);
|
||||
Rpc.Send(NULL, M_RPCs.M_Admin_Log_error, true, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void info(string log)
|
||||
{
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
if(FileExist(LogFolderPath))
|
||||
{
|
||||
FileHandle file = OpenFile(LogFolderPath + "Info.txt", FileMode.APPEND);
|
||||
if (file != 0)
|
||||
{
|
||||
FPrintln(file, LineIn() + log);
|
||||
CloseFile(file);
|
||||
}
|
||||
}else{
|
||||
MakeDirectory(LogFolderPath + "Info.txt");
|
||||
if (file != 0)
|
||||
{
|
||||
FPrintln(file, LineIn() + log);
|
||||
CloseFile(file);
|
||||
}
|
||||
Print("Could not create Folder/File " + LogFolderPath + "Info.txt");
|
||||
}
|
||||
}else
|
||||
{
|
||||
ScriptRPC Rpc = new ScriptRPC();
|
||||
Rpc.Write(log);
|
||||
Rpc.Send(NULL, M_RPCs.M_Admin_Log_info, true, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
|
||||
{
|
||||
string msg;
|
||||
string player;
|
||||
switch(rpc_type)
|
||||
{
|
||||
case M_RPCs.M_Admin_Message:
|
||||
Param1< string > specParams;
|
||||
ctx.Read( specParams );
|
||||
if ( GetGame().IsClient() )
|
||||
{
|
||||
player(sender, specParams.param1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Message_Setup:
|
||||
//ctx.Read( specParams );
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
if(GetFileHandler().IsConfig("Setup"))
|
||||
{
|
||||
if(GetFileHandler().HasPermission("Admin", sender))
|
||||
{
|
||||
player(sender, "Admin Set Menu Should open !")
|
||||
}else{
|
||||
player(sender,"Admin not set type /opme and try again")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Log_info:
|
||||
ctx.Read( msg );
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
if(GetFileHandler().HasPermission("Admin", sender))
|
||||
{
|
||||
info(msg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Log_error:
|
||||
ctx.Read( msg );
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
if(GetFileHandler().HasPermission("Admin", sender))
|
||||
{
|
||||
error(msg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Menu_Log_Admin:
|
||||
ctx.Read( msg );
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
if(GetFileHandler().HasPermission("Admin", sender))
|
||||
{
|
||||
admin(msg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Menu_Log_Debug:
|
||||
ctx.Read( msg );
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
if(GetFileHandler().HasPermission("Admin", sender))
|
||||
{
|
||||
dbug(msg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Log_con:
|
||||
ctx.Read( msg );
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
if(GetFileHandler().HasPermission("Admin", sender))
|
||||
{
|
||||
cons(msg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Log_all:
|
||||
ctx.Read( msg );
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
if(GetFileHandler().HasPermission("Admin", sender))
|
||||
{
|
||||
all(msg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Log_all_White:
|
||||
ctx.Read( msg );
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
if(GetFileHandler().HasPermission("Admin", sender))
|
||||
{
|
||||
allWhite(msg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ref LogHandler Tomato_LogHandler;
|
||||
|
||||
ref LogHandler TL()
|
||||
{
|
||||
if( !Tomato_LogHandler )
|
||||
{
|
||||
Tomato_LogHandler = new ref LogHandler();
|
||||
}
|
||||
|
||||
return Tomato_LogHandler;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
modded class EmoteManager
|
||||
{
|
||||
override void LogSuicide()
|
||||
{
|
||||
m_Player.issic(true);
|
||||
super.LogSuicide();
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
modded class PlayerBase
|
||||
{
|
||||
ref FPPlayer authentiPlayer;
|
||||
|
||||
ref DeathHandler m_DeathHandler;
|
||||
|
||||
override void OnConnect()
|
||||
{
|
||||
m_DeathHandler = new ref DeathHandler;
|
||||
// TL().cons("Player connected: " + this.ToString());
|
||||
ref SurvivorBase m_SurBase = SurvivorBase.Cast(this);
|
||||
m_SurBase.SetPID(this.GetIdentity().GetPlainId());
|
||||
m_SurBase.SetPFullName(this.GetIdentity().GetName());
|
||||
|
||||
// NEW STATS API
|
||||
// StatRegister("playtime");
|
||||
// StatRegister("dist");
|
||||
|
||||
Debug.Log("Player connected:"+this.ToString(),"Connect");
|
||||
m_DeathHandler.ConnectHandler(this.GetIdentity());
|
||||
// NEW STATS API
|
||||
StatRegister("playtime");
|
||||
StatRegister("dist");
|
||||
|
||||
m_PlayerOldPos = GetPosition();
|
||||
if( m_AnalyticsTimer )
|
||||
m_AnalyticsTimer.Run( 60, this, "UpdatePlayerMeasures", null, true );
|
||||
|
||||
}
|
||||
override void EEKilled( Object killer )
|
||||
{
|
||||
PlayerBase Killer_Playerbase; // Killer PlayerBase
|
||||
m_DeathHandler.KilledHandler(killer, this);
|
||||
|
||||
if( GetBleedingManagerServer() ) delete GetBleedingManagerServer();
|
||||
|
||||
|
||||
|
||||
// kill character in database
|
||||
if (GetHive())
|
||||
{
|
||||
GetHive().CharacterKill(this);
|
||||
}
|
||||
|
||||
// disable voice communication
|
||||
GetGame().EnableVoN(this, false);
|
||||
|
||||
|
||||
|
||||
GetSymptomManager().OnPlayerKilled();
|
||||
|
||||
super.EEKilled(killer);
|
||||
}
|
||||
|
||||
bool selfkill = false;
|
||||
void issic(bool Yep)
|
||||
{
|
||||
selfkill = Yep;
|
||||
}
|
||||
|
||||
bool CanBeDeleted()
|
||||
{
|
||||
return IsAlive() && !IsRestrained() && !IsUnconscious();
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
modded class SurvivorBase
|
||||
{
|
||||
private string PID = "empty";
|
||||
private string PFullName = "empty";
|
||||
|
||||
string GetPID()
|
||||
{
|
||||
return PID;
|
||||
}
|
||||
|
||||
void SetPID(string IdentityID)
|
||||
{
|
||||
PID = IdentityID;
|
||||
}
|
||||
|
||||
string GetPFullName()
|
||||
{
|
||||
return PFullName;
|
||||
}
|
||||
|
||||
void SetPFullName(string name)
|
||||
{
|
||||
PFullName = name;
|
||||
}
|
||||
}
|
@ -0,0 +1,482 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
class FileHandler
|
||||
{
|
||||
//Main Folder
|
||||
string MainFolder = "$profile:\\Tomato_Profiles";
|
||||
string MainFolderPath = "$profile:\\Tomato_Profiles\\";
|
||||
//Config Folder and Files
|
||||
string ConfigFolder = MainFolderPath + "Config";
|
||||
string ConfigFolderPath = MainFolderPath + "Config\\";
|
||||
string ConfigFile = ConfigFolderPath + "Config.txt";
|
||||
//Players Folder
|
||||
string PlayersFolderPath = ConfigFolderPath + "Players\\";
|
||||
//Log Folder and Files
|
||||
string LogFolder = MainFolderPath + "Log";
|
||||
string LogFolderPath = MainFolderPath + "Log\\";
|
||||
string LErrorFile = LogFolderPath + "Error.txt";
|
||||
string LDebugFile = LogFolderPath + "Debug.txt";
|
||||
string LInfoFile = LogFolderPath + "Info.txt";
|
||||
string LAdminFile = LogFolderPath + "Admin.txt";
|
||||
string LKillsFile = LogFolderPath + "Kills.txt";
|
||||
//Customization Folder and Files
|
||||
string CustomizationFolder = MainFolderPath + "Customization";
|
||||
string CustomizationFolderPath = MainFolderPath + "Customization\\";
|
||||
string TeleportFile = CustomizationFolderPath + "Teleport_Locations.txt";
|
||||
bool IsExit = false;
|
||||
ref FileConfig RootConfig;
|
||||
ref FileTeleport RootTeleport;
|
||||
//ref FilePlayers RootPlayers;
|
||||
|
||||
// NEW BEGINN
|
||||
ref array< ref FPPlayer > FPPlayers;
|
||||
ref FPPermission RootPermission;
|
||||
// NEW END
|
||||
|
||||
|
||||
|
||||
|
||||
void FileHandler()
|
||||
{
|
||||
RootConfig = new ref FileConfig( "ROOT" );
|
||||
RootTeleport = new ref FileTeleport( "ROOT" );
|
||||
//RootPlayers = new ref FilePlayers( "ROOT" );
|
||||
|
||||
// NEW BEGINN
|
||||
FPPlayers = new ref array< ref FPPlayer >;
|
||||
RootPermission = new ref FPPermission( "ROOT" );
|
||||
// NEW END
|
||||
|
||||
}
|
||||
|
||||
// NEW BEGINN
|
||||
|
||||
void SetPermission(string perm, PermissionType type, string id) //Identity.GetID()
|
||||
{
|
||||
Print("FileHandler");
|
||||
for ( int i = 0; i < FPPlayers.Count(); i++ )
|
||||
{
|
||||
if ( FPPlayers[i].GetGUID() == id )
|
||||
{
|
||||
Print("FileHanddler Player Founf");
|
||||
FPPlayers[i].SetPermission(perm , type);
|
||||
//return FPPlayers[i].HasPermission( fPPermission );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
array< ref FPPlayer > GetPlayers( ref array< string > guids = NULL )
|
||||
{
|
||||
if ( guids == NULL )
|
||||
{
|
||||
return FPPlayers;
|
||||
}
|
||||
|
||||
array< ref FPPlayer > tempArray = new array< ref FPPlayer >;
|
||||
|
||||
for ( int i = 0; i < guids.Count(); i++ )
|
||||
{
|
||||
for ( int k = 0; k < FPPlayers.Count(); k++ )
|
||||
{
|
||||
if ( guids[i] == FPPlayers[k].GetGUID() )
|
||||
{
|
||||
tempArray.Insert( FPPlayers[k] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tempArray;
|
||||
}
|
||||
|
||||
void SetPlayers( ref array< ref FPPlayer > players )
|
||||
{
|
||||
FPPlayers.Clear();
|
||||
|
||||
// This doesn't work??? wtf
|
||||
//FPPlayers.Copy( players );
|
||||
|
||||
for ( int i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
FPPlayers.Insert( players[i] );
|
||||
}
|
||||
}
|
||||
|
||||
void AddPlayers( ref array< ref FPPlayer > players )
|
||||
{
|
||||
for ( int i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
FPPlayers.Insert( players[i] );
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterPermission( string fPPermission, PermissionType type = PermissionType.DISALLOW )
|
||||
{
|
||||
RootPermission.AddPermission( fPPermission, type );
|
||||
}
|
||||
|
||||
ref array< string > ToPermArray()
|
||||
{
|
||||
ref array< string > data = new ref array< string >;
|
||||
RootPermission.ToPermArray( data );
|
||||
return data;
|
||||
}
|
||||
|
||||
ref FPPermission GetRootPermission()
|
||||
{
|
||||
return RootPermission;
|
||||
}
|
||||
|
||||
bool HasPermission( string fPPermission, PlayerIdentity player = NULL )
|
||||
{
|
||||
if ( !GetGame().IsMultiplayer() ) return true;
|
||||
|
||||
if ( player == NULL )
|
||||
{
|
||||
if ( ClientAuthPlayer == NULL )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return ClientAuthPlayer.HasPermission( fPPermission );
|
||||
}
|
||||
|
||||
for ( int i = 0; i < FPPlayers.Count(); i++ )
|
||||
{
|
||||
if ( FPPlayers[i].GetGUID() == player.GetId() )
|
||||
{
|
||||
return FPPlayers[i].HasPermission( fPPermission );
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
ref FPPlayer PlayerJoined( PlayerIdentity player )
|
||||
{
|
||||
ref PlayerDataN data = new ref PlayerDataN;
|
||||
|
||||
if ( player )
|
||||
{
|
||||
data.SName = player.GetName();
|
||||
data.SGUID = player.GetId();
|
||||
data.SSteam64ID = player.GetPlainId();
|
||||
} else
|
||||
{
|
||||
data.SName = "Offline Mode";
|
||||
data.SGUID = "N/A";
|
||||
}
|
||||
|
||||
ref FPPlayer auPlayer = new ref FPPlayer( data );
|
||||
|
||||
auPlayer.IdentityPlayer = player;
|
||||
|
||||
auPlayer.CopyPermissions( RootPermission );
|
||||
|
||||
auPlayer.Load();
|
||||
|
||||
FPPlayers.Insert( auPlayer );
|
||||
|
||||
return auPlayer;
|
||||
}
|
||||
|
||||
void PlayerLeft( PlayerIdentity player )
|
||||
{
|
||||
ref PlayerDataN PData = new ref PlayerDataN;
|
||||
if ( player == NULL ) return;
|
||||
|
||||
for ( int i = 0; i < FPPlayers.Count(); i++ )
|
||||
{
|
||||
ref FPPlayer auPlayer = FPPlayers[i];
|
||||
|
||||
if ( auPlayer.GetSteam64ID() == player.GetPlainId() )
|
||||
{
|
||||
auPlayer.Save();
|
||||
|
||||
if ( GetGame().IsServer() && GetGame().IsMultiplayer() )
|
||||
{
|
||||
PData = SerializePlayer( auPlayer );
|
||||
ScriptRPC Adding = new ScriptRPC();
|
||||
Adding.Write(PData);
|
||||
Adding.Send(NULL, M_RPCs.M_Admin_Player_RemovePlayer, true, NULL);
|
||||
//GetRPCManager().SendRPC( "PermissionsFramework", "RemovePlayer", new Param1< ref PlayerDataN >( SerializePlayer( auPlayer ) ), true );
|
||||
}
|
||||
|
||||
FPPlayers.Remove( i );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// void DebugPrint()
|
||||
// {
|
||||
// Print( "Printing all authenticated players!" );
|
||||
// for ( int i = 0; i < FPPlayers.Count(); i++ )
|
||||
// {
|
||||
// FPPlayers[i].DebugPrint();
|
||||
// }
|
||||
// }
|
||||
|
||||
ref FPPlayer GetPlayerByGUID( string guid )
|
||||
{
|
||||
ref FPPlayer auPlayer = NULL;
|
||||
|
||||
for ( int i = 0; i < FPPlayers.Count(); i++ )
|
||||
{
|
||||
if ( FPPlayers[i].GetGUID() == guid )
|
||||
{
|
||||
auPlayer = FPPlayers[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( auPlayer == NULL )
|
||||
{
|
||||
ref PlayerDataN data = new ref PlayerDataN;
|
||||
|
||||
data.SGUID = guid;
|
||||
|
||||
auPlayer = new ref FPPlayer( data );
|
||||
|
||||
FPPlayers.Insert( auPlayer );
|
||||
}
|
||||
|
||||
return auPlayer;
|
||||
}
|
||||
|
||||
ref FPPlayer GetPlayerByIdentity( PlayerIdentity ident )
|
||||
{
|
||||
if ( ident == NULL ) return NULL;
|
||||
|
||||
ref FPPlayer auPlayer = NULL;
|
||||
|
||||
for ( int i = 0; i < FPPlayers.Count(); i++ )
|
||||
{
|
||||
if ( FPPlayers[i].GetGUID() == ident.GetId() )
|
||||
{
|
||||
auPlayer = FPPlayers[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( auPlayer == NULL )
|
||||
{
|
||||
auPlayer = PlayerJoined( ident );
|
||||
}
|
||||
|
||||
return auPlayer
|
||||
}
|
||||
|
||||
ref FPPlayer GetPlayer( ref PlayerDataN data )
|
||||
{
|
||||
if ( data == NULL ) return NULL;
|
||||
|
||||
ref FPPlayer auPlayer = NULL;
|
||||
|
||||
for ( int i = 0; i < FPPlayers.Count(); i++ )
|
||||
{
|
||||
if ( FPPlayers[i].GetGUID() == data.SGUID )
|
||||
{
|
||||
auPlayer = FPPlayers[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( auPlayer == NULL )
|
||||
{
|
||||
auPlayer = new ref FPPlayer( data );
|
||||
|
||||
FPPlayers.Insert( auPlayer );
|
||||
}
|
||||
|
||||
auPlayer.NewData( data );
|
||||
|
||||
auPlayer.ToPermData();
|
||||
|
||||
return auPlayer;
|
||||
}
|
||||
|
||||
// NEW END
|
||||
void AddLocation(string PosName, vector AdminPos)
|
||||
{
|
||||
RootTeleport.AddNewLocation(PosName, AdminPos)
|
||||
}
|
||||
void LoadTeleport()
|
||||
{
|
||||
RootTeleport.Load();
|
||||
}
|
||||
|
||||
void RegisterNewconfig( string CfgName , string type, string data = "")
|
||||
{
|
||||
Print("RegisterNewconfig Data = " + data)
|
||||
RootConfig.RegisterNewconfig( CfgName, type , data);
|
||||
}
|
||||
|
||||
void PrintAllConfigs()
|
||||
{
|
||||
RootConfig.PrintAll();
|
||||
}
|
||||
|
||||
void ConfigInitialize()
|
||||
{
|
||||
RootConfig.ConfigInitialize();
|
||||
}
|
||||
|
||||
|
||||
bool IsConfig( string CfgName)
|
||||
{
|
||||
bool iscfg = false;
|
||||
iscfg = RootConfig.IsConfig(CfgName);
|
||||
return iscfg;
|
||||
}
|
||||
|
||||
string GetConfig( string CfgName)
|
||||
{
|
||||
string getConf = "";
|
||||
getConf = RootConfig.GetConfigData(CfgName);
|
||||
return getConf;
|
||||
}
|
||||
|
||||
void CheckAndCreateFiles()
|
||||
{
|
||||
Print("DayZ-Sa-Tomato Checking File system");
|
||||
CheckFolder(MainFolder);
|
||||
CheckFolder(ConfigFolder);
|
||||
CheckFolder(CustomizationFolder);
|
||||
CheckFolder(LogFolder);
|
||||
|
||||
CheckFile(LKillsFile);
|
||||
CheckFile(TeleportFile);
|
||||
CheckFile(LErrorFile);
|
||||
CheckFile(LDebugFile);
|
||||
CheckFile(LInfoFile);
|
||||
CheckFile(LAdminFile);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CheckFile(string File)
|
||||
{
|
||||
if(FileExist(File))
|
||||
{
|
||||
Print("FileHandler : File " + File + " found!");
|
||||
}else
|
||||
{
|
||||
FileHandle file = OpenFile(File, FileMode.APPEND);
|
||||
if (file != 0)
|
||||
{
|
||||
FPrintln(file, "");
|
||||
CloseFile(file);
|
||||
}
|
||||
if(FileExist(File))
|
||||
{
|
||||
if(File == TeleportFile)
|
||||
{
|
||||
CreateTeleportFile();
|
||||
}else
|
||||
{
|
||||
Print("FileHandler : File " + File + " Created");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetConfigType(string name, string stype)
|
||||
{
|
||||
ConfigType type
|
||||
if(stype == "true"){type = ConfigType.true;}
|
||||
else if (stype == "false"){type = ConfigType.false;}
|
||||
else if (stype == "custom"){type = ConfigType.custom;}
|
||||
|
||||
for ( int i = 0; i < RootConfig.Children.Count(); i++ )
|
||||
{
|
||||
if ( name == RootConfig.Children[i].ConfigName )
|
||||
{
|
||||
RootConfig.Children[i].SetConfigType(type);
|
||||
}
|
||||
}
|
||||
|
||||
RootConfig.WriteToFile();
|
||||
}
|
||||
|
||||
void SetConfigData(string name, string data)
|
||||
{
|
||||
for ( int i = 0; i < RootConfig.Children.Count(); i++ )
|
||||
{
|
||||
if ( name == RootConfig.Children[i].ConfigName )
|
||||
{
|
||||
RootConfig.Children[i].SetConfigData(data);
|
||||
}
|
||||
}
|
||||
RootConfig.WriteToFile();
|
||||
}
|
||||
|
||||
void CheckFolder(string Folder)
|
||||
{
|
||||
if(FileExist(Folder))
|
||||
{
|
||||
Print("FileHandler : Folder " + Folder + " found!");
|
||||
}else
|
||||
{
|
||||
MakeDirectory(Folder);
|
||||
if(FileExist(Folder))
|
||||
{
|
||||
Print("FileHandler : Folder " + Folder + " Created");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CreateTeleportFile()
|
||||
{
|
||||
FileHandle file = OpenFile(TeleportFile, FileMode.APPEND);
|
||||
if (file != 0)
|
||||
{
|
||||
FPrintln(file, "Prison Island = 2651.42 0.0 1395.8");
|
||||
FPrintln(file, "Mogilevka = 7572.65 0.0 5182.3");
|
||||
FPrintln(file, "Stary Sobor = 6192.39 0.0 7666.5");
|
||||
FPrintln(file, "Msta = 11206.6 0.0 5398.70");
|
||||
FPrintln(file, "Solnichniy = 13436.5 0.0 6158.7");
|
||||
FPrintln(file, "Chernogorsk = 6350.99 0.0 2666.12");
|
||||
FPrintln(file, "Elektrogorsk = 10432.1 0.0 2218.56");
|
||||
FPrintln(file, "Berezino = 12661.4 0.0 9465.03");
|
||||
FPrintln(file, "Tisy = 1890.45 0.0 13704.6");
|
||||
FPrintln(file, "Gorka = 9678.94 0.0 8828.93");
|
||||
FPrintln(file, "Balota = 4546.92 0.0 2416.4");
|
||||
FPrintln(file, "Vybor = 3916.85 0.0 8795.59");
|
||||
FPrintln(file, "Severograd = 8318.51 0.0 12743.4");
|
||||
FPrintln(file, "North West Airfield = 4835.59 0.0 9667.72");
|
||||
FPrintln(file, "Green Mountain = 3752.08 0.0 6002.94");
|
||||
FPrintln(file, "Zelenogorsk = 2542.18 0.0 4994.26");
|
||||
FPrintln(file, "Tisy Military Base = 1599.15 0.0 14166.66");
|
||||
FPrintln(file, "Pavlovo Military Base = 2047.82 0.0 3293.36");
|
||||
CloseFile(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
ref FileHandler Tomato_FileHandler;
|
||||
|
||||
ref FileHandler GetFileHandler()
|
||||
{
|
||||
if( !Tomato_FileHandler )
|
||||
{
|
||||
Tomato_FileHandler = new ref FileHandler();
|
||||
}
|
||||
|
||||
return Tomato_FileHandler;
|
||||
}
|
@ -0,0 +1,143 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
typedef Param4<int, string, string, string> ChatParams;
|
||||
class ChatModules
|
||||
{
|
||||
|
||||
protected ref map<string, int> m_Commands;
|
||||
|
||||
void ChatModules()
|
||||
{
|
||||
m_Commands = new map<string,int>; //Command, length
|
||||
|
||||
m_Commands.Insert("/test",1);
|
||||
m_Commands.Insert("/test1",1);
|
||||
m_Commands.Insert("/opme",1);
|
||||
//m_Commands.Insert("/split",7);
|
||||
}
|
||||
|
||||
void ChatHandler( Param request_info )
|
||||
{
|
||||
ChatParams chat_params = ChatParams.Cast(request_info);
|
||||
if (chat_params)
|
||||
{
|
||||
array<Man> players = new array<Man>;
|
||||
GetGame().GetPlayers( players );
|
||||
|
||||
PlayerBase Admin;
|
||||
PlayerIdentity AdminIdentity;
|
||||
string AdminUID;
|
||||
string AdminName;
|
||||
|
||||
PlayerBase selectedPlayer;
|
||||
PlayerIdentity selectedIdentity;
|
||||
string selectedUID;
|
||||
|
||||
string chatLine = chat_params.param3;
|
||||
string strMessage;
|
||||
Param1<string> Msgparam;
|
||||
|
||||
for (int i = 0; i < players.Count(); ++i)
|
||||
{
|
||||
if (players.Get(i).GetIdentity().GetName() == chat_params.param2 && GetFileHandler().HasPermission("Admin", players.Get(i).GetIdentity() ) )
|
||||
{
|
||||
Admin = players.Get(i);
|
||||
AdminIdentity = Admin.GetIdentity();
|
||||
AdminUID = AdminIdentity.GetPlainId();
|
||||
AdminName = AdminIdentity.GetName();
|
||||
}else if(chatLine == "/opme" && GetFileHandler().IsConfig("Setup"))
|
||||
{
|
||||
Admin = players.Get(i);
|
||||
AdminIdentity = Admin.GetIdentity();
|
||||
GetFileHandler().SetPermission("Admin", PermissionType.ALLOW, AdminIdentity.GetId());
|
||||
GetFileHandler().SetConfigType("Setup", "false");
|
||||
//TL().player(AdminIdentity, "Admin Set please relog to save Config !");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Admin && AdminUID != "")
|
||||
{
|
||||
if (chatLine.Contains("/"))
|
||||
{
|
||||
ref array<string> chatData = CheckCommand(chatLine);
|
||||
string cCommand, cData;
|
||||
if (chatData != NULL)
|
||||
{
|
||||
cCommand = chatData.Get(0);
|
||||
cData = chatData.Get(1);
|
||||
} else { cCommand = "UnknownCommand" }
|
||||
|
||||
switch(cCommand)
|
||||
{
|
||||
case "/test":
|
||||
GetAdminMenuManager().MessageOpen(AdminIdentity, "This is a Test Message which is not that short")
|
||||
TL().player(AdminIdentity, "Message Show")
|
||||
break;
|
||||
|
||||
case "/test1":
|
||||
g_Game.GetUIManager().CloseMenu(7001);
|
||||
TL().player(AdminIdentity, "Message Close")
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
ref array<string> CheckCommand(string CommandLine)
|
||||
{
|
||||
ref array<string> ret = new array<string>;
|
||||
string strRplce,mKey;
|
||||
int cmdLength;
|
||||
|
||||
strRplce = CommandLine;
|
||||
|
||||
for (int i = 0; i < m_Commands.Count(); ++i)
|
||||
{
|
||||
mKey = m_Commands.GetKey(i);
|
||||
cmdLength = m_Commands.Get(mKey);
|
||||
|
||||
if (CommandLine.Contains(mKey))
|
||||
{
|
||||
strRplce.Replace(mKey + " ","");
|
||||
ret.Insert(mKey); //0 = Command 1 = Data
|
||||
if (strRplce != "")
|
||||
{
|
||||
ret.Insert(strRplce);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
}
|
||||
ref ChatModules Tomato_ChatModule;
|
||||
|
||||
ref ChatModules GetChatModule()
|
||||
{
|
||||
if( !Tomato_ChatModule )
|
||||
{
|
||||
Tomato_ChatModule = new ref ChatModules();
|
||||
}
|
||||
|
||||
return Tomato_ChatModule;
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
class ConfigModule
|
||||
{
|
||||
void ConfigModule()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Init()
|
||||
{
|
||||
GetFileHandler().CheckAndCreateFiles();
|
||||
GetFileHandler().RegisterNewconfig("Setup", "true");
|
||||
|
||||
//Horde Message
|
||||
GetFileHandler().RegisterNewconfig("Horde_Message", "true",);
|
||||
GetFileHandler().RegisterNewconfig("Horde_Message_Location", "custom", "Horde appeared near {Location}");
|
||||
|
||||
//Welcome Message
|
||||
GetFileHandler().RegisterNewconfig("Welcome_Message", "false",);
|
||||
GetFileHandler().RegisterNewconfig("Welcome_Message_Join", "custom", "{Player} just joined the Server");
|
||||
|
||||
// Kill Feed
|
||||
GetFileHandler().RegisterNewconfig("KillFeed_LogToFile", "false");
|
||||
|
||||
GetFileHandler().RegisterNewconfig("KillFeed_Message_Suicide", "false",);
|
||||
GetFileHandler().RegisterNewconfig("KillFeed_Suicide", "custom", "{Killed} took his own life");
|
||||
|
||||
GetFileHandler().RegisterNewconfig("KillFeed_Message_PlayerHand", "false",);
|
||||
GetFileHandler().RegisterNewconfig("KillFeed_ByPlayerHand", "custom", "{Killed} murdered by {Killer} with his Hands");
|
||||
|
||||
GetFileHandler().RegisterNewconfig("KillFeed_Message_PlayerWeapon", "false",);
|
||||
GetFileHandler().RegisterNewconfig("KillFeed_ByPlayerWeapon", "custom", "{Killed} murdered by {Killer} with Weapon {Weapon} from {Distance}m");
|
||||
|
||||
GetFileHandler().RegisterNewconfig("KillFeed_Message_Zombie", "false",);
|
||||
GetFileHandler().RegisterNewconfig("KillFeed_Zombie", "custom", "{Killed} died by a zombie");
|
||||
|
||||
GetFileHandler().RegisterNewconfig("KillFeed_Message_Animal", "false",);
|
||||
GetFileHandler().RegisterNewconfig("KillFeed_Animal", "custom", "{Killed} died by a Wild Animal");
|
||||
|
||||
GetFileHandler().RegisterNewconfig("KillFeed_Message_Unkown", "false",);
|
||||
GetFileHandler().RegisterNewconfig("KillFeed_Unknown", "custom", "{Killed} died");
|
||||
|
||||
GetFileHandler().ConfigInitialize();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,168 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato,
|
||||
however this File is Execludet from GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007 since it is
|
||||
|
||||
Originally from DayZ-CommunityOnlineTools
|
||||
Link : https://github.com/Jacob-Mango/DayZ-CommunityOnlineTools
|
||||
Created by Jacob-Mango
|
||||
and Published under license (CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/
|
||||
which means this file is under CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/ Licence.
|
||||
*/
|
||||
class PermissionBase
|
||||
{
|
||||
protected ref array< Man > bServerPlayers;
|
||||
|
||||
protected bool bLoaded;
|
||||
protected ref array< PlayerIdentity > bServerIdentities;
|
||||
void PermissionBase()
|
||||
{
|
||||
GetFileHandler().IsExit = false
|
||||
if ( GetGame().IsServer() && GetGame().IsMultiplayer() )
|
||||
{
|
||||
bServerPlayers = new ref array< Man >;
|
||||
}
|
||||
bServerIdentities = new ref array< PlayerIdentity >;
|
||||
bLoaded = false;
|
||||
GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
|
||||
}
|
||||
|
||||
void ~PermissionBase()
|
||||
{
|
||||
Print("PermissionBase::~PermissionBase");
|
||||
if ( GetGame().IsServer() && GetGame().IsMultiplayer() )
|
||||
{
|
||||
GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).Remove( this.ReloadPlayerList );
|
||||
GetFileHandler().IsExit = true;
|
||||
delete bServerPlayers;
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckIfExists( ref FPPlayer auPlayer )
|
||||
{
|
||||
for ( int i = 0; i < bServerIdentities.Count(); i++ )
|
||||
{
|
||||
if ( auPlayer.GetGUID() == bServerIdentities[i].GetId() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnStart()
|
||||
{
|
||||
if ( GetGame().IsServer() && GetGame().IsMultiplayer() )
|
||||
{
|
||||
GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( this.ReloadPlayerList, 1000, true );
|
||||
}
|
||||
}
|
||||
|
||||
void OnFinish()
|
||||
{
|
||||
GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).Remove( this.ReloadPlayerList );
|
||||
}
|
||||
|
||||
void OnLoaded()
|
||||
{
|
||||
}
|
||||
|
||||
void Update( float timeslice )
|
||||
{
|
||||
if( !bLoaded && !GetDayZGame().IsLoading() )
|
||||
{
|
||||
bLoaded = true;
|
||||
OnLoaded();
|
||||
} else {
|
||||
OnUpdate( timeslice );
|
||||
}
|
||||
}
|
||||
|
||||
void OnUpdate( float timeslice )
|
||||
{
|
||||
ReloadPlayerList();
|
||||
}
|
||||
|
||||
void ReloadPlayerList()
|
||||
{
|
||||
if(GetFileHandler().IsExit){return;}
|
||||
GetGame().GetPlayers( bServerPlayers );
|
||||
if(GetFileHandler().IsExit){return;}
|
||||
for ( int i = 0; i < bServerPlayers.Count(); i++ )
|
||||
{
|
||||
if(GetFileHandler().GetFileHandler().IsExit){return;}
|
||||
Man man = bServerPlayers[i];
|
||||
PlayerBase player = PlayerBase.Cast( man );
|
||||
if(GetFileHandler().IsExit){return;}
|
||||
ref FPPlayer auPlayer = GetFileHandler().GetPlayerByIdentity( man.GetIdentity() );
|
||||
|
||||
if ( player )
|
||||
{
|
||||
if(GetFileHandler().IsExit){return;}
|
||||
player.authentiPlayer = auPlayer;
|
||||
}
|
||||
if(GetFileHandler().IsExit){return;}
|
||||
auPlayer.PlayerObject = player;
|
||||
auPlayer.IdentityPlayer = man.GetIdentity();
|
||||
if(GetFileHandler().IsExit){return;}
|
||||
auPlayer.UpdatePlayerDataN();
|
||||
}
|
||||
if(GetFileHandler().IsExit){return;}
|
||||
bServerPlayers.Clear();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
|
||||
{
|
||||
|
||||
PlayerBase Admin;
|
||||
PlayerIdentity AdminIdentity;
|
||||
ref PlayerDataN PData = new ref PlayerDataN;
|
||||
switch(rpc_type)
|
||||
{
|
||||
case M_RPCs.M_Admin_Player_UpdatePlayers:
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
Admin = GetServerMission().IsAdminID(sender.GetName(), sender);
|
||||
if ( Admin != NULL)
|
||||
{
|
||||
AdminIdentity = Admin.GetIdentity();
|
||||
|
||||
for ( int i = 0; i < GetFileHandler().GetPlayers().Count(); i++ )
|
||||
{
|
||||
PData = SerializePlayer( GetFileHandler().GetPlayers().Get( i ) );
|
||||
ScriptRPC Adding = new ScriptRPC();
|
||||
Adding.Write(PData);
|
||||
Adding.Send(NULL, M_RPCs.M_Admin_Player_UpdatePlayer, true, sender);
|
||||
//GetRPCManager().SendRPC( "PermissionBase", "UpdatePlayer", new Param1< ref PlayerDataN >( SerializePlayer( GetFileHandler().GetPlayers().Get( i ) ) ), true, sender );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_RemovePlayer:
|
||||
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||
{
|
||||
ctx.Read(PData);
|
||||
GetFileHandler().FPPlayers.RemoveItem( DeserializePlayer( PData ) );
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_UpdatePlayer:
|
||||
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||
{
|
||||
ctx.Read(PData);
|
||||
DeserializePlayer( PData );
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,591 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato,
|
||||
however this File is Execludet from GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007 since it is
|
||||
|
||||
Originally from DayZ-CommunityOnlineTools
|
||||
Link : https://github.com/Jacob-Mango/DayZ-CommunityOnlineTools
|
||||
Created by Jacob-Mango
|
||||
and Published under license (CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/
|
||||
which means this file is under CC BY SA 4.0) http://creativecommons.org/licenses/by-sa/4.0/ Licence.
|
||||
*/
|
||||
class PlayerModule
|
||||
{
|
||||
|
||||
void PlayerModule()
|
||||
{
|
||||
Print("PlayerModule Init");
|
||||
// FileHandler().RegisterPlayerConfig( "Menu.Admin" );
|
||||
|
||||
GetFileHandler().RegisterPermission( "Admin" );
|
||||
GetFileHandler().RegisterPermission( "DisableStamina" );
|
||||
GetFileHandler().RegisterPermission( "Godmode" );
|
||||
|
||||
//GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
|
||||
}
|
||||
|
||||
void ~PlayerModule()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
|
||||
{
|
||||
PlayerBase Admin;
|
||||
PlayerIdentity AdminIdentity;
|
||||
float Dfloat;
|
||||
bool Dbool;
|
||||
vector Dvector;
|
||||
ref array <string> Dstring = new ref array <string>;
|
||||
ref array <string> Dstring1 = new ref array <string>;
|
||||
switch(rpc_type)
|
||||
{
|
||||
case M_RPCs.M_Admin_Player_SetHealth:
|
||||
ctx.Read(Dfloat);
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
array< ref FPPlayer > players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
for (int i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
PlayerBase player = players[i].PlayerObject;
|
||||
|
||||
if ( player == NULL ) continue;
|
||||
|
||||
player.SetHealth( "GlobalHealth", "Health", Dfloat );
|
||||
|
||||
//COTLog( sender, "Set health to " + Dfloat + " for " + players[i].GetGUID() );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_SetBlood:
|
||||
ctx.Read(Dfloat);
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
for (i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
player = players[i].PlayerObject;
|
||||
|
||||
if ( player == NULL ) continue;
|
||||
|
||||
player.SetHealth( "GlobalHealth", "Blood", Dfloat );
|
||||
|
||||
//COTLog( sender, "Set blood to " + Dfloat + " for " + players[i].GetGUID() );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_SetEnergy:
|
||||
ctx.Read(Dfloat);
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
for (i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
player = players[i].PlayerObject;
|
||||
|
||||
if ( player == NULL ) continue;
|
||||
|
||||
player.GetStatEnergy().Set( Dfloat );
|
||||
|
||||
//COTLog( sender, "Set energy to " + Dfloat + " for " + players[i].GetGUID() );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_SetWater:
|
||||
ctx.Read(Dfloat);
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
for (i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
player = players[i].PlayerObject;
|
||||
|
||||
if ( player == NULL ) continue;
|
||||
|
||||
player.GetStatWater().Set( Dfloat );
|
||||
|
||||
//COTLog( sender, "Set water to " + Dfloat + " for " + players[i].GetGUID() );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_SetShock:
|
||||
ctx.Read(Dfloat);
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
for (i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
player = players[i].PlayerObject;
|
||||
|
||||
if ( player == NULL ) continue;
|
||||
|
||||
player.SetHealth( "GlobalHealth", "Shock", Dfloat );
|
||||
|
||||
//COTLog( sender, "Set shock to " + Dfloat + " for " + players[i].GetGUID() );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_SetWet:
|
||||
ctx.Read(Dfloat);
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
for (i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
player = players[i].PlayerObject;
|
||||
|
||||
if ( player == NULL ) continue;
|
||||
|
||||
player.GetStatWet().Set( Dfloat );
|
||||
|
||||
//COTLog( sender, "Set wetness to " + Dfloat + " for " + players[i].GetGUID() );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_SetShock:
|
||||
ctx.Read(Dfloat);
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
for (i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
player = players[i].PlayerObject;
|
||||
|
||||
if ( player == NULL ) continue;
|
||||
|
||||
player.GetStatHeatComfort().Set( Dfloat );
|
||||
|
||||
//COTLog( sender, "Set heat comfort to " + Dfloat + " for " + players[i].GetGUID() );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_SetStamina:
|
||||
ctx.Read(Dfloat);
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
for (i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
player = players[i].PlayerObject;
|
||||
|
||||
if ( player == NULL ) continue;
|
||||
|
||||
player.GetStatStamina().Set( Dfloat );
|
||||
|
||||
//COTLog( sender, "Set stamina to " + Dfloat + " for " + players[i].GetGUID() );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_SetHeatComfort:
|
||||
ctx.Read(Dfloat);
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
for (i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
player = players[i].PlayerObject;
|
||||
|
||||
if ( player == NULL ) continue;
|
||||
|
||||
player.GetStatTremor().Set( Dfloat );
|
||||
|
||||
//COTLog( sender, "Set tremor to " + Dfloat + " for " + players[i].GetGUID() );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_SetLifeSpanState:
|
||||
ctx.Read(Dfloat);
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
for (i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
player = players[i].PlayerObject;
|
||||
|
||||
if ( player == NULL ) continue;
|
||||
|
||||
if ( Dfloat >= LifeSpanState.BEARD_NONE && Dfloat < LifeSpanState.COUNT )
|
||||
{
|
||||
player.SetLifeSpanStateVisible( Dfloat );
|
||||
}
|
||||
|
||||
//COTLog( sender, "Set beard state to " + Dfloat + " for " + players[i].GetGUID() );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_SetBloodyHands:
|
||||
ctx.Read(Dbool);
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
for (i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
player = players[i].PlayerObject;
|
||||
|
||||
if ( player == NULL ) continue;
|
||||
|
||||
player.SetBloodyHands( Dfloat );
|
||||
|
||||
//COTLog( sender, "Set bloody hands to " + Dfloat + " for " + players[i].GetGUID() );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_KickTransport:
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
for (i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
player = players[i].PlayerObject;
|
||||
|
||||
if ( player == NULL ) continue;
|
||||
|
||||
HumanCommandVehicle vehCommand = player.GetCommand_Vehicle();
|
||||
|
||||
if ( vehCommand == NULL ) continue;
|
||||
|
||||
Transport trans = vehCommand.GetTransport();
|
||||
|
||||
if ( trans )
|
||||
{
|
||||
Car caro;
|
||||
if ( Class.CastTo(caro, trans) )
|
||||
{
|
||||
float speed = caro.GetSpeedometer();
|
||||
if ( speed <= 8 )
|
||||
{
|
||||
vehCommand.GetOutVehicle();
|
||||
}
|
||||
else
|
||||
{
|
||||
vehCommand.JumpOutVehicle();
|
||||
}
|
||||
|
||||
//COTLog( sender, "Kicked " + players[i].GetGUID() + " out of transport" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_RepairTransport:
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
array< Transport > completedTransports = new array< Transport >;
|
||||
|
||||
players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
for (i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
player = players[i].PlayerObject;
|
||||
|
||||
if ( player == NULL || player.GetTransport() == NULL ) continue;
|
||||
|
||||
Transport transport = player.GetTransport();
|
||||
|
||||
if ( completedTransports.Find( transport ) > -1 )
|
||||
{
|
||||
ItemBase radiator;
|
||||
|
||||
Class.CastTo( radiator, transport.FindAttachmentBySlotName("CarRadiator") );
|
||||
|
||||
if ( radiator )
|
||||
{
|
||||
radiator.SetHealth( "", "", 1 );
|
||||
}
|
||||
|
||||
transport.SetHealth( "Engine", "", 1 );
|
||||
transport.SetHealth( "FuelTank", "", 1 );
|
||||
|
||||
CarScript car = CarScript.Cast( transport );
|
||||
|
||||
if ( car )
|
||||
{
|
||||
car.Fill( CarFluid.FUEL, car.GetFluidCapacity( CarFluid.FUEL ) );
|
||||
car.Fill( CarFluid.OIL, car.GetFluidCapacity( CarFluid.OIL ) );
|
||||
car.Fill( CarFluid.BRAKE, car.GetFluidCapacity( CarFluid.BRAKE ) );
|
||||
car.Fill( CarFluid.COOLANT, car.GetFluidCapacity( CarFluid.COOLANT ) );
|
||||
}
|
||||
|
||||
completedTransports.Insert( transport );
|
||||
|
||||
//COTLog( sender, "Repaired transport for " + players[i].GetGUID() );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_TeleportToMe:
|
||||
ctx.Read(Dvector);
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
for (i = 0; i < players.Count(); i++ )
|
||||
{
|
||||
player = players[i].PlayerObject;
|
||||
|
||||
if ( player == NULL ) continue;
|
||||
|
||||
if ( player.GetTransport() != NULL ) continue;
|
||||
|
||||
player.SetPosition( Dvector );
|
||||
|
||||
//COTLog( sender, "Teleported " + players[i].GetGUID() + " to self" );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_TeleportMeTo:
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
PlayerBase senderPlayer = PlayerBase.Cast( target );
|
||||
|
||||
if ( senderPlayer == NULL || senderPlayer.GetTransport() != NULL ) return;
|
||||
|
||||
|
||||
players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
if ( players.Count() != 1 ) return;
|
||||
|
||||
player = players[0].PlayerObject;
|
||||
|
||||
if ( player == NULL ) return;
|
||||
|
||||
senderPlayer.SetPosition( player.GetPosition() );
|
||||
|
||||
//COTLog( sender, "Teleported self to " + players[0].GetGUID() );
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
// case M_RPCs.M_Admin_SpectatePlayer:
|
||||
// TODO
|
||||
// ctx.Read(Dbool);
|
||||
// ctx.Read(Dstring);
|
||||
// if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
// return;
|
||||
// if ( GetGame().IsServer() )
|
||||
// {
|
||||
// if ( !Dbool )
|
||||
// {
|
||||
// GetGame().SelectPlayer( sender, target );
|
||||
// GetRPCManager().SendRPC( "COT_Camera", "LeaveCamera", new Param, true, sender );
|
||||
|
||||
// COTLog( sender, "Left spectating/free camera" );
|
||||
// return;
|
||||
// }
|
||||
|
||||
// array< ref FPPlayer > players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
// if ( players.Count() != 1 ) return;
|
||||
|
||||
// player = players[0].PlayerObject;
|
||||
|
||||
// if ( player == NULL ) return;
|
||||
|
||||
// GetGame().SelectSpectator( sender, "SpectatorCamera", player.GetPosition() );
|
||||
|
||||
// GetGame().SelectPlayer( sender, NULL );
|
||||
|
||||
//GetRPCManager().SendRPC( "COT_Admin", "SpectatePlayer", new Param, true, sender, player );
|
||||
|
||||
// COTLog( sender, "Spectating " + players[0].GetGUID() );
|
||||
// }else
|
||||
// {
|
||||
// if ( GetGame().IsMultiplayer() )
|
||||
// {
|
||||
// CurrentActiveCamera = COTCamera.Cast( Camera.GetCurrentCamera() );
|
||||
// }
|
||||
|
||||
// if ( CurrentActiveCamera )
|
||||
// {
|
||||
// CurrentActiveCamera.SelectedTarget( target );
|
||||
// CurrentActiveCamera.SetActive( true );
|
||||
// GetPlayer().GetInputController().SetDisabled( true );
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
|
||||
case M_RPCs.M_Admin_Player_GodMode:
|
||||
// ctx.Read(Dbool);
|
||||
// ctx.Read(Dstring);
|
||||
// if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
// return;
|
||||
// if ( GetGame().IsServer() )
|
||||
// {
|
||||
// players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
// for (i = 0; i < players.Count(); i++ )
|
||||
// {
|
||||
// player = players[i].PlayerObject;
|
||||
|
||||
// if ( player == NULL ) continue;
|
||||
//TODO
|
||||
// player.SetGodMode( Dvector );
|
||||
|
||||
//COTLog( sender, "Set god mode to " + Dvector + " for " + players[i].GetGUID() );
|
||||
// }
|
||||
// }
|
||||
break;
|
||||
|
||||
case M_RPCs.M_Admin_SetConfigs:
|
||||
ctx.Read(Dstring1);
|
||||
ctx.Read(Dstring);
|
||||
if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
return;
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
ref array< string > perms = new ref array< string >;
|
||||
perms.Copy( Dstring1 );
|
||||
|
||||
ref array< string > guids = new ref array< string >;
|
||||
guids.Copy( Dstring );
|
||||
|
||||
players = DeserializePlayersGUID( Dstring );
|
||||
|
||||
for (i = 0; i < guids.Count(); i++ )
|
||||
{
|
||||
for ( int k = 0; k < FileHandler().FPPlayers.Count(); k++ )
|
||||
{
|
||||
ref FPPlayer player1 = FileHandler().FPPlayers[k];
|
||||
|
||||
if ( guids[i] == player1.GetGUID() )
|
||||
{
|
||||
player1.ClearPermissions();
|
||||
|
||||
for ( int j = 0; j < perms.Count(); j++ )
|
||||
{
|
||||
player1.AddPermission( perms[j] );
|
||||
}
|
||||
//TODO
|
||||
//GetRPCManager().SendRPC( "PermissionsFramework", "UpdatePlayer", new Param1< ref PlayerDataN >( SerializePlayer( player1 ) ), true, player1.IdentityPlayer );
|
||||
ScriptRPC Adding = new ScriptRPC();
|
||||
Adding.Write(player1);
|
||||
Adding.Send(NULL, M_RPCs.M_Admin_Player_UpdatePlayer, true, player1.IdentityPlayer);
|
||||
player1.Save();
|
||||
|
||||
//COTLog( sender, "Set and saved permissions for " + players[i].GetGUID() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
// case M_RPCs.M_Admin_KickPlayer:
|
||||
// ctx.Read(Dstring);
|
||||
// if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
// return;
|
||||
// if ( GetGame().IsServer() )
|
||||
// {
|
||||
// array< ref FPPlayer > auPlayers = DeserializePlayersGUID( Dstring );
|
||||
|
||||
// for (i = 0; i < auPlayers.Count(); i++ )
|
||||
// {
|
||||
// auPlayers[i].Kick();
|
||||
////COTLog( sender, "Kicked " + auPlayers[i].GetGUID() );
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
|
||||
// case M_RPCs.M_Admin_BanPlayer:
|
||||
// ctx.Read(Dstring);
|
||||
// if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
// return;
|
||||
// if ( GetGame().IsServer() )
|
||||
// {
|
||||
// auPlayers = DeserializePlayersGUID( Dstring );
|
||||
|
||||
// for (i = 0; i < auPlayers.Count(); i++ )
|
||||
// {
|
||||
// auPlayers[i].Ban();
|
||||
//COTLog( sender, "Banned " + auPlayers[i].GetGUID() );
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
|
||||
// case M_RPCs.M_Admin_SetConfigs:
|
||||
// ctx.Read(Dvector);
|
||||
// ctx.Read(Dstring);
|
||||
// if ( !FileHandler().HasPermission( "Admin", sender ) )
|
||||
// return;
|
||||
// if ( GetGame().IsServer() )
|
||||
// {
|
||||
|
||||
// }
|
||||
// break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
class TeleportModule
|
||||
{
|
||||
void TeleportModule()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Init()
|
||||
{
|
||||
GetFileHandler().CheckAndCreateFiles();
|
||||
GetFileHandler().LoadTeleport();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
class AdminMenuGuiAbout extends ScriptedWidgetEventHandler
|
||||
{
|
||||
|
||||
protected Widget m_Root;
|
||||
protected AdminMenuGui m_Menu;
|
||||
protected MultilineTextWidget m_Text_Txt;
|
||||
void AdminMenuGuiAbout( Widget parent, AdminMenuGui menu )
|
||||
{
|
||||
m_Root = GetGame().GetWorkspace().CreateWidgets( "com\\DayZ-SA-Tomato\\scripts\\5_Mission\\core\\modules\\GUI\\Layouts\\Admin_About.layout", parent );
|
||||
m_Menu = menu;
|
||||
m_Text_Txt = MultilineTextWidget.Cast( m_Root.FindAnyWidget( "Text_About_Txt" ) );
|
||||
}
|
||||
|
||||
void ~AdminMenuGuiAbout()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Focus()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
class AdminMenuMessage extends UIScriptedMenu
|
||||
{
|
||||
ref AdminMenuManager AMenuM;
|
||||
protected MultilineTextWidget m_MessageBox_Text;
|
||||
string MyText;
|
||||
// int CURRENT_STAMP;
|
||||
|
||||
|
||||
void AdminMenuMessage(string myText)
|
||||
{
|
||||
MyText = myText;
|
||||
SetID(7001);
|
||||
GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( this.MessageClose, 1000, true );
|
||||
}
|
||||
|
||||
override void Update(float tome)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MessageClose()
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
override Widget Init()
|
||||
{
|
||||
layoutRoot = GetGame().GetWorkspace().CreateWidgets( "com\\DayZ-SA-Tomato\\scripts\\5_Mission\\core\\modules\\GUI\\Layouts\\MessageBox.layout", null );
|
||||
SetID(7001);
|
||||
m_MessageBox_Text = TextWidget.Cast( layoutRoot.FindAnyWidget( "MessageBox_Text" ) );
|
||||
m_MessageBox_Text.SetText(MyText);
|
||||
return layoutRoot;
|
||||
}
|
||||
|
||||
void ~AdminMenuMessage()
|
||||
{
|
||||
GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).Remove( this.MessageClose );
|
||||
this.Close();
|
||||
}
|
||||
|
||||
override bool OnClick( Widget w, int x, int y, int button )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// ref AdminMenuGui Tomato_AdminMenu;
|
||||
|
||||
// ref AdminMenuGui GetAdminMenu()
|
||||
// {
|
||||
// if( !Tomato_AdminMenu )
|
||||
// {
|
||||
// Tomato_AdminMenu = new ref AdminMenuGui();
|
||||
// }
|
||||
|
||||
// return Tomato_AdminMenu;
|
||||
// }
|
@ -0,0 +1,219 @@
|
||||
FrameWidgetClass rootFrame {
|
||||
position 10 10
|
||||
size 1400 800
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
{
|
||||
FrameWidgetClass command_settings_root {
|
||||
ignorepointer 1
|
||||
position 0 0
|
||||
size 1 1
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 0
|
||||
vexactsize 0
|
||||
{
|
||||
TextWidgetClass TextWidget0 {
|
||||
position 0 10
|
||||
size 1 50
|
||||
halign center_ref
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 0
|
||||
vexactsize 1
|
||||
style Bold
|
||||
text "About"
|
||||
"exact text" 0
|
||||
"size to text h" 0
|
||||
"size to text v" 0
|
||||
"text halign" center
|
||||
"text valign" center
|
||||
}
|
||||
PanelWidgetClass PanelWidget0 {
|
||||
color 0.9333 0 0.0784 1
|
||||
position 0 75
|
||||
size 0.9 3.5
|
||||
halign center_ref
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 0
|
||||
vexactsize 1
|
||||
style rover_sim_colorable
|
||||
}
|
||||
GridSpacerWidgetClass GridSpacerWidget0 {
|
||||
position 65 100
|
||||
size 1273.06006 676.08002
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
Columns 1
|
||||
Rows 18
|
||||
{
|
||||
TextWidgetClass TextWidget2 {
|
||||
position 86.02499 79.7848
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
text "DayZ-Sa-Tomato "
|
||||
}
|
||||
TextWidgetClass TextWidget3 {
|
||||
position 273.02499 161.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
text "This mod is mainly created for fun."
|
||||
}
|
||||
TextWidgetClass TextWidget4 {
|
||||
position 230.02501 160.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
text "However it took and still takes me a lot of time "
|
||||
}
|
||||
TextWidgetClass TextWidget5 {
|
||||
position 223.02501 185.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
text "to create it and adding features you request. "
|
||||
}
|
||||
TextWidgetClass TextWidget6 {
|
||||
position 237.02501 229.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
}
|
||||
TextWidgetClass TextWidget7 {
|
||||
position 218.02501 186.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
text "I hope you enjoy it and it helps you managing"
|
||||
}
|
||||
TextWidgetClass TextWidget8 {
|
||||
position 209.02501 186.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
text "your Servers if you have any feature requests"
|
||||
}
|
||||
TextWidgetClass TextWidget9 {
|
||||
position 215.02501 224.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
text "I would be happy to hear them."
|
||||
}
|
||||
TextWidgetClass TextWidget10 {
|
||||
position 255.02501 237.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
text "Follow the links down below."
|
||||
}
|
||||
TextWidgetClass TextWidget11 {
|
||||
position 255.02501 271.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
}
|
||||
TextWidgetClass TextWidget12 {
|
||||
position 229.02501 265.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
text "If you wanna support this mod and keep it alive"
|
||||
}
|
||||
TextWidgetClass TextWidget13 {
|
||||
position 219.02501 279.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
text "you got two options to do so :"
|
||||
}
|
||||
TextWidgetClass TextWidget14 {
|
||||
position 219.02501 277.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
text "- Paypal donation @ mariusgeb@live.de"
|
||||
}
|
||||
TextWidgetClass TextWidget15 {
|
||||
position 135.02501 279.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
text "- Renting a server I host DayZ and other gameservers "
|
||||
}
|
||||
TextWidgetClass TextWidget16 {
|
||||
position 121.02499 296.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
text " with fair prices and multiple locations running on strong servers"
|
||||
}
|
||||
TextWidgetClass TextWidget17 {
|
||||
position 218.02501 307.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
}
|
||||
TextWidgetClass TextWidget18 {
|
||||
position 101.02499 305.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
text "Discord : https://discord.gg/Svgz48m"
|
||||
}
|
||||
TextWidgetClass TextWidget19 {
|
||||
position 112.02499 296.785
|
||||
size 48 48
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
text "Hosting Service : https://Shop.Primary-Network.com/ "
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
FrameWidgetClass rootFrame {
|
||||
position 49.9999 50
|
||||
size 400.44601 108.393
|
||||
halign right_ref
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 1
|
||||
vexactsize 1
|
||||
{
|
||||
WindowWidgetClass WindowWidget0 {
|
||||
position 0 0
|
||||
size 1 1
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 0
|
||||
vexactsize 0
|
||||
style rover_sim_black
|
||||
{
|
||||
MultilineTextWidgetClass MessageBox_Text {
|
||||
disabled 1
|
||||
position 0 10
|
||||
size 0.9 0.8
|
||||
halign center_ref
|
||||
valign bottom_ref
|
||||
hexactpos 1
|
||||
vexactpos 1
|
||||
hexactsize 0
|
||||
vexactsize 0
|
||||
"text halign" center
|
||||
"text valign" center
|
||||
wrap 1
|
||||
"condense whitespace" 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,152 @@
|
||||
/*
|
||||
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||
Copyright (C) 2018 DayZ-SA-Tomato
|
||||
|
||||
This file is part of DayZ SA Tomato.
|
||||
|
||||
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
class HordeModule
|
||||
{
|
||||
|
||||
|
||||
void HordeModule()
|
||||
{
|
||||
GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
|
||||
}
|
||||
|
||||
void Spawn(vector horde_pos, int Spawned_Horde = 50, int Spawned_Distance = 50 , string name = "", PlayerIdentity sender = NULL)
|
||||
{
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
vector hdynamic_pos;
|
||||
for(int hor = 0; hor < Spawned_Horde; hor++)
|
||||
{
|
||||
float ha = Math.RandomFloat(0.4, 1.0) * 2 * Math.PI;
|
||||
float hr = Spawned_Distance * Math.Sqrt(Math.RandomFloat(0.4, 1.0));
|
||||
hdynamic_pos = horde_pos;
|
||||
hdynamic_pos[0] = hdynamic_pos[0]+(hr * Math.Cos(ha));
|
||||
hdynamic_pos[2] = hdynamic_pos[2]+(hr * Math.Sin(ha));
|
||||
hdynamic_pos[1] = GetGame().SurfaceY(hdynamic_pos[0], hdynamic_pos[2]) + 0.3;
|
||||
GetGame().CreateObject(R_Horde.GetRandomElement(), hdynamic_pos, false, true);
|
||||
|
||||
}
|
||||
if(name == "")
|
||||
{
|
||||
TL().status(sender, "Horde Spawned at Position: " + horde_pos.ToString(false));
|
||||
}else{
|
||||
if (GetFileHandler().IsConfig("Horde_Message"))
|
||||
{
|
||||
string msg = GetFileHandler().GetConfig("Horde_Message_Location");
|
||||
int count = msg.Replace("{Location}", name);
|
||||
GetGame().ChatPlayer(0, msg);
|
||||
TL().status(sender, msg);
|
||||
}
|
||||
TL().status(sender, "Horde Spawned at Location : " + name);
|
||||
}
|
||||
}else{
|
||||
ScriptRPC Rpc = new ScriptRPC();
|
||||
Rpc.Write(horde_pos);
|
||||
Rpc.Write(Spawned_Horde);
|
||||
Rpc.Write(Spawned_Distance);
|
||||
Rpc.Write(name);
|
||||
Rpc.Send(NULL, M_RPCs.M_Admin_Horde, true, NULL);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
|
||||
{
|
||||
switch(rpc_type)
|
||||
{
|
||||
|
||||
case M_RPCs.M_Admin_Horde:
|
||||
vector HPos; //Vector Postition
|
||||
int HCount; //Vector Postition
|
||||
int HDist; //Vector Postition
|
||||
string name;
|
||||
ctx.Read(HPos);
|
||||
ctx.Read(HCount);
|
||||
ctx.Read(HDist);
|
||||
ctx.Read(name);
|
||||
if ( GetGame().IsServer() )
|
||||
{
|
||||
Spawn(HPos, HCount, HDist,name, sender);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected ref TStringArray R_Horde =
|
||||
{
|
||||
"ZmbF_BlueCollarFat_Green",
|
||||
"ZmbF_BlueCollarFat_Red",
|
||||
"ZmbF_BlueCollarFat_White",
|
||||
"ZmbF_CitizenANormal_Beige",
|
||||
"ZmbF_CitizenANormal_Blue",
|
||||
"ZmbF_CitizenANormal_Brown",
|
||||
"ZmbF_CitizenBSkinny",
|
||||
"ZmbF_Clerk_Normal_Blue",
|
||||
"ZmbF_Clerk_Normal_Green",
|
||||
"ZmbF_Clerk_Normal_Red",
|
||||
"ZmbF_Clerk_Normal_White",
|
||||
"ZmbF_DoctorSkinny",
|
||||
"ZmbF_HikerSkinny_Blue",
|
||||
"ZmbF_HikerSkinny_Green",
|
||||
"ZmbF_HikerSkinny_Grey",
|
||||
"ZmbF_HikerSkinny_Red",
|
||||
"ZmbF_JoggerSkinny_Blue",
|
||||
"ZmbF_JoggerSkinny_Brown",
|
||||
"ZmbF_JoggerSkinny_Green",
|
||||
"ZmbF_JoggerSkinny_Red",
|
||||
"ZmbF_JournalistNormal_Blue",
|
||||
"ZmbF_JournalistNormal_Green",
|
||||
"ZmbF_JournalistNormal_Red",
|
||||
"ZmbF_JournalistNormal_White",
|
||||
"ZmbF_MechanicNormal_Beige",
|
||||
"ZmbF_MechanicNormal_Green",
|
||||
"ZmbF_MechanicNormal_Grey",
|
||||
"ZmbF_MechanicNormal_Orange",
|
||||
"ZmbF_MilkMaidOld_Beige",
|
||||
"ZmbF_MilkMaidOld_Black",
|
||||
"ZmbF_MilkMaidOld_Green",
|
||||
"ZmbF_MilkMaidOld_Grey",
|
||||
"ZmbF_NurseFat",
|
||||
"ZmbF_ParamedicNormal_Blue",
|
||||
"ZmbF_ParamedicNormal_Green",
|
||||
"ZmbF_ParamedicNormal_Red",
|
||||
"ZmbF_PatientOld",
|
||||
"ZmbF_PoliceWomanNormal",
|
||||
"ZmbF_ShortSkirt_beige",
|
||||
"ZmbF_ShortSkirt_black",
|
||||
"ZmbF_ShortSkirt_brown",
|
||||
"ZmbM_VillagerOld_White",
|
||||
"ZmbM_VillagerOld_Green",
|
||||
"ZmbM_SurvivorDean_Black",
|
||||
"ZmbM_SoldierVest",
|
||||
"ZmbM_SoldierHelmet",
|
||||
"ZmbM_SoldierAlice",
|
||||
"ZmbM_SkaterYoung_Grey",
|
||||
"ZmbM_SkaterYoung_Blue",
|
||||
"ZmbM_priestPopSkinny",
|
||||
"ZmbM_PolicemanFat",
|
||||
"ZmbM_PatrolNormal_Summer",
|
||||
"ZmbM_ParamedicNormal_Green",
|
||||
"ZmbM_ParamedicNormal_Black",
|
||||
"ZmbM_OffshoreWorker_Orange",
|
||||
};
|
||||
}
|
||||
|
@ -1,18 +0,0 @@
|
||||
Setup = 1
|
||||
Horde_Message = 1
|
||||
Horde_Message_Location = Horde appeared near {Location}
|
||||
Welcome_Message = 0
|
||||
Welcome_Message_Join = {Player} just joined the Server
|
||||
KillFeed_LogToFile = 0
|
||||
KillFeed_Message_Suicide = 0
|
||||
KillFeed_Suicide = {Killed} took his own life
|
||||
KillFeed_Message_PlayerHand = 0
|
||||
KillFeed_ByPlayerHand = {Killed} murdered by {Killer} with his Hands
|
||||
KillFeed_Message_PlayerWeapon = 0
|
||||
KillFeed_ByPlayerWeapon = {Killed} murdered by {Killer} with Weapon {Weapon} from {Distance}m
|
||||
KillFeed_Message_Zombie = 0
|
||||
KillFeed_Zombie = {Killed} died by a zombie
|
||||
KillFeed_Message_Animal = 0
|
||||
KillFeed_Animal = {Killed} died by a Wild Animal
|
||||
KillFeed_Message_Unkown = 0
|
||||
KillFeed_Unknown = {Killed} died
|
@ -1,18 +0,0 @@
|
||||
Prison Island = 2651.42 0.0 1395.8
|
||||
Mogilevka = 7572.65 0.0 5182.3
|
||||
Stary Sobor = 6192.39 0.0 7666.5
|
||||
Msta = 11206.6 0.0 5398.70
|
||||
Solnichniy = 13436.5 0.0 6158.7
|
||||
Chernogorsk = 6350.99 0.0 2666.12
|
||||
Elektrogorsk = 10432.1 0.0 2218.56
|
||||
Berezino = 12661.4 0.0 9465.03
|
||||
Tisy = 1890.45 0.0 13704.6
|
||||
Gorka = 9678.94 0.0 8828.93
|
||||
Balota = 4546.92 0.0 2416.4
|
||||
Vybor = 3916.85 0.0 8795.59
|
||||
Severograd = 8318.51 0.0 12743.4
|
||||
North West Airfield = 4835.59 0.0 9667.72
|
||||
Green Mountain = 3752.08 0.0 6002.94
|
||||
Zelenogorsk = 2542.18 0.0 4994.26
|
||||
Tisy Military Base = 1599.15 0.0 14166.66
|
||||
Pavlovo Military Base = 2047.82 0.0 3293.36
|
@ -1 +0,0 @@
|
||||
|
@ -1,2 +0,0 @@
|
||||
|
||||
[02.01.2019 21:21] - y
|
@ -1 +0,0 @@
|
||||
|
@ -1 +0,0 @@
|
||||
|
@ -1 +0,0 @@
|
||||
|
126
README.md
126
README.md
@ -1,6 +1,6 @@
|
||||
# DayZ-SA-Tomato
|
||||
# DayZ SA Tomato
|
||||
|
||||
Dayz Standalone GUI Based Admin Tool
|
||||
Dayz Standalone UI Admin Tool
|
||||
|
||||
|
||||
|
||||
@ -10,40 +10,48 @@ See CHANGELOG.md
|
||||
|
||||
## News
|
||||
|
||||
## 20.01.2019 21:00
|
||||
## 15.12.2018 23:00
|
||||
|
||||
### Fixed
|
||||
|
||||
- For 1.0 Update (make sure to kopy the Key from Keys folder again !)
|
||||
|
||||
### Added
|
||||
|
||||
- Teleport Locations added right from in-game gui.
|
||||
- Spawn a changable size horde of zombies by a simple click on the map or on a defined location.
|
||||
- Delete Object on cursor
|
||||
- Player files sorted by Steam64ID for easy adding of admin to the server.
|
||||
- Teleport on Map click
|
||||
- Horde on Map Click
|
||||
- Customizable Kill feed (standard is disabled, change it in Config.txt File in your profiles folder)
|
||||
- Customizable Welcome message
|
||||
- Kill log file
|
||||
- Spectate Player
|
||||
|
||||
- Teleport Locations Check the Config/List Folder u can add your own Locations to it (Adding Locations from ingame does not work since filewrite is bugged at the moment)
|
||||
|
||||
### next up
|
||||
|
||||
- TBA
|
||||
-
|
||||
|
||||
|
||||
#### If Someone has this mod working on a 3rd Party host (GSP) PLEASE Cantact me or join https://discord.gg/Svgz48m to let us know to help others with the same service get their mod working as well
|
||||
#### If Someone got the mod to work on a 3rd Party hoster Cantact me or join https://discord.gg/Svgz48m
|
||||
|
||||
## Notes
|
||||
|
||||
You can do what you like with this tool as the license states. But if you add any features to it, i would appreciate if you would share your code so that everyone can benefit from it.
|
||||
You can do with this tool what you want as the licence says if you add any features to it i would appreciate if you would share your code so that everyone can benefit from it.
|
||||
|
||||
|
||||
You could cantact me by email at DayZ-SA-Tomato@Primary-Network.de
|
||||
You could cantact me per mail at DayZ-SA-Tomato@Primary-Network.de
|
||||
Or @Discord https://discord.gg/qqjwVXV
|
||||
|
||||
### Installation
|
||||
### Installing
|
||||
|
||||
0. Check out this Link if you are using a 3rd party hoster they changed there Wiki since a user asked them how to Install this mod probs to them https://trugaming.com/wiki/index.php?title=DayZ#Server_Side_Mods hoefully this helps a little bit
|
||||
1. Copy DayZ-SA-Tomato to your Server/Client main Folder
|
||||
2. Copy SchnitzelPommes.bikey to your Servers keys folder
|
||||
3. Make sure YourServerFolder/DayZ-Sa-Tomato/Config/Admins.txt file exist (You can delete it Client side)
|
||||
4. If You need to use the mod folder with an @ Make sure to create DayZ-Sa-Tomato Folder with the Config Folder in it or it wont load Admins.txt and TpLocations file
|
||||
5. Make sure when step 3 completed add your Steam64ID to this file(for every ID 1 line)
|
||||
6. Set start param -mod=DayZ-SA-Tomato at Server/Client
|
||||
7. If not exist Add -profiles=D:\YourProfileFolderMaybe/DayzServer/Log and -scrAllowFileWrite To your server Parameters
|
||||

|
||||
|
||||
|
||||
Also Available in the Steam workshop (not updated all the time)
|
||||
https://steamcommunity.com/sharedfiles/filedetails/?id=1575615457
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
0. If you upgrade from an older version delete all of it and start at step 1.
|
||||
1. Click download, get the zip file, and open it
|
||||
1. Copy DayZ-SA-Tomato to your Server AND Client main (ROOT) Folder
|
||||
@ -97,24 +105,30 @@ Check out this Link if you are using a 3rd party hoster. They changed their Wiki
|
||||
```
|
||||
```
|
||||
### Enabling Logs and Messages
|
||||
=======
|
||||
>>>>>>> parent of c8d7f7d... Update to Ver. 1.30
|
||||
|
||||
-First thing you do is to go in to your server and open DayZServer/URPROFILES/Tomato_Profiles/Config/Config.txt file. Find the features you'd like to add and change the number 0 at the end to a 1 to enable it.
|
||||
|
||||
-Next if you want to customize the messages you can but REMEMBER you can not change certain parts or you wont get all your information from the message. Make sure you DO NOT edit anyting BEFORE the = symbol, the = symbol, or anything in the {} brackets.
|
||||
```
|
||||
```
|
||||

|
||||
|
||||
|
||||
## Test and Use
|
||||
|
||||
Start your Server and login
|
||||
|
||||
Check your Server log for
|
||||
|
||||
```
|
||||
Adding Admin:
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
If this Meessage appears the server loadet the tool if not you did something wrong
|
||||
|
||||
-If you are still not able to access the admin tool with "M" there IS another way to activate the menu on your server. First, go to your DayZ server root and find your "profiles" (or whatever you named your profiles folder) and open it. Inside that folder will be a DayZ-Sa-Tomato folder. Inside that there is a "config" folder and inside that one is a "players" folder. There should be a file in there YOURSTEAM64ID.player (i.e. 76561198161388867.Player). right click and edit that to change Admin = 0 to Admin = 1 save and close that file. Back out to the "config" folder and edit config.txt to change the first option Setup = 0 to setup = 1. Restart the server and join your server and "M" should now work for you.
|
||||
```
|
||||
```
|
||||

|
||||
```
|
||||
In Game press "M" Key
|
||||
```
|
||||
If Your Client is configured with the mod a Message will appear @chat
|
||||
If Your Server is also configured correct and Admins.txt Contains your id The Ui will open
|
||||
|
||||
## Features
|
||||
|
||||
* **In Game** - M Key brings up the UI
|
||||
@ -129,21 +143,10 @@ Check out this Link if you are using a 3rd party hoster. They changed their Wiki
|
||||
* **Commands Tab** - Nighttime
|
||||
* **Commands Tab** - Spawn Car repaired and filled
|
||||
* **Commands Tab** - Refill nearest Car
|
||||
* **Commands Tab** - Delete at cursor
|
||||
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
------------
|
||||
|
||||
* **Spawn Tab** - Item/AI/Building Spawning
|
||||
|
||||
|
||||
|
||||
|
||||

|
||||
* **Spawn Tab** - Item/AI/Building Spawning
|
||||
|
||||
------------
|
||||
|
||||
@ -154,50 +157,17 @@ Check out this Link if you are using a 3rd party hoster. They changed their Wiki
|
||||
* **Player Tab** - Disable Stamina for specific Player
|
||||
* **Player Tab** - Heal Player
|
||||
* **Player Tab** - Kill Player
|
||||
* **Player Tab** - Spectate Player
|
||||
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
------------
|
||||
|
||||
* **Teleport Tab** - Teleport location list
|
||||
* **Teleport Tab** - Add/remove teleport locations in list
|
||||
* **Teleport Tab** - Spawn zombie hordes on locations
|
||||
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
------------
|
||||
|
||||
* **Map Tab** - Shows Location of all Players on the Map
|
||||
* **Map Tab** - Spawn Zombie Horde on map
|
||||
* **Map Tab** - Teleport by map
|
||||
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
------------
|
||||
|
||||
* **About Tab** - All the information about support for DayZ-Sa-Tomato
|
||||
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
------------
|
||||
|
||||
|
||||
### Known Issues
|
||||
* **Spwan Tab** - Item Preview (right side not working)
|
||||
* **Spwan Tab** - Building spawning in ground
|
||||
* **Player Tab** - Blood Energy not showing correctly (sometimes it does)
|
||||
* **Player Tab** - Send Message not working
|
||||
|
||||
## License
|
||||
|
||||
|
Reference in New Issue
Block a user