transmitAllPlayerConnects(connId); send(connId, createSettingsPacket()); send(connId, new Packet(Packet.COMMAND_PHASE_CHANGE, new Integer(game.phase))); send(connId, createEntitiesPacket());
sendCurrentInfo(connId);
    private void receiveClientName(Packet packet, int connId) {        final Connection conn = getPendingConnection(connId);        // this had better be from a pending connection        if (conn == null) {            System.out.println("server: got a client name from a non-pending connection");            return;        }        // right, switch the connection into the "active" bin        connectionsPending.removeElement(conn);        connections.addElement(conn);        connectionIds.put(new Integer(conn.getId()), conn);        // add and validate the player info        game.addPlayer(connId, new Player(connId, (String)packet.getObject(0)));        validatePlayerInfo(connId);        // send info that the player has connected        send(createPlayerConnectPacket(connId));        // tell them their local playerId        send(connId, new Packet(Packet.COMMAND_LOCAL_PN, new Integer(connId)));        // send current game info        transmitAllPlayerConnects(connId);        send(connId, createSettingsPacket());        send(connId, new Packet(Packet.COMMAND_PHASE_CHANGE, new Integer(game.phase)));        send(connId, createEntitiesPacket());        System.out.println("s: player " + connId                           + " (" + getPlayer(connId).getName() + ") connected from "                           + getClient(connId).getSocket().getInetAddress());        sendChatToAll("***Server", getPlayer(connId).getName() + " connected from "                           + getClient(connId).getSocket().getInetAddress());    }