void Database::init()
{
    qDebug() << "Initializing ...";
    if (isInitialized())
        return;

    qDebug() << "Not initialized";
    createTables();
    resetDefaults();
    setInitialized();
}
/**
 * @brief Elimina la Dcel contenuta nel manager.
 *
 * Aggiorna in automatico la canvasm e setta i pulsanti del manager in modalità "dcelNotLoaded".
 */
void DcelManager::cleanDcel() {
    setButtonsDcelNotLoaded();

    if (drawableDcel != nullptr){
        resetDefaults();
        drawableDcel->setVisible(false);
        mainWindow->updateGlCanvas();
        mainWindow->deleteObj(drawableDcel);
        delete drawableDcel;
        drawableDcel = nullptr;

    }
}
int TartiniSettingsDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: {
            QString _r = getPath((*reinterpret_cast< const QString(*)>(_a[1])));
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r;
        }
        break;
        case 1:
            changeTempFolder();
            break;
        case 2:
            fileNameChanged();
            break;
        case 3:
            getBackgroundColor();
            break;
        case 4:
            getShading1Color();
            break;
        case 5:
            getShading2Color();
            break;
        case 6:
            saveSetting((*reinterpret_cast< QObject*(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2])));
            break;
        case 7:
            saveSettings();
            break;
        case 8:
            checkAnalysisEnabled();
            break;
        case 9:
            onNoteRangeChoice((*reinterpret_cast< int(*)>(_a[1])));
            break;
        case 10:
            setUnknownsToDefault((*reinterpret_cast< QSettings*(*)>(_a[1])));
            break;
        case 11:
            resetDefaults();
            break;
        }
        _id -= 12;
    }
    return _id;
}
Esempio n. 4
0
IntegrationPreferences::IntegrationPreferences(KConfigDialog *parent, Qt::WindowFlags f)
  : QWidget(parent, f)
{
    ui.setupUi(this);

    //AutoPaste stuff
    ui.type->addItem(KIcon("list-add"), i18n("Include"), AutoPasteModel::Include);
    ui.type->addItem(KIcon("list-remove"), i18n("Exclude"), AutoPasteModel::Exclude);

    ui.patternSyntax->addItem(i18n("Escape sequences"), AutoPasteModel::Wildcard);
    ui.patternSyntax->addItem(i18n("Regular expression"), AutoPasteModel::RegExp);

    ui.add->setGuiItem(KStandardGuiItem::add());
    ui.remove->setGuiItem(KStandardGuiItem::remove());
    ui.increase->setIcon(KIcon("arrow-up"));
    ui.decrease->setIcon(KIcon("arrow-down"));

    m_model = new AutoPasteModel(this);
    m_model->load();
    ui.list->setModel(m_model);
    AutoPasteDelegate *delegate = new AutoPasteDelegate(ui.type->model(), ui.patternSyntax->model(), this);
    ui.list->setItemDelegate(delegate);

    QByteArray loadedState = QByteArray::fromBase64(Settings::autoPasteHeaderState().toAscii());
    if (Settings::autoPasteHeaderState().isEmpty()) {
        ui.list->resizeColumnToContents(AutoPasteModel::Type);
    } else if (!loadedState.isNull()) {
        ui.list->header()->restoreState(loadedState);
    }

    connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed()));
    connect(ui.list->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(slotUpdateButtons()));
    connect(ui.pattern, SIGNAL(textChanged(QString)), this, SLOT(slotUpdateButtons()));
    connect(ui.pattern, SIGNAL(returnPressed(QString)), this, SLOT(slotAddItem()));
    connect(ui.add, SIGNAL(clicked()), this, SLOT(slotAddItem()));
    connect(ui.remove, SIGNAL(clicked()), this, SLOT(slotRemoveItem()));
    connect(ui.increase, SIGNAL(clicked()), this, SLOT(slotIncreasePriority()));
    connect(ui.decrease, SIGNAL(clicked()), this, SLOT(slotDecreasePriority()));
    connect(parent, SIGNAL(rejected()), m_model, SLOT(load()));
    connect(parent, SIGNAL(applyClicked()), m_model, SLOT(save()));
    connect(parent, SIGNAL(okClicked()), m_model, SLOT(save()));
    connect(parent, SIGNAL(defaultClicked()), m_model, SLOT(resetDefaults()));

    slotUpdateButtons();
}
Esempio n. 5
0
InputHandler::InputHandler(void)
{
	resetDefaults();
}
Esempio n. 6
0
CameraHandler::CameraHandler(void) : activeCamera(THIRD_PERSON)
{
	resetDefaults();
}
Esempio n. 7
0
//keyboard method
void keyboard(unsigned char key, int x, int y)
{
    switch(key) {
        case 'w':
            polygonMode = WIREFRAME;
            break;
        case 'W':
            polygonMode = SHADED;
            break;
        case 'p':
            viewMode = PERSPECTIVE;
            setView(windowWidth, windowHeight);
            break;
        case 'o':
            if (viewPerson == THIRD)
                viewMode = ORTHOGRAPHIC;
            setView(windowWidth, windowHeight);
            break;
        case 'z':
            if (zoom >= 0.05 && viewPerson == THIRD) {
                zoom -= 0.01f;
            }
            setView(windowWidth, windowHeight);
            break;
        case 'Z':
            if (zoom < 1.0f && viewPerson == THIRD) {
                zoom += 0.01f;
            }
            setView(windowWidth, windowHeight);
            break;
        case 'f':
            if (r > 1.0f && viewPerson == THIRD)
                r -= 4.0f;
            break;
        case 'b':
            if (viewPerson == THIRD)
                r += 4.0f;
            break;
        case 'c':
            resetDefaults();
            break;
        case 27:
            exit(0);
            break;
        case 's':
            moving = true;
            break;
        case 'e':
            moving = false;
            break;
        case 'a':
            if (moving && speed < 1.0f) {
                speed += 0.1f;
            }
            break;
        case 'A':
            if (moving && speed > 0.1f) {
                speed -= 0.1f;
                if (speed < 0.1f) {
                    speed = 0.1f;
                }
            }
            break;
        case '1':
            viewPerson = FIRST;
            viewMode = PERSPECTIVE; //Orthographic first person doesn't really make sense.
            setView(windowWidth, windowHeight);
            break;
        case '3':
            viewPerson = THIRD;
            break;
        case 'l':
            if (lightingEnabled)
                lightingEnabled = false;
            else
                lightingEnabled = true;
        case 'h':
            highBeam = true;
            break;
        case 'H':
            highBeam = false;
            break;
        case '2':
            if (lightingEnabled) {
                
                if (circleLightMoving)
                    circleLightMoving = false;
                else
                    circleLightMoving = true;
            }
            break;
        default:
            break;
    }
    
    moveCamera();
    
    glutPostRedisplay(); /* this redraws the scene without
                          waiting for the display callback so that any changes appear 
                          instantly */
}
void
get_N_dispatch_outfit_event(int *team, int *s_type, int *lastplayercount)
{
    W_Event event;
    int     validshipletter = 0;
    static int resetting = 0;
    int     oldresetting;
    int     i;

    oldresetting = resetting;

    W_NextEvent(&event);
    switch ((int) event.type) {
    case W_EV_KEY:
	{
	    struct shiplist *shipscan;
	    validshipletter = 0;
	    shipscan = shiptypes;
	    while (shipscan) {
		if (shipscan->ship->s_letter == event.key) {
		    *s_type = shipscan->ship->s_type;
		    validshipletter = 1;
		    break;
		}
		shipscan = shipscan->next;
	    }
	}

	if (me->p_status == PTQUEUE) {
	    for (i = 0; i < WNUM; i++) {
		if (event.Window == messWin[i].window) {
		    messageWinEvent(&event);
		    break;
		}
	    }
	    if (i != WNUM)
		break;
	    if (event.Window == messagew ||
		event.Window == tstatw ||
		event.Window == warnw)
		smessage(event.key);
	}
	if (event.Window == motdWin) {
	    motdWinEvent(&event);
	    break;
	} else if (event.Window == playerw || event.Window == infow) {
	    /* allow 'i' 'I' and '^i' in playerw [BDyess] */
	    playerwEvent(&event);
	    break;
	} else if (event.Window == w || event.Window == mapw) {
	    switch (event.key) {
#ifdef Q_OUTFITTING
	    case 'q':
		*team = number_of_teams;
		me->p_status = PFREE;
		break;
#endif				/* Q_OUTFITTING */
	    case 'R':
		warning("Are you sure you want to reset your stats?");
		resetting = 1;
		break;
	    case 'y':
		if (resetting) {
		    sendResetStatsReq('Y');
		    warning("OK, your stats have been reset.");
		    resetting = 0;
		}
		break;
	    case 'n':
		if (resetting) {
		    warning("I didn't think so.");
		    resetting = 0;
		}
		break;

	    case 'f':		/* Scroll motd forward */
		if (currpage == NULL)
		    currpage = motddata;
		if (currpage == NULL || currpage->next == NULL)
		    break;
		currpage->next->prev = currpage;
		currpage = currpage->next;
		showMotd(w);
		resetting = 0;
		break;
	    case 'b':		/* Scroll motd backward */
		if (currpage == NULL || currpage->prev == NULL)
		    break;
		currpage = currpage->prev;
		showMotd(w);
		resetting = 0;
		break;
		/* ok, let's have some info windows available on the TQ */

	    default:		/* hmm, something that doesn't have to do
				   with the MOTD, maybe it's an info window
				   request */
		switch (doKeymap(&event)) {
		case 'U':	/* U = Rank list */
		    if (W_IsMapped(rankw)) {
			W_UnmapWindow(rankw);
		    } else {
			W_MapWindow(rankw);
		    }
		    break;
		case 'P':	/* P = Planet list */
		    if (W_IsMapped(planetw)) {
			W_UnmapWindow(planetw);
			W_UnmapWindow(planetw2);
		    } else {
			W_MapWindow(planetw);
			W_MapWindow(planetw2);
		    }
		    break;
		case 'h':	/* h = Map help window */
		    if (W_IsMapped(helpWin)) {
			W_UnmapWindow(helpWin);
		    } else {
			W_MapWindow(helpWin);
		    }
		    if (optionWin)
			optionredrawtarget(helpWin);
		    break;
		case 'O':	/* O = options Window */
		    if (optionWin != NULL && W_IsMapped(optionWin))
			optiondone();
		    else
			optionwindow();
		    break;
		case 'w':	/* w = map war stuff */
		    if (W_IsMapped(war))
			W_UnmapWindow(war);
		    else
			warwindow();
		    break;
		case '&':
		    if (defaultsFile) {
			char    buf[150];
			sprintf(buf, "Reading defaults from %s", defaultsFile);
			warning(buf);
			freeDefaults();
			defaultsFile = initDefaults(defaultsFile);
			resetDefaults();
		    } else {
			warning("No defaults file to read from!");
		    }
		}
		break;
	    }

	    break;		/* switch event type */
	}
	if (event.Window == qwin)
	    return;		/* normal keypresses can't make you quit */

	if (event.Window == optionWin) {
	    optionaction(&event);
	    return;
	}
	if (!validshipletter)
	    break;
	/*
	   it wasn't the main window, see if they hit the key in a team
	   window to choose their ship... falling through
	*/
    case W_EV_BUTTON:

	for (i = 0; i < number_of_teams; i++)
	    if (event.Window == teamWin[i]) {
		*team = i;
		break;
	    }
	if (event.Window == qwin) {
	    *team = number_of_teams;
	    me->p_status = PFREE;
	    break;
	}
	/* allow message scrollback [BDyess] */
	for (i = 0; i < WNUM; i++) {
	    if (event.Window == messWin[i].window) {
		messageWinEvent(&event);
		break;
	    }
	}
	/* allow bozo selection in playerw [BDyess] */
	if (event.Window == playerw) {
	    playerwEvent(&event);
	    break;
	} else if (event.Window == war)
	    waraction(&event);
	else if (event.Window == optionWin)
	    optionaction(&event);
	else if (event.Window == motdWin)
	    motdWinEvent(&event);
	else if (event.Window == w) {
	    W_Window tmp = motdWin;
	    motdWin = w;
	    motdWinEvent(&event);
	    motdWin = tmp;
	}
	if (*team != -1 && !teamRequest(*team, *s_type)) {
	    *team = -1;
	}
	break;
    case W_EV_EXPOSE:
	for (i = 0; i < number_of_teams; i++)
	    if (event.Window == teamWin[i]) {
		lastplayercount[i] = -1;	/* force update */
		redrawTeam(teamWin[i], i, &lastplayercount[i]);
		break;
	    }
	if (event.Window == qwin)
	    redrawQuit();
	else if (event.Window == w)
	    showMotd(w);
	else if (event.Window == mapw) {
		showValues(mapw);
	    redraw_death_messages();
	} else
	    /* let the normal expose handler figure out who to redraw */
	    dispatch_W_expose_event(&event);
	break;
    case W_EV_KILL_WINDOW:	/* WM_DESTROY_WINDOW support [BDyess] */
        if(event.Window == baseWin) exit(0);
	else W_UnmapWindow(event.Window);
	break;
    }

    if (oldresetting && resetting) {
	resetting = 0;
	warning("Resetting of stats cancelled");
    }
}
int
main(int argc, char **argv)
{
    int     team, s_type;
    char   *dpyname = NULL;
    int     usage = 0;
    int     err = 0;
    char   *name, *ptr, *cp;
    struct passwd *pwent;
    int     passive = 0;
    int     xpmopt = 1;
    int     useORopt = 0;
    int     useCookieOpt = 0;
    int     dontUseCookieOpt = 0;
/*    char *defaultsFile=NULL;*/

    pseudo[0] = defpasswd[0] = '\0';

    name = *argv++;
    argc--;
    if ((ptr = strrchr(name, '/')) != NULL)
	name = ptr + 1;
    while (*argv) {
	if (**argv != '-') {
	    serverName = *argv;	/* don't abort argument processing */
	    argv++;
	    argc--;
	} else {
	    ++*argv;

	    argc--;
	    ptr = *argv++;
	    while (*ptr) {
		switch (*ptr) {
		case 'C':	/* character name */
		    (void) strncpy(pseudo, *argv, sizeof(pseudo));
		    argv++;
		    argc--;
		    break;

		case 'P':	/* authorization password */
		    (void) strncpy(defpasswd, *argv, sizeof(defpasswd));
		    {
			int     i;
			for (i = 0; (*argv)[i]; i++)
			    (*argv)[i] = 0;
		    }
		    argv++;
		    argc--;
		    break;

		case 'u':
		    usage++;
		    break;
		case 's':
		    if (*argv) {
			xtrekPort = atoi(*argv);
			passive = 1;
			argv++;
			argc--;
		    }
		    break;
		case 'p':
		    if (*argv) {
			xtrekPort = atoi(*argv);
			argv++;
			argc--;
		    }
		    break;
		case 'd':
		    dpyname = *argv;
		    argc--;
		    argv++;
		    break;
		case 'm':
		    usemeta = 1;
		    break;
		case 'h':
		    serverName = *argv;
		    argc--;
		    argv++;
		    break;

		case 't':
		    title = *argv;
		    argc--;
		    argv++;
		    break;
		case 'r':
		    defaultsFile = *argv;
		    argv++;
		    argc--;
		    break;
#ifdef AUTHORIZE
		case 'o':
		    RSA_Client = -1;
		    break;
		case 'R':
		    RSA_Client = -2;
		    break;
#else
		case 'o':
		case 'R':
		    printf("This client does not have binary authorization.\n");
		    break;
#endif
		case 'e':
#ifdef AUTHORIZE
		    checkExpire(1);
#else
		    printf("This client does not RSA verify and will not expire.\n");
#endif
		    exit(0);
		    break;
		case 'f':	/* list ftp sites */
		    fprintf(stderr, "\n\
The newest version of the Paradise client can be found at:\n\
      ftp.netrek.org  in /pub/netrek/paradise/bin/\n");
		    exit(0);
		case 'G':
		    if (*argv) {
			ghoststart++;
			ghost_pno = atoi(*argv);
			printf("Emergency restart being attempted...\n");
			argv++;
			argc--;
		    }
		    break;
		case '2':	/* force paradise */
		    paradise = 1;
		    break;
		case 'F':	/* File playback */
		    if (*argv) {
			playFile = strdup(*argv);
			playback = 1;
			argv++;
			argc--;
		    }
		    break;
		case 'x':
		    xpmopt = 0;
		    break;
		case 'k':		/* cookie mode [BDyess] */
		    useCookieOpt = 1;
		    break;
		case 'K':		/* no-cookies :( [BDyess] */
		    dontUseCookieOpt = 1;
		    break;
		case 'v':
		    verbose_image_loading = 1;
		    break;
		case 'O':		/* turn on GXor image drawing [BDyess]*/
		    useORopt = 1;	
		    break;
                case 'c': 	/* dump .paradiserc defaults [BDyess] */
		    dump_defaults = 1;
		    break;
		default:
		    fprintf(stderr, "%s: unknown option '%c'\n", name, *ptr);
		    err++;
		    break;
		}
		ptr++;
	    }
	}
    }

    inittrigtables();

    initStars();		/* moved from redraw.c at KAO\'s suggestion */

    if (usage || err) {
	printUsage(name);
#ifdef AUTHORIZE
	checkExpire(1);
#endif
	exit(0);
	/* exit(err); Exits from checkExpire */
    }
    defaultsFile = initDefaults(defaultsFile);

    if(xpmopt) xpm = 1;
    else xpm = booleanDefault("xpm",xpm);
    if(xpm) printf("XPM mode enabled.\n");
    /* command line option overrides .paradiserc value [BDyess] */
    if(useORopt) useOR = 1;
    else useOR = booleanDefault("useOR",useOR);
    if(useOR) printf("OR mode enabled.\n");
    if(useOR || !xpm) cookie = 0;	/* default no-cookies unless in XPM
    					   mode w/out OR [BDyess] */
					/* note: need a milk mode :) */
    if(useCookieOpt) cookie = 1;
    else if(dontUseCookieOpt) cookie = 0;
    else cookie = booleanDefault("cookie",cookie);
    if(cookie) printf("Cookie mode enabled.\n");

#ifdef AUTHORIZE
    if (RSA_Client != -1)
	checkExpire(0);
#endif

    /* compatability */
    if (argc > 0)
	serverName = argv[0];

    srandom(getpid() + time((long *) 0));

    if(playback || booleanDefault("playback",0)) {
        defNickName = "playback";
	usemeta=0;
        serverName = "playback";
    } else
    {
        if (serverName) {
	    char    temp[80], *s;
	    sprintf(temp, "server.%s", serverName);
	    if ((s = stringDefault(temp,NULL))) {
		printf("Using nickname \"%s\" for server %s\n", serverName, s);
		defNickName = serverName;
		serverName = s;
		defFlavor = stringDefault("flavor",NULL);
	    }
	}
	if (!serverName) {
	    serverName = stringDefault("server",NULL);
        }
	if (!serverName && !passive) {
	    serverName = DEFAULT_SERVER;
	    usemeta = 1;		/* no server specified, show the menu */
	}
	if (passive)
	    serverName = "passive";	/* newwin gets a wrong title otherwise */

	if (xtrekPort < 0)
	    xtrekPort = intDefault("port", -1);
	if (xtrekPort < 0)
	    xtrekPort = DEFAULT_PORT;
    } /* playback */
    build_default_configuration();

    metaserverAddress = stringDefault("metaserver",
				      "metaserver.netrek.org");
    if (usemeta)
	openmeta();

    W_Initialize(dpyname);

    metaFork = booleanDefault("metaFork", metaFork);
    /* do the metawindow thang */
    if (usemeta) {
	metawindow();
	metainput();
	if (metaFork)
	    W_Initialize(dpyname);
	newwin(dpyname, name);
    } else

	/* this creates the necessary x windows for the game */
	newwin(dpyname, name);

    /* open memory...? */
    openmem();
    if (!startPlayback())
    {
	if (!passive) {
	    serverName = callServer(xtrekPort, serverName);
	} else {
	    connectToServer(xtrekPort);
	}
    }
    sendFeature("FEATURE_PACKETS", 'S', 1, 0, 0);

    timeStart = time(NULL);
    findslot();

    /* sets all the settings from defaults file (.xtrekrc probably) */
    resetDefaults();

#ifdef UNIX_SOUND
    init_sound();
    play_sound(SND_PARADISE);
#endif

    mapAll();
/*    signal(SIGINT, SIG_IGN);*/
    signal(SIGCHLD, reaper);

    /* Get login name */
    if ((pwent = getpwuid(getuid())) != NULL)
	(void) strncpy(login, pwent->pw_name, sizeof(login));
    else
	(void) strncpy(login, "Bozo", sizeof(login));
    login[sizeof(login) - 1] = '\0';

    if (pseudo[0] == '\0') {
	char *freeme;
	strncpy(pseudo, freeme = stringDefault("name",login), sizeof(pseudo));
	free(freeme);
    }
    pseudo[sizeof(pseudo) - 1] = '\0';

    if (defpasswd[0] == '\0') {
	char buf[100];  /* added password by character name -JR */
	sprintf(buf,"password.%s",pseudo);
	if((cp = stringDefault(buf,NULL)) || (cp = stringDefault("password",NULL)))
	    (void) strncpy(defpasswd, cp, sizeof(defpasswd));
    }
    defpasswd[sizeof(defpasswd) - 1] = '\0';

    /*
       sendLoginReq("Gray Lensman", "hh", "sfd", 0); loginAccept = -1; while
       (loginAccept == -1) { socketPause(1,0); readFromServer(); }
    */
    getname(pseudo, defpasswd);
    loggedIn = 1;

    /*
       Set p_hostile to hostile, so if keeppeace is on, the guy starts off
       hating everyone (like a good fighter should)
    */
    me->p_hostile = (1 << number_of_teams) - 1;

    redrawTstats();

    me->p_planets = 0;
    me->p_genoplanets = 0;
    me->p_armsbomb = 0;
    me->p_genoarmsbomb = 0;
    /* Set up a reasonable default */
    me->p_whydead = KNOREASON;
    me->p_teami = -1;
    s_type = defaultShip(CRUISER);	/* from rlb7h 11/15/91 TC */

    if (booleanDefault("netStats", 1))
	startPing();		/* tell the server that we support pings */

    /*
       hack to make galaxy class ships work.  This could be more elegant, but
       the configuration code would have to be modified quite a bit, since
       the client doesn't know if it's on a paradise server until after it
       connects, and it needs the configuration info before it connects.
    */
    init_galaxy_class();

    initkeymap(-1);		/* needs to have ship types initialized -JR */

    setjmp(env);		/* Reentry point of game */

    if (ghoststart) {
	int     i;

	ghoststart = 0;

	for (i = -1; i < 5; i++)
	    if (teaminfo[i].letter == me->p_mapchars[0])
		break;

	me->p_teami = i;

	if (me->p_damage > me->p_ship->s_maxdamage) {
	    me->p_status = POUTFIT;
	} else
	    me->p_status = PALIVE;
    } else
	me->p_status = POUTFIT;

    while (1) {
	switch (me->p_status) {
	case POUTFIT:
	case PTQUEUE:
	    /* give the player the motd and find out which team he wants */
	    new_entrywindow(&team, &s_type);
	    allowPlayerlist = 1;
	    if (W_IsMapped(playerw))
		playerlist();

	    if (!playback)
		if (team == -1) {
		    W_DestroyWindow(w);
		    sendByeReq();
		    sleep(1);
		    printf("OK, bye!\n");
		    EXIT(0);
		}
	    sendVersion();
	    myship = getship(myship->s_type);

	    currentship = myship->s_type;

	    /*
	       sendOptionsPacket(); this would totally blast any flags you
	       had on the server
	    */

	    redrawall = 1;
	    enter();
	    calibrate_stats();
	    W_ClearWindow(w);
	    /*
	       for (i = 0; i < NSIG; i++) { signal(i, SIG_IGN); }
	    */

	    me->p_status = PALIVE;	/* Put player in game */

#ifdef UNIX_SOUND
            kill_sound ();
#endif
            
	    hockeyInit();

	    if (showStats)	/* Default showstats are on. */
		W_MapWindow(statwin);
	    if (showNewStats)	/* default showNewStats are off. [BDyess] */
	        W_MapWindow(newstatwin);

	    if (tryUdp && commMode != COMM_UDP) {
		sendUdpReq(COMM_UDP);
	    }

	    if (tryShort) {
		sendShortReq(SPK_VON);
		tryShort = 0;	/* only try it once */
	    }
	    /* Send request for a full update */
	    if (askforUpdate) {
		if(recv_short)
		    sendShortReq(SPK_SALL);
		else
		    sendUdpReq(COMM_UPDATE);
	    }
	    sendUpdatePacket(1000000 / updateSpeed);

	    W_Deiconify(baseWin);

	    break;
	case PALIVE:
	case PEXPLODE:
	case PDEAD:
	case POBSERVE:

	    /* Get input until the player quits or dies */
	    input();
	    W_ClearWindow(mapw);
	    break;
	default:
	    printf("client has p_status=%d.  how strange\n", me->p_status);
	    me->p_status = POUTFIT;
	}
    }

    /* NOTREACHED */
}
Esempio n. 10
0
Options::Options()
{
    resetDefaults();
}