Jump to content

"packet.h" Can I use vector while transferring data?


Go to solution Solved by Mali,

Recommended Posts

  • Honorable Member

I would suggest using the common approach, the use of structs, as it has always been used and the reason behind the file @ "Srcs/Server/common/tables.h" for this purpose.

Of course, there are other ways you can do this without using vectors but if you're trying to send multiple data you could also consider and should use dynamic packets for this approach.

In the other hand, we can't guarantee that the size of the vector will be the same as the host and client and we mainly don't use it by its dynamic structure if the packet is static.

154636WhyWeDontUseVectorInPackets.png

Regardless, I'm not saying it's not possible, in fact, I haven't tried to test this but I'm sure this wouldn’t work with static packets.

Edited by Owsap
  • Good 1
Link to comment
Share on other sites

  • Honorable Member
  • Solution
Spoiler

yb0c3yb.png

Spoiler

TaOHMYG.png

Spoiler

5IpEbGA.png

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Good 2
  • Love 1

 

Link to comment
Share on other sites

  • Honorable Member
12 minutes ago, Mali said:
  Hide contents

yb0c3yb.png

  Hide contents

TaOHMYG.png

  Hide contents

5IpEbGA.png

 

Don't forget to mention that this will not work on static packets.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Good 2
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



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