What's new

Własny klient Tibia 11 bl?d klienta

saleen

New User
Joined
Mar 15, 2016
Messages
2
Reaction score
0
Witam,
Chcia?em ogarn?? sobie otsa do grania samemu na localhost.
Silnik OTX3.8 silnik dzia?a i pracuje jak mniemam bez zarzutu. EXE wrzuci?em skompilowanego TFS 1.2 Wszystko niby obs?uguje protok?? 11.47 czy tam 11.49 [w config.lua mam zaznaczone tak:]

PHP:
-- Version Manual
clientVersionMin = 1100
clientVersionMax = 1100
clientVersionStr = "Only clients with protocol 10 and 11 or allowed!"



Xaamp uruchomiony i skonfigurowany. Baza danych te?. Wszystko ustawione na localhost.
Stron? te? mam za?o?on? w xaampie i wrzucony MyACC maker. Wszystko jednak localhost, bo robie to sam dla siebie. Strona te? ma jakies drobne bugi, ale nad tym mog? popracowa? p??niej, tymi w grze r?wnie?.

Mam ?ci?gni?tego klienta tibii z takim opisem: 127.0.0.1-11.44.5516.exe uruchamia si? jako 11 i chyba nawet ustawiona jest na localhost, ale by? problem z uruchomieniem go: komunikat dotyczy? braku login.php , ?ci?gn??em wersje z MyACC 1.3, bo takowa jest z tym plikiem i wgra?em go jako plugin. Ok problem znikn?? jednak, gdy si? loguj? na moje dane w tym kliencie to po sekundzie klient si? zamyka. Zadnej informacji, ?adnego b??du. Mam go jako? konfigurowa?? Pr?bowa?em oficjaln? tibi? przez IP changera, ale logowanie nie przechodzi. Teraz pytanie czy mam ?ci?gn?? jak?? inn? wersj? klienta? czy gdzie? go skonfigurowa? w pliku?

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

require_once('common.php');
require 'config.php';
require 'config.local.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);

require_once(SYSTEM . 'functions.php');
require_once(SYSTEM . 'init.php');

/*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 = $config['lua']['gameProtocolPort'];

# check if player wanna see cast list
if (strtolower($accountName) == "cast")
	$isCasting = true;

if ($isCasting) {
	$casts = $db->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 OTS_Player();
		$character->load($cast['player_id']);
		
		if ($character->isLoaded()) {
			$char = array("worldid" => 0, "name" => $character->getName(), "ismale" => (($character->getSex() == 1) ? true : false), "tutorial" => true);
			$characters[] = $char;
		}
	}
	
	$port = 7173;
	$lastLogin = 0;

	$premiumAccount = true;
	$timePremium = 30 * 86400;
}
else {
	$account = new OTS_Account();
	$account->find($accountName);
	
	if (!$account->isLoaded())
		sendError("Failed to get account. Try again!");

	$config_salt_enabled = fieldExist('salt', 'accounts');
	$current_password = encrypt(($config_salt_enabled ? $account->getCustomField('salt') : '') . $password);
	if ($account->getPassword() != $current_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" => true);
		$characters[] = $char;
	}
	
	$save = false;
	$timeNow = time();

	$query = $db->query('SELECT `premdays`, `lastday` FROM `accounts` WHERE `id` = ' . $account->getId());
	if($query->rowCount() > 0) {
		$query = $query->fetch();
		$premDays = (int)$query['premdays'];
		$lastDay = (int)$query['lastday'];
		$lastLogin = $lastDay;
	}
	else {
		sendError("Error while fetching your account data. Please contact admin.");
	}
	
	if($premDays != 0 && $premDays != PHP_INT_MAX ) {
		if($lastDay == 0) {
			$lastDay = $timeNow;
			$save = true;
		} else {
			$days = (int)(($timeNow - $lastDay) / 86400);
			if($days > 0) {
				if($days >= $premDays) {
					$premDays = 0;
					$lastDay = 0;
				} else {
					$premDays -= $days;
					$remainder = (int)(($timeNow - $lastDay) % 86400);
					$lastDay = $timeNow - remainder;
				}

				$save = true;
			}
		}
	} else if ($lastDay != 0) {
		$lastDay = 0;
		$save = true;
	}

	if($save) {
		$db->query('UPDATE `accounts` SET `premdays` = ' . $premDays . ', `lastday` = ' . $lastDay . ' WHERE `id` = ' . $account->getId());
	}

	$premiumAccount = $premDays > 0;
	$timePremium = time() + ($premDays * 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['lua']['serverName'],
	"externaladdress" => $config['lua']['ip'],
	"externalport" => $port,
	"previewstate" => 0,
	"location" => "BRA",
	"anticheatprotection" => false,
	"externaladdressunprotected" => $config["lua"]["ip"],
	"externaladdressprotected" => $config["lua"]["ip"]
);

$worlds = array($world);

$data["session"] = $session;
$playerData["worlds"] = $worlds;
$playerData["characters"] = $characters;
$data["playdata"] = $playerData;

echo json_encode($data);
//echo '<pre>' . var_export($data, true) . '</pre>';

Skoro silnik dzia?a, acc maker te?, baza te? to mo?e by? problem w kliencie lub IP changerze? Najch?tniej bym si? logowa? przez custom clienta. Z allegro za 300 z? te? nie chc? kupowa? czego? pewnie jeszcze do poprawek...

G??wnie zale?y mi na tym ?eby to by? silnik i ACC maker, kt?ry chodzi na tibii minimum 11.46-48 . Chyba, ?e kto? potrafi?by zrobi? customowego klienta, kt?ry by na pewno chodzi? pod localhost 127.0.0.1, bo ten nie wiem czemu ga?nie nagle..

---------- Tre?? dodana o 10:45 ----------

Dotar?em do tego, ?e mam OTX 3.8 do protoko?u 11.00 , a klienta 11.47 i exe z tfs1.2, a niby obs?uguje tfs1.3 :/ dlatego chyba s? problemy z po??czeniem.. Mo?e mi kto? chocia? napisa? czego potrzebuj??
Wydaje mi si?, ?e musz? ?ci?gn?? serwer TFS1.3, do tego pliki z OTX3.9 i wtedy m?g?bym odpali? na tym kliencie z wersj? 11.47. Czy kto? to mo?e potwierdzi?? albo chocia?, kt?re wersje czego potrzebuj? ?eby odpali? tibie z protoko?em 11.47?
 
Top