-
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
Add unknown packet handling in Lua #4043
Conversation
any advantage for doing this as creaturescript instead of player event? |
None at all! I am just too dumb to know the other alternatives. Appreciate the help 🤣 |
here is my diff in case you need help: |
f33031c
to
177353b
Compare
closes #1786 |
I've been using it for a while now and it's pretty stable. Any suggestions? |
https://github.com/Zbizu/forgottenserver/commit/de2db0c6135d1bf505a158e69fecc68dd65f2077# |
Avoid copying , if we parse only unhandled opcodes then why are we copying? |
Is it a big deal to just
Well, because I don't want the network message to be stored for later usage only to crash the server because it was used after deletion. But maybe it would be better to move the message into |
9155410
to
047e5dc
Compare
When I merge these changes I can't connect with any character, I think the handling of the buffers is not correct |
7012ea1
to
807a41e
Compare
With help from @MillhioreBT I believe the issue above has been fixed. The problem was replacing |
807a41e
to
1d1a54d
Compare
1d1a54d
to
bca2180
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working correctly.
@Zbizu if you have time, please check again that it has been fixed |
src/events.cpp
Outdated
} | ||
|
||
if (!scriptInterface.reserveScriptEnv()) { | ||
std::cout << "[Error - Events::eventPlayerOnInventoryUpdate] Call stack overflow" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eventPlayerOnNetworkMessage
Pull Request Prelude
Changes Proposed
This pull request aims to add packet handling in Lua for network messages with unknown packet types. The idea, in the long run, is to move lightweight handlers to Lua for easy extensibility, rather than baking into the source code. New packet types should be added directly with Lua scripts instead.
Closes #1786