int main() { try { Glinde::Engine engine; engine.run(timerCreate(30)); //TODO: // check argv // If a world is going to be loaded // Load that world and move input control to its menu // Else // Move input to console. // Console can always be accessed through key X // Esc returns to previous input mode } catch(const Glinde::ErrorMessage& msg) { fprintf(stderr,"%s\n",msg.messageGet()); return -1; } return 0; }
int startRegistrarServerHunt() { serverHuntCnt = 0; enrpAnnounceTimer = timerCreate(enrpAnnounceTimeout, NULL, "enrp announce cycle timer"); if (useEnrpAnnouncements) { logDebug("using announcements to find mentor peer"); sendEnrpPresence(0, 1, 0); serverHuntTimer = timerCreate(serverHuntTimeout, NULL, "server hunt timer"); timerStart(serverHuntTimer, TIMEOUT_SERVER_HUNT); return 1; } logDebug("skipped server hunt, no multicast available"); registrarState = SERVICING; timerStart(enrpAnnounceTimer, PEER_HEARTBEAT_CYCLE); return 1; }
int main(int argc, char **argv) { Timer *timer; CLOCK period = { 1, 0 }; counter = 10; if (1 < argc) counter = strtol(argv[1], NULL, 10); if ((timer = timerCreate(task, NULL, NULL, &period, 0)) == NULL) return 1; sleep(6); timerFree(timer); return 0; }