mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-12-25 10:38:19 +01:00
Essentially, it's a lookup for a player's input stream.
Or: InputStream -> PlayerInjector -> Player.
This commit is contained in:
parent
8c2f6bddd8
commit
9195e677ab
@ -27,7 +27,7 @@ import net.sf.cglib.proxy.Factory;
|
||||
import org.bukkit.Server;
|
||||
|
||||
import com.comphenix.protocol.error.ErrorReporter;
|
||||
import com.comphenix.protocol.injector.server.InjectedServerSocket;
|
||||
import com.comphenix.protocol.injector.server.InputStreamPlayerLookup;
|
||||
import com.comphenix.protocol.reflect.FieldUtils;
|
||||
import com.comphenix.protocol.reflect.FuzzyReflection;
|
||||
import com.comphenix.protocol.reflect.ObjectWriter;
|
||||
@ -55,7 +55,7 @@ class InjectedServerConnection {
|
||||
private NetLoginInjector netLoginInjector;
|
||||
|
||||
// Inject server connections
|
||||
private InjectedServerSocket socketInjector;
|
||||
private InputStreamPlayerLookup socketInjector;
|
||||
|
||||
private Server server;
|
||||
private ErrorReporter reporter;
|
||||
@ -64,7 +64,7 @@ class InjectedServerConnection {
|
||||
|
||||
private Object minecraftServer = null;
|
||||
|
||||
public InjectedServerConnection(ErrorReporter reporter, InjectedServerSocket socketInjector, Server server, NetLoginInjector netLoginInjector) {
|
||||
public InjectedServerConnection(ErrorReporter reporter, InputStreamPlayerLookup socketInjector, Server server, NetLoginInjector netLoginInjector) {
|
||||
this.listFields = new ArrayList<VolatileField>();
|
||||
this.replacedLists = new ArrayList<ReplacedArrayList<Object>>();
|
||||
this.reporter = reporter;
|
||||
|
@ -25,7 +25,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import com.comphenix.protocol.error.ErrorReporter;
|
||||
import com.comphenix.protocol.injector.GamePhase;
|
||||
import com.comphenix.protocol.injector.server.InjectedServerSocket;
|
||||
import com.comphenix.protocol.injector.server.InputStreamPlayerLookup;
|
||||
import com.comphenix.protocol.injector.server.SocketInjector;
|
||||
import com.comphenix.protocol.reflect.FuzzyReflection;
|
||||
import com.comphenix.protocol.utility.MinecraftReflection;
|
||||
@ -45,12 +45,12 @@ class NetLoginInjector {
|
||||
private ProxyPlayerInjectionHandler injectionHandler;
|
||||
|
||||
// Associate input streams and injectors
|
||||
private InjectedServerSocket serverSocket;
|
||||
private InputStreamPlayerLookup serverSocket;
|
||||
|
||||
// The current error rerporter
|
||||
private ErrorReporter reporter;
|
||||
|
||||
public NetLoginInjector(ErrorReporter reporter, ProxyPlayerInjectionHandler injectionHandler, InjectedServerSocket serverSocket) {
|
||||
public NetLoginInjector(ErrorReporter reporter, ProxyPlayerInjectionHandler injectionHandler, InputStreamPlayerLookup serverSocket) {
|
||||
this.reporter = reporter;
|
||||
this.injectionHandler = injectionHandler;
|
||||
this.serverSocket = serverSocket;
|
||||
|
@ -36,7 +36,7 @@ import com.comphenix.protocol.injector.GamePhase;
|
||||
import com.comphenix.protocol.injector.ListenerInvoker;
|
||||
import com.comphenix.protocol.injector.PlayerLoggedOutException;
|
||||
import com.comphenix.protocol.injector.PacketFilterManager.PlayerInjectHooks;
|
||||
import com.comphenix.protocol.injector.server.InjectedServerSocket;
|
||||
import com.comphenix.protocol.injector.server.InputStreamPlayerLookup;
|
||||
import com.comphenix.protocol.injector.server.SocketInjector;
|
||||
import com.comphenix.protocol.injector.server.TemporaryPlayerFactory;
|
||||
import com.google.common.base.Predicate;
|
||||
@ -52,7 +52,7 @@ class ProxyPlayerInjectionHandler implements PlayerInjectionHandler {
|
||||
private InjectedServerConnection serverInjection;
|
||||
|
||||
// Server socket injection
|
||||
private InjectedServerSocket serverSocket;
|
||||
private InputStreamPlayerLookup serverSocket;
|
||||
|
||||
// NetLogin injector
|
||||
private NetLoginInjector netLoginInjector;
|
||||
@ -96,7 +96,7 @@ class ProxyPlayerInjectionHandler implements PlayerInjectionHandler {
|
||||
this.invoker = invoker;
|
||||
this.injectionFilter = injectionFilter;
|
||||
this.packetListeners = packetListeners;
|
||||
this.serverSocket = new InjectedServerSocket(reporter, server);
|
||||
this.serverSocket = new InputStreamPlayerLookup(reporter, server);
|
||||
this.netLoginInjector = new NetLoginInjector(reporter, this, serverSocket);
|
||||
this.serverInjection = new InjectedServerConnection(reporter, serverSocket, server, netLoginInjector);
|
||||
serverInjection.injectList();
|
||||
|
@ -34,7 +34,7 @@ import com.google.common.collect.MapMaker;
|
||||
*
|
||||
* @author Kristian
|
||||
*/
|
||||
public class InjectedServerSocket {
|
||||
public class InputStreamPlayerLookup {
|
||||
/**
|
||||
* The read and connect timeout for our built-in MOTD reader.
|
||||
*/
|
||||
@ -162,7 +162,7 @@ public class InjectedServerSocket {
|
||||
// Used to create fake players
|
||||
private TemporaryPlayerFactory tempPlayerFactory = new TemporaryPlayerFactory();
|
||||
|
||||
public InjectedServerSocket(ErrorReporter reporter, Server server) {
|
||||
public InputStreamPlayerLookup(ErrorReporter reporter, Server server) {
|
||||
this.reporter = reporter;
|
||||
this.server = server;
|
||||
}
|
Loading…
Reference in New Issue
Block a user