Sign In Register

How can we help you today?

Start a new topic
Answered

Sending packet directly to the server e.g. in Unity

Hello!


In the Real-Time Services Tutorial at the Understanding GameSparks Real-Time it is mentioned that a packet could be sent directly to the server:

Clients can also send the packets directly to the server for it to be processed through Cloud Code.


In the other tutrial I found this:

// send the RTData with op-cdoe '120' and to all players.

gameSparksRTUnity.SendData (120, GameSparksRT.DeliveryIntent.RELIABLE, data);

// send the RTData with op-code '121' to only players 1 and 2

gameSparksRTUnity.SendData (121, GameSparksRT.DeliveryIntent.RELIABLE, data, new int[]{ 1, 2 });


How do I adress the server, so other clients will not get the packet automatically?


Thanks and Regads,

David.


 


Best Answer

Hi David,


You can send a packet directly and only to the server like so.

gameSparksRTUnity.SendData (121, GameSparksRT.DeliveryIntent.RELIABLE, data, new int[]{ 0 });


Hope this helps,

 - Steve

1 Comment

Answer

Hi David,


You can send a packet directly and only to the server like so.

gameSparksRTUnity.SendData (121, GameSparksRT.DeliveryIntent.RELIABLE, data, new int[]{ 0 });


Hope this helps,

 - Steve


1 person likes this
Login to post a comment