예제 #1
0
 public CMsgShopSystemGC2GMReqShopBuy(EShopType type, UInt32 id, UInt32 num)
     : base(CServerType.SRVTYPE_GAMESERVER, CFuncType.EFUNCTYPE_SHOPSYSTEM, CShopSystemMsgNumID.EMSGID_SHOPSYSTEM_GC2GM_REQ_SHOP_BUY)
 {
     m_type = type;
     m_id = id;
     m_num = num;
 }
예제 #2
0
        public async Task <Shop> CreateAsync(string name, EShopType shopType, string postCode, string city)
        {
            var shop       = new Shop(name, shopType, postCode, city);
            var resultShop = await _shopRepository.FindAsync(shop) ?? shop;

            return(resultShop);
        }
예제 #3
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 0 || ((Behaviour)this).get_enabled())
            {
                return;
            }
            string gname;

            switch (GlobalVars.ShopType)
            {
            case EShopType.Event:
                gname = GlobalVars.EventShopItem.shops.gname;
                break;

            case EShopType.Limited:
                gname = GlobalVars.LimitedShopItem.shops.gname;
                break;

            default:
                this.mShopType = GlobalVars.ShopType;
                gname          = this.mShopType.ToString();
                break;
            }
            this.ExecRequest((WebAPI) new ReqShopLineup(gname, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
            ((Behaviour)this).set_enabled(true);
        }
예제 #4
0
        public bool SendMsgShopSystemGC2GMReqShopOpen(EShopType type, CBMsgShopSystemGM2GCAckShopOpen cb)
        {
            CMsgShopSystemGC2GMReqShopOpen req = new CMsgShopSystemGC2GMReqShopOpen(type);

            CMsgShopSystemGM2GCAckShopOpen.cb = cb;
            return(CGameClient.Singleton.SendMsg(req));
        }
예제 #5
0
        public bool SendMsgShopSystemGC2GMReqShopBuy(EShopType type, UInt32 id, UInt32 num, CBMsgShopSystemGM2GCAckShopBuy cb)
        {
            CMsgShopSystemGC2GMReqShopBuy req = new CMsgShopSystemGC2GMReqShopBuy(type, id, num);

            CMsgShopSystemGM2GCAckShopBuy.cb = cb;
            return(CGameClient.Singleton.SendMsg(req));
        }
예제 #6
0
파일: Shop.cs 프로젝트: Cule5/DataWarehouse
 public Shop(string name, EShopType shopType, string postCode, string city)
 {
     Name     = name;
     Type     = shopType;
     PostCode = postCode;
     City     = city;
 }
예제 #7
0
        private async Task ProcessAsync(EShopType shopType)
        {
            var bufferedData = await _bufferService.GetBufferAsync(shopType);

            await _bufferService.ClearBufferAsync(shopType);

            if (bufferedData.Count == 0)
            {
                return;
            }
            var transaction = await _transactionFactory.CreateAsync(bufferedData[0].ClientCity,
                                                                    bufferedData[0].TransactionDateTime, bufferedData[0].PaymentType, bufferedData[0].ClientPostCode);

            var shop = await _shopFactory.CreateAsync(bufferedData[0].ShopName, bufferedData[0].ShopType, bufferedData[0].ShopPostCode, bufferedData[0].ShopCity);

            shop.Transactions.Add(transaction);
            transaction.Shop = shop;
            foreach (var rawData in bufferedData)
            {
                var product = await _productFactory.CreateAsync(rawData.Price, rawData.Product, rawData.Quantity);

                var transactionProduct = await _transactionProductFactory.CreateAsync(product, transaction);

                transaction.TransactionProducts.Add(transactionProduct);
                product.TransactionProducts.Add(transactionProduct);
                await _productRepository.AddAsync(product);

                await _transactionProductRepository.AddAsync(transactionProduct);
            }
            await _transactionRepository.AddAsync(transaction);

            await _shopRepository.AddAsync(shop);

            await _unitOfWork.SaveAsync();
        }
예제 #8
0
        private void Awake()
        {
            List <EShopType> eshopTypeList = new List <EShopType>();

            for (int index = 0; index < this.ShopLevelLock.Length; ++index)
            {
                if (MonoSingleton <GameManager> .Instance.Player.CheckUnlock(this.ShopLevelLock[index].Condition))
                {
                    switch (this.ShopLevelLock[index].Condition)
                    {
                    case UnlockTargets.Shop:
                        eshopTypeList.Add(EShopType.Normal);
                        continue;

                    case UnlockTargets.ShopTabi:
                        eshopTypeList.Add(EShopType.Tabi);
                        continue;

                    case UnlockTargets.ShopKimagure:
                        eshopTypeList.Add(EShopType.Kimagure);
                        continue;

                    default:
                        continue;
                    }
                }
            }
            this.NpcRandArray = eshopTypeList.ToArray();
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ImgNPC, (UnityEngine.Object)null))
            {
                EShopType npcRand = this.NpcRandArray[Random.Range(0, this.NpcRandArray.Length)];
                this.ImgNPC.set_texture((Texture)AssetManager.Load <Texture2D>(ShopWindow.ImgPathPrefix + (object)npcRand));
            }
            MonoSingleton <GameManager> .Instance.OnSceneChange += new GameManager.SceneChangeEvent(this.OnGoOutShop);
        }
예제 #9
0
    public static UnlockTargets ToUnlockTargets(this EShopType type)
    {
        switch (type)
        {
        case EShopType.Normal:
            return(UnlockTargets.Shop);

        case EShopType.Tabi:
            return(UnlockTargets.ShopTabi);

        case EShopType.Kimagure:
            return(UnlockTargets.ShopKimagure);

        case EShopType.Monozuki:
            return(UnlockTargets.ShopMonozuki);

        case EShopType.Tour:
            return(UnlockTargets.Tour);

        case EShopType.Arena:
            return(UnlockTargets.Arena);

        case EShopType.Multi:
            return(UnlockTargets.MultiPlay);

        case EShopType.AwakePiece:
            return(UnlockTargets.ShopAwakePiece);

        case EShopType.Artifact:
            return(UnlockTargets.Artifact);

        default:
            return((UnlockTargets)0);
        }
    }
예제 #10
0
 public RTShopGridData(EShopType shopType, ShopItemData data, RTShopGridData.ShopItemCallback buyCallback, RTShopGridData.ShopItemCallback showCallback)
 {
     this.ShopType = shopType;
     this.shopData = data;
     this.AVData = Globals.Instance.Player.ActivitySystem.GetValueMod(7);
     if (this.shopData.InfoType == 1)
     {
         this.itemInfo = Globals.Instance.AttDB.ItemDict.GetInfo(this.shopData.InfoID);
         if (this.itemInfo.Type == 3 && this.itemInfo.SubType == 0)
         {
             this.petInfo = Globals.Instance.AttDB.PetDict.GetInfo(this.itemInfo.Value2);
         }
         else if (this.itemInfo.Type == 3 && this.itemInfo.SubType == 3)
         {
             this.lopetInfo = Globals.Instance.AttDB.LopetDict.GetInfo(this.itemInfo.Value2);
         }
     }
     else if (this.shopData.InfoType == 2)
     {
         this.petInfo = Globals.Instance.AttDB.PetDict.GetInfo(this.shopData.InfoID);
     }
     else if (this.shopData.InfoType == 3)
     {
         this.lopetInfo = Globals.Instance.AttDB.LopetDict.GetInfo(this.shopData.InfoID);
     }
     this.BuyShopItemEvent = buyCallback;
     this.ShowShopItemEvent = showCallback;
 }
예제 #11
0
        public bool SendMsgShopSystemGC2GMReqShopPaidRefresh(EShopType type, CBMsgShopSystemGM2GCAckShopPaidRefresh cb)
        {
            CMsgShopSystemGC2GMReqShopPaidRefresh req = new CMsgShopSystemGC2GMReqShopPaidRefresh(type);

            CMsgShopSystemGM2GCAckShopPaidRefresh.cb = cb;
            return(CGameClient.Singleton.SendMsg(req));
        }
예제 #12
0
 public override void OnActivate(int pinID)
 {
     if (pinID != 0 || ((Behaviour)this).get_enabled())
     {
         return;
     }
     if (Network.Mode == Network.EConnectMode.Online)
     {
         this.mShopType = GlobalVars.ShopType;
         string str = this.mShopType.ToString();
         if (this.mShopType == EShopType.Guerrilla)
         {
             this.ExecRequest((WebAPI) new ReqItemGuerrillaShop(str, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
         }
         else
         {
             this.ExecRequest((WebAPI) new ReqItemShop(str, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
         }
         ((Behaviour)this).set_enabled(true);
     }
     else
     {
         this.Success();
     }
 }
예제 #13
0
 public CShopData()
 {
     this.displaySprite = string.Empty;
     this.price         = 100;
     this.type          = EShopType.NONE;
     this.value         = 0;
     this.isUsing       = false;
 }
예제 #14
0
        public Task ClearBufferAsync(EShopType shopType)
        {
            var key = "BufferedData" + shopType;

            return(Task.Factory.StartNew(() =>
            {
                _memoryCache.Remove(key);
            }));
        }
예제 #15
0
 private void Start()
 {
     if (MonoSingleton <GameManager> .Instance.Player.CheckEnableConvertGold())
     {
         FlowNode_GameObject.ActivateOutputLinks((Component)this, 10);
     }
     if (Object.op_Inequality((Object)this.ImgNPC, (Object)null))
     {
         EShopType npcRand = this.NpcRandArray[Random.Range(0, this.NpcRandArray.Length)];
         this.ImgNPC.set_texture((Texture)AssetManager.Load <Texture2D>(ShopWindow.ImgPathPrefix + (object)npcRand));
     }
     MonoSingleton <GameManager> .Instance.OnSceneChange += new GameManager.SceneChangeEvent(this.OnGoOutShop);
 }
예제 #16
0
 public ShopGridData(EShopType shopType, ShopInfo info, ShopGridData.ShopItemCallback buyCallback, ShopGridData.ShopItemCallback showCallback)
 {
     this.ShopType = shopType;
     this.shopInfo = info;
     if (info.IsFashion != 0)
     {
         this.fashionInfo = Globals.Instance.AttDB.FashionDict.GetInfo(this.shopInfo.InfoID);
     }
     else
     {
         this.itemInfo = Globals.Instance.AttDB.ItemDict.GetInfo(this.shopInfo.InfoID);
     }
     this.BuyShopItemEvent = buyCallback;
     this.ShowShopItemEvent = showCallback;
 }
예제 #17
0
 public Task AddToBufferAsync(transaction transaction, EShopType shopType)
 {
     return(Task.Factory.StartNew(() =>
     {
         var key = "BufferedData" + shopType;
         if (!_memoryCache.TryGetValue(key, out List <transaction> currentBuffer))
         {
             var newList = new List <transaction>();
             newList.Add(transaction);
             _memoryCache.Set(key, newList);
         }
         else
         {
             currentBuffer.Add(transaction);
             _memoryCache.Set(key, currentBuffer, TimeSpan.FromMinutes(5));
         }
     }));
 }
예제 #18
0
    void setSpriteButton(EShopType type)
    {
        foreach (Transform child_1 in this.transform)
        {
            if (child_1.name == "Buttons")
            {
                foreach (Transform child_2 in child_1.transform)
                {
                    switch (child_2.name)
                    {
                    case "Buy Tower":
                        if (type == EShopType.TOWER)
                        {
                            child_2.transform.GetChild(0).GetComponent <UISprite>().spriteName   = "button-bg-2";
                            child_2.transform.GetChild(0).GetComponent <UIButton>().normalSprite = "button-bg-2";
                        }
                        else if (type == EShopType.ITEM)
                        {
                            child_2.transform.GetChild(0).GetComponent <UISprite>().spriteName   = "button-bg-1";
                            child_2.transform.GetChild(0).GetComponent <UIButton>().normalSprite = "button-bg-1";
                        }
                        break;

                    case "Buy Item":
                        if (type == EShopType.TOWER)
                        {
                            child_2.transform.GetChild(0).GetComponent <UISprite>().spriteName   = "button-bg-1";
                            child_2.transform.GetChild(0).GetComponent <UIButton>().normalSprite = "button-bg-1";
                        }
                        else if (type == EShopType.ITEM)
                        {
                            child_2.transform.GetChild(0).GetComponent <UISprite>().spriteName   = "button-bg-2";
                            child_2.transform.GetChild(0).GetComponent <UIButton>().normalSprite = "button-bg-2";
                        }
                        break;
                    }
                }

                break;
            }
        }
    }
예제 #19
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 0 || ((Behaviour)this).get_enabled())
            {
                return;
            }
            string gname;

            if (GlobalVars.ShopType != EShopType.Event)
            {
                this.mShopType = GlobalVars.ShopType;
                gname          = this.mShopType.ToString();
            }
            else
            {
                gname = GlobalVars.EventShopItem.shops.gname;
            }
            this.ExecRequest((WebAPI) new ReqShopLineup(gname, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
            ((Behaviour)this).set_enabled(true);
        }
예제 #20
0
 private void InitShopEntryItem(EShopType type, Transform Shop)
 {
     if (Shop == null)
     {
         return;
     }
     GUIShopEntry.ShopItem shopItem = new GUIShopEntry.ShopItem();
     this.ShopItems[(int)type] = shopItem;
     shopItem.shopIcon = Shop.GetComponent<UISprite>();
     shopItem.shopTile = Shop.Find("title").GetComponent<UILabel>();
     shopItem.newTip = Shop.Find("new");
     shopItem.disableMask = Shop.Find("disable");
     shopItem.openTip = Shop.Find("tips").GetComponent<UILabel>();
     shopItem.shopIcon.spriteName = string.Format("shop{0}", (int)type);
     shopItem.shopTile.text = Singleton<StringManager>.Instance.GetString(string.Format("ShopN{0}", (int)type));
     this.RefreshShopOpenState(type);
     if (type == EShopType.EShop_Common2)
     {
         shopItem.newTip.gameObject.SetActive(Globals.Instance.Player.HasRedFlag(1024));
     }
     else if (type == EShopType.EShop_Awaken)
     {
         shopItem.newTip.gameObject.SetActive(Globals.Instance.Player.HasRedFlag(2048));
     }
     else if (type == EShopType.EShop_Lopet)
     {
         shopItem.newTip.gameObject.SetActive(Globals.Instance.Player.HasRedFlag(131072));
         shopItem.shopIcon2 = Shop.Find("Icon2").GetComponent<UISprite>();
         shopItem.shopIcon2.enabled = true;
         shopItem.shopIcon2.spriteName = string.Format("shop{0}", (int)type);
     }
     else
     {
         shopItem.newTip.gameObject.SetActive(false);
     }
     UIEventListener expr_1A6 = UIEventListener.Get(Shop.gameObject);
     expr_1A6.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_1A6.onClick, new UIEventListener.VoidDelegate(this.OnShopItemClick));
     int num = (int)type;
     Shop.name = num.ToString();
 }
예제 #21
0
 public static bool IsShopOpen(EShopType type)
 {
     LocalPlayer player = Globals.Instance.Player;
     switch (type)
     {
     case EShopType.EShop_Common2:
         return (ulong)player.Data.Level >= (ulong)((long)GameConst.GetInt32(27));
     case EShopType.EShop_Awaken:
         return (ulong)player.Data.Level >= (ulong)((long)GameConst.GetInt32(24));
     case EShopType.EShop_Guild:
         return player.Data.HasGuild == 1;
     case EShopType.EShop_Trial:
         return (ulong)player.Data.Level >= (ulong)((long)GameConst.GetInt32(5));
     case EShopType.EShop_KR:
         return (ulong)player.Data.Level >= (ulong)((long)GameConst.GetInt32(2));
     case EShopType.EShop_Pvp:
         return (ulong)player.Data.Level >= (ulong)((long)GameConst.GetInt32(6));
     case EShopType.EShop_Lopet:
         return (ulong)player.Data.Level >= (ulong)((long)GameConst.GetInt32(201));
     }
     return true;
 }
예제 #22
0
        public Task <List <transaction> > GetBufferAsync(EShopType shopType)
        {
            var key = "BufferedData" + shopType;

            return(Task.Factory.StartNew <List <transaction> >(() => _memoryCache.Get <List <transaction> >(key)));
        }
예제 #23
0
 private void RefreshShopOpenState(EShopType type)
 {
     GUIShopEntry.ShopItem shopItem = this.ShopItems[(int)type];
     if (shopItem == null)
     {
         return;
     }
     shopItem.shopIcon.gameObject.SetActive(true);
     if (GUIShopScene.IsShopOpen(type))
     {
         shopItem.disableMask.gameObject.SetActive(false);
         shopItem.openTip.gameObject.SetActive(false);
     }
     else if (type == EShopType.EShop_Guild)
     {
         shopItem.openTip.text = Singleton<StringManager>.Instance.GetString("ShopD2");
         shopItem.openTip.gameObject.SetActive(true);
         shopItem.disableMask.gameObject.SetActive(true);
     }
     else if (type == EShopType.EShop_KR)
     {
         shopItem.openTip.text = string.Format(Singleton<StringManager>.Instance.GetString(string.Format("ShopD{0}", (int)type)), GameConst.GetInt32(2));
         shopItem.openTip.gameObject.SetActive(true);
         shopItem.disableMask.gameObject.SetActive(true);
     }
     else if (type == EShopType.EShop_Trial)
     {
         shopItem.openTip.text = string.Format(Singleton<StringManager>.Instance.GetString(string.Format("ShopD{0}", (int)type)), GameConst.GetInt32(5));
         shopItem.openTip.gameObject.SetActive(true);
         shopItem.disableMask.gameObject.SetActive(true);
     }
     else if (type == EShopType.EShop_Pvp)
     {
         shopItem.openTip.text = string.Format(Singleton<StringManager>.Instance.GetString(string.Format("ShopD{0}", (int)type)), GameConst.GetInt32(6));
         shopItem.openTip.gameObject.SetActive(true);
         shopItem.disableMask.gameObject.SetActive(true);
     }
     else if (type == EShopType.EShop_Common2)
     {
         shopItem.openTip.text = string.Format(Singleton<StringManager>.Instance.GetString(string.Format("ShopD{0}", (int)type)), GameConst.GetInt32(27));
         shopItem.openTip.gameObject.SetActive(true);
         shopItem.disableMask.gameObject.SetActive(true);
     }
     else if (type == EShopType.EShop_Awaken)
     {
         if ((ulong)Globals.Instance.Player.Data.Level < (ulong)((long)GameConst.GetInt32(26)))
         {
             shopItem.shopIcon.gameObject.SetActive(false);
         }
         else
         {
             shopItem.openTip.text = string.Format(Singleton<StringManager>.Instance.GetString(string.Format("ShopD{0}", (int)type)), GameConst.GetInt32(24));
             shopItem.openTip.gameObject.SetActive(true);
             shopItem.disableMask.gameObject.SetActive(true);
         }
     }
     else if (type == EShopType.EShop_Lopet)
     {
         if ((ulong)Globals.Instance.Player.Data.Level < (ulong)((long)GameConst.GetInt32(209)))
         {
             shopItem.shopIcon.gameObject.SetActive(false);
         }
         else
         {
             shopItem.openTip.text = string.Format(Singleton<StringManager>.Instance.GetString(string.Format("ShopD{0}", (int)type)), GameConst.GetInt32(201));
             shopItem.openTip.gameObject.SetActive(true);
             shopItem.disableMask.gameObject.SetActive(true);
         }
     }
     else
     {
         shopItem.openTip.gameObject.SetActive(false);
         shopItem.disableMask.gameObject.SetActive(false);
     }
 }
예제 #24
0
 public static void TryOpen(EShopType type)
 {
     if (type == EShopType.EShop_Max)
     {
         return;
     }
     if (!GUIShopScene.IsShopOpen(type))
     {
         switch (type)
         {
         case EShopType.EShop_Common2:
             GameUIManager.mInstance.ShowMessageTip(Singleton<StringManager>.Instance.GetString("ShopD0", new object[]
             {
                 GameConst.GetInt32(27)
             }), 0f, 0f);
             break;
         case EShopType.EShop_Awaken:
             GameUIManager.mInstance.ShowMessageTip(Singleton<StringManager>.Instance.GetString("ShopD1", new object[]
             {
                 GameConst.GetInt32(24)
             }), 0f, 0f);
             break;
         case EShopType.EShop_Guild:
             GameUIManager.mInstance.ShowMessageTipByKey("ShopD2", 0f, 0f);
             break;
         case EShopType.EShop_Trial:
             GameUIManager.mInstance.ShowMessageTip(Singleton<StringManager>.Instance.GetString("ShopD4", new object[]
             {
                 GameConst.GetInt32(5)
             }), 0f, 0f);
             break;
         case EShopType.EShop_KR:
             GameUIManager.mInstance.ShowMessageTip(Singleton<StringManager>.Instance.GetString("ShopD5", new object[]
             {
                 GameConst.GetInt32(2)
             }), 0f, 0f);
             break;
         case EShopType.EShop_Pvp:
             GameUIManager.mInstance.ShowMessageTip(Singleton<StringManager>.Instance.GetString("ShopD8", new object[]
             {
                 GameConst.GetInt32(6)
             }), 0f, 0f);
             break;
         case EShopType.EShop_Lopet:
             GameUIManager.mInstance.ShowMessageTip(Singleton<StringManager>.Instance.GetString("ShopD9", new object[]
             {
                 GameConst.GetInt32(201)
             }), 0f, 0f);
             break;
         }
         return;
     }
     GUIShopScene.PendingOpenShopType = type;
     GUIShopScene gUIShopScene = GameUIManager.mInstance.CurUISession as GUIShopScene;
     if (gUIShopScene == null)
     {
         GameUIManager.mInstance.ChangeSession<GUIShopScene>(null, false, true);
     }
     else if (gUIShopScene.ShopType != type)
     {
         gUIShopScene.OpenPendingShop();
     }
 }
예제 #25
0
        private void GotoShop(TrophyParam trophy)
        {
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;
            EShopType  type   = EShopType.Normal;

            if (!string.IsNullOrEmpty(trophy.Objectives[0].sval))
            {
                char[] chArray = new char[1] {
                    ','
                };
                string[] strArray = trophy.Objectives[0].sval.Split(chArray);
                type = !string.IsNullOrEmpty(strArray[0]) ? (EShopType)MonoSingleton <GameManager> .Instance.MasterParam.GetShopType(strArray[0]) : EShopType.Normal;
            }
            if (type >= EShopType.Normal && player.CheckUnlockShopType(type))
            {
                switch (type)
                {
                case EShopType.Normal:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1013);
                    break;

                case EShopType.Tabi:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1014);
                    break;

                case EShopType.Kimagure:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1015);
                    break;

                case EShopType.Monozuki:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1016);
                    break;

                case EShopType.Tour:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1017);
                    break;

                case EShopType.Arena:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1018);
                    break;

                case EShopType.Multi:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1019);
                    break;

                case EShopType.AwakePiece:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1020);
                    break;

                case EShopType.Artifact:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1021);
                    break;
                }
            }
            if (type < EShopType.Normal)
            {
                return;
            }
            if (MonoSingleton <GameManager> .Instance.Player.CheckUnlockShopType(type))
            {
                return;
            }
            try
            {
                UnlockTargets unlockTargets = type.ToUnlockTargets();
                LevelLock.ShowLockMessage(player.Lv, player.VipRank, unlockTargets);
            }
            catch (Exception ex)
            {
            }
        }
예제 #26
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 1)
            {
                return;
            }
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            ((Behaviour)this).set_enabled(false);
            EventShopData eventShopData = player.GetEventShopData();

            if (eventShopData == null)
            {
                this.ActivateOutputLinks(104);
            }
            else
            {
                EventShopItem shopitem = eventShopData.items.FirstOrDefault <EventShopItem>((Func <EventShopItem, bool>)(item => item.id == GlobalVars.ShopBuyIndex));
                if (shopitem.is_soldout)
                {
                    this.ActivateOutputLinks(105);
                }
                else
                {
                    int buy = 0;
                    if (shopitem.IsArtifact)
                    {
                        buy = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(shopitem.iname).GetBuyNum(shopitem.saleType);
                    }
                    else if (shopitem.IsConceptCard)
                    {
                        if (!MonoSingleton <GameManager> .Instance.Player.CheckConceptCardCapacity(shopitem.num * GlobalVars.ShopBuyAmount))
                        {
                            ConceptCardParam conceptCardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(shopitem.iname);

                            if (conceptCardParam != null && conceptCardParam.type == eCardType.Equipment)
                            {
                                this.ActivateOutputLinks(106);
                                return;
                            }
                        }
                    }
                    else
                    {
                        ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(shopitem.iname);

                        if (!shopitem.IsSet && !player.CheckItemCapacity(itemParam, shopitem.num * GlobalVars.ShopBuyAmount))
                        {
                            this.ActivateOutputLinks(106);
                            return;
                        }
                    }
                    switch (shopitem.saleType)
                    {
                    case ESaleType.Gold:
                        if (!this.CheckCanBuy(shopitem, buy, player.Gold, 107))
                        {
                            return;
                        }
                        break;

                    case ESaleType.Coin:
                        if (!this.CheckCanBuy(shopitem, buy, player.Coin, 108))
                        {
                            return;
                        }
                        break;

                    case ESaleType.TourCoin:
                        if (!this.CheckCanBuy(shopitem, buy, player.TourCoin, 109))
                        {
                            return;
                        }
                        break;

                    case ESaleType.ArenaCoin:
                        if (!this.CheckCanBuy(shopitem, buy, player.ArenaCoin, 110))
                        {
                            return;
                        }
                        break;

                    case ESaleType.PiecePoint:
                        if (!this.CheckCanBuy(shopitem, buy, player.PiecePoint, 111))
                        {
                            return;
                        }
                        break;

                    case ESaleType.MultiCoin:
                        if (!this.CheckCanBuy(shopitem, buy, player.MultiCoin, 112))
                        {
                            return;
                        }
                        break;

                    case ESaleType.EventCoin:
                        if (shopitem.isSetSaleValue)
                        {
                            int saleValue = shopitem.saleValue;
                            if (player.EventCoinNum(shopitem.cost_iname) < saleValue)
                            {
                                this.ActivateOutputLinks(114);
                                return;
                            }
                            break;
                        }
                        break;

                    case ESaleType.Coin_P:
                        if (!this.CheckCanBuy(shopitem, buy, player.PaidCoin, 113))
                        {
                            return;
                        }
                        break;
                    }
                    if (Network.Mode == Network.EConnectMode.Offline)
                    {
                        player.DEBUG_BUY_ITEM(GlobalVars.ShopType, GlobalVars.ShopBuyIndex);
                        this.Success();
                    }
                    else
                    {
                        this.mShopType = GlobalVars.ShopType;
                        this.ExecRequest((WebAPI) new ReqItemEventShopBuypaid(GlobalVars.EventShopItem.shops.gname, GlobalVars.ShopBuyIndex, GlobalVars.ShopBuyAmount, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                        ((Behaviour)this).set_enabled(true);
                    }
                }
            }
        }
예제 #27
0
 private void Change2Shop(EShopType type)
 {
     GUIShopScene.TryOpen(type);
 }
예제 #28
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 1)
            {
                return;
            }
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            ((Behaviour)this).set_enabled(false);
            LimitedShopData limitedShopData = player.GetLimitedShopData();

            if (limitedShopData == null)
            {
                this.ActivateOutputLinks(104);
            }
            else
            {
                LimitedShopItem limitedShopItem = limitedShopData.items[GlobalVars.ShopBuyIndex];
                if (limitedShopItem.is_soldout)
                {
                    this.ActivateOutputLinks(105);
                }
                else
                {
                    ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(limitedShopItem.iname);

                    if (!limitedShopItem.IsSet && !player.CheckItemCapacity(itemParam, limitedShopItem.num))
                    {
                        this.ActivateOutputLinks(106);
                    }
                    else
                    {
                        switch (limitedShopItem.saleType)
                        {
                        case ESaleType.Gold:
                            int num1 = !limitedShopItem.isSetSaleValue ? (int)itemParam.buy * limitedShopItem.num : limitedShopItem.saleValue;
                            if (player.Gold < num1)
                            {
                                this.ActivateOutputLinks(107);
                                return;
                            }
                            break;

                        case ESaleType.Coin:
                            int num2 = !limitedShopItem.isSetSaleValue ? (int)itemParam.coin * limitedShopItem.num : limitedShopItem.saleValue;
                            if (player.Coin < num2)
                            {
                                this.ActivateOutputLinks(108);
                                return;
                            }
                            break;

                        case ESaleType.TourCoin:
                            int num3 = !limitedShopItem.isSetSaleValue ? (int)itemParam.tour_coin * limitedShopItem.num : limitedShopItem.saleValue;
                            if (player.TourCoin < num3)
                            {
                                this.ActivateOutputLinks(109);
                                return;
                            }
                            break;

                        case ESaleType.ArenaCoin:
                            int num4 = !limitedShopItem.isSetSaleValue ? (int)itemParam.arena_coin * limitedShopItem.num : limitedShopItem.saleValue;
                            if (player.ArenaCoin < num4)
                            {
                                this.ActivateOutputLinks(110);
                                return;
                            }
                            break;

                        case ESaleType.PiecePoint:
                            int num5 = !limitedShopItem.isSetSaleValue ? (int)itemParam.piece_point * limitedShopItem.num : limitedShopItem.saleValue;
                            if (player.PiecePoint < num5)
                            {
                                this.ActivateOutputLinks(111);
                                return;
                            }
                            break;

                        case ESaleType.MultiCoin:
                            int num6 = !limitedShopItem.isSetSaleValue ? (int)itemParam.multi_coin * limitedShopItem.num : limitedShopItem.saleValue;
                            if (player.MultiCoin < num6)
                            {
                                this.ActivateOutputLinks(112);
                                return;
                            }
                            break;

                        case ESaleType.EventCoin:
                            this.ActivateOutputLinks(113);
                            return;

                        case ESaleType.Coin_P:
                            int num7 = !limitedShopItem.isSetSaleValue ? (int)itemParam.coin * limitedShopItem.num : limitedShopItem.saleValue;
                            if (player.PaidCoin < num7)
                            {
                                this.ActivateOutputLinks(113);
                                return;
                            }
                            break;
                        }
                        if (Network.Mode == Network.EConnectMode.Offline)
                        {
                            player.DEBUG_BUY_ITEM(GlobalVars.ShopType, GlobalVars.ShopBuyIndex);
                            this.Success();
                        }
                        else
                        {
                            this.mShopType = GlobalVars.ShopType;
                            this.ExecRequest((WebAPI) new ReqItemLimitedShopBuypaid(GlobalVars.LimitedShopItem.shops.gname, GlobalVars.ShopBuyIndex, 1, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                            ((Behaviour)this).set_enabled(true);
                        }
                    }
                }
            }
        }
예제 #29
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 1 || ((Behaviour)this).get_enabled())
            {
                return;
            }
            this.mShopType = GlobalVars.ShopType;
            ShopData shopData = MonoSingleton <GameManager> .Instance.Player.GetShopData(this.mShopType);

            ShopParam shopParam = MonoSingleton <GameManager> .Instance.MasterParam.GetShopParam(this.mShopType);

            ((Behaviour)this).set_enabled(false);
            if (shopData == null || shopParam == null)
            {
                this.ActivateOutputLinks(101);
            }
            else
            {
                PlayerData player         = MonoSingleton <GameManager> .Instance.Player;
                int        shopUpdateCost = player.GetShopUpdateCost(this.mShopType, false);
                switch (shopParam.UpdateCostType)
                {
                case ESaleType.Gold:
                    if (player.Gold < shopUpdateCost)
                    {
                        this.ActivateOutputLinks(103);
                        return;
                    }
                    break;

                case ESaleType.Coin:
                    if (player.Coin < shopUpdateCost)
                    {
                        this.ActivateOutputLinks(104);
                        return;
                    }
                    break;

                case ESaleType.TourCoin:
                    if (player.TourCoin < shopUpdateCost)
                    {
                        this.ActivateOutputLinks(105);
                        return;
                    }
                    break;

                case ESaleType.ArenaCoin:
                    if (player.ArenaCoin < shopUpdateCost)
                    {
                        this.ActivateOutputLinks(106);
                        return;
                    }
                    break;

                case ESaleType.PiecePoint:
                    if (player.PiecePoint < shopUpdateCost)
                    {
                        this.ActivateOutputLinks(107);
                        return;
                    }
                    break;

                case ESaleType.MultiCoin:
                    if (player.MultiCoin < shopUpdateCost)
                    {
                        this.ActivateOutputLinks(108);
                        return;
                    }
                    break;

                case ESaleType.EventCoin:
                    if (player.EventCoinNum(GlobalVars.EventShopItem.shop_cost_iname) < shopUpdateCost)
                    {
                        this.ActivateOutputLinks(109);
                        return;
                    }
                    break;
                }
                if (Network.Mode == Network.EConnectMode.Online)
                {
                    if (this.mShopType != EShopType.Event)
                    {
                        this.ExecRequest((WebAPI) new ReqItemShopUpdate(this.mShopType.ToString(), new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                    }
                    else
                    {
                        this.ExecRequest((WebAPI) new ReqItemEventShopUpdate(GlobalVars.EventShopItem.shops.gname, GlobalVars.EventShopItem.shop_cost_iname, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                    }
                    ((Behaviour)this).set_enabled(true);
                }
                else if (!player.CheckShopUpdateCost(GlobalVars.ShopType))
                {
                    this.ActivateOutputLinks(104);
                }
                else
                {
                    this.Success();
                }
            }
        }
예제 #30
0
 public static void RequestShopBuyRTItem(RTShopGridData data, EShopType shopType)
 {
     if (data == null || data.shopData == null)
     {
         return;
     }
     if (data.shopData.BuyCount != 0u)
     {
         GameUIManager.mInstance.ShowMessageTip(Singleton<StringManager>.Instance.GetString("ShopT3"), 0f, 0f);
         return;
     }
     int num = data.GetPrice();
     if (Tools.GetCurrencyMoney((ECurrencyType)data.shopData.Type, 0) < num)
     {
         Tools.MoneyNotEnough((ECurrencyType)data.shopData.Type, num, 0);
         return;
     }
     MC2S_ShopBuyItem mC2S_ShopBuyItem = new MC2S_ShopBuyItem();
     mC2S_ShopBuyItem.ID = data.shopData.ID;
     mC2S_ShopBuyItem.Price = (uint)num;
     mC2S_ShopBuyItem.ShopType = (int)shopType;
     mC2S_ShopBuyItem.Count = 1;
     Globals.Instance.CliSession.Send(514, mC2S_ShopBuyItem);
 }
예제 #31
0
 private void OpenShopData()
 {
     this.mTargetTable.ClearData();
     this.mTargetTable.ShopType = this.ShopType;
     this.mTargetTable.cellWidth = 448f;
     this.mTargetTable.cellHeight = 114f;
     this.mTargetTable.ClearGridItem();
     this.mTargetTable.SetDragAmount(0f, 0f);
     this.mBG.height = 512;
     this.Currency2.gameObject.SetActive(false);
     if (this.ShopType == EShopType.EShop_Common2)
     {
         List<ShopItemData> petShopData = Globals.Instance.Player.PetShopData;
         for (int i = 0; i < petShopData.Count; i++)
         {
             this.mTargetTable.AddData(new RTShopGridData(this.ShopType, petShopData[i], new RTShopGridData.ShopItemCallback(this.OnOpenRTShopBuyCheckDialog), new RTShopGridData.ShopItemCallback(this.OnOpenShowRTShopItemDialog)));
         }
         if (petShopData.Count > 6)
         {
             this.mBG.height = 576;
         }
     }
     else if (this.ShopType == EShopType.EShop_Awaken)
     {
         List<ShopItemData> awakeShopData = Globals.Instance.Player.AwakeShopData;
         for (int j = 0; j < awakeShopData.Count; j++)
         {
             this.mTargetTable.AddData(new RTShopGridData(this.ShopType, awakeShopData[j], new RTShopGridData.ShopItemCallback(this.OnOpenRTShopBuyCheckDialog), new RTShopGridData.ShopItemCallback(this.OnOpenShowRTShopItemDialog)));
         }
     }
     else if (this.ShopType == EShopType.EShop_Lopet)
     {
         List<ShopItemData> lopetShopData = Globals.Instance.Player.LopetShopData;
         for (int k = 0; k < lopetShopData.Count; k++)
         {
             this.mTargetTable.AddData(new RTShopGridData(this.ShopType, lopetShopData[k], new RTShopGridData.ShopItemCallback(this.OnOpenRTShopBuyCheckDialog), new RTShopGridData.ShopItemCallback(this.OnOpenShowRTShopItemDialog)));
         }
     }
     else
     {
         this.RefreshCurrency2();
         LocalPlayer player = Globals.Instance.Player;
         foreach (ShopInfo current in Globals.Instance.AttDB.ShopDict.Values)
         {
             if ((ulong)player.Data.Level >= (ulong)((long)current.Level))
             {
                 EShopType shopType = (EShopType)current.ShopType;
                 if (shopType == this.ShopType)
                 {
                     bool flag = true;
                     if (current.ResetType == 1 && player.GetBuyCount(current) >= current.Times)
                     {
                         flag = false;
                     }
                     else if (current.IsFashion != 0)
                     {
                         FashionInfo info = Globals.Instance.AttDB.FashionDict.GetInfo(current.InfoID);
                         if (info == null || info.Gender != player.Data.Gender + 1 || player.ItemSystem.HasFashion(info.ID))
                         {
                             flag = false;
                         }
                     }
                     else if (this.ShopType == EShopType.EShop_Trial)
                     {
                         switch (this.curEquipTab)
                         {
                         case 1:
                         {
                             ItemInfo info2 = Globals.Instance.AttDB.ItemDict.GetInfo(current.InfoID);
                             flag = (info2 != null && (info2.Type == 0 || info2.Type == 3) && info2.Quality == 2);
                             break;
                         }
                         case 2:
                         {
                             ItemInfo info3 = Globals.Instance.AttDB.ItemDict.GetInfo(current.InfoID);
                             flag = (info3 != null && (info3.Type == 0 || info3.Type == 3) && info3.Quality == 3);
                             break;
                         }
                         case 3:
                         {
                             ItemInfo info4 = Globals.Instance.AttDB.ItemDict.GetInfo(current.InfoID);
                             flag = (info4 != null && (info4.Type == 0 || info4.Type == 3) && info4.Quality == 4);
                             break;
                         }
                         default:
                         {
                             ItemInfo info5 = Globals.Instance.AttDB.ItemDict.GetInfo(current.InfoID);
                             if (info5 == null)
                             {
                                 flag = false;
                             }
                             else if (info5.Type == 0 || info5.Type == 3)
                             {
                                 flag = (info5.Quality != 4 && info5.Quality != 3 && info5.Quality != 2);
                             }
                             break;
                         }
                         }
                     }
                     if (flag)
                     {
                         this.mTargetTable.AddData(new ShopGridData(this.ShopType, current, new ShopGridData.ShopItemCallback(this.OnOpenShopBuyCheckDialog), new ShopGridData.ShopItemCallback(this.OnOpenShowShopItemDialog)));
                     }
                 }
             }
         }
         if (this.ShopType == EShopType.EShop_Common)
         {
             this.mTargetTable.cellHeight = 143f;
         }
     }
     this.mTargetTable.repositionNow = true;
 }
예제 #32
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 1)
            {
                return;
            }
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            ((Behaviour)this).set_enabled(false);
            LimitedShopData limitedShopData = player.GetLimitedShopData();

            if (limitedShopData == null)
            {
                this.ActivateOutputLinks(104);
            }
            else
            {
                LimitedShopItem shopitem = limitedShopData.items[GlobalVars.ShopBuyIndex];
                if (shopitem.is_soldout)
                {
                    this.ActivateOutputLinks(105);
                }
                else
                {
                    int buyNum;
                    if (shopitem.IsArtifact)
                    {
                        buyNum = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(shopitem.iname).GetBuyNum(shopitem.saleType);
                    }
                    else
                    {
                        ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(shopitem.iname);

                        if (!shopitem.IsSet && !player.CheckItemCapacity(itemParam, shopitem.num))
                        {
                            this.ActivateOutputLinks(106);
                            return;
                        }
                        buyNum = itemParam.GetBuyNum(shopitem.saleType);
                    }
                    switch (shopitem.saleType)
                    {
                    case ESaleType.Gold:
                        if (!this.CheckCanBuy(shopitem, buyNum, player.Gold, 107))
                        {
                            return;
                        }
                        break;

                    case ESaleType.Coin:
                        if (!this.CheckCanBuy(shopitem, buyNum, player.Coin, 108))
                        {
                            return;
                        }
                        break;

                    case ESaleType.TourCoin:
                        if (!this.CheckCanBuy(shopitem, buyNum, player.TourCoin, 109))
                        {
                            return;
                        }
                        break;

                    case ESaleType.ArenaCoin:
                        if (!this.CheckCanBuy(shopitem, buyNum, player.ArenaCoin, 110))
                        {
                            return;
                        }
                        break;

                    case ESaleType.PiecePoint:
                        if (!this.CheckCanBuy(shopitem, buyNum, player.PiecePoint, 111))
                        {
                            return;
                        }
                        break;

                    case ESaleType.MultiCoin:
                        if (!this.CheckCanBuy(shopitem, buyNum, player.MultiCoin, 112))
                        {
                            return;
                        }
                        break;

                    case ESaleType.EventCoin:
                        this.ActivateOutputLinks(113);
                        return;

                    case ESaleType.Coin_P:
                        if (!this.CheckCanBuy(shopitem, buyNum, player.PaidCoin, 113))
                        {
                            return;
                        }
                        break;
                    }
                    if (Network.Mode == Network.EConnectMode.Offline)
                    {
                        player.DEBUG_BUY_ITEM(GlobalVars.ShopType, GlobalVars.ShopBuyIndex);
                        this.Success();
                    }
                    else
                    {
                        this.mShopType = GlobalVars.ShopType;
                        this.ExecRequest((WebAPI) new ReqItemLimitedShopBuypaid(GlobalVars.LimitedShopItem.shops.gname, GlobalVars.ShopBuyIndex, 1, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                        ((Behaviour)this).set_enabled(true);
                    }
                }
            }
        }
예제 #33
0
 public CMsgShopSystemGC2GMReqShopOpen(EShopType type)
     : base(CServerType.SRVTYPE_GAMESERVER, CFuncType.EFUNCTYPE_SHOPSYSTEM, CShopSystemMsgNumID.EMSGID_SHOPSYSTEM_GC2GM_REQ_SHOP_OPEN)
 {
     m_type = type; 
 }
예제 #34
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 1)
            {
                return;
            }
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            ((Behaviour)this).set_enabled(false);
            ShopData shopData = player.GetShopData(GlobalVars.ShopType);

            if (shopData == null)
            {
                this.ActivateOutputLinks(104);
            }
            else
            {
                ShopItem shopitem = shopData.items.FirstOrDefault <ShopItem>((Func <ShopItem, bool>)(item => item.id == GlobalVars.ShopBuyIndex));
                if (shopitem.is_soldout)
                {
                    this.ActivateOutputLinks(105);
                }
                else
                {
                    int       buy       = 0;
                    ItemParam itemParam = (ItemParam)null;
                    if (shopitem.IsArtifact)
                    {
                        buy = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(shopitem.iname).GetBuyNum(shopitem.saleType);
                    }
                    else if (shopitem.IsConceptCard)
                    {
                        if (!MonoSingleton <GameManager> .Instance.Player.CheckConceptCardCapacity(shopitem.num * GlobalVars.ShopBuyAmount))
                        {
                            ConceptCardParam conceptCardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(shopitem.iname);

                            if (conceptCardParam != null && conceptCardParam.type == eCardType.Equipment)
                            {
                                this.ActivateOutputLinks(106);
                                return;
                            }
                        }
                    }
                    else
                    {
                        itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(shopitem.iname);

                        if (!shopitem.IsSet && !player.CheckItemCapacity(itemParam, shopitem.num * GlobalVars.ShopBuyAmount))
                        {
                            this.ActivateOutputLinks(106);
                            return;
                        }
                        buy = itemParam.GetBuyNum(shopitem.saleType);
                    }
                    switch (shopitem.saleType)
                    {
                    case ESaleType.Gold:
                        if (!this.CheckCanBuy(shopitem, buy, player.Gold, 107))
                        {
                            return;
                        }
                        break;

                    case ESaleType.Coin:
                        if (!this.CheckCanBuy(shopitem, buy, player.Coin, 108))
                        {
                            return;
                        }
                        break;

                    case ESaleType.TourCoin:
                        if (!this.CheckCanBuy(shopitem, buy, player.TourCoin, 109))
                        {
                            return;
                        }
                        break;

                    case ESaleType.ArenaCoin:
                        if (!this.CheckCanBuy(shopitem, buy, player.ArenaCoin, 110))
                        {
                            return;
                        }
                        break;

                    case ESaleType.PiecePoint:
                        if (!this.CheckCanBuy(shopitem, buy, player.PiecePoint, 111))
                        {
                            return;
                        }
                        break;

                    case ESaleType.MultiCoin:
                        if (!this.CheckCanBuy(shopitem, buy, player.MultiCoin, 112))
                        {
                            return;
                        }
                        break;

                    case ESaleType.EventCoin:
                        DebugUtility.Assert("There is no common price in the event coin.");
                        this.ActivateOutputLinks(113);
                        return;

                    case ESaleType.Coin_P:
                        if (!this.CheckCanBuy(shopitem, buy, player.PaidCoin, 114))
                        {
                            return;
                        }
                        break;
                    }
                    this.mShopType = GlobalVars.ShopType;
                    int shopBuyIndex = GlobalVars.ShopBuyIndex;
                    if (Network.Mode == Network.EConnectMode.Offline)
                    {
                        if (itemParam == null)
                        {
                            return;
                        }
                        player.DEBUG_BUY_ITEM(this.mShopType, shopBuyIndex);
                        ShopParam shopParam = MonoSingleton <GameManager> .Instance.MasterParam.GetShopParam(this.mShopType);

                        player.OnBuyAtShop(shopParam.iname, itemParam.iname, shopitem.num);
                        this.Success();
                    }
                    else
                    {
                        if (this.mShopType == EShopType.Guerrilla)
                        {
                            this.ExecRequest((WebAPI) new ReqItemGuerrillaShopBuypaid(shopBuyIndex, GlobalVars.ShopBuyAmount, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                        }
                        else
                        {
                            this.ExecRequest((WebAPI) new ReqItemShopBuypaid(this.mShopType.ToString(), shopBuyIndex, GlobalVars.ShopBuyAmount, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                        }
                        ((Behaviour)this).set_enabled(true);
                    }
                }
            }
        }
예제 #35
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 1)
            {
                return;
            }
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            ((Behaviour)this).set_enabled(false);
            ShopData shopData = player.GetShopData(GlobalVars.ShopType);

            if (shopData == null)
            {
                this.ActivateOutputLinks(104);
            }
            else
            {
                ShopItem shopItem = shopData.items[GlobalVars.ShopBuyIndex];
                if (shopItem.is_soldout)
                {
                    this.ActivateOutputLinks(105);
                }
                else
                {
                    ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(shopItem.iname);

                    if (!player.CheckItemCapacity(itemParam, shopItem.num))
                    {
                        this.ActivateOutputLinks(106);
                    }
                    else
                    {
                        switch (shopItem.saleType)
                        {
                        case ESaleType.Gold:
                            if (player.Gold < (int)itemParam.buy * shopItem.num)
                            {
                                this.ActivateOutputLinks(107);
                                return;
                            }
                            break;

                        case ESaleType.Coin:
                            if (player.Coin < (int)itemParam.coin * shopItem.num)
                            {
                                this.ActivateOutputLinks(108);
                                return;
                            }
                            break;

                        case ESaleType.TourCoin:
                            if (player.TourCoin < (int)itemParam.tour_coin * shopItem.num)
                            {
                                this.ActivateOutputLinks(109);
                                return;
                            }
                            break;

                        case ESaleType.ArenaCoin:
                            if (player.ArenaCoin < (int)itemParam.arena_coin * shopItem.num)
                            {
                                this.ActivateOutputLinks(110);
                                return;
                            }
                            break;

                        case ESaleType.PiecePoint:
                            if (player.PiecePoint < (int)itemParam.piece_point * shopItem.num)
                            {
                                this.ActivateOutputLinks(111);
                                return;
                            }
                            break;

                        case ESaleType.MultiCoin:
                            if (player.MultiCoin < (int)itemParam.multi_coin * shopItem.num)
                            {
                                this.ActivateOutputLinks(112);
                                return;
                            }
                            break;

                        case ESaleType.EventCoin:
                            DebugUtility.Assert("There is no common price in the event coin.");
                            this.ActivateOutputLinks(113);
                            return;
                        }
                        this.mShopType = GlobalVars.ShopType;
                        int shopBuyIndex = GlobalVars.ShopBuyIndex;
                        if (Network.Mode == Network.EConnectMode.Offline)
                        {
                            player.DEBUG_BUY_ITEM(this.mShopType, shopBuyIndex);
                            ShopParam shopParam = MonoSingleton <GameManager> .Instance.MasterParam.GetShopParam(this.mShopType);

                            player.OnBuyAtShop(shopParam.iname, itemParam.iname, shopItem.num);
                            this.Success();
                        }
                        else
                        {
                            this.ExecRequest((WebAPI) new ReqItemShopBuypaid(this.mShopType.ToString(), shopBuyIndex, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                            ((Behaviour)this).set_enabled(true);
                        }
                    }
                }
            }
        }
예제 #36
0
 public static void RequestShopBuyItem(ShopInfo shopInfo, EShopType shopType, int count)
 {
     if (shopInfo == null)
     {
         return;
     }
     LocalPlayer player = Globals.Instance.Player;
     if (shopInfo.Type == 1 && (player.GuildSystem.Guild == null || player.GuildSystem.Guild.Level < shopInfo.Value))
     {
         GameUIManager.mInstance.ShowMessageTip(string.Format(Singleton<StringManager>.Instance.GetString("ShopT4"), shopInfo.Value), 0f, 0f);
         return;
     }
     if (shopInfo.Type == 2 && player.Data.TrialMaxWave < shopInfo.Value)
     {
         GameUIManager.mInstance.ShowMessageTip(string.Format(Singleton<StringManager>.Instance.GetString("ShopT41"), shopInfo.Value), 0f, 0f);
         return;
     }
     if (shopInfo.Type == 3 && (player.Data.ArenaHighestRank == 0 || player.Data.ArenaHighestRank > shopInfo.Value))
     {
         GameUIManager.mInstance.ShowMessageTip(string.Format(Singleton<StringManager>.Instance.GetString("ShopT42"), shopInfo.Value), 0f, 0f);
         return;
     }
     int buyCount = player.GetBuyCount(shopInfo);
     if (shopInfo.Times != 0)
     {
         int num = Tools.GetShopBuyTimes(shopInfo) - buyCount;
         if (num <= 0)
         {
             GameUIManager.mInstance.ShowMessageTip(Singleton<StringManager>.Instance.GetString("ShopT3"), 0f, 0f);
             return;
         }
     }
     int num2 = 0;
     int num3 = 0;
     if (shopInfo.IsFashion != 0)
     {
         if (Tools.GetCurrencyMoney((ECurrencyType)shopInfo.CurrencyType2, 0) < shopInfo.Price2)
         {
             Tools.MoneyNotEnough((ECurrencyType)shopInfo.CurrencyType2, shopInfo.Price2, 0);
             return;
         }
         num2 = count * shopInfo.Price;
         if (Tools.GetCurrencyMoney((ECurrencyType)shopInfo.CurrencyType, 0) < num2)
         {
             Tools.MoneyNotEnough((ECurrencyType)shopInfo.CurrencyType, num2, 0);
             return;
         }
         MC2S_ShopBuyFashion mC2S_ShopBuyFashion = new MC2S_ShopBuyFashion();
         mC2S_ShopBuyFashion.ID = shopInfo.ID;
         Globals.Instance.CliSession.Send(534, mC2S_ShopBuyFashion);
     }
     else
     {
         ItemInfo info = Globals.Instance.AttDB.ItemDict.GetInfo(shopInfo.InfoID);
         while (count - num3 > 0)
         {
             num2 += Tools.GetItemBuyConst(info, buyCount + ++num3, shopInfo);
         }
         if (Tools.GetCurrencyMoney((ECurrencyType)shopInfo.CurrencyType, 0) < num2)
         {
             Tools.MoneyNotEnough((ECurrencyType)shopInfo.CurrencyType, num2, 0);
             return;
         }
         if (shopInfo.Price2 > 0 && Tools.MoneyNotEnough((ECurrencyType)shopInfo.CurrencyType2, num3 * shopInfo.Price2, 0))
         {
             return;
         }
         MC2S_ShopBuyItem mC2S_ShopBuyItem = new MC2S_ShopBuyItem();
         mC2S_ShopBuyItem.ID = shopInfo.ID;
         mC2S_ShopBuyItem.Price = (uint)shopInfo.Price;
         mC2S_ShopBuyItem.ShopType = (int)shopType;
         mC2S_ShopBuyItem.Count = count;
         Globals.Instance.CliSession.Send(514, mC2S_ShopBuyItem);
     }
 }
예제 #37
0
 private void OpenPendingShop()
 {
     if (GUIShopScene.PendingOpenShopType == EShopType.EShop_Max)
     {
         global::Debug.LogError(new object[]
         {
             "data error"
         });
         GUIShopScene.PendingOpenShopType = EShopType.EShop_Common;
     }
     if (!GUIShopScene.IsShopOpen(GUIShopScene.PendingOpenShopType))
     {
         global::Debug.LogError(new object[]
         {
             "data error"
         });
         GameUIManager.mInstance.GobackSession();
         return;
     }
     this.ShopType = GUIShopScene.PendingOpenShopType;
     this.Title.text = Singleton<StringManager>.Instance.GetString(string.Format("ShopN{0}", (int)this.ShopType));
     TopGoods topGoods = GameUIManager.mInstance.GetTopGoods();
     topGoods.BackLabelText = this.Title.text;
     this._RefreshShopStatus();
     for (int i = 0; i < 4; i++)
     {
         this.tabEquip[i].gameObject.SetActive(this.ShopType == EShopType.EShop_Trial);
     }
     if (GUIShopScene.PendingOpenShopType == EShopType.EShop_Common2)
     {
         MC2S_GetShopData mC2S_GetShopData = new MC2S_GetShopData();
         mC2S_GetShopData.ShopVersion = Globals.Instance.Player.PetShopVersion;
         mC2S_GetShopData.Refresh = false;
         mC2S_GetShopData.ShopType = 0;
         mC2S_GetShopData.DiamondRefresh = false;
         Globals.Instance.CliSession.Send(512, mC2S_GetShopData);
     }
     else if (GUIShopScene.PendingOpenShopType == EShopType.EShop_Awaken)
     {
         MC2S_GetShopData mC2S_GetShopData2 = new MC2S_GetShopData();
         mC2S_GetShopData2.ShopVersion = Globals.Instance.Player.AwakeShopVersion;
         mC2S_GetShopData2.Refresh = false;
         mC2S_GetShopData2.ShopType = 1;
         mC2S_GetShopData2.DiamondRefresh = false;
         Globals.Instance.CliSession.Send(512, mC2S_GetShopData2);
     }
     else if (GUIShopScene.PendingOpenShopType == EShopType.EShop_Lopet)
     {
         MC2S_GetShopData mC2S_GetShopData3 = new MC2S_GetShopData();
         mC2S_GetShopData3.ShopVersion = Globals.Instance.Player.AwakeShopVersion;
         mC2S_GetShopData3.Refresh = false;
         mC2S_GetShopData3.ShopType = 9;
         mC2S_GetShopData3.DiamondRefresh = false;
         Globals.Instance.CliSession.Send(512, mC2S_GetShopData3);
     }
     else
     {
         this.OpenShopData();
     }
 }
예제 #38
0
 public CMsgShopSystemGC2GMReqShopPaidRefresh(EShopType type)
     : base(CServerType.SRVTYPE_GAMESERVER, CFuncType.EFUNCTYPE_SHOPSYSTEM, CShopSystemMsgNumID.EMSGID_SHOPSYSTEM_GC2GM_REQ_SHOP_PAIDREFRESH)
 {
     m_type = type;
 }
예제 #39
0
    public static bool TrackSpendShopUpdate(ESaleType sale_type, EShopType shop_type, int value)
    {
        string name = "ShopUpdate." + shop_type.ToString();

        return(MyMetaps.TrackSpend(sale_type.ToString(), name, value));
    }