Implement "isOnline" for temporary players.

This corrects the issue seen on http://pastebin.com/C4D8jsja
This commit is contained in:
Kristian S. Stangeland 2013-05-06 18:37:08 +02:00
parent 0fc6396974
commit 8d814d2d9c

View File

@ -102,6 +102,8 @@ public class TemporaryPlayerFactory {
throw new IllegalStateException("Unable to find injector.");
// Use the socket to get the address
if (methodName.equalsIgnoreCase("isOnline"))
return injector.getSocket() != null && injector.getSocket().isConnected();
if (methodName.equalsIgnoreCase("getName"))
return "UNKNOWN[" + injector.getSocket().getRemoteSocketAddress() + "]";
if (methodName.equalsIgnoreCase("getPlayer"))