Sign In Register

How can we help you today?

Start a new topic

Socket control from cloud?

Hi


We're now using "Messages" with 0 expiration to push game data to devices.

And we would like to let users connect from different devices by logging the same GS account.

Users may play different games in the different devices, so we don't want to push data of all games to all devices.


Is it possible to push data directly via sockets to different devices instead of 

push data to a player account, then broadcast to all devices owned by the user.


Example:

An user has 2 devices A,B.  

In A, he entered a game X and plays.

In B, he entered a game Y and plays.


By Message mechanism provided now, I have to send all data to the "Player", and then GS servers sends all data to device A and B.

But I want to send data of X to device A, send data of Y to device B.


Thanks,

Jo



Hi Jo,

 

It is not possible to filter which websocket the specific data will go to. The messages, requests and responses will be sent to the websocket.

 

You can however set values that will help you filter messages depending on device. For example, if the player is in a game, the device they're using will note down which game it is playing right now by saving the game's ID.

 

So future messages will only be processed or displayed to the Player if they match some kind of criteria. Example:

 

A user has 2 devices A,B.

In A, he enters game X and plays. A keeps track of the game's ID or a value that help you recognise this device is associated to this match.

 

When the player does something that triggers a message because of game X, the message will have a custom value that helps you distinguish what game it came from (Or sequence of events) for example Game's X's ID.

Message:

data:{message:"hey!",gameID:Example12371287}

 

Device A and B will both receive this message, but a sequence will compare Device A and B's association and decide if they're associated to this game(you set this by saving a local variable of the games ID or anything else useful), if they are matching, then that message will only be processed by that device.

 

Hope this helps,

Omar

Hi Omar,


Thanks for detail reply.

I see. 

Just wanted to save the bandwidth for unneeded broadcasting.


Jo

Login to post a comment