Jump to content
  • 0

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


lordsas61

Question

4 answers to this question

Recommended Posts

  • 1
  • Nitro Booster

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

  • 0
  • Nitro Booster
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

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.