LexManos

Forge IConnectionHandler First Draft

Feb 7th, 2012
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.39 KB | None | 0 0
  1. package net.minecraft.src.forge;
  2.  
  3. import net.minecraft.src.NetworkManager;
  4. import net.minecraft.src.Packet1Login;
  5.  
  6. public interface IConnectionHandler
  7. {
  8.     /**
  9.      * Raised when a Client successfully connects it's socket to the Server.
  10.      * @param network The new NetworkManager associated with this connection.
  11.      */
  12.     public void OnConnect(NetworkManager network);
  13.    
  14.     /**
  15.      * Raised when you receive a Packet1Login.
  16.      * On the server, it is raised after the NetHandler is switched, and the
  17.      * initial user placement/info packets are sent.
  18.      *
  19.      * On the client, this is raised after the packet is parsed, and the user
  20.      * is sitting at the 'Downloading Terrain' screen.
  21.      *
  22.      * @param network The NetoworkManager associated with this connection.
  23.      * @param login The login packet
  24.      */
  25.     public void OnLogin(NetworkManager network, Packet1Login login);
  26.    
  27.     /**
  28.      * Raised whenever the socket is closed, can be caused by various reasons.
  29.      *
  30.      * @param network The NetworkManager associated with this connection.
  31.      * @param message The translated message to be displayed for this disconnection.
  32.      * @param args Any additional arguments that the code may of provided.
  33.      *   Sometimes this is further explanation, or a Throwable, in the case of errors.
  34.      */
  35.     public void OnDisconnect(NetworkManager network, String message, Object[] args);
  36. }
Advertisement
Add Comment
Please, Sign In to add comment