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

(Client) JavaScript/TypeScript (or WebAssembly + JavaScript/TypeScript) + Canvas + WebSocket + WebAPI + knowledge of binary data in a web browser + (optional) HTML + CSS + web framework.
(Server) WebSocket support in TFS (or WebSocket proxy in web account maker/microservice).
 
some people have talk about webassembly. Will it take a lot of work? I've never used webasembly.
 
some people have talk about webassembly. Will it take a lot of work?
Yes. WebAssembly is not magic; it has a lot of limitations. You only have access to Web APIs there, so you'd have to implement a WebGL/WebGPU renderer and use something like File System API for file access (or load everything from the server via HTTP, but still quite a lot of work). And there's also client-server communication - as mentioned above, browsers don't allow you to use raw TCP sockets (there's a draft of this feature though), so you'd have to implement WebSockets instead (on both the client side and server side).
And I guess many C/C++ libs that OTClient uses would not compile to WASM just like that.
 
I've adapted OTClient Redemption to work when built with emscripten.

Simple demo, no assets:

Modular version, use a .zip with any init.lua, data and modules:

Source:
 
Last edited:
I've adapted OTClient Redemption to work when built with emscripten.

Simple demo, no assets:

Modular version, use a .zip with any init.lua, data and modules:

Source:

These are the true contributions, I thank you very much for your great contribution and to the entire OTArchive / OTServList Brazil community.

These contributions are what encourage many to really fall in love with what OpenTibia is, many simply out of passion as in the old days.

Congratulations to everyone! What a way to answer a question (the beginning of the post), with something totally functional, and stop throwing words to the moon like many others do.

GREAT!!!
 
@OT Archive

Code:
WebSocket connection to 'wss://testaac.otarchive.com/api/login:443' failed:
WebSocket connection to 'wss://testaac.otarchive.com/api/login' failed:
 
@OT Archive

Code:
WebSocket connection to 'wss://testaac.otarchive.com/api/login:443' failed:
WebSocket connection to 'wss://testaac.otarchive.com/api/login' failed:
What are you trying to do?
This address is configured for the login server, it will only answer to HTTPS requests. The Web Client uses a https POST request to login.
If you want to connect straight to the game server, try wss://testserver.otarchive.com. The server uses sessions, not sure if it will work.
 
Last edited:
I've created account on your test server and was trying to login using parameters you put in Wiki Guia ‐ OTClient Redemption Web (https://github.com/OTArchive/otclient-web/wiki/Guia-%E2%80%90-OTClient-Redemption-Web#conex%C3%A3o)

View attachment 87473

But that way I've got

View attachment 87474

No matter if I put any credentials or client version or port.
Are you trying with the demo version? If so, there are no assets.
If you just want to test the gameplay, prepare a .zip with init.lua, data and modules and use the modular version. Don't forget the 13.40 assets.

Here is a video showing the demo and then the modular version:
Post automatically merged:

If you compile your own, you can have your files and assets preloaded. The compiled versions I've published are this way to avoid hosting copyright protected material.
 
Last edited:
I always thought of something like this to avoid bot injection.

I also thought that the "game market" trend would be to no longer export clients, but to run in the cloud to avoid cheats, something like the cloud services we have (Xbox cloud gaming and others). I imagine that some cheats that use the screen, such as aims would still be possible, but wallhacks would be completely avoided.

good job.. following
 
If you compile your own,
It's pretty big PR that changes a lot in OTC/OTC setup. Is there any instruction 'how to run it all on your own server'?
Is there any instruction how to setup web socket proxy for OTS?
I worked on OTC web client 6 years ago, but it was OTC code translated to TypeScript ( GitHub - gesior/otwebclient: TypeScript OTWebClient for Open Tibia Servers, based on edubart/otclient C++ client (https://github.com/gesior/otwebclient) ), not C++ compiled to WebAssembly, but it still required WS proxy to allow clients to login to OTS.
I also thought that the "game market" trend would be to no longer export clients, but to run in the cloud to avoid cheats,
It's not related. This whole client is still executed in your web browser (uses your CPU/GPU/RAM) - same as .exe is executed on your PC. It's just another website. You can download it, modify (add bot) and open in any web browser. Now you can use JavaScript to write bots for it :)

Someone made web browsers able to run compiled code [assembly, ex. compiled C++], someone made web browsers able to use graphic cards and @OT Archive worked hard to combine both to be able to run OTClient in web browser.

When I've started work on my C++ -> TypeScript conversion (6 years ago), someone already mentioned 'emscripten', but no one posted working version of OTC on www.
 
Last edited:
It's pretty big PR that changes a lot in OTC/OTC setup. Is there any instruction 'how to run it all on your own server'?
Is there any instruction how to setup web socket proxy for OTS?
Yes, there are instructions here, but in Portuguese. It's not that different from what we are used in terms of libraries, it's still vcpkg (besides lua 5.1) and I've made overlay-ports to automate the pthread patches. Just need to learn a bit how to use emscripten to compile.
There are also basic instructions on how to setup a server with support to websockets using Websockify.
 
Last edited:
The compiled versions I've published are this way to avoid hosting copyright protected material.
My - pretty bad - OTC version AKA open-tibia-library (GitHub - gesior/open-tibia-library: Library to manipulate files used by OTS and OTClient. Written in TypeScript. (https://github.com/gesior/open-tibia-library)) is able to download files from www (that's thing that blocks it changing from 'library' to 'package' [downloading from www code is different in Node.js and web browser JS).
All 7.1 - 10.99 .spr and .dat versions are available on my site: OTSME DL - data/tibia-clients/dat_and_spr (https://downloads.ots.me/?dir=data/tibia-clients/dat_and_spr)

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?
 
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, I've already done something similar for the modular version. Add the parameter gameData to the URL and the .zip will be downloaded, installed and cached, example:
Code:
https://webclient.otarchive.com/?gameData=https://dominio/pasta/otclient.zip
The server will have to serve the file using HTTPS and with the header
Code:
Access-Control-Allow-Origin https://webclient.otarchive.com
Post automatically merged:

My - pretty bad - OTC version AKA open-tibia-library (GitHub - gesior/open-tibia-library: Library to manipulate files used by OTS and OTClient. Written in TypeScript. (https://github.com/gesior/open-tibia-library)) is able to download files from www (that's thing that blocks it changing from 'library' to 'package' [downloading from www code is different in Node.js and web browser JS).
All 7.1 - 10.99 .spr and .dat versions are available on my site: OTSME DL - data/tibia-clients/dat_and_spr (https://downloads.ots.me/?dir=data/tibia-clients/dat_and_spr)
This is huge in combination with the modular version!
 
Last edited:
Back
Top