Jump to content
  • 0

Packet structure


Elfocrash

Question

So i've been diving into the code during my lunch break and i noticed several things but only one made me curious.

 

Why are you using a Long as your packets opcode and not a byte?

Is there any weird black magic i am not aware of?

 

Thanks.

 

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0
2 hours ago, Elfocrash said:

I have no intention to study it, i've written networking for multiple gameservers.

 

I am curious about why that came to be.

 

2 hours ago, Kibbelz said:

Considering @SPQR Panda is rewriting networking for the next release i would't bother studying it.


It's a moot point why it came to be, and I doubt JC remembers why. It will likely be a short or a byte once I'm done with it, but probably for the sake of future-proofing it will be a short.
 

Link to comment
Share on other sites

  • 0

Yeah makes more sense.

 

I personally like going for the group up choice of double byte for similar context (if you ever have more than 128 different packets for the default behavior), which removed the minor overhead and adds the needed depth, but straight short makes sense too.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...