!= should be ==

This commit is contained in:
high 2011-09-05 01:44:46 -04:00
parent 7cfc219794
commit 332fe805a9

View file

@ -30,9 +30,9 @@ namespace TShockAPI
Ip = ip; Ip = ip;
Port = port; Port = port;
} }
public void Start() public virtual void Start()
{ {
if (listener != null) if (listener == null)
{ {
listener = HttpListener.Create(Ip, Port); listener = HttpListener.Create(Ip, Port);
listener.RequestReceived += OnRequest; listener.RequestReceived += OnRequest;
@ -45,7 +45,7 @@ namespace TShockAPI
Port = port; Port = port;
Start(); Start();
} }
public void Stop() public virtual void Stop()
{ {
listener.Stop(); listener.Stop();
} }
@ -55,12 +55,12 @@ namespace TShockAPI
Register(new RestCommand(path, callback)); Register(new RestCommand(path, callback));
} }
public void Register(RestCommand com) public virtual void Register(RestCommand com)
{ {
commands.Add(com); commands.Add(com);
} }
void OnRequest(object sender, RequestEventArgs e) protected virtual void OnRequest(object sender, RequestEventArgs e)
{ {
var obj = Process(sender, e); var obj = Process(sender, e);
if (obj == null) if (obj == null)