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

OTClient on Browser via Emscripten?

Do someone need this?

  • Yes

    Votes: 7 100.0%
  • No

    Votes: 0 0.0%

  • Total voters
    7
  • Poll closed .

Fenrisus

Ferin-Sha
Joined
Mar 19, 2010
Messages
205
Reaction score
339
Location
Canada
Hello OTLanders, i am play with Emscripten library. And want to ask yours. Do your need a OTCLient on web? As browser ver.? Literally, this dont change current OTClient features (exept one*?). Just compiling them under this way : C++ source code ----->LLVM----->JavaScript.

Well little result is:
jW6b4sH.jpg

Sry, i dont know how to change their size right now, and them going to scrolling on my firefox.:(
Note*: My client uses SDL2 as graphic lib.

Right now i am do it just for research & learning on mainstream technologies. I dont have a plans to make it seriosly, but if community needed, i can try finish them...;)
 
This is a nice feature I guess. Would be nice to see how if works on Browser :)
 
It looks nice, I would like to test it myself
 
It looks nice, I would like to test it myself
Well, it's non easy, but... here my short manual for developers (i.e. you should figure out all issues self, that is easy)
===========================================
1)Download plugin for VS2013
  1. Copy the folder platform\ from this repository to C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\platform\ (or the corresponding location where MSBuild exists on your system)
  2. To enable an existing solution to be built via vs-tool, create a a platform for it from Configuration Manager -> Active Solution Platform -> New... -> platform.
  3. To choose the toolchain to build with, edit the dropdown list at Project Properties -> General -> Platform Toolset.
============================================
2) Download and install MinGW: http://www.mingw.org/
3) Download and install Clang
4) Download and install emscripten: http://emscripten.org/
= =======================================

Configure platform enviroments for Visual Studio, add variables etc. for platform toolset. Go to your OTClient, and setup project toolsets with:

Emscripten:
Project Properties -> Toolchain Directories -> Emcc Linker Path, and specify there the directory to the emscripten root directory.

Clang:
Project Properties -> Toolchain Directories -> Clang Compiler Path, and specify there the directory where the Clang toolchain executables are located.

MinGW:
Project Properties -> Toolchain Directories -> MinGW Compiler Path, and specify there the bin\ directory where the MinGW toolchain executables are located.

Any additional documentation, how to, port things and etc. can be found at http://kripken.github.io/emscripten-site/docs/getting_started/Tutorial.html
 
How does this connect to the server, since you can't do pure TCP in web browsers? Do you run a reverse proxy like Websockify on the server?
 
How does this connect to the server, since you can't do pure TCP in web browsers? Do you run a reverse proxy like Websockify on the server?
This can be done on few ways:
1) roBrowser (same way, them can connect to eAthena) https://github.com/vthibault/roBrowser/
2)any other websockets wrapper.
3) https://github.com/varmil/tcp-server-with-emscripten
In short, currently i am using hand-maded wrapper similar to roBrowser port, also here the issue, just for test not all packets works ^_^ For example, inventory, character info - works, chat - nope, cast spells too, and many other things too. But for be fair, possible to make semi-automatic wrapper for it.
Just need to handle protocol things for correct parse.

And finally, as i noticed, here a few issues on emscripten github, well, on future, here will be something like auto-wrapper. But currently, i using my own, hackish, unstable just experemental :) Right now there currently many issues. Client works, but right now them non-playable. (Another issue, not only good networking - is physfs library. They should be wrapped too, for be fair, i am just disable them and make content load hardcoded fully... Those problems appears due to general browser(s) & web behavior. In short - there is no way for normal using virtual file system, only direct load our content.)

But, anyways, it can be done, with alot of job & time for it. All of those issues, depends only on development things (i mean real development, not just using code and do various custom modules or simple additions). Probably here should be special fork for OTCEmscripten :)

For users, here will be easy way :D
Just IO before compile.
Code:
#DEFINE EMSCRIPTEN 1
#ifndef EMSCRIPTEN
//Code of all default-related things
#else
//Code of all Emscripten things
#endif
But for custom (deep) developers, that will be a little pain :D
 
This can be done on few ways:
1) roBrowser (same way, them can connect to eAthena) https://github.com/vthibault/roBrowser/
2)any other websockets wrapper.
3) GitHub - varmil/tcp-server-with-emscripten: TCP server written in C++, and convert it to JavaScript with Emscripten
In short, currently i am using hand-maded wrapper similar to roBrowser port, also here the issue, just for test not all packets works ^_^ For example, inventory, character info - works, chat - nope, cast spells too, and many other things too. But for be fair, possible to make semi-automatic wrapper for it.
Just need to handle protocol things for correct parse.

And finally, as i noticed, here a few issues on emscripten github, well, on future, here will be something like auto-wrapper. But currently, i using my own, hackish, unstable just experemental :) Right now there currently many issues. Client works, but right now them non-playable. (Another issue, not only good networking - is physfs library. They should be wrapped too, for be fair, i am just disable them and make content load hardcoded fully... Those problems appears due to general browser(s) & web behavior. In short - there is no way for normal using virtual file system, only direct load our content.)

But, anyways, it can be done, with alot of job & time for it. All of those issues, depends only on development things (i mean real development, not just using code and do various custom modules or simple additions). Probably here should be special fork for OTCEmscripten :)

For users, here will be easy way :D
Just IO before compile.
Code:
#DEFINE EMSCRIPTEN 1
#ifndef EMSCRIPTEN
//Code of all default-related things
#else
//Code of all Emscripten things
#endif
But for custom (deep) developers, that will be a little pain :D
technically how hard is it to actionally host it so that other players can use it to connect to certain servers ( to avoid burn user has to submit spr or dat file or use last 24hours files/ that get deleted every 24hours as thats enough to not be any damage done copyright way
 
Hello OTLanders, i am play with Emscripten library. And want to ask yours. Do your need a OTCLient on web? As browser ver.? Literally, this dont change current OTClient features (exept one*?). Just compiling them under this way : C++ source code ----->LLVM----->JavaScript.

Well little result is:
jW6b4sH.jpg

Sry, i dont know how to change their size right now, and them going to scrolling on my firefox.:(
Note*: My client uses SDL2 as graphic lib.

Right now i am do it just for research & learning on mainstream technologies. I dont have a plans to make it seriosly, but if community needed, i can try finish them...;)
any updates on that?
 
Back
Top