GetCurrentPlayerID() 공개 정적인 메소드

public static GetCurrentPlayerID ( ) : string
리턴 string
예제 #1
0
        static public string PlayerSeedPath()
        {
            string PlayerName     = SenseixSession.GetCurrentPlayerID();
            string playerSeedPath = System.IO.Path.Combine(Application.persistentDataPath, PlayerName + SEED_FILE_EXTENSION);

            return(playerSeedPath);
        }
예제 #2
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;
        }
예제 #3
0
        public static IEnumerator InitializeSenseix(string newAccessToken)
        {
            //Debug.Log ("initializing");

            yield return(GetSingletonInstance().StartCoroutine(LimitedInitializeSenseix(newAccessToken)));

            //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();
            EndInitialize();
        }
예제 #4
0
        static public bool SubmitAnswer(Message.Problem.ProblemData answeredProblemData, Answer answer, bool correct)
        {
            Message.Problem.ProblemPost problem = new Message.Problem.ProblemPost();
            problem.correct = correct;

            //set Problem's answers to given ones
            string[] answerIDStrings = answer.GetAnswerIDs();
            Senseix.Message.Problem.AnswerIdentifier givenAnswerIDs = new Senseix.Message.Problem.AnswerIdentifier();
            foreach (string answerID in answerIDStrings)
            {
                givenAnswerIDs.uuid.Add(answerID);
            }

            problem.problem_id            = answeredProblemData.uuid;
            problem.answer_ids            = givenAnswerIDs;
            problem.player_id             = SenseixSession.GetCurrentPlayerID();
            problem.answered_at_unix_time = UnixTimeNow();
            AddAnsweredProblem(problem, answer);
            return(correct);
        }
예제 #5
0
 public static void GetProblems(uint numberOfProblems)
 {
     Message.Request.GetSingletonInstance().StartCoroutine(
         Message.Request.GetProblems(SenseixSession.GetCurrentPlayerID(), numberOfProblems));
 }