Essentially, it's a lookup for a player's input stream.

Or: InputStream -> PlayerInjector -> Player.
This commit is contained in:
Kristian S. Stangeland 2013-02-25 20:32:27 +01:00
parent 8c2f6bddd8
commit 9195e677ab
4 changed files with 11 additions and 11 deletions

View File

@ -27,7 +27,7 @@ import net.sf.cglib.proxy.Factory;
import org.bukkit.Server; import org.bukkit.Server;
import com.comphenix.protocol.error.ErrorReporter; 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.FieldUtils;
import com.comphenix.protocol.reflect.FuzzyReflection; import com.comphenix.protocol.reflect.FuzzyReflection;
import com.comphenix.protocol.reflect.ObjectWriter; import com.comphenix.protocol.reflect.ObjectWriter;
@ -55,7 +55,7 @@ class InjectedServerConnection {
private NetLoginInjector netLoginInjector; private NetLoginInjector netLoginInjector;
// Inject server connections // Inject server connections
private InjectedServerSocket socketInjector; private InputStreamPlayerLookup socketInjector;
private Server server; private Server server;
private ErrorReporter reporter; private ErrorReporter reporter;
@ -64,7 +64,7 @@ class InjectedServerConnection {
private Object minecraftServer = null; 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.listFields = new ArrayList<VolatileField>();
this.replacedLists = new ArrayList<ReplacedArrayList<Object>>(); this.replacedLists = new ArrayList<ReplacedArrayList<Object>>();
this.reporter = reporter; this.reporter = reporter;

View File

@ -25,7 +25,7 @@ import org.bukkit.entity.Player;
import com.comphenix.protocol.error.ErrorReporter; import com.comphenix.protocol.error.ErrorReporter;
import com.comphenix.protocol.injector.GamePhase; 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.injector.server.SocketInjector;
import com.comphenix.protocol.reflect.FuzzyReflection; import com.comphenix.protocol.reflect.FuzzyReflection;
import com.comphenix.protocol.utility.MinecraftReflection; import com.comphenix.protocol.utility.MinecraftReflection;
@ -45,12 +45,12 @@ class NetLoginInjector {
private ProxyPlayerInjectionHandler injectionHandler; private ProxyPlayerInjectionHandler injectionHandler;
// Associate input streams and injectors // Associate input streams and injectors
private InjectedServerSocket serverSocket; private InputStreamPlayerLookup serverSocket;
// The current error rerporter // The current error rerporter
private ErrorReporter reporter; private ErrorReporter reporter;
public NetLoginInjector(ErrorReporter reporter, ProxyPlayerInjectionHandler injectionHandler, InjectedServerSocket serverSocket) { public NetLoginInjector(ErrorReporter reporter, ProxyPlayerInjectionHandler injectionHandler, InputStreamPlayerLookup serverSocket) {
this.reporter = reporter; this.reporter = reporter;
this.injectionHandler = injectionHandler; this.injectionHandler = injectionHandler;
this.serverSocket = serverSocket; this.serverSocket = serverSocket;

View File

@ -36,7 +36,7 @@ import com.comphenix.protocol.injector.GamePhase;
import com.comphenix.protocol.injector.ListenerInvoker; import com.comphenix.protocol.injector.ListenerInvoker;
import com.comphenix.protocol.injector.PlayerLoggedOutException; import com.comphenix.protocol.injector.PlayerLoggedOutException;
import com.comphenix.protocol.injector.PacketFilterManager.PlayerInjectHooks; 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.SocketInjector;
import com.comphenix.protocol.injector.server.TemporaryPlayerFactory; import com.comphenix.protocol.injector.server.TemporaryPlayerFactory;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
@ -52,7 +52,7 @@ class ProxyPlayerInjectionHandler implements PlayerInjectionHandler {
private InjectedServerConnection serverInjection; private InjectedServerConnection serverInjection;
// Server socket injection // Server socket injection
private InjectedServerSocket serverSocket; private InputStreamPlayerLookup serverSocket;
// NetLogin injector // NetLogin injector
private NetLoginInjector netLoginInjector; private NetLoginInjector netLoginInjector;
@ -96,7 +96,7 @@ class ProxyPlayerInjectionHandler implements PlayerInjectionHandler {
this.invoker = invoker; this.invoker = invoker;
this.injectionFilter = injectionFilter; this.injectionFilter = injectionFilter;
this.packetListeners = packetListeners; this.packetListeners = packetListeners;
this.serverSocket = new InjectedServerSocket(reporter, server); this.serverSocket = new InputStreamPlayerLookup(reporter, server);
this.netLoginInjector = new NetLoginInjector(reporter, this, serverSocket); this.netLoginInjector = new NetLoginInjector(reporter, this, serverSocket);
this.serverInjection = new InjectedServerConnection(reporter, serverSocket, server, netLoginInjector); this.serverInjection = new InjectedServerConnection(reporter, serverSocket, server, netLoginInjector);
serverInjection.injectList(); serverInjection.injectList();

View File

@ -34,7 +34,7 @@ import com.google.common.collect.MapMaker;
* *
* @author Kristian * @author Kristian
*/ */
public class InjectedServerSocket { public class InputStreamPlayerLookup {
/** /**
* The read and connect timeout for our built-in MOTD reader. * The read and connect timeout for our built-in MOTD reader.
*/ */
@ -162,7 +162,7 @@ public class InjectedServerSocket {
// Used to create fake players // Used to create fake players
private TemporaryPlayerFactory tempPlayerFactory = new TemporaryPlayerFactory(); private TemporaryPlayerFactory tempPlayerFactory = new TemporaryPlayerFactory();
public InjectedServerSocket(ErrorReporter reporter, Server server) { public InputStreamPlayerLookup(ErrorReporter reporter, Server server) {
this.reporter = reporter; this.reporter = reporter;
this.server = server; this.server = server;
} }