Jump to content

Recommended Posts

  • Active+ Member
Posted (edited)

Long story short, normally you have to call the "Set" member function from CPacketInfoCG's constructor every time you add a new packet. If you forget it, you end up with packet errors at runtime.

With this thing, adding an annotation to your new packets is enough. The array gets generated at compile-time. On top of that, you can also add checks like whether there is padding, whether the annotation is there or not, and so on.

If you have questions, leave a comment and I'll answer when I have time.

Note: I only recently started working with C++26. I was reading the papers and this idea came to my mind. I'm still not very familiar with it, so there might be other use cases I don't know about. If you know any, feel free to share.

You need C++26 - GCC16, otherwise it won't work. You can use your brain and turn this into something different too.

Mock:

refl namespace gist:

 

Edited by Larry Watterson
  • Metin2 Dev 1

Software Engineer | Low-Latency C++

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.