Ir para conteúdo

Featured Replies

Postado

 

Esse é o meu config/config.php

 

Quote

 

<?PHP
// ----Config Shop----
$outfits_list = array();
$loyalty_title = array(50 => 'Scout', 100 => 'Sentinel', 200 => 'Steward', 400 => 'Warden', 1000 => 'Squire', 2000 => 'Warrior', 3000 => 'Keeper', 4000 => 'Guardian', 5000 => 'Sage');
$config['shop']['newitemdays'] = 1; #days to item be new in shop

# Pagseguro configs
$config['pagseguro']['testing'] = false;
$config['pagseguro']['tokentest'] = "";
$config['pagseguro']['email'] = '';
$config['pagseguro']['apitoken'] = '';

# Bank transfer data
$config['banktransfer']['bank'] = "Caixa Econômica";
$config['banktransfer']['agency'] = "";
$config['banktransfer']['account'] = "";
$config['banktransfer']['name'] = "";
$config['banktransfer']['operation'] = 003; // 0 = no operation

# PayPal configs
$config['paypal']['email'] = "";

# Social Networks
$config['social']['status'] = true;
$config['social']['facebook'] = "https://www.facebook.com/tibia";

# PAGE: characters.php
$config['site']['quests'] = array(
"Demon Helmet" => 2213,
"In Service of Yalahar" => 12279,
"Pits Of Inferno" => 10544,
"The Ancient Tombs" => 50220,
"The Annihilator" => 2215,
"The Demon Oak" => 1010,
"Wrath Of The Emperor" => 12374);

# time in days to show the former names
$config['site']['formerNames'] = 10;
$config['site']['formerNames_amount'] = 10;

# Account Maker Config
$config['site']['serverPath'] = "C:/Users/Franco/Desktop/ot/ombra-pack10x-master/";
$config['site']['useServerConfigCache'] = false;
$towns_list = array(
1 => 'Venore',
2 => 'Thais',
3 => 'Kazordoon',
4 => 'Carlin',
5 => 'Ab\'Dendriel',
6 => 'Rookgaard',
7 => 'Liberty Bay',
8 => 'Port Hope',
9 => 'Ankrahmun',
10 => 'Darashia',
11 => 'Edron',
12 => 'Svargrond',
13 => 'Yalahar',
14 => 'Farmine',
28 => 'Gray Beach',
29 => 'Roshamuul',
33 => 'Rathleton',
34 => 'Krailos',
51 => 'Dawnport',
52 => 'Feyrist',
);
# this is important if you want to use ajax check in your create account
$config['site']['sqlHost'] = "localhost";
$config['site']['sqlUser'] = "root";
$config['site']['sqlPass'] = "YOUR DATABASE PASSWORD HERE";
$config['site']['sqlBD'] = "YOUR DATABASE NAME";

# Create Account Options
$config['site']['one_email'] = true;
$config['site']['create_account_verify_mail'] = true;
$config['site']['verify_code'] = true;
$config['site']['email_days_to_change'] = 7;
$config['site']['newaccount_premdays'] = 0;
$config['site']['send_register_email'] = true;

# Create Character Options
$config['site']['newchar_vocations'] = array(0 => 'Rook Sample'); // if you wan't use rook, put (1 => 'Sorcerer Sample', 2 => 'Druid Sample', 3 => 'Paladin Sample', 4 => 'Knight Sample');
$config['site']['newchar_towns'] = array(6, 51);
$config['site']['max_players_per_account'] = 10;


# Emails Config
$config['site']['send_emails'] = true;
$config['site']['mail_address'] = "";
$config['site']['mail_senderName'] = "";
$config['site']['smtp_enabled'] = true;
$config['site']['smtp_host'] = "ssl://smtp.gmail.com";
$config['site']['smtp_port'] = 465;
$config['site']['smtp_auth'] = true;
$config['site']['smtp_user'] = "";
$config['site']['smtp_pass'] = "";
$config['site']['smtp_secure'] = true;

# PAGE: accountmanagement.php
$config['site']['send_mail_when_change_password'] = true;
$config['site']['send_mail_when_generate_reckey'] = true;
$config['site']['email_time_change'] = 7;
$config['site']['daystodelete'] = 7;
$config['site']['flash_client_enabled'] = false;

# PAGE: guilds.php
$config['site']['guild_need_level'] = 8;
$config['site']['guild_need_pacc'] = false;
$config['site']['guild_image_size_kb'] = 50;
$config['site']['guild_description_chars_limit'] = 2000;
$config['site']['guild_description_lines_limit'] = 6;
$config['site']['guild_motd_chars_limit'] = 250;

# PAGE: adminpanel.php
$config['site']['access_admin_panel'] = 3;

# PAGE: latestnews.php
$config['site']['news_limit'] = 6;

# PAGE: killstatistics.php
$config['site']['last_deaths_limit'] = 40;

# PAGE: team.php
$config['site']['groups_support'] = array(2, 3, 4, 5, 6);

# PAGE: highscores.php
$config['site']['groups_hidden'] = array(3, 4, 5, 6);
$config['site']['accounts_hidden'] = array(1);

# PAGE: lostaccount.php
$config['site']['email_lai_sec_interval'] = 180;

#  Pagseguro offers
// ValorR$ => Qtd_coins
$config['pagseguro']['offers'] = array(
    500=>75,
    800=>125,
    1500=>250,
    2800=>500,
    4900=>1000
);
// Nome do produto
$config['pagseguro']['produtoNome'] = 'Tibia Coins';

$config['pagseguro']['urlRedirect'] =  'https://127.0.0.1/';
$config['pagseguro']['urlNotification'] = 'https://127.0.0.1/retpagseguro.php';

# Layout Config
$config['site']['layout'] = 'tibiarl';
$config['site']['vdarkborder'] = '#505050';
$config['site']['darkborder'] = '#D4C0A1';
$config['site']['lightborder'] = '#F1E0C6';
$config['site']['download_page'] = false;
$config['site']['serverinfo_page'] = true;

 

 

E esse é o meu login.php

Quote

<?php
/**
 * Created by Notepad++.
 * User: Malucooo - Erick Nunes
 * Remaked of login.php by JLCVP and parts of login.php by Monteiro. Thanks for both!
 * Date: 18/09/17
 * Time: 03:01
 */

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
/*error example:
{
    "errorCode":3,
    "errorMessage":"Account name or password is not correct."
}*/

# 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 = true;
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()) {
            $char = array("worldid" => 0, "name" => $character->getName(), "ismale" => (($character->getSex() == 1) ? true : false), "tutorial" => 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) {
        $char = array("worldid" => 0, "name" => $character->getName(), "ismale" => (($character->getSex() == 1) ? true : false), "tutorial" => false);
        $characters[] = $char;
    }
    
    $lastLogin = $account->getLastLogin();
    $premiumAccount = ($account->isPremium()) ? true : false;
    $timePremium = time() + ($account->getPremDays() * 86400);
}
$session = array(
    "fpstracking" => false,
    "isreturner" => true,
    "returnernotification" => false,
    "showrewardnews" => false,
    "sessionkey" => $accountName . "\n" . $password,
    "lastlogintime" => $lastLogin,
    "ispremium" => $premiumAccount,
    "premiumuntil" => $timePremium,
    "status" => "active"    
);
$world = array(
    "id" => 0,
    "name" => $config['server']['serverName'],
    "externaladdress" => $config['server']['ip'],
    "externalport" => $port,
    "previewstate" => 0,
    "location" => "BRA",
    "anticheatprotection" => false
);

$worlds = array($world);
$data["session"] = $session;
$playerData["worlds"] = $worlds;
$playerData["characters"] = $characters;
$data["playdata"] = $playerData;
$data["survey"] = $survey;

echo json_encode($data);

 

 

Já tentei deixar sem nada entre as aspas onde diz:

$config['site']['sqlHost'] = "localhost";
$config['site']['sqlUser'] = "root";
$config['site']['sqlPass'] = "YOUR DATABASE PASSWORD HERE";
$config['site']['sqlBD'] = "YOUR DATABASE NAME";

Carrega a lista de char mas nao entra, diz que que está off:  (The remote host close the connection)

 

Deixei assim:

$config['site']['sqlHost'] = "localhost";
$config['site']['sqlUser'] = "root";
$config['site']['sqlPass'] = "";
$config['site']['sqlBD'] = "DATABASE";

Usando assim da acc/pass invalido

Testei trocando o localhost para 127.0.0.1

Tb deu o mesmo erro.

 

Socorro !!! kkk

 

 

  • Respostas 25
  • Visualizações 6.3k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • //Survey by: Cjaker $survey = array( "id" => rand(0, 999999), "invitationtext" => "Querido tibiano, obrigado por usar OTX, a base mais atualizada do Tibia Global.\n'Mensagem dita por Cjaker'."

Posted Images

Postado
26 minutos atrás, francosilverio1 disse:

$config['site']['sqlHost'] = "localhost";
$config['site']['sqlUser'] = "root";
$config['site']['sqlPass'] = "";
$config['site']['sqlBD'] = "DATABASE";


No seu caso, está faltando configurar essas linhas. Elas são responsáveis por definir:
$config['site']['sqlHost']  >> host onde se localiza o seu banco de dados MYSQL
$config['site']['sqlUser'] >> usuario que irá se conectar no seu MySQL
$config['site']['sqlPass'] >> senha do usuário que irá se conectar no mysql
$config['site']['sqlBD'] >> nome do banco de dados que você irá se conectar

Dica: nunca deixem o usuário root sem senha, e nunca usem ele no seu Banco de Dados. O usuário root tem muitas permissões que vão além do necessário para um OTServer. Criem um usuário exclusivo para operar no banco de dados do OTServer.

Postado

Sabe como posso fazer esta alteração de usuário e senha?

 

De qualquer forma, essa parte não diz respeito a conexão com a database?

Pq mesmo usando essa ele parece fazer a conexão com a database pq carrega a lista de char etc. Só não loga

 

Devo deixar assim?

Exemplo

$config['site']['sqlHost']  >> localhost
$config['site']['sqlUser'] >> otserverdatabase
$config['site']['sqlPass'] >> 17171717
$config['site']['sqlBD'] >> DATABASE

 

Tenho testado o root sem senha pq a princípio quero abrir apenas em localhost para testes. Por isso não troquei a senha da db.

Editado por francosilverio1 (veja o histórico de edições)

Postado
45 minutos atrás, francosilverio1 disse:

$world = array(
    "id" => 0,
    "name" => $config['server']['serverName'],
    "externaladdress" => $config['server']['ip'],
    "externalport" => $port,
    "previewstate" => 0,
    "location" => "BRA",
    "anticheatprotection" => false
);


Eu acho estranho esse código... pq ele tenta acessar duas propiedades do config.php:
"name" => $config['server']['serverName']
"externaladdress" => $config['server']['ip']


Nenhuma dessas duas propiedades está definida no arquivo config.php, tente adicionar essas duas linhas no seu arquivo config/config.php:

$config['server']['serverName'] = "Nome do Seu Servidor";
$config['server']['ip'] = "127.0.0.1";

 

Postado

Seria assim o correto?

 

$world = array(
    "id" => 0,
    "name" => $config['server']['serverName'] = "Rift";
    "externaladdress" => $config['server']['ip'] = "127.0.0.1";
    "externalport" => $port,
    "previewstate" => 0,
    "location" => "BRA",
    "anticheatprotection" => false
);
 

Estou junto com o Franco na config do OT, 

 

Valeu pela atenção, mesmo erro de client aqui

meu config ficou assim:

 

<?php
/**
 * Created by Notepad++.
 * User: Malucooo - Erick Nunes
 * Remaked of login.php by JLCVP and parts of login.php by Monteiro. Thanks for both!
 * Date: 18/09/17
 * Time: 03:01
 */

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
/*error example:
{
    "errorCode":3,
    "errorMessage":"Account name or password is not correct."
}*/

# 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 = true;
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()) {
            $char = array("worldid" => 0, "name" => $character->getName(), "ismale" => (($character->getSex() == 1) ? true : false), "tutorial" => 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) {
        $char = array("worldid" => 0, "name" => $character->getName(), "ismale" => (($character->getSex() == 1) ? true : false), "tutorial" => false);
        $characters[] = $char;
    }
    
    $lastLogin = $account->getLastLogin();
    $premiumAccount = ($account->isPremium()) ? true : false;
    $timePremium = time() + ($account->getPremDays() * 86400);
}
$session = array(
    "fpstracking" => false,
    "isreturner" => true,
    "returnernotification" => false,
    "showrewardnews" => false,
    "sessionkey" => $accountName . "\n" . $password,
    "lastlogintime" => $lastLogin,
    "ispremium" => $premiumAccount,
    "premiumuntil" => $timePremium,
    "status" => "active"    
);
$world = array(
    "id" => 0,
    "name" => $config['server']['serverName'] = "Rift";
    "externaladdress" => $config['server']['ip'] = "127.0.0.1";
    "externalport" => $port,
    "previewstate" => 0,
    "location" => "BRA",
    "anticheatprotection" => false
);

//Survey by: Cjaker
$survey = array(
    "id" => rand(0, 999999),
    "invitationtext" => "Querido tibiano, obrigado por usar OTX, a base mais atualizada do Tibia Global.\n'Mensagem dita por Cjaker'.",
    "invitationtoken" => "1751f1beddf001e1d36dee78ace974",
    "endtimestamp" => 1510614000
);

// https://limesurvey.cipsoft.com/index.php/survey/index/sid/527875/lang-en?token=1751f1beddf001e1d36dee78ace974
// token=invitationtoken
// o endtimestamp acima é o tempo convertido em unix timestamp, onde o mesmo é o prazo que irá acabar o survey!

$worlds = array($world);
$data["session"] = $session;
$playerData["worlds"] = $worlds;
$playerData["characters"] = $characters;
$data["playdata"] = $playerData;
$data["survey"] = $survey;

echo json_encode($data);
 

 

''

Fiz a alteração e ficou travado na tela de login, 

Please wait
Preparing game files. Please wait

 

Editado por keitar (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo