-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Feature Request] parsePacket to Lua! #1786
Comments
Lots of stuff could be offloaded to Lua. Problem is it would be too easy to mess and break a server - nothing that I care personally. Hey wait, isn't it OTClient extended opcodes? |
@ranisalt and what about performance? Luajit is good but does not operate miracles. |
As stated by @djarek once, the major bottleneck is spectators, so we probably can afford some performance hit. Maybe not for all networking, but surely some of it can be scriptable. |
The major bottlenecks are: getSpectators, XTEA (IO thread probably spends 99% of its time doing XTEA encrypt, it either needs heavy optimizations using vectorization or we should support multiple IO threads), Map::getTile, heap allocations/deallocations, pathfinding and item attribute lookups. As long as these things aren't done in Lua, you can probably implement everything else without a noticeable difference if you're running LuaJIT. The most significant performance hit is going to be from increased heap allocation/deallocations by using Lua. I agree that this is a powerful concept, and this is similar to how TFS 2.0 would probably be designed, where every packet would be handled in Lua. |
As the title says.
We just load a .xml. Now instead of programming in c++ we can do it in Lua. i'm currently using a system displayed in the screenshots below and it works amazingly! I don't have to compile and rebuild and reboot server with every small change. I just reload lua (/reload gameprotocols)!
Currently i have the following working with this system.
*Premiumstore
*Equiphotkey
Example XML (Feel free to check out Premiumshop entry codes, the are annoying to track :) ):
Example coding, of opening premiumshop, feel free to take a good look at opening Premiumstore code :)
Short but powerfull!
My system was made by Milice, so full credits to him.
The text was updated successfully, but these errors were encountered: