Hi, just started learning Game sparks sdk and able find a match making. Can any one share a snippet that creates real time session and send packets between connected players..
The code I'm providing here will need to re worked for your individual case, but the basic principals will remain the same.
On Match Found should look something like this. This will create the real time session.
private void OnMatchFound(GameSparks.Api.Messages.MatchFoundMessage message)
On Real Time session ready. I send a packet here just to demonstrate.
private void OnRtReady(bool ready)
if (!ready) return;
var data = new RTData();
data.SetLong(1, (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0)).TotalMilliseconds);
_gameSparksManager.GameSparksRtUnity.SendData(101, GameSparksRT.DeliveryIntent.RELIABLE, data, 0);
On Packet Received.
private void OnPacketReceived(RTPacket packet)
The relevant Real Time Code Cloud to use here could be something like
.setNumber(2, new Date().getTime()))
I haven't included the OnPlayerConnect and Discconect but for the purpose of testing these can be private static methods.
Hope this helps,
I read somewhere a couple of months ago, one of the staff saying Android real-time is coming soon.
How soon can we get this please? been waiting for it since forever.