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:
parent
78cfcbe466
commit
abd3e02d4d
3 changed files with 562 additions and 519 deletions
|
@ -55,6 +55,7 @@ const uint32_t PROTO_VER = 0x00010001; // 1.1
|
||||||
#define OLD_PROP_MSG_ID 5
|
#define OLD_PROP_MSG_ID 5
|
||||||
#define RESET_DATA_ID 6
|
#define RESET_DATA_ID 6
|
||||||
#define POS_DATA_ID 7
|
#define POS_DATA_ID 7
|
||||||
|
#define MP_2017_DATA_ID 8
|
||||||
|
|
||||||
// XDR demands 4 byte alignment, but some compilers use8 byte alignment
|
// 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
|
// 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 Version; // Protocoll version
|
||||||
xdr_data_t MsgId; // Message identifier
|
xdr_data_t MsgId; // Message identifier
|
||||||
xdr_data_t MsgLen; // absolute length of message
|
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
|
xdr_data_t ReplyPort; // player's receiver port
|
||||||
char Callsign[MAX_CALLSIGN_LEN]; // Callsign used by the player
|
char Callsign[MAX_CALLSIGN_LEN]; // Callsign used by the player
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -101,6 +101,9 @@ private:
|
||||||
typedef std::map<unsigned int, SGSharedPtr<SGPropertyNode> > PropertyMap;
|
typedef std::map<unsigned int, SGSharedPtr<SGPropertyNode> > PropertyMap;
|
||||||
PropertyMap mPropertyMap;
|
PropertyMap mPropertyMap;
|
||||||
|
|
||||||
|
typedef std::map<unsigned int, const struct IdPropertyList*> PropertyDefinitionMap;
|
||||||
|
PropertyDefinitionMap mPropertyDefinition;
|
||||||
|
|
||||||
bool mPropertiesChanged;
|
bool mPropertiesChanged;
|
||||||
MPPropertyListener* mListener;
|
MPPropertyListener* mListener;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue