예제 #1
0
        public void AddM3Res()
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request request = lookupsManager.EndPoint.Post("/userres/debugAddM3Res");
            lookupsManager.Service(request, null);
        }
예제 #2
0
        public void BuyGoldToHc()
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request request = lookupsManager.EndPoint.Post("/userres/buyGoldToHc");
            lookupsManager.Service(request, null);
        }
예제 #3
0
        public void GetAllEquipmentInfo(System.Action <Response> callback)
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request request = lookupsManager.EndPoint.Get("/equipment/DEBUG_getEquipmentClientData");
            lookupsManager.Service(request, callback, false);
        }
예제 #4
0
//#if DEBUG
        public void AddGold(int goldAmount)
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request request = lookupsManager.EndPoint.Post("/userres/addGold");
            request.AddData("amount", goldAmount);
            lookupsManager.Service(request, null);
        }
예제 #5
0
        public void AddTicket(int ticket, System.Action <EB.Sparx.Response> callback)
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request request = lookupsManager.EndPoint.Post("/userres/addTicket");
            request.AddData("num", ticket);
            lookupsManager.Service(request, callback);
        }
예제 #6
0
        public void AddVipHc(int hc, System.Action <EB.Sparx.Response> callback)
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request request = lookupsManager.EndPoint.Post("/userres/addVipHc");
            request.AddData("hc", hc);
            lookupsManager.Service(request, callback);
        }
예제 #7
0
        public void Process()
        {
            if (!m_TimerScheduler.isLegalTimer)
            {
                return;
            }

            if (m_NextRequestTime <= 0)
            {
                m_NextRequestTime = GetNextRequestTime(m_TimePath);
                EB.Debug.Log("CronRefreshExcuter.Process: next time = {0}", EB.Time.FromPosixTime(m_NextRequestTime));
                if (m_NextRequestTime <= 0)
                {
                    return;
                }
            }

            int now = EB.Time.Now;

            if (now > m_NextRequestTime)
            {
                m_NextRequestTime = GetNextRequestTime(m_TimePath);
                EB.Debug.Log("CronRefreshExcuter.Process: next time = {0}", EB.Time.FromPosixTime(m_NextRequestTime));
                if (m_NextRequestTime <= 0)
                {
                    return;
                }

                DataLookupSparxManager lookup = SparxHub.Instance.GetManager <DataLookupSparxManager>();
                var request = (m_IsPost) ? lookup.EndPoint.Post(m_RequestURL) : lookup.EndPoint.Get(m_RequestURL);
                request.numRetries = 2;
                if (m_Parameters != null)
                {
                    request.AddData(m_Parameters);
                }


                lookup.Service(request, delegate(EB.Sparx.Response res)
                {
                    if (res.sucessful)
                    {
                        if (m_Callback != null)
                        {
                            m_Callback(res.hashtable);
                        }
                        EB.Debug.Log("CronRefreshExcuter.Process: sucessful");
                    }
                    else if (res.fatal)
                    {
                        SparxHub.Instance.FatalError(res.localizedError);
                    }
                    else
                    {
                        EB.Debug.LogWarning("CronRefreshExcuter.Process: error = {0}", res.localizedError);
                    }
                }, true);
            }
        }
예제 #8
0
        public void SetResRPC(string type, int num)
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request request = lookupsManager.EndPoint.Post("/userres/debugSetRes");
            request.AddData("type", type);
            request.AddData("num", num);
            lookupsManager.Service(request, null);
        }
예제 #9
0
        public void OnPartnerUpgradeClick()
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request request = lookupsManager.EndPoint.Post("/userres/debugAddBuddyXp");
            int exp = 5000000;

            request.AddData("xp", exp);
            lookupsManager.Service(request, null);
            MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, "您的所有伙伴已增加500w经验!");
        }
예제 #10
0
        public void EquipmentRecycle(string[] inventoryIdList, System.Action <bool> callback)
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request request = lookupsManager.EndPoint.Post("/recycling/equipmentRecycle");

            request.AddData("inventoryIdList", inventoryIdList);

            lookupsManager.Service(request, delegate(Response result)
            {
                callback(result.sucessful);
            }, true);
        }
예제 #11
0
        public void useInventory(string inventoryId, int amount, System.Action <bool> callback)
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request request = lookupsManager.EndPoint.Post("/gaminventory/use");
            request.AddData("inventoryId", inventoryId);
            request.AddData("num", amount);

            lookupsManager.Service(request, delegate(Response result)
            {
                callback(result.sucessful);
            }, true);
        }
예제 #12
0
        public void UnEquip(int itemInvID, System.Action <bool> callback)
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request req = lookupsManager.EndPoint.Post("/equipment/unEquip");

            req.AddData("inventoryId", itemInvID);

            lookupsManager.Service(req, delegate(Response result)
            {
                callback(result.sucessful);
            }, true);
        }
예제 #13
0
        public void EquipmentUnsocketGem(string equipmentInvID, int slotNum, System.Action <bool> callback)
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request req = lookupsManager.EndPoint.Post("/socketing/unsocketGem");

            req.AddData("inventoryId", equipmentInvID);
            req.AddData("slotNum", slotNum);

            lookupsManager.Service(req, delegate(Response result)
            {
                callback(result.sucessful);
            }, true);
        }
예제 #14
0
        public void ChangeRandomStats(string inventoryId, System.Action <bool> callback)
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request request = lookupsManager.EndPoint.Post("/refining/changeRandomStats");

            request.AddData("inventoryId", inventoryId);

            lookupsManager.Service(request, delegate(Response result)
            {
                EB.Debug.Log("changeRandomStats : result = ", result);
                callback(result.sucessful);
            }, true);
        }
예제 #15
0
        public void OnSendMainCampaignOpenReq()
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request request = lookupsManager.EndPoint.Post("/lostmaincampaign/debugallstar");
            if (int.TryParse(chapterlabel.text, out int chapter))
            {
                request.AddData("chapter", chapter);
                lookupsManager.Service(request, null);
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, "已解锁主线副本指定关卡,重新登录后生效!");
            }
            else
            {
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, "请输入指定章节,如: 101 ");
            }
        }
예제 #16
0
        public void EquipmentRefine(string inventoryId, string[] lockStatsList, bool autoBuy, System.Action <bool> callback)
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request request = lookupsManager.EndPoint.Post("/refining/refineEquipment");

            request.AddData("inventoryId", inventoryId);
            request.AddData("lockStats", lockStatsList);
            request.AddData("autoBuy", autoBuy);

            lookupsManager.Service(request, delegate(Response result)
            {
                EB.Debug.Log("refineEquipment : result = ", result);
                callback(result.sucessful);
            }, true);
        }
예제 #17
0
        public void OnSendChanllengeCampaignOpenReq()
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request request = lookupsManager.EndPoint.Post("/lostchallengecampaign/enterChapter");
            if (int.TryParse(challengeLabel.text, out int chapter))
            {
                request.AddData("level", chapter);
                lookupsManager.Service(request, null);
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, "已解锁挑战副本指定关卡,重新登录后生效!");
            }
            else
            {
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, "请输入指定层数,如: 1 ");
            }
        }
예제 #18
0
        public void instantCreate(string targetEconomyId, int count, System.Action <bool, string> callback)
        {
            DataLookupSparxManager lookupsManager = EB.Sparx.Hub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request request = lookupsManager.EndPoint.Post("/synthesis/instantCreate");

            request.AddData("targetEconomyId", targetEconomyId);
            request.AddData("number", count);

            lookupsManager.Service(request, delegate(Response result)
            {
                if (result.sucessful)
                {
                    callback(result.sucessful, "");
                }
                else
                {
                    callback(result.sucessful, result.error.ToString());
                }
            }, true);
        }
예제 #19
0
        public void EnchantItem(int itemInvID, int luckstoneInvID, System.Action <bool> callback)
        {
            DataLookupSparxManager data_lookups_mgr = SparxHub.Instance.GetManager <DataLookupSparxManager>();

            EB.Sparx.Request req = data_lookups_mgr.EndPoint.Post("/enchantments/enchant");

            //req.AddData ("itemID", itemInvID);
            req.AddData("inventoryId", itemInvID);

            if (luckstoneInvID != -1)
            {
                req.AddData("luckStoneID", luckstoneInvID);
            }

            data_lookups_mgr.Service(req, (response) =>
            {
                var jobject         = response.result as Hashtable;
                var jobject2        = jobject["enchantments"] as Hashtable;
                bool enchantSuccess = (bool)jobject2["success"];
                callback(enchantSuccess);
            });
        }