From 24f7756370869c921a3845b932228e32d91886c0 Mon Sep 17 00:00:00 2001 From: Maverick Motherfucker Date: Sat, 4 Jun 2011 10:35:20 -0700 Subject: [PATCH] did a debug session, fixed bugs --- TShockAPI/Commands.cs | 2 +- TShockAPI/Group.cs | 2 +- TShockAPI/Tools.cs | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 0848b597..26a3be87 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -10,7 +10,7 @@ namespace TShockAPI public class Commands { public delegate void CommandDelegate(CommandArgs args); - public static List commands; + public static List commands = new List(); public struct CommandArgs { diff --git a/TShockAPI/Group.cs b/TShockAPI/Group.cs index e3bb5bcf..1572221b 100644 --- a/TShockAPI/Group.cs +++ b/TShockAPI/Group.cs @@ -76,7 +76,7 @@ namespace TShockAPI { } - new public virtual bool HasPermission(string permission) + public override bool HasPermission(string permission) { return true; } diff --git a/TShockAPI/Tools.cs b/TShockAPI/Tools.cs index 4b6dbf99..a4cc44d8 100644 --- a/TShockAPI/Tools.cs +++ b/TShockAPI/Tools.cs @@ -7,7 +7,7 @@ namespace TShockAPI { class Tools { - private static List groups; + private static List groups = new List(); /// /// Provides the real IP address from a RemoteEndPoint string that contains a port and an IP @@ -418,7 +418,7 @@ namespace TShockAPI { ip = GetRealIP(ip); - StreamReader sr = new StreamReader("users.txt"); + StreamReader sr = new StreamReader(FileTools.SaveDir + "users.txt"); string data = sr.ReadToEnd(); data = data.Replace("\r", ""); string[] lines = data.Split('\n'); @@ -430,6 +430,10 @@ namespace TShockAPI { continue; } + if (lines[i].StartsWith("#")) + { + continue; + } if (args[0].Equals(ip)) { return GetGroup(args[1]);