internal static void WriteRTData(Stream stream, RTData instance) { RTDataSerializer.WriteRTData(stream, instance); }
public void Configure(int opCode, GameSparksRT.DeliveryIntent intent, ArraySegment <byte>?payload, RTData data, params int[] targetPlayers) { OpCode = opCode; this.payload = payload; this.intent = intent; Data = data; if (targetPlayers != null) { this.TargetPlayers.AddRange(targetPlayers); } }
internal static RTData ReadRTData(Stream stream, BinaryReader br, RTData instance) { return(RTDataSerializer.ReadRTData(stream, br, instance)); }
public RTData SetData(uint index, RTData value) { data[index] = new RTVal(value); return(this); }
public int SendRTDataAndBytes(int opCode, GameSparksRT.DeliveryIntent intent, ArraySegment <byte>?payload, RTData data, params int[] targetPlayers) { CustomRequest csr = PooledObjects.CustomRequestPool.Pop(); try{ csr.Configure(opCode, intent, payload, data, targetPlayers); if (!useOnlyWebSockets && intent != GameSparksRT.DeliveryIntent.RELIABLE && ConnectState >= GameSparksRT.ConnectState.ReliableAndFastSend) { return(fastConnection.Send(csr)); } else { if (ConnectState >= GameSparksRT.ConnectState.ReliableOnly) { #if !__WINDOWS__ if (useOnlyWebSockets) { return(reliableWSConnection.Send(csr)); } else #endif { return(reliableConnection.Send(csr)); } } } }finally{ PooledObjects.CustomRequestPool.Push(csr); } return(0); }
public int SendRTData(int opCode, GameSparksRT.DeliveryIntent intent, RTData data, params int[] targetPlayers) { return(SendRTDataAndBytes(opCode, intent, null, data, targetPlayers)); }
public int SendData(int opCode, GameSparksRT.DeliveryIntent intent, byte[] payload, RTData data, params int[] targetPlayers) { if (payload == null) { return(SendRTDataAndBytes(opCode, intent, null, data, targetPlayers)); } else { return(SendRTDataAndBytes(opCode, intent, new ArraySegment <byte>(payload), data, targetPlayers)); } }