protected void handlePacketReceived(PacketReceivedMessage msg) {
                if (!(msg.source instanceof ServerClientConnection)) return;
                ServerClientConnection connection = (ServerClientConnection)msg.source;
                if (connections.containsValue(connection)) {
                        plugin.getServer().getPluginManager().callEvent(new ServerReceivePacketEvent(connection, msg.packet));
                } else if (handshakePending.contains(connection)) {
                        if (!(msg.packet instanceof HandshakePacket)) {
                                handshakePending.remove(connection);
                                connection.shutdown();
                        }
                        HandshakePacket packet = (HandshakePacket)msg.packet;
                        if (packet.protocolVersion != WinLinkPlugin.PROTOCOL_VERSION) {
                                handshakePending.remove(connection);
                                connection.shutdown();
                        }
                        if (connections.containsKey(packet.name)) {
                                handshakePending.remove(connection);
                                connection.shutdown();
                        }
                        handshakePending.remove(connection);
                        connection.setName(packet.name);
                        connections.put(packet.name, connection);
                        connection.setStatus("Connected");
                        plugin.getLogger().info("Server: accepted `" + connection.getName() + "' from " + connection.getRemoteHostname() + ":" + connection.getRemotePort());
                        plugin.getServer().getPluginManager().callEvent(new ServerConnectEvent(connection));
                        // Connect corresponding client, if any
                        Client client = plugin.getClientConnection(connection.getName());
                        if (client != null) client.reconnect(0);
                } else {
                        return;
                }
        }