• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Windows error installing site

JonatasLucas

New Member
Joined
Jun 12, 2013
Messages
116
Reaction score
3
Error occured!
Error ID: #C-5
More info: ERROR: #C-5 : Class::ConfigPHP - Key passwordType doesn't exist.

File: C:\xampp\htdocs\Radbr2\classes/configphp.php Line: 96
File: C:\xampp\htdocs\Radbr2\system/load.database.php Line: 38
File: C:\xampp\htdocs\Radbr2/index.php Line: 21
 
post those lines pls

Code:
File: C:\xampp\htdocs\Radbr2\classes/configphp.php Line: 96
File: C:\xampp\htdocs\Radbr2\system/load.database.php Line: 38
File: C:\xampp\htdocs\Radbr2/index.php Line: 21
 
configphp.php
Code:
<?php
if(!defined('INITIALIZED'))
    exit;

class ConfigPHP extends Errors
{
    private $config;
    private $loadedFromPath = '';

    public function __construct($path = false)
    {
        if($path)
            $this->loadFromFile($path);
    }

    public function loadFromFile($path)
    {
        if(Website::fileExists($path))
        {
            $content = Website::getFileContents($path);
            $this->loadedFromPath = $path;
            $lines = explode("\n", $content);
            unset($lines[0]); // remove <?php
            unset($lines[count($lines)]); // remove ? >
            $this->loadFromString(implode("\n", $lines));
        }
        else
            WebsiteErrors::addError('#C-4', 'ERROR: <b>#C-4</b> : Class::ConfigPHP - PHP config file doesn\'t exist. Path: <b>' . $path . '</b>');
    }

    public function fileExists($path)
    {
        return Website::fileExists($path);
    }

    public function loadFromString($string)
    {
        $ret = @eval('$_web_config = array();' . chr(0x0A) . $string . chr(0x0A) . '');
        if($ret === false)
        {
            $error = error_get_last();
            new Error_Critic('',  ' - cannot load PHP config from string', array(
            new Error('MESSAGE', $error['message']),
            new Error('FILE', $error['file']),
            new Error('LINE', $error['line']),
            new Error('FILE PATH', $this->loadedFromPath)
            ));
        }
        $this->config = $_web_config;
        unset($_web_config);
    }

    private function parsePhpVariableToText($value)
    {
        if(is_bool($value))
            return ($value) ? 'true' : 'false';
        elseif(is_numeric($value))
            return $value;
        else
            return '"' . str_replace('"', '\"' , $value) . '"';
    }

    public function arrayToPhpString(array $a, $d)
    {
        $s = '';
        if(is_array($a) && count($a) > 0)
            foreach($a as $k => $v)
            {
                if(is_array($v))
                    $s .= self::arrayToPhpString($v, $d . '["' . $k . '"]');
                else
                    $s .= $d . '["' . $k . '"] = ' . self::parsePhpVariableToText($v) . ';' . chr(0x0A);
            }
        return $s;
    }

    public function getConfigAsString()
    {
        return self::arrayToPhpString($this->config, '$_web_config');
    }

    public function saveToFile($path = false)
    {
        if($path)
            $savePath = $path;
        else
            $savePath = $this->loadedFromPath;
        Website::putFileContents($savePath, '<?php' . chr(0x0A) . $this->getConfigAsString() . '?>');
    }

    public function getValue($key)
    {
        if(isset($this->config[ $key ]))
            return $this->config[ $key ];
        else
            new Error_Critic('#C-5', 'ERROR: <b>#C-5</b> : Class::ConfigPHP - Key <b>' . $key . '</b> doesn\'t exist.');
    }

    public function setValue($key, $value)
    {
        $this->config[ $key ] = $value;
    }

    public function removeKey($key)
    {
        if(isset($this->config[ $key ]))
            unset($this->config[ $key ]);
    }

    public function isSetKey($key)
    {
        return isset($this->config[ $key ]);
    }

    public function getConfig()
    {
        return $this->config;
    }

    public function setConfig($value)
    {
        $this->config = $value;
    }
}
 
database.php

Code:
<?php
if(!defined('INITIALIZED'))
    exit;

if(Website::getServerConfig()->isSetKey('mysqlHost'))
{
    define('SERVERCONFIG_SQL_HOST', 'mysqlHost');
    define('SERVERCONFIG_SQL_PORT', 'mysqlPort');
    define('SERVERCONFIG_SQL_USER', 'mysqlUser');
    define('SERVERCONFIG_SQL_PASS', 'mysqlPass');
    define('SERVERCONFIG_SQL_DATABASE', 'mysqlDatabase');
    define('SERVERCONFIG_SQLITE_FILE', 'sqlFile');
}
else
    new Error_Critic('#E-3', 'There is no key <b>mysqlHost</b> in server config', array(new Error('INFO', 'use server config cache: <b>' . (Website::getWebsiteConfig()->getValue('useServerConfigCache') ? 'true' : 'false') . '</b>')));
Website::setDatabaseDriver(Database::DB_MYSQL);
if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_HOST))
    Website::getDBHandle()->setDatabaseHost(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_HOST));
else
    new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_HOST . '</b> in server config file.');
if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_PORT))
    Website::getDBHandle()->setDatabasePort(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_PORT));
else
    new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_PORT . '</b> in server config file.');
if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_DATABASE))
    Website::getDBHandle()->setDatabaseName(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_DATABASE));
else
    new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_DATABASE . '</b> in server config file.');
if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_USER))
    Website::getDBHandle()->setDatabaseUsername(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_USER));
else
    new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_USER . '</b> in server config file.');
if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_PASS))
    Website::getDBHandle()->setDatabasePassword(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_PASS));
else
    new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_PASS . '</b> in server config file.');

Website::setPasswordsEncryption(Website::getServerConfig()->getValue('passwordType'));
$SQL = Website::getDBHandle();
 
index.php

Code:
<?php
// comment to show E_NOTICE [undefinied variable etc.], comment if you want make script and see all errors
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE);

// true = show sent queries and SQL queries status/status code/error message
define('DEBUG_DATABASE', false);

define('INITIALIZED', true);

// if not defined before, set 'false' to load all normal
if(!defined('ONLY_PAGE'))
    define('ONLY_PAGE', false);
   
// check if site is disabled/requires installation
include_once('./system/load.loadCheck.php');

// fix user data, load config, enable class auto loader
include_once('./system/load.init.php');

// DATABASE
include_once('./system/load.database.php');
if(DEBUG_DATABASE)
    Website::getDBHandle()->setPrintQueries(true);
// DATABASE END

// LOGIN
if(!ONLY_PAGE)
    include_once('./system/load.login.php');
// LOGIN END

// COMPAT
// some parts in that file can be blocked because of ONLY_PAGE constant
include_once('./system/load.compat.php');
// COMPAT END

// LOAD PAGE
include_once('./system/load.page.php');
// LOAD PAGE END

// LAYOUT
// with ONLY_PAGE we return only page text, not layout
if(!ONLY_PAGE)
    include_once('./system/load.layout.php');
else
    echo $main_content;
// LAYOUT END
 
Code:
-- Combat settings
-- NOTE: valid values for worldType are: "pvp", "no-pvp" and "pvp-enforced"
worldType = "pvp"
hotkeyAimbotEnabled = "yes"
protectionLevel = 1
killsToRedSkull = 3
killsToBlackSkull = 6
pzLocked = 60000
removeChargesFromRunes = "yes"
timeToDecreaseFrags = 24 * 60 * 60 * 1000
whiteSkullTime = 15 * 60 * 1000
stairJumpExhaustion = 2000
experienceByKillingPlayers = "no"
expFromPlayersLevelRange = 75
noDamageToSameLookfeet = "no"

-- Connection Config
-- NOTE: maxPlayers set to 0 means no limit
ip = "127.0.0.1"
bindOnlyGlobalAddress = "no"
loginProtocolPort = 7171
gameProtocolPort = 7172
statusProtocolPort = 7171
maxPlayers = 0
motd = "Welcome to The Forgotten Server!"
onePlayerOnlinePerAccount = "yes"
allowClones = "no"
serverName = "Forgotten"
statusTimeout = 5000
replaceKickOnLogin = "yes"
maxPacketsPerSecond = 25

-- Deaths
-- NOTE: Leave deathLosePercent as -1 if you want to use the default
-- death penalty formula. For the old formula, set it to 10. For
-- no skill/experience loss, set it to 0.
deathLosePercent = -1

-- Houses
-- NOTE: set housePriceEachSQM to -1 to disable the ingame buy house functionality
housePriceEachSQM = 1000
houseRentPeriod = "never"

-- Item Usage
timeBetweenActions = 200
timeBetweenExActions = 1000

-- Map
-- NOTE: set mapName WITHOUT .otbm at the end
mapName = "forgotten"
mapAuthor = "Komic"

-- Market
marketOfferDuration = 30 * 24 * 60 * 60
premiumToCreateMarketOffer = "yes"
checkExpiredMarketOffersEachMinutes = 60
maxMarketOffersAtATimePerPlayer = 100

-- MySQL
mysqlHost = "127.0.0.1"
mysqlUser = "root"
mysqlPass = "minhasenha"
mysqlDatabase = "radbr"
mysqlPort = 3306
mysqlSock = ""

-- Misc.
allowChangeOutfit = "yes"
freePremium = "no"
kickIdlePlayerAfterMinutes = 15
maxMessageBuffer = 4
emoteSpells = "no"
classicEquipmentSlots = "no"
playersCanChangePvPFrames = "yes"

-- Rates
-- NOTE: rateExp is not used if you have enabled stages in data/XML/stages.xml
rateExp = 5
rateSkill = 3
rateLoot = 2
rateMagic = 3
rateSpawn = 1

-- Monsters
deSpawnRange = 2
deSpawnRadius = 50

-- Stamina
staminaSystem = "yes"

-- Scripts
warnUnsafeScripts = "yes"
convertUnsafeScripts = "yes"

-- Startup
-- NOTE: defaultPriority only works on Windows and sets process priority.
defaultPriority = "high"
startupDatabaseOptimization = "no"

-- Status server information
ownerName = ""
ownerEmail = ""
url = "http://otland.net/"
location = "Sweden"
 
worked thank you, now on another site is giving this error

STEP 1
Check server configuration

Warning: syntax error, unexpected '"' in C:/Users/Scorpions/Desktop/RadBR/config.lua on line 2 in C:\xampp\htdocs\RadBR\install.php on line 130
File config.lua loaded from C:/Users/Scorpions/Desktop/RadBR/config.lua and it's not valid TFS config.lua file. Go to STEP 1 - select other directory. If it's your config.lua file from TFS contact with acc. maker author.



LINE 130: $config['server'] = parse_ini_file($config['site']['server_path'].'config.lua');
 
Last edited:
Back
Top