Core: Fix color not being in /goto.

This commit is contained in:
UnknownShadow200 2016-09-16 17:36:31 +10:00
parent 3714775621
commit a6de8d7986
2 changed files with 4 additions and 21 deletions

View File

@ -28,26 +28,9 @@ namespace MCGalaxy {
public static bool Read(string path, Action<string, string> processor, public static bool Read(string path, Action<string, string> processor,
char separator = '=', bool trimValue = true) { char separator = '=', bool trimValue = true) {
if (!File.Exists(path)) return false; object obj = null;
LineProcessor<object> del = (string key, string value, ref object state) => { processor(key, value); };
using (CP437Reader reader = new CP437Reader(path)) { return Read(path, ref obj, del, separator, trimValue);
string line;
while ((line = reader.ReadLine()) != null) {
int index = ParseLine(line, path, separator);
if (index == -1) continue;
string key = line.Substring(0, index), value = line.Substring(index + 1);
if (trimValue) value = value.Trim();
try {
processor(key.Trim(), value);
} catch (Exception ex) {
Server.ErrorLog(ex);
Server.s.Log("Line \"" + line + "\" in " + path + " caused an error");
}
}
}
return true;
} }
public static bool Read<T>(string path, ref T state, LineProcessor<T> processor, public static bool Read<T>(string path, ref T state, LineProcessor<T> processor,

View File

@ -125,7 +125,7 @@ namespace MCGalaxy {
p.prevMsg = ""; p.prevMsg = "";
if (!p.hidden && p.level.ShouldShowJoinMessage(oldLevel)) { if (!p.hidden && p.level.ShouldShowJoinMessage(oldLevel)) {
Player.SendChatFrom(p, p.DisplayName + " %Swent to &b" + lvl.name, false); Player.SendChatFrom(p, p.ColoredName + " %Swent to &b" + lvl.name, false);
Player.RaisePlayerAction(p, PlayerAction.JoinWorld, lvl.name); Player.RaisePlayerAction(p, PlayerAction.JoinWorld, lvl.name);
} }
return true; return true;