Пример #1
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            if (player.CurrentMarryRoom == null || player.CurrentMarryRoom.RoomState != eRoomState.FREE)
            {
                return(false);
            }
            if (!player.CurrentMarryRoom.Info.GuestInvite && player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.GroomID && player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.BrideID)
            {
                return(false);
            }
            GSPacketIn gSPacketIn = packet.Clone();

            gSPacketIn.ClearContext();
            int        playerId   = packet.ReadInt();
            GamePlayer playerById = WorldMgr.GetPlayerById(playerId);

            if (playerById != null && playerById.CurrentRoom == null && playerById.CurrentMarryRoom == null)
            {
                gSPacketIn.WriteByte(4);
                gSPacketIn.WriteInt(player.PlayerCharacter.ID);
                gSPacketIn.WriteString(player.PlayerCharacter.NickName);
                gSPacketIn.WriteInt(player.CurrentMarryRoom.Info.ID);
                gSPacketIn.WriteString(player.CurrentMarryRoom.Info.Name);
                gSPacketIn.WriteString(player.CurrentMarryRoom.Info.Pwd);
                gSPacketIn.WriteInt(player.MarryMap);
                playerById.Out.SendTCP(gSPacketIn);
                return(true);
            }
            return(false);
        }
Пример #2
0
 public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
 {
     if (player.CurrentMarryRoom != null)
     {
         packet.ReadInt();
         int templateId = packet.ReadInt();
         ItemTemplateInfo itemTemplateInfo = ItemMgr.FindItemTemplate(templateId);
         if (itemTemplateInfo != null && !player.CurrentMarryRoom.Info.IsGunsaluteUsed && (player.CurrentMarryRoom.Info.GroomID == player.PlayerCharacter.ID || player.CurrentMarryRoom.Info.BrideID == player.PlayerCharacter.ID))
         {
             player.CurrentMarryRoom.ReturnPacketForScene(player, packet);
             player.CurrentMarryRoom.Info.IsGunsaluteUsed = true;
             GSPacketIn packet2 = player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("GunsaluteCommand.Successed1", new object[]
             {
                 player.PlayerCharacter.NickName
             }));
             player.CurrentMarryRoom.SendToPlayerExceptSelfForScene(packet2, player);
             GameServer.Instance.LoginServer.SendMarryRoomInfoToPlayer(player.CurrentMarryRoom.Info.GroomID, true, player.CurrentMarryRoom.Info);
             GameServer.Instance.LoginServer.SendMarryRoomInfoToPlayer(player.CurrentMarryRoom.Info.BrideID, true, player.CurrentMarryRoom.Info);
             using (PlayerBussiness playerBussiness = new PlayerBussiness())
             {
                 playerBussiness.UpdateMarryRoomInfo(player.CurrentMarryRoom.Info);
             }
             return(true);
         }
     }
     return(false);
 }
Пример #3
0
 public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
 {
     if (player.CurrentMarryRoom != null)
     {
         player.X = packet.ReadInt();
         player.Y = packet.ReadInt();
         return(true);
     }
     return(false);
 }
Пример #4
0
 public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
 {
     if (player.CurrentMarryRoom != null && player.CurrentMarryRoom.RoomState == eRoomState.FREE && (player.PlayerCharacter.ID == player.CurrentMarryRoom.Info.GroomID || player.PlayerCharacter.ID == player.CurrentMarryRoom.Info.BrideID))
     {
         int userID = packet.ReadInt();
         player.CurrentMarryRoom.KickPlayerByUserID(player, userID);
         return(true);
     }
     return(false);
 }
Пример #5
0
 public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
 {
     if (player.CurrentMarryRoom != null && player.CurrentMarryRoom.RoomState == eRoomState.FREE)
     {
         player.X = packet.ReadInt();
         player.Y = packet.ReadInt();
         player.CurrentMarryRoom.ReturnPacketForScene(player, packet);
         return(true);
     }
     return(false);
 }
Пример #6
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            if(player.CurrentMarryRoom != null)
            {
                player.X = packet.ReadInt();
                player.Y = packet.ReadInt();

                return true;
            }

            return false;
        }
Пример #7
0
 public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
 {
     if (player.CurrentMarryRoom != null && (player.PlayerCharacter.ID == player.CurrentMarryRoom.Info.GroomID || player.PlayerCharacter.ID == player.CurrentMarryRoom.Info.BrideID))
     {
         int num = packet.ReadInt();
         if (num != player.CurrentMarryRoom.Info.BrideID && num != player.CurrentMarryRoom.Info.GroomID)
         {
             player.CurrentMarryRoom.KickPlayerByUserID(player, num);
             player.CurrentMarryRoom.SetUserForbid(num);
         }
         return(true);
     }
     return(false);
 }
Пример #8
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            bool result;

            if (player.CurrentMarryRoom != null)
            {
                int          userID     = packet.ReadInt();
                int          templateID = packet.ReadInt();
                ShopItemInfo temp       = ShopMgr.FindShopbyTemplatID(templateID).FirstOrDefault <ShopItemInfo>();
                if (temp != null)
                {
                    if (temp.APrice1 == -2)
                    {
                        if (player.PlayerCharacter.Gold >= temp.AValue1)
                        {
                            player.RemoveGold(temp.AValue1);
                            player.CurrentMarryRoom.ReturnPacketForScene(player, packet);
                            player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("UserFirecrackersCommand.Successed1", new object[]
                            {
                                temp.AValue1
                            }));
                            player.OnUsingItem(temp.TemplateID);
                            result = true;
                            return(result);
                        }
                        player.Out.SendMessage(eMessageType.ERROR, LanguageMgr.GetTranslation("UserFirecrackersCommand.GoldNotEnough", new object[0]));
                    }
                    if (temp.APrice1 == -1)
                    {
                        if (player.PlayerCharacter.Money >= temp.AValue1)
                        {
                            player.RemoveMoney(temp.AValue1, LogMoneyType.Marry, LogMoneyType.Marry_Flower);
                            player.CurrentMarryRoom.ReturnPacketForScene(player, packet);
                            player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("UserFirecrackersCommand.Successed2", new object[]
                            {
                                temp.AValue1
                            }));
                            player.OnUsingItem(temp.TemplateID);
                            result = true;
                            return(result);
                        }
                        player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("UserFirecrackersCommand.MoneyNotEnough", new object[0]));
                    }
                }
            }
            result = false;
            return(result);
        }
Пример #9
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            bool result;

            if (player.CurrentMarryRoom != null)
            {
                player.X = packet.ReadInt();
                player.Y = packet.ReadInt();
                result   = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }
Пример #10
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            if (player.CurrentMarryRoom != null /* && player.CurrentMarryRoom.RoomState == eRoomState.FREE*/)
            {
                int userID     = packet.ReadInt();
                int templateID = packet.ReadInt();

                //ItemTemplateInfo template = ItemMgr.FindItemTemplate(templateID);
                ShopItemInfo temp = ShopMgr.FindShopbyTemplatID(templateID).FirstOrDefault();
                if (temp != null)
                {
                    if (temp.APrice1 == -2)
                    {
                        if (player.PlayerCharacter.Gold >= temp.AValue1)
                        {
                            player.RemoveGold(temp.AValue1);
                            //0 player.CurrentMarryRoom.ReturnPacket(player, packet);
                            player.CurrentMarryRoom.ReturnPacketForScene(player, packet);
                            player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("UserFirecrackersCommand.Successed1", temp.AValue1));
                            return(true);
                        }
                        else
                        {
                            player.Out.SendMessage(eMessageType.ERROR, LanguageMgr.GetTranslation("UserFirecrackersCommand.GoldNotEnough"));
                        }
                    }
                    if (temp.APrice1 == -1)
                    {
                        if (player.PlayerCharacter.Money >= temp.AValue1)
                        {
                            player.RemoveMoney(temp.AValue1);
                            LogMgr.LogMoneyAdd(LogMoneyType.Marry, LogMoneyType.Marry_Flower, player.PlayerCharacter.ID, temp.AValue1, player.PlayerCharacter.Money, 0, 0, 0, 0, "", "", "");
                            player.CurrentMarryRoom.ReturnPacketForScene(player, packet);
                            player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("UserFirecrackersCommand.Successed2", temp.AValue1));
                            return(true);
                        }
                        else
                        {
                            player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("UserFirecrackersCommand.MoneyNotEnough"));
                        }
                    }
                }
            }
            return(false);
        }
 public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
 {
     if (player.CurrentMarryRoom != null)
     {
         packet.ReadInt();
         int          templatID    = packet.ReadInt();
         ShopItemInfo shopItemInfo = ShopMgr.FindShopbyTemplatID(templatID).FirstOrDefault <ShopItemInfo>();
         if (shopItemInfo != null)
         {
             if (shopItemInfo.APrice1 == -2)
             {
                 if (player.PlayerCharacter.Gold >= shopItemInfo.AValue1)
                 {
                     player.RemoveGold(shopItemInfo.AValue1);
                     player.CurrentMarryRoom.ReturnPacketForScene(player, packet);
                     player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("UserFirecrackersCommand.Successed1", new object[]
                     {
                         shopItemInfo.AValue1
                     }));
                     return(true);
                 }
                 player.Out.SendMessage(eMessageType.ERROR, LanguageMgr.GetTranslation("UserFirecrackersCommand.GoldNotEnough", new object[0]));
             }
             if (shopItemInfo.APrice1 == -1)
             {
                 if (player.PlayerCharacter.Money >= shopItemInfo.AValue1)
                 {
                     player.RemoveMoney(shopItemInfo.AValue1);
                     LogMgr.LogMoneyAdd(LogMoneyType.Marry, LogMoneyType.Marry_Flower, player.PlayerCharacter.ID, shopItemInfo.AValue1, player.PlayerCharacter.Money, 0, 0, 0, 0, "", "", "");
                     player.CurrentMarryRoom.ReturnPacketForScene(player, packet);
                     player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("UserFirecrackersCommand.Successed2", new object[]
                     {
                         shopItemInfo.AValue1
                     }));
                     return(true);
                 }
                 player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("UserFirecrackersCommand.MoneyNotEnough", new object[0]));
             }
         }
     }
     return(false);
 }
Пример #12
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            bool result;

            if (player.CurrentMarryRoom == null || player.CurrentMarryRoom.RoomState != eRoomState.FREE)
            {
                result = false;
            }
            else
            {
                if (!player.CurrentMarryRoom.Info.GuestInvite)
                {
                    if (player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.GroomID && player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.BrideID)
                    {
                        result = false;
                        return(result);
                    }
                }
                GSPacketIn pkg = packet.Clone();
                pkg.ClearContext();
                int        id            = packet.ReadInt();
                GamePlayer invitedplayer = WorldMgr.GetPlayerById(id);
                if (invitedplayer != null && invitedplayer.CurrentRoom == null && invitedplayer.CurrentMarryRoom == null && invitedplayer.CurrentSpaRoom == null)
                {
                    pkg.WriteByte(4);
                    pkg.WriteInt(player.PlayerCharacter.ID);
                    pkg.WriteString(player.PlayerCharacter.NickName);
                    pkg.WriteInt(player.CurrentMarryRoom.Info.ID);
                    pkg.WriteString(player.CurrentMarryRoom.Info.Name);
                    pkg.WriteString(player.CurrentMarryRoom.Info.Pwd);
                    pkg.WriteInt(player.MarryMap);
                    invitedplayer.Out.SendTCP(pkg);
                    result = true;
                }
                else
                {
                    result = false;
                }
            }
            return(result);
        }
Пример #13
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            bool result;

            if (player.CurrentMarryRoom != null)
            {
                if (player.PlayerCharacter.ID == player.CurrentMarryRoom.Info.GroomID || player.PlayerCharacter.ID == player.CurrentMarryRoom.Info.BrideID)
                {
                    int userID = packet.ReadInt();
                    if (userID != player.CurrentMarryRoom.Info.BrideID && userID != player.CurrentMarryRoom.Info.GroomID)
                    {
                        player.CurrentMarryRoom.KickPlayerByUserID(player, userID);
                        player.CurrentMarryRoom.SetUserForbid(userID);
                    }
                    result = true;
                    return(result);
                }
            }
            result = false;
            return(result);
        }
Пример #14
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            if (player.CurrentMarryRoom == null || player.CurrentMarryRoom.RoomState != eRoomState.FREE)
            {
                return(false);
            }

            if (player.CurrentMarryRoom.Info.GuestInvite == false)
            {
                if (player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.GroomID && player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.BrideID)
                {
                    return(false);
                }
            }

            GSPacketIn pkg = packet.Clone();

            pkg.ClearContext();

            int        id            = packet.ReadInt();
            GamePlayer invitedplayer = Managers.WorldMgr.GetPlayerById(id);

            if (invitedplayer != null && invitedplayer.CurrentRoom == null && invitedplayer.CurrentMarryRoom == null)
            {
                pkg.WriteByte((byte)MarryCmdType.INVITE);
                pkg.WriteInt(player.PlayerCharacter.ID);
                pkg.WriteString(player.PlayerCharacter.NickName);
                pkg.WriteInt(player.CurrentMarryRoom.Info.ID);
                //pkg.WriteInt(player.CurrentMarryRoom.Info.MapIndex);
                pkg.WriteString(player.CurrentMarryRoom.Info.Name);
                pkg.WriteString(player.CurrentMarryRoom.Info.Pwd);
                pkg.WriteInt(player.MarryMap);

                invitedplayer.Out.SendTCP(pkg);

                return(true);
            }

            return(false);
        }
Пример #15
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            if (player.CurrentMarryRoom == null || player.CurrentMarryRoom.RoomState != eRoomState.FREE)
            {
                return(false);
            }
            if (player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.GroomID && player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.BrideID)
            {
                return(false);
            }
            int pRICE_PROPOSE = GameProperties.PRICE_PROPOSE;

            if (player.CurrentMarryRoom.Info.IsHymeneal && player.PlayerCharacter.Money < pRICE_PROPOSE)
            {
                player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("UserFirecrackersCommand.MoneyNotEnough", new object[0]));
                return(false);
            }
            GamePlayer playerByUserID = player.CurrentMarryRoom.GetPlayerByUserID(player.CurrentMarryRoom.Info.GroomID);

            if (playerByUserID == null)
            {
                player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("HymenealCommand.NoGroom", new object[0]));
                return(false);
            }
            GamePlayer playerByUserID2 = player.CurrentMarryRoom.GetPlayerByUserID(player.CurrentMarryRoom.Info.BrideID);

            if (playerByUserID2 == null)
            {
                player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("HymenealCommand.NoBride", new object[0]));
                return(false);
            }
            bool       flag       = false;
            bool       flag2      = false;
            GSPacketIn gSPacketIn = packet.Clone();
            int        num        = packet.ReadInt();

            if (1 == num)
            {
                player.CurrentMarryRoom.RoomState = eRoomState.FREE;
            }
            else
            {
                player.CurrentMarryRoom.RoomState = eRoomState.Hymeneal;
                player.CurrentMarryRoom.BeginTimerForHymeneal(170000);
                if (!player.PlayerCharacter.IsGotRing)
                {
                    flag2 = true;
                    ItemTemplateInfo goods    = ItemMgr.FindItemTemplate(9022);
                    ItemInfo         itemInfo = ItemInfo.CreateFromTemplate(goods, 1, 112);
                    itemInfo.IsBinds = true;
                    using (PlayerBussiness playerBussiness = new PlayerBussiness())
                    {
                        itemInfo.UserID = 0;
                        playerBussiness.AddGoods(itemInfo);
                        string translation = LanguageMgr.GetTranslation("HymenealCommand.Content", new object[]
                        {
                            playerByUserID2.PlayerCharacter.NickName
                        });
                        MailInfo mailInfo = new MailInfo();
                        mailInfo.Annex1     = itemInfo.ItemID.ToString();
                        mailInfo.Content    = translation;
                        mailInfo.Gold       = 0;
                        mailInfo.IsExist    = true;
                        mailInfo.Money      = 0;
                        mailInfo.Receiver   = playerByUserID.PlayerCharacter.NickName;
                        mailInfo.ReceiverID = playerByUserID.PlayerCharacter.ID;
                        mailInfo.Sender     = LanguageMgr.GetTranslation("HymenealCommand.Sender", new object[0]);
                        mailInfo.SenderID   = 0;
                        mailInfo.Title      = LanguageMgr.GetTranslation("HymenealCommand.Title", new object[0]);
                        mailInfo.Type       = 14;
                        if (playerBussiness.SendMail(mailInfo))
                        {
                            flag = true;
                        }
                        player.Out.SendMailResponse(mailInfo.ReceiverID, eMailRespose.Receiver);
                    }
                    ItemInfo itemInfo2 = ItemInfo.CreateFromTemplate(goods, 1, 112);
                    itemInfo2.IsBinds = true;
                    using (PlayerBussiness playerBussiness2 = new PlayerBussiness())
                    {
                        itemInfo2.UserID = 0;
                        playerBussiness2.AddGoods(itemInfo2);
                        string translation2 = LanguageMgr.GetTranslation("HymenealCommand.Content", new object[]
                        {
                            playerByUserID.PlayerCharacter.NickName
                        });
                        MailInfo mailInfo2 = new MailInfo();
                        mailInfo2.Annex1     = itemInfo2.ItemID.ToString();
                        mailInfo2.Content    = translation2;
                        mailInfo2.Gold       = 0;
                        mailInfo2.IsExist    = true;
                        mailInfo2.Money      = 0;
                        mailInfo2.Receiver   = playerByUserID2.PlayerCharacter.NickName;
                        mailInfo2.ReceiverID = playerByUserID2.PlayerCharacter.ID;
                        mailInfo2.Sender     = LanguageMgr.GetTranslation("HymenealCommand.Sender", new object[0]);
                        mailInfo2.SenderID   = 0;
                        mailInfo2.Title      = LanguageMgr.GetTranslation("HymenealCommand.Title", new object[0]);
                        mailInfo2.Type       = 14;
                        if (playerBussiness2.SendMail(mailInfo2))
                        {
                            flag = true;
                        }
                        player.Out.SendMailResponse(mailInfo2.ReceiverID, eMailRespose.Receiver);
                    }
                    player.CurrentMarryRoom.Info.IsHymeneal = true;
                    using (PlayerBussiness playerBussiness3 = new PlayerBussiness())
                    {
                        playerBussiness3.UpdateMarryRoomInfo(player.CurrentMarryRoom.Info);
                        playerBussiness3.UpdatePlayerGotRingProp(playerByUserID.PlayerCharacter.ID, playerByUserID2.PlayerCharacter.ID);
                        playerByUserID.LoadMarryProp();
                        playerByUserID2.LoadMarryProp();
                        goto IL_429;
                    }
                }
                flag2 = false;
                flag  = true;
IL_429:
                if (!flag2)
                {
                    player.RemoveMoney(pRICE_PROPOSE);
                    LogMgr.LogMoneyAdd(LogMoneyType.Marry, LogMoneyType.Marry_Hymeneal, player.PlayerCharacter.ID, pRICE_PROPOSE, player.PlayerCharacter.Money, 0, 0, 0, 0, "", "", "");
                    CountBussiness.InsertSystemPayCount(player.PlayerCharacter.ID, pRICE_PROPOSE, 0, 0, 1);
                }
                gSPacketIn.WriteInt(player.CurrentMarryRoom.Info.ID);
                gSPacketIn.WriteBoolean(flag);
                player.CurrentMarryRoom.SendToAll(gSPacketIn);
                if (flag)
                {
                    string translation3 = LanguageMgr.GetTranslation("HymenealCommand.Succeed", new object[]
                    {
                        playerByUserID.PlayerCharacter.NickName,
                        playerByUserID2.PlayerCharacter.NickName
                    });
                    GSPacketIn packet2 = player.Out.SendMessage(eMessageType.ChatNormal, translation3);
                    player.CurrentMarryRoom.SendToPlayerExceptSelfForScene(packet2, player);
                }
            }
            return(true);
        }
Пример #16
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            if (player.CurrentMarryRoom == null || player.CurrentMarryRoom.RoomState != eRoomState.FREE)
            {
                return false;
            }

            if(player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.GroomID && player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.BrideID )
            {
                return false;
            }

            int needMoney = GameProperties.PRICE_PROPOSE;
            if(player.CurrentMarryRoom.Info.IsHymeneal)
            {
                if (player.PlayerCharacter.Money < needMoney)
                {
                    player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("UserFirecrackersCommand.MoneyNotEnough"));
                    return false;
                }
            }

            GamePlayer Groom = player.CurrentMarryRoom.GetPlayerByUserID(player.CurrentMarryRoom.Info.GroomID);
            if(Groom == null)
            {
                player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("HymenealCommand.NoGroom"));
                return false;
            }

            GamePlayer Bride = player.CurrentMarryRoom.GetPlayerByUserID(player.CurrentMarryRoom.Info.BrideID);
            if (Bride == null)
            {
                player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("HymenealCommand.NoBride"));
                return false;
            }

            bool result = false;
            bool isFirst = false;
            GSPacketIn pkg = packet.Clone();

            int hymenealState = packet.ReadInt();

            if (1 == hymenealState)
            {
                player.CurrentMarryRoom.RoomState = eRoomState.FREE;
            }
            else
            {
                player.CurrentMarryRoom.RoomState = eRoomState.Hymeneal;
                player.CurrentMarryRoom.BeginTimerForHymeneal(170 * 1000);

                if (!player.PlayerCharacter.IsGotRing)
                {
                    isFirst = true;
                    ItemTemplateInfo ringTemplate = ItemMgr.FindItemTemplate(9022);
                    ItemInfo ring1 = ItemInfo.CreateFromTemplate(ringTemplate, 1, (int)ItemAddType.webing);
                    ring1.IsBinds = true;
                    //Groom.CurrentInventory.AddItem(ring1, 11);
                    using (PlayerBussiness pb = new PlayerBussiness())
                    {
                        ring1.UserID = 0;
                        pb.AddGoods(ring1);

                        string content = LanguageMgr.GetTranslation("HymenealCommand.Content", Bride.PlayerCharacter.NickName);

                        MailInfo mail = new MailInfo();
                        mail.Annex1 = ring1.ItemID.ToString();
                        mail.Content = content;
                        mail.Gold = 0;
                        mail.IsExist = true;
                        mail.Money = 0;
                        mail.Receiver = Groom.PlayerCharacter.NickName;
                        mail.ReceiverID = Groom.PlayerCharacter.ID;
                        mail.Sender = LanguageMgr.GetTranslation("HymenealCommand.Sender");
                        mail.SenderID = 0;
                        mail.Title = LanguageMgr.GetTranslation("HymenealCommand.Title");
                        mail.Type = (int)eMailType.Marry;
                        if (pb.SendMail(mail))
                        {
                            result = true;
                        }
                        player.Out.SendMailResponse(mail.ReceiverID, eMailRespose.Receiver);
                    }

                    ItemInfo ring2 = ItemInfo.CreateFromTemplate(ringTemplate, 1, (int)ItemAddType.webing);
                    ring2.IsBinds = true;
                    //Bride.CurrentInventory.AddItem(ring2, 11);
                    using (PlayerBussiness pb = new PlayerBussiness())
                    {
                        ring2.UserID = 0;
                        pb.AddGoods(ring2);

                        string content = LanguageMgr.GetTranslation("HymenealCommand.Content", Groom.PlayerCharacter.NickName);

                        MailInfo mail = new MailInfo();
                        mail.Annex1 = ring2.ItemID.ToString();
                        mail.Content = content;
                        mail.Gold = 0;
                        mail.IsExist = true;
                        mail.Money = 0;
                        mail.Receiver = Bride.PlayerCharacter.NickName;
                        mail.ReceiverID = Bride.PlayerCharacter.ID;
                        mail.Sender = LanguageMgr.GetTranslation("HymenealCommand.Sender");
                        mail.SenderID = 0;
                        mail.Title = LanguageMgr.GetTranslation("HymenealCommand.Title");
                        mail.Type = (int)eMailType.Marry;
                        if (pb.SendMail(mail))
                        {
                            result = true;
                        }
                        player.Out.SendMailResponse(mail.ReceiverID, eMailRespose.Receiver);
                    }

                    player.CurrentMarryRoom.Info.IsHymeneal = true;

                    using (PlayerBussiness db = new PlayerBussiness())
                    {
                        db.UpdateMarryRoomInfo(player.CurrentMarryRoom.Info);

                        //更新IsGotRing的数据库
                        db.UpdatePlayerGotRingProp(Groom.PlayerCharacter.ID,Bride.PlayerCharacter.ID);

                        //通过数据库读入PlayerCharacter内存
                        Groom.LoadMarryProp();
                        Bride.LoadMarryProp();
                    }

                    //Groom.PlayerCharacter.IsGotRing = true;
                    //Bride.PlayerCharacter.IsGotRing = true;

                }
                else
                {
                    isFirst = false;
                    result = true;
                }

                if (!isFirst)
                {
                    //player.SetMoney(-needMoney, MoneyRemoveType.Marry);
                    player.RemoveMoney(needMoney);
                    LogMgr.LogMoneyAdd(LogMoneyType.Marry, LogMoneyType.Marry_Hymeneal, player.PlayerCharacter.ID, needMoney, player.PlayerCharacter.Money, 0, 0, 0,0, "", "", "");
                    CountBussiness.InsertSystemPayCount(player.PlayerCharacter.ID, needMoney, 0, (int)eConsumerType.Marry, (int)eSubConsumerType.Marry_Hymeneal);
                }

                pkg.WriteInt(player.CurrentMarryRoom.Info.ID);
                pkg.WriteBoolean(result);
                //0 player.CurrentMarryRoom.SendToAll(pkg);
                //0 player.CurrentMarryRoom.SendToAllForScene(pkg,1);
                player.CurrentMarryRoom.SendToAll(pkg);

                if(result)
                {
                    string msg = LanguageMgr.GetTranslation("HymenealCommand.Succeed", Groom.PlayerCharacter.NickName, Bride.PlayerCharacter.NickName);
                    GSPacketIn message = player.Out.SendMessage(eMessageType.ChatNormal, msg);
                    player.CurrentMarryRoom.SendToPlayerExceptSelfForScene(message, player);
                }
            }

            return true;
        }
Пример #17
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            if (player.CurrentMarryRoom == null || player.CurrentMarryRoom.RoomState != eRoomState.FREE)
            {
                return(false);
            }

            if (player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.GroomID && player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.BrideID)
            {
                return(false);
            }

            int needMoney = GameProperties.PRICE_PROPOSE;

            if (player.CurrentMarryRoom.Info.IsHymeneal)
            {
                if (player.PlayerCharacter.Money < needMoney)
                {
                    player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("UserFirecrackersCommand.MoneyNotEnough"));
                    return(false);
                }
            }

            GamePlayer Groom = player.CurrentMarryRoom.GetPlayerByUserID(player.CurrentMarryRoom.Info.GroomID);

            if (Groom == null)
            {
                player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("HymenealCommand.NoGroom"));
                return(false);
            }

            GamePlayer Bride = player.CurrentMarryRoom.GetPlayerByUserID(player.CurrentMarryRoom.Info.BrideID);

            if (Bride == null)
            {
                player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("HymenealCommand.NoBride"));
                return(false);
            }

            bool       result  = false;
            bool       isFirst = false;
            GSPacketIn pkg     = packet.Clone();

            int hymenealState = packet.ReadInt();

            if (1 == hymenealState)
            {
                player.CurrentMarryRoom.RoomState = eRoomState.FREE;
            }
            else
            {
                player.CurrentMarryRoom.RoomState = eRoomState.Hymeneal;
                player.CurrentMarryRoom.BeginTimerForHymeneal(170 * 1000);

                if (!player.PlayerCharacter.IsGotRing)
                {
                    isFirst = true;
                    ItemTemplateInfo ringTemplate = ItemMgr.FindItemTemplate(9022);
                    ItemInfo         ring1        = ItemInfo.CreateFromTemplate(ringTemplate, 1, (int)ItemAddType.webing);
                    ring1.IsBinds = true;
                    //Groom.CurrentInventory.AddItem(ring1, 11);
                    using (PlayerBussiness pb = new PlayerBussiness())
                    {
                        ring1.UserID = 0;
                        pb.AddGoods(ring1);

                        string content = LanguageMgr.GetTranslation("HymenealCommand.Content", Bride.PlayerCharacter.NickName);

                        MailInfo mail = new MailInfo();
                        mail.Annex1     = ring1.ItemID.ToString();
                        mail.Content    = content;
                        mail.Gold       = 0;
                        mail.IsExist    = true;
                        mail.Money      = 0;
                        mail.Receiver   = Groom.PlayerCharacter.NickName;
                        mail.ReceiverID = Groom.PlayerCharacter.ID;
                        mail.Sender     = LanguageMgr.GetTranslation("HymenealCommand.Sender");
                        mail.SenderID   = 0;
                        mail.Title      = LanguageMgr.GetTranslation("HymenealCommand.Title");
                        mail.Type       = (int)eMailType.Marry;
                        if (pb.SendMail(mail))
                        {
                            result = true;
                        }
                        player.Out.SendMailResponse(mail.ReceiverID, eMailRespose.Receiver);
                    }


                    ItemInfo ring2 = ItemInfo.CreateFromTemplate(ringTemplate, 1, (int)ItemAddType.webing);
                    ring2.IsBinds = true;
                    //Bride.CurrentInventory.AddItem(ring2, 11);
                    using (PlayerBussiness pb = new PlayerBussiness())
                    {
                        ring2.UserID = 0;
                        pb.AddGoods(ring2);

                        string content = LanguageMgr.GetTranslation("HymenealCommand.Content", Groom.PlayerCharacter.NickName);

                        MailInfo mail = new MailInfo();
                        mail.Annex1     = ring2.ItemID.ToString();
                        mail.Content    = content;
                        mail.Gold       = 0;
                        mail.IsExist    = true;
                        mail.Money      = 0;
                        mail.Receiver   = Bride.PlayerCharacter.NickName;
                        mail.ReceiverID = Bride.PlayerCharacter.ID;
                        mail.Sender     = LanguageMgr.GetTranslation("HymenealCommand.Sender");
                        mail.SenderID   = 0;
                        mail.Title      = LanguageMgr.GetTranslation("HymenealCommand.Title");
                        mail.Type       = (int)eMailType.Marry;
                        if (pb.SendMail(mail))
                        {
                            result = true;
                        }
                        player.Out.SendMailResponse(mail.ReceiverID, eMailRespose.Receiver);
                    }


                    player.CurrentMarryRoom.Info.IsHymeneal = true;

                    using (PlayerBussiness db = new PlayerBussiness())
                    {
                        db.UpdateMarryRoomInfo(player.CurrentMarryRoom.Info);

                        //更新IsGotRing的数据库
                        db.UpdatePlayerGotRingProp(Groom.PlayerCharacter.ID, Bride.PlayerCharacter.ID);

                        //通过数据库读入PlayerCharacter内存
                        Groom.LoadMarryProp();
                        Bride.LoadMarryProp();
                    }

                    //Groom.PlayerCharacter.IsGotRing = true;
                    //Bride.PlayerCharacter.IsGotRing = true;
                }
                else
                {
                    isFirst = false;
                    result  = true;
                }

                if (!isFirst)
                {
                    //player.SetMoney(-needMoney, MoneyRemoveType.Marry);
                    player.RemoveMoney(needMoney);
                    LogMgr.LogMoneyAdd(LogMoneyType.Marry, LogMoneyType.Marry_Hymeneal, player.PlayerCharacter.ID, needMoney, player.PlayerCharacter.Money, 0, 0, 0, 0, "", "", "");
                    CountBussiness.InsertSystemPayCount(player.PlayerCharacter.ID, needMoney, 0, (int)eConsumerType.Marry, (int)eSubConsumerType.Marry_Hymeneal);
                }

                pkg.WriteInt(player.CurrentMarryRoom.Info.ID);
                pkg.WriteBoolean(result);
                //0 player.CurrentMarryRoom.SendToAll(pkg);
                //0 player.CurrentMarryRoom.SendToAllForScene(pkg,1);
                player.CurrentMarryRoom.SendToAll(pkg);

                if (result)
                {
                    string     msg     = LanguageMgr.GetTranslation("HymenealCommand.Succeed", Groom.PlayerCharacter.NickName, Bride.PlayerCharacter.NickName);
                    GSPacketIn message = player.Out.SendMessage(eMessageType.ChatNormal, msg);
                    player.CurrentMarryRoom.SendToPlayerExceptSelfForScene(message, player);
                }
            }

            return(true);
        }
Пример #18
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            bool result2;

            if (player.CurrentMarryRoom == null || player.CurrentMarryRoom.RoomState != eRoomState.FREE)
            {
                result2 = false;
            }
            else
            {
                if (player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.GroomID && player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.BrideID)
                {
                    result2 = false;
                }
                else
                {
                    int needMoney = 500;
                    if (player.CurrentMarryRoom.Info.IsHymeneal)
                    {
                        if (player.PlayerCharacter.Money < needMoney)
                        {
                            player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("UserFirecrackersCommand.MoneyNotEnough", new object[0]));
                            result2 = false;
                            return(result2);
                        }
                    }
                    GamePlayer Groom = player.CurrentMarryRoom.GetPlayerByUserID(player.CurrentMarryRoom.Info.GroomID);
                    if (Groom == null)
                    {
                        player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("HymenealCommand.NoGroom", new object[0]));
                        result2 = false;
                    }
                    else
                    {
                        GamePlayer Bride = player.CurrentMarryRoom.GetPlayerByUserID(player.CurrentMarryRoom.Info.BrideID);
                        if (Bride == null)
                        {
                            player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("HymenealCommand.NoBride", new object[0]));
                            result2 = false;
                        }
                        else
                        {
                            bool       result        = false;
                            bool       isFirst       = false;
                            GSPacketIn pkg           = packet.Clone();
                            int        hymenealState = packet.ReadInt();
                            if (1 == hymenealState)
                            {
                                player.CurrentMarryRoom.RoomState = eRoomState.FREE;
                            }
                            else
                            {
                                player.CurrentMarryRoom.RoomState = eRoomState.Hymeneal;
                                player.CurrentMarryRoom.BeginTimerForHymeneal(170000);
                                if (!player.PlayerCharacter.IsGotRing)
                                {
                                    isFirst = true;
                                    ItemTemplateInfo ringTemplate = ItemMgr.FindItemTemplate(9022);
                                    ItemInfo         ring         = ItemInfo.CreateFromTemplate(ringTemplate, 1, 112);
                                    ring.IsBinds = true;
                                    using (PlayerBussiness pb = new PlayerBussiness())
                                    {
                                        ring.UserID = 0;
                                        pb.AddGoods(ring);
                                        string content = LanguageMgr.GetTranslation("HymenealCommand.Content", new object[]
                                        {
                                            Bride.PlayerCharacter.NickName
                                        });
                                        MailInfo mail = new MailInfo();
                                        mail.Annex1     = ring.ItemID.ToString();
                                        mail.Content    = content;
                                        mail.Gold       = 0;
                                        mail.IsExist    = true;
                                        mail.Money      = 0;
                                        mail.GiftToken  = 0;
                                        mail.Receiver   = Groom.PlayerCharacter.NickName;
                                        mail.ReceiverID = Groom.PlayerCharacter.ID;
                                        mail.Sender     = LanguageMgr.GetTranslation("HymenealCommand.Sender", new object[0]);
                                        mail.SenderID   = 0;
                                        mail.Title      = LanguageMgr.GetTranslation("HymenealCommand.Title", new object[0]);
                                        mail.Type       = 14;
                                        if (pb.SendMail(mail))
                                        {
                                            result = true;
                                        }
                                        player.Out.SendMailResponse(mail.ReceiverID, eMailRespose.Receiver);
                                    }
                                    ItemInfo ring2 = ItemInfo.CreateFromTemplate(ringTemplate, 1, 112);
                                    ring2.IsBinds = true;
                                    using (PlayerBussiness pb = new PlayerBussiness())
                                    {
                                        ring2.UserID = 0;
                                        pb.AddGoods(ring2);
                                        string content = LanguageMgr.GetTranslation("HymenealCommand.Content", new object[]
                                        {
                                            Groom.PlayerCharacter.NickName
                                        });
                                        MailInfo mail = new MailInfo();
                                        mail.Annex1     = ring2.ItemID.ToString();
                                        mail.Content    = content;
                                        mail.Gold       = 0;
                                        mail.IsExist    = true;
                                        mail.Money      = 0;
                                        mail.GiftToken  = 0;
                                        mail.Receiver   = Bride.PlayerCharacter.NickName;
                                        mail.ReceiverID = Bride.PlayerCharacter.ID;
                                        mail.Sender     = LanguageMgr.GetTranslation("HymenealCommand.Sender", new object[0]);
                                        mail.SenderID   = 0;
                                        mail.Title      = LanguageMgr.GetTranslation("HymenealCommand.Title", new object[0]);
                                        mail.Type       = 14;
                                        if (pb.SendMail(mail))
                                        {
                                            result = true;
                                        }
                                        player.Out.SendMailResponse(mail.ReceiverID, eMailRespose.Receiver);
                                    }
                                    player.CurrentMarryRoom.Info.IsHymeneal = true;
                                    using (PlayerBussiness db = new PlayerBussiness())
                                    {
                                        db.UpdateMarryRoomInfo(player.CurrentMarryRoom.Info);
                                        db.UpdatePlayerGotRingProp(Groom.PlayerCharacter.ID, Bride.PlayerCharacter.ID);
                                        Groom.LoadMarryProp();
                                        Bride.LoadMarryProp();
                                    }
                                }
                                else
                                {
                                    isFirst = false;
                                    result  = true;
                                }
                                if (!isFirst)
                                {
                                    player.RemoveMoney(needMoney, LogMoneyType.Marry, LogMoneyType.Marry_Hymeneal);
                                    CountBussiness.InsertSystemPayCount(player.PlayerCharacter.ID, needMoney, 0, 0, 1);
                                }
                                pkg.WriteInt(player.CurrentMarryRoom.Info.ID);
                                pkg.WriteBoolean(result);
                                player.CurrentMarryRoom.SendToAll(pkg);
                                if (result)
                                {
                                    string msg = LanguageMgr.GetTranslation("HymenealCommand.Succeed", new object[]
                                    {
                                        Groom.PlayerCharacter.NickName,
                                        Bride.PlayerCharacter.NickName
                                    });
                                    GSPacketIn message = player.Out.SendMessage(eMessageType.ChatNormal, msg);
                                    player.CurrentMarryRoom.SendToPlayerExceptSelfForScene(message, player);
                                }
                            }
                            result2 = true;
                        }
                    }
                }
            }
            return(result2);
        }
Пример #19
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            bool result;

            if (player.CurrentMarryRoom == null)
            {
                result = false;
            }
            else
            {
                if (player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.GroomID && player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.BrideID)
                {
                    result = false;
                }
                else
                {
                    int      hour  = packet.ReadInt();
                    string[] money = "2000,2700,3400".Split(new char[]
                    {
                        ','
                    });
                    if (money.Length < 3)
                    {
                        ContinuationCommand.log.Error("MarryRoomCreateMoney node in configuration file is wrong");

                        result = false;
                    }
                    else
                    {
                        int needMoney;
                        switch (hour)
                        {
                        case 2:
                            needMoney = int.Parse(money[0]);
                            break;

                        case 3:
                            needMoney = int.Parse(money[1]);
                            break;

                        case 4:
                            needMoney = int.Parse(money[2]);
                            break;

                        default:
                            needMoney = int.Parse(money[2]);
                            hour      = 4;
                            break;
                        }
                        if (player.PlayerCharacter.Money < needMoney)
                        {
                            player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("MarryApplyHandler.Msg1", new object[0]));
                            result = false;
                        }
                        else
                        {
                            player.RemoveMoney(needMoney, LogMoneyType.Marry, LogMoneyType.Marry_RoomAdd);
                            CountBussiness.InsertSystemPayCount(player.PlayerCharacter.ID, needMoney, 0, 0, 0);
                            player.CurrentMarryRoom.RoomContinuation(hour);
                            GSPacketIn pkg = player.Out.SendContinuation(player, player.CurrentMarryRoom.Info);
                            int        spouseID;
                            if (player.PlayerCharacter.ID == player.CurrentMarryRoom.Info.GroomID)
                            {
                                spouseID = player.CurrentMarryRoom.Info.BrideID;
                            }
                            else
                            {
                                spouseID = player.CurrentMarryRoom.Info.GroomID;
                            }
                            GamePlayer spouse = WorldMgr.GetPlayerById(spouseID);
                            if (spouse != null)
                            {
                                spouse.Out.SendTCP(pkg);
                            }
                            player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("ContinuationCommand.Successed", new object[0]));
                            result = true;
                        }
                    }
                }
            }
            return(result);
        }
Пример #20
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            if (player.CurrentMarryRoom == null)
            {
                return(false);
            }

            if (player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.GroomID && player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.BrideID)
            {
                return(false);
            }

            int hour = packet.ReadInt();

            string[] money = GameProperties.PRICE_MARRY_ROOM.Split(',');
            if (money.Length < 3)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error("MarryRoomCreateMoney node in configuration file is wrong");
                }

                return(false);
            }

            int needMoney = 0;

            switch (hour)
            {
            case 2:
                needMoney = int.Parse(money[0]);
                break;

            case 3:
                needMoney = int.Parse(money[1]);
                break;

            case 4:
                needMoney = int.Parse(money[2]);
                break;

            default:
                needMoney = int.Parse(money[2]);
                hour      = 4;
                break;
            }

            if (player.PlayerCharacter.Money < needMoney)
            {
                player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("MarryApplyHandler.Msg1"));
                return(false);
            }

            //player.SetMoney(-needMoney, MoneyRemoveType.Marry);
            player.RemoveMoney(needMoney);
            LogMgr.LogMoneyAdd(LogMoneyType.Marry, LogMoneyType.Marry_RoomAdd, player.PlayerCharacter.ID, needMoney, player.PlayerCharacter.Money, 0, 0, 0, "", "", "");

            CountBussiness.InsertSystemPayCount(player.PlayerCharacter.ID, needMoney, 0, (int)eConsumerType.Marry, (int)eSubConsumerType.Marry_MarryRoom);

            player.CurrentMarryRoom.RoomContinuation(hour);

            GSPacketIn pkg = player.Out.SendContinuation(player, player.CurrentMarryRoom.Info);

            int spouseID = 0;

            if (player.PlayerCharacter.ID == player.CurrentMarryRoom.Info.GroomID)
            {
                spouseID = player.CurrentMarryRoom.Info.BrideID;
            }
            else
            {
                spouseID = player.CurrentMarryRoom.Info.GroomID;
            }

            GamePlayer spouse = WorldMgr.GetPlayerById(spouseID);

            if (spouse != null)
            {
                spouse.Out.SendTCP(pkg);
            }

            player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("ContinuationCommand.Successed"));

            return(true);
        }
Пример #21
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            bool result;

            if (player.CurrentMarryRoom == null)
            {
                result = false;
            }
            else
            {
                int num = packet.ReadInt();
                if (num > 0)
                {
                    if (player.PlayerCharacter.Money >= num)
                    {
                        player.RemoveMoney(num, LogMoneyType.Marry, LogMoneyType.Marry_Gift);
                        using (PlayerBussiness pb = new PlayerBussiness())
                        {
                            string content = LanguageMgr.GetTranslation("LargessCommand.Content", new object[]
                            {
                                player.PlayerCharacter.NickName,
                                num / 2
                            });
                            string title = LanguageMgr.GetTranslation("LargessCommand.Title", new object[]
                            {
                                player.PlayerCharacter.NickName
                            });
                            MailInfo mail = new MailInfo();
                            mail.Annex1     = "";
                            mail.Content    = content;
                            mail.Gold       = 0;
                            mail.IsExist    = true;
                            mail.Money      = num / 2;
                            mail.GiftToken  = 0;
                            mail.Receiver   = player.CurrentMarryRoom.Info.BrideName;
                            mail.ReceiverID = player.CurrentMarryRoom.Info.BrideID;
                            mail.Sender     = LanguageMgr.GetTranslation("LargessCommand.Sender", new object[0]);
                            mail.SenderID   = 0;
                            mail.Title      = title;
                            mail.Type       = 14;
                            pb.SendMail(mail);
                            player.Out.SendMailResponse(mail.ReceiverID, eMailRespose.Receiver);
                            MailInfo mail2 = new MailInfo();
                            mail2.Annex1     = "";
                            mail2.Content    = content;
                            mail2.Gold       = 0;
                            mail2.IsExist    = true;
                            mail2.Money      = num / 2;
                            mail2.GiftToken  = 0;
                            mail2.Receiver   = player.CurrentMarryRoom.Info.GroomName;
                            mail2.ReceiverID = player.CurrentMarryRoom.Info.GroomID;
                            mail2.Sender     = LanguageMgr.GetTranslation("LargessCommand.Sender", new object[0]);
                            mail2.SenderID   = 0;
                            mail2.Title      = title;
                            mail2.Type       = 14;
                            pb.SendMail(mail2);
                            player.Out.SendMailResponse(mail2.ReceiverID, eMailRespose.Receiver);
                        }
                        player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("LargessCommand.Succeed", new object[0]));
                        GSPacketIn msg = player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("LargessCommand.Notice", new object[]
                        {
                            player.PlayerCharacter.NickName,
                            num
                        }));
                        player.CurrentMarryRoom.SendToPlayerExceptSelf(msg, player);
                        result = true;
                    }
                    else
                    {
                        player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("UserFirecrackersCommand.MoneyNotEnough", new object[0]));
                        result = false;
                    }
                }
                else
                {
                    result = false;
                }
            }
            return(result);
        }
Пример #22
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            if (player.CurrentMarryRoom != null /* && player.CurrentMarryRoom.RoomState == eRoomState.FREE*/)
            {
                int userID     = packet.ReadInt();
                int templateID = packet.ReadInt();


                ItemTemplateInfo template = ItemMgr.FindItemTemplate(templateID);

                if (template != null)
                {
                    if (player.CurrentMarryRoom.Info.IsGunsaluteUsed == false && (player.CurrentMarryRoom.Info.GroomID == player.PlayerCharacter.ID ||
                                                                                  player.CurrentMarryRoom.Info.BrideID == player.PlayerCharacter.ID))
                    {
                        player.CurrentMarryRoom.ReturnPacketForScene(player, packet);
                        player.CurrentMarryRoom.Info.IsGunsaluteUsed = true;
                        GSPacketIn msg = player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("GunsaluteCommand.Successed1", player.PlayerCharacter.NickName));
                        player.CurrentMarryRoom.SendToPlayerExceptSelfForScene(msg, player);
                        GameServer.Instance.LoginServer.SendMarryRoomInfoToPlayer(player.CurrentMarryRoom.Info.GroomID, true, player.CurrentMarryRoom.Info);
                        GameServer.Instance.LoginServer.SendMarryRoomInfoToPlayer(player.CurrentMarryRoom.Info.BrideID, true, player.CurrentMarryRoom.Info);

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

                        return(true);
                    }
                    //未开始
                    //if(template.PayType == 0)
                    //{
                    //    if(player.PlayerCharacter.Gold >= template.Price1)
                    //    {
                    //        player.RemoveGold(template.Price1, GoldRemoveType.Firecrackers);
                    //        CountBussiness.InsertSystemPayCount(player.PlayerCharacter.ID, 0, template.Price1, (int)eConsumerType.Marry, (int)eSubConsumerType.Marry_Gunsalute);
                    //        //0 player.CurrentMarryRoom.ReturnPacket(player, packet);
                    //        player.CurrentMarryRoom.ReturnPacketForScene(player, packet);
                    //        GSPacketIn msg = player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("GunsaluteCommand.Successed1", player.PlayerCharacter.NickName));
                    //        player.CurrentMarryRoom.SendToPlayerExceptSelfForScene(msg, player);
                    //        return true;
                    //    }
                    //    else
                    //    {
                    //        player.Out.SendMessage(eMessageType.ERROR, LanguageMgr.GetTranslation("GunsaluteCommand.GoldNotEnough"));
                    //    }
                    //}
                    //else
                    //{
                    //    if(player.PlayerCharacter.Money >= template.Price1)
                    //    {
                    //        player.RemoveMoney(template.Price1, MoneyRemoveType.Firecrackers);
                    //        CountBussiness.InsertSystemPayCount(player.PlayerCharacter.ID, template.Price1, 0, (int)eConsumerType.Marry, (int)eSubConsumerType.Marry_Gunsalute);
                    //        //0 player.CurrentMarryRoom.ReturnPacket(player, packet);
                    //        player.CurrentMarryRoom.ReturnPacketForScene(player, packet);
                    //        GSPacketIn msg = player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("GunsaluteCommand.Successed1", player.PlayerCharacter.NickName));
                    //        player.CurrentMarryRoom.SendToPlayerExceptSelfForScene(msg, player);
                    //        return true;
                    //    }
                    //    else
                    //    {
                    //        player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("GunsaluteCommand.MoneyNotEnough"));
                    //    }
                    //}
                }
            }
            return(false);
        }
Пример #23
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            if (player.CurrentMarryRoom == null /*|| player.CurrentMarryRoom.RoomState != eRoomState.FREE*/)
            {
                return(false);
            }

            //if (player.PlayerCharacter.ID == player.CurrentMarryRoom.Info.GroomID || player.PlayerCharacter.ID == player.CurrentMarryRoom.Info.BrideID)
            //{
            //    return false;
            //}

            int num = packet.ReadInt();

            if (num > 0)
            {
                if (player.PlayerCharacter.Money >= num)
                {
                    //player.SetMoney(-num, MoneyAddType.Marry);
                    player.RemoveMoney(num);
                    LogMgr.LogMoneyAdd(LogMoneyType.Marry, LogMoneyType.Marry_Gift, player.PlayerCharacter.ID, num, player.PlayerCharacter.Money, 0, 0, 0, 0, "", "", "");
                }
                else
                {
                    player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("UserFirecrackersCommand.MoneyNotEnough"));
                    return(false);
                }


                using (PlayerBussiness pb = new PlayerBussiness())
                {
                    string content = LanguageMgr.GetTranslation("LargessCommand.Content", player.PlayerCharacter.NickName, num / 2);
                    string title   = LanguageMgr.GetTranslation("LargessCommand.Title", player.PlayerCharacter.NickName);

                    MailInfo mail1 = new MailInfo();
                    mail1.Annex1     = "";
                    mail1.Content    = content;
                    mail1.Gold       = 0;
                    mail1.IsExist    = true;
                    mail1.Money      = num / 2;
                    mail1.Receiver   = player.CurrentMarryRoom.Info.BrideName;
                    mail1.ReceiverID = player.CurrentMarryRoom.Info.BrideID;
                    mail1.Sender     = LanguageMgr.GetTranslation("LargessCommand.Sender");
                    mail1.SenderID   = 0;
                    mail1.Title      = title;
                    mail1.Type       = (int)eMailType.Marry;
                    pb.SendMail(mail1);

                    player.Out.SendMailResponse(mail1.ReceiverID, eMailRespose.Receiver);

                    MailInfo mail2 = new MailInfo();
                    mail2.Annex1     = "";
                    mail2.Content    = content;
                    mail2.Gold       = 0;
                    mail2.IsExist    = true;
                    mail2.Money      = num / 2;
                    mail2.Receiver   = player.CurrentMarryRoom.Info.GroomName;
                    mail2.ReceiverID = player.CurrentMarryRoom.Info.GroomID;
                    mail2.Sender     = LanguageMgr.GetTranslation("LargessCommand.Sender");
                    mail2.SenderID   = 0;
                    mail2.Title      = title;
                    mail2.Type       = (int)eMailType.Marry;
                    pb.SendMail(mail2);

                    player.Out.SendMailResponse(mail2.ReceiverID, eMailRespose.Receiver);
                }

                player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("LargessCommand.Succeed"));
                GSPacketIn msg = player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("LargessCommand.Notice", player.PlayerCharacter.NickName, num));
                player.CurrentMarryRoom.SendToPlayerExceptSelf(msg, player);

                return(true);
            }

            return(false);
        }
Пример #24
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            if (player.CurrentMarryRoom == null)
            {
                return(false);
            }
            int num = packet.ReadInt();

            if (num <= 0)
            {
                return(false);
            }
            if (player.PlayerCharacter.Money >= num)
            {
                player.RemoveMoney(num);
                LogMgr.LogMoneyAdd(LogMoneyType.Marry, LogMoneyType.Marry_Gift, player.PlayerCharacter.ID, num, player.PlayerCharacter.Money, 0, 0, 0, 0, "", "", "");
                using (PlayerBussiness playerBussiness = new PlayerBussiness())
                {
                    string translation = LanguageMgr.GetTranslation("LargessCommand.Content", new object[]
                    {
                        player.PlayerCharacter.NickName,
                        num / 2
                    });
                    string translation2 = LanguageMgr.GetTranslation("LargessCommand.Title", new object[]
                    {
                        player.PlayerCharacter.NickName
                    });
                    MailInfo mailInfo = new MailInfo();
                    mailInfo.Annex1     = "";
                    mailInfo.Content    = translation;
                    mailInfo.Gold       = 0;
                    mailInfo.IsExist    = true;
                    mailInfo.Money      = num / 2;
                    mailInfo.Receiver   = player.CurrentMarryRoom.Info.BrideName;
                    mailInfo.ReceiverID = player.CurrentMarryRoom.Info.BrideID;
                    mailInfo.Sender     = LanguageMgr.GetTranslation("LargessCommand.Sender", new object[0]);
                    mailInfo.SenderID   = 0;
                    mailInfo.Title      = translation2;
                    mailInfo.Type       = 14;
                    playerBussiness.SendMail(mailInfo);
                    player.Out.SendMailResponse(mailInfo.ReceiverID, eMailRespose.Receiver);
                    MailInfo mailInfo2 = new MailInfo();
                    mailInfo2.Annex1     = "";
                    mailInfo2.Content    = translation;
                    mailInfo2.Gold       = 0;
                    mailInfo2.IsExist    = true;
                    mailInfo2.Money      = num / 2;
                    mailInfo2.Receiver   = player.CurrentMarryRoom.Info.GroomName;
                    mailInfo2.ReceiverID = player.CurrentMarryRoom.Info.GroomID;
                    mailInfo2.Sender     = LanguageMgr.GetTranslation("LargessCommand.Sender", new object[0]);
                    mailInfo2.SenderID   = 0;
                    mailInfo2.Title      = translation2;
                    mailInfo2.Type       = 14;
                    playerBussiness.SendMail(mailInfo2);
                    player.Out.SendMailResponse(mailInfo2.ReceiverID, eMailRespose.Receiver);
                }
                player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("LargessCommand.Succeed", new object[0]));
                GSPacketIn packet2 = player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("LargessCommand.Notice", new object[]
                {
                    player.PlayerCharacter.NickName,
                    num
                }));
                player.CurrentMarryRoom.SendToPlayerExceptSelf(packet2, player);
                return(true);
            }
            player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("UserFirecrackersCommand.MoneyNotEnough", new object[0]));
            return(false);
        }
Пример #25
0
        public bool HandleCommand(TankMarryLogicProcessor process, GamePlayer player, GSPacketIn packet)
        {
            if (player.CurrentMarryRoom == null)
            {
                return(false);
            }
            if (player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.GroomID && player.PlayerCharacter.ID != player.CurrentMarryRoom.Info.BrideID)
            {
                return(false);
            }
            int time = packet.ReadInt();

            string[] array = GameProperties.PRICE_MARRY_ROOM.Split(new char[]
            {
                ','
            });
            if (array.Length < 3)
            {
                if (ContinuationCommand.log.IsErrorEnabled)
                {
                    ContinuationCommand.log.Error("MarryRoomCreateMoney node in configuration file is wrong");
                }
                return(false);
            }
            int num;

            switch (time)
            {
            case 2:
                num = int.Parse(array[0]);
                break;

            case 3:
                num = int.Parse(array[1]);
                break;

            case 4:
                num = int.Parse(array[2]);
                break;

            default:
                num  = int.Parse(array[2]);
                time = 4;
                break;
            }
            if (player.PlayerCharacter.Money < num)
            {
                player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("MarryApplyHandler.Msg1", new object[0]));
                return(false);
            }
            player.RemoveMoney(num);
            LogMgr.LogMoneyAdd(LogMoneyType.Marry, LogMoneyType.Marry_RoomAdd, player.PlayerCharacter.ID, num, player.PlayerCharacter.Money, 0, 0, 0, 0, "", "", "");
            CountBussiness.InsertSystemPayCount(player.PlayerCharacter.ID, num, 0, 0, 0);
            player.CurrentMarryRoom.RoomContinuation(time);
            GSPacketIn packet2 = player.Out.SendContinuation(player, player.CurrentMarryRoom.Info);
            int        playerId;

            if (player.PlayerCharacter.ID == player.CurrentMarryRoom.Info.GroomID)
            {
                playerId = player.CurrentMarryRoom.Info.BrideID;
            }
            else
            {
                playerId = player.CurrentMarryRoom.Info.GroomID;
            }
            GamePlayer playerById = WorldMgr.GetPlayerById(playerId);

            if (playerById != null)
            {
                playerById.Out.SendTCP(packet2);
            }
            player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("ContinuationCommand.Successed", new object[0]));
            return(true);
        }