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

Solved Tibia Client 11.x...

silveralol

Advanced OT User
Joined
Mar 16, 2010
Messages
1,480
Solutions
9
Reaction score
212
Hello folks, I'm not getting working tibia client 11 in my 4fun otserver
I'm using an old tfs 1.2 with some modifications without two factor authenticator support and the latest tibia client 11 also the ip changer made by Jo3Bingham, the site is znote acc with the support to tibia client 11
the only thing that I get working is the list from the account, it load my character list but don't enter in the game, my protocol of tfs is 10.99 and my server is in VPS
how I can start to find the issue and fix it ?
 
Last edited:
https://github.com/Znote/ZnoteAAC/blob/366542d249cc4138a57ba542f0b64660a5bcf737/config.php#L571

Try to change $_SERVER["SERVER_ADDR"] with your numberic game server IP inside quotes, like "123.123.123.123"

https://github.com/otland/forgottenserver/blob/master/src/definitions.h#L28
Make sure CLIENT_VERSION_MAX is 1101. (you need to edit and recompile if its not).
my ip is correct in the file config.lua, also I've compiled the source with the CLIENT_VERSION_MAX = 1101
and still the same, load the list of characters but don't enter in the game.
 
Does connecting to your game world work on a regular client 10.98 with ip changer?
 
yes. works fine when login in 10.98/99... only with the 11 don't login.
the two factor is needed to get working?
 
No, Two-factor authentication is not required to login.

Do you get any errors from index.php or login.php in your /var/log/apache2/error.log file?

Edit: Do you have any source edits related to world id?
 
Last edited:
No, Two-factor authentication is not required to login.

Do you get any errors from index.php or login.php in your /var/log/apache2/error.log file?

Edit: Do you have any source edits related to world id?
:eek::eek::eek::eek::eek: find something:
Code:
[Tue Dec 06 12:18:47.710851 2016] [:error] [pid 1059] [client 180.76.15.163:50802] PHP Notice:  Undefined index: 149.56.98.79 in /var/www/html/config.php on line 502
and anothers errors no releates to login.php or config.php
I don't have any edit to world id, I don't edit anything of login system, just fix the issue of premium days left in the ctrl + g ...
 
What is in your config.php at line 502?

If its gameserver ip, write "149.56.98.79" (with the quote " symbol), not just 149.56.98.79
 
Should be like this:

Code:
'ip' =>"149.56.98.79",

Also with the comma symbol at the end.
 
now it is like this
Code:
'ip' => "149.56.98.79", // Can be an ip string like '123.123.123.123'
but now get the message "account name or password is not correct",
edit: get the message again same by creating an account in the znote acc :(:mad:
 
Your running a semi outdated version of TFS 1.2?

In protocolgame.cpp

Replace the entire function
Code:
void ProtocolGame::onRecvFirstMessage(NetworkMessage& msg)


With this:
https://github.com/otland/forgotten...4e4f2a37257f3e/src/protocolgame.cpp#L237-L335
Code:
void ProtocolGame::onRecvFirstMessage(NetworkMessage& msg)
{
if (g_game.getGameState() == GAME_STATE_SHUTDOWN) {
disconnect();
return;
}
OperatingSystem_t operatingSystem = static_cast<OperatingSystem_t>(msg.get<uint16_t>());
version = msg.get<uint16_t>();
msg.skipBytes(7); // U32 client version, U8 client type, U16 dat revision
if (!Protocol::RSA_decrypt(msg)) {
disconnect();
return;
}
uint32_t key[4];
key[0] = msg.get<uint32_t>();
key[1] = msg.get<uint32_t>();
key[2] = msg.get<uint32_t>();
key[3] = msg.get<uint32_t>();
enableXTEAEncryption();
setXTEAKey(key);
if (operatingSystem >= CLIENTOS_OTCLIENT_LINUX) {
NetworkMessage opcodeMessage;
opcodeMessage.addByte(0x32);
opcodeMessage.addByte(0x00);
opcodeMessage.add<uint16_t>(0x00);
writeToOutputBuffer(opcodeMessage);
}
msg.skipBytes(1); // gamemaster flag
std::string sessionKey = msg.getString();
auto sessionArgs = explodeString(sessionKey, "\n", 4);
if (sessionArgs.size() != 4) {
disconnect();
return;
}
std::string& accountName = sessionArgs[0];
std::string& password = sessionArgs[1];
std::string& token = sessionArgs[2];
uint32_t tokenTime = strtoul(sessionArgs[3].c_str(), NULL, 10);
if (accountName.empty()) {
disconnectClient("You must enter your account name.");
return;
}
std::string characterName = msg.getString();
uint32_t timeStamp = msg.get<uint32_t>();
uint8_t randNumber = msg.getByte();
if (challengeTimestamp != timeStamp || challengeRandom != randNumber) {
disconnect();
return;
}
if (version < CLIENT_VERSION_MIN || version > CLIENT_VERSION_MAX) {
std::ostringstream ss;
ss << "Only clients with protocol " << CLIENT_VERSION_STR << " allowed!";
disconnectClient(ss.str());
return;
}
if (g_game.getGameState() == GAME_STATE_STARTUP) {
disconnectClient("Gameworld is starting up. Please wait.");
return;
}
if (g_game.getGameState() == GAME_STATE_MAINTAIN) {
disconnectClient("Gameworld is under maintenance. Please re-connect in a while.");
return;
}
BanInfo banInfo;
if (IOBan::isIpBanned(getIP(), banInfo)) {
if (banInfo.reason.empty()) {
banInfo.reason = "(none)";
}
std::ostringstream ss;
ss << "Your IP has been banned until " << formatDateShort(banInfo.expiresAt) << " by " << banInfo.bannedBy << ".\n\nReason specified:\n" << banInfo.reason;
disconnectClient(ss.str());
return;
}
uint32_t accountId = IOLoginData::gameworldAuthentication(accountName, password, characterName, token, tokenTime);
if (accountId == 0) {
disconnectClient("Account name or password is not correct.");
return;
}
g_dispatcher.addTask(createTask(std::bind(&ProtocolGame::login, getThis(), characterName, accountId, operatingSystem)));
}

And recompile.
 
Last edited:
Your running a semi outdated version of TFS 1.2?

In protocolgame.cpp

Replace the entire function
Code:
void ProtocolGame::onRecvFirstMessage(NetworkMessage& msg)


With this:
https://github.com/otland/forgotten...4e4f2a37257f3e/src/protocolgame.cpp#L237-L335
Code:
void ProtocolGame::onRecvFirstMessage(NetworkMessage& msg)
{
if (g_game.getGameState() == GAME_STATE_SHUTDOWN) {
disconnect();
return;
}
OperatingSystem_t operatingSystem = static_cast<OperatingSystem_t>(msg.get<uint16_t>());
version = msg.get<uint16_t>();
msg.skipBytes(7); // U32 client version, U8 client type, U16 dat revision
if (!Protocol::RSA_decrypt(msg)) {
disconnect();
return;
}
uint32_t key[4];
key[0] = msg.get<uint32_t>();
key[1] = msg.get<uint32_t>();
key[2] = msg.get<uint32_t>();
key[3] = msg.get<uint32_t>();
enableXTEAEncryption();
setXTEAKey(key);
if (operatingSystem >= CLIENTOS_OTCLIENT_LINUX) {
NetworkMessage opcodeMessage;
opcodeMessage.addByte(0x32);
opcodeMessage.addByte(0x00);
opcodeMessage.add<uint16_t>(0x00);
writeToOutputBuffer(opcodeMessage);
}
msg.skipBytes(1); // gamemaster flag
std::string sessionKey = msg.getString();
auto sessionArgs = explodeString(sessionKey, "\n", 4);
if (sessionArgs.size() != 4) {
disconnect();
return;
}
std::string& accountName = sessionArgs[0];
std::string& password = sessionArgs[1];
std::string& token = sessionArgs[2];
uint32_t tokenTime = strtoul(sessionArgs[3].c_str(), NULL, 10);
if (accountName.empty()) {
disconnectClient("You must enter your account name.");
return;
}
std::string characterName = msg.getString();
uint32_t timeStamp = msg.get<uint32_t>();
uint8_t randNumber = msg.getByte();
if (challengeTimestamp != timeStamp || challengeRandom != randNumber) {
disconnect();
return;
}
if (version < CLIENT_VERSION_MIN || version > CLIENT_VERSION_MAX) {
std::ostringstream ss;
ss << "Only clients with protocol " << CLIENT_VERSION_STR << " allowed!";
disconnectClient(ss.str());
return;
}
if (g_game.getGameState() == GAME_STATE_STARTUP) {
disconnectClient("Gameworld is starting up. Please wait.");
return;
}
if (g_game.getGameState() == GAME_STATE_MAINTAIN) {
disconnectClient("Gameworld is under maintenance. Please re-connect in a while.");
return;
}
BanInfo banInfo;
if (IOBan::isIpBanned(getIP(), banInfo)) {
if (banInfo.reason.empty()) {
banInfo.reason = "(none)";
}
std::ostringstream ss;
ss << "Your IP has been banned until " << formatDateShort(banInfo.expiresAt) << " by " << banInfo.bannedBy << ".\n\nReason specified:\n" << banInfo.reason;
disconnectClient(ss.str());
return;
}
uint32_t accountId = IOLoginData::gameworldAuthentication(accountName, password, characterName, token, tokenTime);
if (accountId == 0) {
disconnectClient("Account name or password is not correct.");
return;
}
g_dispatcher.addTask(createTask(std::bind(&ProtocolGame::login, getThis(), characterName, accountId, operatingSystem)));
}

And recompile.
now get errors of the iologindata, not match function, seems that my tfs don't have the function or are with wrong parameters
Code:
/home/adriano/otserver/src/protocolgame.cpp:348:114: error: no matching function for call to ‘IOLoginData::gameworldAuthentication(std::string&, std::string&, std::string&, std::string&, uint32_t&)’
  uint32_t accountId = IOLoginData::gameworldAuthentication(accountName, password, characterName, token, tokenTime);
                                                                                                                  ^
/home/adriano/otserver/src/protocolgame.cpp:348:114: note: candidate is:
In file included from /home/adriano/otserver/src/protocolgame.cpp:32:0:
/home/adriano/otserver/src/iologindata.h:36:19: note: static uint32_t IOLoginData::gameworldAuthentication(const string&, const string&, std::string&)
   static uint32_t gameworldAuthentication(const std::string& accountName, const std::string& password, std::string& characterName);
                   ^
/home/adriano/otserver/src/iologindata.h:36:19: note:   candidate expects 3 arguments, 5 provided
edit: I edit some functions to fix this error while compile.
edit 2: now I get this codes
https://github.com/otland/forgottenserver/commit/35691289b2b75c2983c19bf24906c6d723867485
then compiling it :D:D
 
Last edited:
Ahh yeah, you may need that as well. To alter the table to get the secret column (so you don't need to reimport schema.sql):
Code:
ALTER TABLE `players` ADD `secret` char(16) DEFAULT NULL;
Should work.
 
what to use it if it does not have under the TFS versions. You have 11+ engines to help to the editor
 
what to use it if it does not have under the TFS versions. You have 11+ engines to help to the editor
my source is old because I'm bored to copy all features and all fixes
such as:
  • reward chest
  • equip hotkey
  • passive monsters
  • store 10.97 working
  • removed time to walk throght players in pz
  • fly system
  • function onSpawn()
  • clean protection zones
  • function creature:moveTo()
  • store inbox
  • gold pounch (pagination)
  • blessing adventurer
  • orange skull system
  • window skulls
:oops:
 
Last edited:
Happy to help. :)

If you get disconnected on client 11 by holding in CTRL + any arrow keys for a couple seconds, then you need to increase maxPacketsPerSecond.
https://github.com/otland/forgottenserver/blob/master/config.lua#L30

All the way up to 250-300. Client 11 sends much more packets to the server than the old one.
yes I see that, solve by increasing the max packets ...
but now that I update the tibia client to the latest with the today's update now the client crash when try login, now is not a problem with source or the web service :/
 
Back
Top