private FizzEvent BuildEvent(string sessionId, FizzEventType type, long timestamp, JSONNode fields)
        {
            try
            {
                UnityEngine.PlayerPrefs.SetString(KEY_SESSION_UPDATE_TS, (FizzUtils.Now() + _timeOffset).ToString());
                UnityEngine.PlayerPrefs.Save();

                return(new FizzEvent(
                           _userId,
                           type,
                           EVENT_VER,
                           sessionId,
                           timestamp,
                           PLATFORM,
                           BuildVer,
                           CustomDimesion01, CustomDimesion02, CustomDimesion03,
                           fields
                           ));
            }
            catch (Exception ex)
            {
                FizzLogger.E("Invalid event encountered: " + ex.Message);
                return(null);
            }
        }
Esempio n. 2
0
        public FizzEvent(
            string userId,
            FizzEventType type,
            int ver,
            string sessionId,
            long time,
            string platform,
            string build,
            string custom01,
            string custom02,
            string custom03,
            JSONNode fields
            )
        {
            if (userId == null)
            {
                throw FizzException.ERROR_INVALID_USER_ID;
            }
            if (sessionId == null)
            {
                throw new FizzException(FizzError.ERROR_BAD_ARGUMENT, "invalid_session_id");
            }

            Id        = ++idCounter;
            UserId    = userId;
            Type      = type;
            Version   = ver;
            SessionId = sessionId;
            Time      = time;
            Platform  = platform;
            Build     = build;
            Custom01  = custom01;
            Custom02  = custom02;
            Custom03  = custom03;
            Fields    = fields;
        }