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

Compiling changes for 10.80

Scrappy Coco

Member
Joined
Dec 27, 2014
Messages
95
Reaction score
17
Is tedious wait update TFS servers for that reason I make this thread.
I would like to learn how to update my server by editing the source code .
NO LOOKING GIVE ME CODES .

Just I wanted to tell me where there need to modify the code and thank you.


MyHOkso.png
 
Premium time, in the character list packet, has been changed from an unsigned short (uint16_t) to a 1 byte (uint8_t) boolean indicating whether you have premium or not, followed by a 4 byte (uint32_t) timestamp (in seconds since epoch) of when your premium expires.

If you want the client to display free premium it's as easy as:
Code:
msg.addByte(0x01); // Has to be 1 (isPremium flag)
msg.add<uint32_t>(0); // Has to be less than the current time since epoch (in seconds), so it's just safe to use 0 here

@Jo3Bingham, you have any idea how to show real premium days?
Thank you.
 
I've used this:
protocollogin.cpp
Replace this:
Code:
    if (g_config.getBoolean(ConfigManager::FREE_PREMIUM)) {
        output->add<uint16_t>(0xFFFF); //client displays free premium
    } else {
        output->add<uint16_t>(account.premiumDays);
..With this:
Code:
    if (version >= 1080) {
        output->addByte(g_config.getBoolean(ConfigManager::FREE_PREMIUM) || account.premiumDays > 0);
        output->add<uint32_t>(g_config.getBoolean(ConfigManager::FREE_PREMIUM) ? 0 : (time(nullptr) + (account.premiumDays * 86400)));
    }
    else {
        output->add<uint16_t>(g_config.getBoolean(ConfigManager::FREE_PREMIUM) ? 0xFFFF : account.premiumDays);
protocolgame.cpp
Below:
Code:
// can report bugs?
msg.addByte(0x01);

msg.addByte(0x00); // can change pvp framing option
msg.addByte(0x00); // expert mode button enabled
..Add This:
Code:
msg.addString("http://static.tibia.com/images/store/");
msg.addByte(g_config.getNumber(ConfigManager::MAX_PACKETS_PER_SECOND));
definitions.h
Replace this:
Code:
#define CLIENT_VERSION_MIN 1076
#define CLIENT_VERSION_MAX 1077
#define CLIENT_VERSION_STR "10.77"
..With this:
Code:
#define CLIENT_VERSION_MIN 1080
#define CLIENT_VERSION_MAX 1080
#define CLIENT_VERSION_STR "10.80"
And it is working.
Write if i missed anything, but i can login without debugs.
Thank you all for your contribution.
 
For those interested, since gs1994 didn't share, 10.82 is just a simple byte in the character list packet before the isPremium flag that I outlined in my previous post. The byte is for "Account Status" that you see below your character list; 0 = normal (free/premium), 1 = frozen, 2 = suspended. Anything above 2 is considered as 'suspended'. Passing 1 or higher won't do anything to the client other than display that the account is frozen/suspended, but the client will still connect to the game server unless you implement something against it.
 
For those interested, since gs1994 didn't share, 10.82 is just a simple byte in the character list packet before the isPremium flag that I outlined in my previous post. The byte is for "Account Status" that you see below your character list; 0 = normal (free/premium), 1 = frozen, 2 = suspended. Anything above 2 is considered as 'suspended'. Passing 1 or higher won't do anything to the client other than display that the account is frozen/suspended, but the client will still connect to the game server unless you implement something against it.
Perfect, can you take a look in private?

#EDITED:

Worked for me.
 
Last edited:
For those interested, since gs1994 didn't share, 10.82 is just a simple byte in the character list packet before the isPremium flag that I outlined in my previous post. The byte is for "Account Status" that you see below your character list; 0 = normal (free/premium), 1 = frozen, 2 = suspended. Anything above 2 is considered as 'suspended'. Passing 1 or higher won't do anything to the client other than display that the account is frozen/suspended, but the client will still connect to the game server unless you implement something against it.

Help changes for 10.82
:)
 
Help
TFS 1.0
;)
For TFS 1.0:
Code:
if (version >= 1080) {
    if (version >= 1082)
        output->AddByte(0);
    output->AddByte(g_config.getBoolean(ConfigManager::FREE_PREMIUM) || account.premiumDays > 0);
    output->add<uint32_t>(g_config.getBoolean(ConfigManager::FREE_PREMIUM) ? 0 : (time(nullptr) + (account.premiumDays * 86400)));
} else {
    output->add<uint16_t>(g_config.getBoolean(ConfigManager::FREE_PREMIUM) ? 0xFFFF : account.premiumDays);
}
 
For TFS 1.0:
Code:
if (version >= 1080) {
    if (version >= 1082)
        output->AddByte(0);
    output->AddByte(g_config.getBoolean(ConfigManager::FREE_PREMIUM) || account.premiumDays > 0);
    output->add<uint32_t>(g_config.getBoolean(ConfigManager::FREE_PREMIUM) ? 0 : (time(nullptr) + (account.premiumDays * 86400)));
} else {
    output->add<uint16_t>(g_config.getBoolean(ConfigManager::FREE_PREMIUM) ? 0xFFFF : account.premiumDays);
}

Thanks!
 
Last edited:
Since no one else has gotten it right, I guess I'll point it out.

In sendAddCreature() there are two things needed for 10.80 support; a string and a byte. Everyone got the string correct, it's just a directory to images used in the Store. But note that it doesn't have to be CipSoft's link, you can use your own, but you'll have to figure out how it works on your own. The second is a byte, again everyone got the byte correct, but why do I keep seeing people use MAX_PACKETS_PER_SECOND? It's the increment of Tibia Coins players can transfer. So, if you set it to 25 (which just so happens to be the default value of MAX_PACKETS_PER_SECOND, and the value CipSoft uses), open the Store, and go to transfer coins, you'll see that you can transfer increments of 25 coins. Set it to 3, repeat above, and you can transfer coins in increments of 3.
 
Since no one else has gotten it right, I guess I'll point it out.

In sendAddCreature() there are two things needed for 10.80 support; a string and a byte. Everyone got the string correct, it's just a directory to images used in the Store. But note that it doesn't have to be CipSoft's link, you can use your own, but you'll have to figure out how it works on your own. The second is a byte, again everyone got the byte correct, but why do I keep seeing people use MAX_PACKETS_PER_SECOND? It's the increment of Tibia Coins players can transfer. So, if you set it to 25 (which just so happens to be the default value of MAX_PACKETS_PER_SECOND, and the value CipSoft uses), open the Store, and go to transfer coins, you'll see that you can transfer increments of 25 coins. Set it to 3, repeat above, and you can transfer coins in increments of 3.

I keep seeing people use MAX_PACKETS_PER_SECOND?

Ahahaha.
I'm trying to imagine your reaction seeing that:

colin_farrel_digusted_gif.gif


I mean its a legitimate INT.. its working for 'em ahaha!

Ghetto_246864_2437684.jpg
 
Code:
if (version >= 1080) {
        if (version >= 1082)
        output->AddByte(0);
         output->AddByte((g_config.getBoolean(ConfigManager::FREE_PREMIUM)) ? 0x01 : 0x00);
        auto time = std::chrono::system_clock::now() + std::chrono::hours(account.premiumDays * 24);
         std::chrono::seconds timestamp = std::chrono::duration_cast<std::chrono::seconds>(time.time_since_epoch());
         output->add<uint32_t>(g_config.getBoolean(ConfigManager::FREE_PREMIUM) ? 0 : timestamp.count());
     } else {
            output->add<uint16_t>(g_config.getBoolean(ConfigManager::FREE_PREMIUM) ? 0xFFFF : account.premiumDays);
        }

what about?
 
Tried all of the things above and I seem unable to get 10.82/10.90 to start up as intended.

Is there anything other than definitions, protocolgame.cpp and protocollogin.cpp edits listed above that needs to be done? Thankful for info!
 
Back
Top