1
0
Fork 0

partitioned MP messages.

This moves certain properties into a second part of the buffer that isn't visible to the first with the intention of making a backwards compatible MP protocol that can have more efficient encoding in a second part that is after MsgLen.

Unfortunately this doesn't work because the code ensures that MsgLen in the header matches the received byte count.
This commit is contained in:
Richard Harrison 2017-02-04 23:59:14 +01:00
parent 78cfcbe466
commit abd3e02d4d
3 changed files with 562 additions and 519 deletions

View file

@ -55,6 +55,7 @@ const uint32_t PROTO_VER = 0x00010001; // 1.1
#define OLD_PROP_MSG_ID 5
#define RESET_DATA_ID 6
#define POS_DATA_ID 7
#define MP_2017_DATA_ID 8
// XDR demands 4 byte alignment, but some compilers use8 byte alignment
// so it's safe to let the overall size of a network message be a
@ -70,7 +71,7 @@ struct T_MsgHdr {
xdr_data_t Version; // Protocoll version
xdr_data_t MsgId; // Message identifier
xdr_data_t MsgLen; // absolute length of message
xdr_data_t ReplyAddress; // (player's receiver address
xdr_data_t MsgLen2; // Used to be - ReplyAddress; // (player's receiver address
xdr_data_t ReplyPort; // player's receiver port
char Callsign[MAX_CALLSIGN_LEN]; // Callsign used by the player
};

File diff suppressed because it is too large Load diff

View file

@ -100,7 +100,10 @@ private:
// and the property nodes
typedef std::map<unsigned int, SGSharedPtr<SGPropertyNode> > PropertyMap;
PropertyMap mPropertyMap;
typedef std::map<unsigned int, const struct IdPropertyList*> PropertyDefinitionMap;
PropertyDefinitionMap mPropertyDefinition;
bool mPropertiesChanged;
MPPropertyListener* mListener;