Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Recommended Posts

  • Premium+

In online gaming, excessive use of certain items like scarves, mounts, pets, and wings can lead to significant lag, especially when many players are online simultaneously. To address this issue, we can enhance the anti-spam mechanisms in our game’s code, allowing for smoother gameplay and a better user experience. Below, we’ll go through the steps necessary to implement these changes.

Step-by-Step Guide:

1. Modifying Char.cpp

First, we need to locate the existing function responsible for character creation.

Search for:

 
This is the hidden content, please

Add the following lines right above the closing brace }:

 
This is the hidden content, please

2. Updating char.h

Next, we will add new member variables to track item usage and anti-flood settings.

Search for:

 
This is the hidden content, please

Below this line, add:

 
This is the hidden content, please

Additionally, find the GetSyncHackCount method and add the following:

 
This is the hidden content, please

3. Adjusting char_item.cpp

Finally, we’ll modify the item handling to account for the new anti-flood mechanism.

Search for:

 
This is the hidden content, please

Insert the following code above this line:

 
This is the hidden content, please

Note: You may choose to enable GetDesc()->DelayedDisconnect(0); for disconnections—but if you increase the allowed usage count from 3 to a higher number, such as 8 or 10 seconds, be sure to adjust it accordingly in the condition.

By implementing these changes, players will enjoy an improved experience without the interruptions caused by item spam.

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...