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


C# PlayerBussiness.UpdateMail方法代码示例

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


在下文中一共展示了PlayerBussiness.UpdateMail方法的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


//.........这里部分代码省略.........
                        {
                            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);
                        player.AddGiftToken(mes.GiftToken);
                        mes.GiftToken = 0;
                    }

                    if (mes.Type > 100 && mes.Money > 0)
                    {
                        mes.Money = 0;
                        msg = LanguageMgr.GetTranslation("MailGetAttachHandler.Deduct") + (string.IsNullOrEmpty(msg) ? LanguageMgr.GetTranslation("MailGetAttachHandler.Success") : msg);
                    }

                    if (db.UpdateMail(mes, oldMoney))
                    {
                        if (mes.Type > 100 && oldMoney > 0)
                        {
                            player.RemoveMoney(oldMoney);
                            LogMgr.LogMoneyAdd(LogMoneyType.Mail, LogMoneyType.Mail_Pay, client.Player.PlayerCharacter.ID, oldMoney, client.Player.PlayerCharacter.Money, 0, 0, 0,0, "", "", "");
                            client.Out.SendMailResponse(mes.SenderID, eMailRespose.Receiver);
                            client.Out.SendMailResponse(mes.ReceiverID, eMailRespose.Send);
                        }
                    }

                    //pkg.WriteBoolean(result);
                    pkg.WriteInt(id);
                    pkg.WriteInt(types.Count);
                    foreach (int i in types)
                    {
                        pkg.WriteInt(i);
                    }

                    client.Out.SendTCP(pkg);

                    client.Out.SendMessage(eMsg, string.IsNullOrEmpty(msg) ? LanguageMgr.GetTranslation("MailGetAttachHandler.Success") : msg);
                }
                else
                {
                    client.Out.SendMessage(eMessageType.ERROR, LanguageMgr.GetTranslation("MailGetAttachHandler.Falied"));
                }
            }

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


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