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

Jaku

New Member
Joined
Apr 12, 2012
Messages
9
Reaction score
0
Hello.

I just installed Gesior 0.3.6 for 8.6 TFS server and everything worked perfectly except for one error message on character creation page.
The error itself is :

Notice: Uninitialized string offset: 4 in C:\xampp\htdocs\ajax\check_name.php on line 80

Notice: Uninitialized string offset: -1 in C:\xampp\htdocs\ajax\check_name.php on line 86

Notice: Undefined index: sqliteDatabase in C:\xampp\htdocs\ajax\check_name.php on line 120

Line 80 - if($name[$i] == $name[($i+1)] && $name[$i] == $name[($i+2)])
Line 86 - if($name[$i-1] == ' ' && $name[$i+1] == ' ')
Line 120 - $sqlitefile = $server_config['sqliteDatabase'];

I hope there is someone who can help me!

Thank you.

EDIT: Thanks Gabriel Tibiano who gave his php file and it works , just forgot to restart xampp. Noobish mistake ...
 

Attachments

Last edited:
I use Mysql , forgot to add that.

Use this one dude:

PHP:
<?PHP
echo '<?xml version="1.0" encoding="utf-8" standalone="yes"?>';
$config_ini = parse_ini_file('../config/config.ini');
$name = strtolower(stripslashes(trim($_REQUEST['name'])));
if(empty($name))
{
        echo '<font color="red">Please enter new character name.</font>';
        exit;
}

//first word can't be:
$first_words_blocked = array('gm ','cm ', 'god ','tutor ', "'", '-');
//names blocked:
$names_blocked = array('aa ', 'ee', 'ii', 'oo', 'uu', 'gm','cm', 'aff ', 'god ', 'abc', 'tutor', 'game', 'admin', 'the ', 'amazon', 'valkyrie', 'carrion worm', 'rotworm', 'rotworm queen', 'cockroach', 'kongra', 'merlkin', 'sibang', 'crystal spider', 'giant spider', 'poison spider', 'scorpion', 'spider', 'tarantula', 'achad', 'axeitus headbanger', 'bloodpaw', 'bovinus', 'colerian the barbarian', 'cursed gladiator', 'frostfur', 'orcus the cruel', 'rocky', 'the hairy one', 'avalanche', 'drasilla', 'grimgor guteater', 'kreebosh the exile', 'slim', 'spirit of earth', 'spirit of fire', 'spirit of water', 'the dark dancer', 'the hag', 'darakan the executioner', 'deathbringer', 'fallen mooh\'tah master ghar', 'gnorre chyllson', 'norgle glacierbeard', 'svoren the mad', 'the masked marauder', 'the obliverator', 'the pit lord', 'webster', 'barbarian bloodwalker', 'barbarian brutetamer', 'barbarian headsplitter', 'barbarian skullhunter', 'bear', 'panda', 'polar bear', 'braindeath', 'beholder', 'elder beholder', 'gazer', 'chicken', 'dire penguin', 'flamingo', 'parrot', 'penguin', 'seagull', 'terror bird', 'bazir', 'infernatil', 'thul', 'munster', 'son of verminor', 'xenia', 'zoralurk', 'big boss trolliver', 'foreman kneebiter', 'mad technomancer', 'man in the cave', 'lord of the elements', 'the count', 'the plasmother', 'dracola', 'the abomination', 'the handmaiden', 'mr. punish', 'the countess sorrow', 'the imperor', 'massacre', 'apocalypse', 'brutus bloodbeard', 'deadeye devious', 'demodras', 'dharalion', 'fernfang', 'ferumbras', 'general murius', 'ghazbaran', 'grorlam', 'lethal lissy', 'morgaroth', 'necropharus', 'orshabaal', 'ron the ripper', 'the evil eye', 'the horned fox', 'the old widow', 'tiquandas revenge', 'apprentice sheng', 'dog', 'hellhound', 'war wolf', 'winter wolf', 'wolf', 'chakoya toolshaper', 'chakoya tribewarden', 'chakoya windcaller', 'blood crab', 'crab', 'frost giant', 'frost giantess', 'ice golem', 'yeti', 'acolyte of the cult', 'adept of the cult', 'enlightened of the cult', 'novice of the cult', 'ungreez', 'dark torturer', 'demon', 'destroyer', 'diabolic imp', 'fire devil', 'fury', 'hand of cursed fate', 'juggernaut', 'nightmare', 'plaguesmith', 'blue djinn', 'efreet', 'green djinn', 'marid', 'frost dragon', 'wyrm', 'sea serpent', 'dragon lord', 'dragon', 'hydra', 'dragon hatchling', 'dragon lord hatchling', 'frost dragon hatchling', 'dwarf geomancer', 'dwarf guard', 'dwarf soldier', 'dwarf', 'dworc fleshhunter', 'dworc venomsniper', 'dworc voodoomaster', 'elephant', 'mammoth', 'elf arcanist', 'elf scout', 'elf', 'charged energy elemental', 'energy elemental', 'massive energy elemental', 'overcharged energy elemental', 'energy overlord', 'cat', 'lion', 'tiger', 'azure frog', 'coral frog', 'crimson frog', 'green frog', 'orchid frog', 'toad', 'jagged earth elemental', 'muddy earth elemental', 'earth elemental', 'massive earth elemental', 'earth overlord', 'gargoyle', 'stone golem', 'ghost', 'phantasm', 'phantasm', 'pirate ghost', 'spectre', 'cyclops smith', 'cyclops drone', 'behemoth', 'cyclops', 'slick water elemental', 'roaring water elemental', 'ice overlord', 'water elemental', 'massive water elemental', 'ancient scarab', 'butterfly', 'bug', 'centipede', 'exp bug', 'larva', 'scarab', 'wasp', 'lizard sentinel', 'lizard snakecharmer', 'lizard templar', 'minotaur archer', 'minotaur guard', 'minotaur mage', 'minotaur', 'squirrel', 'goblin demon', 'badger', 'bat', 'deer', 'the halloween hare', 'hyaena', 'pig', 'rabbit', 'silver rabbit', 'skunk', 'wisp', 'dark monk', 'monk', 'tha exp carrier', 'necromancer', 'priestess', 'orc berserker', 'orc leader', 'orc rider', 'orc shaman', 'orc spearman', 'orc warlord', 'orc warrior', 'orc', 'goblin leader', 'goblin scavenger', 'goblin', 'goblin assassin', 'assasin', 'bandit', 'black knight', 'hero', 'hunter', 'nomad', 'smuggler', 'stalker', 'poacher', 'wild warrior', 'ashmunrah', 'dipthrah', 'mahrdis', 'morguthis', 'omruc', 'rahemos', 'thalas', 'vashresamun', 'pirate buccaneer', 'pirate corsair', 'pirate cutthroat', 'pirate marauder', 'carniphila', 'spit nettle', 'fire overlord', 'massive fire elemental', 'blistering fire elemental', 'blazing fire elemental', 'fire elemental', 'hellfire fighter', 'quara constrictor scout', 'quara hydromancer scout', 'quara mantassin scout', 'quara pincher scout', 'quara predator scout', 'quara constrictor', 'quara hydromancer', 'quara mantassin', 'quara pincher', 'quara predator', 'cave rat', 'rat', 'cobra', 'crocodile', 'serpent spawn', 'snake', 'wyvern', 'black sheep', 'sheep', 'mimic', 'betrayed wraith', 'bonebeast', 'demon skeleton', 'lost soul', 'pirate skeleton', 'skeleton', 'skeleton warrior', 'undead dragon', 'defiler', 'slime2', 'slime', 'bog raider', 'ice witch', 'warlock', 'witch', 'bones', 'fluffy', 'grynch clan goblin', 'hacker', 'minishabaal', 'primitive', 'tibia bug', 'undead minion', 'annihilon', 'hellgorak', 'latrivan', 'madareth', 'zugurosh', 'ushuriel', 'golgordan', 'thornback tortoise', 'tortoise', 'eye of the seven', 'deathslicer', 'flamethrower', 'magicthrower', 'plaguethrower', 'poisonthrower', 'shredderthrower', 'troll champion', 'frost troll', 'island troll', 'swamp troll', 'troll', 'banshee', 'blightwalker', 'crypt shambler', 'ghoul', 'lich', 'mummy', 'vampire', 'grim reaper', 'trainer', 'forest dragon', 'knight', 'paladin', 'druid', 'sorcerer', 'guard', 'mercenary', 'thief', 'toxiros', 'pyramo', 'lazarus', 'zathroth', 'goshnar', 'durin', 'demora', 'orc champion', 'lumenia', 'dracula', 'alezzo', 'prince almirith', 'elf warlord', 'random noob', 'magebomb');
//name can't contain:
$words_blocked = array('gamemaster', 'game master', 'game-master', "game'master", '  ', '--', "''","' ", " '", '- ', ' -', "-'", "'-", 'fuck', 'sux', 'suck', 'noob', 'tutor', 'aa ', 'ee', 'ii', 'oo', 'uu', 'gm','cm', 'aff ', 'god ', 'abc', 'tutor', 'game', 'admin', 'the ', 'amazon', 'valkyrie', 'carrion worm', 'rotworm', 'rotworm queen', 'cockroach', 'kongra', 'merlkin', 'sibang', 'crystal spider', 'giant spider', 'poison spider', 'scorpion', 'spider', 'tarantula', 'achad', 'axeitus headbanger', 'bloodpaw', 'bovinus', 'colerian the barbarian', 'cursed gladiator', 'frostfur', 'orcus the cruel', 'rocky', 'the hairy one', 'avalanche', 'drasilla', 'grimgor guteater', 'kreebosh the exile', 'slim', 'spirit of earth', 'spirit of fire', 'spirit of water', 'the dark dancer', 'the hag', 'darakan the executioner', 'deathbringer', 'fallen mooh\'tah master ghar', 'gnorre chyllson', 'norgle glacierbeard', 'svoren the mad', 'the masked marauder', 'the obliverator', 'the pit lord', 'webster', 'barbarian bloodwalker', 'barbarian brutetamer', 'barbarian headsplitter', 'barbarian skullhunter', 'bear', 'panda', 'polar bear', 'braindeath', 'beholder', 'elder beholder', 'gazer', 'chicken', 'dire penguin', 'flamingo', 'parrot', 'penguin', 'seagull', 'terror bird', 'bazir', 'infernatil', 'thul', 'munster', 'son of verminor', 'xenia', 'zoralurk', 'big boss trolliver', 'foreman kneebiter', 'mad technomancer', 'man in the cave', 'lord of the elements', 'the count', 'the plasmother', 'dracola', 'the abomination', 'the handmaiden', 'mr. punish', 'the countess sorrow', 'the imperor', 'massacre', 'apocalypse', 'brutus bloodbeard', 'deadeye devious', 'demodras', 'dharalion', 'fernfang', 'ferumbras', 'general murius', 'ghazbaran', 'grorlam', 'lethal lissy', 'morgaroth', 'necropharus', 'orshabaal', 'ron the ripper', 'the evil eye', 'the horned fox', 'the old widow', 'tiquandas revenge', 'apprentice sheng', 'dog', 'hellhound', 'war wolf', 'winter wolf', 'wolf', 'chakoya toolshaper', 'chakoya tribewarden', 'chakoya windcaller', 'blood crab', 'crab', 'frost giant', 'frost giantess', 'ice golem', 'yeti', 'acolyte of the cult', 'adept of the cult', 'enlightened of the cult', 'novice of the cult', 'ungreez', 'dark torturer', 'demon', 'destroyer', 'diabolic imp', 'fire devil', 'fury', 'hand of cursed fate', 'juggernaut', 'nightmare', 'plaguesmith', 'blue djinn', 'efreet', 'green djinn', 'marid', 'frost dragon', 'wyrm', 'sea serpent', 'dragon lord', 'dragon', 'hydra', 'dragon hatchling', 'dragon lord hatchling', 'frost dragon hatchling', 'dwarf geomancer', 'dwarf guard', 'dwarf soldier', 'dwarf', 'dworc fleshhunter', 'dworc venomsniper', 'dworc voodoomaster', 'elephant', 'mammoth', 'elf arcanist', 'elf scout', 'elf', 'charged energy elemental', 'energy elemental', 'massive energy elemental', 'overcharged energy elemental', 'energy overlord', 'cat', 'lion', 'tiger', 'azure frog', 'coral frog', 'crimson frog', 'green frog', 'orchid frog', 'toad', 'jagged earth elemental', 'muddy earth elemental', 'earth elemental', 'massive earth elemental', 'earth overlord', 'gargoyle', 'stone golem', 'ghost', 'phantasm', 'phantasm', 'pirate ghost', 'spectre', 'cyclops smith', 'cyclops drone', 'behemoth', 'cyclops', 'slick water elemental', 'roaring water elemental', 'ice overlord', 'water elemental', 'massive water elemental', 'ancient scarab', 'butterfly', 'bug', 'centipede', 'exp bug', 'larva', 'scarab', 'wasp', 'lizard sentinel', 'lizard snakecharmer', 'lizard templar', 'minotaur archer', 'minotaur guard', 'minotaur mage', 'minotaur', 'squirrel', 'goblin demon', 'badger', 'bat', 'deer', 'the halloween hare', 'hyaena', 'pig', 'rabbit', 'silver rabbit', 'skunk', 'wisp', 'dark monk', 'monk', 'tha exp carrier', 'necromancer', 'priestess', 'orc berserker', 'orc leader', 'orc rider', 'orc shaman', 'orc spearman', 'orc warlord', 'orc warrior', 'orc', 'goblin leader', 'goblin scavenger', 'goblin', 'goblin assassin', 'assasin', 'bandit', 'black knight', 'hero', 'hunter', 'nomad', 'smuggler', 'stalker', 'poacher', 'wild warrior', 'ashmunrah', 'dipthrah', 'mahrdis', 'morguthis', 'omruc', 'rahemos', 'thalas', 'vashresamun', 'pirate buccaneer', 'pirate corsair', 'pirate cutthroat', 'pirate marauder', 'carniphila', 'spit nettle', 'fire overlord', 'massive fire elemental', 'blistering fire elemental', 'blazing fire elemental', 'fire elemental', 'hellfire fighter', 'quara constrictor scout', 'quara hydromancer scout', 'quara mantassin scout', 'quara pincher scout', 'quara predator scout', 'quara constrictor', 'quara hydromancer', 'quara mantassin', 'quara pincher', 'quara predator', 'cave rat', 'rat', 'cobra', 'crocodile', 'serpent spawn', 'snake', 'wyvern', 'black sheep', 'sheep', 'mimic', 'betrayed wraith', 'bonebeast', 'demon skeleton', 'lost soul', 'pirate skeleton', 'skeleton', 'skeleton warrior', 'undead dragon', 'defiler', 'slime2', 'slime', 'bog raider', 'ice witch', 'warlock', 'witch', 'bones', 'fluffy', 'grynch clan goblin', 'hacker', 'minishabaal', 'primitive', 'tibia bug', 'undead minion', 'annihilon', 'hellgorak', 'latrivan', 'madareth', 'zugurosh', 'ushuriel', 'golgordan', 'thornback tortoise', 'tortoise', 'eye of the seven', 'deathslicer', 'flamethrower', 'magicthrower', 'plaguethrower', 'poisonthrower', 'shredderthrower', 'troll champion', 'frost troll', 'island troll', 'swamp troll', 'troll', 'banshee', 'blightwalker', 'crypt shambler', 'ghoul', 'lich', 'mummy', 'vampire', 'grim reaper', 'trainer', 'forest dragon', 'knight', 'paladin', 'druid', 'sorcerer', 'guard', 'mercenary', 'thief', 'toxiros', 'pyramo', 'lazarus', 'zathroth', 'goshnar', 'durin', 'demora', 'orc champion', 'lumenia', 'dracula', 'alezzo', 'prince almirith', 'elf warlord', 'random noob', 'magebomb');
$temp = strspn("$name", "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM ");
if($temp != strlen($name))
{
        echo '<font color="red">The name for you character has been blocked for one or more security methods of the system, try another nick following the pattern of a-z, A-z.</font>';
        exit;
}
if(strlen($name) > 20)
{
        echo '<font color="red">To create a character it is necessary that the name has at least 4 digits and a maximum of 20 digits.</font>';
        exit;
}
foreach($names_blocked as $word)
        if($word == $name)
        {
                echo '<font color="red">The name for you character has been blocked for one or more security methods of the system, try another nick following the pattern of a-z, A-z.</b></font>';
                exit;
        }
foreach($first_words_blocked as $word)
        if($word == substr($name, 0, strlen($word)))
        {
                echo '<font color="red">First letters in name can\'t be:<b> '.$first_words_blocked[0];
                if(count($first_words_blocked) > 1)
                        foreach($first_words_blocked as $word)
                                if($word != $first_words_blocked[0])
                                        echo ','.$word;
                echo '</b></font>';
                exit;
        }
if(substr($name, -1) == "'" || substr($name, -1) == "-")
{
        echo '<font color="red">Last letter can\'t be <b>\'</b> and <b>-</b></font>';
        exit;
}
foreach($words_blocked as $word)
        if (!(strpos($name, $word) === false))
        {
                echo '<font color="red">The name for you character has been blocked for one or more security methods of the system, try another nick following the pattern of a-z, A-z.</b></font>';
                exit;
        }
for($i = 0; $i < strlen($name); $i++)
        if($name[$i] == $name[($i+1)] && $name[$i] == $name[($i+2)])
        {
                echo '<font color="red">Name can\'t contain 3 same letters one by one.</font><br />';
                exit;
        }
for($i = 0; $i < strlen($name); $i++)
        if($name[$i-1] == ' ' && $name[$i+1] == ' ')
        {
                echo '<font color="red">Use normal name format.</font><br /><font color="green"><u>Good:</u> <b>Gesior</b></font><font color="red"><br />Wrong: <b>G e s ior</b></font>';
                exit;
        }
if(substr($name, 1, 1) == ' ')
{
        echo '<font color="red">Use normal name format.</font><br /><font color="green"><u>Good:</u> <b>Gesior</b></font><font color="red"><br />Wrong: <b>G esior</b></font>';
        exit;
}
if(substr($name, -2, 1) == " ")
{
        echo '<font color="red">Use normal name format.</font><br /><font color="green"><u>Good:</u> <b>Gesior</b></font><font color="red"><br />Wrong: <b>Gesio r</b></font>';
        exit;
}
else
                //connect to DB
                $server_config = parse_ini_file($config_ini['server_path'].'config.lua');
                if(isset($server_config['sqlHost']))
                {
                        //old (0.2.4) ots config.lua file
                        $mysqlhost = $server_config['sqlHost'];
                        $mysqluser = $server_config['sqlUser'];
                        $mysqlpass = $server_config['sqlPass'];
                        $mysqldatabase = $server_config['sqlDatabase'];
                        $sqlitefile = $server_config['sqliteDatabase'];
                }
                // loads #####POT mainfile#####
                include('../pot/OTS.php');
                // PDO and POT connects to database
                $ots = POT::getInstance();
                if($server_config['sqlType'] == "mysql")
                        $ots->connect(POT::DB_MYSQL, array('host' => $mysqlhost, 'user' => $mysqluser, 'password' => $mysqlpass, 'database' => $mysqldatabase) );
                elseif($server_config['sqlType'] == "sqlite")
                        $ots->connect(POT::DB_SQLITE, array('database' => $config_ini['server_path'].$sqlitefile));
                $name_db = new OTS_Player();
                $name_db->find($name);
                if($name_db->isLoaded())
                        echo '<font color="red"><b>Player with this name already exist.</b></font>';
                else
                        echo '<font color="green">Good. Your name will be:<br />"<b>'.ucwords($name).'</b>"</font>';

?>
 
When i used yours it gave new errors :
Notice: Uninitialized string offset: 4 in C:\xampp\htdocs\ajax\check_name.php on line 57

Notice: Uninitialized string offset: 4 in C:\xampp\htdocs\ajax\check_name.php on line 57

Notice: Uninitialized string offset: -1 in C:\xampp\htdocs\ajax\check_name.php on line 63

Notice: Undefined index: sqliteDatabase in C:\xampp\htdocs\ajax\check_name.php on line 88
 
Line 57-if($name[$i] == $name[($i+1)] && $name[$i] == $name[($i+2)])
Line 63-if($name[$i-1] == ' ' && $name[$i+1] == ' ')
Line 88-$sqlitefile = $server_config['sqliteDatabase'];

As i see these are the same things just located now on a different line.
 
Back
Top