• 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

I've been trying to run this on Docker.
Any contribution/improvement is welcome.

This is the Dockerfile I created to run the query manager on a container:

Code:
# Multi-stage Dockerfile for Tibia Query Manager

# Builder stage
FROM debian:bookworm-slim AS build
RUN apt-get update \
    && apt-get install -y --no-install-recommends build-essential make \
    && rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY . .
RUN make -j"$(nproc)"

# Runtime stage
FROM debian:bookworm-slim AS runtime
RUN apt-get update \
    && apt-get install -y --no-install-recommends sqlite3 \
    && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy binary and runtime assets
COPY --from=build /src/build/querymanager /app/querymanager
COPY config.cfg /app/config.cfg
COPY sql /app/sql
EXPOSE 7173
# Config file is read from current working directory
CMD ["./querymanager"]

First I created a network on Docker: docker network create tibia-net
Then build command: docker build -t tibia-querymanager .
And run comand: docker run -d --name tibia-querymanager --network tibia-net -p 7173:7173 -v tibiaqm-data:/app tibia-querymanager

1755728775933.webp

As described on the init.sql file, if you want to run the initial seed script, on the container terminal you just run: sqlite3 -echo tibia.db < sql/init.sql



And this is where I am with the login server:

Code:
# syntax=docker/dockerfile:1

# Tibia 7.7 Login Server - Containerized

ARG DEBIAN_FRONTEND=noninteractive

FROM debian:bookworm AS builder
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        build-essential make ca-certificates pkg-config libssl-dev && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /src
COPY . .

# Build the project (release by default)
RUN make

# Runtime image
FROM debian:bookworm-slim
RUN apt-get update && \
    apt-get install -y --no-install-recommends libssl3 ca-certificates && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy runtime artifacts
COPY --from=builder /src/build/login /app/login
COPY config.cfg tibia.pem /app/

# Expose the login port
EXPOSE 7171/tcp

ENTRYPOINT ["./login"]

You'll need to update config.cfg, so that QueryManagerHost = "tibia-querymanager"
Then build command: docker build -t tibia-login .
And run comand: docker run -d --name tibia-login --network tibia-net -p 7171:7171 tibia-login

1755729344830.webp

Now when I try to login using 111111/tibia:

1755729500836.webp
1755729574157.webp

I'm still finding my way to run the game server.
As I said, any help is welcome :)
 
@fusion32 You have done an incredible contribution showing your knowledge in engineering and OTS! I am reading your GitHub readme where you speak that people are gate-keeping its open tibia resources & etc that I will not quote. However, look how you are leading by example. You have a fork of 7.4, people are sharing its ideas how to dockerize the backends. Good job you all & I am super happy seeing such threads!
 
Almost there I guess...
But still struggling to connect to the querymanager.

1755807057393.webp
 
Almost there I guess...
But still struggling to connect to the querymanager.

View attachment 94410
I've also been able to create Docker for login, query and webb, but still issues with the game. Getting the same results as this. I've been trying for the last couple of days without any success. There is something missing that I don't know what.
 
@fusion32 helped me with that solution:

Looking at the config file for the query manager, that default "nXE?/>j`" password translates to "a6glaf0c" which is the default password on config.cfg. The actual problem is that I moved any initial data from sql/schema.sql into sql/init.sql and the query manager will reject connections if it can't find the server by name. The solution is to run sqlite3 tibia.db &lt; sql/init.sql to insert at least the server config into the database.
 
Is anyone working on a map editor for Cipsoft files?
 
@elao @iNux
I'm not entirely sure how docker manages networking. The thing is, traffic with the query manager is NOT encrypted at all, so I chose to make it bind to the loopback interface, meaning it will only accept local connections (see src/connection.cc:56). I'd suppose there is some mechanism for different containers to communicate through the loopback interface, or else a regular mysql container with remote only connections wouldn't work either. You could technically bind to INADDR_ANY but you'd need to configure the firewall to block all external traffic to it, so it's probably not the best solution.

Just as a sidenote, I didn't modify how the game server talks to the query manager, and the leaked config file would make it connect through "127.0.0.1" so this is supposedly the way it was designed. But I think it was only a bridge to a remote database server. The difference here is that I made it hold an sqlite3 database to simplify single world setups.

@Morrison
The server should be up for a few more weeks, although either nobody was really interested in testing it or couldn't make the client connect to it. Either way, I just checked it and it's still up and running but it doesn't use any default RSA key so you'd need to change it to be able to login. The key itself is listed on the website (the number with 309 digits).
 
I was able to get connected and played for a bit of nostalgia. I've been flirting with setting up an old 7.7 server for nostalgia sake for a long time but wanted a real decomp and the gate kept stuff you mentioned kept me away. Thanks for releasing this, looks super promising.
 
Really impressive 😮😇👍.

How can we edit the map?

.sec map editor were already published in the RealOTS distro. This whole distro/tools should be more well organized by someone for example, maybe in your readme @fusion32
 
.sec map editor were already published in the RealOTS distro. This whole distro/tools should be more well organized by someone for example, maybe in your readme @fusion32
You can only see the map not edit it with this rme, and there are not sources code from this one so basically we dont have map editor yet
 
Actually you can edit (map only. no monsters, no actions). You just need to make sure you select .sec format when saving too.
But it's very old and has lots of bugs. And not having the source code makes it difficult to fix things.
 
.sec map editor were already published in the RealOTS distro. This whole distro/tools should be more well organized by someone for example, maybe in your readme @fusion32
This map editor is for previews only.
 
You can only see the map not edit it with this rme, and there are not sources code from this one so basically we dont have map editor yet

Yes you can edit, also export it, i have done quets in cip files, small changes, using this rme, the only bug i have found, when u save it, it dont break the lines, in signs, street signs...
 
map converter, .otbm to json, json to .sec, but before you need to convert the otbm to client id, i did this test with nostalrius map since it uses client id it did work perfectly ( converted nostalrius 7.1 based map)
 

Attachments

I might be able to patch some map editor to load/save these types of files but it would have to be later this year. It's also not as straightforward because map data is persistent, and any changes to the original map (ORIGMAP) are not automatically transfered. It would need to collect deltas and export additional patch files that are loaded at startup, and that loader remains untested.
 
Back
Top