001 package cpw.mods.fml.common.network; 002 003 import net.minecraft.server.MinecraftServer; 004 import net.minecraft.src.NetHandler; 005 import net.minecraft.src.NetLoginHandler; 006 import net.minecraft.src.NetworkManager; 007 import net.minecraft.src.Packet1Login; 008 009 public interface IConnectionHandler 010 { 011 /** 012 * Called when a player logs into the server 013 * SERVER SIDE 014 * 015 * @param player 016 * @param netHandler 017 * @param manager 018 */ 019 void playerLoggedIn(Player player, NetHandler netHandler, NetworkManager manager); 020 021 /** 022 * If you don't want the connection to continue, return a non-empty string here 023 * If you do, you can do other stuff here- note no FML negotiation has occured yet 024 * though the client is verified as having FML installed 025 * 026 * SERVER SIDE 027 * 028 * @param netHandler 029 * @param manager 030 * @return 031 */ 032 String connectionReceived(NetLoginHandler netHandler, NetworkManager manager); 033 034 /** 035 * Fired when a remote connection is opened 036 * CLIENT SIDE 037 * 038 * @param netClientHandler 039 * @param server 040 * @param port 041 */ 042 void connectionOpened(NetHandler netClientHandler, String server, int port, NetworkManager manager); 043 /** 044 * 045 * Fired when a local connection is opened 046 * 047 * CLIENT SIDE 048 * 049 * @param netClientHandler 050 * @param server 051 */ 052 void connectionOpened(NetHandler netClientHandler, MinecraftServer server, NetworkManager manager); 053 054 /** 055 * Fired when a connection closes 056 * 057 * ALL SIDES 058 * 059 * @param manager 060 */ 061 void connectionClosed(NetworkManager manager); 062 063 /** 064 * Fired when the client established the connection to the server 065 * 066 * CLIENT SIDE 067 * @param clientHandler 068 * @param manager 069 * @param login 070 */ 071 void clientLoggedIn(NetHandler clientHandler, NetworkManager manager, Packet1Login login); 072 073 }