X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMultiPlayer%2Fmultiplaymgr.hxx;h=96e56f2428a29f8e56f3313650be78b978029331;hb=ad13e4f3b42c53410cb695d2dd0083af77addb2e;hp=073b57a5c15cfdacd348d022f9459e36add3f68d;hpb=fd492a297aee6d40c58f71b1889847b6668af3fd;p=flightgear.git diff --git a/src/MultiPlayer/multiplaymgr.hxx b/src/MultiPlayer/multiplaymgr.hxx index 073b57a5c..96e56f242 100644 --- a/src/MultiPlayer/multiplaymgr.hxx +++ b/src/MultiPlayer/multiplaymgr.hxx @@ -37,10 +37,10 @@ # include #endif -#include STL_STRING -SG_USING_STD(string); +#include +using std::string; #include -SG_USING_STD(vector); +using std::vector; #include #include @@ -58,10 +58,13 @@ public: struct IdPropertyList { unsigned id; const char* name; - SGPropertyNode::Type type; + simgear::props::Type type; }; - static IdPropertyList sIdPropertyList[]; + static const IdPropertyList sIdPropertyList[]; + static const unsigned numProperties; + static const IdPropertyList* findProperty(unsigned id); + FGMultiplayMgr(); ~FGMultiplayMgr(); bool init(void); @@ -69,18 +72,18 @@ public: // transmitter void SendMyPosition(const FGExternalMotionData& motionInfo); void SendTextMessage(const string &sMsgText); - void FillMsgHdr(T_MsgHdr *MsgHdr, int iMsgId, unsigned _len = 0u); - // receiver - void ProcessPosMsg(const char *Msg, netAddress & SenderAddress, - unsigned len, long stamp); - void ProcessChatMsg(const char *Msg, netAddress & SenderAddress); void Update(void); private: + union MsgBuf; FGAIMultiplayer* addMultiplayer(const std::string& callsign, const std::string& modelName); FGAIMultiplayer* getMultiplayer(const std::string& callsign); + void FillMsgHdr(T_MsgHdr *MsgHdr, int iMsgId, unsigned _len = 0u); + void ProcessPosMsg(const MsgBuf& Msg, const netAddress& SenderAddress, + long stamp); + void ProcessChatMsg(const MsgBuf& Msg, const netAddress& SenderAddress); /// maps from the callsign string to the FGAIMultiplayer typedef std::map > MultiPlayerMap;