int init_subsystems(void) { init_hud(); init_flares(); init_starfield(); init_fire(); init_particles(); init_chunks(); init_video_new_game(); reset_update(); reset_plugins(); init_asteroids(); return (0); }
void mud_update(void) { static long creature_time = 0; static long object_time = 0; static long reset_time = 0; static long mysql_time = 0; static long mudtime_time = 0; static long backup_time = 0; static long heal_time = 0; static long socket_time = 0; if( ++socket_time % (LOOPS_PER_SECOND) == 0 ) socket_update(); if( ++heal_time % (LOOPS_PER_SECOND*5) == 0 ) heal_update(); if( ++creature_time % (LOOPS_PER_SECOND*60) == 0 ) creature_update(); if( ++object_time % (LOOPS_PER_SECOND) == 0 ) object_update(); if( ++reset_time % (LOOPS_PER_SECOND) == 0 ) reset_update(); if( ++mysql_time % (LOOPS_PER_SECOND*60*60) == 0 ) mudlog("Pinging mysql server == %s", mysql_ping(mysql) == 0 ? "Connected" : "Disconnected"); if( ++mudtime_time % (LOOPS_PER_SECOND) == 0 ) { if(mudtime_time % (LOOPS_PER_SECOND*60*15) == 0) // 15 minutes fwrite_time(); mudtime.age++; } if( ++backup_time % (LOOPS_PER_SECOND*60*60) == 0) // check at startup and every hour backup_update(); }