• 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!

Gesior Page Error

skywalker16

New Member
Joined
Nov 5, 2008
Messages
250
Reaction score
1
Location
Switzerland
I think many ppl have already posted this error but i never saw a solution so i ask:

In the latest version of Gesiors AAC Page, i always get this bug by reloading monsters/spells... Does anyone know how to fix this?

Monsters:

Warning: domdocument::domdocument() expects at least 1 parameter, 0 given in C:\Users\Open Tibia Server\Resoria\xampp\htdocs\pot\OTS_MonstersList.php on line 61

Fatal error: Call to undefined method domdocument::load() in C:\Users\Open Tibia Server\Resoria\xampp\htdocs\pot\OTS_MonstersList.php on line 62

Spells:

Warning: Illegal offset type in C:\Users\Open Tibia Server\Resoria\xampp\htdocs\adminpanel.php on line 295

Warning: Illegal offset type in C:\Users\Open Tibia Server\Resoria\xampp\htdocs\adminpanel.php on line 295

Warning: domdocument::domdocument() expects at least 1 parameter, 0 given in C:\Users\Open Tibia Server\Resoria\xampp\htdocs\pot\OTS_SpellsList.php on line 97

Fatal error: Call to undefined method domdocument::load() in C:\Users\Open Tibia Server\Resoria\xampp\htdocs\pot\OTS_SpellsList.php on line 98
 
MONSTERLIST

PHP:
<?php

/**#@+
 * @version 0.1.0
 * @since 0.1.0
 */

/**
 * @package POT
 * @version 0.1.3
 * @author Wrzasq <[email protected]>
 * @copyright 2007 - 2008 (C) by Wrzasq
 * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public License, Version 3
 */

/**
 * Wrapper for monsters list.
 * 
 * @package POT
 * @version 0.1.3
 * @tutorial POT/data_directory.pkg#monsters
 */
class OTS_MonstersList implements Iterator, Countable, ArrayAccess
{
/**
 * Monsters directory.
 * 
 * @var string
 */
    private $monstersPath;

/**
 * List of loaded monsters.
 * 
 * @var array
 */
    private $monsters = array();

/**
 * Loads monsters mapping file.
 * 
 * <p>
 * Note: You pass directory path, not monsters.xml file name itself.
 * </p>
 * 
 * @param string $path Monsters directory.
 * @throws DOMException On DOM operation error.
 */
    public function __construct($path)
    {
        $this->monstersPath = $path;

        // makes sure it has directory separator at the end
        $last = substr($this->monstersPath, -1);
        if($last != '/' && $last != '\\')
        {
            $this->monstersPath .= '/';
        }

        // loads monsters mapping file
        $monsters = new DOMDocument();
        $monsters->load($this->monstersPath . 'monsters.xml');

        foreach( $monsters->getElementsByTagName('monster') as $monster)
        {
            $this->monsters[ $monster->getAttribute('name') ] = $monster->getAttribute('file');
        }
    }

/**
 * Magic PHP5 method.
 * 
 * Allows object importing from {@link http://www.php.net/manual/en/function.var-export.php var_export()}.
 * 
 * @param array $properties List of object properties.
 */
    public function __set_state($properties)
    {
        $object = new self();

        // loads properties
        foreach($properties as $name => $value)
        {
            $object->$name = $value;
        }

        return $object;
    }

/**
 * Checks if given monster ID exists on list.
 * 
 * @version 0.1.3
 * @since 0.1.3
 * @param string $name Monster name.
 * @return bool If monster is set then true.
 */
    public function hasMonster($name)
    {
        return isset($this->monsters[$name]);
    }

/**
 * Returns loaded data of given monster.
 * 
 * @version 0.1.3
 * @param string $name Monster name.
 * @return OTS_Monster Monster data.
 * @throws OutOfBoundsException If not exists.
 * @throws DOMException On DOM operation error.
 */
    public function getMonster($name)
    {
        // checks if monster exists
        if( isset($this->monsters[$name]) )
        {
            // loads file
            $monster = new OTS_Monster();
            $monster->load($this->monstersPath . $this->monsters[$name]);
            return $monster;
        }

        throw new OutOfBoundsException();
    }

/**
 * Returns amount of monsters loaded.
 * 
 * @return int Count of monsters.
 */
    public function count()
    {
        return count($this->monsters);
    }

/**
 * Returns monster at current position in iterator.
 * 
 * @return OTS_Monster Monster.
 * @throws DOMException On DOM operation error.
 */
    public function current()
    {
        return $this->getMonster( key($this->monsters) );
    }

/**
 * Moves to next iterator monster.
 */
    public function next()
    {
        next($this->monsters);
    }

/**
 * Returns name of current position.
 * 
 * @return string Current position key.
 */
    public function key()
    {
        return key($this->monsters);
    }

/**
 * Checks if there is anything more in interator.
 * 
 * @return bool If iterator has anything more.
 */
    public function valid()
    {
        return key($this->monsters) !== null;
    }

/**
 * Resets iterator index.
 */
    public function rewind()
    {
        reset($this->monsters);
    }

/**
 * Checks if given element exists.
 * 
 * @param string $offset Array key.
 * @return bool True if it's set.
 */
    public function offsetExists($offset)
    {
        return isset($this->monsters[$offset]);
    }

/**
 * Returns item from given position.
 * 
 * @version 0.1.3
 * @param string $offset Array key.
 * @return OTS_Monster Monster instance.
 * @throws DOMException On DOM operation error.
 */
    public function offsetGet($offset)
    {
        return $this->getMonster($offset);
    }

/**
 * This method is implemented for ArrayAccess interface. In fact you can't write/append to monsters list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise.
 * 
 * @param string|int $offset Array key.
 * @param mixed $value Field value.
 * @throws E_OTS_ReadOnly Always - this class is read-only.
 */
    public function offsetSet($offset, $value)
    {
        throw new E_OTS_ReadOnly();
    }

/**
 * This method is implemented for ArrayAccess interface. In fact you can't write/append to monsters list. Any call to this method will cause {@link E_OTS_ReadOnly E_OTS_ReadOnly} raise.
 * 
 * @param string|int $offset Array key.
 * @throws E_OTS_ReadOnly Always - this class is read-only.
 */
    public function offsetUnset($offset)
    {
        throw new E_OTS_ReadOnly();
    }

/**
 * Returns string representation of object.
 * 
 * <p>
 * If any display driver is currently loaded then it uses it's method.
 * </p>
 * 
 * @version 0.1.3
 * @since 0.1.3
 * @return string String representation of object.
 */
    public function __toString()
    {
        $ots = POT::getInstance();

        // checks if display driver is loaded
        if( $ots->isDataDisplayDriverLoaded() )
        {
            return $ots->getDataDisplayDriver()->displayMonstersList($this);
        }

        return (string) $this->count();
    }
}

/**#@-*/

?>
61 & 62
PHP:
$monsters = new DOMDocument();
         $monsters->load($this->monstersPath . 'monsters.xml');
SPELLS
PHP:
<?php

/**#@+
 * @version 0.1.0
 * @since 0.1.0
 */

/**
 * @package POT
 * @author Wrzasq <[email protected]>
 * @copyright 2007 (C) by Wrzasq
 * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public License, Version 3
 */

/**
 * Wrapper for spells list.
 * 
 * @package POT
 * @property-read array $runesList List of rune spells.
 * @property-read array $instantsList List of instant spells.
 * @property-read array $conjuresList List of conjure spells.
 */
class OTS_SpellsList
{
/**
 * Rune spell.
 */
    const SPELL_RUNE = 0;
/**
 * Instant spell.
 */
    const SPELL_INSTANT = 1;
/**
 * Conjure spell.
 */
    const SPELL_CONJURE = 2;

/**
 * Rune spells.
 * 
 * @var array
 */
    private $runes = array();

/**
 * Instant spells.
 * 
 * @var array
 */
    private $instants = array();

/**
 * Conjure spells.
 * 
 * @var array
 */
    private $conjures = array();
/**
 * Magic PHP5 method.
 * 
 * Allows object importing from {@link http://www.php.net/manual/en/function.var-export.php var_export()}.
 * 
 * @internal Magic PHP5 method.
 * @param array $properties List of object properties.
 */
    public function __set_state($properties)
    {
        $object = new self();

        // loads properties
        foreach($properties as $name => $value)
        {
            $object->$name = $value;
        }

        return $object;
    }

/**
 * Loads spells list.
 * 
 * @param string $file Spells file name.
 */
    public function __construct($file)
    {
        // loads DOM document
        $spells = new DOMDocument();
        $spells->load($file);

        // loads runes
        foreach( $spells->getElementsByTagName('rune') as $rune)
        {
            $this->runes[ $rune->getAttribute('name') ] = new OTS_Spell(self::SPELL_RUNE, $rune);
        }

        // loads instants
        foreach( $spells->getElementsByTagName('instant') as $instant)
        {
            $this->instants[ $instant->getAttribute('name') ] = new OTS_Spell(self::SPELL_INSTANT, $instant);
        }

        // loads conjures
        foreach( $spells->getElementsByTagName('conjure') as $conjure)
        {
            $this->conjures[ $conjure->getAttribute('name') ] = new OTS_Spell(self::SPELL_CONJURE, $conjure);
        }
    }

/**
 * Returns list of runes.
 * 
 * @return array List of rune names.
 */
    public function getRunesList()
    {
        return array_keys($this->runes);
    }

/**
 * Returns given rune spell.
 * 
 * @param string $name Rune name.
 * @return OTS_Spell|null Rune spell wrapper (null if rune does not exist).
 */
    public function getRune($name)
    {
        if( isset($this->runes[$name]) )
        {
            return $this->runes[$name];
        }
        else
        {
            return null;
        }
    }

/**
 * Returns list of instants.
 * 
 * @return array List of instant spells names.
 */
    public function getInstantsList()
    {
        return array_keys($this->instants);
    }

/**
 * Returns given instant spell.
 * 
 * @param string $name Spell name.
 * @return OTS_Spell|null Instant spell wrapper (null if rune does not exist).
 */
    public function getInstant($name)
    {
        if( isset($this->instants[$name]) )
        {
            return $this->instants[$name];
        }
        else
        {
            return null;
        }
    }

/**
 * Returns list of conjure spells.
 * 
 * @return array List of conjure spells names.
 */
    public function getConjuresList()
    {
        return array_keys($this->conjures);
    }

/**
 * Returns given conjure spell.
 * 
 * @param string $name Spell name.
 * @return OTS_Spell|null Conjure spell wrapper (null if rune does not exist).
 */
    public function getConjure($name)
    {
        if( isset($this->conjures[$name]) )
        {
            return $this->conjures[$name];
        }
        else
        {
            return null;
        }
    }

/**
 * Magic PHP5 method.
 * 
 * @param string $name Property name.
 * @return mixed Property value.
 * @throws OutOfBoundsException For non-supported properties.
 */
    public function __get($name)
    {
        switch($name)
        {
            case 'runesList':
                return $this->getRunesList();

            case 'instantsList':
                return $this->getInstantsList();

            case 'conjuresList':
                return $this->getConjuresList();

            default:
                throw new OutOfBoundsException();
        }
    }
}

/**#@-*/

?>
87 & 88 (This is where i have errors)
PHP:
$spells = new DOMDocument();
        $spells->load($file);
 
that error is when you load the config.lua from httdocs when you load the config.lua from the server folder then you wont get any errors.
 
Code:
Warning: Illegal offset type in C:\Users\Open Tibia Server\Resoria\xampp\htdocs\adminpanel.php on line 295


go to line 295 of adminpanel.php and add a ; at the end of the line. It should fix 1 minor bug.
Worked for me!
 
Let me be a little more specific.

change this on line 295 of your adminpanel.php
Code:
$vocations_ids[$voc_name] = $voc_id

to this
Code:
$vocations_ids[$voc_name] = $voc_id;
 
Back
Top