iamgreaser / iceball

Open-source rewrite of the VOXLAP version of Ace of Spades.
http://iceball.build
GNU General Public License v3.0
114 stars 32 forks source link

Port it across to ENet #64

Closed iamgreaser closed 11 years ago

iamgreaser commented 11 years ago

Here's the notes I'm going to give.

Channel 0 is for Lua-visible messages - that is, the 0x40-0x7E + 0x7F group, except you just send the data as-is - no "length" field. An extra optional field will be appended to the end of the Lua packet send function, "unreliable", which when true will not mark the packet as reliable, and when false, will. Channel 1 is for all the other stuff. All packets MUST be "reliable" which implies that they are also sequenced in order.

Both the TCP port used for what will become the "legacy" protocol (i.e. the "lags a shitload on a VPS" protocol) and the UDP port used for what will become the "enet" protocol will share the same port number.

The connection packet "data" field should contain "1CEB" in little-endian (0x42454331) because big-endian sucks.

My main concern with using ENet, however, is that I suspect ENet isn't IPv6-capable, so we MUST retain the "legacy" protocol. But while we wait for that problem to be solved, we can still get our reduced latencies.

This will probably be something I will have to do, but I might as well document what I'm thinking of just in case someone thinks my approach is utter crap.

rakiru commented 11 years ago

I don't see any glaring issues with this plan. What is the "other stuff" that will be going on channel 1?

As far as I know, ENet isn't IPv6 compatible yet, but will be at some point. How soon that is depends entirely on when the author has time and feels like doing so.

iamgreaser commented 11 years ago

Anything that isn't in the 0x40..0x7E + 0x7F bracket as documented in docs/proto_main.txt will be in channel 1.

Ericson2314 commented 11 years ago

Enet is pretty damn small, could we implement ipv6 ourselves and submit a pull request?I also created an issue about refactoring the headers a bit, as the current design is really not condusive for bindings in a way that I don't see helps anything else. Fixing both these things would be nice.

iamgreaser commented 11 years ago

For now we should stick with official ENet 1.3.x releases, just so we don't get weird issues further down the track.

Anyhow, we're one step away from this being done, which will mark... 0.0-51. Which we can then bump up to version 0.1 and zip it up into a nice package. You can feel the excrement.

iamgreaser commented 11 years ago

Going to bed now. In the morning I should finally be working on the second-to-last remaining step, which is the parsing of Lua packets, and after that the last step should be handling client kicks.

iamgreaser commented 11 years ago

DONE.

Ericson2314 commented 11 years ago

BTW, as of today I am working on IPv6 for Enet.

Ericson2314 commented 11 years ago

initial progress: https://github.com/Ericson2314/enet