EventForward









How do I use Event Forward
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: LoadbalancingPeer.cs Copy
463         public virtual bool OpRaiseEvent(byte eventCode, object customEventContent, bool sendReliable, RaiseEventOptions raiseEventOptions)
464         {
465             opParameters.Clear(); // re-used private variable to avoid many new Dictionary() calls (garbage collection)
466             opParameters[(byte)LiteOpKey.Code] = (byte)eventCode;
467             if (customEventContent != null)
468             {
469                 opParameters[(byte) LiteOpKey.Data] = customEventContent;
470             }
471
472             if (raiseEventOptions == null)
473             {
474                 raiseEventOptions = RaiseEventOptions.Default;
475             }
476             else
477             {
478                 if (raiseEventOptions.CachingOption != EventCaching.DoNotCache)
479                 {
480                     opParameters[(byte) LiteOpKey.Cache] = (byte) raiseEventOptions.CachingOption;
481                 }
482                 if (raiseEventOptions.Receivers != ReceiverGroup.Others)
483                 {
484                     opParameters[(byte) LiteOpKey.ReceiverGroup] = (byte) raiseEventOptions.Receivers;
485                 }
486                 if (raiseEventOptions.InterestGroup != 0)
487                 {
488                     opParameters[(byte) LiteOpKey.Group] = (byte) raiseEventOptions.InterestGroup;
489                 }
490                 if (raiseEventOptions.TargetActors != null)
491                 {
492                     opParameters[(byte) LiteOpKey.ActorList] = raiseEventOptions.TargetActors;
493                 }
494                 if (raiseEventOptions.ForwardToWebhook)
495                 {
496                     opParameters[(byte) ParameterCode.EventForward] = true; //TURNBASED
497                 }
498             }
499
500             return this.OpCustom((byte)LiteOpCode.RaiseEvent, opParameters, sendReliable, raiseEventOptions.SequenceChannel, raiseEventOptions.Encrypt);
501         }

EventForward 133 lượt xem

Gõ tìm kiếm nhanh...