BasicLog() public static method

public static BasicLog ( string extraLog ) : void
extraLog string
return void
Exemplo n.º 1
0
        public static IEnumerator LimitedInitializeSenseix(string newAccessToken)
        {
            if (isInitializing)
            {
                Logger.BasicLog("already initializing");
                yield break;
            }
            isInitializing = true;

            yield return(GetSingletonInstance().StartCoroutine(WaitForWebGLInitializing()));

            SetSessionState(true);

            accessToken = newAccessToken;
            if (CheckAccessToken() == -1)
            {
                throw new Exception("The Thinksy Token you have provided is not of a valid length, please" +
                                    " register at https://developer.thinksylearn.com/ to create a valid key.  Then, fill " +
                                    "in the Game Access Token field of the ThinksyPlugin script on the Thinksy Prefab." +
                                    "  You can also test offline by checking the testing mode boolean on the Thinksy Prefab.");
            }

            //Creates a temporary account based on device id
            //returns an auth token. This is Syncronous.
            //Debug.Log("registering device");
            yield return(GetSingletonInstance().StartCoroutine(RegisterDevice()));

            //Debug.Log ("listing players");
            yield return(GetSingletonInstance().StartCoroutine(ListPlayers()));

            //Debug.Log("register all players");
            yield return(GetSingletonInstance().StartCoroutine(RegisterAllPlayers()));

            EndInitialize();
        }
Exemplo n.º 2
0
        static public void DrainProblems()
        {
            int problemsDrained = 0;

            while (newProblems.Count > 0)           //don't give it a little wiggle room...
            {
                newProblems.Dequeue();
                problemsDrained++;
            }
            Logger.BasicLog(problemsDrained + " problems drained.");
        }
Exemplo n.º 3
0
 public static void PushAllProblems()
 {
     if (answeredProblems.Count == 0)
     {
         return;
     }
     Logger.BasicLog("Pushing current queue of " + answeredProblems.Count + " problems.");
     Senseix.Message.Request.GetSingletonInstance().StartCoroutine(
         Message.Request.PostProblems(Senseix.SenseixSession.GetCurrentPlayerID(), answeredProblems));
     answeredProblems.Clear();
 }
Exemplo n.º 4
0
        public static IEnumerator InitializeSenseix(string newAccessToken)
        {
            //Debug.Log ("initializing");

            if (isInitializing)
            {
                Logger.BasicLog("already initializing");
                yield break;
            }
            isInitializing = true;

            yield return(GetSingletonInstance().StartCoroutine(WaitForWebGLInitializing()));

            SetSessionState(true);

            accessToken = newAccessToken;
            if (CheckAccessToken() == -1)
            {
                throw new Exception("The Thinksy Token you have provided is not of a valid length, please" +
                                    " register at https://developer.thinksylearn.com/ to create a valid key.  Then, fill " +
                                    "in the Game Access Token field of the ThinksyPlugin script on the Thinksy Prefab." +
                                    "  You can also test offline by checking the testing mode boolean on the Thinksy Prefab.");
            }

            //Creates a temporary account based on device id
            //returns an auth token. This is Syncronous.
            //Debug.Log("registering device");
            yield return(GetSingletonInstance().StartCoroutine(RegisterDevice()));

            //Debug.Log ("listing players");
            yield return(GetSingletonInstance().StartCoroutine(ListPlayers()));

            //Debug.Log("register all players");
            yield return(GetSingletonInstance().StartCoroutine(RegisterAllPlayers()));

            //Debug.Log("submit cache");
            SenseixSession.CheckProblemPostCacheSubmission();
            //SenseixPlugin.ShowEmergencyWindow ("testing");

            //yield return GetSingletonInstance().StartCoroutine(Message.Request.UpdatePlayerScore (GetCurrentPlayerID(), 0));
            //yield return GetSingletonInstance().StartCoroutine(Message.Request.GetPlayerRank (GetCurrentPlayerID ()));

            yield return(Message.Request.GetSingletonInstance().StartCoroutine(
                             Message.Request.GetProblems(SenseixSession.GetCurrentPlayerID(), ProblemKeeper.PROBLEMS_PER_PULL)));

            ThinksyPlugin.GetMostRecentProblem();
            isInitializing = false;
        }
 private static ConnectionIndicator GetSingletonInstance()
 {
     if (singletonInstance == null)
     {
         singletonInstance = FindObjectOfType <ConnectionIndicator>();
     }
     if (singletonInstance == null)
     {
         if (!warningThrown)
         {
             Logger.BasicLog("There is no ConnectionIndicator enabled in scene.");
         }
         warningThrown = true;
     }
     return(singletonInstance);
 }
Exemplo n.º 6
0
        static private void ReplaceSeed(Message.Problem.ProblemGetResponse reply)
        {
            Logger.BasicLog("Replacing seed file.");
            MemoryStream            stream           = new MemoryStream();
            ThinksyProtosSerializer customSerializer = new ThinksyProtosSerializer();

            customSerializer.Serialize(stream, reply);

            byte[] replacementBytes = stream.ToArray();
            try
            {
                FileStream newFile = System.IO.File.Create(PlayerSeedPath());
                SenseixSession.DoFileFlagging(PlayerSeedPath());
                newFile.Close();
            }
            catch
            {
                ThinksyPlugin.ShowEmergencyWindow("An error occurred while creating a seedfile in " + PlayerSeedPath());
            }
            stream.Close();
            System.IO.File.WriteAllBytes(SeedFilePath(), replacementBytes);
            SenseixSession.DoFileFlagging(SeedFilePath());
        }
Exemplo n.º 7
0
 public static void Heartbeat()
 {
     Logger.BasicLog("thump thump");
     Senseix.SenseixSession.GetEncouragements();
     ProblemKeeper.PushAllProblems();
 }