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


C# Bussiness.PlayerBussiness类代码示例

本文整理汇总了C#中Bussiness.PlayerBussiness的典型用法代码示例。如果您正苦于以下问题:C# PlayerBussiness类的具体用法?C# PlayerBussiness怎么用?C# PlayerBussiness使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PlayerBussiness类属于Bussiness命名空间,在下文中一共展示了PlayerBussiness类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Build

        public static string Build()
        {
            bool value = false;
            string message = "Fail!";
            XElement result = new XElement("Result");

            try
            {
                using (PlayerBussiness db = new PlayerBussiness())
                {
                    BestEquipInfo[] infos = db.GetCelebByDayBestEquip();
                    foreach (BestEquipInfo info in infos)
                    {
                        result.Add(FlashUtils.CreateBestEquipInfo(info));
                    }

                    value = true;
                    message = "Success!";
                }
            }
            catch (Exception ex)
            {
                log.Error("Load CelebByDayBestEquip is fail!", ex);
            }

            result.Add(new XAttribute("value", value));
            result.Add(new XAttribute("message", message));

            return csFunction.CreateCompressXml(result, "CelebForBestEquip", false);
        }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:30,代码来源:CelebByDayBestEquip.ashx.cs

示例2: HandlePacket

        //修改:  Xiaov
        //时间:  2009-11-7
        //描述:  获取用户装备<已测试>
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            bool type = packet.ReadBoolean();//_loc_3.writeBoolean(true);
            int id = packet.ReadInt();
            string nickname;
            if (!type)
                nickname = packet.ReadString();
            GamePlayer player = Managers.WorldMgr.GetPlayerById(id);
            PlayerInfo info;
            List<ItemInfo> items;
            if (player != null)
            {
                info = player.PlayerCharacter;
                items = player.MainBag.GetItems(0, 31);
            }
            else
            {
                using (PlayerBussiness pb = new PlayerBussiness())
                {
                    info = pb.GetUserSingleByUserID(id);
                    items = pb.GetUserEuqip(id);
                }
            }

            if (info != null && items != null)
                client.Out.SendUserEquip(info, items);
            return 0;
        }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:31,代码来源:UserEquipListHandler.cs

示例3: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            int result = 1;
            try
            {
                string username = HttpUtility.UrlDecode(Request["username"]);
                string site = Request["site"] == null ? "" : HttpUtility.UrlDecode(Request["site"]);

                if (!string.IsNullOrEmpty(username))
                {
                    username = BaseInterface.GetNameBySite(username, site);
                    using (PlayerBussiness db = new PlayerBussiness())
                    {
                        PlayerInfo info = db.GetUserSingleByUserName(username);
                        if (info != null)
                        {
                            result = 0;
                        }
                        else
                        {
                            result = 2;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                log.Error("UserNameCheck:", ex);
            }
            Response.Write(result);
        }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:31,代码来源:UserNameCheck.aspx.cs

示例4: HandlePacket

        public int HandlePacket(ClientBase client, GamePacket packet)
        {
            int clientID = packet.ReadInt();
            string account = packet.ReadUTF();
            string nickName = packet.ReadUTF();

            int playerID = 0;

            using (PlayerBussiness pb = new PlayerBussiness())
            {
                playerID = pb.Registe(account, nickName);
            }

            if (playerID != 0)
            {
                ValidateLoginHandler.SendLoginPacket(client, clientID, account, playerID);
            }
            else
            {
                //TODO: 发送创建角色失败给客户端

                RegisteResultPacket pkg = new RegisteResultPacket();

                pkg.ClientID = clientID;

                client.SendTcp(pkg);
            }

            return 0;
        }
开发者ID:W8023Y2014,项目名称:jsion,代码行数:30,代码来源:RegistePlayerHandler.cs

示例5: OnTick

        public override void OnTick(MarryRoom room)
        {
            try 
            {
                if(room != null)
                {
                    room.KickAllPlayer();

                    using(PlayerBussiness db = new PlayerBussiness())
                    {
                        db.DisposeMarryRoomInfo(room.Info.ID);
                    }

                    GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(room.Info.GroomID);
                    GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(room.Info.BrideID);

                    GameServer.Instance.LoginServer.SendMarryRoomInfoToPlayer(room.Info.GroomID, false, room.Info);
                    GameServer.Instance.LoginServer.SendMarryRoomInfoToPlayer(room.Info.BrideID, false, room.Info);

                    MarryRoomMgr.RemoveMarryRoom(room);

                    GSPacketIn pkg = new GSPacketIn((short)ePackageType.MARRY_ROOM_DISPOSE);
                    pkg.WriteInt(room.Info.ID);
                    WorldMgr.MarryScene.SendToALL(pkg);

                    room.StopTimer();
                }
            }
            catch(Exception ex)
            {
                if (log.IsErrorEnabled)
                    log.Error("OnTick",ex);
            }
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:34,代码来源:TankMarryLogicProcessor.cs

示例6: ProcessRequest

 public void ProcessRequest(HttpContext context)
 {
     XElement result = new XElement("Result");
     bool registerResult=false;
     try
     {
         string username = HttpUtility.UrlDecode(context.Request["username"]);
         string password = HttpUtility.UrlDecode(context.Request["password"]);
         string nickName = HttpUtility.UrlDecode(context.Request["password"]);
         bool sex=false;
         int money=100;
         int giftoken=100;
         int gold = 100;
         using (PlayerBussiness db = new PlayerBussiness())
         {
             registerResult=db.RegisterUser(username,password,nickName,sex,money,giftoken,gold);;
         }
     }
     catch (Exception ex)
     {
         log.Error("RegisterResult", ex);
     }
     finally
     {
         result.Add(new XAttribute("value", "vl"));
         result.Add(new XAttribute("message", registerResult));
         context.Response.ContentType = "text/plain";
         context.Response.Write(result.ToString(false));
     }
 }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:30,代码来源:AccountRegister.ashx.cs

示例7: LoadFromDatabase

        /// <summary>
        /// 从数据库中加载
        /// </summary>
        /// <param name="playerId"></param>
        public void LoadFromDatabase(int playerId)
        {
            lock (m_lock)
            {
                using (PlayerBussiness db = new PlayerBussiness())
                {
                    BufferInfo[] infos = db.GetUserBuffer(playerId);
                    BeginChanges();

                    foreach (BufferInfo info in infos)
                    {
                        AbstractBuffer buffer = CreateBuffer(info);
                        if (buffer != null)
                        {
                            buffer.Start(m_player);
                        }
                    }

                    CommitChanges();
                }

                //更新状态
                Update();
            }
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:29,代码来源:BufferList.cs

示例8: SaveToDatabase

        /// <summary>
        /// 保存到数据库中
        /// </summary>
        public void SaveToDatabase()
        {
            using (PlayerBussiness pb = new PlayerBussiness())
            {
                lock (_lock)
                {
                    for (int i = 0; i < _items.Length; i++)
                    {
                        ItemInfo item = _items[i];
                        if (item != null)
                        {
                            if (item.IsDirty)
                            {
                                if (item.ItemID > 0)
                                {
                                    pb.UpdateGoods(item);
                                }
                                else
                                {
                                    pb.AddGoods(item);
                                }
                            }
                        }
                    }

                    foreach (ItemInfo item in _removedList)
                    {
                        pb.UpdateGoods(item);
                    }
                    _removedList.Clear();
                }
            }        
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:36,代码来源:CommonPage.cs

示例9: HandlePacket

        //修改:  Xiaov
        //时间:  2009-11-4
        //描述:  修改邮件的已读未读标志<已测试>
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            GSPacketIn pkg = packet.Clone();
            pkg.ClearContext();

            int id = packet.ReadInt();
            using (PlayerBussiness db = new PlayerBussiness())
            {
                MailInfo mes = db.GetMailSingle(client.Player.PlayerCharacter.ID, id);
                if (mes != null && !mes.IsRead)
                {
                    mes.IsRead = true;
                    if (mes.Type < 100)
                    {
                        mes.ValidDate = 3 * 24;
                        mes.SendTime = DateTime.Now;
                    }
                    db.UpdateMail(mes, mes.Money);
                    pkg.WriteBoolean(true);
                }
                else
                {
                    pkg.WriteBoolean(false);
                }
            }

            client.Out.SendTCP(pkg);

            return 0;
        }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:33,代码来源:UserUpdateMailHandler.cs

示例10: HandlePacket

        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            if (client.Player.CurrentMarryRoom != null && client.Player.PlayerCharacter.ID == client.Player.CurrentMarryRoom.Info.PlayerID)
            {
                string roomName = packet.ReadString();

                bool isPwdChanged = packet.ReadBoolean();

                string pwd = packet.ReadString();
                
                string introduction = packet.ReadString();

                MarryRoom room = client.Player.CurrentMarryRoom;

                room.Info.RoomIntroduction = introduction;
                room.Info.Name = roomName;
                if (isPwdChanged)
                {
                    room.Info.Pwd = pwd;
                }
                

                using (PlayerBussiness db = new PlayerBussiness())
                {
                    db.UpdateMarryRoomInfo(room.Info);
                }

                room.SendMarryRoomInfoUpdateToScenePlayers(room);

                client.Player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("MarryRoomInfoUpdateHandler.Successed"));
                return 0;
            }

            return 1;
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:35,代码来源:MarryRoomInfoUpdateHandler.cs

示例11: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            bool value = false;
            string message = "Fail!";
            XElement result = new XElement("Result");

            try
            {
                int id = Convert.ToInt32(context.Request["userid"]);
                int selfid = Convert.ToInt32(context.Request["selfid"]);
                string key = context.Request["key"];
                using (PlayerBussiness db = new PlayerBussiness())
                {

                }

                value = true;
                message = "Success!";
            }
            catch (Exception ex)
            {
                log.Error("IMListLoad", ex);
            }

            result.Add(new XAttribute("value", value));
            result.Add(new XAttribute("message", message));

            context.Response.ContentType = "text/plain";
            context.Response.Write(string.Format("0,{0},0",DateTime.Now));
            //context.Response.BinaryWrite(StaticFunction.Compress(result.ToString(false)));
        }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:31,代码来源:AdvanceQuestTime.ashx.cs

示例12: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            bool value = false;
            string message = "Fail!";
            XElement result = new XElement("Result");

            try
            {
                int userID = int.Parse(context.Request["ID"]);
                using (PlayerBussiness db = new PlayerBussiness())
                {
                    QuestDataInfo[] quests = db.GetUserQuest(userID);
                    foreach (QuestDataInfo quest in quests)
                    {
                        result.Add(FlashUtils.CreateQuestDataInfo(quest));
                    }

                    value = true;
                    message = "Success!";
                }
            }
            catch (Exception ex)
            {
                log.Error("UserQuestList", ex);
            }

            result.Add(new XAttribute("vaule", value));
            result.Add(new XAttribute("message", message));

            context.Response.ContentType = "text/plain";
            context.Response.Write(result.ToString(false));
            //context.Response.BinaryWrite(StaticFunction.Compress(result.ToString(false)));
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:33,代码来源:UserQuestList.ashx.cs

示例13: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            bool value = false;
            string message = "Fail!";

            XElement result = new XElement("Result");
            try
            {
                int userid = int.Parse(context.Request.Params["ID"]);
                
                using (PlayerBussiness db = new PlayerBussiness())
                {
                    ItemInfo[] items = db.GetUserItem(userid);

                    foreach (ItemInfo item in items)
                    {
                        result.Add(Road.Flash.FlashUtils.CreateGoodsInfo(item));
                    }

                }
                value = true;
                message = "Success!";
            }
            catch (Exception ex)
            {
                log.Error("LoadUserItems", ex);
            }

            result.Add(new XAttribute("value", value));
            result.Add(new XAttribute("message", message));

            context.Response.ContentType = "text/plain";
            context.Response.Write(result.ToString(false));
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:34,代码来源:LoadUserItems.ashx.cs

示例14: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            bool value = false;
            string message = "Fail!";
            XElement result = new XElement("Result");
            try
            {
                //int id = int.Parse(context.Request["id"]);
                using (PlayerBussiness db = new PlayerBussiness())
                {

                }

                value = true;
                message = "Success!";
            }
            catch (Exception ex)
            {
                log.Error("ActivePullDown", ex);
            }
            result.Add(new XAttribute("value", value));
            result.Add(new XAttribute("message", message));
            context.Response.ContentType = "text/plain";
            context.Response.Write(result.ToString(false));
        }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:25,代码来源:ActivePullDown.ashx.cs

示例15: HandlePacket

        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            GSPacketIn pkg = packet.Clone();
            //pkg.ClearContext();
            if (client.Player.PlayerCharacter.HasBagPassword && client.Player.PlayerCharacter.IsLocked)
            {

                client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("Bag.Locked"));

                return 0;
            }
            int id = packet.ReadInt();
            int senderID;
            using (PlayerBussiness db = new PlayerBussiness())
            {
                if (db.DeleteMail(client.Player.PlayerCharacter.ID, id, out senderID))
                {
                    client.Out.SendMailResponse(senderID,eMailRespose.Receiver);
                    pkg.WriteBoolean(true);
                }
                else
                {
                    pkg.WriteBoolean(false);
                }
            }

            client.Out.SendTCP(pkg);

            return 0;
        }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:30,代码来源:UserDeleteMailHandler.cs


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