Unable to detect the presence of ExtraPosData in CB_PPK

Issue #113 new
Joris created an issue

Continuum does not always include ExtraPosData in C2S_POSITION. game.c knows this by looking at the packet length received from net.

I might be missing something, but it looks to me there is no reliable way to figure this out in CB_PPK, everything in extra position data except energy (energy gets copied in game.c) is simply 0.

I think the easiest would be to simply change the CB_PPK definition to:

{{{ #!C typedef void (PPKFunc)(Player p, const struct C2SPosition *pos, bool extra); }}}

{{{ #!C DO_CBS(CB_PPK, arena, PPKFunc, (p, pos, len >= 32)); }}}

Comments (2)

  1. Former user Account Deleted

    While that is the easiest way to change the function, changing the signature has some serious problems.

    The compiler cannot check the type of the registered callback, so there's no warning about incompatible code. Changing the CB_PPK only helps if the compiler can fix (or at least detect) the binary incompatibility. The compiler can do these checks on advisers and interfaces, but not callbacks.

    A good solution might be to have C2SPosition replaced with a struct who's first element is a C2SPosition, and has a length int afterwards (or a extra bool, if that's preferable, or both). Then there's no binary incompatibility.

  2. Former user Account Deleted

    I view binary compatibility as having little importance. ASSS is GPL, so all module source should be available for rebuild. The small number of asss users are or should all be able to add modules to the build system and 'make clean; make'. I wouldn't want to compromise design for the sake of binary compat given such a tiny install base.

  3. Log in to comment