mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 04:32:50 -04:00
Properly load ZS properties now
This commit is contained in:
parent
8926fe92e2
commit
ed2ea2af14
@ -18,6 +18,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using MCGalaxy.Games;
|
||||
using MCGalaxy.SQL;
|
||||
|
||||
namespace MCGalaxy {
|
||||
@ -42,6 +43,9 @@ namespace MCGalaxy {
|
||||
oldPerms = new OldPerms();
|
||||
if (PropertiesFile.Read(givenPath, ref oldPerms, LineProcessor))
|
||||
Server.s.SettingsUpdate();
|
||||
if (oldPerms.saveZS)
|
||||
ZombieGameProps.SaveSettings();
|
||||
ZombieGameProps.LoadSettings();
|
||||
|
||||
Database.Backend = Server.useMySQL ?
|
||||
MySQLBackend.Instance : SQLiteBackend.Instance;
|
||||
@ -70,14 +74,20 @@ namespace MCGalaxy {
|
||||
perms.adminchatPerm = int.Parse(value); break;
|
||||
|
||||
default:
|
||||
if (!ConfigElement.Parse(Server.serverConfig, key, value, null))
|
||||
if (!ConfigElement.Parse(Server.serverConfig, key, value, null)) {
|
||||
// ZS used to be part of server.properties
|
||||
if (ConfigElement.Parse(Server.zombieConfig, key, value, null)) {
|
||||
perms.saveZS = true;
|
||||
} else {
|
||||
Server.s.Log("\"" + key + "\" was not a recognised server property key.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
internal static OldPerms oldPerms;
|
||||
internal class OldPerms { public int viewPerm = -1, nextPerm = -1,
|
||||
clearPerm = -1, opchatPerm = -1, adminchatPerm = -1; }
|
||||
clearPerm = -1, opchatPerm = -1, adminchatPerm = -1; public bool saveZS; }
|
||||
|
||||
public static void Save() { Save(Paths.ServerPropsFile); }
|
||||
static readonly object saveLock = new object();
|
||||
@ -127,14 +137,6 @@ namespace MCGalaxy {
|
||||
w.WriteLine("# adminchat-perm = The rank required to view adminchat. Default rank is superop.");
|
||||
w.WriteLine("# admins-join-silent = Players who have adminchat permission join the game silently. Default true");
|
||||
w.WriteLine("# server-owner = The minecraft name, of the owner of the server.");
|
||||
w.WriteLine("# zombie-on-server-start = Starts Zombie Survival when server is started.");
|
||||
w.WriteLine("# no-respawning-during-zombie = Disables respawning (Pressing R) while Zombie is on.");
|
||||
w.WriteLine("# no-pillaring-during-zombie = Disables pillaring while Zombie Survival is activated.");
|
||||
w.WriteLine("# zombie-name-while-infected = Sets the zombies name while actived if there is a value.");
|
||||
w.WriteLine("# enable-changing-levels = After a Zombie Survival round has finished, will change the level it is running on.");
|
||||
w.WriteLine("# zombie-survival-only-server = EXPERIMENTAL! Makes the server only for Zombie Survival (etc. changes main level)");
|
||||
w.WriteLine("# use-level-list = Only gets levels for changing levels in Zombie Survival from zombie-level-list.");
|
||||
w.WriteLine("# zombie-level-list = List of levels for changing levels (Must be comma seperated, no spaces. Must have changing levels and use level list enabled.)");
|
||||
w.WriteLine("# total-undo = Track changes made by the last X people logged on for undo purposes. Folder is rotated when full, so when set to 200, will actually track around 400.");
|
||||
w.WriteLine("# guest-limit-notify = Show -Too Many Guests- message in chat when maxGuests has been reached. Default false");
|
||||
w.WriteLine("# guest-join-notify = Shows when guests and lower ranks join server in chat and IRC. Default true");
|
||||
|
@ -200,5 +200,14 @@ namespace MCGalaxy.Games {
|
||||
ConfigElement.Serialise(Server.zombieConfig, " options", w, null);
|
||||
}
|
||||
}
|
||||
|
||||
public static void LoadSettings() {
|
||||
PropertiesFile.Read("properties/zombiesurvival.properties", ZSLineProcessor);
|
||||
}
|
||||
|
||||
static void ZSLineProcessor(string key, string value) {
|
||||
if (!ConfigElement.Parse(Server.zombieConfig, key, value, null))
|
||||
Server.s.Log("\"" + key + "\" was not a recognised zombie survival property key.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -59,9 +59,9 @@ namespace MCGalaxy {
|
||||
}
|
||||
}
|
||||
|
||||
internal static ConfigElement[] serverConfig, zombieConfig, levelConfig;
|
||||
internal static ConfigElement[] serverConfig, levelConfig, zombieConfig;
|
||||
public void Start() {
|
||||
serverConfig = ConfigElement.GetAll(typeof(Server), typeof(ZombieGameProps));
|
||||
serverConfig = ConfigElement.GetAll(typeof(Server));
|
||||
zombieConfig = ConfigElement.GetAll(typeof(ZombieGameProps));
|
||||
levelConfig = ConfigElement.GetAll(typeof(Level));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user