Sign In Register

How can we help you today?

Start a new topic

SparkMessage.setPlayerIds([playerId]).Send(), the message is not only received by playerId, even by other connected users


our goal is to connect, our game gamespark, with an external server (so to use node libraries),

to do this, on external server we require the node.js library gamespark-node-server-sdk to run a websoket with gamspark,
when the websocket starts, authentication is done with a gamespark registered user (the playerId),

code
from external server node.js library gamespark-node-server-sdk
gameSparks.initPreviewListener(gameApiKey, gs_secret, . . .
gameSparks.sendAs( null, ".AuthenticationRequest", { userName: xxx, password: xxx}, . . .

from gamespark we launch the script
Spark.message().setSendViaSocket(true).setSendAsPush(false).setMessageData(content).setDeviceTypes(['server']).setPlayerIds( [playerId] ).send();
to send a message to the remote node instance,
so far it works, node istance receives the message!!!

the problem :
if there are more node istances connect simultaneously from different devices (each one with his own user/playerId) via websoket node.js library gamespark-node-server-sdk,
the message is not received only by recipient playerId, even by all other connected users,
it seems that the message were sent in broadcast

ps
we verified that the fact does not occur with users connected by their devices, they only receive messages addressed to their playerId
the fact occurs via websoket node.js library gamespark-node-server-sdk,

thanks in advance for your reply
Login to post a comment