Example #1
0
// Include library
require_once 'Debug.php';
require_once 'Grf.php';
require_once 'Bmp.php';
require_once 'Client.php';
$CONFIGS = (require_once 'configs.php');
// Apply configs
if ($CONFIGS['DEBUG']) {
    // Do not show debug if the request is from roBrowser
    if (empty($_SERVER['HTTP_X_APPLICATION']) || $_SERVER['HTTP_X_APPLICATION'] !== 'roBrowser') {
        Debug::enable();
    }
}
Client::$path = '';
Client::$data_ini = $CONFIGS['CLIENT_RESPATH'] . $CONFIGS['CLIENT_DATAINI'];
Client::$AutoExtract = $CONFIGS['CLIENT_AUTOEXTRACT'];
// Initialize client
ini_set('memory_limit', '1000M');
Client::init();
/**
 * SEARCH ACCESS
 * This features is only used in map/rsm/str/grf viewer
 * If you are not using them, you can comment this block
 */
if (isset($_POST['filter']) && is_string($_POST['filter'])) {
    header('Status: 200 OK', true, 200);
    header('Content-type: text/plain');
    if (!$CONFIGS['CLIENT_ENABLESEARCH']) {
        exit;
    }
    $filter = ini_get('magic_quotes_gpc') ? stripslashes($_POST['filter']) : $_POST['filter'];
Example #2
0
Controller::$hostname = "127.0.0.1";
// Mysql Host
Controller::$database = "ragnarok";
// Database Name
Controller::$username = "******";
// Database Username
Controller::$password = "******";
// Database Pass
/// -----------------------------------------------------------------
// No write access to directory ? disable cache.
if (Cache::$time && !is_writable(Cache::$path)) {
    Cache::$time = 0;
    Debug::write('Disable Cache system, don\'t have write acess to "' . Cache::$path . '".', 'error');
}
if (Client::$AutoExtract && !is_writable(Client::$path . 'data/')) {
    Client::$AutoExtract = false;
    Debug::write('Disable GRF auto-extract mode, don\'t have write access to "' . Client::$path . 'data/".', 'error');
}
// Don't cache images when debug mode is on
if (Debug::isEnable()) {
    Cache::$time = 0;
}
// Url Rewriting
$routes = array();
$routes['/character/(.*)/(\\d+)/([0-7])'] = 'Character';
$routes['/character/(.*)'] = 'Character';
$routes['/characterhead/(.*)'] = 'CharacterHead';
$routes['/avatar/(.*)'] = 'Avatar';
$routes['/signature/(.*)'] = 'Signature';
$routes['/monster/(\\d+)'] = 'Monster';
$routes['/generate/body=(F|M)-(\\d+)-(\\d+)/hair=(\\d+)-(\\d+)-(\\d)/hats=(\\d+)-(\\d+)-(\\d+)/equip=(\\d+)-(\\d+)-(\\d+)/option=(\\d+)/actdir=([0-7])-(\\d+)-(\\d+)'] = 'Generator';