public virtual bool OpRaiseEvent(byte eventCode, bool sendReliable, object customEventContent, byte channelId, EventCaching cache, int[] targetActors, ReceiverGroup receivers, byte interestGroup, bool forwardToWebhook) { var opParameters = new Dictionary <byte, object> { [ParameterCode.Code] = eventCode }; if (customEventContent != null) { opParameters[ParameterCode.Data] = customEventContent; } if (cache != EventCaching.DoNotCache) { opParameters[ParameterCode.Cache] = (byte)cache; } if (receivers != ReceiverGroup.Others) { opParameters[ParameterCode.ReceiverGroup] = (byte)receivers; } if (interestGroup != 0) { opParameters[ParameterCode.Group] = interestGroup; } if (targetActors != null) { opParameters[ParameterCode.ActorList] = targetActors; } if (forwardToWebhook) { opParameters[ParameterCode.EventForward] = true; //TURNBASED } return(OpCustom(OperationCode.RaiseEvent, opParameters, sendReliable, channelId, false)); }
public override bool OpRaiseEvent(byte eventCode, Hashtable evData, bool sendReliable, byte channelId, EventCaching cache, ReceiverGroup receivers) { if (PhotonNetwork.offlineMode) { return false; } return base.OpRaiseEvent(eventCode, evData, sendReliable, channelId, cache, receivers); }
public override bool OpRaiseEvent(byte eventCode, Hashtable evData, bool sendReliable, byte channelId, int[] targetActors, EventCaching cache) { if (PhotonNetwork.offlineMode) { return false; } return base.OpRaiseEvent(eventCode, evData, sendReliable, channelId, targetActors, cache); }
/// <summary> /// Calls operation RaiseEvent on the server, with full control of event-caching and the target receivers. /// </summary> /// <remarks> /// This method is described in one of its overloads. /// /// The cache parameter defines if and how this event will be cached server-side. Per event-code, your client /// can store events and update them and will send cached events to players joining the same room. /// /// The option EventCaching.DoNotCache matches the default behaviour of RaiseEvent. /// The option EventCaching.MergeCache will merge the costomEventContent into existing one. /// Values in the customEventContent Hashtable can be null to remove existing values. /// /// With the receivers parameter, you can chose who gets this event: Others (default), All (includes you as sender) /// or MasterClient. The MasterClient is the connected player with the lowest ActorNumber in this room. /// This player could get some privileges, if needed. /// /// Read more about Cached Events in the DevNet: http://doc.exitgames.com /// </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">Custom data you want to send along (use null, if none).</param> /// <param name="sendReliable">If this event has to arrive reliably (potentially repeated if it's lost).</param> /// <param name="channelId">Number of channel to use (starting with 0).</param> /// <param name="cache">Events can be cached (merged and removed) for players joining later on.</param> /// <param name="receivers">Controls who should get this event.</param> /// <returns>If operation could be enqueued for sending.</returns> public virtual bool OpRaiseEvent(byte eventCode, Hashtable customEventContent, bool sendReliable, byte channelId, EventCaching cache, ReceiverGroup receivers) { Dictionary<byte, object> opParameters = new Dictionary<byte, object>(); opParameters[(byte)LiteOpKey.Data] = customEventContent; opParameters[(byte)LiteOpKey.Code] = (byte)eventCode; if (cache != EventCaching.DoNotCache) { opParameters[(byte)LiteOpKey.Cache] = (byte)cache; } if (receivers != ReceiverGroup.Others) { opParameters[(byte)LiteOpKey.ReceiverGroup] = (byte)receivers; } return this.OpCustom((byte)LiteOpCode.RaiseEvent, opParameters, sendReliable, channelId, false); }
public virtual bool OpRaiseEvent(byte eventCode, bool sendReliable, object customEventContent, byte channelId, EventCaching cache, int[] targetActors, ReceiverGroup receivers, byte interestGroup) { Dictionary <byte, object> customOpParameters = new Dictionary <byte, object>(); customOpParameters[(byte)244] = (object)eventCode; if (customEventContent != null) { customOpParameters[(byte)245] = customEventContent; } if (cache != EventCaching.DoNotCache) { customOpParameters[(byte)247] = (object)cache; } if (receivers != ReceiverGroup.Others) { customOpParameters[(byte)246] = (object)receivers; } if ((int)interestGroup != 0) { customOpParameters[(byte)240] = (object)interestGroup; } if (targetActors != null) { customOpParameters[(byte)252] = (object)targetActors; } return(this.OpCustom((byte)253, customOpParameters, sendReliable, channelId, false)); }
///<summary> /// Calls operation RaiseEvent on the server, with full control of event-caching and the target receivers. /// </summary> /// <remarks> /// This method is described in one of its overloads. /// The cache parameter defines if and how this event will be cached server-side. Per event-code, your client /// can store events and update them and will send cached events to players joining the same room. /// The option EventCaching.DoNotCache matches the default behaviour of RaiseEvent. /// The option EventCaching.MergeCache will merge the costomEventContent into existing one. /// Values in the customEventContent Hashtable can be null to remove existing values. /// With the receivers parameter, you can chose who gets this event: Others (default), All (includes you as sender) /// or MasterClient. The MasterClient is the connected player with the lowest ActorNumber in this room. /// This player could get some privileges, if needed. /// Read more about Cached Events in the DevNet: http://doc.exitgames.com /// </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">Custom data you want to send along (use null, if none).</param> /// <param name="sendReliable">If this event has to arrive reliably (potentially repeated if it's lost).</param> /// <param name="channelId">Number of channel to use (starting with 0).</param> /// <param name="cache">Events can be cached (merged and removed) for players joining later on.</param> /// <param name="receivers">Controls who should get this event.</param> /// <returns>If operation could be enqueued for sending.</returns> public virtual bool OpRaiseEvent(byte eventCode, bool sendReliable, object customEventContent, byte channelId, EventCaching cache, int[] targetActors, ReceiverGroup receivers, byte interestGroup) { Dictionary <byte, object> opParameters = new Dictionary <byte, object>(); opParameters[0xf4] = eventCode; if (customEventContent != null) { opParameters[0xf5] = customEventContent; } if (cache != EventCaching.DoNotCache) { opParameters[0xf7] = (byte)cache; } if (receivers != ReceiverGroup.Others) { opParameters[0xf6] = (byte)receivers; } if (interestGroup != 0) { opParameters[240] = interestGroup; } if (targetActors != null) { opParameters[0xfc] = targetActors; } return(this.OpCustom(0xfd, opParameters, sendReliable, channelId, false)); }
/// <summary> /// Used in a room to raise (send) an event to the other players. /// Multiple overloads expose different parameters to this frequently used operation. /// </summary> /// <param name="eventCode">Code for this "type" of event (use a code per "meaning" or content).</param> /// <param name="evData">Data to send. Hashtable that contains key-values of Photon serializable datatypes.</param> /// <param name="sendReliable">Use false if the event is replaced by a newer rapidly. Reliable events add overhead and add lag when repeated.</param> /// <param name="channelId">The "channel" to which this event should belong. Per channel, the sequence is kept in order.</param> /// <param name="targetActors">Defines the target players who should receive the event (use only for small target groups).</param> /// <param name="cache">Use EventCaching options to store this event for players who join.</param> /// <returns>If the operation could be sent (has to be connected).</returns> public virtual bool OpRaiseEvent(byte eventCode, Hashtable evData, bool sendReliable, byte channelId, int[] targetActors, EventCaching cache) { if (this.DebugOut >= DebugLevel.INFO) { this.Listener.DebugReturn(DebugLevel.INFO, "OpRaiseEvent()"); } Dictionary <byte, object> opParameters = new Dictionary <byte, object>(); opParameters[ParameterCode.Data] = evData; opParameters[ParameterCode.Code] = (byte)eventCode; if (cache != EventCaching.DoNotCache) { opParameters[ParameterCode.Cache] = (byte)cache; } if (targetActors != null) { opParameters[ParameterCode.ActorList] = targetActors; } return(this.OpCustom(OperationCode.RaiseEvent, opParameters, sendReliable, channelId)); }
/// <summary> /// Used in a room to raise (send) an event to the other players. /// Multiple overloads expose different parameters to this frequently used operation. /// </summary> /// <param name="eventCode">Code for this "type" of event (use a code per "meaning" or content).</param> /// <param name="evData">Data to send. Hashtable that contains key-values of Photon serializable datatypes.</param> /// <param name="sendReliable">Use false if the event is replaced by a newer rapidly. Reliable events add overhead and add lag when repeated.</param> /// <param name="channelId">The "channel" to which this event should belong. Per channel, the sequence is kept in order.</param> /// <param name="targetActors">Defines the target players who should receive the event (use only for small target groups).</param> /// <param name="cache">Use EventCaching options to store this event for players who join.</param> /// <returns>If the operation could be sent (has to be connected).</returns> public virtual bool OpRaiseEvent(byte eventCode, Hashtable evData, bool sendReliable, byte channelId, int[] targetActors, EventCaching cache) { if (this.DebugOut >= DebugLevel.INFO) { this.Listener.DebugReturn(DebugLevel.INFO, "OpRaiseEvent()"); } Dictionary<byte, object> opParameters = new Dictionary<byte, object>(); opParameters[ParameterCode.Data] = evData; opParameters[ParameterCode.Code] = (byte)eventCode; if (cache != EventCaching.DoNotCache) { opParameters[ParameterCode.Cache] = (byte)cache; } if (targetActors != null) { opParameters[ParameterCode.ActorList] = targetActors; } return this.OpCustom(OperationCode.RaiseEvent, opParameters, sendReliable, channelId); }
public virtual bool OpRaiseEvent(byte eventCode, bool sendReliable, object customEventContent, byte channelId, EventCaching cache, int[] targetActors, ReceiverGroup receivers, byte interestGroup) { return(OpRaiseEvent(eventCode, sendReliable, customEventContent, channelId, cache, targetActors, receivers, interestGroup, false)); }
public virtual bool OpRaiseEvent(byte eventCode, Hashtable evData, bool sendReliable, byte channelId, EventCaching cache, ReceiverGroup receivers) { return(OpRaiseEvent(eventCode, sendReliable, evData, channelId, cache, null, receivers, 0, false)); }
public virtual bool OpRaiseEvent(byte eventCode, bool sendReliable, object customEventContent, byte channelId, EventCaching cache, int[] targetActors, ReceiverGroup receivers, byte interestGroup, bool forwardToWebhook) { Dictionary<byte, object> opParameters = new Dictionary<byte, object>(); opParameters[(byte)ParameterCode.Code] = (byte)eventCode; if (customEventContent != null) { opParameters[(byte)ParameterCode.Data] = customEventContent; } if (cache != EventCaching.DoNotCache) { opParameters[(byte)ParameterCode.Cache] = (byte)cache; } if (receivers != ReceiverGroup.Others) { opParameters[(byte)ParameterCode.ReceiverGroup] = (byte)receivers; } if (interestGroup != 0) { opParameters[(byte)ParameterCode.Group] = (byte)interestGroup; } if (targetActors != null) { opParameters[(byte)ParameterCode.ActorList] = targetActors; } if (forwardToWebhook) { opParameters[(byte) ParameterCode.EventForward] = true; //TURNBASED } return this.OpCustom((byte)OperationCode.RaiseEvent, opParameters, sendReliable, channelId, false); }
public virtual bool OpRaiseEvent(byte eventCode, bool sendReliable, object customEventContent, byte channelId, EventCaching cache, int[] targetActors, ReceiverGroup receivers, byte interestGroup) { return OpRaiseEvent(eventCode, sendReliable, customEventContent, channelId, cache, targetActors, receivers, interestGroup, false); }
public virtual bool OpRaiseEvent(byte eventCode, Hashtable evData, bool sendReliable, byte channelId, EventCaching cache, ReceiverGroup receivers) { return this.OpRaiseEvent(eventCode, sendReliable, evData, channelId, cache, null, receivers, 0, false); }
public virtual bool OpRaiseEvent(byte eventCode, Hashtable evData, bool sendReliable, byte channelId, int[] targetActors, EventCaching cache) { return this.OpRaiseEvent(eventCode, sendReliable, evData, channelId, cache, targetActors, ReceiverGroup.Others, 0, false); }
public override bool OpRaiseEvent(byte eventCode, bool sendReliable, object customEventContent, byte channelId, EventCaching cache, int[] targetActors, ReceiverGroup receivers, byte interestGroup) { if (PhotonNetwork.offlineMode) { return false; } return base.OpRaiseEvent(eventCode, sendReliable, customEventContent, channelId, cache, targetActors, receivers, interestGroup); }
/// <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="sendReliable">If this event has to arrive reliably (potentially repeated if it's lost).</param> /// <param name="customEventContent">Any serializable datatype (including Hashtable like the other OpRaiseEvent overloads).</param> /// <param name="channelId">Command sequence in which this command belongs. Must be less than value of ChannelCount property. Default: 0.</param> /// <param name="cache">Affects how the server will treat the event caching-wise. Can cache events for players joining later on or remove previously cached events. Default: DoNotCache.</param> /// <param name="targetActors">List of ActorNumbers (in this room) to send the event to. Overrides caching. Default: null.</param> /// <param name="receivers">Defines a target-player group. Default: Others.</param> /// <param name="interestGroup">Defines to which interest group the event is sent. Players can subscribe or unsibscribe to groups. Group 0 is always sent to all. Default: 0.</param> /// <returns>If operation could be enqueued for sending. Sent when calling: Service or SendOutgoingCommands.</returns> public virtual bool OpRaiseEvent(byte eventCode, bool sendReliable, object customEventContent, byte channelId, EventCaching cache, int[] targetActors, ReceiverGroup receivers, byte interestGroup) { Dictionary <byte, object> opParameters = new Dictionary <byte, object>(); opParameters[(byte)LiteOpKey.Code] = (byte)eventCode; if (customEventContent != null) { opParameters[(byte)LiteOpKey.Data] = customEventContent; } if (cache != EventCaching.DoNotCache) { opParameters[(byte)LiteOpKey.Cache] = (byte)cache; } if (receivers != ReceiverGroup.Others) { opParameters[(byte)LiteOpKey.ReceiverGroup] = (byte)receivers; } if (interestGroup != 0) { opParameters[(byte)LiteOpKey.Group] = (byte)interestGroup; } if (targetActors != null) { opParameters[(byte)LiteOpKey.ActorList] = targetActors; } return(this.OpCustom((byte)LiteOpCode.RaiseEvent, opParameters, sendReliable, channelId, false)); }
/// <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="sendReliable">If this event has to arrive reliably (potentially repeated if it's lost).</param> /// <param name="customEventContent">Any serializable datatype (including Hashtable like the other OpRaiseEvent overloads).</param> /// <param name="channelId">Command sequence in which this command belongs. Must be less than value of ChannelCount property. Default: 0.</param> /// <param name="cache">Affects how the server will treat the event caching-wise. Can cache events for players joining later on or remove previously cached events. Default: DoNotCache.</param> /// <param name="targetActors">List of ActorNumbers (in this room) to send the event to. Overrides caching. Default: null.</param> /// <param name="receivers">Defines a target-player group. Default: Others.</param> /// <param name="interestGroup">Defines to which interest group the event is sent. Players can subscribe or unsibscribe to groups. Group 0 is always sent to all. Default: 0.</param> /// <returns>If operation could be enqueued for sending. Sent when calling: Service or SendOutgoingCommands.</returns> public virtual bool OpRaiseEvent(byte eventCode, bool sendReliable, object customEventContent, byte channelId, EventCaching cache, int[] targetActors, ReceiverGroup receivers, byte interestGroup) { Dictionary<byte, object> opParameters = new Dictionary<byte, object>(); opParameters[(byte)LiteOpKey.Code] = (byte)eventCode; if (customEventContent != null) { opParameters[(byte)LiteOpKey.Data] = customEventContent; } if (cache != EventCaching.DoNotCache) { opParameters[(byte)LiteOpKey.Cache] = (byte)cache; } if (receivers != ReceiverGroup.Others) { opParameters[(byte)LiteOpKey.ReceiverGroup] = (byte)receivers; } if (interestGroup != 0) { opParameters[(byte)LiteOpKey.Group] = (byte)interestGroup; } if (targetActors != null) { opParameters[(byte)LiteOpKey.ActorList] = targetActors; } return this.OpCustom((byte)LiteOpCode.RaiseEvent, opParameters, sendReliable, channelId, false); }
public virtual bool OpRaiseEvent(byte eventCode, Hashtable evData, bool sendReliable, byte channelId, int[] targetActors, EventCaching cache) { return(OpRaiseEvent(eventCode, sendReliable, evData, channelId, cache, targetActors, ReceiverGroup.Others, 0, false)); }
/// <summary> /// Used in a room to raise (send) an event to the other players. /// Multiple overloads expose different parameters to this frequently used operation. /// </summary> /// <param name="eventCode">Code for this "type" of event (use a code per "meaning" or content).</param> /// <param name="evData">Data to send. Hashtable that contains key-values of Photon serializable datatypes.</param> /// <param name="sendReliable">Use false if the event is replaced by a newer rapidly. Reliable events add overhead and add lag when repeated.</param> /// <param name="channelId">The "channel" to which this event should belong. Per channel, the sequence is kept in order.</param> /// <param name="cache">Use EventCaching options to store this event for players who join.</param> /// <param name="receivers">ReceiverGroup defines to which group of players the event is passed on.</param> /// <returns>If the operation could be sent (has to be connected).</returns> public virtual bool OpRaiseEvent(byte eventCode, Hashtable evData, bool sendReliable, byte channelId, EventCaching cache, ReceiverGroup receivers) { if (this.DebugOut >= DebugLevel.INFO) { this.Listener.DebugReturn(DebugLevel.INFO, "OpRaiseEvent()"); } Dictionary<byte, object> opParameters = new Dictionary<byte, object>(); opParameters[ParameterCode.Data] = evData; opParameters[ParameterCode.Code] = (byte)eventCode; if (receivers != ReceiverGroup.Others) { opParameters[ParameterCode.ReceiverGroup] = (byte)receivers; } if (cache != EventCaching.DoNotCache) { opParameters[ParameterCode.Cache] = (byte)cache; } return this.OpCustom((byte)OperationCode.RaiseEvent, opParameters, sendReliable, channelId); }
public virtual bool OpRaiseEvent(byte eventCode, Hashtable customEventContent, bool sendReliable, byte channelId, EventCaching cache, ReceiverGroup receivers) { Dictionary <byte, object> customOpParameters = new Dictionary <byte, object>(); customOpParameters[(byte)245] = (object)customEventContent; customOpParameters[(byte)244] = (object)eventCode; if (cache != EventCaching.DoNotCache) { customOpParameters[(byte)247] = (object)cache; } if (receivers != ReceiverGroup.Others) { customOpParameters[(byte)246] = (object)receivers; } return(this.OpCustom((byte)253, customOpParameters, sendReliable, channelId, false)); }
/// <summary> /// Used in a room to raise (send) an event to the other players. /// Multiple overloads expose different parameters to this frequently used operation. /// </summary> /// <param name="eventCode">Code for this "type" of event (use a code per "meaning" or content).</param> /// <param name="evData">Data to send. Hashtable that contains key-values of Photon serializable datatypes.</param> /// <param name="sendReliable">Use false if the event is replaced by a newer rapidly. Reliable events add overhead and add lag when repeated.</param> /// <param name="channelId">The "channel" to which this event should belong. Per channel, the sequence is kept in order.</param> /// <param name="cache">Use EventCaching options to store this event for players who join.</param> /// <param name="receivers">ReceiverGroup defines to which group of players the event is passed on.</param> /// <returns>If the operation could be sent (has to be connected).</returns> public virtual bool OpRaiseEvent(byte eventCode, Hashtable evData, bool sendReliable, byte channelId, EventCaching cache, ReceiverGroup receivers) { if (this.DebugOut >= DebugLevel.INFO) { this.Listener.DebugReturn(DebugLevel.INFO, "OpRaiseEvent()"); } Dictionary <byte, object> opParameters = new Dictionary <byte, object>(); opParameters[ParameterCode.Data] = evData; opParameters[ParameterCode.Code] = (byte)eventCode; if (receivers != ReceiverGroup.Others) { opParameters[ParameterCode.ReceiverGroup] = (byte)receivers; } if (cache != EventCaching.DoNotCache) { opParameters[ParameterCode.Cache] = (byte)cache; } return(this.OpCustom((byte)OperationCode.RaiseEvent, opParameters, sendReliable, channelId)); }
///<summary> /// Calls operation RaiseEvent on the server, with full control of event-caching and the target receivers. /// </summary> /// <remarks> /// This method is described in one of its overloads. /// The cache parameter defines if and how this event will be cached server-side. Per event-code, your client /// can store events and update them and will send cached events to players joining the same room. /// The option EventCaching.DoNotCache matches the default behaviour of RaiseEvent. /// The option EventCaching.MergeCache will merge the costomEventContent into existing one. /// Values in the customEventContent Hashtable can be null to remove existing values. /// With the receivers parameter, you can chose who gets this event: Others (default), All (includes you as sender) /// or MasterClient. The MasterClient is the connected player with the lowest ActorNumber in this room. /// This player could get some privileges, if needed. /// Read more about Cached Events in the DevNet: http://doc.exitgames.com /// </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">Custom data you want to send along (use null, if none).</param> /// <param name="sendReliable">If this event has to arrive reliably (potentially repeated if it's lost).</param> /// <param name="channelId">Number of channel to use (starting with 0).</param> /// <param name="cache">Events can be cached (merged and removed) for players joining later on.</param> /// <param name="receivers">Controls who should get this event.</param> /// <returns>If operation could be enqueued for sending.</returns> public virtual bool OpRaiseEvent(byte eventCode, Hashtable customEventContent, bool sendReliable, byte channelId, EventCaching cache, ReceiverGroup receivers) { Dictionary <byte, object> opParameters = new Dictionary <byte, object>(); opParameters[0xf5] = customEventContent; opParameters[0xf4] = eventCode; if (cache != EventCaching.DoNotCache) { opParameters[0xf7] = (byte)cache; } if (receivers != ReceiverGroup.Others) { opParameters[0xf6] = (byte)receivers; } return(this.OpCustom(0xfd, opParameters, sendReliable, channelId, false)); }