コード例 #1
0
 public BatchEvent(int count, float start, string name, BaseEventParam param)
 {
     this.count   = count;
     this.start   = start;
     this.name    = name;
     this.@params = param ?? new BaseEventParam();
 }
コード例 #2
0
        public static void Validate(string openId, string playerId, int timeout, Action callback)
        {
            _validSeq++;
            var validSeqTmp = _validSeq;

            Init(openId, playerId, timeout);

            var eve   = new BaseEvent(Events.InitSdk);
            var param = new BaseEventParam {
                Sv = SdKonfig.Version, Pi = playerId, Gi = GameInfo.GameId, Sc = 9
            };

            eve.@params = param;
            var list = new List <BaseEvent> {
                eve
            };

            PushEvent <BaseEventParam> (list, true, () => {
                if (validSeqTmp == _validSeq)
                {
                    callback?.Invoke();
                }
            });
            StartEventUpload();
        }
コード例 #3
0
 private static void AddEventToQueue(BaseEventParam param, string eventName)
 {
     param.Sv = SdKonfig.Version;
     param.Pi = Player.Id;
     param.Gi = GameInfo.GameId;
     param.Sc = 9;
     _queue.Add(new BaseEvent(param, eventName));
 }
コード例 #4
0
        public void OnEvent(string eventName, BaseEventParam param, Action <bool> callback)
        {
            var start  = Util.GetTime();
            var events = new List <BatchEvent> ();

            if (param == null)
            {
                param = new BaseEventParam();
            }
            events.Add(new BatchEvent(1, start, eventName, param));
            Util.Request(4, start, 0, events, callback);
        }
コード例 #5
0
 public BaseEvent(BaseEventParam param, string eventName)
 {
     this.@params   = param;
     this.eventName = eventName;
 }
コード例 #6
0
 public BaseEvent(string eventName)
 {
     this.@params   = new BaseEventParam();
     this.eventName = eventName;
 }