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

[Feature Request] Custom packet priorities #1335

Open
canerksk opened this issue Nov 12, 2024 · 4 comments
Open

[Feature Request] Custom packet priorities #1335

canerksk opened this issue Nov 12, 2024 · 4 comments

Comments

@canerksk
Copy link
Contributor

canerksk commented Nov 12, 2024

Each packet has been assigned a priority, but it’s unclear how these priorities were determined. When I want to change the priority of a packet , it’s not very straightforward; it always requires making changes in the source code. Would it be possible to set priorities for each packet in an .ini section as shown in the example? When the sphere starts, it would load a packet priority list and maintain that priority value for the packet as long as the server is running. If no priority is specified for a packet , the sphere would assign the default priority value. This would be great. I have no idea how feasible this is; we can discuss this further under this topic.

eg;

// PRI_LOW = 1
// PRI_NORMAL = 2
// PRI_HIGH = 3
// PRI_HIGHEST = 4
[PACKETPRIORITIES]
PACKET0x88=4 // PacketPaperdoll
PACKET0x86=1 // PacketCharacterListUpdate
or decimal 
PACKET136=4
PACKET134=1

If a priority is entered for that packet in the list above, that packet will run at that priority. If no priority is entered, Sphere will continue to run with its default priority value.
instead of function there will be priority value (1-4).

It could be a structure similar to "PACKET FILTER: Hooked packet"

///////////////////////////////////////////////////////////////
//////// General Information
///////////////////////////////////////////////////////////////

[SPHERE]
// Both
// PACKET12=F_PACKET_0x0C
// PACKET21=F_PACKET_0x15
// PACKET34=F_PACKET_0x22

Or can it be added to the existing structure? For example, a variable that can be read/written under the hooked function

LOCAL.PRIORITY=1

similar

eg;

[FUNCTION F_PACKET_0x0C]
SERV.LOG Priority: <DLOCAL.PRIORITY>
LOCAL.PRIORITY=1

@Jhobean
Copy link
Contributor

Jhobean commented Nov 15, 2024

Do the priority change really something? Each packet are send reallt fast no?

@GladieUO
Copy link
Contributor

GladieUO commented Nov 15, 2024

Do the priority change really something? Each packet are send reallt fast no?

Theres also packet priority ON/OFF sphere.ini setting, not sure what that change. 🤔

@canerksk
Copy link
Contributor Author

canerksk commented Nov 16, 2024

Do we know what determines the current and previous packet? I want a package to be given the highest priority, is there a requirement to change the code for this?

@canerksk
Copy link
Contributor Author

Do the priority change really something? Each packet are send reallt fast no?

Actually, this is not a matter of whether it is sent fast or not. Let's think of two different packets with the same length and think that we send them at the same time. When sphere starts begintransaction, it processes and sends the packet that is the priority first.

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

No branches or pull requests

3 participants