How can I know originator of onUpdatePeersReceieved(message)?

0 votes
When I call sendUpdatePeers(), other clients receive an onUpdatePeersReceieved() callback. However, there is no indication which client originated the sendUpdatePeers call.

I don't see anyway other than using crytographic signing to accomplish this without opening clients to spoofing from same-room clients. Crytography would be overkill for my real-time strategy game. Why don't they provide the client info in the callback?

I am using the Corona SDK.

Thanks,

Martin
asked Apr 7, 2014 in AppWarp by Martin (16 points)

1 Answer

+1 vote
 
Best answer

Are you using appwarp cloud or appwarp s2?

In AppWarp S2, you can do the following (instead of signing)

- have the clients send the updatePeers message. 

- override the BaseRoomAdaptor's handleUpdatePeersRequest

- In the override, set the sendNotification to false on the HandlingResult. Create a new byte array that is a copy of what was sent by the client, prefix it with the name of the sender - and broadCast the update using BroadcastUpdatePeers API of the room.

- The clients receiving the update can then parse the byte array (prefixed with the sender) and can be sure its not spoofed as you've overriden the function on the server side.

answered Apr 7, 2014 by dhruvc (1,099 points)
selected May 22, 2014 by Martin
Yes, I am (planning on) using AppWarp S2. It would have been nice to retain the option of using the Appwarp cloud however..
We do provide a hosting environment as well for AppWarp S2. Have you taken a look at GPaaS? http://app42paas.shephertz.com/dev-center/gpaas/
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...