public void onStateSyncFinished(string message)
        {
            SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onStateSyncFinished: " + message);

            JSONObject eventJSON = new JSONObject(message);

            List <JSONObject> changedComponentsJSON = eventJSON["changedComponents"].list;
            List <string>     changedComponents     = new List <string>();

            foreach (var changedComponentJSON in changedComponentsJSON)
            {
                changedComponents.Add(changedComponentJSON.str);
            }

            List <JSONObject> failedComponentsJSON = eventJSON["failedComponents"].list;
            List <string>     failedComponents     = new List <string>();

            foreach (var failedComponentJSON in failedComponentsJSON)
            {
                failedComponents.Add(failedComponentJSON.str);
            }

            GrowSync.HandleStateSyncFinised();

            HighwayEvents.OnStateSyncFinished(changedComponents, failedComponents);
        }
        public void onStateResetFinished()
        {
            SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onStateResetFinished");

            GrowSync.HandleStateSyncFinised();

            HighwayEvents.OnStateResetFinished();
        }
        /* Internal SOOMLA events ... Not meant for public use */

        public void onConflict(string message)
        {
            SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onConflict:" + message);

            JSONObject eventJSON       = new JSONObject(message);
            string     remoteStateStr  = eventJSON["remoteState"].str;
            string     currentStateStr = eventJSON["currentState"].str;
            string     stateDiffStr    = eventJSON["stateDiff"].str;

            JSONObject remoteState  = new JSONObject(remoteStateStr);
            JSONObject currentState = new JSONObject(currentStateStr);
            JSONObject stateDiff    = new JSONObject(stateDiffStr);

            GrowSync.HandleStateSyncConflict(remoteState, currentState, stateDiff);
        }
Exemple #4
0
        void Start()
        {
            StoreEvents.OnSoomlaStoreInitialized += onSoomlaStoreInitialized;

            StoreEvents.OnUnexpectedStoreError += onUnexpectedStoreError;


            GrowHighway.Initialize();
            bool modelSync = true;
            bool stateSync = true;

            GrowSync.Initialize(modelSync, stateSync);
            GrowGifting.Initialize();
            SoomlaProfile.Initialize();
            GrowInsights.Initialize();
            SoomlaStore.Initialize(new IAPAssets());
            StartCoroutine("loadMainScene");
            Invoke("loadGameNotAsync", 4);
        }