Refactored various message-related operations into the Message class.

- Replaces the XPCMessage struct.
 - Messages are now read from a UDPSocket by the Message class.
 - Printing messages to the log is now handled by the Message class.
 - In the future, may extend this class with command-specific subclasses that encapsulate additional message parsing functionality.
This commit is contained in:
Jason Watkins
2015-04-11 09:12:47 -07:00
parent 2736cd86de
commit 547eb4de18
9 changed files with 363 additions and 303 deletions

View File

@@ -19,17 +19,6 @@
extern XPLMDataRef multiplayer[20][17];
extern XPLMDataRef AIswitch;
struct XPCMessage
{
short connectionID;
char head[5];
char msg[5000];
int msglen;
struct sockaddr recvaddr;
};
void readMessage(XPC::UDPSocket* socket, struct XPCMessage * pMessage);
void buildXPLMDataRefs(void);
int almostequal(float arg1, float arg2, float tol);
@@ -39,8 +28,6 @@
int test(int buffer);
unsigned short getIP(struct sockaddr recvaddr, char *IP);
int printBufferToLog(struct XPCMessage & msg);
int fmini(int a, int b);