// Use this for initialization
 void Start()
 {
     App42Log.SetDebug(true);        //Prints output in your editor console
                                     //   App42API.Initialize("API_KEY", "SECRET_KEY");
     albumService = App42API.BuildAlbumService();
     //   albumService.GetAlbums(userName, new UnityCallBack());
 }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     App42Log.SetDebug(true);
     Debug.Log("Start called -----" + this.gameObject.name);
     setListenerGameObject(this.gameObject.name);    // sets the name of the game object as a listener to which this script is assigned.
     registerForRemoteNotifications();
 }
Esempio n. 3
0
    IEnumerator GetHighScoresForDB(Animator anim)
    {
        App42Log.SetDebug(true);            //Print output in your editor console
        Query query      = QueryBuilder.Build("score", "0", Operator.GREATER_THAN);
        Query query1     = QueryBuilder.Build("name", PlayerPrefs.GetString("name"), Operator.EQUALS);
        Query queryfinal = QueryBuilder.CompoundOperator(query, Operator.AND, query1);

        storageService.FindDocsWithQueryPagingOrderBy("SCORES", "HighScores", queryfinal, 5, 0, OrderByType.DESCENDING, "name", callBack1);
        //FindDocsWithQueryPagingOrderBy("SCORES", "HighScores",max, offset, key1, OrderByType.ASCENDING, new UnityCallBack());
        Debug.Log("IN Enumerator " + callBack.getResult());
        while (callBack1.getResult() == 0)
        {
            yield return(new WaitForSeconds(0.5f));
        }
        if (callBack1.getResult() == 1)
        {
            string response = ScoreResponse.scores;
            Debug.Log("Response " + response);
            char   ch        = '"';
            char   ch1       = ' ';
            string newString = ((string)((string)response.Replace("{", "")).Replace("}", "")).Replace(ch, ch1).Replace("name :", "").Replace("score :", "").Replace(",", " : ");
            ScoreField.text = "" + newString;
            OpenPanel(anim);
            callBack1.setResult();
        }
        else if (callBack1.getResult() == 2)
        {
            ScoreField.text = "Something wen't Wrong Please Try again";
            callBack1.setResult();
        }
    }
    IEnumerator SaveScoreForUser()
    {
        App42Log.SetDebug(true);
        string json  = "{\"name\":\"Name1\",\"score\":\"score1\"}";
        string json1 = json.Replace("Name1", PlayerPrefs.GetString("name")).Replace("score1", score.text);

        storageService.InsertJSONDocument("SCORES", "HighScores", json1, callBack2);
        Debug.Log("IN Enumerator " + callBack2.getResult());
        while (callBack2.getResult() == 0)
        {
            yield return(new WaitForSeconds(0.5f));
        }
        Debug.Log("IN Enumerator " + callBack2.getResult());
        if (callBack2.getResult() == 1)
        {
            scoreStatus.text = "Your Score Submitted Successfully..";
            callBack2.setResult();
        }
        else if (callBack2.getResult() == 2)
        {
            //ScoreField.text = "Something wen't Wrong Please Try again";
            Debug.Log("Something wen't wrong");
            callBack2.setResult();
        }
    }
Esempio n. 5
0
    // Use this for initialization

    void Start()
    {
        goRank   = false;
        ranks    = new List <Text>();
        names    = new List <Text>();
        score    = new List <Text>();
        texts    = new List <GameObject>();
        reload   = relo;
        scorenew = false;
        otherMetaHeaders.Add("orderByDescending", "score");
        App42API.Initialize(key, secretkey);
        App42Log.SetDebug(true);
        gameserv       = App42API.BuildGameService();
        scoreboardserv = App42API.BuildScoreBoardService();
        scoreboardserv.SetOtherMetaHeaders(otherMetaHeaders);
        scoreboardserv.GetTopNRankers(gamename, maxplayers, new toprankMenu());
        if (texts.Count < 20)
        {
            for (int i = 0; i < 20; i++)
            {
                texts.Add(GameObject.Find("Text" + (i + 1)));
            }
            for (int i = 0; i < texts.Count; i++)
            {
                ranks.Add(texts [i].transform.FindChild("ran").GetComponent <Text> ());
                names.Add(texts [i].transform.FindChild("nome").GetComponent <Text> ());
                score.Add(texts [i].transform.FindChild("pt").GetComponent <Text> ());
            }
            //Debug.Log ("veioaquiDENOVO");
        }
        render    = GameObject.Find("hsImg").GetComponent <Image> ();
        error [0] = bla [0];
        error [1] = bla [1];
    }
    //RUN THIS WHEN THE GAME STARTS
    public void CreateGameDataToStorage(GameData data)
    {
        JSONClass  json         = new JSONClass();
        int        counter      = 0;
        string     nameGoer     = "ID";
        JsonArray  arrayExample = new JsonArray();
        JsonObject names        = new JsonObject();

        foreach (string id in data.participantIDs)
        {
            string name = nameGoer + counter.ToString();
            names[name] = id;
            counter++;
        }
        foreach (bool state in data.readyStates)
        {
            string name = "ISReady" + counter.ToString();
            names[name] = state;
            counter++;
        }
        names["StartTime"] = Time.time.ToString();
        //      arrayExample.Add(names);
        // arrayExample.Add(names);
        Debug.Log(arrayExample.ToJsonString());
        App42Log.SetDebug(true);        //Print output in your editor console
        storageService.InsertJSONDocument(dbName, Common.roundInformation.gameData.hostID, names.ToJsonString(), new UnityCallBack());
    }
Esempio n. 7
0
    // Use this for initialization
    void Start()
    {
        DontDestroyOnLoad(this);
        App42Log.SetDebug(true);
        App42API.Initialize(api_key, secret_key);
//		Debug.Log ("Start called -----" + this.gameObject.name);
//		#if !UNITY_EDITOR
        setListenerGameObject(this.gameObject.name);         // sets the name of the game object as a listener to which this script is assigned.
        //		#endif
    }
 void Start()
 {
             #if UNITY_EDITOR
     ServicePointManager.ServerCertificateValidationCallback = Validator;
             #endif
     App42API.Initialize(AppConstants.API_KEY, AppConstants.SECRET_KEY);
     App42API.EnableCrashEventHandler(false);
     App42Log.SetDebug(true);
     App42API.SetDbName(AppConstants.DB_NAME);
 }
Esempio n. 9
0
 public ServicesPage()
 {
     App42API.Initialize(Constants.apiKey, Constants.secretKey);
     App42Log.SetDebug(true);
     InitializeComponent();
     userService                  = App42API.BuildUserService();
     storageService               = App42API.BuildStorageService();
     gameService                  = App42API.BuildGameService();
     scoreBoardService            = App42API.BuildScoreBoardService();
     uploadService                = App42API.BuildUploadService();
     photoChooserTask             = new PhotoChooserTask();
     photoChooserTask.Completed  += new EventHandler <PhotoResult>(photoChooserTask_Completed);
     photoChooserTask2            = new PhotoChooserTask();
     photoChooserTask2.Completed += new EventHandler <PhotoResult>(photoChooserTask2_Completed);
 }
Esempio n. 10
0
 public void saveScore()
 {
     if (playerName != null && LeveliManeger._instance.getIdScore() == null)
     {
         Debug.Log(name);
         App42Log.SetDebug(true);
         scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
         Debug.Log(LeveliManeger._instance.getSkupniCas() + "skupni cassss");
         scoreBoardService.SaveUserScore(gameName, playerName, Mathf.Floor(LeveliManeger._instance.getSkupniCas() * 10), saveScoreCall);
     }
     else if (LeveliManeger._instance.getIdScore() != null)
     {
         scoreBoardService = sp.BuildScoreBoardService();
         scoreBoardService.EditScoreValueById(LeveliManeger._instance.getIdScore(), Mathf.Floor(LeveliManeger._instance.getSkupniCas() * 10), saveScoreCall);
     }
 }
Esempio n. 11
0
    void OnGUI()
    {
        if (Time.time % 2 < 1)
        {
            success = callBack.getResult();
        }

        // For Setting Up ResponseBox.
        GUI.TextArea(new Rect(10, 5, 1300, 175), success);


        //=======================================EMAIL_SERVICE=======================================

        if (GUI.Button(new Rect(50, 200, 200, 30), "CreateMailConfiguration"))
        {
            App42Log.SetDebug(true);

            emailService = sp.BuildEmailService();              // Initializing Email Service.
            emailService.CreateMailConfiguration(cons.emailHost, cons.emailPort, cons.mailId, cons.emailPassword, cons.isSSL, callBack);
        }

        //=======================================EMAIL_SERVICE=======================================

        if (GUI.Button(new Rect(260, 200, 200, 30), "RemoveEmailConfiguration"))
        {
            emailService = sp.BuildEmailService();              // Initializing Email Service.
            emailService.RemoveEmailConfiguration(cons.mailId, callBack);
        }

        //=======================================EMAIL_SERVICE=======================================

        if (GUI.Button(new Rect(470, 200, 200, 30), "GetEmailConfigurations"))
        {
            emailService = sp.BuildEmailService();              // Initializing Email Service.
            emailService.GetEmailConfigurations(callBack);
        }

        //=======================================EMAIL_SERVICE=======================================

        if (GUI.Button(new Rect(680, 200, 200, 30), "SendMail"))
        {
            emailService = sp.BuildEmailService();              // Initializing Email Service.
            emailService.SendMail(cons.sendTo, cons.sendSubject, cons.sendMsg, cons.mailId, EmailMIME.PLAIN_TEXT_MIME_TYPE, callBack);
        }
    }
Esempio n. 12
0
 IEnumerator SignIn(Animator anim)
 {
     App42Log.SetDebug(true);
     //App42Log.SetDebug(true);        //Print output in your editor console
     userService.Authenticate(username1.text, password1.text, callBack);
     Debug.Log("IN Enumerator " + callBack.getResult());
     while (callBack.getResult() == 0)
     {
         yield return(new WaitForSeconds(0.5f));
     }
     if (callBack.getResult() == 1)
     {
         PlayerPrefs.SetString("login_status", "True");
         PlayerPrefs.SetString("name", username1.text);
         PlayerPrefs.Save();
         Debug.Log(PlayerPrefs.GetString("login_status"));
         OpenPanel(anim);
     }
     else if (callBack.getResult() == 2)
     {
         //loginstatus.text = "Something wen't \n wrong try again.....";
         //loginstatus.color = Color.red;
         callBack.setResult();
     }
     else if (callBack.getResult() == 2002)
     {
         loginstatus.text  = "UserName/Password did  not match. Authentication Failed.";
         loginstatus.color = Color.red;
         callBack.setResult();
     }
     else if (callBack.getResult() == 2000)
     {
         loginstatus.text  = "User by the name " + username1.text + " does not exist. ";
         loginstatus.color = Color.red;
         callBack.setResult();
     }
     else if (callBack.getResult() == 2006)
     {
         loginstatus.text  = "Users do not exist.";
         loginstatus.color = Color.red;
         callBack.setResult();
     }
 }
Esempio n. 13
0
    void OnGUI()
    {
        if (Time.time % 2 < 1)
        {
            success = callBack.getResult();
        }
        // For Setting Up ResponseBox.
        GUI.TextArea(new Rect(10, 5, 1300, 175), success);

        //=========================================================================
        if (GUI.Button(new Rect(50, 200, 200, 30), "Run Java Code"))
        {
            App42Log.SetDebug(true);
            customCodeService = sp.BuildCustomCodeService();             // Initializing CustomCodeService.
            JSONClass jsonBody = new JSONClass();
            jsonBody.Add("name", "John");
            jsonBody.Add("age", 30);
            customCodeService.RunJavaCode(cons.customServiceName, jsonBody, new CustomCodeResponse());
        }
    }
Esempio n. 14
0
    void Start()
    {
        ranks  = new List <Text>();
        names  = new List <Text>();
        score  = new List <Text>();
        texts  = new List <GameObject>();
        reload = relo;
        App42API.Initialize(key, secretkey);
        gameserv       = App42API.BuildGameService();
        scoreboardserv = App42API.BuildScoreBoardService();
        App42Log.SetDebug(true);
        gameserv.GetGameByName(gamename, new gameCallback());
        if (PlayerPrefs.HasKey("highscore"))
        {
            highscore = PlayerPrefs.GetInt("highscore");
        }

        if (PlayerPrefs.HasKey("nome"))
        {
            name = PlayerPrefs.GetString("nome");
            scoreboardserv.SaveUserScore(gamename, name, highscore, new savehigh());
            Debug.Log("salva ai com nome " + name + " e com score " + highscore);
        }

        render   = GameObject.Find("hsImg").GetComponent <Image>();
        error[0] = bla[0];
        error[1] = bla[1];

        for (int i = 0; i < 20; i++)
        {
            texts.Add(GameObject.Find("Text" + (i + 1)));
        }
        for (int i = 0; i < texts.Count; i++)
        {
            ranks.Add(texts[i].transform.FindChild("ran").GetComponent <Text>());
            names.Add(texts[i].transform.FindChild("nome").GetComponent <Text>());
            score.Add(texts[i].transform.FindChild("pt").GetComponent <Text>());
        }
    }
Esempio n. 15
0
 public MyLeaderBoard()
 {
     App42Log.SetDebug(true);
     App42API.Initialize(API_KEY, SECRET_KEY);
     scoreBoardService = App42API.BuildScoreBoardService();
 }
Esempio n. 16
0
    void OnGUI()
    {
        if (Time.time % 2 < 1)
        {
            success = callBack.GetResult();
        }

        // For Setting Up ResponseBox.
        GUI.TextArea(new Rect(10, 5, 1100, 175), success);


        //======================================= Achievement Service======================================

        if (GUI.Button(new Rect(50, 200, 200, 30), "Create Achievement"))
        {
            App42Log.SetDebug(true);
            achievementService = sp.BuildAchievementService();             // Initializing Achievement Service.
            achievementService.CreateAchievement(cons.achievementName, cons.description, callBack);
        }

        //==================================== Achievement Service=========================================

        if (GUI.Button(new Rect(260, 200, 200, 30), "Earn Achievement"))
        {
            App42Log.SetDebug(true);
            achievementService = sp.BuildAchievementService();              // Initializing Achievement Service.
            achievementService.EarnAchievement(cons.userName, cons.achievementName, cons.gameName, cons.description, callBack);
        }

        //==================================== Achievement Service========================================

        if (GUI.Button(new Rect(470, 200, 200, 30), "GetAll Achievements ForUser"))
        {
            App42Log.SetDebug(true);
            achievementService = sp.BuildAchievementService();              // Initializing Achievement Service.
            achievementService.GetAllAchievementsForUser(cons.userName, callBack);
        }

        //===================================== Achievement Service=======================================

        if (GUI.Button(new Rect(680, 200, 200, 30), "GetAll Achievements ForUserInGame"))
        {
            App42Log.SetDebug(true);
            achievementService = sp.BuildAchievementService();              // Initializing Achievement Service.
            achievementService.GetAllAchievementsForUserInGame(cons.userName, cons.gameName, callBack);
        }

        //====================================== Achievement Service======================================

        if (GUI.Button(new Rect(890, 200, 200, 30), "GetAll Achievements"))
        {
            App42Log.SetDebug(true);
            achievementService = sp.BuildAchievementService();              // Initializing Achievement Service.
            achievementService.GetAllAchievements(callBack);
        }

        //====================================== Achievement Service======================================

        if (GUI.Button(new Rect(50, 250, 200, 30), "Get Achievement ByName"))
        {
            App42Log.SetDebug(true);
            achievementService = sp.BuildAchievementService();              // Initializing Achievement Service.
            achievementService.GetAchievementByName(cons.achievementName, callBack);
        }

        //======================================= Achievement Service=====================================

        if (GUI.Button(new Rect(260, 250, 200, 30), "GetUsers Achievement"))
        {
            App42Log.SetDebug(true);
            achievementService = sp.BuildAchievementService();              // Initializing Achievement Service.
            achievementService.GetUsersAchievement(cons.achievementName, cons.gameName, callBack);
        }
    }
Esempio n. 17
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("On navigated to loading");
            timeout = 0;

            MediaElementData[0] = t1;
            MediaElementData[1] = t2;

            Global.MyAudio[0] = App.GlobalMediaElement0;
            Global.MyAudio[1] = App.GlobalMediaElement1;
            Global.MyAudio[2] = App.GlobalMediaElement2;
            Global.MyAudio[3] = App.GlobalMediaElement3;
            Global.MyAudio[4] = App.GlobalMediaElement4;

            Global.opponentUsername = "";
            Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                ready.Text = Global.localUsername + " \nvs\n";
            });

            _dispatcherTimer = new DispatcherTimer {
                Interval = TimeSpan.FromSeconds(1)
            };
            _dispatcherTimer.Tick += UpdateMediaData;
            _dispatcherTimer.Start();

            i = 0;
            k = 0;
            B(false);

            requestCallback = this;
            App42API.Initialize(Constants.API_KEY, Constants.SECRET_KEY);
            App42Log.SetDebug(true);

            ServiceAPI api = new ServiceAPI(Constants.API_KEY, Constants.SECRET_KEY);

            storage       = api.BuildStorageService();
            uploadService = api.BuildUploadService();

            System.Diagnostics.Debug.WriteLine("Before warp");

            WarpClient.initialize(Constants.API_KEY, Constants.SECRET_KEY);

            WarpClient.setRecoveryAllowance(60);

            Global.warpClient = WarpClient.GetInstance();


            //trivia
            if ((int)settings["trigger"] == 0)
            {
                TriviaTB.Text = Global.TriviaB[(new Random()).Next(Global.TriviaB.Length)];
            }
            else
            {
                TriviaTB.Text = Global.TriviaH[(new Random()).Next(Global.TriviaH.Length)];
            }

            Global.disconnectSuccess       = false;
            Global.deleteSuccess           = false;
            Global.conListenObj            = new ConnectionListener(this);
            Global.roomReqListenerObj      = new RoomReqListener(this);
            Global.zoneReqListenerObj      = new ZoneRequestListener(this);
            Global.notificationListenerObj = new NotificationListener(this);

            Global.warpClient.AddConnectionRequestListener(Global.conListenObj);
            Global.warpClient.AddRoomRequestListener(Global.roomReqListenerObj);
            Global.warpClient.AddNotificationListener(Global.notificationListenerObj);
            Global.warpClient.AddZoneRequestListener(Global.zoneReqListenerObj);

            Global.warpClient.Connect(Global.localUsername);

            System.Diagnostics.Debug.WriteLine("after warp");
        }
Esempio n. 18
0
    void OnGUI()
    {
        if (Time.time % 2 < 1)
        {
            success = callBack.getResult();
        }

        // For Setting Up ResponseBox.
        GUI.TextArea(new Rect(10, 5, 1300, 175), success);


        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(50, 200, 200, 30), "Info"))
        {
            App42Log.SetDebug(true);
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.Info(msg, module, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(260, 200, 200, 30), "Debug"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.Debug(msg, module, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(470, 200, 200, 30), "Fatal"))
        {
            App42Log.SetDebug(true);
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.Fatal(msg, module, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(680, 200, 200, 30), "Error"))
        {
            App42Log.SetDebug(true);
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.Error(msg, module, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(890, 200, 200, 30), "FetchLogsByModule"))
        {
            App42Log.SetDebug(true);
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsByModule(module, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(50, 250, 200, 30), "FetchLogsByModuleAndText"))
        {
            App42Log.SetDebug(true);
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsByModuleAndText(module, text, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(260, 250, 200, 30), "SetEvent"))
        {
            App42Log.SetDebug(true);
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.SetEvent(eventName, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(470, 250, 200, 30), "FetchLogsByInfo"))
        {
            App42Log.SetDebug(true);
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsByInfo(callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(680, 250, 200, 30), "FetchLogsByDebug"))
        {
            App42Log.SetDebug(true);
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsByDebug(callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(890, 250, 200, 30), "FetchLogsByError"))
        {
            App42Log.SetDebug(true);
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsByError(callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(50, 300, 200, 30), "FetchLogsByFatal"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsByFatal(callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(260, 300, 200, 30), "FetchLogByDateRange"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogByDateRange(startDate, endDate, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(470, 300, 200, 30), "FetchLogsByInfoByPaging"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsByInfo(max, offSet, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(680, 300, 200, 30), "FetchLogsByDebugByPaging"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsByDebug(max, offSet, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(890, 300, 200, 30), "FetchLogsByErrorByPaging"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsByError(max, offSet, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(50, 350, 200, 30), "FetchLogsByFatalByPaging"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsByFatal(max, offSet, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(260, 350, 200, 30), "FetchLogsByModuleByPaging"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsByModule(module, max, offSet, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(470, 350, 200, 30), "FetchLogsByModuleAndTextByPaging"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsByModuleAndText(module, text, max, offSet, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(680, 350, 200, 30), "FetchLogByDateRangeByPaging"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogByDateRange(startDate, endDate, max, offSet, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(890, 350, 200, 30), "FetchLogsCountByModule"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsCountByModule(module, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(50, 400, 200, 30), "FetchLogsCountByModuleAndText"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsCountByModuleAndText(module, text, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(260, 400, 200, 30), "FetchLogsCountByInfo"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsCountByInfo(callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(470, 400, 200, 30), "FetchLogsCountByDebug"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsCountByDebug(callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(680, 400, 200, 30), "FetchLogsCountByError"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsCountByError(callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(890, 400, 200, 30), "FetchLogsCountByFatal"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogsCountByFatal(callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(50, 450, 200, 30), "FetchLogCountByDateRange"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.FetchLogCountByDateRange(startDate, endDate, callBack);
        }

        //=======================================LOG_SERVICE=======================================

        if (GUI.Button(new Rect(260, 450, 200, 30), "SetEvent"))
        {
            logService = sp.BuildLogService();              // Initializing Log Service.
            logService.SetEvent(module, eventName, callBack);
        }
    }
Esempio n. 19
0
 public void InitializeUserManagement()
 {
     userService = main_mpserver.ServiceApi.BuildUserService();
     App42Log.SetDebug(LogManager.IsActive);
 }
 // Use this for initialization
 void Start()
 {
     App42Log.SetDebug(true);        //Prints output in your editor console
     uploadService            = App42API.BuildUploadService();
     Common.cloudImageManager = this;
 }
Esempio n. 21
0
    void OnGUI()
    {
        if (Time.time % 2 < 1)
        {
            success = callBack.getResult();
        }
        // For Setting Up ResponseBox.
        GUI.TextArea(new Rect(10, 5, 1300, 175), success);

        //======================================{{{{************}}}}================================
        if (GUI.Button(new Rect(50, 200, 200, 30), "SaveUserScore"))
        {
            App42Log.SetDebug(true);
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.SaveUserScore(cons.gameName, cons.userName, userScore, callBack);
        }

        //======================================{{{{************}}}}=================================
        if (GUI.Button(new Rect(260, 200, 200, 30), "GetScoresByUser"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetScoresByUser(cons.gameName, cons.userName, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(470, 200, 200, 30), "GetHighestScoreByUser"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetHighestScoreByUser(cons.gameName, cons.userName, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(680, 200, 200, 30), "GetLowestScoreByUser"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetLowestScoreByUser(cons.gameName, cons.userName, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(890, 200, 200, 30), "GetTopRankings"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetTopRankings(cons.gameName, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(50, 250, 200, 30), "GetAverageScoreByUser"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetAverageScoreByUser(cons.gameName, cons.userName, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(260, 250, 200, 30), "GetLastScoreByUser"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetLastScoreByUser(cons.gameName, cons.userName, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(470, 250, 200, 30), "GetTopRankings"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetTopRankings(cons.gameName, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(680, 250, 200, 30), "GetTopNRankings"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetTopNRankings(cons.gameName, max, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(890, 250, 200, 30), "GetTopNRankers"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetTopNRankers(cons.gameName, max, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(50, 300, 200, 30), "GetTopRankingsByGroup"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            IList <string> userList = new List <string> ();
            userList.Add(cons.userName);
            userList.Add(cons.userName1);
            scoreBoardService.GetTopRankingsByGroup(cons.gameName, userList, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(260, 300, 200, 30), "GetTopNRankersByGroup"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            IList <string> userList = new List <string> ();
            userList.Add(cons.userName);
            userList.Add(cons.userName1);
            scoreBoardService.GetTopNRankersByGroup(cons.gameName, userList, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(470, 300, 200, 30), "EditScoreValueById"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            IList <string> userList = new List <string> ();
            userList.Add(cons.userName);
            userList.Add(cons.userName1);
            scoreBoardService.EditScoreValueById(cons.scoreId, userScore, callBack);
        }
    }
    void OnGUI()
    {
        if (Time.time % 2 < 1)
        {
            success = callBack.getResult();
        }
        // For Setting Up ResponseBox.
        GUI.TextArea(new Rect(10, 5, 1300, 175), success);

        //======================================{{{{************}}}}================================
        if (GUI.Button(new Rect(470, 160, 200, 30), "CreateGame"))
        {
            App42Log.SetDebug(true);
            gameService = sp.BuildGameService();              // Initializing ScoreBoard Service.
            gameService.CreateGame(cons.gameName, cons.description, callBack);
        }

        //======================================{{{{************}}}}================================
        if (GUI.Button(new Rect(50, 200, 200, 30), "SaveUserScore"))
        {
            App42Log.SetDebug(true);
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.SaveUserScore(cons.gameName, cons.userName, userScore, callBack);
        }

        //======================================{{{{************}}}}=================================
        if (GUI.Button(new Rect(260, 200, 200, 30), "GetScoresByUser"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetScoresByUser(cons.gameName, cons.userName, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(470, 200, 200, 30), "GetHighestScoreByUser"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetHighestScoreByUser(cons.gameName, cons.userName, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(680, 200, 200, 30), "GetLowestScoreByUser"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetLowestScoreByUser(cons.gameName, cons.userName, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(890, 200, 200, 30), "GetTopRankings"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetTopRankings(cons.gameName, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(50, 250, 200, 30), "GetAverageScoreByUser"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetAverageScoreByUser(cons.gameName, cons.userName, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(260, 250, 200, 30), "GetLastScoreByUser"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetLastScoreByUser(cons.gameName, cons.userName, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(470, 250, 200, 30), "GetTopRankings"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetTopRankings(cons.gameName, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(680, 250, 200, 30), "GetTopNRankings"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetTopNRankings(cons.gameName, max, callBack);
        }

        //======================================{{{{************}}}}==========================================
        if (GUI.Button(new Rect(890, 250, 200, 30), "GetTopNRankers"))
        {
            scoreBoardService = sp.BuildScoreBoardService();              // Initializing ScoreBoard Service.
            scoreBoardService.GetTopNRankers(cons.gameName, max, callBack);
        }
    }
Esempio n. 23
0
 public void CreateAlbum(string userName, string albumName)
 {
     App42Log.SetDebug(true);
     albumService.CreateAlbum(userName, albumName, description, new AlbumCallBack());
 }