Beispiel #1
0
    IEnumerator LoadUserRanking()
    {
        WWW result;

        yield return(result = WWWUtils.DoWebRequestWithSpecificURL("http://www.contagotas.online/services/user/score/check/" + PlayerPrefs.GetInt("user_id").ToString() + "/"));

        Debug.Log("url result = " + result.text);

        if (result.text.ToUpper().Contains("ERROR"))
        {
            screenManager.ShowErrorScreen("error loading user score:" + result.text);
            yield break;
        }
        else
        {
            string json = StringUtils.DecodeBytesForUTF8(result.bytes);

            List <PlayerData> player = JsonConvert.DeserializeObject <List <PlayerData> >(json);

            playerName.text  = player[0].playerName;
            playerScore.text = player[0].playerPoints.ToString();

            UserData.userData.playerData.playerPoints = player[0].playerPoints;
            UserData.userData.Save();

            StartCoroutine(LoadRanking());
        }
    }
Beispiel #2
0
    IEnumerator HasGroup(int userID)
    {
        ShowLoadingScreen();
        WWW result;

        yield return(result = WWWUtils.DoWebRequest("hasGroup/" + userID + "/"));

        Debug.Log("url result = " + result.text);

        if (result.text == "true")
        {
            yield return(result = WWWUtils.DoWebRequest("list_by_user_id/" + userID + "/"));

            Debug.Log("url result = " + result.text);

            if (result.text.ToUpper().Contains("ERROR"))
            {
                ShowErrorScreen("error checking group:" + result.text);
                yield break;
            }
            else
            {
                string json = StringUtils.DecodeBytesForUTF8(result.bytes);

                List <GroupData> account = JsonConvert.DeserializeObject <List <GroupData> >(json);
                groupInfo = account[0];
                existingGroupScreenManager.ShowExistingGroup(groupInfo);
            }
        }
        else
        {
            inviteReceivedScreenManager.StartSearchForInvites();
        }
    }
Beispiel #3
0
    private static void BuilderPost(string uri, Hashtable data)
    {
        var statusUrl = EnvironmentUtils.Get("BUILD_STATUS_URL", string.Empty);

        if (!string.IsNullOrEmpty(statusUrl))
        {
            var jsonData = EB.Encoding.GetBytes(EB.JSON.Stringify(data));
            var url      = statusUrl + uri;

            //Hashtable headers = new Hashtable();
            //headers["Content-Type"] = "application/json";
            System.Collections.Generic.Dictionary <string, string> headers = new System.Collections.Generic.Dictionary <string, string>();
            headers.Add("Content-Type", "application/json");

            //headers["Content-Length"] = jsonData.Length;	// moko: unity 4.3 will handle www raw data lenght for you
            //EB.Debug.Log("Headers: {0}", headers);

            var www = new UnityWebRequest(url, UnityWebRequest.kHttpVerbPOST);
            www.uploadHandler   = (UploadHandler) new UploadHandlerRaw(jsonData);
            www.downloadHandler = (DownloadHandler) new DownloadHandlerBuffer();
            www.SetRequestHeader("Content-Type", "application/json");

            //var www = new WWW(url, jsonData, headers);
            //EB.Debug.Log("Status: " + www.url);
            WWWUtils.WaitOnWWW(www, false);
            //EB.Debug.Log("result: " + www.text);
        }
        else
        {
            Debug.LogWarning("Can not fetch env var 'BUILD_STATUS_URL' for posting builder email");
        }
    }
Beispiel #4
0
    IEnumerator CheckIfGroupExists(string groupName, string password)
    {
        screenManager.ShowLoadingScreen();

        WWW result;

        yield return(result = WWWUtils.DoWebRequest("exists/" + groupName + "/"));

        //yield return result = WWWUtils.DoWebRequestWithSpecificURL("http://localhost/contagotas/group/exists/" + groupName + "/" );
        Debug.Log("url result = " + result.text);

        if (result.text.ToUpper().Contains("ERROR"))
        {
            screenManager.ShowErrorScreen("error creating group:" + result.text);
            yield break;
        }

        if (result.text == "true")
        {
            screenManager.ShowCreateScreen();
            ShowGroupExistentErrorScreen();
        }
        else
        {
            StartCoroutine(CreateGroup(groupName, password));
        }
    }
Beispiel #5
0
    public static bool UploadTranslations()
    {
        string stoken = WWWUtils.AdminLogin();

        if (string.IsNullOrEmpty(stoken))
        {
            return(false);
        }

        var url = WWWUtils.AdminUrl("/localization/upload/english");

        EB.Localizer.Clear();
        var result = LoadAllFromResources(EB.Language.English, new string[] { "all" });
        // fixup all the \n
        var data = new Hashtable();

        foreach (var entry in result)
        {
            data[entry.Key] = entry.Value.Trim().Replace("\n", "\\n");
        }

        EB.Debug.Log(" source string count: " + data.Count);

        var form = new WWWForm();

        form.AddField("body", EB.JSON.Stringify(data));
        form.AddField("stoken", stoken);
        form.AddField("format", "json");
        return(WWWUtils.PostJson(url, form) != null);
    }
Beispiel #6
0
    public static Dictionary <EB.Language, string> DownloadTranslations()
    {
        string stoken = WWWUtils.AdminLogin();

        if (string.IsNullOrEmpty(stoken))
        {
            return(null);
        }

        var transData = new Dictionary <EB.Language, string>();

        var langs = new List <EB.Language>();

        langs.Add(EB.Language.English);
        langs.Add(EB.Language.ChineseSimplified);
        langs.Add(EB.Language.ChineseTraditional);

        foreach (var lang in langs)
        {
            var code = EB.Localizer.GetSparxLanguageCode(lang);
            var url  = WWWUtils.AdminUrl(string.Format("/localization/export/{0}?stoken={1}&format=csv&status=1&code=1", code, stoken));
            var csv  = WWWUtils.Get(url);
            if (string.IsNullOrEmpty(csv))
            {
                Debug.LogWarning("LocalizationUtils.WWWUtils.Get(" + url + ") = null");
                continue;
            }
            csv = csv.Replace(@"\\n", @"\n");
            transData.Add(lang, csv);
        }

        return(transData);
    }
Beispiel #7
0
    static void UploadContentManifest(WWWUtils.Environment env, string url, int enabled)
    {
        var stoken  = WWWUtils.AdminLogin(env);
        var postUrl = WWWUtils.GetAdminUrl(env) + "/bundlemanager/content/from-manifest?stoken=" + stoken;
        var form    = new WWWForm();

        form.AddField("url", url);
        form.AddField("enabled", enabled);
        WWWUtils.Post(postUrl, form);
    }
Beispiel #8
0
    IEnumerator JoinWithPassword(int groupID, string password)
    {
        StringBuilder sb = new StringBuilder();

        sb.Append("data={");
        sb.Append("\"groupid\"");
        sb.Append(":\"");
        sb.Append(groupID);
        sb.Append("\"");
        sb.Append(",");
        sb.Append("\"userid\"");
        sb.Append(":\"");
        sb.Append(PlayerPrefs.GetInt("user_id"));
        sb.Append("\"");
        sb.Append(",");
        sb.Append("\"password\"");
        sb.Append(":\"");
        sb.Append(password);
        sb.Append("\"");
        sb.Append("}");

        WWW result;

        screenManager.ShowLoadingScreen();
        yield return(result = WWWUtils.DoWebRequest("join/", sb.ToString()));

        ConfirmJoinPasswordInput.text = "";

        Debug.Log("url result = " + result.text);

        if (result.text.ToUpper().Contains("ERROR") || result.text.ToUpper().Contains("TIMEOUT"))
        {
            screenManager.ShowErrorScreen("Error joining group ->" + result.text);
        }
        else
        {
            string data = StringUtils.DecodeBytesForUTF8(result.bytes);

            if (data == "wrong password")
            {
                ConfirmJoinPasswordInput.text = "";
                joinConfirmFeedback.text      = LocalizationManager.GetTranslation("GroupWrongPass");
                screenManager.ShowGroup(ScreenType.CONFIRM_JOIN_GROUP);
                Debug.Log("Wrong Password");
            }
            else
            {
                List <GroupData> account   = JsonConvert.DeserializeObject <List <GroupData> >(data);
                GroupData        groupData = account[0];
                PlayerPrefs.SetInt("group_id", groupData.Id);
                Retry();
            }
        }
    }
Beispiel #9
0
    IEnumerator HasGroup()
    {
        WWW result;

        yield return(result = WWWUtils.DoWebRequest("hasGroup/" + PlayerPrefs.GetInt("user_id") + "/"));

        Debug.Log("url result = " + result.text);

        if (result.text == "false")
        {
            StartCoroutine(CheckInvite());
        }
    }
Beispiel #10
0
    IEnumerator StartSearchGroup()
    {
        if (groupToSearchInput.text == "")
        {
            yield break;
        }

        screenManager.ShowLoadingScreen();
        WWW result;

        yield return(result = WWWUtils.DoWebRequest("list_by_name/" + groupToSearchInput.text + "/"));

        Debug.Log("url result = " + result.text);

        if (result.text == "[]")
        {
            screenManager.ShowErrorScreen(LocalizationManager.GetTranslation("GroupNotFound"));
            yield break;
        }

        if (result.text.ToUpper().Contains("ERROR") || result.text.ToUpper().Contains("TIMEOUT"))
        {
            screenManager.ShowErrorScreen("error searching group:" + result.text);
            yield break;
        }

        screenManager.ShowGroup(ScreenType.JOIN_GROUP);

        string json = StringUtils.DecodeBytesForUTF8(result.bytes);

        List <GroupData> foundGroups = JsonConvert.DeserializeObject <List <GroupData> >(json);

        foreach (var item in screenManager.temporaryObjsList)
        {
            Destroy(item);
        }
        screenManager.temporaryObjsList.Clear();

        foreach (var group in foundGroups)
        {
            GameObject item = Instantiate(screenManager.GroupObjectPrefabs, searchResultParent);
            screenManager.temporaryObjsList.Add(item);
            GroupInfo groupInfoScript = item.GetComponent <GroupInfo>();
            groupInfoScript.joinGroupClicked += HandleJoinClickWithPassword;
            groupInfoScript.SetupGroupInfo(group.Name, group.Score, group.Id, false);
        }
    }
Beispiel #11
0
    IEnumerator AddScore(int groupid, int score)
    {
        WWW result;

        yield return(result = WWWUtils.DoWebRequest("score/" + groupid.ToString() + "/" + score.ToString() + "/" + PlayerPrefs.GetInt("user_id") + "/"));

        Debug.Log("url result = " + result.text);

        if (result.text == "success")
        {
            Debug.Log("Inserido score");
        }
        else
        {
            Debug.Log("ERROR:" + result.text);
        }
    }
Beispiel #12
0
    IEnumerator DeclineInvite(int inviteId)
    {
        WWW result;

        yield return(result = WWWUtils.DoWebRequest("invite/deny/" + inviteId + "/"));

        Debug.Log("url result = " + result.text);

        if (result.text.ToUpper().Contains("ERROR") || result.text.ToUpper().Contains("TIMEOUT"))
        {
            screenManager.ShowErrorScreen("Error declining invite ->" + result.text);
        }
        else
        {
            screenManager.CheckIfHasGroup();
        }
    }
Beispiel #13
0
    IEnumerator SearchForInvites()
    {
        screenManager.ShowLoadingScreen();
        WWW result;

        yield return(result = WWWUtils.DoWebRequest("invite/check/" + PlayerPrefs.GetInt("user_id") + "/"));

        Debug.Log("url result = " + result.text);

        if (result.text.ToUpper().Contains("ERROR") || result.text.ToUpper().Contains("TIMEOUT"))
        {
            screenManager.ShowErrorScreen("error checking invite:" + result.text);
            yield break;
        }

        string jsonDecoded = StringUtils.DecodeBytesForUTF8(result.bytes);

        List <InviteData> invites = JsonConvert.DeserializeObject <List <InviteData> >(jsonDecoded);

        foreach (var obj in screenManager.temporaryObjsList)
        {
            Destroy(obj);
        }
        screenManager.temporaryObjsList.Clear();

        if (invites.Count > 0)
        {
            foreach (var invite in invites)
            {
                GameObject item = Instantiate(InvitePrefab, InviteGroupParent);
                screenManager.temporaryObjsList.Add(item);
                InviteObject inviteObj = item.GetComponent <InviteObject> ();
                inviteObj.acceptButtonClicked  += HandleAcceptInvite;
                inviteObj.declineButtonClicked += HandleDeclineInvite;
                inviteObj.closeButtonClicked   += HandleCloseButtonClicked;
                inviteObj.SetupInviteInfo(invite.sender_name, invite.group_name, invite.id_invite);
            }

            screenManager.ShowGroup(ScreenType.RECEIVE_INVITES);
        }
        else
        {
            screenManager.ShowGroup(ScreenType.NEW_GROUP);
        }
    }
Beispiel #14
0
    IEnumerator LoadRanking()
    {
        LoadingContent.SetActive(true);
        MyGroupContent.SetActive(false);
        RankingContent.SetActive(false);
        SetButtonOn(rankingButton);
        SetButtonOff(groupButton);

        WWW result;

        yield return(result = WWWUtils.DoWebRequest("score/top/"));

        Debug.Log("url result = " + result.text);

        if (result.text.ToUpper().Contains("ERROR"))
        {
            screenManager.ShowErrorScreen("error leaving group:" + result.text);
            yield break;
        }
        else
        {
            //clearing all texts
            for (int i = 0; i < 8; i++)
            {
                GroupsName [i].text  = "";
                GroupsScore [i].text = "";
            }

            string json = StringUtils.DecodeBytesForUTF8(result.bytes);

            List <GroupData> rankedGroups = JsonConvert.DeserializeObject <List <GroupData> >(json);

            int index = 0;
            foreach (var group in rankedGroups)
            {
                GroupsName [index].text  = group.Name;
                GroupsScore [index].text = group.Score.ToString();
                index++;
            }

            LoadingContent.SetActive(false);
            MyGroupContent.SetActive(false);
            RankingContent.SetActive(true);
        }
    }
Beispiel #15
0
    public static string PutData(byte[] bytes, string name, string path)
    {
        var key = Path.Combine(BasePath, path);

        Debug.LogFormat("S3 Put: {0} -> {1}:/{2}", name, Bucket, key);

        if (string.IsNullOrEmpty(Bucket))
        {
            return(string.Empty);
        }

        WWWForm form = new WWWForm();

        form.AddField("key", key);
        form.AddField("acl", "public-read");
        form.AddField("AWSAccessKeyId", AccessKeyId);
        form.AddField("Policy", Policy);
        form.AddField("Signature", Signature);
        form.AddBinaryData("file", bytes, name);

        var contentType = MimeUtils.GetMimeType(Path.GetExtension(name));

        if (!string.IsNullOrEmpty(contentType))
        {
            form.AddField("Content-Type", contentType);
        }

        // make sure to upload the md5
        form.AddField("Content-MD5", CalculateMD5(bytes));

        var url    = "http://" + Bucket + ".s3.amazonaws.com/";
        var result = WWWUtils.Post(url, form);

        Debug.LogFormat("key {0} result: {1}", key, result);
        if (result.Contains("Error"))
        {
            throw new System.Exception("S3 upload failed! key: " + key + " result: " + result);
        }

        // GC
        System.GC.Collect();

        // return the url
        return(url + key);
    }
Beispiel #16
0
    IEnumerator AddUserScore(int score)
    {
        WWW result;

        yield return(result = WWWUtils.DoWebRequestWithSpecificURL("http://www.contagotas.online/services/user/score/" + PlayerPrefs.GetInt("user_id").ToString() + "/" + score.ToString() + "/"));

        Debug.Log("url result = " + result.text);

        if (result.text == "success")
        {
            ///save player points
            UserData.userData.playerData.playerPoints += score;
            UserData.userData.Save();
        }
        else
        {
            Debug.Log("ERROR:" + result.text);
        }
    }
Beispiel #17
0
    IEnumerator GetGroupInfo()
    {
        SetButtonOn(groupButton);
        SetButtonOff(rankingButton);
        LoadingContent.SetActive(true);
        MyGroupContent.SetActive(false);
        RankingContent.SetActive(false);

        WWW result;

        yield return(result = WWWUtils.DoWebRequest("score/get_detailed/" + groupData.Id + "/"));

        Debug.Log("url result = " + result.text);

        if (result.text.ToUpper().Contains("ERROR") || result.text.ToUpper().Contains("TIMEOUT"))
        {
            screenManager.ShowErrorScreen("error getting group info:" + result.text);
            yield break;
        }

        string json = StringUtils.DecodeBytesForUTF8(result.bytes);

        List <PlayerInfo> foundPlayers = JsonConvert.DeserializeObject <List <PlayerInfo> >(json);

        foreach (var item in screenManager.temporaryObjsList)
        {
            Destroy(item);
        }
        screenManager.temporaryObjsList.Clear();

        foreach (var player in foundPlayers)
        {
            GameObject item = Instantiate(PlayerDataObject, playerDataParentTransform);
            screenManager.temporaryObjsList.Add(item);
            PlayerDetailedInfo playerInfo = item.GetComponent <PlayerDetailedInfo>();
            playerInfo.SetupPlayerInfo(player.Name, player.Score);
        }
        LoadingContent.SetActive(false);
        MyGroupContent.SetActive(true);
        RankingContent.SetActive(false);
        screenManager.ShowGroup(ScreenType.EXISTING_GROUP);
    }
Beispiel #18
0
    static void UploadApkFiles(string apkPath, WWWUtils.Environment env)
    {
        try
        {
            var tmpDir = "/tmp/apk";
            GeneralUtils.DeleteDirectory(tmpDir, true);               // mko: cleaning up build folder
            Directory.CreateDirectory(tmpDir);

            // unzip
            var res = CommandLineUtils.Run("/usr/bin/unzip", string.Format("-d {0} {1}", tmpDir, apkPath));
            Debug.Log(res);

            // generate the app.dll
            var files = new List <string>(Directory.GetFiles("/tmp/apk/assets/bin/Data/Managed", "*.dll", SearchOption.TopDirectoryOnly));
            files.Sort(System.StringComparer.OrdinalIgnoreCase);

            List <byte> bytes = new List <byte>();
            foreach (string filePath in files)
            {
                Debug.Log("Adding file " + filePath);
                bytes.AddRange(File.ReadAllBytes(filePath));
            }

            Debug.Log("MSIL size is " + EB.Localizer.FormatNumber(bytes.Count, true));

            WWWForm form = new WWWForm();
            form.AddBinaryData("data", bytes.ToArray(), "data");
            form.AddField("version", EB.Version.GetVersion());
            form.AddField("platform", "android");
            form.AddField("sha1", EB.Encoding.ToBase64String(EB.Digest.Sha1().Hash(bytes.ToArray())));

            var stoken  = WWWUtils.AdminLogin(env);
            var postUrl = WWWUtils.GetAdminUrl(env) + "/protect/upload?stoken=" + stoken;
            res = WWWUtils.Post(postUrl, form);
            Debug.Log("version: " + res);
        }
        catch (System.Exception e)
        {
            Debug.Log("Build Failed: exception: " + e.ToString());
            Failed(e);
        }
    }
Beispiel #19
0
    IEnumerator LeaveGroup(int userID)
    {
        screenManager.ShowLoadingScreen();
        WWW result;

        yield return(result = WWWUtils.DoWebRequest("leave/" + userID + "/"));

        Debug.Log("url result = " + result.text);

        if (result.text.ToUpper().Contains("SUCCESS"))
        {
            PlayerPrefs.DeleteKey("group_id");
            screenManager.ShowGroup(ScreenType.NEW_GROUP);
        }
        else
        {
            screenManager.ShowErrorScreen("error leaving group:" + result.text);
            yield break;
        }
    }
Beispiel #20
0
    IEnumerator CreateGroup(string groupName, string password)
    {
        StringBuilder sb = new StringBuilder();

        sb.Append("data={");
        sb.Append("\"name\"");
        sb.Append(":\"");
        sb.Append(groupName);
        sb.Append("\"");
        sb.Append(",");
        sb.Append("\"password\"");
        sb.Append(":\"");
        sb.Append(password);
        sb.Append("\"");
        sb.Append("}");

        screenManager.ShowLoadingScreen();

        WWW result;

        yield return(result = WWWUtils.DoWebRequest("create/", sb.ToString()));

        Debug.Log("url result = " + result.text);

        if (result.text.ToUpper().Contains("ERROR"))
        {
            screenManager.ShowErrorScreen("error creating group:" + result.text);
            yield break;
        }

        int groupID;

        if (!int.TryParse(result.text, out groupID))
        {
            screenManager.ShowErrorScreen("error on group id:" + result.text);
            yield break;
        }

        StartCoroutine(joinManager.Join(groupID));
    }
Beispiel #21
0
    IEnumerator AcceptInvite(int inviteId)
    {
        screenManager.ShowLoadingScreen();
        WWW result;

        yield return(result = WWWUtils.DoWebRequest("invite/accept/" + inviteId + "/"));

        Debug.Log("url result = " + result.text);

        if (result.text.ToUpper().Contains("ERROR") || result.text.ToUpper().Contains("TIMEOUT"))
        {
            screenManager.ShowErrorScreen("Error accepting invite ->" + result.text);
        }
        else
        {
            string           json      = StringUtils.DecodeBytesForUTF8(result.bytes);
            List <GroupData> account   = JsonConvert.DeserializeObject <List <GroupData> >(json);
            GroupData        groupData = account[0];
            PlayerPrefs.SetInt("group_id", groupData.Id);
            Retry();
        }
    }
Beispiel #22
0
    public IEnumerator Join(int groupID)
    {
        screenManager.ShowLoadingScreen();
        WWW result;

        yield return(result = WWWUtils.DoWebRequest("join/" + groupID + "/" + PlayerPrefs.GetInt("user_id") + "/"));

        Debug.Log("url result = " + result.text);

        if (result.text.ToUpper().Contains("ERROR") || result.text.ToUpper().Contains("TIMEOUT"))
        {
            screenManager.ShowErrorScreen("Error joining group ->" + result.text);
        }
        else
        {
            string json = StringUtils.DecodeBytesForUTF8(result.bytes);

            List <GroupData> account   = JsonConvert.DeserializeObject <List <GroupData> >(json);
            GroupData        groupData = account[0];
            PlayerPrefs.SetInt("group_id", groupData.Id);
            screenManager.ShowExistingGroup(groupData);
        }
    }
Beispiel #23
0
        private IEnumerator DownloadIntoOrLoadWebPFromFolderRoutine(string folderPath, MonoBehaviour context, string url, Image image, Action onSuccess = null, Action <string> onError = null)
        {
            yield return(new WaitForEndOfFrame());

            string filePath = ImageDownloader.GetImageFilePathFromUrl(url, folderPath);

            if (!Directory.Exists(folderPath))
            {
                Directory.CreateDirectory(folderPath);
            }
            if (File.Exists(filePath))
            {
                LoadTextureFromWebP(File.ReadAllBytes(filePath));
                onSuccess?.Invoke();
            }
            else
            {
                WWWUtils.LoadBinaryFromWWW(this, url, bytes => {
                    LoadTextureFromWebP(bytes);
                    File.WriteAllBytes(filePath, bytes);
                    onSuccess?.Invoke();
                });
            }
        }
Beispiel #24
0
    IEnumerator LoadRanking()
    {
        WWW result;

        yield return(result = WWWUtils.DoWebRequestWithSpecificURL("http://www.contagotas.online/services/user/score/top10/"));

        Debug.Log("url result = " + result.text);

        if (result.text.ToUpper().Contains("ERROR"))
        {
            screenManager.ShowErrorScreen("error loading user ranking:" + result.text);
            yield break;
        }
        else
        {
            //clearing all texts
            for (int i = 0; i < 10; i++)
            {
                PlayersName [i].text  = "";
                PlayersScore [i].text = "";
            }

            string json = StringUtils.DecodeBytesForUTF8(result.bytes);

            List <PlayerData> rankedPlayers = JsonConvert.DeserializeObject <List <PlayerData> >(json);

            int index = 0;
            foreach (var playerData in rankedPlayers)
            {
                PlayersName [index].text  = playerData.playerName;
                PlayersScore [index].text = playerData.playerPoints.ToString();
                index++;
            }
            screenManager.ShowScreen(PlayerRankingScreenType.PLAYER_RANKING_SCREEN);
        }
    }
Beispiel #25
0
    public IEnumerator CheckInvite()
    {
        WWW result;

        yield return(result = WWWUtils.DoWebRequest("invite/check/" + PlayerPrefs.GetInt("user_id") + "/"));

        Debug.Log("url result = " + result.text);

        if (result.text.ToUpper().Contains("ERROR") || result.text.ToUpper().Contains("TIMEOUT"))
        {
            Debug.LogError("error checking invite:" + result.text);
            yield break;
        }

        string jsonDecoded = StringUtils.DecodeBytesForUTF8(result.bytes);

        List <InviteData> invites = JsonConvert.DeserializeObject <List <InviteData> >(jsonDecoded);

        if (invites.Count > 0)
        {
            notificationAssets.SetActive(true);
            notificationNumber.text = invites.Count.ToString();
        }
    }