Esempio n. 1
0
    private void RGetMoneySlot(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Get Money Slot: " + response.post_data);
        JGetMoneySlot json = JsonUtility.FromJson <JGetMoneySlot> (response.post_data);

        MoneySlotManager.instance.SetJson(json);
    }
Esempio n. 2
0
    private void RSearchFriend(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Search Friend: " + response.post_data);
        JSearchFriend json = JsonUtility.FromJson <JSearchFriend> (response.post_data);

        FriendManager.instance.ShowSearchResult(json.friend);
    }
Esempio n. 3
0
    private void RGetLeaderboard(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Get Leaderboard: " + response.post_data);
        JGetLeaderboard json = JsonUtility.FromJson <JGetLeaderboard> (response.post_data);

        LeaderboardManager.instance.SetJson(json);
    }
Esempio n. 4
0
    private void RGetFriend(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Get Friend: " + response.post_data);
        JGetFriend json = JsonUtility.FromJson <JGetFriend> (response.post_data);

        if (TransferManager.instance.isWaitingJSON)
        {
            if (json.friend.display_name == null)
            {
                MessageManager.instance.Show(this.gameObject, "Pemain tidak ditemukan");
                TransferManager.instance.ResetAll();
                TransferManager.instance.ToInput();
                return;
            }
            TransferManager.instance.SetReceiverInfo(json.friend.display_name, json.friend.display_picture);
            return;
        }
        if (FriendManager.instance.isSettingJsonFriendList)
        {
            FriendManager.instance.SetJson(json, ApiBridge.FriendType.FriendList);
            GetFriend(0, ApiBridge.FriendType.FriendRequestMe);
        }
        else if (FriendManager.instance.isSettingJsonFriendReqMe)
        {
            FriendManager.instance.SetJson(json, ApiBridge.FriendType.FriendRequestMe);
        }
    }
Esempio n. 5
0
    private void RGetShop(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Get Shop: " + response.post_data);
        JGetShop json = JsonUtility.FromJson <JGetShop> (response.post_data);

        ShopManager.instance.SetJson(json);
    }
Esempio n. 6
0
    public void UpdateAnnouncementSession(ApiBridge.ResponseParam response)
    {
        Logger.E("Update Announcement Session: " + response.post_data);
        JUpdateAnnouncement json = JsonUtility.FromJson <JUpdateAnnouncement> (response.post_data);

        HomeManager.instance.runningText.AddQueue(json.announcement.announcement_text);
    }
Esempio n. 7
0
    private void RGetVersion(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Get Version: " + response.post_data);
        JGetVersion json = JsonUtility.FromJson <JGetVersion> (response.post_data);

        BundleManager.instance.ProcessGetVersion(json);
    }
Esempio n. 8
0
    private void RGetWeeklyLogin(ApiBridge.ResponseParam response)
    {
        Logger.E("Return GetWeeklyLogin: " + response.post_data);
        JGetWeeklyLogin json = JsonUtility.FromJson <JGetWeeklyLogin> (response.post_data);

        if (json.reward.item_amount == null)
        {
            WeeklyRewardsManager.instance.SetJson(json);
        }
        else
        {
            int             itemValue = int.Parse(json.reward.item_amount);
            ItemReceiveData data      = new ItemReceiveData(json.reward.item_type, json.reward.item_id, itemValue);
            ReceiveItemManager.instance.itemsData.Add(data);
            if (json.bonus_reward.item_amount != null)
            {
                int             bonusItemValue = int.Parse(json.bonus_reward.item_amount);
                ItemReceiveData bonusData      = new ItemReceiveData(json.bonus_reward.item_type, json.bonus_reward.item_id, bonusItemValue);
                ReceiveItemManager.instance.itemsData.Add(bonusData);
            }
            ReceiveItemManager.instance.ShowCombined();
            PlayerData.jHome.can_claim_weekly = false;
            PlayerData.owned_coin             = Convert.ToInt64(json.player.coin);
            PlayerData.owned_coupon           = Convert.ToInt64(json.player.coupon);
            _SceneManager.instance.UpdateAllCoinAndCoupon();
            WeeklyRewardsManager.instance.SetWeeklyDaysStatus(json);
            WeeklyRewardsManager.instance.IncrementProgressBar();
            WeeklyRewardsManager.instance.json.login_count++;
        }
    }
Esempio n. 9
0
    private void RGetInbox(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Get Inbox: " + response.post_data);
        JGetInbox json = JsonUtility.FromJson <JGetInbox> (response.post_data);

        InboxManager.instance.SetJson(json);
    }
Esempio n. 10
0
    private void RSetHeroFeatured(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Set Hero Featured: " + response.post_data);
        JSetHeroFeatured json = JsonUtility.FromJson <JSetHeroFeatured> (response.post_data);

        PlayerData.jHome = json.player;
        PlayerData.UpdateData(json.player);
    }
Esempio n. 11
0
    private void RSetStatus(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Set Status: " + response.post_data);
        JSetStatus json = JsonUtility.FromJson <JSetStatus> (response.post_data);

        PlayerData.jHome          = json.player;
        PlayerData.status_message = json.player.status_message;
    }
Esempio n. 12
0
    private void RGetChatPublic(ApiBridge.ResponseParam response)
    {
        //when friend ID = -1, get public chat content
        Logger.E("Return Get Chat Public: " + response.post_data);
        JGetChatPublic json = JsonUtility.FromJson <JGetChatPublic> (response.post_data);

        HomeManager.instance.SetJson(json);
    }
Esempio n. 13
0
    private void RSetCostume(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Set Costume: " + response.post_data);
        JSetCostume json = JsonUtility.FromJson <JSetCostume> (response.post_data);

        PlayerData.costume_id = json.player.costume_equiped;
        //HomeManager.instance.Init ();
        //HeroManager.instance.UpdateStatusEquipped ();
    }
Esempio n. 14
0
    private void RGetOtp(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Get Otp: " + response.post_data);
        JGetOtp json = JsonUtility.FromJson <JGetOtp> (response.post_data);

        //set otp
        api.SetOtp(json.otp.otp_key);
        bOtpSet = true;
    }
Esempio n. 15
0
    public void RStartSlot(ApiBridge.ResponseParam response)
    {
        Debug.Log("Return " + response.uri + " in " + response.post_time + " (Seed #" + response.seed.ToString() + ")\n" + response.post_data + "\n\nRaw = " + response.post_id);
        JStartSlot jsonStart = JsonUtility.FromJson <JStartSlot>(response.post_data);

        serverMoney = jsonStart.player.coin;
        json        = jsonStart.slot;
        jsonIndex   = 0;
        StartCoroutine(StopSpin(json.slot_spin[jsonIndex]));
    }
Esempio n. 16
0
    private void RGetHome(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Get Home: " + response.post_data);
        JGetHome json = JsonUtility.FromJson <JGetHome> (response.post_data);

        _SceneManager.instance.SetActiveScene(SceneType.LOGIN, false);
        PlayerData.UpdateData(json.player);
        if (json.player.costume_equiped == 0)
        {
            _SceneManager.instance.SetActiveScene(SceneType.BEGIN, true);
        }
        else
        {
            StartChatSession();
            GetChat();
            GetShop();
            GetInbox();
            GetLeaderboard();
            GetFriend();
            GetDailyTransferLimit();
            GetWeeklyLogin();
            MoneySlotManager.instance.json.next_in = json.player.money_slot_next_in;
            MoneySlotManager.instance.StartTimer();
            //_SceneManager.instance.SetActiveScene (SceneType.HOME, true);
            HomeManager.instance.Show();
            HomeManager.instance.Init();
        }

        if (json.player.friend_gift_me.Length > 0)
        {
            HomeManager.instance.objNotifInbox.SetActive(true);
        }
        else
        {
            HomeManager.instance.objNotifInbox.SetActive(false);
        }
        if (json.player.friend_request_me.Length > 0)
        {
            HomeManager.instance.objNotifFriend.SetActive(true);
        }
        else
        {
            HomeManager.instance.objNotifFriend.SetActive(false);
        }
        if (json.player.can_claim_daily)
        {
            DailyRewardsManager.instance.btnClaim.interactable = true;
        }
        else
        {
            DailyRewardsManager.instance.btnClaim.interactable = false;
        }
    }
Esempio n. 17
0
    private void RGetDailyLogin(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Get Daily Login: " + response.post_data);
        DailyRewardsManager.instance.btnClaim.interactable = false;
        JGetDailyLogin  json      = JsonUtility.FromJson <JGetDailyLogin> (response.post_data);
        int             itemValue = int.Parse(json.reward.item_amount);
        ItemReceiveData data      = new ItemReceiveData(json.reward.item_type, json.reward.item_id, itemValue);

        ReceiveItemManager.instance.Show(new ItemReceiveData[] { data });
        PlayerData.jHome.can_claim_daily = false;
        PlayerData.owned_coin            = Convert.ToInt64(json.player.coin);
        PlayerData.owned_coupon          = Convert.ToInt64(json.player.coupon);
        _SceneManager.instance.UpdateAllCoinAndCoupon();
    }
Esempio n. 18
0
    private void RSendCoin(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Send Coin: " + response.post_data);
        JSendCoin json  = JsonUtility.FromJson <JSendCoin> (response.post_data);
        long      lCoin = long.Parse(json.transfer.coin_limit) * 1000;

        TransferManager.instance.txtCoinLimitAmount.text = lCoin.ToString("N0");
        if (TransferManager.instance.isInit)
        {
            MessageManager.instance.Show(this.gameObject, "Proses transfer telah berhasil");
            _SceneManager.instance.SetActiveScene(SceneType.TRANSFER, false);
            PlayerData.owned_coin   = Convert.ToInt64(json.player.coin);
            PlayerData.owned_coupon = Convert.ToInt64(json.player.coupon);
            _SceneManager.instance.UpdateAllCoinAndCoupon();
        }
    }
Esempio n. 19
0
    private void RClaimPromoCode(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Claim Promo Code: " + response.post_data);
        JClaimPromoCode json = JsonUtility.FromJson <JClaimPromoCode> (response.post_data);

        if (json.promo.item_type == 1 || json.promo.item_type == 2)
        {
            int             itemValue = int.Parse(json.promo.item_amount);
            ItemReceiveData data      = new ItemReceiveData(json.promo.item_type, json.promo.item_id, itemValue);
            ReceiveItemManager.instance.Show(new ItemReceiveData[] { data });
            PlayerData.owned_coin   = Convert.ToInt64(json.player.coin);
            PlayerData.owned_coupon = Convert.ToInt64(json.player.coupon);
            _SceneManager.instance.UpdateAllCoinAndCoupon();
        }
        RedeemManager.instance.ipfCode.text = string.Empty;
    }
Esempio n. 20
0
    private void RSetHero(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Set Hero: " + response.post_data);
        JSetHero json = JsonUtility.FromJson <JSetHero> (response.post_data);

        PlayerData.costume_id = json.player.costume_equiped;
        _SceneManager.instance.SetActiveScene(SceneType.BEGIN, false);
        //_SceneManager.instance.SetActiveScene (SceneType.HOME, true);
        HomeManager.instance.Show();
        HomeManager.instance.Init();
        GetShop();
        GetInbox();
        GetLeaderboard();
        GetFriend();
        GetDailyTransferLimit();
        GetWeeklyLogin();
    }
Esempio n. 21
0
    private void RBuyShop(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Buy Shop: " + response.post_data);
        JBuyShop json = JsonUtility.FromJson <JBuyShop> (response.post_data);

        if (json.item.item_type_id == 1)
        {
            int             itemValue = int.Parse(json.item.bonus_coin);
            ItemReceiveData data      = new ItemReceiveData(json.item.item_type_id, json.item.item_id, itemValue);
            ReceiveItemManager.instance.Show(new ItemReceiveData[] { data });
        }
        PlayerData.owned_coin   = long.Parse(json.player.coin);
        PlayerData.owned_coupon = long.Parse(json.player.coupon);
        ShopManager.instance.UpdateStatus(json);
        _SceneManager.instance.UpdateAllCoinAndCoupon();
        MessageManager.instance.Show(this.gameObject, "Anda berhasil membeli " + json.item.item_name[0]);
    }
Esempio n. 22
0
 public void UpdatePublicChatSession(ApiBridge.ResponseParam response)
 {
     Logger.E("Update Public Chat Session: " + response.post_data);
     if (HomeManager.instance.json != null)
     {
         JGetChatPublic     json       = JsonUtility.FromJson <JGetChatPublic> (response.post_data);
         List <JPublicChat> updateChat = new List <JPublicChat> ();
         int lastChatID = HomeManager.instance.GetLastPublicChatID();
         for (int i = 0; i < json.chat.Length; i++)
         {
             if (json.chat[i].chat_public_id > lastChatID)
             {
                 updateChat.Add(json.chat[i]);
             }
         }
         HomeManager.instance.AddPublicChat(updateChat.ToArray());
     }
 }
Esempio n. 23
0
    private void RUserLogin(ApiBridge.ResponseParam response)
    {
        LoginManager.instance.btnGuest.interactable = true;
        Logger.E("Return User Login: " + response.post_data);
        JUserLogin json = JsonUtility.FromJson <JUserLogin> (response.post_data);

        api.SetPlayerId(json.player.player_id);
        api.SetToken(json.player.token);
        PlayerData.display_name = json.player.display_name;
        PlayerData.id           = json.player.player_id;
        PlayerData.tag          = json.player.player_tag;
        PlayerData.owned_coupon = Convert.ToInt64(json.player.coupon);
        PlayerData.owned_coin   = Convert.ToInt64(json.player.coin);
        PlayerPrefs.SetInt(PrefEnum.PLAYER_ID.ToString(), json.player.player_id);
        PlayerPrefs.SetString(PrefEnum.TOKEN.ToString(), json.player.token);
        PlayerPrefs.Save();

        GetHome();
    }
Esempio n. 24
0
    private void RClaimInbox(ApiBridge.ResponseParam response)
    {
        Logger.E("Return Claim Inbox: " + response.post_data);
        JClaimInbox     json      = JsonUtility.FromJson <JClaimInbox> (response.post_data);
        int             itemValue = int.Parse(json.inbox.item_amount);
        ItemReceiveData data      = new ItemReceiveData(json.inbox.item_type_id, json.inbox.item_id, itemValue);

        ReceiveItemManager.instance.itemsData.Add(data);
        if (InboxManager.instance.countClaim == 0)
        {
            ReceiveItemManager.instance.ShowCombined();
            PlayerData.owned_coin   = Convert.ToInt64(json.player.coin);
            PlayerData.owned_coupon = Convert.ToInt64(json.player.coupon);
            _SceneManager.instance.UpdateAllCoinAndCoupon();
        }
        else
        {
            InboxManager.instance.countClaim--;
        }
    }
Esempio n. 25
0
 public void RErrorHandler(ApiBridge.ResponseParam error)
 {
     if (LoginManager.instance != null)
     {
         LoginManager.instance.btnGuest.interactable = true;
     }
     if (error.error_code == 19)
     {
         SettingsManager.instance.Logout();
     }
     Debug.LogError("RErrorHandler from " + error.uri + " (Seed #" + error.seed.ToString()
                    + ")\n(Code #" + error.error_code + ") {" + error.error_msg[0] + " || " + error.error_msg[1] + "}");
     if (Rays.Utilities.Congest.DEVELOPMENT)
     {
         MessageManager.instance.Show(this.gameObject, "(" + error.error_code + ") " + error.error_msg[1], ButtonMode.OK, -1, "OK", "Batal", error.uri);
     }
     else
     {
         MessageManager.instance.Show(this.gameObject, error.error_msg[0], ButtonMode.OK);
     }
 }
Esempio n. 26
0
 private void RStartSicbo(ApiBridge.ResponseParam response)
 {
     Logger.E("Return Start Sicbo: " + response.post_data);
     SicboManager.instance.SendRStartSicbo(response.post_data);
 }
Esempio n. 27
0
 private void REndPoker(ApiBridge.ResponseParam response)
 {
     Logger.E("Return End Poker: " + response.post_data);
     //UPDATE COIN AND COUPON(?)
 }
Esempio n. 28
0
 private void RStartPoker(ApiBridge.ResponseParam response)
 {
     Logger.E("Return Start Poker: " + response.post_data);
     SetPokerData(response.post_data);
     PhotonTexasPokerManager.instance.SetOthersPokerData(response.post_data);
 }
Esempio n. 29
0
 private void RSendChatPublic(ApiBridge.ResponseParam response)
 {
     Logger.E("Return Send Chat Public: " + response.post_data);
 }
Esempio n. 30
0
 public void UpdatePrivateChatSession(ApiBridge.ResponseParam response)
 {
     Logger.E("Update Private Chat Session: " + response.post_data);
 }