Renamed settings to start with a Capital letter
Removed config read on post init. Already read in SetupConfig which is called in Init Added option to disable auto saving
This commit is contained in:
parent
d369852998
commit
17cd6652d7
7 changed files with 48 additions and 30 deletions
|
|
@ -78,15 +78,17 @@ namespace TShockAPI
|
|||
public static bool ListServer = false;
|
||||
|
||||
public static int Spawn_WorldID;
|
||||
public static int originalSpawnX;
|
||||
public static int originalSpawnY;
|
||||
public static int spawnTileX;
|
||||
public static int spawnTileY;
|
||||
public static int OriginalSpawnX;
|
||||
public static int OriginalSpawnY;
|
||||
public static int SpawnTileX;
|
||||
public static int SpawnTileY;
|
||||
|
||||
public static bool hardcoreOnly = false;
|
||||
public static bool HardcoreOnly = false;
|
||||
public static bool KickOnHardcoreDeath = false;
|
||||
public static bool BanOnHardcoreDeath = false;
|
||||
|
||||
public static bool AutoSave = true;
|
||||
|
||||
public static void ReadJsonConfiguration()
|
||||
{
|
||||
TextReader tr = new StreamReader(FileTools.ConfigPath);
|
||||
|
|
@ -125,15 +127,16 @@ namespace TShockAPI
|
|||
BackupInterval = cfg.BackupInterval;
|
||||
BackupKeepFor = cfg.BackupKeepFor;
|
||||
ListServer = cfg.ListServer;
|
||||
originalSpawnX = Main.spawnTileX;
|
||||
originalSpawnY = Main.spawnTileY;
|
||||
spawnTileX = cfg.spawnTileX;
|
||||
spawnTileY = cfg.spawnTileY;
|
||||
OriginalSpawnX = Main.spawnTileX;
|
||||
OriginalSpawnY = Main.spawnTileY;
|
||||
SpawnTileX = cfg.SpawnTileX;
|
||||
SpawnTileY = cfg.SpawnTileY;
|
||||
Spawn_WorldID = cfg.Spawn_WorldID;
|
||||
RememberLeavePos = cfg.RememberLeavePos;
|
||||
hardcoreOnly = cfg.HardcoreOnly;
|
||||
HardcoreOnly = cfg.HardcoreOnly;
|
||||
KickOnHardcoreDeath = cfg.KickOnHardcoreOnlyDeath;
|
||||
BanOnHardcoreDeath = cfg.BanOnHardcoreOnlyDeath;
|
||||
AutoSave = cfg.AutoSave;
|
||||
}
|
||||
|
||||
public static void WriteJsonConfiguration()
|
||||
|
|
@ -168,13 +171,14 @@ namespace TShockAPI
|
|||
cfg.BackupInterval = BackupInterval;
|
||||
cfg.BackupKeepFor = BackupKeepFor;
|
||||
cfg.ListServer = ListServer;
|
||||
cfg.spawnTileX = spawnTileX;
|
||||
cfg.spawnTileY = spawnTileY;
|
||||
cfg.SpawnTileX = SpawnTileX;
|
||||
cfg.SpawnTileY = SpawnTileY;
|
||||
cfg.RememberLeavePos = RememberLeavePos;
|
||||
cfg.Spawn_WorldID = Spawn_WorldID;
|
||||
cfg.HardcoreOnly = hardcoreOnly;
|
||||
cfg.HardcoreOnly = HardcoreOnly;
|
||||
cfg.BanOnHardcoreOnlyDeath = BanOnHardcoreDeath;
|
||||
cfg.KickOnHardcoreOnlyDeath = KickOnHardcoreDeath;
|
||||
cfg.AutoSave = AutoSave;
|
||||
string json = JsonConvert.SerializeObject(cfg, Formatting.Indented);
|
||||
TextWriter tr = new StreamWriter(FileTools.ConfigPath);
|
||||
tr.Write(json);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue