Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Recommended Posts

As part of our ongoing effort to enhance code efficiency, I've put together a comprehensive guide for removing redundant code that pertains to blocking country IPs and limit time functionality. Below, you will find step-by-step instructions to clean up your codebase effectively.

Removing Block Country IP Functionality

  1. Edit Common/tables.h

    • Search for and remove the following lines:
     
This is the hidden content, please
  • Next, find and delete this block of code:
 
  • This is the hidden content, please

     

  • Edit db/src

    • Remove the following files:

    • Open db/clientmanager.cpp and delete these sections:

     
This is the hidden content, please
  • Remove the entire BlockException function:
 
  • This is the hidden content, please

     

  • Edit db/clientmanager.h

    • Remove the following function declaration:
     
  • This is the hidden content, please

     

  • Edit Main.cpp

    • Remove:
     
  • This is the hidden content, please

     

  • Update Makefile

    • Search for and remove the reference to BlockCountry.cpp.
  • In the game source folder, remove files:

  • Edit game/db.cpp

    • Remove the entire RequestBlockException function:
     
  • This is the hidden content, please

     

  • Edit db.h

    • Remove the line:
     
  • This is the hidden content, please

     

  • Edit input.cpp

    • Remove the section for BLOCK_EXCEPTION command processing:
     
  • This is the hidden content, please

     

  • Edit input.h

    • Remove these function declarations:
     
  • This is the hidden content, please

     

  • Edit input_db

    • Remove the following lines and replace with:
     
This is the hidden content, please
  • Delete:
 
This is the hidden content, please
  • Remove:
 
  • This is the hidden content, please

     

  • Edit input_login.cpp

    • Remove the #include "block_country.h" line.

    • Replace it with the code that checks for blocking IPs:

     
  • This is the hidden content, please

     

  • Streamline packet.h

    • Remove the line:
    This is the hidden content, please

     

Removing Limit Time Functionality

  1. Edit db/clientmanagerlogin.cpp

  2. Edit game/desc.cpp

    • Remove the conditional compilation:
     
  • This is the hidden content, please

     

  • Edit game/input.cpp

    • Remove the following lines:
     
  1. This is the hidden content, please
    • And the limit time checks within.
  2. Edit input_auth.cpp

    • Remove #include "limit_time.h" and the associated checks for valid servers.
  3. Cleanup Main Files

    • Search and remove #include "limit_time.h" and the associated condition checks within game/main.cpp.

    • Also, delete the makefile entry related to limit_time.

  4. Delete Limit Time Files

    • Remove limit_time.h and update_limit_time.py files from the game folder.

This cleanup guide should significantly reduce redundant code and streamline the functionality within your codebase. By following the outlined steps diligently, you'll improve maintainability and performance.

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...