private void ActionMatchesDataLoadedFunction(GP_TBM_LoadMatchesResult result)
    {
        AndroidMessage.Create("Loaded all matches", "will show all matches");
        bool loaded = false;
        List <GP_TBM_Match> matchDatas = new List <GP_TBM_Match>();

        foreach (KeyValuePair <string, GP_TBM_Match> dict in result.LoadedMatches)
        {
            //   AndroidMessage.Create("KEY VALUE PAIR ", "key "+dict.Key+" value mnumber"+dict.Value.MatchNumber.ToString());
            if (loaded == false)
            {
                //  DealWithMatchData(dict.Value);
            }
            loaded = true;
            matchDatas.Add(dict.Value);

            /* foreach (GP_Participant part in result.Match.Participants)
             * {
             *   AndroidMessage.Create("Participant", "Participant info " + part.DisplayName + " +" + part.IconImageUrl + " id " + part.id + " pid " + part.playerId);
             * }*/
        }
        matchDatasLoaded = matchDatas;
        // matchUI.SetActive(true);
        activeMatchesGridHandler.CreateMatches(matchDatas);
    }
Esempio n. 2
0
    private static void OnProductPurchased(BillingResult result)
    {
        //this flag will tell you if purchase is available
        //result.isSuccess


        //infomation about purchase stored here
        //result.purchase

        //here is how for example you can get product SKU
        //result.purchase.SKU


        if (result.isSuccess)
        {
            OnProcessingPurchasedProduct(result.purchase);
        }
        else
        {
            if (FailedPurchase != null)
            {
                FailedPurchase();
            }
            else
            {
                Debug.LogWarning("NOTHING IS SUBSCRIBED TO FailedPurchase DELEGATE");
            }

            AndroidMessage.Create("Product Purchase Failed", result.response.ToString() + " " + result.message);
        }
        Debug.Log("Purchased Responce: " + result.response.ToString() + " " + result.message);
    }
 public void LoadActiveMatchesInfo()
 {
     AndroidMessage.Create("Loading active matches info ", "loaad ");
     //takas  GooglePlayTBM.ActionMatchDataLoaded += ActionMatchDataLoadedFunction;
     // GooglePlayTBM.ActionMatchesResultLoaded += ActionMatchesDataLoadedFunction;
     GooglePlayTBM.Instance.LoadMatchesInfo(GP_TBM_MatchesSortOrder.SORT_ORDER_MOST_RECENT_FIRST, GP_TBM_MatchTurnStatus.MATCH_TURN_STATUS_MY_TURN, GP_TBM_MatchTurnStatus.MATCH_TURN_STATUS_THEIR_TURN);
 }
Esempio n. 4
0
 public static Task <ResultPush> AndroidAsync(AndroidMessage androidMessage)
 {
     return(Task <ResultPush> .Factory.StartNew(() =>
     {
         return Android(androidMessage);
     }));
 }
Esempio n. 5
0
    void Awake()
    {
        if (_instance != null)
        {
            DestroyImmediate(this);
        }

        IOSMessage.ClickMap("GameLaunch");
        AndroidMessage.ClickMap("GameLaunch");
        WebMessage.ClickMap("GameLaunch");

        _instance  = this;
        modleLayer = LayerMask.NameToLayer("Modle");
        UI3D_S     = LayerMask.NameToLayer("3DUI_S");
        UI3D_M     = LayerMask.NameToLayer("3DUI_M");
        UI3D_L     = LayerMask.NameToLayer("3DUI_L");

        canvas_S = GameObject.Find("Cube/MapRoot/TitleCanvas_S");
        canvas_M = GameObject.Find("Cube/MapRoot/TitleCanvas_M");
        canvas_L = GameObject.Find("Cube/MapRoot/TitleCanvas_L");
        canvas_S.gameObject.layer = DataManager.Instance.UI3D_S;
        canvas_M.gameObject.layer = DataManager.Instance.UI3D_M;
        canvas_L.gameObject.layer = DataManager.Instance.UI3D_L;

        StartCoroutine(LoadXml());
        lastDistance = Camera.main.orthographicSize;

        curCullingMask = Camera.main.cullingMask;
    }
    private void ActionAvailableGameSavesLoaded(GooglePlayResult res)
    {
        GooglePlaySavedGamesManager.ActionAvailableGameSavesLoaded -= ActionAvailableGameSavesLoaded;
        if (res.IsSucceeded)
        {
            try
            {
                foreach (GP_SnapshotMeta meta in GooglePlaySavedGamesManager.Instance.AvailableGameSaves)
                {
                    Debug.Log("Meta.Title: " + meta.Title);
                    Debug.Log("Meta.Description: " + meta.Description);
                    Debug.Log("Meta.CoverImageUrl): " + meta.CoverImageUrl);
                    Debug.Log("Meta.LastModifiedTimestamp: " + meta.LastModifiedTimestamp);
                    Debug.Log("Meta.TotalPlayedTime" + meta.TotalPlayedTime);
                }

                if (GooglePlaySavedGamesManager.Instance.AvailableGameSaves.Count > 0)
                {
                    GP_SnapshotMeta s = GooglePlaySavedGamesManager.Instance.AvailableGameSaves[0];
                    GooglePlaySavedGamesManager.Instance.LoadSpanshotByName(s.Title);
                }
            }
            catch (Exception e)
            {
                Debug.Log("ActionAvailableGameSavesLoaded Exception: " + e.Message);
                AndroidNativeUtility.HidePreloader();
            }
        }
        else
        {
            AndroidNativeUtility.HidePreloader();
            AndroidMessage.Create("\nGame\n", "Failed to load game data from Cloud in Internet.\n\nPlease, check your Internet connection and try again.");
        }
    }
    private void ActionAvailableGameSavesLoaded(GooglePlayResult res)
    {
        GooglePlaySavedGamesManager.ActionAvailableGameSavesLoaded -= ActionAvailableGameSavesLoaded;
        if (res.IsSucceeded)
        {
            foreach (GP_SnapshotMeta meta in GooglePlaySavedGamesManager.Instance.AvailableGameSaves)
            {
                Debug.Log("Meta.Title: " + meta.Title);
                Debug.Log("Meta.Description: " + meta.Description);
                Debug.Log("Meta.CoverImageUrl): " + meta.CoverImageUrl);
                Debug.Log("Meta.LastModifiedTimestamp: " + meta.LastModifiedTimestamp);
                Debug.Log("Meta.TotalPlayedTime" + meta.TotalPlayedTime);
            }

            if (GooglePlaySavedGamesManager.Instance.AvailableGameSaves.Count > 0)
            {
                GP_SnapshotMeta s      = GooglePlaySavedGamesManager.Instance.AvailableGameSaves[0];
                AndroidDialog   dialog = AndroidDialog.Create("Load Snapshot?", "Would you like to load " + s.Title);
                dialog.ActionComplete += OnSpanshotLoadDialogComplete;
            }
        }
        else
        {
            AndroidMessage.Create("Fail", "Available Game Saves Load failed");
        }
    }
Esempio n. 8
0
    private static void OnProductPurchased(CEvent e)
    {
        BillingResult result = e.data as BillingResult;

        //this flag will tell you if purchase is avaliable
        //result.isSuccess


        //infomation about purchase stored here
        //result.purchase

        //here is how for example you can get product SKU
        //result.purchase.SKU


        if (result.isSuccess)
        {
            OnProcessingPurchasedProduct(result.purchase);
        }
        else
        {
            AndroidMessage.Create("Product Purchase Failed", result.response.ToString() + " " + result.message);
        }

        Debug.Log("Purchased Responce: " + result.response.ToString() + " " + result.message);
    }
Esempio n. 9
0
    private void ActionConnectionResultReceived(GooglePlayConnectionResult result)
    {
                #if UNITY_ANDROID
        GooglePlayConnection.ActionConnectionResultReceived -= ActionConnectionResultReceived;

        // Check for locked achievements with all progress completed
        GameManager.Instance.CheckAchievements();

        if (result.IsSuccess)
        {
            if (needLeaderboard)
            {
                needLeaderboard = false;
                GooglePlayManager.Instance.ShowLeaderBoardById(ProjectManager.leaderboardId);
            }
        }
        else
        {
            AndroidMessage.Create(ProjectManager.playServicesTitle, ProjectManager.playServicesError);
        }
                #endif

                #if DEBUG_INFO
        if (result.IsSuccess)
        {
            Debug.Log("AndroidManager: connected to Google Play Services successfully");
        }
        else
        {
            Debug.Log("AndroidManager: failed to connect to Google Play Services with error: " + result.code.ToString());
        }
                #endif
    }
    //--------------------------------------
    // EVENTS
    //--------------------------------------

    private void ActionNewGameSaveRequest()
    {
        SA_StatusBar.text = "New  Game Save Requested, Creating new save..";
        Debug.Log("New  Game Save Requested, Creating new save..");
        StartCoroutine(MakeScreenshotAndSaveGameData());

        AndroidMessage.Create("Result", "New Game Save Request");
    }
Esempio n. 11
0
	private static void OnRetrieveProductsFinised(BillingResult result) {
		AndroidInAppPurchaseManager.ActionRetrieveProducsFinished -= OnRetrieveProductsFinised;
		if(result.isSuccess) {
			UpdateStoreData();
			_isInited = true;
		} else {
			AndroidMessage.Create("Connection Responce", result.response.ToString() + " " + result.message);
		}
	}
Esempio n. 12
0
 void Text_ClickEvent()
 {
     string[] array = this.target.name.Split('_');
     if (array.Length == 2)
     {
         IOSMessage.ClickMap(array[1]);
         AndroidMessage.ClickMap(array[1]);
     }
 }
Esempio n. 13
0
 void Awake()
 {
     if (_instance != null)
     {
         DestroyImmediate(this);
         return;
     }
     _instance = this;
 }
Esempio n. 14
0
	private static void OnProductConsumed(BillingResult result) {
		
		if(result.isSuccess) {
			OnProcessingConsumeProduct (result.purchase);
		} else {
			AndroidMessage.Create("Product Cousume Failed", result.response.ToString() + " " + result.message);
		}
		
		Debug.Log ("Cousume Responce: " + result.response.ToString() + " " + result.message);
	}
Esempio n. 15
0
    public void ShowPopUp(string title, string message)
    {
                #if DEBUG_INFO
        Debug.Log("AndroidManager: attempting to show a pop up");
                #endif

                #if UNITY_ANDROID
        AndroidMessage.Create(title, message);
                #endif
    }
 public void FailPurchase()
 {
     if (GPaymnetManagerExample.isInited)
     {
         AndroidInAppPurchaseManager.instance.purchase(GPaymnetManagerExample.ANDROID_TEST_ITEM_UNAVAILABLE);
     }
     else
     {
         AndroidMessage.Create("Error", "PaymnetManagerExample not yet inited");
     }
 }
 public void SuccsesPurchase()
 {
     if (GPaymnetManagerExample.isInited)
     {
         AndroidInAppPurchaseManager.instance.purchase(GPaymnetManagerExample.ANDROID_TEST_PURCHASED);
     }
     else
     {
         AndroidMessage.Create("Error", "PaymnetManagerExample not yet inited");
     }
 }
Esempio n. 18
0
 public AndroidMessagePush(AndroidMessage androidMessage)
 {
     this.title      = androidMessage.Title;
     this.subtitle   = androidMessage.SubTitle;
     this.message    = androidMessage.Message;
     this.tickerText = androidMessage.TickerText;
     this.badge      = androidMessage.Badge;
     this.sound      = androidMessage.Sound;
     this.vibrate    = androidMessage.Vibrate;
     this.payload    = androidMessage.Payload;
 }
Esempio n. 19
0
    //purchasing events
    private void OnProductPurchased(BillingResult result)
    {
        if (result.IsSuccess)
        {
            OnProcessingPurchasedProduct(result.Purchase);
        }

        else
        {
            AndroidMessage.Create("Product Purchase Failed", result.Response.ToString() + " " + result.Message);
        }
    }
	private static void OnProductPurchased(CEvent e) {
		BillingResult result = e.data as BillingResult;
		
		
		if(result.isSuccess) {
			OnProcessingPurchasedProduct (result.purchase);
		} else {
			AndroidMessage.Create("Product Purchase Failed", result.response.ToString() + " " + result.message);
		}
		
		Debug.Log ("Purchased Responce: " + result.response.ToString() + " " + result.message);
	}
Esempio n. 21
0
    private static void OnProductPurchased(BillingResult result)
    {
        if (result.IsSuccess)
        {
            OnProcessingPurchasedProduct(result.Purchase);

            AndroidMessage.Create(
                "Purchase",
                "Successfull purchase!",
                AndroidDialogTheme.ThemeHoloLight);
        }
    }
    void initGame(GP_TBM_Match match)
    {
        AndroidMessage.Create("Initializing match data ", " match data initialization");
        List <string> playerIDS = new List <string>();

        foreach (GP_Participant participant in match.Participants)
        {
            playerIDS.Add(participant.id); //TODO katso onko playerID vai joku toinen ID
        }
        Common.roundInformation.InitializeGameData(playerIDS, match.Id);
        Common.cloudServiceMaster.CreateAlbumOnGameStarted();
    }
    private void ActionMatchDataLoadedFunction(GP_TBM_LoadMatchResult result)
    {
        Debug_previous_method_name();
        AndroidMessage.Create("Loaded match data ", "loaad ");
        foreach (GP_Participant part in result.Match.Participants)
        {
            //  AndroidMessage.Create("Participant", "Participant info " + part.DisplayName + " +" + part.IconImageUrl + " id " + part.id + " pid " + part.playerId);
        }
        GP_TBM_Match match = result.Match;

        DealWithMatchData(match);
    }
Esempio n. 24
0
 private void OnProductConsumed(BillingResult result)
 {
     if (result.IsSuccess)
     {
         AndroidMessage.Create(ProjectManager.billingTitle, ProjectManager.billingComplete);
         OnProcessingConsumeProduct(result.Purchase);
     }
     else
     {
         AndroidMessage.Create(ProjectManager.billingTitle, ProjectManager.billingError);
     }
 }
    //--------------------------------------
    // EVENTS
    //--------------------------------------

    private void ActionAdvertisingIdLoaded(GP_AdvertisingIdLoadResult res)
    {
        GooglePlayUtils.ActionAdvertisingIdLoaded -= ActionAdvertisingIdLoaded;

        if (res.IsSucceeded)
        {
            AndroidMessage.Create("Succeeded", "Advertising Id: " + res.id);
        }
        else
        {
            AndroidMessage.Create("Failed", "Advertising Id failed to loaed");
        }
    }
Esempio n. 26
0
    private void OnBillingConnected(BillingResult result)
    {
        AndroidInAppPurchaseManager.ActionBillingSetupFinished -= OnBillingConnected;

        if (!result.IsSuccess)
        {
            AndroidMessage msg = AndroidMessage.Create("Error!", "Error trying to connect to billing service");
        }
        else
        {
            AndroidMessage msg = AndroidMessage.Create("Connected", "Connected to billing service");
        }
    }
    private static void OnProductConsumed(BillingResult result)
    {
        if (result.IsSuccess)
        {
            AndroidMessage.Create("Product Consumed", result.Purchase.SKU + "\n Full Response: " + result.Purchase.OriginalJson);
            OnProcessingConsumeProduct(result.Purchase);
        }
        else
        {
            AndroidMessage.Create("Product Cousume Failed", result.Response.ToString() + " " + result.Message);
        }

        Debug.Log("Cousume Responce: " + result.Response.ToString() + " " + result.Message);
    }
    private static void OnBillingConnected(BillingResult result)
    {
        AndroidInAppPurchaseManager.ActionBillingSetupFinished -= OnBillingConnected;

        if (result.IsSuccess)
        {
            //Store connection is Successful. Next we loading product and customer purchasing details
            AndroidInAppPurchaseManager.Client.RetrieveProducDetails();
            AndroidInAppPurchaseManager.ActionRetrieveProducsFinished += OnRetrieveProductsFinised;
        }

        AndroidMessage.Create("Connection Responce", result.Response.ToString() + " " + result.Message);
        Debug.Log("Connection Responce: " + result.Response.ToString() + " " + result.Message);
    }
	private static void OnRetriveProductsFinised(CEvent e) {
		BillingResult result = e.data as BillingResult;
		AndroidInAppPurchaseManager.instance.removeEventListener (AndroidInAppPurchaseManager.ON_RETRIEVE_PRODUC_FINISHED, OnRetriveProductsFinised);
		
		if(result.isSuccess) {

			UpdateStoreData();
			_isInited = true;


		} else {
			AndroidMessage.Create("Connection Responce", result.response.ToString() + " " + result.message);
		}

	}
	private static void OnBillingConnected(CEvent e) {
		BillingResult result = e.data as BillingResult;
		AndroidInAppPurchaseManager.instance.removeEventListener (AndroidInAppPurchaseManager.ON_BILLING_SETUP_FINISHED, OnBillingConnected);
		
		
		if(result.isSuccess) {
			//Store connection is Successful. Next we loading product and customer purchasing details
			AndroidInAppPurchaseManager.instance.addEventListener (AndroidInAppPurchaseManager.ON_RETRIEVE_PRODUC_FINISHED, OnRetriveProductsFinised);
			AndroidInAppPurchaseManager.instance.retrieveProducDetails();

		} 
		
		AndroidMessage.Create("Connection Responce", result.response.ToString() + " " + result.message);
		Debug.Log ("Connection Responce: " + result.response.ToString() + " " + result.message);
	}