@Override
    public void onCommand(Network src, Command com) throws IOException {
        switch (com.getType()) {
        case HANDSHAKE:
            register(src, (Handshake) com);
            break;
        case MESSAGE:
            broadcast(com);
            break;
        case PRIVATEMESSAGE:
            PrivateMessage pm = (PrivateMessage) com;
            Network recip = clients.get(pm.tar);
            recip.send(pm);
            break;
        case NETWORKSHUTDOWN:
            unregister(((NetworkShutdown) com).token);
            break;
        case LISTUSERS:
            src.send(new Message("USERS", getUserList()));
            break;
        default:
            throw new AssertionError("Unknown command recieved by server: " + com.getType().name());
        }
    }