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

is it possible to make otclient on web browser?

This is huge in combination with the modular version!
I've tried:
Code:
https://webclient.otarchive.com/?gameData=https://downloads.ots.me/data/tibia-clients/dat_and_spr/860.zip
but it does nothing (asks for Update). It looks like normal OTC - my ots.me host is 2$/month web host in ovh.com - I cannot control Access-Control-Allow-Origin of webserver.
OVH often sends me an e-mail about too-high-cpu-usage when new OTS starts, as it goes up to 1kk 'outfit images per day' (outfit-images.ots.me).

I've moved my files to secondary host (Oracle free host, all clients 7.1- 10.99 available) and configured Access-Control-Allow-Origin ex.:
Code:
https://downloads-oracle.ots.me/data/tibia-clients/dat_and_spr/860.zip
but it still does not load client:
https://webclient.otarchive.com/?gameData=https://downloads-oracle.ots.me/data/tibia-clients/dat_and_spr/860.zip
It looks like it expects whole OTC Mehah data, modules and init.lua, but my host only delivers data/things/XXX/ (Tibia.spr and Tibia.dat).
 
It looks like it expects whole OTC Mehah data, modules and init.lua, but my host only delivers data/things/XXX/ (Tibia.spr and Tibia.dat).
Indeed, currently all the files are needed besides the compiled client. It should warn you that these files are missing, but it seems that it's only showing in the local zip option.
 
Last edited:
Indeed, currently all the files are needed besides the compiled client.
I've asked about WebSocket's server, because I wanted to add your client to my test server OTS 8.6 (all www/ots/websocket hosted on my VPS):
It's 8.6 server, with in-game (ProtocolLogin) login and 8.6 sprites/dat.
Code:
IP: arm.skalski.pro
Port: 7171
Login: ppp
Password: ppp

If I want to use your client hosting (webclient.otarchive.com), I should prepare OTC Mehah files in .zip (init.lua etc.) and paste their URL as gameData to https://webclient.otarchive.com/?gameData= ?

And if I want to create own client host with client files (www) and WebSocket I should follow Guia ‐ OTClient Redemption Web (https://github.com/OTArchive/otclient-web/wiki/Guia-%E2%80%90-OTClient-Redemption-Web#readme-top) ?
 
Last edited:
Is it possible to download .zip and unpack it - and CACHE it - in web browser?
I can also host all these .zips as unpacked .spr and .dat files, but is it possible to cache it in web browser or it's too big?
Yes and no. Proper headers and the browser will cache as much as possible (depends on the browser and settings) but it is not the same as downloading the files onto your disk directly. This cache is not permanent and it can lead to forced redownload more often than it should. This can be big hit for people with limited connection speed or data (from what I know, a lot of people in Brazil have such limitations). It would be better to let the players download files directly and then use FileReader API to read their local data.zip (they have to manually point to the data.zip each time tho). But then what's the point of using web client other than cross-platform compatibility.
 
I've asked about WebSocket's server, because I wanted to add your client to my test server OTS 8.6 (all www/ots/websocket hosted on my VPS):
It's 8.6 server, with in-game (ProtocolLogin) login and 8.6 sprites/dat.
Code:
IP: arm.skalski.pro
Port: 7171
Login: ppp
Port: ppp

If I want to use your client hosting (webclient.otarchive.com), I should prepare OTC Mehah files in .zip (init.lua etc.) and paste their URL as gameData to https://webclient.otarchive.com/?gameData= ?

And if I want to create own client host with client files (www) and WebSocket I should follow Guia ‐ OTClient Redemption Web (https://github.com/OTArchive/otclient-web/wiki/Guia-%E2%80%90-OTClient-Redemption-Web#readme-top) ?
Exactly!
I've not tested this version with the web client so there are no examples in the guide. If you have doubts or issues please let me know.
Post automatically merged:

Yes and no. Proper headers and the browser will cache as much as possible (depends on the browser and settings) but it is not the same as downloading the files onto your disk directly. This cache is not permanent and it can lead to forced redownload more often than it should. This can be big hit for people with limited connection speed or data (from what I know, a lot of people in Brazil have such limitations). It would be better to let the players download files directly and then use FileReader API to read their local data.zip (they have to manually point to the data.zip each time tho). But then what's the point of using web client other than cross-platform compatibility.
Besides browser cache, Emscripten uses IndexedDB to keep track of files and avoid redownloads. The modular version also taps into this, installing the game files into the DB and avoiding redownloads if the link is the same. This is very customizable and combined with the browser cache is not an issue.
 
Last edited:
Besides browser cache, Emscripten uses IndexedDB to keep track of files and avoid redownloads. The modular version also taps into this, installing the game files into the DB and avoiding redownloads if the link is the same. This is very customizable and combined with the browse cache is not an issue.
Oh shit, that's new to me, Web API is expanding fast.
 
Yes and no. Proper headers and the browser will cache as much as possible (depends on the browser and settings) but it is not the same as downloading the files onto your disk directly. This cache is not permanent and it can lead to forced redownload more often than it should. This can be big hit for people with limited connection speed or data (from what I know, a lot of people in Brazil have such limitations). It would be better to let the players download files directly and then use FileReader API to read their local data.zip (they have to manually point to the data.zip each time tho). But then what's the point of using web client other than cross-platform compatibility.
There are no internet limitations in Brazil. The basic plan starts at 300-500 Mbps costing U$18.

According to SpeedTest upload speed in Brazil are 161% higher than in the USA, and latency is 116% lower.
 
There are no internet limitations in Brazil. The basic plan starts at 300-500 Mbps costing U$18.

According to SpeedTest upload speed in Brazil are 161% higher than in the USA, and latency is 116% lower.
Huh... I had people complaining that they had to download client few times during beta launch (updater was poorly configured :x), due to daily limits or something, eh.
 
Huh... I had people complaining that they had to download client few times during beta launch (updater was poorly configured :x), due to daily limits or something, eh.
99% of residential internet plans have unlimited traffic, but I realize that there are some limitations in these update systems, whether via DLL or OTCv8. As if the host had a QoS. Using OVH I cannot download update at maximum speed (62Mb/s)
 
I'm currently testing connecting to a 8.6 server and there's a bit of work to be done. I will let you know when it's ready.
Nice. @ me, when you post new version for old protocols.

I've tried to setup proxy server for my 8.6 OTS, but it shows error in Chrome scripts console when I click Login:
Code:
WARNING: luaCallLuaField(onConnect) is being called outside the context of the lua call.
I made OTArchive/otclient .zip with 8.60 'things':
https://webclient.otarchive.com/?gameData=https://downloads-oracle.ots.me/data/MehahWeb860/otclient-otarchive.zip

Setup domain web.skalski.pro (SSL) with nginx config passing requests to websockify, that passes them to arm.skalski.pro:7172 (my OTS) and login like this:
1728226674405.webp
Code:
ppp
ppp
web.skalski.pro
860
7171
It created connection on nginx, websockify and OTS VPS to port 7172 (port from websockify config), but it failed to login (Lua error posted above).
 
Last edited:
Nice. @ me, when you post new version for old protocols.
@Gesior.pl I've added support for older protocols.
You will need to run 2 instances of websockify, one for 7171 and another for 7172.

The modular version will use any port you inform to login, but to connect to the world it will use 443, no matter what the server informs. I'm yet to test this setup behind nginx, but will update the guide if I do so.
 
Last edited:
@Gesior.pl setting up a 8.6 server with tfs 0.4 seems more challenging. After login the server will send the IP address instead of the domain, so we will have SSL issues. Not sure if I should change the client to force the use of the same address used to login or some other approach.
Post automatically merged:

Ok, so I've decided to add extra fields to the login form, asking for the address and port of the game world. This way I don't need to enforce the world port on the client and we won't have to adapt server code to send the correct stuff.
 
Last edited:
I setup nginx+websockify like this:
444 -> 7171
443 -> 7172

In client set port to login to 444 and in modules/client_entergame/characterlist.lua forced it to use proxy address "web.skalski.pro":
LUA:
    g_game.loginWorld(G.account, G.password, charInfo.worldName, "web.skalski.pro", charInfo.worldPort,
                      charInfo.characterName, G.authenticatorToken, G.sessionKey)

I've updated my client files on host, you can use this URL to start client that logins to arm.skalski.pro ThaisWar with bots 8.6 OTS:
Code:
https://webclient.otarchive.com/?gameData=https://downloads-oracle.ots.me/data/MehahWeb860/otclient-otarchive.zip
Login/password: ppp/ppp (many people use this and kick other players from this account characters)
You can create own account: Createaccount - Forgotten (https://arm.skalski.pro/?subtopic=createaccount)

It would be much easier to use with WS, not WSS. You could use IP, not domain and it would not require generating SSL certificates.
I use nginx proxy to offload SSL now. After changing to WS, I could use just websockify.
Tibia protocol itself is encrypted with XTEA, packets containing user login/password are encrypted using RSA.


1728319946335.webp

1728319995639.webp



nginx config:
Code:
server {
        server_name web.skalski.pro;
        location / {
          proxy_pass http://localhost:7172;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header Host $host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

          # WebSocket support
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "upgrade";
  }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/web.skalski.pro/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/web.skalski.pro/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
        server_name web.skalski.pro;
        location / {
          proxy_pass http://localhost:7171;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header Host $host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

          # WebSocket support
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "upgrade";
  }

    listen [::]:444 ssl ipv6only=on; # managed by Certbot
    listen 444 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/web.skalski.pro/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/web.skalski.pro/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
 
Last edited:
I setup nginx+websockify like this:
444 -> 7171
443 -> 7172

In client set port to login to 444 and in modules/client_entergame/characterlist.lua forced it to use proxy address "web.skalski.pro":
LUA:
    g_game.loginWorld(G.account, G.password, charInfo.worldName, "web.skalski.pro", charInfo.worldPort,
                      charInfo.characterName, G.authenticatorToken, G.sessionKey)

I've updated my client files on host, you can use this URL to start client that logins to arm.skalski.pro ThaisWar with bots 8.6 OTS:
Code:
https://webclient.otarchive.com/?gameData=https://downloads-oracle.ots.me/data/MehahWeb860/otclient-otarchive.zip
Login/password: ppp/ppp

It would be much easier to use with WS, not WSS. You could use IP, not domain and it would not require generating SSL certificates.
I use nginx proxy to offload SSL now. After changing to WS, I could use just websockify.
Tibia protocol itself is encrypted with XTEA, packets containing user login/password are encrypted using RSA.


View attachment 87536

View attachment 87537



nginx config:
Code:
server {
        server_name web.skalski.pro;
        location / {
          proxy_pass http://localhost:7172;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header Host $host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

          # WebSocket support
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "upgrade";
  }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/web.skalski.pro/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/web.skalski.pro/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
        server_name web.skalski.pro;
        location / {
          proxy_pass http://localhost:7171;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header Host $host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

          # WebSocket support
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "upgrade";
  }

    listen [::]:444 ssl ipv6only=on; # managed by Certbot
    listen 444 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/web.skalski.pro/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/web.skalski.pro/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
Awesome! I'm glad to see you already got it working.

ws:// would indeed be much easier, but sadly it will be blocked by the browsers as far as I know. SharedArrayBuffers (for threading) only works with https, and then we won't be able to stablish ws:// connections because of mixed contents. Let me know if this is not correct.
 
Tested for a while, using shift + left mouse leads to client stuck. Tab button is not working correctly - and website is completely not working on mobile devices (not sure if that was on purpose or not)

Anyway, really good job with this one. Congratulations!
 
Tested for a while, using shift + left mouse leads to client stuck. Tab button is not working correctly - and website is completely not working on mobile devices (not sure if that was on purpose or not)

Anyway, really good job with this one. Congratulations!
The browser hijacks the keys, you will have a better experience playing in fullscreen (F11). Let me know how it goes.
The website is working on my android device, but the client is not adapted to open the virtual keyboard. What issues did you face?
 
The browser hijacks the keys, you will have a better experience playing in fullscreen (F11). Let me know how it goes.The website is working on my android device, but the client is not adapted to open the virtual keyboard. What issues did you face?
Did F11, unfortunately still same issues. Also the numpad doesn't work at all :p Well, I've used the link from Gesior with his adapted data.zip and nothing happens (iOS), however tried the same on Bluestacks and same issue - nothing is being downloaded nor any buttons are available.
 
Back
Top