OpenSettlers#5

As always – a commit!

Here’s a thing I struggled while doing previous commit – decoding command to something more structurized – according to docs it’s composed of command name and body – all coming in one binary. I had to get the name and body (if any)

It seems like you have to use ::binary-size for the first one, and just ::binary for the rest – I may be wrong thou and I will have to research that more in the future.

It’s slowly starting to be a mess – that’s why I refactored enconding a bit to make a use of pattern matching. Not it’s more “elixir style”. Still I feel the lack of the bigger picture – I guess rushing into it wasn’t as good idea as first though 😉 I will have to do some more research and maybe a post on a protocol – it will surely help me. For example – turns out that command will never have “more” frames incoming – as you can see in changes in code – now all command have “more” set as false (with is quite redundant).

Leave a Reply

Your email address will not be published. Required fields are marked *