Added C client support for multiplayer sendCTRL commands.

This commit is contained in:
Jason Watkins
2015-04-06 14:41:23 -07:00
parent 79f632f9a3
commit abf2a426d2
3 changed files with 123 additions and 57 deletions

View File

@@ -373,7 +373,12 @@ short sendPOSI(struct xpcSocket recfd, short ACNum, short numArgs, float valueAr
short sendCTRL(struct xpcSocket recfd, short numArgs, float valueArray[])
{
char message[26] = {0};
return sendpCTRL(recfd, numArgs, valueArray, 0);
}
short sendpCTRL(struct xpcSocket recfd, short numArgs, float valueArray[], char acNum)
{
char message[27] = { 0 };
int i;
short position = 5;
@@ -406,11 +411,11 @@ short sendCTRL(struct xpcSocket recfd, short numArgs, float valueArray[])
// Float Values
memcpy(&message[position],&val,sizeof(float));
position += sizeof(float);
}
}
}
message[position] = acNum;
sendUDP(recfd, message, 26);
sendUDP(recfd, message, 27);
return 0;
}

View File

@@ -70,8 +70,9 @@
// Controls
xpcCtrl parseCTRL(const char data[]);
xpcCtrl readCTRL(struct xpcSocket recfd);
short sendCTRL(struct xpcSocket recfd, short numArgs, float valueArray[]);
xpcCtrl readCTRL(struct xpcSocket recfd);
short sendCTRL(struct xpcSocket recfd, short numArgs, float valueArray[]);
short sendpCTRL(struct xpcSocket recfd, short numArgs, float valueArray[], char acNum);
// DREF Manipulation
short readDREF(struct xpcSocket recfd, float *resultArray[], short arraySizes[]);