當前位置: 首頁>>代碼示例>>C#>>正文


C# UserNote.GetInt32方法代碼示例

本文整理匯總了C#中Sinan.FrontServer.UserNote.GetInt32方法的典型用法代碼示例。如果您正苦於以下問題:C# UserNote.GetInt32方法的具體用法?C# UserNote.GetInt32怎麽用?C# UserNote.GetInt32使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sinan.FrontServer.UserNote的用法示例。


在下文中一共展示了UserNote.GetInt32方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AllUseGoods

 private void AllUseGoods(UserNote note)
 {
     //商品的使用
     Variant package = BurdenManager.BurdenPlace(note.Player.B0, note.GetInt32(0));
     if (package == null) return;
     string goodsid = package.GetStringOrDefault("E");
     if (goodsid == null) return;
     GameConfig gc = GameConfigAccess.Instance.FindOneById(goodsid);
     if (gc == null) return;
     UseGoods(note, package, gc, true);
 }
開發者ID:abel,項目名稱:sinan,代碼行數:11,代碼來源:GoodsMediator.cs

示例2: IntoBattle

        /// <summary>
        /// 進入玩家和怪的戰鬥
        /// </summary>
        /// <param name="note"></param>
        private void IntoBattle(UserNote note)
        {
            List<PlayerBusiness> players = FightBase.GetPlayers(note.Player);
            FightObject[] teamA = FightBase.CreateFightPlayers(players);
            FightType fType = (FightType)(note.GetInt32(0));
            FightObject[] teamB = FightBase.CreateApcTeam(players, fType, note[1]);

            string npcID = note.GetString(2);

            if (players.Count == 0 || teamB.Length == 0)
            {
                foreach (var v in players)
                {
                    v.SetActionState(ActionState.Standing);
                }
                return;
            }
            bool isEctype = (note.Player.Scene is SceneEctype || note.Player.Scene is SceneSubEctype);

            FightBusiness fb;
            if (fType == FightType.SceneAPC)
            {
                //打明怪
                SceneApc sab = note.GetValue<SceneApc>(3);
                int subID = note.GetInt32(4);
                fb = new FightSceneApc(teamA, teamB, players, npcID, isEctype, sab, subID);
            }
            else if (fType == FightType.RobAPC)
            {
                SceneApc sab = note.GetValue<SceneApc>(3);
                int subID = note.GetInt32(4);
                RobBusiness rb = note.GetValue<RobBusiness>(5);
                fb = new FightBusinessRobApc(teamA, teamB, players, npcID, isEctype, sab, subID, rb);
            }
            else if (fType == FightType.ProAPC)
            {
                //守護戰爭明怪
                SceneApc sab = note.GetValue<SceneApc>(3);
                int subID = note.GetInt32(4);
                PartBusiness pb = note.GetValue<PartBusiness>(5);
                fb = new FightBusinessProApc(teamA, teamB, players, npcID, isEctype, sab, subID, pb);
            }
            else
            {
                fb = new FightBusiness(teamA, teamB, players, npcID, isEctype);
            }
            foreach (var player in players)
            {
                player.Fight = fb;
            }
            fb.SendToClinet(FightCommand.StartFight, (int)fType, teamA, teamB);
            fb.Start();
        }
開發者ID:abel,項目名稱:sinan,代碼行數:57,代碼來源:FightMediator.cs

示例3: FightEctypeApc

        /// <summary>
        /// 跟副本怪戰鬥
        /// </summary>
        /// <param name="note"></param>
        private void FightEctypeApc(UserNote note)
        {
            PlayerBusiness player = note.Player;
            TeamInstanceBusiness eb = player.TeamInstance;
            if (eb == null || player.AState == ActionState.Fight || (player.TeamJob == TeamJob.Member))
            {
                return;
            }

            int index = note.GetInt32(0);
            if (!eb.CheckBatch(index))
            {
                //提示
                return;
            }

            const FightType ft = FightType.EctypeApc;
            EctypeApc apc = eb.CurrentApcs[index];
            List<PlayerBusiness> players = FightBase.GetPlayers(note.Player);
            FightObject[] teamA = FightBase.CreateFightPlayers(players);
            FightObject[] teamB = FightBase.CreateApcTeam(players, ft, apc.Apc);

            if (teamB.Length == 0 || eb.Astate != ActionState.Standing)
            {
                foreach (var v in players)
                {
                    v.SetActionState(ActionState.Standing);
                }
                return;
            }
            FightBusinessEctype fb = new FightBusinessEctype(teamA, teamB, players, eb, apc);
            foreach (var item in players)
            {
                item.Fight = fb;
            }
            fb.SendToClinet(FightCommand.StartFight, (int)ft, teamA, teamB);
            fb.Start();
        }
開發者ID:abel,項目名稱:sinan,代碼行數:42,代碼來源:TeamInstanceMediator.cs

示例4: AuctionBid

        /// <summary>
        /// 競價
        /// </summary>
        public static void AuctionBid(UserNote note)
        {
            string auctionid = note.GetString(0);
            int BidPrice = note.GetInt32(1);//競價

            string npcid = note.GetString(2);//NPC
            if (!note.Player.EffectActive(npcid, ""))
                return;

            if (note.Player.Score < BidPrice)
            {
                note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.NoScore));
                //遊戲不足
                return;
            }
            Auction auction = AuctionAccess.Instance.FindOne(auctionid);
            if (auction == null)
            {
                //物口不存在
                note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.NoGoods));
                return;
            }

            string soleid = auctionid + note.Name;
            if (!m_dic.TryAdd(soleid, soleid))
                return;
            try
            {
                if (auction.Value.GetIntOrDefault("Status") != 0)
                {
                    note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.IsSell));
                    return;
                }
                DateTime dt = DateTime.UtcNow;
                DateTime EndTime;

                if (!DateTime.TryParse(auction.Value.GetStringOrEmpty("EndTime"), out EndTime))
                {
                    note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.Expired));
                    return;
                }

                if (EndTime < dt)
                {
                    //過期物品不能競拍
                    note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.Expired));
                    return;
                }

                int price = auction.Value.GetIntOrDefault("Price");//一口價

                if (price > 0 && BidPrice > price)
                {
                    note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.MorePrice));
                    return;
                }
                else if (price > 0 && BidPrice == price)
                {
                    //一口價操作
                    UserNote n = new UserNote(note, AuctionCommand.AuctionBuy, new object[] { auction.ID });
                    Notifier.Instance.Publish(n);
                    return;
                }
                int bidPrice = auction.Value.GetIntOrDefault("BidPrice");
                if (string.IsNullOrEmpty(auction.Value.GetStringOrEmpty("BidderID")))
                {
                    if (bidPrice > BidPrice)
                    {
                        note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.LossStartPrice));
                        return;
                    }
                }
                else
                {
                    if (bidPrice >= BidPrice)
                    {
                        //競拍價格太底
                        note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.NoBidPrice));
                        return;
                    }
                }
                if (!note.Player.AddScore(-BidPrice, FinanceType.AuctionBid))
                {
                    note.Call(AuctionCommand.AuctionBidR, false, TipManager.GetMessage(AuctionReturn.MorePrice));
                    return;
                }
                if (auction.Value.GetStringOrEmpty("BidderID") != string.Empty)
                {
                    //競購失敗
                    Dictionary<string, object> bidFail = new Dictionary<string, object>();
                    bidFail.Add("GoodsName", auction.Name);
                    bidFail.Add("Name", auction.Value.GetStringOrDefault("BidName"));
                    bidFail.Add("Score", bidPrice.ToString());

                    PlayerBusiness BidOnLine = PlayersProxy.FindPlayerByID(auction.Value.GetStringOrDefault("BidderID"));
                    AuctionEmail.SendAuctionEmail(bidFail, AuctionEmail.BidFail, auction.ID, BidOnLine.ID, BidOnLine.Name, bidPrice, 0, null);

//.........這裏部分代碼省略.........
開發者ID:abel,項目名稱:sinan,代碼行數:101,代碼來源:AuctionBusiness.cs

示例5: BuyMallGoods

        /// <summary>
        /// 購買商城產品
        /// </summary>
        /// <param name="note"></param>
        private void BuyMallGoods(UserNote note)
        {
            //買的道具ID
            string id = note.GetString(0);
            //數量
            int number = note.GetInt32(1);
            //貨幣類型
            string cointype = note.GetString(2);

            //是否通過GM上下架檢查
            if (ServerManager.IsMall)
            {
                //物品沒有上架
                if (!MallAccess.HS.Contains(id))
                {
                    note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.MallDown));
                    return;
                }
            }

            GameConfig gc = GameConfigAccess.Instance.FindOneById(id);
            if (gc == null)
            {
                note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.MallGoodsNo));
                return;
            }

            Variant v = gc.Value;
            DateTime dt = DateTime.UtcNow;

            string upDate = v.GetStringOrDefault("UpDate");
            //上架時間
            if (!string.IsNullOrEmpty(upDate))
            {
                DateTime update = v.GetDateTimeOrDefault("UpDate").ToUniversalTime();
                if (dt < update)
                {
                    note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.MallUp));
                    return;
                }
            }
            string downDate = v.GetStringOrDefault("DownDate");
            //下架時間
            if (!string.IsNullOrEmpty(downDate))
            {
                DateTime endDate = v.GetDateTimeOrDefault("DownDate").ToUniversalTime();
                if (endDate < dt)
                {
                    note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.MallDown));
                    return;
                }
            }

            string goodsid = v.GetStringOrDefault("GoodsID");
            int count = v.GetIntOrDefault("Number");

            GameConfig gid = GameConfigAccess.Instance.FindOneById(goodsid);
            if (gid == null)
            {
                note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.MallGoodsNo));
                return;
            }

            if (gc.SubType == "ShiZhuang")
            {
                PlayerEx wx = note.Player.Wardrobe;
                Variant wv = wx.Value;
                IList wl = wv.GetValue<IList>("WardrobeList");
                if (wl != null)
                {
                    if (wl.Contains(goodsid))
                    {
                        note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.NoRepeat));
                        return;
                    }
                }

                Variant limit = gid.Value.GetVariantOrDefault("UserLimit");
                if (limit != null)
                {
                    if (limit.ContainsKey("Sex"))
                    {
                        int sex = Convert.ToInt32(limit["Sex"]);
                        if (sex != 2 && sex != note.Player.Sex)
                        {
                            note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.NoSex));
                            return;
                        }
                    }
                }

                //需要晶幣
                int coin = gc.Value.GetIntOrDefault("ZCoin");
                if (note.Player.Coin < coin)
                {
                    note.Call(MallCommand.BuyMallGoodsR, false, TipManager.GetMessage(MallReturn.MallCoinNo));
//.........這裏部分代碼省略.........
開發者ID:abel,項目名稱:sinan,代碼行數:101,代碼來源:MallMediator.cs

示例6: SaveShowInfo

 /// <summary>
 /// 更新顯示信息
 /// </summary>
 /// <param name="note"></param>
 private void SaveShowInfo(UserNote note)
 {
     int showInfo = note.GetInt32(0);
     note.Player.ShowInfo = showInfo;
     PlayerAccess.Instance.SaveValue(note.Player.PID, "ShowInfo", showInfo);
 }
開發者ID:abel,項目名稱:sinan,代碼行數:10,代碼來源:BurdenMediator.cs

示例7: ConsumeCoin

        /// <summary>
        /// 晶幣變化
        /// </summary>
        /// <param name="note"></param>
        public static void ConsumeCoin(UserNote note)
        {
            PlayerEx ex = note.Player.Social;
            if (ex == null)
                return;
            Variant m = ex.Value.GetValueOrDefault<Variant>("Mentor");
            if (m == null)
                return;
            IList master = m.GetValue<IList>("Master");
            if (master == null || master.Count <= 0)
                return;

            Variant v = master[0] as Variant;
            if (v == null) return;

            PlayerBusiness pb = PlayersProxy.FindPlayerByID(v.GetStringOrDefault("PlayerID"));
            if (pb == null) return;

            int coin = note.GetInt32(0);
            FinanceType ft = note.GetValue<FinanceType>(1);
            int bond = 0;//得到
            int owe = 0;
            if (coin < 0)
            {
                if (note.Player.Level > 39)
                {
                    //高徒
                    bond = Convert.ToInt32(Math.Ceiling(-coin * 0.05));

                }
                else
                {
                    //學徒
                    bond = Convert.ToInt32(Math.Ceiling(-coin * 0.1));
                }
                owe = Convert.ToInt32(Math.Ceiling(-coin * 0.5));
            }
            int reTime = Convert.ToInt32(TipManager.GetMessage(EmailReturn.HameDay));
            if (bond > 0)
            {
                if (pb.AddBond(bond, FinanceType.ConsumeCoin))
                {
                    string msg = string.Format(TipManager.GetMessage(SocialReturn.ConsumeCoin1), note.Player.Name, bond);
                    //"你的徒弟【" + note.Player.Name + "】消費晶幣,為感謝師傅的栽培,為師傅送上了【" + bond + "】點劵";
                    //徒弟消費獎勵點劵

                    if (EmailAccess.Instance.SendEmail(TipManager.GetMessage(SocialReturn.ConsumeCoin2), TipManager.GetMessage(SocialReturn.FriendsBless8), pb.ID, pb.Name, msg, string.Empty, null, reTime))
                    {
                        if (pb.Online)
                        {
                            pb.Call(EmailCommand.NewEmailTotalR, EmailAccess.Instance.NewTotal(pb.ID));
                        }
                    }
                }
            }

            if (owe > 0)
            {
                if (pb.AddOwe(owe, FinanceType.ConsumeCoin))
                {
                    string msg = string.Format(TipManager.GetMessage(SocialReturn.ConsumeCoin3), owe);
                    // "你獲得了【" + owe + "】點感恩值";
                    //徒弟消費獎勵感恩值
                    if (EmailAccess.Instance.SendEmail(TipManager.GetMessage(SocialReturn.ConsumeCoin4), TipManager.GetMessage(SocialReturn.FriendsBless8), pb.ID, pb.Name, msg, string.Empty, null, reTime))
                    {
                        if (pb.Online)
                        {
                            pb.Call(EmailCommand.NewEmailTotalR, EmailAccess.Instance.NewTotal(pb.ID));
                            pb.Call(ClientCommand.SendActivtyR, new object[] { "T02", msg });
                        }
                    }
                }
            }

            //晶幣消費總量
            //long gce = note.Player.GCE;
        }
開發者ID:abel,項目名稱:sinan,代碼行數:81,代碼來源:MasterBusiness.cs

示例8: HomeProduce

        /// <summary>
        /// 家園生產
        /// </summary>
        /// <param name="note"></param>
        public static void HomeProduce(UserNote note)
        {
            string soleid = note.PlayerID + "HomeProduce";
            if (!m_dic.TryAdd(soleid, soleid))
                return;

            try
            {

                string id = note.GetString(0);
                int number = note.GetInt32(1);
                string npcid = note.GetString(2);//NPC
                if (!note.Player.EffectActive(npcid, ""))
                    return;

                //要生產的道具數量
                GameConfig gc = GameConfigAccess.Instance.FindOneById(id);
                if (gc == null)
                {
                    note.Call(HomeCommand.HomeProduceR, false, TipManager.GetMessage(HomeReturn.PareError));
                    return;
                }
                string subType = gc.SubType;
                PlayerEx home = note.Player.Home;
                if (home == null)
                {
                    note.Call(HomeCommand.HomeProduceR, false, TipManager.GetMessage(HomeReturn.NoHome));
                    return;
                }

                Variant hv = home.Value;

                //得到需要的道具數量,計算出當前可以生產道具的數量
                Variant produces = hv.GetValueOrDefault<Variant>("Produces");
                if (produces == null)
                {
                    note.Call(HomeCommand.HomeProduceR, false, TipManager.GetMessage(HomeReturn.PareError));
                    return;
                }
                Variant v = produces.GetValueOrDefault<Variant>(subType);
                if (v == null)
                {
                    note.Call(HomeCommand.HomeProduceR, false, TipManager.GetMessage(HomeReturn.PareError));
                    return;
                }

                IList petList = v.GetValue<IList>("PetList");

                if (petList.Count == 0)
                {
                    note.Call(HomeCommand.HomeProduceR, false, TipManager.GetMessage(HomeReturn.InPet));
                    return;
                }

                int yaoJi = 0;
                int juanZhou = 0;
                int sheJi = 0;
                int jiaGong = 0;
                int caiJi = 0;
                int jiazhengtotal = 0;//寵物家政值總數

                Dictionary<string, Pet> producePet = new Dictionary<string, Pet>();
                foreach (Variant d in petList)
                {
                    yaoJi += d.GetIntOrDefault("YaoJi");
                    juanZhou += d.GetIntOrDefault("JuanZhou");
                    sheJi += d.GetIntOrDefault("SheJi");
                    jiaGong += d.GetIntOrDefault("JiaGong");
                    caiJi += d.GetIntOrDefault("CaiJi");
                }

                jiazhengtotal = yaoJi + juanZhou + jiaGong + caiJi;

                Dictionary<string, int> dic = new Dictionary<string, int>();
                dic.Add("YaoJi", yaoJi);
                dic.Add("JuanZhou", juanZhou);
                dic.Add("SheJi", sheJi);
                dic.Add("JiaGong", jiaGong);
                dic.Add("CaiJi", caiJi);

                //目標道具
                string goodsid = gc.Value.GetStringOrDefault("GoodsID");
                //生產所需時間,秒鍾
                int produceTime = gc.Value.GetIntOrDefault("ProduceTime");
                //所需家政信息
                Variant homeInfo = gc.Value.GetValueOrDefault<Variant>("HomeValue");

                //所需家政信息
                DateTime dt = DateTime.UtcNow;
                DateTime endTime = dt.AddSeconds(number * produceTime);

                Variant mv = MemberAccess.MemberInfo(note.Player.MLevel);

                //生產隊列數
                int qc = 3 + mv.GetIntOrDefault("Produce");

//.........這裏部分代碼省略.........
開發者ID:abel,項目名稱:sinan,代碼行數:101,代碼來源:HomeBusiness_QY.cs

示例9: BurdenExtend

        /// <summary>
        /// 包袱或倉庫擴展[還要求判斷是否要求晶幣消費]
        /// </summary>
        /// <param name="note"></param>
        /// <param name="exname">包袱或倉庫名</param>
        /// <param name="count">擴展數量</param>
        private void BurdenExtend(UserNote note)
        {
            PlayerEx burden = note.Player.B1;
            if (burden != null)
            {
                Variant v = burden.Value;
                //最大值
                int max = v.GetIntOrDefault("Max");
                //當前數量
                int cur = v.GetIntOrDefault("Cur");
                if (cur >= max)
                {
                    note.Call(BurdenCommand.BurdenExtendR, false, TipManager.GetMessage(BurdenReturn.BurdenMaxEx));
                    return;
                }

                int number = note.GetInt32(0);
                string goodsid = "";
                double lv = GameConfigAccess.Instance.FindExtend(ExtendType.B1, cur.ToString(), out number, out goodsid);

                if (string.IsNullOrEmpty(goodsid) || number <= 0)
                {
                    note.Call(PetsCommand.ShockSkillR, false, TipManager.GetMessage(ExtendReturn.B12));
                    return;
                }

                if (!note.Player.RemoveGoods(goodsid, number, GoodsSource.BurdenExtend))
                {
                    note.Call(PetsCommand.ShockSkillR, false, TipManager.GetMessage(ExtendReturn.B12));
                    return;
                }

                note.Player.UpdateBurden();
                if (NumberRandom.RandomHit(lv))
                {
                    v["Cur"] = cur + 7;
                    IList c = v.GetValue<IList>("C");
                    for (int i = cur; i < cur + 7; i++)
                    {
                        Variant d = new Variant();
                        d["P"] = i;
                        d["E"] = "";
                        d["G"] = "";
                        d["A"] = 0;
                        d["S"] = 0;
                        d["H"] = 0;
                        d["D"] = 0;
                        d["T"] = null;
                        c.Add(d);
                    }

                    burden.Save();
                    note.Call(BurdenCommand.BurdenExtendR, true, TipManager.GetMessage(BurdenReturn.Success));
                    note.Player.FinishNote(FinishCommand.ExtendLib);
                }
                else
                {
                    note.Call(PetsCommand.ShockSkillR, false, TipManager.GetMessage(ExtendReturn.B13));
                }
            }
        }
開發者ID:abel,項目名稱:sinan,代碼行數:67,代碼來源:BurdenMediator.cs

示例10: Fuse

        /// <summary>
        /// 合成操作,將多個道具或裝備合成新的道具[完成]
        /// </summary>
        /// <param name="note"></param>
        private void Fuse(UserNote note)
        {
            //合成配置的ID
            string mixid = note.GetString(0);
            //合成數量
            int number = note.GetInt32(1);
            //提升成功率的數量
            int upCount = note.GetInt32(2);

            string npcid = note.GetString(3);
            if (!note.Player.EffectActive(npcid, ""))
                return;

            GameConfig gc = GameConfigAccess.Instance.FindOneById(mixid);
            if (gc == null)
            {
                note.Call(FuseCommand.FuseR, false, TipManager.GetMessage(FuseReturn.FuseEquipNo));
                return;
            }

            #region 目標道具基本信息,判斷包袱是否滿和角色遊戲幣是否滿足
            string upid = gc.Value.GetStringOrDefault("UpID");

            string fuseGoodsID = gc.Value.GetStringOrDefault("GoodsID");
            GameConfig fuseGC = GameConfigAccess.Instance.FindOneById(fuseGoodsID);

            int m = BurdenManager.StactCount(fuseGC);

            if (m == 0)
            {
                note.Call(FuseCommand.FuseR, false, TipManager.GetMessage(FuseReturn.FuseEquipError));
                return;
            }

            int y = 0;
            int s = Math.DivRem(number, m, out y);
            //需要空格子的數量
            int n = (y == 0) ? s : s + 1;
            PlayerEx burden = note.Player.B0;
            IList c = burden.Value.GetValue<IList>("C");
            int grid = 0;
            int upNumber = 0;
            foreach (Variant d in c)
            {
                if (string.IsNullOrEmpty(d.GetStringOrDefault("E")))
                    grid++;
                //提升成功率的道具
                if (upid == d.GetStringOrDefault("G"))
                {
                    upNumber += d.GetIntOrDefault("A");
                }
            }

            if (grid < n)
            {
                //表示包袱格子數不足
                note.Call(FuseCommand.FuseR, false, TipManager.GetMessage(FuseReturn.FuseBurdenFull));
                return;
            }

            if (upNumber < upCount)
            {
                note.Call(FuseCommand.FuseR, false, TipManager.GetMessage(FuseReturn.FuseGoodsLv));
                return;
            }

            int score = 0;//合成所需遊戲幣

            Variant price = fuseGC.Value.GetValueOrDefault<Variant>("Price");
            Variant buy = price.GetValueOrDefault<Variant>("Buy");

            score = buy.GetIntOrDefault("Score") * number;

            #endregion

            #region 判斷合成所需材料是否夠
            IList mixNeed = gc.Value.GetValue<IList>("MixNeed");
            int isBinding = 0;
            foreach (Variant d in mixNeed)
            {
                int total = 0;
                int numCount = d.GetIntOrDefault("Number") * number;
                foreach (Variant con in c)
                {
                    if (con.GetStringOrDefault("G") == d.GetStringOrDefault("GoodsID"))
                    {
                        if (total < numCount && con.GetIntOrDefault("H") == 1)
                        {
                            //判斷目標道具是否為綁定狀態
                            isBinding = 1;
                        }
                        total += con.GetIntOrDefault("A");
                    }
                }

                if (total < numCount)
//.........這裏部分代碼省略.........
開發者ID:abel,項目名稱:sinan,代碼行數:101,代碼來源:EquipFuseMediator.cs

示例11: FamilyList

        /// <summary>
        /// 得到所有家族列表
        /// </summary>
        /// <param name="note"></param>
        public static void FamilyList(UserNote note)
        {
            int pageSize = note.GetInt32(0);
            int pageIndex = note.GetInt32(1);
            string familName = note.GetString(2);
            int totalCount = 0;
            int currCount = 0;
            List<Family> list = FamilyAccess.Instance.FamilyPage(pageSize, pageIndex, familName, out totalCount, out currCount);
            List<Variant> tmp = new List<Variant>();
            int a = 0;
            foreach (Family model in list)
            {
                a++;
                Variant v = new Variant();
                v.Add("ID", model.ID);
                v.Add("Name", model.Name);
                v.Add("Level", model.Value.GetIntOrDefault("Level"));

                IList persons = model.Value.GetValue<IList>("Persons");
                string bossName = string.Empty;
                foreach (Variant dy in persons)
                {
                    if (dy.GetIntOrDefault("RoleID") == 0)
                    {
                        //PlayerBusiness pb = PlayersProxy.FindPlayerByID(dy.GetStringOrDefault("PlayerID"));
                        ////族長名稱
                        //if (pb != null)
                        //{
                        //    ;// pb.Name;
                        //}
                        bossName = PlayerAccess.Instance.GetPlayerName(Convert.ToInt32(dy.GetStringOrDefault("PlayerID"), 16));
                        break;
                    }
                }

                Variant number = new Variant();
                number.Add("V", persons.Count);
                Variant max = FamilyBase.FamilyCount(model.Value.GetIntOrDefault("Level"));
                number.Add("M", max == number ? 20 : max.GetIntOrDefault("Persons"));
                v.Add("Number", number);
                v.Add("BossName", bossName);
                v.Add("Notice", model.Value.GetStringOrDefault("Notice"));
                v.Add("Sort", (currCount * pageSize) + a);
                tmp.Add(v);
            }
            note.Call(FamilyCommand.FamilyListR, totalCount, tmp);
        }
開發者ID:abel,項目名稱:sinan,代碼行數:51,代碼來源:FamilyBusiness.cs

示例12: ArenaGoodsPet

        /// <summary>
        /// 物品使用
        /// </summary>
        /// <param name="note"></param>
        public static void ArenaGoodsPet(UserNote note)
        {
            string sole = note.PlayerID + "ArenaGoodsPet";
            if (!m_dic.TryAdd(sole, sole))
                return;
            try
            {
                string petid = note.GetString(0);
                //使用格子物品的位置
                int position = note.GetInt32(1);

                ArenaBase model;
                if (!ArenaBusiness.ArenaList.TryGetValue(note.Player.SoleID, out model))
                {
                    //請先選擇競技場
                    note.Call(ArenaCommand.ArenaGoodsR, false, TipManager.GetMessage(ArenaReturn.ArenaGoodsPet1));
                    return;
                }

                Variant v = BurdenManager.BurdenPlace(note.Player.B0, position);
                if (v == null)
                {
                    //輸入參數不對
                    note.Call(ArenaCommand.ArenaGoodsR, false, TipManager.GetMessage(ArenaReturn.ArenaGoodsPet2));
                    return;
                }

                string goodsid = v.GetStringOrDefault("G");

                if (string.IsNullOrEmpty(goodsid))
                {
                    //物品不存在
                    note.Call(ArenaCommand.ArenaGoodsR, false, TipManager.GetMessage(ArenaReturn.ArenaGoodsPet3));
                    return;
                }

                GameConfig gc = GameConfigAccess.Instance.FindOneById(goodsid);
                if (gc == null)
                {
                    //物品不存在
                    note.Call(ArenaCommand.ArenaGoodsR, false, TipManager.GetMessage(ArenaReturn.ArenaGoodsPet3));
                    return;
                }

                if (gc.SubType != GoodsSub.Supply)
                {
                    //該物品不能在戰鬥中使用
                    note.Call(ArenaCommand.ArenaGoodsR, false, TipManager.GetMessage(ArenaReturn.ArenaGoodsPet4));
                    return;
                }

                if (!ArenaGoods.SupplyLimit(note, gc))
                    return;

                Pet p;
                if (model.Pets.TryGetValue(petid, out p))
                {
                    if (!SupplyPet(gc.Value, p, model, note.Player.Name))
                    {
                        //不需要補充
                        note.Call(ArenaCommand.ArenaGoodsR, false, TipManager.GetMessage(ArenaReturn.ArenaGoodsPet5));
                        return;
                    }

                    //作用成功移除物品
                    if (note.Player.RemoveGoods(position, GoodsSource.ArenaGoodsPet))
                    {
                        //Variant tmp = new Variant();
                        //tmp.Add("B0", note.Player.B0);
                        //note.Call(BurdenCommand.BurdenListR, tmp);
                        note.Player.UpdateBurden();
                    }
                }
            }
            finally
            {
                m_dic.TryRemove(sole, out sole);
            }
        }
開發者ID:abel,項目名稱:sinan,代碼行數:83,代碼來源:ArenaInfo.cs

示例13: PetInArena

        /// <summary>
        /// 寵物進入參戰
        /// </summary>
        /// <param name="note"></param>
        public static void PetInArena(UserNote note)
        {
            string petid = note.GetString(0);
            string groupname = note.GetString(1);

            int x = note.GetInt32(2);
            int y = note.GetInt32(3);

            if (string.IsNullOrEmpty(note.Player.SoleID))
            {
                //請選擇要參戰的競技場
                note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.ArenaGroupName1));
                return;
            }

            ArenaBase model;
            if (!ArenaBusiness.ArenaList.TryGetValue(note.Player.SoleID, out model))
            {
                //請選擇要參戰的競技場
                note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.PetInArena1));
                return;
            }

            if (model.StartTime < DateTime.UtcNow)
            {
                //競技場已經開始,不能再參戰
                note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.PetInArena2));
                return;
            }

            if (!model.GroupName.Contains(groupname))
            {
                //請選擇分組
                note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.PetInArena3));
                return;
            }

            if (!string.IsNullOrEmpty(note.Player.GroupName))
            {
                if (note.Player.GroupName != groupname)
                {
                    //你已經加入【" + note.Player.GroupName + "】組,不能再選擇其它組
                    note.Call(ArenaCommand.PetInArenaR, false, string.Format(TipManager.GetMessage(ArenaReturn.PetInArena4), note.Player.GroupName));
                    return;
                }
            }

            PlayerEx b3 = note.Player.B3;
            IList c = b3.Value.GetValue<IList>("C");
            Variant tmp = null;
            foreach (Variant v in c)
            {
                if (v.GetStringOrDefault("E") == petid)
                {
                    tmp = v;
                    break;
                }
            }

            if (tmp == null)
            {
                //寵物不存在
                note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.PetInArena5));
                return;
            }

            Pet p = PetAccess.Instance.FindOneById(petid);
            if (p == null || p.PlayerID != note.PlayerID)
            {
                note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.PetInArena5));
                return;
            }

            if (PetAccess.Instance.IsFatigue(p))
            {
                //寵物過度疲勞,不能參加競技場
                note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.PetInArena6));
                return;
            }

            if (Math.Abs(note.Player.FightValue - model.FightValue) > model.FightPoor)
            {
                //戰績差距太大,不能參加
                note.Call(ArenaCommand.PetInArenaR, false, TipManager.GetMessage(ArenaReturn.PetInArena7));
                return;
            }

            int count = 0;//已經放入的寵物數量
            int groupcount = 0;//得到選組寵物總數
            foreach (Pet pk in model.Pets.Values)
            {
                if (pk.PlayerID == note.PlayerID)
                {
                    count++;
                }

//.........這裏部分代碼省略.........
開發者ID:abel,項目名稱:sinan,代碼行數:101,代碼來源:ArenaInfo.cs

示例14: ArenaWalk

        /// <summary>
        /// 行走坐標中轉
        /// </summary>
        /// <param name="note"></param>
        public static void ArenaWalk(UserNote note)
        {
            string petid = note.GetString(0);
            Int64 point = note.GetInt64(1);

            ArenaBase model;
            if (!ArenaBusiness.ArenaList.TryGetValue(note.Player.SoleID, out model))
                return;
            //開始坐標
            Point begin = new Point();
            begin.X = Convert.ToInt32(point >> 24);
            begin.Y = Convert.ToInt32(point >> 16 & 0xff);

            //結束坐標
            Point end = new Point();
            end.X = Convert.ToInt32(point >> 8 & 0xff);
            end.Y = Convert.ToInt32(point & 0xff);
            Pet p;
            if (model.Pets.TryGetValue(petid, out p))
            {
                p.StartTime = DateTime.UtcNow;
                p.BeginPoint = model.SceneSession.ToScreen(begin);
                p.EndPoint = model.SceneSession.ToScreen(end);
                p.RangePet = note.GetString(2);
                p.PetStatus = note.GetInt32(3);
            }
            if (p != null)
            {
                if (p.PetStatus != 0)
                {
                    model.CallAll(ArenaCommand.ArenaWalkR, true, petid, point);
                }
            }
        }
開發者ID:abel,項目名稱:sinan,代碼行數:38,代碼來源:ArenaInfo.cs

示例15: EmailList

        /// <summary>
        /// 得到郵件列表
        /// </summary>
        /// <param name="note"></param>
        public static void EmailList(UserNote note)
        {
            int pageIndex = note.GetInt32(0);
            int pageSize = 6;//note.GetInt32(1);
            //0所有按時間,1未讀,2有附件,3到期時間
            int number = note.GetInt32(2);
            if (pageIndex < 0 || pageSize < 1)
            {
                note.Call(EmailCommand.EmailListR, 0, new List<Variant>());
                return;
            }
            int total = 0;
            List<Email> emailList = EmailAccess.Instance.EmailPage(note.PlayerID, pageSize, pageIndex, number, out total);

            List<Variant> list = new List<Variant>();
            foreach (Email model in emailList)
            {
                Variant mv = model.Value;
                if (mv == null)
                    continue;

                Variant v = new Variant();
                foreach (var item in mv)
                {
                    v.Add(item.Key, item.Value);
                }

                v.Add("ID", model.ID);
                v.Add("Name", model.Name);
                v.Add("MainType", model.MainType);
                v.Add("Status", model.Status);
                list.Add(v);
            }

            note.Call(EmailCommand.EmailListR, total, list);
        }
開發者ID:abel,項目名稱:sinan,代碼行數:40,代碼來源:EmailBusiness.cs


注:本文中的Sinan.FrontServer.UserNote.GetInt32方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。