[C++] Remove Improved packet encryption properly

  • Hello,


    I come to share my knowledge on what I discovered recently on the encryption of packets. Some may tell me, but this has already been shared by MartySama. In reality, this one is not complete, it has forgotten a very important factor which I will present to you subsequently.


    But suddenly, you have to wonder what is happening if we disable the encryption of packets, by the way he shared it? Well, we may have an overload at the buffers, which may cause crashes game without error, or rather strange bugs.


    I could see different strange bugs. The most common was the fact that we can no longer perform an action that requires an agreement with the game. Example, after 15 minutes of play with a few connected players, some can no longer click on an item, or others will not be able to talk, etc ...

    There was a lot of debate about this, I took advice left and right and I pulled a problem.


    Why these bugs were not present before the encryption of packets?


    Simply because the structure was edited.

    Indeed, we can see that in the protocol.h Game, the function buffer_adjust_size was commented.

    Also, in the desc.cpp, they completely removed the condition in the function:


    Code
    1. void DESC::Packet


    But why ? Simply because it is no longer useful, the new system no longer requires a size adjuster for buffers (it seems to me)

    Or, they coded something else that automatically adjusts the size of the buffers but I have not watched yet.


    Why would I disable this system?


    Zitat

    Connection time LARGELY decreased (as we no longer use Cipher)

    Loading time also decreased

    Better fluidity (personal opinion)

    Size of the game enormously diminished as well as that of the launcher


    Here is a small preview video:

    Bitte melden Sie sich an, um dieses Medienelement zu sehen.


    Server side changes:


    A. Service.h file (Common)

    Look for this line:

    Code
    1. #define _IMPROVED_PACKET_ENCRYPTION_

    And comment or delete the line like this:

    Code
    1. //#define _IMPROVED_PACKET_ENCRYPTION_


    B. Protocol.h file (Game)

    Look for this line:

    Code
    1. //buffer_adjust_size(pbuf, length);

    Uncomment it like this:

    Code
    1. buffer_adjust_size(pbuf, length);


    C. desc.cpp file (Game)

    Look for this line:

    Code
    1. void DESC::Packet(const void * c_pvData, int iSize)

    Replace the entire function with this:


    Warning ! Do not forget to compile your Game & your DB


    Client side change:


    D. ServiceDefs file (Eterpack)

    Look for this line:

    Code
    1. #define _IMPROVED_PACKET_ENCRYPTION_

    Comment or delete like this:

    Code
    1. //#define _IMPROVED_PACKET_ENCRYPTION_


    E. Locale.cpp file (Userinterface)

    Look for this line:

    Code
    1. #define LSS_SECURITY_KEY "testtesttesttest"

    Edit like this:

    Code
    1. #define LSS_SECURITY_KEY "1234abcd5678efgh"


    If you want to share this tutorial elsewhere, please quote the source.

    Kuroro

    A good beginning, makes a good ending.


    Bitte melden Sie sich an, um dieses Bild zu sehen.


  • Dieses Thema enthält 11 weitere Beiträge, die nur für registrierte Benutzer sichtbar sind, bitte registrieren Sie sich oder melden Sie sich an um diese lesen zu können.