Added /setspawn command, uses "cfg" permmission. Sets the spawn point of the server

This commit is contained in:
Twitchy 2011-06-23 19:34:27 +12:00
parent 5a38810305
commit f790d9378c
3 changed files with 17 additions and 0 deletions

View file

@ -110,6 +110,8 @@ namespace TShockAPI
BackupInterval = cfg.BackupInterval;
BackupKeepFor = cfg.BackupKeepFor;
ListServer = cfg.ListServer;
Main.spawnTileX = cfg.spawnTileX;
Main.spawnTileY = cfg.spawnTileY;
}
public static void WriteJsonConfiguration()
@ -142,6 +144,9 @@ namespace TShockAPI
cfg.BackupInterval = BackupInterval;
cfg.BackupKeepFor = BackupKeepFor;
cfg.ListServer = ListServer;
cfg.spawnTileX = Main.spawnTileX;
cfg.spawnTileY = Main.spawnTileY;
string json = JsonConvert.SerializeObject(cfg, Formatting.Indented);
TextWriter tr = new StreamWriter(FileTools.ConfigPath);
tr.Write(json);