Esempio n. 1
0
    public void OnSuccess(object response)
    {
        Game game = (Game)response;

        App42Log.Console("gameName is " + game.GetName());
        for (int i = 0; i < game.GetScoreList().Count; i++)
        {
            SaveHS.render.sprite = SaveHS.error[0];
            SaveHS.ranks[i].text = (i + 1).ToString();
            if (i > 2)
            {
                SaveHS.names[i].text = game.GetScoreList()[i].GetUserName().ToLower();
            }
            else
            {
                SaveHS.names[i].text = game.GetScoreList()[i].GetUserName().ToUpper();
            }
            SaveHS.score[i].text = game.GetScoreList()[i].GetValue().ToString();
            Debug.Log("highscore foi salvo");
            // App42Log.Console("userName is : " + game.GetScoreList()[i].GetUserName());
            //  App42Log.Console("score is : " + game.GetScoreList()[i].GetValue());

            // Debug.Log("A posiçao é "+(i+1)+ " is " + game.GetScoreList()[i].GetUserName() + " Score is" + game.GetScoreList()[i].GetValue());
        }
    }
Esempio n. 2
0
    public void OnException(Exception e)
    {
        App42Log.Console("Exception : " + e);
        SaveHS.render.sprite = SaveHS.error[1];

        SaveHS.reload.SetActive(true);
    }
Esempio n. 3
0
    public void OnSuccess(object response)
    {
        Game game = (Game)response;

        App42Log.Console("gameName is " + game.GetName());
        App42Log.Console("gameDescription is " + game.GetDescription());
    }
Esempio n. 4
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. 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];
    }
Esempio n. 6
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();
        }
    }
Esempio n. 7
0
    public void OnSuccess(object response)
    {
        User user = (User)response;

        App42Log.Console("userName is " + user.GetUserName());
        App42Log.Console("emailId is " + user.GetEmail());
    }
    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();
        }
    }
    //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());
    }
 // 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. 11
0
        public void OnSuccess(object response)
        {
            Debug.Log("Adding photo succesfull");
            Album album = (Album)response;

            App42Log.Console("userName is :" + album.GetUserName());
            App42Log.Console("albumName is :" + album.GetName());
            App42Log.Console("Description is :" + album.GetDescription());
            App42Log.Console("jsonResponse is :" + album.ToString());
            IList <Album.Photo> photoList = album.GetPhotoList();;

            for (int i = 0; i < photoList.Count; i++)
            {
                App42Log.Console("PhotoName is :" + photoList[i].GetName());
                App42Log.Console("Url is :" + photoList[i].GetUrl());
                App42Log.Console("TinyUrl is :" + photoList[i].GetTinyUrl());
                App42Log.Console("ThumbNailUrl is :" + photoList[i].GetThumbNailUrl());
                App42Log.Console("ThumbNailTinyUrl is :" + photoList[i].GetThumbNailTinyUrl());
                App42Log.Console("jsonResponse is :" + photoList[i].ToString());
                Common.playerInformation.SetURL(photoList[i].GetUrl(), 0);
            }

            Common.cloudServiceMaster.PhotoAddWasSuccesfull();
            // updateDelegateForPhotoAddSuccesfull();
        }
Esempio n. 12
0
 public void OnException(Exception e)
 {
     App42Log.Console("Exception : " + e);
     if (callback != null)
     {
         callback(false);
     }
 }
Esempio n. 13
0
 public void OnException(Exception e)
 {
     App42Log.Console("Exception : " + e);
     if (callback != null)
     {
         callback(false, new List <Dictionary <string, string> >());
     }
 }
        public void OnSuccess(object response)
        {
            albumRemoving = false;
            Debug.Log("AlbumRemoved");
            App42Response app42Response = (App42Response)response;

            App42Log.Console("app42Response is :" + app42Response.ToString());
        }
Esempio n. 15
0
 public void OnSuccess(object response)
 {
     if (response is JObject)
     {
         JObject objecti = (JObject)response;
         App42Log.Console("objectName is : " + objecti["name"]);
         App42Log.Console("Success : " + response);
     }
 }
Esempio n. 16
0
    public void OnSuccess(object response)
    {
        User user = (User)response;

        App42Log.Console("userName is " + user.GetUserName());
        App42Log.Console("emailId is " + user.GetEmail());
        PlayerPrefs.SetString("user", user.GetUserName());
        leaderSkripta.recivedUser = user.GetUserName();
    }
Esempio n. 17
0
        public void OnException(Exception e)
        {
            App42Exception exception    = (App42Exception)e;
            int            appErrorCode = exception.GetAppErrorCode();

            if (appErrorCode == 2001)
            {
            }
            App42Log.Console("Exception : " + e);
        }
Esempio n. 18
0
        public void OnSuccess(object response)
        {
            User user = (User)response;

            App42Log.Console("userName is " + user.GetUserName());
            App42Log.Console("sessionId is " + user.GetSessionId());
            MultiplayerManager.connectToWarp(user.GetUserName());
            PlayerPrefs.SetString("username", user.GetUserName());
            LoginResultScreen.login_result = 0;
        }
Esempio n. 19
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. 21
0
        public void OnSuccess(object response)
        {
            Debug.Log("Creating album was succesfull");
            Album album = (Album)response;

            App42Log.Console("userName is :" + album.GetUserName());
            App42Log.Console("albumName is :" + album.GetName());
            App42Log.Console("Description is :" + album.GetDescription());
            App42Log.Console("jsonResponse is :" + album.ToString());
        }
        public void OnSuccess(object response)
        {
            Storage storage = (Storage)response;
            IList <Storage.JSONDocument> jsonDocList = storage.GetJsonDocList();

            for (int i = 0; i < jsonDocList.Count; i++)
            {
                App42Log.Console("objectId is " + jsonDocList[i].GetDocId());
                App42Log.Console("jsonDoc is " + jsonDocList[i].GetJsonDoc());
            }
        }
Esempio n. 23
0
        public void OnSuccess(object response)
        {
            User user = (User)response;

            App42Log.Console("userName is " + user.GetUserName());
            App42Log.Console("emailId is " + user.GetEmail());
            MultiplayerManager.connectToWarp(user.GetUserName());
            PlayerPrefs.SetString("username", user.GetUserName());
            //	REGISTER SUCCESSFUL
            RegisterResultScreen.setRegResult(0);
        }
        public void OnSuccess(object response)
        {
            Storage storage = (Storage)response;
            IList <Storage.JSONDocument> jsonDocList = storage.GetJsonDocList();

            for (int i = 0; i < jsonDocList.Count; i++)
            {
                App42Log.Console("objectId is " + jsonDocList[i].GetDocId());
                App42Log.Console("Created At " + jsonDocList[i].GetCreatedAt());
                Common.roundInformation.savedGameDataID = jsonDocList[i].GetDocId();
            }
        }
Esempio n. 25
0
        public void OnSuccess(object response)
        {
            Game game = (Game)response;

            App42Log.Console("gameName is " + game.GetName());
            for (int i = 0; i < game.GetScoreList().Count; i++)
            {
                App42Log.Console("userName is : " + game.GetScoreList()[i].GetUserName());
                App42Log.Console("score is : " + game.GetScoreList()[i].GetValue());
                App42Log.Console("scoreId is : " + game.GetScoreList()[i].GetScoreId());
            }
            callback(true);
        }
Esempio n. 26
0
    public void OnSuccess(object response)
    {
        Game game = (Game)response;

        App42Log.Console("gameName is " + game.GetName());
        for (int i = 0; i < game.GetScoreList().Count; i++)
        {
            App42Log.Console("userName is : " + game.GetScoreList()[i].GetUserName());
            App42Log.Console("score is : " + game.GetScoreList()[i].GetValue());
            App42Log.Console("scoreId is : " + game.GetScoreList()[i].GetScoreId());
            leaderSkripta.recivedScore = game.GetScoreList()[i].GetValue() + "";
        }
    }
Esempio n. 27
0
    public void OnSuccess(object response)
    {
        Game game = (Game)response;

        App42Log.Console("gameName is " + game.GetName());

        for (int i = 0; i < game.GetScoreList().Count; i++)
        {
            //App42Log.Console("userName is : " + game.GetScoreList()[i].GetUserName());
            // App42Log.Console("score is : " + game.GetScoreList()[i].GetValue());
            SaveHS.salvouhs = true;
            Debug.Log("salvo");
        }
    }
        public void OnSuccess(object response)
        {
            IList <Album> album = (IList <Album>)response;

            albumsLoaded  = album;
            albumsLoading = false;
            for (int i = 0; i < album.Count; i++)
            {
                App42Log.Console("userName is :" + album[i].GetUserName());
                App42Log.Console("albumName is :" + album[i].GetName());
                App42Log.Console("Description is :" + album[i].GetDescription());
                App42Log.Console("jsonResponse is :" + album[i].ToString());
            }
        }
Esempio n. 29
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);
 }
        public void OnSuccess(object response)
        {
            Upload upload = (Upload)response;
            IList <Upload.File> fileList = upload.GetFileList();

            for (int i = 0; i < fileList.Count; i++)
            {
                App42Log.Console("fileName is " + fileList[i].GetName());
                App42Log.Console("fileType is " + fileList[i].GetType());
                App42Log.Console("fileUrl is " + fileList[i].GetUrl());
                App42Log.Console("TinyUrl Is  : " + fileList[i].GetTinyUrl());
                App42Log.Console("fileDescription is " + fileList[i].GetDescription());
                Common.cloudImageManager.cbgetFileGO.SendMessage(Common.cloudImageManager.callBackToUploadFile, fileList[i].GetUrl());
            }
        }