-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add browser support #894
base: main
Are you sure you want to change the base?
Add browser support #894
Conversation
@OTArchive |
Great job! Edit: damn yes seems so: https://demo.otarchive.com/ |
The tibia protocol is a custom binary protocol not compatible with the socket APIs available in javascript (webSocket, XMLHttpRequest, fetch) ... do you have a plan for dealing with that? A websocket<->TCP proxy could work.. (but it will be able to steal all usernames/passwords of tibia 7.6 and older clients, possibly newer protocols too, soooo there's that) |
It's already mentioned in the guide, but in Portuguese: yes, we can use proxies. I've setup my testing server using websockify. |
Amazing contribution, here is my short.review Would be better to have the bit implementations to be C++ binds instead of this Lua class, and only fallback to those C++ implementations when not using LuaJit |
why do you care? are you worried about performance? not really sure why we're using the bit library anyway tho, quoting https://www.lua.org/manual/5.3/manual.html#3.4.2
seems lua support the standard bitwise operators, so does that mean return Bit.operation(g_window.getKeyboardModifiers(), KeyboardCtrlModifier, Bit.AND) ~= 0 is better than return (g_window.getKeyboardModifiers() & KeyboardCtrlModifier) ~= 0; or local bitsChanged = Bit.operation(now, old, Bit.XOR) is better than local bitsChanged = now & ~old; ? is it easier to read? more maintainable? |
Some operations are very limited or not possible to implement in LUA only. Moreover the project can only use Lua 5.1 because os the env system that is not present in other Lua versions. So for making the bit operations more reliable it should be implemented as a C++ to Lua bind |
Should we also include Lua 5.1 code and precompiled lib in the repo, as it is not available in vcpkg? |
That's look a good solution, we also avoid new contributors to be confused why to not use default lib functions. About including Lua 5.1 what other options we have? Nonetheless I will leave this decision to @mehah and others contributors. |
Description
Support compiling to javascript and webassembly using Emscripten.
Compiling guide (PT-BR): Guia ‐ OTClient Redemption Web
Notes:
Changed .bit operations to a lua implementation (Lua 5.1 incompatible);Now using bitlib;