Skip to content
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

improve: improvement in receiving the bytes used in modules #2870

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

luanluciano93
Copy link
Contributor

@luanluciano93 luanluciano93 commented Sep 2, 2024

Description

The byte packets received that pass through the parsePacket function are sent to parsePacketFromDispatcher and g_modules().executeOnRecvbyte, but will be used in only one option of the two mentioned.

To solve it, just use 'g_modules().executeOnRecvbyte' only if the package is not in the parsePacketFromDispatcher options

Fixes #2493

How Has This Been Tested

Test Configuration:

  • Server Version: Canary Main
  • Client: Tibia Client 13.40
  • Operating System: Windows 11

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

g_logger().debug("Player '{}' sent unknown packet header: hex[{}], decimal[{}]", player->getName(), asUpperCaseString(hexString), recvbyte);
break;
// Modules system
if (!g_modules().executeOnRecvbyte(player->getID(), msg, recvbyte)) {
Copy link
Contributor

@dudantas dudantas Sep 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check: recvbyte != 0xD3 is still necessary? Because this byte is checked in another place (in the outfit window)

outfitModule->executeOnRecvbyte(player, msg);

Copy link
Contributor Author

@luanluciano93 luanluciano93 Sep 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In "recvbyte != 0xD3" the byte is not sent to executeOnRecvbyte and within the "case" it will also not reach executeOnRecvbyt, only within parseSetOutfit, as it already is, so the change does not change the functioning of this part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modules::executeOnRecvbyte in ProtocolGame::parsePacketFromDispatcher?
3 participants