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


C# PlayerBussiness.GetMailSingle方法代码示例

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


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

示例1: 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

示例2: HandlePacket

        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            int id = packet.ReadInt();
            byte type = packet.ReadByte();
            List<int> types = new List<int>();
            string msg = "";// LanguageMgr.GetTranslation("MailGetAttachHandler.Falied");
            eMessageType eMsg = eMessageType.Normal;
            if (client.Player.PlayerCharacter.HasBagPassword && client.Player.PlayerCharacter.IsLocked)
            {

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

            GSPacketIn pkg = packet.Clone();
            pkg.ClearContext();

            using (PlayerBussiness db = new PlayerBussiness())
            {
                MailInfo mes = db.GetMailSingle(client.Player.PlayerCharacter.ID, id);
                if (mes != null)
                {
                    bool result = true;
                    int oldMoney = mes.Money;
                    GamePlayer player = Managers.WorldMgr.GetPlayerById(mes.ReceiverID);

                    if (mes.Type > 100 && mes.Money > client.Player.PlayerCharacter.Money)
                    {
                        client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("MailGetAttachHandler.NoMoney"));
                        return 0;
                    }

                    if (!mes.IsRead)
                    {
                        mes.IsRead = true;
                        mes.ValidDate = 3 * 24;
                        mes.SendTime = DateTime.Now;
                    }
                    if (result && (type == 0 || type == 1) && !string.IsNullOrEmpty(mes.Annex1))
                    {
                        if (GetAnnex(mes.Annex1, client.Player, ref msg, ref result, ref eMsg))
                        {
                            types.Add(1);
                            mes.Annex1 = null;
                        }
                    }

                    if (result && (type == 0 || type == 2) && !string.IsNullOrEmpty(mes.Annex2))
                    {
                        if (GetAnnex(mes.Annex2, client.Player, ref msg, ref result, ref eMsg))
                        {
                            types.Add(2);
                            mes.Annex2 = null;
                        }
                    }

                    if (result && (type == 0 || type == 3) && !string.IsNullOrEmpty(mes.Annex3))
                    {
                        if (GetAnnex(mes.Annex3, client.Player, ref msg, ref result, ref eMsg))
                        {
                            types.Add(3);
                            mes.Annex3 = null;
                        }
                    }

                    if (result && (type == 0 || type == 4) && !string.IsNullOrEmpty(mes.Annex4))
                    {
                        if (GetAnnex(mes.Annex4, client.Player, ref msg, ref result, ref eMsg))
                        {
                            types.Add(4);
                            mes.Annex4 = null;
                        }
                    }

                    if (result && (type == 0 || type == 5) && !string.IsNullOrEmpty(mes.Annex5))
                    {
                        if (GetAnnex(mes.Annex5, client.Player, ref msg, ref result, ref eMsg))
                        {
                            types.Add(5);
                            mes.Annex5 = null;
                        }
                    }

                    if ((type == 0 || type == 6) && mes.Gold > 0)
                    {
                        types.Add(6);
                        player.AddGold(mes.Gold);
                        mes.Gold = 0;
                    }

                    if ((type == 0 || type == 7) && mes.Type < 100 && mes.Money > 0)
                    {
                        types.Add(7);
                        player.AddMoney(mes.Money);
                        LogMgr.LogMoneyAdd(LogMoneyType.Mail, LogMoneyType.Mail_Money, player.PlayerCharacter.ID, mes.Money, player.PlayerCharacter.Money, 0, 0, 0,0, "", "", "");//添加日志
                        mes.Money = 0;
                    }
                    if (mes.Type > 100 && mes.GiftToken > 0)//trminhpc
                    {
                        types.Add(8);
//.........这里部分代码省略.........
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:101,代码来源:MailGetAttachHandler.cs


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