• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Tibia 7.7 Server Decompiled

@dajotsa @Gustinos Server crashed when running the version with the map refresh fix, so it did not include the new gold fix that seems to be available since 2 days ago so I will try the new release.

The error shows something about the depot 4. The person said a few minutes before the server crashed, he deposited some gold coins into the Edron depot. They said it didn't actually crash until they were on their way to the magic carpet, not sure if they actually used the magic carpet or they were just walking there or standing at the NPC so not sure if that was the actual cause or what happened.

Also:
It seems like when the server crashed and starting the game service again, everyone lost all progress since the last server save. Do I have an issue or is this expected? Is there a way to prevent this?

This could be related to a bug I fixed recently. But it could also be something else. The best thing is to have the server compiled with debug symbols (make -B DEBUG=1 will do it) and then get the backtrace of the crash with GDB. If you're using the service file from the repo, you should get a coredump when the application crashes. They're usually right next to the executable but it depends on your system's configuration. Here are a few commands to get a backtrace when you have a coredump file:
Code:
cd path/to/tibia/game
gdb bin/game bin/core
(gdb) thread apply all backtrace # print backtrace for all threads -- probably too verbose
(gdb) thread N                   # switch to thread that caused the crash -- it usually tells when you open GDB
(gdb) backtrace                  # print backtrace for the current thread
(gdb) exit                       # exit gdb

This backtrace alone should usually be enough to track the source of the bug, but it'll only work with the executable that generated the coredump so you'd need to do this before recompiling/replacing the server's executable.

The scope the server was initially tested was pretty small so I do expect bugs to show up. Crashes should be rare because the design of the original application is on the "safe" side, but the problem with them is that player/world data (up to a limit) is cached in memory and only flushed at server save. This means you end up losing any progress since the last "server save", but is more subtle because you may end up with a partial save where some of the players were saved earlier because they were evicted from the cache.

Anyway, I'd recommend only running a test server for the time being, and always doing backups on server save so you can always rollback to a consistent save in case of a crash.
 
I was struggling to get this working online. I changed a line in communication.cc and then changed the host table in the database to my WAN ip.
This made it work for me. I assume it should work with the regular line of code?
Adding my WAN to the host table in the database made the game server throw and error

LUA:
From;
ServerAddress.sin_addr.s_addr = inet_addr(GameAddress);

To;
ServerAddress.sin_addr.s_addr = INADDR_ANY;

Issue with non edited src when launching world server;
Code:
Tibia Game-Server (c) by CIP Productions, 2003. InitSignalHandler: 21 Signalhandler eingerichtet (Soll=28) Verwende verkleinerte Bibliotheks-Stacks. Starte Game-Server... Pid=213786, Tid=213786 - horche an Port 7172 LaunchServer: Fehler 99 bei bind. error.log: LaunchServer: Fehler 99 bei bind. Bind Error Again -> Begin FloodBind :(

Not sure if this is due to the fact ive been running them in Terminals and not as services?
I was struggling with the whole computer freezing and had to manually power cycle to restart it when I had them as services.
 
I was struggling to get this working online. I changed a line in communication.cc and then changed the host table in the database to my WAN ip.
This made it work for me. I assume it should work with the regular line of code?
Adding my WAN to the host table in the database made the game server throw and error

LUA:
From;
ServerAddress.sin_addr.s_addr = inet_addr(GameAddress);

To;
ServerAddress.sin_addr.s_addr = INADDR_ANY;

Issue with non edited src when launching world server;
Code:
Tibia Game-Server (c) by CIP Productions, 2003. InitSignalHandler: 21 Signalhandler eingerichtet (Soll=28) Verwende verkleinerte Bibliotheks-Stacks. Starte Game-Server... Pid=213786, Tid=213786 - horche an Port 7172 LaunchServer: Fehler 99 bei bind. error.log: LaunchServer: Fehler 99 bei bind. Bind Error Again -> Begin FloodBind :(

Not sure if this is due to the fact ive been running them in Terminals and not as services?
I was struggling with the whole computer freezing and had to manually power cycle to restart it when I had them as services.
I also had that problem, but it seems it doesn't happen to everyone (see Tibia 7.7 Server Decompiled (https://otland.net/threads/tibia-7-7-server-decompiled.296811/post-2786103)).
In my case, I run it dockerized. And doing that change it works just fine
 
The scope the server was initially tested was pretty small so I do expect bugs to show up. Crashes should be rare because the design of the original application is on the "safe" side, but the problem with them is that player/world data (up to a limit) is cached in memory and only flushed at server save. This means you end up losing any progress since the last "server save", but is more subtle because you may end up with a partial save where some of the players were saved earlier because they were evicted from the cache.

Anyway, I'd recommend only running a test server for the time being, and always doing backups on server save so you can always rollback to a consistent save in case of a crash.
I wonder why Cipsoft made it this way as it seems 'horrible' unless your server is just rock solid 'can never crash'. Sure when you have like like 500-600 people online at once and someone logs out and someone else logs in. The recently logged out players data might get flushed from the cache to make room for new player data (If I understand this correct).

But for using these files for more than just a test server id say a more robust and better save system is needed as a safety net to not lose progression, Just like we would have in a regular OT~
 
I wonder why Cipsoft made it this way as it seems 'horrible' unless your server is just rock solid 'can never crash'. Sure when you have like like 500-600 people online at once and someone logs out and someone else logs in. The recently logged out players data might get flushed from the cache to make room for new player data (If I understand this correct).

But for using these files for more than just a test server id say a more robust and better save system is needed as a safety net to not lose progression, Just like we would have in a regular OT~
Well actually the server is pretty stable and somehow if you do control+c it saves the progression although i havent had a single crash yet so dont know if it saves anything
 
Well actually the server is pretty stable and somehow if you do control+c it saves the progression although i havent had a single crash yet so dont know if it saves anything
Ive had it running a bit for solo sessions on my own PC with the server in terminals (Not services). Whenever I was done playing I just ctrl+c to terminate the game>login>query and it has saved just fine each time.

My worry is more now when running as a service 24/7 on a dedicated machine. It is still a 'test' but more as a "hopefully me and a few friends can play this and not worry about crashing" type of test haha.

Now im just looking into if I could possibly make a NPC sell premium. So people could get prem time ingame by paying gold.
 
Ive had it running a bit for solo sessions on my own PC with the server in terminals (Not services). Whenever I was done playing I just ctrl+c to terminate the game>login>query and it has saved just fine each time.

My worry is more now when running as a service 24/7 on a dedicated machine. It is still a 'test' but more as a "hopefully me and a few friends can play this and not worry about crashing" type of test haha.

Now im just looking into if I could possibly make a NPC sell premium. So people could get prem time ingame by paying gold.
Well if you compile it on debug mode and host as service would be good tho because we can get the gdb and fix it in case it crashes ofc even tfs or any other distro have crashes so i think you are good to go
 
Been running it for almost a week now with not that many people on at one time or at all.
But the server has never crashed and it server saves each day just fine.
Now the sad part is that the people I put it up for quit after just 1½ days lol
 
I just want to say thank you for all the work youve done, this project is really awesome, and ive been hacking my brains out working on the server, and modding it. Im stuck at getting something better than the tibia-web that comes with it, Ive tried all sorts of solutions for there doesnt seem to be any sort of concrete path to making myaac work. The postgres database route wouldnt work when i tried it multiple times. I tried using the 10 year old querymanager and login but eventually gave up and wanted something more secure. Im not a developer just a lover of tibia and i like to mod things, and eventually have a website for my server thats a bit more impressive than the one included. Everything on this forum uses mysql and myaac, and as a total noob to all this, i really wish that path was included with the tibia-web download. If someone could please figure this out, as ive been trying for a week, to get a good website and the game running at the same time.
I would be eternally grateful if someone could upload a tibia-web with normal mysql working.
 
I just want to say thank you for all the work youve done, this project is really awesome, and ive been hacking my brains out working on the server, and modding it. Im stuck at getting something better than the tibia-web that comes with it, Ive tried all sorts of solutions for there doesnt seem to be any sort of concrete path to making myaac work. The postgres database route wouldnt work when i tried it multiple times. I tried using the 10 year old querymanager and login but eventually gave up and wanted something more secure. Im not a developer just a lover of tibia and i like to mod things, and eventually have a website for my server thats a bit more impressive than the one included. Everything on this forum uses mysql and myaac, and as a total noob to all this, i really wish that path was included with the tibia-web download. If someone could please figure this out, as ive been trying for a week, to get a good website and the game running at the same time.
I would be eternally grateful if someone could upload a tibia-web with normal mysql working.
use google gemini or replit ai, and send him the actual tibia-web and send any layout that you want on it, give him a good promt on what you need
 
Last edited:
My solution to the problem is im trying to get the AI to write me a python script that will automatically sync mariadb to the sqlite db, and translate the needed tables and columns.
i modded myaac to work with the password type that the querymanager is expecting, now im just trying to get it to actually clone over the database to the sqlite file, which has worked in a few tests but has since stopped working. Close to a solution but not quite there yet.
 
Ive got success with myaac writing the correct type of password when creating an account.
Im able to login to the game with the account created from the myaac website.
Im still ironing out the sync. Ill share my work when its bug free. :)
 
Hey @fusion32 great work! I was trying to do that and was looking for something like this but it was way beyond my skills :)

You've inspired me - some time ago I was working on rewriting some of the leaked files things like query manager and login server in Rust, wrote some useful scripts as well- it is far from being complete and I'm no longer working on it but maybe it will be useful for someone. Will try to open source this as well and maybe someone will use it to build something.

Some time ago I've also dockerized the realots stuff so maybe could add Docker to your files as well

Cheers man, this is lit
 
I've modified the tibianic-dll to be able to connect to this (local) server (altered the RSA), I've made it possible to build this on linux as well


If you want something more lightweight - here is only WSAD modified for 7.72 client (also compilable on unix)


Both are for 7.72 because I've compiled tibia-game with 7.72 switch

Also here is a script (patch) for query manager (sqlite3) to add some characters from the original leaked files

This will create accounts 1,2,3 ... 12 (password tibia) with character levels ordered from highest to lowers

Enjoy!
 

Attachments

I've modified the tibianic-dll to be able to connect to this (local) server (altered the RSA), I've made it possible to build this on linux as well


If you want something more lightweight - here is only WSAD modified for 7.72 client (also compilable on unix)


Both are for 7.72 because I've compiled tibia-game with 7.72 switch

Also here is a script (patch) for query manager (sqlite3) to add some characters from the original leaked files

This will create accounts 1,2,3 ... 12 (password tibia) with character levels ordered from highest to lowers

Enjoy!
1768986900796.webp

When I visit https://github.com/michaldarda/tibia-wsad
 
I created a fork of this repo that I'll be keeping in sync with the OG :)


The changes I added are some configuration options added to .tibia like experience or skill rates, death penalty


I also plan to experiment with rewriting some parts of it in Rust.

I'm not an experienced C++ dev so this is mostly Vibe Coded.
 
I wonder why Cipsoft made it this way as it seems 'horrible' unless your server is just rock solid 'can never crash'. Sure when you have like like 500-600 people online at once and someone logs out and someone else logs in. The recently logged out players data might get flushed from the cache to make room for new player data (If I understand this correct).

But for using these files for more than just a test server id say a more robust and better save system is needed as a safety net to not lose progression, Just like we would have in a regular OT~
Because Cipsoft prioritize world consistency. They rather have everyone losing daily advancement from time to time instead of having golden helmets duped for the eternity.
 
Back
Top