Rcon Command Changes

- moved the rcon commands to the gamedata files, so they can be extended.
This commit is contained in:
Brett Hewitson 2022-06-14 12:55:58 +10:00
parent f3ff807cd0
commit e7100e6323
18 changed files with 266 additions and 152 deletions

View file

@ -32,6 +32,7 @@ namespace ServerManagerTool.Utils
data.GameMaps.AddRange(fileData.GameMaps);
data.Branches.AddRange(fileData.Branches);
data.ServerRegions.AddRange(fileData.ServerRegions);
data.RconInputModes.AddRange(fileData.RconInputModes);
}
catch
{
@ -90,6 +91,9 @@ namespace ServerManagerTool.Utils
[DataMember(IsRequired = false)]
public List<ServerRegionDataItem> ServerRegions = new List<ServerRegionDataItem>();
[DataMember(IsRequired = false)]
public List<RconInputModeItem> RconInputModes = new List<RconInputModeItem>();
public static MainGameData Load(string file, bool isUserData)
{
if (string.IsNullOrWhiteSpace(file) || !File.Exists(file))
@ -102,6 +106,7 @@ namespace ServerManagerTool.Utils
data.GameMaps.ForEach(c => c.IsUserData = isUserData);
data.Branches.ForEach(c => c.IsUserData = isUserData);
data.ServerRegions.ForEach(c => c.IsUserData = isUserData);
data.RconInputModes.ForEach(c => c.IsUserData = isUserData);
}
return data;
}
@ -148,4 +153,15 @@ namespace ServerManagerTool.Utils
public bool IsUserData = false;
}
[DataContract]
public class RconInputModeItem
{
[DataMember]
public string Command = string.Empty;
[DataMember]
public string Description = string.Empty;
public bool IsUserData = false;
}
}