Skip to content

Conversation

@provrb
Copy link
Owner

@provrb provrb commented Nov 16, 2024

The first major change in this update is to stop using the NetCommon namespace for sending and receiving data. First of all, the receive data function couldn't even receive and decrypt data if the data destination was a bytestring. This added confusion and even broke the code in the earlier stages and made me waste time debugging.

With the new NetworkManager class, you can be sure everything is initialized for each instance, which ensures safety and reduces potential of crashes. Furthermore, there was a segment in the ReceiveData for UDP, where when sending the data size, it would be converted based on the endianess before being sent, but when receiving this wasn't convert to the endianess on the host machine, resulting in a buffer being resized to an absured number (e.g 30201), this patch fixes this.

The second major change in this update is managing files including other files. I was able to bring the size of MLANG.DLL down from ~5.5k Mb to ~4.9Mb. Source files were full of unneccessary includes, and if one file didn't include something, others would break. Completely refactor this so a lot of linker errors don't arrise if something isn't included in the proper order. Also include files in cpp source files rather than header files for a faster compilation time.

Overall, improve compilation time, reduce DLL file size, improve code clarity, reduce crash potential, improve safety when loading native WinSock functions dynamically, and more.

@provrb provrb merged commit 18e9c6f into main Nov 16, 2024
@provrb provrb mentioned this pull request Nov 16, 2024
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.

2 participants