// Game libraries // // proxycheck.php // // This is the main script for the proxy detector. // // Copyright(C) 2004-2008, DeepClone Development //----------------------------------------------------------------------- /* Checks for fork() */ if (!(function_exists('pcntl_fork') || $__runFromAdmin)) { die("This script may not be called from the web server.\n"); } /* Load the required libraries */ $__loader = array('log', 'classloader', 'version', 'game', 'tick', 'config', 'db_connection', 'db_accessor', 'db_copy', 'pcheck_thread', 'pcheck_manager', 'pcheck'); require_once "loader.inc"; l::setSyslogPrefix("lwProxy"); if (count($argv) > 1) { /* Checks for command line arguments */ if (count($argv) > 2 && ($argv[1] == '-c' || $argv[1] == '-f')) { $addresses = $argv; array_shift($addresses); array_shift($addresses); print "Running manual check, please wait ...\n"; try { $results = pcheck::check($addresses, $argv[1] == '-f'); } catch (Exception $e) { print "{$argv[0]}: " . $e->getMessage() . "\n"; exit(1); } foreach ($results as $address => $proxy) { print "\t{$address} - ";
$game = config::getGame($gName); if (is_null($game)) { throw new Exception("Game '{$gName}' not found"); } l::notice("administration script executing tick {$gName}::{$tName}"); $game->getDBAccess(); $game->runTick($tName, true); l::notice("tick {$gName}::{$tName} executed"); dbClose(); } catch (Exception $e) { $argh = $e->getMessage(); } chdir($oldDir); return; } else { l::setSyslogPrefix("lwTicks"); if (count($argv) > 1) { /* Checks for command line arguments */ if ($argv[1] == "-r" && count($argv) == 4) { $game = $argv[2]; $tick = $argv[3]; dbConnect(); $game = config::getGame($argv[2]); if (is_null($game)) { die("Error: game {$argv[2]} not found"); } l::notice("manually executing {$argv[2]}::{$argv[3]}"); $game->getDBAccess(); $game->runTick($argv[3], true); l::notice("{$argv[2]}::{$argv[3]} executed"); dbClose();