当前位置: 首页>>代码示例>>C#>>正文


C# UserNote.GetBoolean方法代码示例

本文整理汇总了C#中Sinan.FrontServer.UserNote.GetBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# UserNote.GetBoolean方法的具体用法?C# UserNote.GetBoolean怎么用?C# UserNote.GetBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sinan.FrontServer.UserNote的用法示例。


在下文中一共展示了UserNote.GetBoolean方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReplyApply

 /// <summary>
 /// 队长返回请求结果
 /// </summary>
 /// <param name="note"></param>
 private void ReplyApply(UserNote note, PlayerTeam team)
 {
     bool reply = note.GetBoolean(0);
     string memberID = note.GetString(1);
     int check = note.GetInt32(2);
     PlayerBusiness member;
     if (note.Player.Scene.TryGetPlayer(memberID, out member))
     {
         if (member.GetHashCode() == check)
         {
             if (reply)
             {
                 if (team.TryAddMember(member))
                 {
                     var members = team.AllPlayerDetail;
                     member.Call(TeamCommand.IntoTeamR, true, new object[] { team, members });
                     note.Player.CallAllExcludeOne(member, TeamCommand.NewMemberR, team.TeamID, new PlayerDetail(member));
                     return;
                 }
             }
             else //不同意
             {
                 //对方拒绝了你的入队请求
                 member.Call(TeamCommand.IntoTeamR, false, TipManager.GetMessage(ClientReturn.ReplyApply1));
             }
         }
     }
 }
开发者ID:abel,项目名称:sinan,代码行数:32,代码来源:TeamCaptainMediator.cs

示例2: Stocking

        /// <summary>
        /// 放养
        /// </summary>
        /// <param name="note"></param>
        public void Stocking(UserNote note)
        {
            //宠物
            string id = note.GetString(0);
            bool isStocking = note.GetBoolean(1);
            if (note.Player.SceneID != SceneHome.DefaultID)
            {
                //不能在【{0}】场景{1}
                string str = string.Format(TipManager.GetMessage(PetsReturn.NoSceneID), note.Player.Scene.Name);
                note.Call(PetsCommand.StockingR, false, isStocking, str);
                return;
            }

            #region 家园驯化完成的宠物直接放养
            if (note.GetInt32(2) == 1)
            {
                PlayerEx home = note.Player.Home;
                Variant pk = home.Value["PetKeep"] as Variant;
                if (pk.GetIntOrDefault("PetsWild") != -1)
                {
                    note.Call(PetsCommand.StockingR, false, isStocking, TipManager.GetMessage(PetsReturn.NoExists));
                    //还不能放养
                    return;
                }
                if (pk.GetStringOrDefault("ID") != id)
                {
                    note.Call(PetsCommand.StockingR, false, isStocking, TipManager.GetMessage(PetsReturn.NoExists));
                    return;
                }
                Pet px = PetAccess.Instance.FindOneById(id);
                PlayerEx b2 = note.Player.B2;
                IList c2 = b2.Value.GetValue<IList>("C");
                Variant v2 = null;
                foreach (Variant v in c2)
                {
                    if (v.GetStringOrDefault("E") == string.Empty)
                    {
                        v2 = v;
                        break;
                    }
                }
                if (v2 == null)
                {
                    note.Call(PetsCommand.StockingR, false, isStocking, TipManager.GetMessage(PetsReturn.PetBurdenB2));
                    return;
                }

                v2["E"] = px.ID;
                v2["G"] = px.Value.GetStringOrDefault("PetsID");
                v2["S"] = px.Value.GetIntOrDefault("Sort");
                v2["H"] = px.Value.GetIntOrDefault("IsBinding");
                v2["A"] = 1;
                v2["D"] = 0;
                v2["R"] = px.Value.GetIntOrDefault("PetsRank");
                v2["I"] = 0;

                pk["ID"] = string.Empty;
                pk["PetID"] = string.Empty;
                pk["StartTime"] = string.Empty;
                pk["EndTime"] = string.Empty;
                pk["PetsWild"] = 0;
                pk["PetName"] = string.Empty;
                pk["PetsRank"] = 0;
                v2["T"] = PetAccess.Instance.CreateAward(note.Player.Level, id, note.PlayerID, note.Player.Pet);

                home.Save();
                b2.Save();

                note.Call(PetsCommand.StockingR, true, isStocking, PetAccess.Instance.GetPetModel(v2));
                Variant mn = new Variant();
                mn.Add("B2", note.Player.B2);
                note.Call(BurdenCommand.BurdenListR, mn);
                return;
            }
            #endregion

            #region 家园与宠物背包宠物交换
            //宠物所在位置
            PlayerEx burden0 = isStocking ? note.Player.B3 : note.Player.B2;

            //放入位置
            PlayerEx burden1 = isStocking ? note.Player.B2 : note.Player.B3;
            IList c0 = burden0.Value.GetValue<IList>("C");
            Variant v0 = null;
            foreach (Variant v in c0)
            {
                if (v.GetStringOrDefault("E") == id)
                {
                    v0 = v;
                    break;
                }
            }
            if (v0 == null)
            {
                note.Call(PetsCommand.StockingR, false, isStocking, TipManager.GetMessage(PetsReturn.NoExists));
                return;
//.........这里部分代码省略.........
开发者ID:abel,项目名称:sinan,代码行数:101,代码来源:PetMediator.cs

示例3: FriendsBack

        /// <summary>
        /// 得到申请回应
        /// </summary>
        /// <param name="note"></param>
        public static void FriendsBack(UserNote note)
        {
            string id = note.GetString(0);
            bool isagree = note.GetBoolean(1);
            PlayerBusiness pb = PlayersProxy.FindPlayerByID(id);
            if (!isagree)
            {
                pb.Call(SocialCommand.FriendsBackR, false, string.Format(TipManager.GetMessage(SocialReturn.FriendsBack1), note.Player.Name));
                //"【" + note.Player.Name + "】拒绝加你为好友", "");
                return;
            }

            if (!CheckFriends(note.Player, pb, SocialCommand.FriendsBackR, 1))
                return;

            Variant v = new Variant();
            v.Add("PlayerID", pb.ID);
            v.Add("Created", DateTime.UtcNow);

            PlayerEx social = note.Player.Social;
            IList enemy = social.Value.GetValue<IList>("Friends");
            int m = 0;
            int n = 0;
            if (enemy != null)
            {
                enemy.Add(v);
                m = enemy.Count;
            }
            else
            {
                social.Value["Friends"] = new List<Variant>() { v };
                m = 1;
            }

            Variant tmp = new Variant();
            tmp.Add("PlayerID", note.PlayerID);
            tmp.Add("Created", DateTime.UtcNow);

            PlayerEx social1 = pb.Social;
            IList enemy1 = social1.Value.GetValue<IList>("Friends");

            if (enemy1 != null)
            {
                enemy1.Add(tmp);
                n = enemy1.Count;
            }
            else
            {
                social1.Value["Friends"] = new List<Variant>() { tmp };
                n = 1;
            }
            social.Save();
            social1.Save();
            //"【" + note.Player.Name + "】与你成为好友,愿你们友谊在石器宝贝中长存"
            pb.Call(SocialCommand.FriendsBackR, true, string.Format(TipManager.GetMessage(SocialReturn.FriendsBack2), note.Player.Name), string.Empty);
            //"【" + user.Name + "】与你成为好友,愿你们友谊在石器宝贝中长存"
            note.Call(SocialCommand.FriendsBackR, true, string.Format(TipManager.GetMessage(SocialReturn.FriendsBack3), pb.Name), string.Empty);

            note.Player.FinishNote(FinishCommand.Friends, m);
            pb.FinishNote(FinishCommand.Friends, n);
        }
开发者ID:abel,项目名称:sinan,代码行数:65,代码来源:FriendsBusiness.cs

示例4: MasterApply

        /// <summary>
        /// 拜师或收徒
        /// </summary>
        /// <param name="note"></param>
        public static void MasterApply(UserNote note)
        {
            //true拜师,false表示收徒
            bool IsMaster = note.GetBoolean(0);
            string name = note.GetString(1);

            if (note.Player.Name == name)
            {
                note.Call(SocialCommand.MasterApplyR, false, IsMaster, TipManager.GetMessage(SocialReturn.NoSelf));
                return;
            }

            PlayerBusiness masterBase = PlayersProxy.FindPlayerByName(name);
            if (masterBase == null)
            {
                note.Call(SocialCommand.MasterApplyR, false, IsMaster, TipManager.GetMessage(SocialReturn.UserInfoError));
                return;
            }

            if (!masterBase.Online)
            {
                //判断被申请者是否在线,如果不在线不能成功
                note.Call(SocialCommand.MasterApplyR, false, IsMaster, TipManager.GetMessage(SocialReturn.NoOnLine));
                return;
            }

            if (MasterList.ContainsKey(note.PlayerID))
            {
                List<Variant> list = MasterList[note.PlayerID];
                int Number = 0;
                for (int i = 0; i < list.Count; i++)
                {
                    Variant k = list[i];
                    DateTime EndDate;
                    if (!DateTime.TryParse(k.GetStringOrDefault("EndDate"), out EndDate))
                        continue;
                    if (EndDate < DateTime.UtcNow)
                    {
                        //过期
                        list.Remove(k);
                    }
                    else if (k.GetBooleanOrDefault("IsMaster") == IsMaster)
                    {
                        if (k.GetStringOrDefault("PlayerID") == masterBase.ID)
                        {
                            note.Call(SocialCommand.MasterApplyR, false, IsMaster, TipManager.GetMessage(IsMaster ? SocialReturn.IsMaster : SocialReturn.IsApprentice));
                            return;
                        }
                        Number += 1;
                    }
                }
                if (Number >= 10)
                {
                    note.Call(SocialCommand.MasterApplyR, false, IsMaster, TipManager.GetMessage(SocialReturn.AppNumber));
                    return;
                }
            }

            //师傅信息
            PlayerEx MasterSocial = IsMaster ? masterBase.Social : note.Player.Social;
            //徒弟信息
            PlayerEx AppSocial = IsMaster ? note.Player.Social : masterBase.Social;

            if (MasterSocial == null || AppSocial == null)
            {
                note.Call(SocialCommand.MasterApplyR, false, IsMaster, TipManager.GetMessage(SocialReturn.UserInfoError));
                return;
            }

            int MasterLevel = 0;//师傅等级
            int AppLevel = 0;//徒弟等级
            if (IsMaster)
            {
                MasterLevel = masterBase.Level;
                AppLevel = note.Player.Level;
            }
            else
            {
                MasterLevel = note.Player.Level;
                AppLevel = masterBase.Level;
            }

            if (AppLevel > 39)
            {
                //徒弟必须小于或等于39级
                note.Call(SocialCommand.MasterApplyR, false, IsMaster, TipManager.GetMessage(SocialReturn.MasterNoLevel));
                return;
            }

            if (MasterLevel < 40)
            {
                //师傅发须大于39级
                note.Call(SocialCommand.MasterApplyR, false, IsMaster, TipManager.GetMessage(SocialReturn.MasterLevelGap));
                return;
            }

//.........这里部分代码省略.........
开发者ID:abel,项目名称:sinan,代码行数:101,代码来源:MasterBusiness.cs

示例5: MasterBack

        /// <summary>
        /// 拜师或收徒回复
        /// </summary>
        /// <param name="note"></param>
        public static void MasterBack(UserNote note)
        {
            //true表示拜师,false表示收徒
            bool IsMaster = note.GetBoolean(0);
            string[] strs = note.GetString(1).Split(',');
            string plasyerid = strs[0];

            PlayerBusiness OnLineBusiness = PlayersProxy.FindPlayerByID(plasyerid);
            if (OnLineBusiness == null || (!OnLineBusiness.Online))
            {
                //判断被申请者是否在线,如果不在线不能成功
                note.Call(SocialCommand.MasterBackR, false, IsMaster, TipManager.GetMessage(SocialReturn.NoOnLine));
                return;
            }

            //师傅信息
            PlayerEx MasterSocial = IsMaster ? note.Player.Social : OnLineBusiness.Social;
            //徒弟信息
            PlayerEx AppSocial = IsMaster ? OnLineBusiness.Social : note.Player.Social;

            if (MasterSocial == null || AppSocial == null)
            {
                note.Call(SocialCommand.MasterBackR, false, IsMaster, TipManager.GetMessage(SocialReturn.UserInfoError));
                return;
            }

            int MasterLevel = 0;//师傅等级
            int AppLevel = 0;//徒弟等级
            if (IsMaster)
            {
                MasterLevel = note.Player.Level;
                AppLevel = OnLineBusiness.Level;
            }
            else
            {
                MasterLevel = OnLineBusiness.Level;
                AppLevel = note.Player.Level;
            }

            if (AppLevel > 39)
            {
                note.Call(SocialCommand.MasterBackR, false, IsMaster, TipManager.GetMessage(SocialReturn.MasterNoLevel));
                return;
            }

            if (MasterLevel < 40)
            {
                note.Call(SocialCommand.MasterBackR, false, IsMaster, TipManager.GetMessage(SocialReturn.MasterLevelGap));
                return;
            }

            Variant MasterMentor = MasterSocial.Value.GetValueOrDefault<Variant>("Mentor"); ;
            Variant AppMentor = AppSocial.Value.GetValueOrDefault<Variant>("Mentor");
            if (FreezeDate(MasterMentor))
            {
                //师傅正处在冷冻期
                note.Call(SocialCommand.MasterBackR, false, IsMaster, TipManager.GetMessage(SocialReturn.MasterApply3));
                return;
            }
            if (FreezeDate(AppMentor))
            {
                //徒弟正处在冷冻期
                note.Call(SocialCommand.MasterBackR, false, IsMaster, TipManager.GetMessage(SocialReturn.MasterApply4));
                return;
            }

            //判断师傅中是否已经是仇人,师傅和徒弟
            if (SocialBusiness.IsLet(MasterSocial, AppSocial.PlayerID, new List<string> { "Enemy" }))
            {
                note.Call(SocialCommand.MasterBackR, false, IsMaster, TipManager.GetMessage(SocialReturn.Enemy));
                return;
            }
            if (SocialBusiness.IsLet(MasterSocial, AppSocial.PlayerID, new List<string> { "Master" }))
            {
                note.Call(SocialCommand.MasterBackR, false, IsMaster, TipManager.GetMessage(SocialReturn.Master));
                return;
            }
            if (SocialBusiness.IsLet(MasterSocial, AppSocial.PlayerID, new List<string> { "Apprentice" }))
            {
                note.Call(SocialCommand.MasterBackR, false, IsMaster, TipManager.GetMessage(SocialReturn.Apprentice));
                return;
            }

            if (SocialBusiness.IsLet(AppSocial, MasterSocial.PlayerID, new List<string> { "Enemy" }))
            {
                note.Call(SocialCommand.MasterBackR, false, IsMaster, TipManager.GetMessage(SocialReturn.Enemy));
                return;
            }
            if (SocialBusiness.IsLet(AppSocial, MasterSocial.PlayerID, new List<string> { "Master" }))
            {
                note.Call(SocialCommand.MasterBackR, false, IsMaster, TipManager.GetMessage(SocialReturn.Master));
                return;
            }
            if (SocialBusiness.IsLet(AppSocial, MasterSocial.PlayerID, new List<string> { "Apprentice" }))
            {
                note.Call(SocialCommand.MasterBackR, false, IsMaster, TipManager.GetMessage(SocialReturn.Apprentice));
//.........这里部分代码省略.........
开发者ID:abel,项目名称:sinan,代码行数:101,代码来源:MasterBusiness.cs

示例6: AuctionBuyList

        /// <summary>
        /// 购买列表
        /// </summary>
        /// <param name="note"></param>
        public static void AuctionBuyList(UserNote note)
        {
            string soleid = note.PlayerID + string.Empty + note.Name;
            if (!m_dic.TryAdd(soleid, soleid))
                return;
            try
            {
                int pageSize = note.GetInt32(0);
                int pageIndex = note.GetInt32(1);
                string goodsType = note.GetString(2);
                bool isName = note.GetBoolean(3);

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

                int total = 0;
                int currIndex = 0;
                List<Auction> list = AuctionAccess.Instance.AuctionBuyList(note.PlayerID, goodsType, isName, pageSize, pageIndex, out total, out currIndex);
                List<Variant> msg = new List<Variant>();
                if (list != null)
                {
                    foreach (Auction a in list)
                    {
                        Variant v = new Variant();
                        v.Add("ID", a.ID);
                        v.Add("Name", a.Name);
                        foreach (var k in a.Value)
                        {
                            v.Add(k.Key, k.Value);
                        }
                        msg.Add(v);
                    }
                }
                note.Call(AuctionCommand.AuctionBuyListR, total, currIndex, msg);
            }
            finally
            {
                m_dic.TryRemove(soleid, out soleid);
            }
        }
开发者ID:abel,项目名称:sinan,代码行数:45,代码来源:AuctionBusiness.cs

示例7: MountsSkillChange

        /// <summary>
        /// 坐骑技能更换
        /// </summary>
        /// <param name="note"></param>
        public static void MountsSkillChange(UserNote note)
        {
            string oldid = note.GetString(0);
            string newid = note.GetString(1);
            bool ischange = note.GetBoolean(2);
            Mounts m = note.Player.Mounts;
            if (m == null)
            {
                //没有坐骑
                note.Call(MountsCommand.MountsSkillChangeR, false, TipManager.GetMessage(MountsReturn.Mounts2));
                return;
            }
            Variant mv = m.Value;
            if (mv == null)
            {
                //被更换的技能不存在
                note.Call(MountsCommand.MountsSkillChangeR, false, TipManager.GetMessage(MountsReturn.Mounts3));
                return;
            }
            Variant skill = mv.GetVariantOrDefault("Skill");
            if (skill == null)
            {
                note.Call(MountsCommand.MountsSkillChangeR, false, TipManager.GetMessage(MountsReturn.Mounts3));
                return;
            }
            Variant o = skill.GetVariantOrDefault(oldid);
            if (o == null)
            {
                //被更换的技能不存在
                note.Call(MountsCommand.MountsSkillChangeR, false, TipManager.GetMessage(MountsReturn.Mounts3));
                return;
            }

            if (skill.ContainsKey(newid))
            {
                //你想更换的技能已经存在
                note.Call(MountsCommand.MountsSkillChangeR, false, TipManager.GetMessage(MountsReturn.Mounts4));
                return;
            }

            GameConfig gc = GameConfigAccess.Instance.FindOneById(m.MountsID);
            if (gc == null)
            {
                //坐骑配置问题
                note.Call(MountsCommand.MountsSkillChangeR, false, TipManager.GetMessage(MountsReturn.Mounts5));
                return;
            }
            Variant v = gc.Value;
            if (v == null)
            {
                //坐骑配置问题
                note.Call(MountsCommand.MountsSkillChangeR, false, TipManager.GetMessage(MountsReturn.Mounts5));
                return;
            }

            Variant skills = v.GetVariantOrDefault("Skills");
            if (skills == null)
            {
                //技能不存在
                note.Call(MountsCommand.MountsSkillChangeR, false, TipManager.GetMessage(MountsReturn.Mounts6));
                return;
            }

            int level = 0;//新技能等级
            if (!skills.TryGetValueT(newid, out level))
            {
                //技能不存在
                note.Call(MountsCommand.MountsSkillChangeR, false, TipManager.GetMessage(MountsReturn.Mounts6));
                return;
            }

            //选择的新技能类型
            GameConfig gck = GameConfigAccess.Instance.FindOneById(newid);
            if (gck == null)
            {
                //技能配置有问题
                note.Call(MountsCommand.MountsSkillChangeR, false, TipManager.GetMessage(MountsReturn.Mounts7));
                return;
            }

            if (!gck.Value.ContainsKey(level.ToString()))
            {
                //坐骑技能等级配置有问题
                note.Call(MountsCommand.MountsSkillChangeR, false, TipManager.GetMessage(MountsReturn.Mounts8));
                return;
            }

            if (gck.SubType != "MountAddition")
            {
                //坐骑类型不正确
                note.Call(MountsCommand.MountsSkillChangeR, false, TipManager.GetMessage(MountsReturn.Mounts9));
                return;
            }

            int score = v.GetIntOrDefault("ChangeScore");
            if (score < 0)
//.........这里部分代码省略.........
开发者ID:abel,项目名称:sinan,代码行数:101,代码来源:MountsBussiness.cs

示例8: ReplyInvite

 /// <summary>
 /// 玩家回复是否同意
 /// </summary>
 /// <param name="note"></param>
 private void ReplyInvite(UserNote note)
 {
     string teamID = note.GetString(0);
     bool a = note.GetBoolean(1);
     if (!a) return;
     PlayerTeam team;
     if (m_teams.TryGetValue(teamID, out team))
     {
         if (!team.Available)
         {
             //队伍已满
             note.Call(TeamCommand.IntoTeamR, false, TipManager.GetMessage(ClientReturn.TeamsMediator2));
             return;
         }
         PlayerBusiness member = note.Player;
         if (team.TryAddMember(member))
         {
             var members = team.AllPlayerDetail;
             note.Call(TeamCommand.IntoTeamR, true, new object[] { team, members });
             member.CallAllExcludeOne(member, TeamCommand.NewMemberR, teamID, new PlayerDetail(member));
         }
     }
 }
开发者ID:abel,项目名称:sinan,代码行数:27,代码来源:TeamsMediator.cs

示例9: FightReplyCC

 /// <summary>
 /// 回复切磋
 /// </summary>
 /// <param name="note"></param>
 protected void FightReplyCC(UserNote note)
 {
     PlayerBusiness player = note.Player;
     if (player.AState == ActionState.Fight || player.TeamJob == TeamJob.Member)
     {
         return;
     }
     string pkID = note.GetString(1);
     PlayerBusiness b;
     if (m_players.TryGetValue(pkID, out b))
     {
         bool a = note.GetBoolean(0);
         if (!a)
         {
             //不同意切磋
             b.Call(FightCommand.FightReplyCCR, false, note.PlayerID);
             return;
         }
         player.FightTime = DateTime.UtcNow;
         UserNote note2 = new UserNote(note, FightCommand.IntoBattlePK, new object[] { FightType.CC, b });
         Notifier.Instance.Publish(note2);
     }
 }
开发者ID:abel,项目名称:sinan,代码行数:27,代码来源:SceneBusiness_Fight.cs

示例10: AutoFight

        private void AutoFight(UserNote note)
        {
            PlayerBusiness player = note.Player;
            bool auto = note.GetBoolean(0);
            int count = 0;
            if (auto)
            {
                count = player.StartAutoFight();
            }
            else
            {
                player.EndAutoFight();
            }

            FightObject[] team;
            FightObject f = m_teamA.FirstOrDefault(x => x.ID == player.ID);
            if (f != null)
            {
                team = m_teamA;
            }
            else
            {
                f = m_teamB.FirstOrDefault(x => x.ID == player.ID);
                team = m_teamB;
            }

            if (f != null)
            {
                var buffer = AmfCodec.Encode(FightCommand.AutoFightR, new object[] { player.ID, count });
                foreach (var p in team)
                {
                    if (p.FType == FighterType.Player)
                    {
                        p.Player.Call(buffer);
                    }
                }
            }
        }
开发者ID:abel,项目名称:sinan,代码行数:38,代码来源:FightBase.cs


注:本文中的Sinan.FrontServer.UserNote.GetBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。