/// <summary> /// Send an event with custom code/type and any content to the other players in the same room. /// </summary> /// <remarks>This override explicitly uses another parameter order to not mix it up with the implementation for Hashtable only.</remarks> /// <param name="eventCode">Identifies this type of event (and the content). Your game's event codes can start with 0.</param> /// <param name="customEventContent">Any serializable datatype (including Hashtable like the other OpRaiseEvent overloads).</param> /// <param name="sendReliable">If this event has to arrive reliably (potentially repeated if it's lost).</param> /// <param name="raiseEventOptions">Contains (slightly) less often used options. If you pass null, the default options will be used.</param> /// <returns>If operation could be enqueued for sending. Sent when calling: Service or SendOutgoingCommands.</returns> public virtual bool OpRaiseEvent(byte eventCode, object customEventContent, bool sendReliable, RaiseEventOptions raiseEventOptions) { if (this.loadBalancingPeer == null) { return false; } return this.loadBalancingPeer.OpRaiseEvent(eventCode, customEventContent, sendReliable, raiseEventOptions); }
/// <summary> /// Send an event with custom code/type and any content to the other players in the same room. /// </summary> /// <remarks>This override explicitly uses another parameter order to not mix it up with the implementation for Hashtable only.</remarks> /// <param name="eventCode">Identifies this type of event (and the content). Your game's event codes can start with 0.</param> /// <param name="customEventContent">Any serializable datatype (including Hashtable like the other OpRaiseEvent overloads).</param> /// <param name="sendReliable">If this event has to arrive reliably (potentially repeated if it's lost).</param> /// <param name="raiseEventOptions">Contains (slightly) less often used options. If you pass null, the default options will be used.</param> /// <returns>If operation could be enqueued for sending. Sent when calling: Service or SendOutgoingCommands.</returns> public virtual bool OpRaiseEvent(byte eventCode, object customEventContent, bool sendReliable, RaiseEventOptions raiseEventOptions) { Dictionary<byte, object> opParameters = new Dictionary<byte, object>(); opParameters[(byte)ParameterCode.Code] = (byte)eventCode; if (customEventContent != null) { opParameters[(byte) ParameterCode.Data] = customEventContent; } if (raiseEventOptions == null) { raiseEventOptions = RaiseEventOptions.Default; } else { if (raiseEventOptions.CachingOption != EventCaching.DoNotCache) { opParameters[(byte) ParameterCode.Cache] = (byte) raiseEventOptions.CachingOption; } if (raiseEventOptions.Receivers != ReceiverGroup.Others) { opParameters[(byte) ParameterCode.ReceiverGroup] = (byte) raiseEventOptions.Receivers; } if (raiseEventOptions.InterestGroup != 0) { opParameters[(byte) ParameterCode.Group] = (byte) raiseEventOptions.InterestGroup; } if (raiseEventOptions.TargetActors != null) { opParameters[(byte) ParameterCode.ActorList] = raiseEventOptions.TargetActors; } if (raiseEventOptions.ForwardToWebhook) { opParameters[(byte) ParameterCode.EventForward] = true; //TURNBASED } } return this.OpCustom((byte)OperationCode.RaiseEvent, opParameters, sendReliable, raiseEventOptions.SequenceChannel, false); }