Exemple #1
0
 public static function cleanup($message = 'Clean shutdown!')
 {
     GWF_CachedCounter::persist();
     if (NULL !== Dog_Init::getStartupTime()) {
         GWF_Counter::increaseCount('dog_uptime', Dog_Init::getUptime());
     }
     if (self::$CLEANED === false) {
         self::$CLEANED = true;
         foreach (Dog::getServers() as $server) {
             $server instanceof Dog_Server;
             if ($server->isConnected()) {
                 $server->disconnect($message);
             }
         }
     }
     die(0);
 }
Exemple #2
0
 /**
  * commits the session if allowed
  * @return NULL
  */
 public function __destruct()
 {
     # Commit Session
     if (!self::getConfig('no_session')) {
         $this->onSessionCommit(self::getConfig('store_last_url'));
     }
     if (self::getConfig('load_module') && self::$MODULE->isEnabled()) {
         $db = gdo_db();
         GWF_CachedCounter::persist();
         $db->transactionEnd();
     }
     # Flush logfiles
     if (true === self::getConfig('do_logging')) {
         GWF_Log::flush();
     }
 }
Exemple #3
0
 public static function init()
 {
     Dog_Log::debug(__METHOD__);
     static $inited = false;
     if ($inited === false) {
         $inited = true;
         Shadowlang::onLoadLanguage();
         Shadowrap::init();
         self::$sr_timestamp = GWF_CachedCounter::getCount('SR4_TIME');
         $path = self::getShadowDir();
         self::initCore($path);
         self::initCmds($path);
         Shadowcmd::init();
         self::initItems($path);
         // 			self::initQuests($path);
         self::initCityBases($path);
         self::initSpells($path);
         self::initCityQuests($path);
         self::initCityNPCs($path);
         self::initCityLocations($path);
         // 			self::initCities($path);
         self::initCityAfter();
         SR_Player::init();
         // 			require_once DOG_PATH.'Lamb_IRCFrom.php';
         // 			require_once DOG_PATH.'Lamb_IRCTo.php';
         if (defined('SL4_REALS')) {
             self::initRealNPCs();
         }
         Shadowcleanup::cleanup();
     }
 }