public class InjectedServerConnection extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
InjectedServerConnection.ServerSocketType |
| Modifier and Type | Field and Description |
|---|---|
static ReportType |
REPORT_CANNOT_COPY_OLD_TO_NEW |
static ReportType |
REPORT_CANNOT_FIND_LISTENER_THREAD |
static ReportType |
REPORT_CANNOT_FIND_MINECRAFT_SERVER |
static ReportType |
REPORT_CANNOT_FIND_NET_HANDLER_THREAD |
static ReportType |
REPORT_CANNOT_FIND_SERVER_CONNECTION |
static ReportType |
REPORT_CANNOT_INJECT_SERVER_CONNECTION |
static ReportType |
REPORT_CANNOT_READ_LISTENER_THREAD |
static ReportType |
REPORT_INSUFFICENT_THREAD_COUNT |
static ReportType |
REPORT_UNEXPECTED_THREAD_COUNT |
| Constructor and Description |
|---|
InjectedServerConnection(ErrorReporter reporter,
AbstractInputStreamLookup socketInjector,
org.bukkit.Server server,
com.comphenix.protocol.injector.player.NetLoginInjector netLoginInjector) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanupAll()
Undoes everything.
|
Object |
getListenerThread()
Retrieve the listener thread object, or NULL the server isn't using this socket implementation.
|
Object |
getServerConnection()
Retrieve the server connection object, or NULL if the server isn't using it as the socket implementation.
|
static Object |
getServerConnection(ErrorReporter reporter,
org.bukkit.Server server)
Retrieve the current server connection.
|
InjectedServerConnection.ServerSocketType |
getServerSocketType()
Retrieve the known server socket type.
|
void |
initialize()
Initial reflective detective work.
|
void |
injectList()
Inject the connection interceptor into the correct server socket implementation.
|
void |
replaceServerHandler(Object oldHandler,
Object newHandler)
Replace the server handler instance kept by the "keep alive" object.
|
void |
revertServerHandler(Object oldHandler)
Revert to the old vanilla server handler, if it has been replaced.
|
public static final ReportType REPORT_CANNOT_FIND_MINECRAFT_SERVER
public static final ReportType REPORT_CANNOT_INJECT_SERVER_CONNECTION
public static final ReportType REPORT_CANNOT_FIND_LISTENER_THREAD
public static final ReportType REPORT_CANNOT_READ_LISTENER_THREAD
public static final ReportType REPORT_CANNOT_FIND_SERVER_CONNECTION
public static final ReportType REPORT_UNEXPECTED_THREAD_COUNT
public static final ReportType REPORT_CANNOT_FIND_NET_HANDLER_THREAD
public static final ReportType REPORT_INSUFFICENT_THREAD_COUNT
public static final ReportType REPORT_CANNOT_COPY_OLD_TO_NEW
public InjectedServerConnection(ErrorReporter reporter, AbstractInputStreamLookup socketInjector, org.bukkit.Server server, com.comphenix.protocol.injector.player.NetLoginInjector netLoginInjector)
public static Object getServerConnection(ErrorReporter reporter, org.bukkit.Server server)
reporter - - error reproter.server - - the current server.FieldAccessException - Reflection error.public void initialize()
public InjectedServerConnection.ServerSocketType getServerSocketType()
This depends on the version of CraftBukkit we are using.
public void injectList()
public Object getListenerThread() throws RuntimeException, IllegalAccessException
IllegalAccessException - Cannot access field.RuntimeException - Unexpected class structure - the field doesn't exist.public Object getServerConnection() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
IllegalAccessException - If the reflective operation failed.IllegalArgumentException - If the reflective operation failed.InvocationTargetException - If the reflective operation failed.public void replaceServerHandler(Object oldHandler, Object newHandler)
oldHandler - - old server handler.newHandler - - new, proxied server handler.public void revertServerHandler(Object oldHandler)
oldHandler - - old vanilla server handler.public void cleanupAll()
Copyright © 2012–2017 Comphenix and dmulloy2. Licensed under the GNU GPL v2.