IgoR lYCAN
New Member
- Joined
- Dec 1, 2018
- Messages
- 169
- Reaction score
- 4
Is that your best strategy?only OTBR developers can understand what they have done on their engine
Reinstall the your website and webhost
Is that your best strategy?
A new repository is precisely why, use the old case you didn't like.
However, if you don't understand, it is better to ask in the repository or in the discord, don't be gossiping like a child.
For this reason, the open tibia community falls more and more into disrepute ... Look at the type of criticism that is made. Not necessary...
Table and ipairs function is the basics of the .lua, if a layman like me can develop this, anyone can. Holy patience.
And the error that the post has nothing to do with the new repository, the error is certainly from those who are trying to install the server. This should also be done as an issue in the repository or discord and not here.
The funny thing is that you got tired of copying the changes in the items.xml of the otbr to make a pull request in the tfs and still dare to talk like that? We spare you from your childishness.
Post automatically merged:
Reinstall the your website and webhost
Download all again. Including the login.php
What are your intentions with these changes?Ive actually made a few changes on the login.php, can I send it to you on private?
If we figured out the fix, I can publish here, for all have it.
Ive change somethings, one of them was the 'call' of the addonsWhat are your intentions with these changes?
I mean, what do you aim to do? Log in to a newer version?
A friend told me, that I need to configure the same name of server on config lua / login php ?View attachment 42106
What we have in the repository shows the addons.
What other changes are you trying to make? I need to know to be able to see if I can help you.
<?php
require 'config/config.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 (!defined('ONLY_PAGE'))
define('ONLY_PAGE', true);
// 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
$input = json_decode(file_get_contents("php://input"));
switch ($input->type ? $input->type : '') {
case "cacheinfo":
$playersonline = $SQL->query("SELECT COUNT(*) FROM `players_online`")->fetchAll();
$statistics = [
'playersonline' => (intval($playersonline[0][0])),
'twitchstreams' => 0,
'twitchviewer' => 0,
'gamingyoutubestreams' => 0,
'gamingyoutubeviewer' => 0
];
echo json_encode($statistics);
break;
case "eventschedule":
$campaign = [
[
'startdate' => time(),
'enddate' => time() + 36600 * 20,
'colorlight' => '#64162b',
'colordark' => '#7a1b34',
'name' => 'OTServBR-Global',
'description' => 'OTServBR-Global',
'isseasonal' => false
], [
'startdate' => time(),
'enddate' => time() + 36600 * 20,
'colorlight' => '#617a49',
'colordark' => '#4f633c',
'name' => 'OTServBR-Global',
'description' => 'OTServBR-Global',
'isseasonal' => false
], [
'startdate' => time(),
'enddate' => time() + 36600 * 20,
'colorlight' => '#527b53',
'colordark' => '#436343',
'name' => 'OTServBR-Global',
'description' => 'OTServBR-Global',
'isseasonal' => false
], [
'startdate' => time() - 36000,
'enddate' => time() + 36600 * 30,
'colorlight' => '#64162b',
'colordark' => '#7a1b34',
'name' => 'OTServBR-Global',
'description' => 'OTServBR-Global',
'isseasonal' => false
], [
'startdate' => time() - 36000,
'enddate' => time() + 36600 * 30,
'colorlight' => '#24657b',
'colordark' => '#1d5263',
'name' => 'OTServBR-Global',
'description' => 'OTServBR-Global',
'isseasonal' => false
], [
'startdate' => time() - 36000,
'enddate' => time() + 36600 * 30,
'colorlight' => '#8B6D05',
'colordark' => '#735D10',
'name' => 'OTServBR-Global',
'description' => 'OTServBR-Global',
'isseasonal' => false
] ];
$schedule['lastupdatetimestamp'] = time();
$schedule['eventlist'] = $campaign;
echo json_encode($schedule);
break;
case "boostedcreature":
// still name to figure out creature raceid's and work with server to boost the creature
$boostedcreature["boostedcreature"] = true;
$boostedcreature["raceid"] = 39;
echo json_encode($boostedcreature);
break;
case "login":
# Declare variables with array structure
$characters = array();
$playerData = array();
$data = array();
$isCasting = false;
# error function
function sendError($msg){
$ret = array();
$ret["errorCode"] = 3;
$ret["errorMessage"] = $msg;
die(json_encode($ret));
}
# getting infos
$request = file_get_contents('php://input');
$result = json_decode($request, true);
# account infos
$accountName = $result["accountname"];
$password = $result["password"];
# game port
$port = 7172;
# check if player wanna see cast list
if (strtolower($accountName) == "cast")
$isCasting = false;
if ($isCasting) {
$casts = $SQL->query("SELECT `player_id` FROM `live_casts`")->fetchAll();
if (count($casts[0]) == 0)
sendError("There is no live casts right now!");
foreach($casts as $cast) {
$character = new Player();
$character->load($cast['player_id']);
if ($character->isLoaded()) {
$level = $character->getLevel();
$outfitid = $character->getLookType();
$headcolor = $character->getLookHead();
$torsocolor = $character->getLookBody();
$legscolor = $character->getLookLegs();
$detailcolor = $character->getLookFeet();
$addonflags = $character->getLookAddons();
settype($level, "int");
settype($outfitid, "int");
settype($headcolor, "int");
settype($torsocolor, "int");
settype($legscolor, "int");
settype($detailcolor, "int");
settype($addonflags, "int");
$char = array("worldid" => 0,
"name" => $character->getName(),
"ismale" => (($character->getSex() == 1) ? true : false),
"tutorial" => false,
"outfitid" => $outfitid,
"level" => $level,
"headcolor" => $headcolor,
"torsocolor" => $torsocolor,
"legscolor" => $legscolor,
"detailcolor" => $detailcolor,
"addonsflags" => $addonflags,
'istournamentparticipant' => false,
'remainingdailytournamentplaytime' => 0,
"vocation" => Website::getVocationName($character->getVocation()),
"ishidden" => (($character->isHidden() == 1) ? true : false));
$characters[] = $char;
}
}
$port = 7173;
$lastLogin = 0;
$premiumAccount = true;
$timePremium = 0;
} else {
$account = new Account();
$account->find($accountName);
if (!$account->isLoaded())
sendError("Failed to get account. Try again!");
if ($account->getPassword() != Website::encryptPassword($password))
sendError("The password for this account is wrong. Try again!");
foreach($account->getPlayersList() as $character) {
$level = $character->getLevel();
$outfitid = $character->getLookType();
$headcolor = $character->getLookHead();
$torsocolor = $character->getLookBody();
$legscolor = $character->getLookLegs();
$detailcolor = $character->getLookFeet();
$addonflags = $character->getLookAddons();
settype($level, "int");
settype($outfitid, "int");
settype($headcolor, "int");
settype($torsocolor, "int");
settype($legscolor, "int");
settype($detailcolor, "int");
settype($addonflags, "int");
$char = array("worldid" => 0,
"name" => $character->getName(),
"ismale" => (($character->getSex() == 1) ? true : false),
"tutorial" => false,
"outfitid" => $outfitid,
"level" => $level,
"headcolor" => $headcolor,
"torsocolor" => $torsocolor,
"legscolor" => $legscolor,
"detailcolor" => $detailcolor,
"addonsflags" => $addonflags,
"vocation" => Website::getVocationName($character->getVocation()),
'istournamentparticipant' => false,
'remainingdailytournamentplaytime' => 0,
"ishidden" => (($character->isHidden() == 1) ? true : false));
$characters[] = $char;
}
$lastLogin = $account->getLastLogin();
$premiumAccount = ($account->isPremium()) ? true : true;
$timePremium = time() + (($account->getPremDays()+654) * 86400);
}
$session = array(
"fpstracking" => false,
"optiontracking" => false,
"isreturner" => true,
"returnernotification" => false,
"showrewardnews" => false,
"sessionkey" => $accountName . "\n" . $password,
"lastlogintime" => $lastLogin,
"ispremium" => $premiumAccount,
"premiumuntil" => $timePremium,
"status" => "active",
'tournamentticketpurchasestate' => 0,
'emailcoderequest' => false,
"stayloggedin" => true,
);
if ($config['server']['worldType'] == "pvp") {
$pvptype = 0;
}
else if ($config['server']['worldType'] == "no-pvp") {
$pvptype = 1;
}
else if ($config['server']['worldType'] == "pvp-enforced") {
$pvptype = 2;
}
else {
$pvptype = 0; //default value
}
$world = array(
"id" => 0,
"name" => $config['server']['serverName'],
"externaladdress" => $config['server']['ip'],
"externalport" => $port,
"previewstate" => 0,
"location" => "BRA",
"externaladdressunprotected" => $config['server']['ip'],
"externaladdressprotected" => $config['server']['ip'],
"externalportunprotected" => $port,
"externalportprotected" => $port,
"pvptype" => $pvptype,
"anticheatprotection" => false,
'istournamentworld' => false,
'restrictedstore' => false,
'currenttournamentphase' => 2
);
$worlds = array($world);
$data["session"] = $session;
$playerData["worlds"] = $worlds;
$playerData["characters"] = $characters;
$data["playdata"] = $playerData;
$data["survey"] = $survey;
echo json_encode($data);
}
A friend told me, that I need to configure the same name of server on config lua / login php ?
thats why this error happens?
PHP:<?php require 'config/config.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 (!defined('ONLY_PAGE')) define('ONLY_PAGE', true); // 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 $input = json_decode(file_get_contents("php://input")); switch ($input->type ? $input->type : '') { case "cacheinfo": $playersonline = $SQL->query("SELECT COUNT(*) FROM `players_online`")->fetchAll(); $statistics = [ 'playersonline' => (intval($playersonline[0][0])), 'twitchstreams' => 0, 'twitchviewer' => 0, 'gamingyoutubestreams' => 0, 'gamingyoutubeviewer' => 0 ]; echo json_encode($statistics); break; case "eventschedule": $campaign = [ [ 'startdate' => time(), 'enddate' => time() + 36600 * 20, 'colorlight' => '#64162b', 'colordark' => '#7a1b34', 'name' => 'OTServBR-Global', 'description' => 'OTServBR-Global', 'isseasonal' => false ], [ 'startdate' => time(), 'enddate' => time() + 36600 * 20, 'colorlight' => '#617a49', 'colordark' => '#4f633c', 'name' => 'OTServBR-Global', 'description' => 'OTServBR-Global', 'isseasonal' => false ], [ 'startdate' => time(), 'enddate' => time() + 36600 * 20, 'colorlight' => '#527b53', 'colordark' => '#436343', 'name' => 'OTServBR-Global', 'description' => 'OTServBR-Global', 'isseasonal' => false ], [ 'startdate' => time() - 36000, 'enddate' => time() + 36600 * 30, 'colorlight' => '#64162b', 'colordark' => '#7a1b34', 'name' => 'OTServBR-Global', 'description' => 'OTServBR-Global', 'isseasonal' => false ], [ 'startdate' => time() - 36000, 'enddate' => time() + 36600 * 30, 'colorlight' => '#24657b', 'colordark' => '#1d5263', 'name' => 'OTServBR-Global', 'description' => 'OTServBR-Global', 'isseasonal' => false ], [ 'startdate' => time() - 36000, 'enddate' => time() + 36600 * 30, 'colorlight' => '#8B6D05', 'colordark' => '#735D10', 'name' => 'OTServBR-Global', 'description' => 'OTServBR-Global', 'isseasonal' => false ] ]; $schedule['lastupdatetimestamp'] = time(); $schedule['eventlist'] = $campaign; echo json_encode($schedule); break; case "boostedcreature": // still name to figure out creature raceid's and work with server to boost the creature $boostedcreature["boostedcreature"] = true; $boostedcreature["raceid"] = 39; echo json_encode($boostedcreature); break; case "login": # Declare variables with array structure $characters = array(); $playerData = array(); $data = array(); $isCasting = false; # error function function sendError($msg){ $ret = array(); $ret["errorCode"] = 3; $ret["errorMessage"] = $msg; die(json_encode($ret)); } # getting infos $request = file_get_contents('php://input'); $result = json_decode($request, true); # account infos $accountName = $result["accountname"]; $password = $result["password"]; # game port $port = 7172; # check if player wanna see cast list if (strtolower($accountName) == "cast") $isCasting = false; if ($isCasting) { $casts = $SQL->query("SELECT `player_id` FROM `live_casts`")->fetchAll(); if (count($casts[0]) == 0) sendError("There is no live casts right now!"); foreach($casts as $cast) { $character = new Player(); $character->load($cast['player_id']); if ($character->isLoaded()) { $level = $character->getLevel(); $outfitid = $character->getLookType(); $headcolor = $character->getLookHead(); $torsocolor = $character->getLookBody(); $legscolor = $character->getLookLegs(); $detailcolor = $character->getLookFeet(); $addonflags = $character->getLookAddons(); settype($level, "int"); settype($outfitid, "int"); settype($headcolor, "int"); settype($torsocolor, "int"); settype($legscolor, "int"); settype($detailcolor, "int"); settype($addonflags, "int"); $char = array("worldid" => 0, "name" => $character->getName(), "ismale" => (($character->getSex() == 1) ? true : false), "tutorial" => false, "outfitid" => $outfitid, "level" => $level, "headcolor" => $headcolor, "torsocolor" => $torsocolor, "legscolor" => $legscolor, "detailcolor" => $detailcolor, "addonsflags" => $addonflags, 'istournamentparticipant' => false, 'remainingdailytournamentplaytime' => 0, "vocation" => Website::getVocationName($character->getVocation()), "ishidden" => (($character->isHidden() == 1) ? true : false)); $characters[] = $char; } } $port = 7173; $lastLogin = 0; $premiumAccount = true; $timePremium = 0; } else { $account = new Account(); $account->find($accountName); if (!$account->isLoaded()) sendError("Failed to get account. Try again!"); if ($account->getPassword() != Website::encryptPassword($password)) sendError("The password for this account is wrong. Try again!"); foreach($account->getPlayersList() as $character) { $level = $character->getLevel(); $outfitid = $character->getLookType(); $headcolor = $character->getLookHead(); $torsocolor = $character->getLookBody(); $legscolor = $character->getLookLegs(); $detailcolor = $character->getLookFeet(); $addonflags = $character->getLookAddons(); settype($level, "int"); settype($outfitid, "int"); settype($headcolor, "int"); settype($torsocolor, "int"); settype($legscolor, "int"); settype($detailcolor, "int"); settype($addonflags, "int"); $char = array("worldid" => 0, "name" => $character->getName(), "ismale" => (($character->getSex() == 1) ? true : false), "tutorial" => false, "outfitid" => $outfitid, "level" => $level, "headcolor" => $headcolor, "torsocolor" => $torsocolor, "legscolor" => $legscolor, "detailcolor" => $detailcolor, "addonsflags" => $addonflags, "vocation" => Website::getVocationName($character->getVocation()), 'istournamentparticipant' => false, 'remainingdailytournamentplaytime' => 0, "ishidden" => (($character->isHidden() == 1) ? true : false)); $characters[] = $char; } $lastLogin = $account->getLastLogin(); $premiumAccount = ($account->isPremium()) ? true : true; $timePremium = time() + (($account->getPremDays()+654) * 86400); } $session = array( "fpstracking" => false, "optiontracking" => false, "isreturner" => true, "returnernotification" => false, "showrewardnews" => false, "sessionkey" => $accountName . "\n" . $password, "lastlogintime" => $lastLogin, "ispremium" => $premiumAccount, "premiumuntil" => $timePremium, "status" => "active", 'tournamentticketpurchasestate' => 0, 'emailcoderequest' => false, "stayloggedin" => true, ); if ($config['server']['worldType'] == "pvp") { $pvptype = 0; } else if ($config['server']['worldType'] == "no-pvp") { $pvptype = 1; } else if ($config['server']['worldType'] == "pvp-enforced") { $pvptype = 2; } else { $pvptype = 0; //default value } $world = array( "id" => 0, "name" => $config['server']['serverName'], "externaladdress" => $config['server']['ip'], "externalport" => $port, "previewstate" => 0, "location" => "BRA", "externaladdressunprotected" => $config['server']['ip'], "externaladdressprotected" => $config['server']['ip'], "externalportunprotected" => $port, "externalportprotected" => $port, "pvptype" => $pvptype, "anticheatprotection" => false, 'istournamentworld' => false, 'restrictedstore' => false, 'currenttournamentphase' => 2 ); $worlds = array($world); $data["session"] = $session; $playerData["worlds"] = $worlds; $playerData["characters"] = $characters; $data["playdata"] = $playerData; $data["survey"] = $survey; echo json_encode($data); }
My server isnt 12It is not necessary to put the server name in login.php
Try using this login:
GitHub - opentibiabr/gesioraac-tibia12-login: This is tibia12 login.php script for GesiorAAC.
This is tibia12 login.php script for GesiorAAC. Contribute to opentibiabr/gesioraac-tibia12-login development by creating an account on GitHub.github.com
My server isnt 12
You don't give information, you say the error is for no apparent reason. Nobody guesses.