コード例 #1
0
        public override int HandlePacket(GamePlayer player, GSPacketIn packet)
        {
            int result;

            if (player.PlayerCharacter.MarryInfoID == 0)
            {
                result = 1;
            }
            else
            {
                int id = packet.ReadInt();
                using (PlayerBussiness db = new PlayerBussiness())
                {
                    MarryInfo info = db.GetMarryInfoSingle(id);
                    if (info != null)
                    {
                        player.Out.SendMarryInfo(player, info);
                        result = 0;
                        return(result);
                    }
                }
                result = 1;
            }
            return(result);
        }
コード例 #2
0
ファイル: FlashUtils.cs プロジェクト: SkelletonX/DDTServer
 public static XElement CreateMarryInfo(MarryInfo info)
 {
     return(new XElement("Info", new object[]
     {
         new XAttribute("ID", info.ID),
         new XAttribute("UserID", info.UserID),
         new XAttribute("IsPublishEquip", info.IsPublishEquip),
         new XAttribute("Introduction", info.Introduction),
         new XAttribute("NickName", info.NickName),
         new XAttribute("IsConsortia", info.IsConsortia),
         new XAttribute("ConsortiaID", info.ConsortiaID),
         new XAttribute("Sex", info.Sex),
         new XAttribute("Win", info.Win),
         new XAttribute("Total", info.Total),
         new XAttribute("Escape", info.Escape),
         new XAttribute("GP", info.GP),
         new XAttribute("Honor", info.Honor),
         new XAttribute("Style", info.Style),
         new XAttribute("Colors", info.Colors),
         new XAttribute("Hide", info.Hide),
         new XAttribute("Grade", info.Grade),
         new XAttribute("State", info.State),
         new XAttribute("Repute", info.Repute),
         new XAttribute("Skin", info.Skin),
         new XAttribute("Offer", info.Offer),
         new XAttribute("IsMarried", info.IsMarried),
         new XAttribute("ConsortiaName", info.ConsortiaName),
         new XAttribute("DutyName", info.DutyName),
         new XAttribute("Nimbus", info.Nimbus),
         new XAttribute("FightPower", info.FightPower)
     }));
 }
コード例 #3
0
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            if (client.Player.PlayerCharacter.MarryInfoID == 0)
            {
                return(1);
            }
            bool   isPublishEquip = packet.ReadBoolean();
            string introduction   = packet.ReadString();
            int    marryInfoID    = client.Player.PlayerCharacter.MarryInfoID;
            string translateId    = "MarryInfoUpdateHandler.Fail";

            using (PlayerBussiness playerBussiness = new PlayerBussiness())
            {
                MarryInfo marryInfoSingle = playerBussiness.GetMarryInfoSingle(marryInfoID);
                if (marryInfoSingle == null)
                {
                    translateId = "MarryInfoUpdateHandler.Msg1";
                }
                else
                {
                    marryInfoSingle.IsPublishEquip = isPublishEquip;
                    marryInfoSingle.Introduction   = introduction;
                    marryInfoSingle.RegistTime     = DateTime.Now;
                    if (playerBussiness.UpdateMarryInfo(marryInfoSingle))
                    {
                        translateId = "MarryInfoUpdateHandler.Succeed";
                    }
                }
                client.Out.SendMarryInfoRefresh(marryInfoSingle, marryInfoID, marryInfoSingle != null);
                client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation(translateId, new object[0]));
            }
            return(0);
        }
コード例 #4
0
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            if (client.Player.PlayerCharacter.MarryInfoID != 0)
            {
                return(1);
            }

            bool         IsPublishEquip = packet.ReadBoolean();
            string       Introduction   = packet.ReadString();
            int          UserID         = client.Player.PlayerCharacter.ID;
            eMessageType eMsg           = eMessageType.Normal;
            string       msg            = "MarryInfoAddHandler.Fail";

            int needGold = 10000;

            if (needGold > client.Player.PlayerCharacter.Gold)
            {
                eMsg = eMessageType.ERROR;
                msg  = "MarryInfoAddHandler.Msg1";
            }
            else
            {
                client.Player.SaveIntoDatabase();
                MarryInfo info = new MarryInfo();
                info.UserID         = UserID;
                info.IsPublishEquip = IsPublishEquip;
                info.Introduction   = Introduction;
                info.RegistTime     = DateTime.Now;

                using (PlayerBussiness db = new PlayerBussiness())
                {
                    if (db.AddMarryInfo(info))
                    {
                        client.Player.RemoveGold(needGold);
                        msg = "MarryInfoAddHandler.Msg2";
                        client.Player.PlayerCharacter.MarryInfoID = info.ID;
                        client.Out.SendMarryInfoRefresh(info, info.ID, true);
                    }
                }
            }


            client.Out.SendMessage(eMsg, LanguageMgr.GetTranslation(msg));

            return(0);
        }
コード例 #5
0
        public override int HandlePacket(GamePlayer player, GSPacketIn packet)
        {
            int result;

            if (player.PlayerCharacter.MarryInfoID != 0)
            {
                result = 1;
            }
            else
            {
                bool         IsPublishEquip = packet.ReadBoolean();
                string       Introduction   = packet.ReadString();
                int          UserID         = player.PlayerCharacter.ID;
                eMessageType eMsg           = eMessageType.Normal;
                string       msg            = "MarryInfoAddHandler.Fail";
                int          needGold       = 10000;
                if (needGold > player.PlayerCharacter.Gold)
                {
                    eMsg = eMessageType.ERROR;
                    msg  = "MarryInfoAddHandler.Msg1";
                }
                else
                {
                    player.SaveIntoDatabase();
                    MarryInfo info = new MarryInfo();
                    info.UserID         = UserID;
                    info.IsPublishEquip = IsPublishEquip;
                    info.Introduction   = Introduction;
                    info.RegistTime     = DateTime.Now;
                    using (PlayerBussiness db = new PlayerBussiness())
                    {
                        if (db.AddMarryInfo(info))
                        {
                            player.RemoveGold(needGold);
                            msg = "MarryInfoAddHandler.Msg2";
                            player.PlayerCharacter.MarryInfoID = info.ID;
                            player.Out.SendMarryInfoRefresh(info, info.ID, true);
                        }
                    }
                }
                player.Out.SendMessage(eMsg, LanguageMgr.GetTranslation(msg, new object[0]));
                result = 0;
            }
            return(result);
        }
コード例 #6
0
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            if (client.Player.PlayerCharacter.MarryInfoID == 0)
            {
                return(1);
            }
            int iD = packet.ReadInt();

            using (PlayerBussiness playerBussiness = new PlayerBussiness())
            {
                MarryInfo marryInfoSingle = playerBussiness.GetMarryInfoSingle(iD);
                if (marryInfoSingle != null)
                {
                    client.Player.Out.SendMarryInfo(client.Player, marryInfoSingle);
                    return(0);
                }
            }
            return(1);
        }
コード例 #7
0
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            if (client.Player.PlayerCharacter.MarryInfoID == 0)
            {
                return(1);
            }

            int id = packet.ReadInt();

            using (PlayerBussiness db = new PlayerBussiness())
            {
                MarryInfo info = db.GetMarryInfoSingle(id);
                if (info != null)
                {
                    client.Player.Out.SendMarryInfo(client.Player, info);
                    return(0);
                }
            }

            return(1);
        }
コード例 #8
0
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            if (client.Player.PlayerCharacter.MarryInfoID != 0)
            {
                return(1);
            }
            bool         isPublishEquip = packet.ReadBoolean();
            string       introduction   = packet.ReadString();
            int          iD             = client.Player.PlayerCharacter.ID;
            eMessageType type           = eMessageType.Normal;
            string       translateId    = "MarryInfoAddHandler.Fail";
            int          num            = 10000;

            if (num > client.Player.PlayerCharacter.Gold)
            {
                type        = eMessageType.ERROR;
                translateId = "MarryInfoAddHandler.Msg1";
            }
            else
            {
                client.Player.SaveIntoDatabase();
                MarryInfo marryInfo = new MarryInfo();
                marryInfo.UserID         = iD;
                marryInfo.IsPublishEquip = isPublishEquip;
                marryInfo.Introduction   = introduction;
                marryInfo.RegistTime     = DateTime.Now;
                using (PlayerBussiness playerBussiness = new PlayerBussiness())
                {
                    if (playerBussiness.AddMarryInfo(marryInfo))
                    {
                        client.Player.RemoveGold(num);
                        translateId = "MarryInfoAddHandler.Msg2";
                        client.Player.PlayerCharacter.MarryInfoID = marryInfo.ID;
                        client.Out.SendMarryInfoRefresh(marryInfo, marryInfo.ID, true);
                    }
                }
            }
            client.Out.SendMessage(type, LanguageMgr.GetTranslation(translateId, new object[0]));
            return(0);
        }
コード例 #9
0
        public static void Process(IHttpRequest Request, IHttpResponse Response)
        {
            bool     value   = false;
            string   message = "Fail!";
            int      total   = 0;
            XElement result  = new XElement("Result");

            try
            {
                int    page = int.Parse(Request.Uri.QueryString["page"]);
                string name = null;
                if (Request.Uri.QueryString["name"] != null)
                {
                    name = csFunction.ConvertSql(HttpUtility.UrlDecode(Request.Uri.QueryString["name"]));
                }
                bool sex  = bool.Parse(Request.Uri.QueryString["sex"]);
                int  size = 12;
                using (PlayerBussiness db = new PlayerBussiness())
                {
                    MarryInfo[] infos = db.GetMarryInfoPages(page, name, sex, size, ref total);
                    MarryInfo[] array = infos;
                    for (int i = 0; i < array.Length; i++)
                    {
                        MarryInfo info = array[i];
                        XElement  temp = FlashUtils.CreateMarryInfo(info);
                        result.Add(temp);
                    }
                    value   = true;
                    message = "Success!";
                }
            }
            catch (Exception ex)
            {
                //MarryInfoPageList.log.Error("MarryInfoPageList", ex);
            }
            result.Add(new XAttribute("total", total));
            result.Add(new XAttribute("vaule", value));
            result.Add(new XAttribute("message", message));
            Response.Write(result.ToString(false));
        }
コード例 #10
0
        public override int HandlePacket(GamePlayer player, GSPacketIn packet)
        {
            int result;

            if (player.PlayerCharacter.MarryInfoID == 0)
            {
                result = 1;
            }
            else
            {
                bool   IsPublishEquip = packet.ReadBoolean();
                string Introduction   = packet.ReadString();
                int    id             = player.PlayerCharacter.MarryInfoID;
                string msg            = "MarryInfoUpdateHandler.Fail";
                using (PlayerBussiness db = new PlayerBussiness())
                {
                    MarryInfo info = db.GetMarryInfoSingle(id);
                    if (info == null)
                    {
                        msg = "MarryInfoUpdateHandler.Msg1";
                    }
                    else
                    {
                        info.IsPublishEquip = IsPublishEquip;
                        info.Introduction   = Introduction;
                        info.RegistTime     = DateTime.Now;
                        if (db.UpdateMarryInfo(info))
                        {
                            msg = "MarryInfoUpdateHandler.Succeed";
                        }
                    }
                    player.Out.SendMarryInfoRefresh(info, id, info != null);
                    player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation(msg, new object[0]));
                }
                result = 0;
            }
            return(result);
        }
コード例 #11
0
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            if (client.Player.PlayerCharacter.MarryInfoID == 0)
            {
                return(1);
            }

            //int id = packet.ReadInt();
            bool   IsPublishEquip = packet.ReadBoolean();
            string Introduction   = packet.ReadString();
            int    id             = client.Player.PlayerCharacter.MarryInfoID;
            string msg            = "MarryInfoUpdateHandler.Fail";

            using (PlayerBussiness db = new PlayerBussiness())
            {
                MarryInfo info = db.GetMarryInfoSingle(id);
                if (info == null)
                {
                    msg = "MarryInfoUpdateHandler.Msg1";
                }
                else
                {
                    info.IsPublishEquip = IsPublishEquip;
                    info.Introduction   = Introduction;
                    info.RegistTime     = DateTime.Now;

                    if (db.UpdateMarryInfo(info))
                    {
                        msg = "MarryInfoUpdateHandler.Succeed";
                    }
                }

                client.Out.SendMarryInfoRefresh(info, id, info != null);
                client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation(msg));
            }
            return(0);
        }
コード例 #12
0
 public GSPacketIn SendMarryInfo(GamePlayer player, MarryInfo info)
 {
     throw new NotImplementedException();
 }
コード例 #13
0
 public GSPacketIn SendMarryInfoRefresh(MarryInfo info, int ID, bool isExist)
 {
     throw new NotImplementedException();
 }