001    package cpw.mods.fml.common.network;
002    
003    import net.minecraft.network.INetworkManager;
004    import net.minecraft.network.NetLoginHandler;
005    import net.minecraft.network.packet.NetHandler;
006    import net.minecraft.network.packet.Packet1Login;
007    import net.minecraft.server.MinecraftServer;
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, INetworkManager 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         */
031        String connectionReceived(NetLoginHandler netHandler, INetworkManager manager);
032    
033        /**
034         * Fired when a remote connection is opened
035         * CLIENT SIDE
036         *
037         * @param netClientHandler
038         * @param server
039         * @param port
040         */
041        void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager);
042        /**
043         *
044         * Fired when a local connection is opened
045         *
046         * CLIENT SIDE
047         *
048         * @param netClientHandler
049         * @param server
050         */
051        void connectionOpened(NetHandler netClientHandler, MinecraftServer server, INetworkManager manager);
052    
053        /**
054         * Fired when a connection closes
055         *
056         * ALL SIDES
057         *
058         * @param manager
059         */
060        void connectionClosed(INetworkManager manager);
061    
062        /**
063         * Fired when the client established the connection to the server
064         *
065         * CLIENT SIDE
066         * @param clientHandler
067         * @param manager
068         * @param login
069         */
070        void clientLoggedIn(NetHandler clientHandler, INetworkManager manager, Packet1Login login);
071    
072    }