did a debug session, fixed bugs

This commit is contained in:
Maverick Motherfucker 2011-06-04 10:35:20 -07:00
parent cfd3cbf5a3
commit 24f7756370
3 changed files with 8 additions and 4 deletions

View file

@ -10,7 +10,7 @@ namespace TShockAPI
public class Commands public class Commands
{ {
public delegate void CommandDelegate(CommandArgs args); public delegate void CommandDelegate(CommandArgs args);
public static List<Command> commands; public static List<Command> commands = new List<Command>();
public struct CommandArgs public struct CommandArgs
{ {

View file

@ -76,7 +76,7 @@ namespace TShockAPI
{ {
} }
new public virtual bool HasPermission(string permission) public override bool HasPermission(string permission)
{ {
return true; return true;
} }

View file

@ -7,7 +7,7 @@ namespace TShockAPI
{ {
class Tools class Tools
{ {
private static List<Group> groups; private static List<Group> groups = new List<Group>();
/// <summary> /// <summary>
/// Provides the real IP address from a RemoteEndPoint string that contains a port and an IP /// 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); ip = GetRealIP(ip);
StreamReader sr = new StreamReader("users.txt"); StreamReader sr = new StreamReader(FileTools.SaveDir + "users.txt");
string data = sr.ReadToEnd(); string data = sr.ReadToEnd();
data = data.Replace("\r", ""); data = data.Replace("\r", "");
string[] lines = data.Split('\n'); string[] lines = data.Split('\n');
@ -430,6 +430,10 @@ namespace TShockAPI
{ {
continue; continue;
} }
if (lines[i].StartsWith("#"))
{
continue;
}
if (args[0].Equals(ip)) if (args[0].Equals(ip))
{ {
return GetGroup(args[1]); return GetGroup(args[1]);