ChillerDragon / teeworlds_network

A teeworlds 0.7 network protocol library written in ruby
5 stars 0 forks source link

Make send_packet(:size) optional #8

Closed ChillerDragon closed 7 months ago

ChillerDragon commented 1 year ago

send_packet() can call .size on the data so make it optional in case one wants to override it

ChillerDragon commented 7 months ago

This makes no sense to me. A teeworlds packet has no size https://chillerdragon.github.io/teeworlds-protocol/07/packet_layout.html

Only the chunks have sizes. And we just pass a blob of bytes to send_packet(). Should send_packet() dissect the raw data and then edit the chunk headers!? No.

You would have to refactor how messages are built. With a header generator based on the payload. But not doing that for now. Just call .size your self.