Trouble sending hashtables from Marmalade SDK to photon srv
Options
I am having trouble sending hashtables across to other players using the Photon cloud server. I am using Marmalade SDK 7.4.1. The example project only uses passing objects, not has tables.
Here's my test code: I am sending
const nByte POS_X = 101;
int x = 1;
ev.put(POS_X, x);
mLoadBalancingClient.opRaiseEvent(false, ev, 101);
On the receiving side,
void NetworkLogic::customEventAction(int playerNr, nByte eventCode, const ExitGames::Common::Hashtable& eventContent)
{
const nByte POS_X = 101, POS_Y = 102, key2 = 103;
int x;
int myInt;
int command;
switch ((int)eventCode) {
case 0:
break;
case 1:
break;
case 101:
// nByte key and int value:
if (eventContent.getValue((POS_X)))
x = ExitGames::Common::ValueObject<int>(eventContent.getValue(POS_X)).getDataCopy();
break;
}
}
The function (eventContent.getValue((POS_X)) produces an access viotation exception.
I tried using ev.put(KeyObject<nByte>(POS_X), ValueObject<int>(x)); In that case, I get an ERROR_UNSUPPORTED_KEY_TYPE compilation error.
Any help would be much appreciated.
Thanks!
Here's my test code: I am sending
const nByte POS_X = 101;
int x = 1;
ev.put(POS_X, x);
mLoadBalancingClient.opRaiseEvent(false, ev, 101);
On the receiving side,
void NetworkLogic::customEventAction(int playerNr, nByte eventCode, const ExitGames::Common::Hashtable& eventContent)
{
const nByte POS_X = 101, POS_Y = 102, key2 = 103;
int x;
int myInt;
int command;
switch ((int)eventCode) {
case 0:
break;
case 1:
break;
case 101:
// nByte key and int value:
if (eventContent.getValue((POS_X)))
x = ExitGames::Common::ValueObject<int>(eventContent.getValue(POS_X)).getDataCopy();
break;
}
}
The function (eventContent.getValue((POS_X)) produces an access viotation exception.
I tried using ev.put(KeyObject<nByte>(POS_X), ValueObject<int>(x)); In that case, I get an ERROR_UNSUPPORTED_KEY_TYPE compilation error.
Any help would be much appreciated.
Thanks!
0
Comments
-
0