@Override
    public void QuitNetGame() throws IOException {
        int i, j;

        if (eval(debugfile))
            try {
                debugfile.close();
            } catch (IOException e) {
                e.printStackTrace();
            }

        if (!netgame || !usergame || consoleplayer == -1 || demoplayback)
            return;

        // send a bunch of packets for security
        netbuffer.player = (byte) consoleplayer;
        netbuffer.numtics = 0;
        for (i = 0; i < 4; i++) {
            for (j = 1; j < doomcom.numnodes; j++)
                if (nodeingame[j])
                    HSendPacket(j, NCMD_EXIT);
            I.WaitVBL(1);
        }
    }