Esempio n. 1
0
        public MarryOtherResult ChangeRing(GameClient client, int nRingID)
        {
            MarryOtherResult result;

            if (-1 == client.ClientData.MyMarriageData.byMarrytype)
            {
                result = MarryOtherResult.NotMarriaged;
            }
            else if (nRingID - client.ClientData.MyMarriageData.nRingID != 1)
            {
                result = MarryOtherResult.NotNexRise;
            }
            else
            {
                SystemXmlItem RingXmlItem = null;
                if (!this.WeddingRingDic.SystemXmlItemDict.TryGetValue(nRingID, out RingXmlItem) || null == RingXmlItem)
                {
                    result = MarryOtherResult.NotRing;
                }
                else
                {
                    SystemXmlItem NowRingXmlItem = null;
                    if (!this.WeddingRingDic.SystemXmlItemDict.TryGetValue(client.ClientData.MyMarriageData.nRingID, out NowRingXmlItem) || null == NowRingXmlItem)
                    {
                        result = MarryOtherResult.NotRing;
                    }
                    else
                    {
                        string strCostList    = "";
                        int    oldUserMoney   = client.ClientData.UserMoney;
                        int    oldUserGlod    = client.ClientData.Gold;
                        int    nCostGam       = RingXmlItem.GetIntValue("NeedZuanShi", -1);
                        int    nBeforeCostGam = NowRingXmlItem.GetIntValue("NeedZuanShi", -1);
                        int    chajia         = nCostGam - nBeforeCostGam;
                        if (!GameManager.ClientMgr.SubUserMoney(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, client, chajia, "更换婚戒扣除", true, true, false, DaiBiSySType.None))
                        {
                            result = MarryOtherResult.NeedGam;
                        }
                        else
                        {
                            strCostList += EventLogManager.NewResPropString(ResLogType.FristBindZuanShi, new object[]
                            {
                                -chajia,
                                oldUserGlod,
                                client.ClientData.Gold,
                                oldUserMoney,
                                client.ClientData.UserMoney
                            });
                            client.ClientData.MyMarriageData.nRingID = nRingID;
                            EventLogManager.AddRingBuyEvent(client, 1, nRingID, (int)client.ClientData.MyMarriageData.byGoodwilllevel, (int)client.ClientData.MyMarriageData.byGoodwilllevel, (int)client.ClientData.MyMarriageData.byGoodwillstar, (int)client.ClientData.MyMarriageData.byGoodwillstar, strCostList);
                            this.UpdateRingAttr(client, true, false);
                            MarryFuBenMgr.UpdateMarriageData2DB(client);
                            this.SendMarriageDataToClient(client, true);
                            result = MarryOtherResult.Success;
                        }
                    }
                }
            }
            return(result);
        }
Esempio n. 2
0
 public static MarryResult MarryAutoReject(GameClient client, int autoReject)
 {
     if ((int)client.ClientData.MyMarriageData.byAutoReject != autoReject)
     {
         client.ClientData.MyMarriageData.byAutoReject = (sbyte)autoReject;
     }
     MarryFuBenMgr.UpdateMarriageData2DB(client);
     return(MarryResult.Success);
 }
Esempio n. 3
0
 public bool initialize()
 {
     MarriageOtherLogic.getInstance().init();
     this.ManAndWifeBossXmlItems.LoadFromXMlFile("Config/ManAndWifeBoss.xml", "", "MonsterID", 0);
     TCPCmdDispatcher.getInstance().registerProcessorEx(870, 1, 2, MarryFuBenMgr.getInstance(), TCPCmdFlags.IsStringArrayParams);
     GlobalEventSource.getInstance().registerListener(18, MarryFuBenMgr.getInstance());
     GlobalEventSource.getInstance().registerListener(12, MarryFuBenMgr.getInstance());
     return(true);
 }
Esempio n. 4
0
 public void ChangeDayUpdate(GameClient client, bool bIsFirstLogin = true)
 {
     if (bIsFirstLogin && client.ClientData.MyMarriageData.nGivenrose != 0)
     {
         client.ClientData.MyMarriageData.nGivenrose = 0;
         MarryFuBenMgr.UpdateMarriageData2DB(client);
         this.SendMarriageDataToClient(client, false);
     }
 }
Esempio n. 5
0
        /// <summary>
        /// 更换婚戒属性
        /// </summary>
        public MarryOtherResult ChangeRing(GameClient client, int nRingID)
        {
            //结婚给戒指不会走该函数 所以不存在扣费用和婚戒id为-1的情况

            //看看是不是结婚了
            if (-1 == client.ClientData.MyMarriageData.byMarrytype)
            {
                return(MarryOtherResult.NotMarriaged);
            }

            //不是下一等级戒指
            if (nRingID - client.ClientData.MyMarriageData.nRingID != 1)
            {
                return(MarryOtherResult.NotNexRise);
            }

            SystemXmlItem RingXmlItem = null;

            if (false == WeddingRingDic.SystemXmlItemDict.TryGetValue(nRingID, out RingXmlItem) ||
                null == RingXmlItem)
            {
                return(MarryOtherResult.NotRing);
            }

            SystemXmlItem NowRingXmlItem = null;

            if (false == WeddingRingDic.SystemXmlItemDict.TryGetValue(client.ClientData.MyMarriageData.nRingID, out NowRingXmlItem) ||
                null == NowRingXmlItem)
            {
                return(MarryOtherResult.NotRing);
            }

            //策划修改为直接扣除婚戒差价
            int nCostGam       = RingXmlItem.GetIntValue("NeedZuanShi");
            int nBeforeCostGam = NowRingXmlItem.GetIntValue("NeedZuanShi");
            int chajia         = nCostGam - nBeforeCostGam;

            if (!GameManager.ClientMgr.SubUserMoney(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, client, chajia, "更换婚戒扣除"))
            {
                return(MarryOtherResult.NeedGam);
            }

            //都好了更换婚戒
            client.ClientData.MyMarriageData.nRingID = nRingID;

            //更新婚戒属性
            UpdateRingAttr(client, true);

            MarryFuBenMgr.UpdateMarriageData2DB(client);

            //发送给客户端更新数据
            SendMarriageDataToClient(client, true);

            return(MarryOtherResult.Success);
        }
Esempio n. 6
0
        /// <summary>
        /// 更新爱情宣言
        /// </summary>
        public MarryOtherResult ChangeMarriageMessage(GameClient client, string strMessage)
        {
            //看看是不是结婚了
            if (-1 == client.ClientData.MyMarriageData.byMarrytype)
            {
                return(MarryOtherResult.NotMarriaged);
            }

            //检查一下宣言长度 todo... 鼠标库表是varchar 128 所以最长就64吧
            if (strMessage.Length >= 64)
            {
                return(MarryOtherResult.MessageLimit);
            }

            //检查屏蔽字 todo...

            //把自己的爱情宣言更新
            client.ClientData.MyMarriageData.strLovemessage = strMessage;

            //保存数据我自己的爱情宣言
            MarryFuBenMgr.UpdateMarriageData2DB(client);

            SendMarriageDataToClient(client);

            //取出情侣
            GameClient Spouseclient = GameManager.ClientMgr.FindClient(client.ClientData.MyMarriageData.nSpouseID);

            if (null != Spouseclient)
            {
                //更新情侣的爱情宣言
                Spouseclient.ClientData.MyMarriageData.strLovemessage = strMessage;

                //保存数据配偶的爱情宣言
                MarryFuBenMgr.UpdateMarriageData2DB(Spouseclient);

                SendMarriageDataToClient(Spouseclient);
            }
            else
            {
                //从db查找配偶数据
                string       tcpstring          = string.Format("{0}", client.ClientData.MyMarriageData.nSpouseID);
                MarriageData SpouseMarriageData = Global.sendToDB <MarriageData, string>((int)TCPGameServerCmds.CMD_DB_GET_MARRY_DATA, tcpstring, client.ServerId);

                //没有数据? 或者出错?
                if (null == SpouseMarriageData ||
                    -1 == SpouseMarriageData.byMarrytype)
                {
                    return(MarryOtherResult.Error);
                }

                //更新配偶爱情宣言到数据库
                MarryFuBenMgr.UpdateMarriageData2DB(client.ClientData.MyMarriageData.nSpouseID, SpouseMarriageData, client);
            }
            return(MarryOtherResult.Success);
        }
Esempio n. 7
0
 public bool destroy()
 {
     GlobalEventSource.getInstance().removeListener(18, MarryFuBenMgr.getInstance());
     GlobalEventSource.getInstance().removeListener(12, MarryFuBenMgr.getInstance());
     if (null != this.MarriageInstanceDic)
     {
         lock (this.MarriageInstanceDic)
         {
             this.MarriageInstanceDic.Clear();
         }
     }
     MarriageOtherLogic.getInstance().destroy();
     return(true);
 }
        public static void destroy()
        {
            ZhanMengShiJianManager.getInstance().destroy();
            JingJiChangManager.getInstance().destroy();
            LiXianBaiTanManager.getInstance().destroy();
            LiXianGuaJiManager.getInstance().destroy();
            CmdRegisterTriggerManager.getInstance().destroy();
            SendCmdManager.getInstance().destroy();
            BossAIManager.getInstance().destroy();
            SaleManager.getInstance().destroy();
            LianZhiManager.GetInstance().destroy();
            ChengJiuManager.GetInstance().destroy();
            PrestigeMedalManager.getInstance().destroy();
            UnionPalaceManager.getInstance().destroy();
            UserActivateManager.getInstance().destroy();
            PetSkillManager.getInstance().destroy();
            UserReturnManager.getInstance().destroy();
            OlympicsManager.getInstance().destroy();
            TalentManager.getInstance().destroy();
            TodayManager.getInstance().destroy();
            FundManager.getInstance().destroy();
            WarnManager.getInstance().destroy();
            MarryFuBenMgr.getInstance().destroy();
            BuildingManager.getInstance().destroy();
            OnePieceManager.getInstance().destroy();
            TenManager.getInstance().destroy();
            SingletonTemplate <SevenDayActivityMgr> .Instance().destroy();

            SingletonTemplate <SoulStoneManager> .Instance().destroy();

            lock (GlobalServiceManager.Scene2ManagerDict)
            {
                foreach (List <IManager> list in GlobalServiceManager.Scene2ManagerDict.Values)
                {
                    foreach (IManager i in list)
                    {
                        try
                        {
                            i.destroy();
                        }
                        catch (Exception ex)
                        {
                            LogManager.WriteException(ex.ToString());
                        }
                    }
                }
            }
            FaceBookManager.getInstance().destroy();
        }
Esempio n. 9
0
        public MarryOtherResult ChangeMarriageMessage(GameClient client, string strMessage)
        {
            MarryOtherResult result;

            if (-1 == client.ClientData.MyMarriageData.byMarrytype)
            {
                result = MarryOtherResult.NotMarriaged;
            }
            else if (strMessage.Length >= 64)
            {
                result = MarryOtherResult.MessageLimit;
            }
            else
            {
                client.ClientData.MyMarriageData.strLovemessage = strMessage;
                MarryFuBenMgr.UpdateMarriageData2DB(client);
                this.SendMarriageDataToClient(client, true);
                GameClient Spouseclient = GameManager.ClientMgr.FindClient(client.ClientData.MyMarriageData.nSpouseID);
                if (null != Spouseclient)
                {
                    Spouseclient.ClientData.MyMarriageData.strLovemessage = strMessage;
                    MarryFuBenMgr.UpdateMarriageData2DB(Spouseclient);
                    this.SendMarriageDataToClient(Spouseclient, true);
                }
                else
                {
                    string       tcpstring          = string.Format("{0}", client.ClientData.MyMarriageData.nSpouseID);
                    MarriageData SpouseMarriageData = Global.sendToDB <MarriageData, string>(10186, tcpstring, client.ServerId);
                    if (SpouseMarriageData == null || -1 == SpouseMarriageData.byMarrytype)
                    {
                        return(MarryOtherResult.Error);
                    }
                    MarryFuBenMgr.UpdateMarriageData2DB(client.ClientData.MyMarriageData.nSpouseID, SpouseMarriageData, client);
                }
                result = MarryOtherResult.Success;
            }
            return(result);
        }
Esempio n. 10
0
        /// <summary>
        /// 提升奉献值
        /// </summary>
        public void UpdateMarriageGoodWill(GameClient client, int addGoodwillValue)
        {
            //功能未开启
            if (!MarryLogic.IsVersionSystemOpenOfMarriage())
            {
                return;
            }

            //看看是不是情侣
            if (client.ClientData.MyMarriageData.byMarrytype == -1)
            {
                return;
            }

            //不加也不减直接无视吧
            if (addGoodwillValue == 0)
            {
                return;
            }

            sbyte tmpGoodwilllv   = client.ClientData.MyMarriageData.byGoodwilllevel;
            sbyte tmpGoodwillstar = client.ClientData.MyMarriageData.byGoodwillstar;

            //加值前先检查当前阶级是否已达上限 到达上限不加
            if (tmpGoodwilllv == byMaxGoodwillLv &&
                tmpGoodwillstar == byMaxGoodwillStar)
            {
                return;
            }

            //加值
            client.ClientData.MyMarriageData.nGoodwillexp += addGoodwillValue;

            //用当前经验值增加上该阶级和星级应该有的经验
            int nNowLvAddExp = GoodwillAllExpList[(tmpGoodwilllv - 1) * byMaxGoodwillStar + tmpGoodwillstar];

            client.ClientData.MyMarriageData.nGoodwillexp += nNowLvAddExp;

            bool bUpdateLv   = false;
            bool bUpdateStar = false;

            //看看当前经验达到哪一级 直接设上去
            for (int i = 1; i < GoodwillAllExpList.Count; ++i)
            {
                //超过最后一项表示满级满星了
                if (i == GoodwillAllExpList.Count - 1 && client.ClientData.MyMarriageData.nGoodwillexp >= GoodwillAllExpList[i])
                {
                    client.ClientData.MyMarriageData.byGoodwilllevel = byMaxGoodwillLv;
                    client.ClientData.MyMarriageData.byGoodwillstar  = byMaxGoodwillStar;

                    bUpdateStar = true;

                    //设定到最大经验
                    client.ClientData.MyMarriageData.nGoodwillexp = GoodwillAllExpList[i] - GoodwillAllExpList[i - 1];
                }
                else if (client.ClientData.MyMarriageData.nGoodwillexp < GoodwillAllExpList[i])
                {
                    int nLv   = 0;
                    int nStar = 0;

                    //1阶情况
                    if (i <= byMaxGoodwillStar + 1)
                    {
                        nLv   = 1;
                        nStar = i - 1;
                    }
                    else
                    {
                        nLv   = (i - 2) / byMaxGoodwillStar + 1;
                        nStar = (i - 1) % byMaxGoodwillStar;
                        if (nStar == 0)
                        {
                            nStar = 10;
                        }
                    }

                    if (nLv != tmpGoodwilllv)
                    {
                        bUpdateLv = true;
                    }
                    if (nStar != tmpGoodwillstar)
                    {
                        bUpdateStar = true;
                    }

                    client.ClientData.MyMarriageData.byGoodwilllevel = (sbyte)nLv;
                    client.ClientData.MyMarriageData.byGoodwillstar  = (sbyte)nStar;

                    //发送客户端和记录数据库时清掉多余的经验部分 例如66点经验 - 当前阶级总共60点经验后剩 6 记录数据
                    client.ClientData.MyMarriageData.nGoodwillexp -= GoodwillAllExpList[i - 1];

                    break;
                }
            }

            //[bing] 更新时间
            if (true == bUpdateLv || true == bUpdateStar)
            {
                client.ClientData.MyMarriageData.ChangTime = TimeUtil.NowDateTime().ToString("yyyy-MM-dd HH:mm:ss");
            }

            //发送给DB update数据
            MarryFuBenMgr.UpdateMarriageData2DB(client);

            //更新婚戒属性
            if (true == bUpdateLv || true == bUpdateStar)
            {
                UpdateRingAttr(client, true);
            }

            //发送给客户端更新数据
            SendMarriageDataToClient(client, (true == bUpdateLv || true == bUpdateStar));

            if (true == bUpdateLv)
            {
                //[bing] 刷新客户端活动叹号
                if (client._IconStateMgr.CheckJieRiFanLi(client, ActivityTypes.JieriMarriage) == true ||
                    client._IconStateMgr.CheckSpecialActivity(client))
                {
                    client._IconStateMgr.AddFlushIconState((ushort)ActivityTipTypes.JieRiActivity, client._IconStateMgr.IsAnyJieRiTipActived());
                    client._IconStateMgr.SendIconStateToClient(client);
                }
            }

            if (addGoodwillValue > 0)
            {
                string strHint = StringUtil.substitute(Global.GetLang("你获得了:{0}点奉献度"), addGoodwillValue);
                GameManager.ClientMgr.NotifyImportantMsg(client, strHint, GameInfoTypeIndexes.Normal, ShowGameInfoTypes.PiaoFuZi);
            }
        }
Esempio n. 11
0
        public static MarryResult MarryDivorce(GameClient client, MarryDivorceType divorceType)
        {
            MarryResult result;

            if (!MarryLogic.IsVersionSystemOpenOfMarriage())
            {
                result = MarryResult.NotOpen;
            }
            else if (0 >= client.ClientData.MyMarriageData.byMarrytype)
            {
                result = MarryResult.NotMarried;
            }
            else if (!SingletonTemplate <CoupleArenaManager> .Instance().IsNowCanDivorce(TimeUtil.NowDateTime()))
            {
                result = MarryResult.DeniedByCoupleAreanTime;
            }
            else
            {
                int        spouseID     = client.ClientData.MyMarriageData.nSpouseID;
                GameClient spouseClient = GameManager.ClientMgr.FindClient(spouseID);
                if (divorceType == MarryDivorceType.DivorceForce || divorceType == MarryDivorceType.DivorceFree || divorceType == MarryDivorceType.DivorceFreeAccept)
                {
                    if (client.ClientData.ExchangeID > 0 || client.ClientSocket.IsKuaFuLogin || client.ClientData.CopyMapID > 0)
                    {
                        return(MarryResult.SelfBusy);
                    }
                    if (-1 != client.ClientData.FuBenID && MapTypes.MarriageCopy == Global.GetMapType(client.ClientData.MapCode))
                    {
                        return(MarryResult.SelfBusy);
                    }
                    if (null != spouseClient)
                    {
                        if (-1 != spouseClient.ClientData.FuBenID && MapTypes.MarriageCopy == Global.GetMapType(spouseClient.ClientData.MapCode))
                        {
                            return(MarryResult.TargetBusy);
                        }
                    }
                    if (divorceType == MarryDivorceType.DivorceForce || divorceType == MarryDivorceType.DivorceFree)
                    {
                        if (MarryLogic.ApplyExist(client.ClientData.RoleID))
                        {
                            return(MarryResult.SelfBusy);
                        }
                    }
                }
                int _man  = client.ClientData.RoleID;
                int _wife = spouseID;
                if (client.ClientData.MyMarriageData.byMarrytype == 2)
                {
                    DataHelper2.Swap <int>(ref _man, ref _wife);
                }
                if (divorceType == MarryDivorceType.DivorceForce)
                {
                    if (client.ClientData.UserMoney < MarryLogic.DivorceForceCost)
                    {
                        return(MarryResult.MoneyNotEnough);
                    }
                    if (!SingletonTemplate <CoupleWishManager> .Instance().PreClearDivorceData(_man, _wife))
                    {
                        return(MarryResult.NotOpen);
                    }
                    if (!SingletonTemplate <CoupleArenaManager> .Instance().PreClearDivorceData(_man, _wife))
                    {
                        return(MarryResult.NotOpen);
                    }
                    if (!GameManager.ClientMgr.SubUserMoney(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, client, MarryLogic.DivorceForceCost, "强制离婚", false, true, false, DaiBiSySType.None))
                    {
                    }
                    client.ClientData.MyMarriageData.byMarrytype = -1;
                    client.ClientData.MyMarriageData.nSpouseID   = -1;
                    MarryFuBenMgr.UpdateMarriageData2DB(client);
                    MarriageOtherLogic.getInstance().ResetRingAttr(client);
                    if (null != spouseClient)
                    {
                        spouseClient.ClientData.MyMarriageData.nSpouseID   = -1;
                        spouseClient.ClientData.MyMarriageData.byMarrytype = -1;
                        MarryFuBenMgr.UpdateMarriageData2DB(spouseClient);
                        MarriageOtherLogic.getInstance().ResetRingAttr(spouseClient);
                        MarriageOtherLogic.getInstance().SendMarriageDataToClient(spouseClient, true);
                        if (spouseClient._IconStateMgr.CheckJieRiFanLi(spouseClient, ActivityTypes.JieriMarriage))
                        {
                            spouseClient._IconStateMgr.AddFlushIconState(14000, spouseClient._IconStateMgr.IsAnyJieRiTipActived());
                            spouseClient._IconStateMgr.SendIconStateToClient(spouseClient);
                        }
                    }
                    else
                    {
                        string       tcpstring          = string.Format("{0}", spouseID);
                        MarriageData spouseMarriageData = Global.sendToDB <MarriageData, string>(10186, tcpstring, client.ServerId);
                        if (spouseMarriageData != null && 0 < spouseMarriageData.byMarrytype)
                        {
                            spouseMarriageData.byMarrytype = -1;
                            spouseMarriageData.nSpouseID   = -1;
                            MarryFuBenMgr.UpdateMarriageData2DB(spouseID, spouseMarriageData, client);
                        }
                    }
                    MarryPartyLogic.getInstance().MarryPartyRemove(client.ClientData.RoleID, true, client);
                    MarryPartyLogic.getInstance().MarryPartyRemove(spouseID, true, client);
                    MarriageOtherLogic.getInstance().SendMarriageDataToClient(client, true);
                    if (client._IconStateMgr.CheckJieRiFanLi(client, ActivityTypes.JieriMarriage))
                    {
                        client._IconStateMgr.AddFlushIconState(14000, client._IconStateMgr.IsAnyJieRiTipActived());
                        client._IconStateMgr.SendIconStateToClient(client);
                    }
                    string msg = string.Format(GLang.GetLang(486, new object[0]), client.ClientData.RoleName);
                    MarryLogic.SendDivorceMail(spouseID, GLang.GetLang(487, new object[0]), msg, spouseClient, client.ServerId);
                    SingletonTemplate <CoupleArenaManager> .Instance().OnDivorce(client.ClientData.RoleID, spouseID);
                }
                else if (divorceType == MarryDivorceType.DivorceFree)
                {
                    if (null == spouseClient)
                    {
                        return(MarryResult.TargetOffline);
                    }
                    if (spouseClient.ClientData.ExchangeID > 0 || spouseClient.ClientSocket.IsKuaFuLogin || spouseClient.ClientData.CopyMapID > 0)
                    {
                        return(MarryResult.TargetBusy);
                    }
                    if (Global.GetTotalBindTongQianAndTongQianVal(client) < MarryLogic.DivorceCost)
                    {
                        return(MarryResult.MoneyNotEnough);
                    }
                    if (!Global.SubBindTongQianAndTongQian(client, MarryLogic.DivorceCost, "申请离婚"))
                    {
                        return(MarryResult.MoneyNotEnough);
                    }
                    MarryLogic.AddMarryApply(client.ClientData.RoleID, MarryApplyType.ApplyDivorce, spouseID);
                    string notifyData = string.Format("{0}:{1}", client.ClientData.RoleID, 1);
                    spouseClient.sendCmd(892, notifyData, false);
                    SingletonTemplate <CoupleArenaManager> .Instance().OnSpouseRequestDivorce(spouseClient, client);
                }
                else
                {
                    if (null == spouseClient)
                    {
                        return(MarryResult.TargetOffline);
                    }
                    if (!MarryLogic.RemoveMarryApply(spouseID, MarryApplyType.ApplyDivorce))
                    {
                        return(MarryResult.ApplyTimeout);
                    }
                    MarryLogic.RemoveMarryApply(spouseID, MarryApplyType.ApplyNull);
                    if (divorceType == MarryDivorceType.DivorceFreeAccept)
                    {
                        if (SingletonTemplate <CoupleWishManager> .Instance().PreClearDivorceData(_man, _wife) && SingletonTemplate <CoupleArenaManager> .Instance().PreClearDivorceData(_man, _wife))
                        {
                            client.ClientData.MyMarriageData.byMarrytype       = -1;
                            client.ClientData.MyMarriageData.nSpouseID         = -1;
                            spouseClient.ClientData.MyMarriageData.byMarrytype = -1;
                            spouseClient.ClientData.MyMarriageData.nSpouseID   = -1;
                            MarryFuBenMgr.UpdateMarriageData2DB(client);
                            MarryFuBenMgr.UpdateMarriageData2DB(spouseClient);
                            MarriageOtherLogic.getInstance().SendMarriageDataToClient(client, true);
                            MarriageOtherLogic.getInstance().SendMarriageDataToClient(spouseClient, true);
                            MarriageOtherLogic.getInstance().ResetRingAttr(client);
                            MarriageOtherLogic.getInstance().ResetRingAttr(spouseClient);
                            MarryPartyLogic.getInstance().MarryPartyRemove(client.ClientData.RoleID, true, client);
                            MarryPartyLogic.getInstance().MarryPartyRemove(spouseID, true, client);
                            if (client._IconStateMgr.CheckJieRiFanLi(client, ActivityTypes.JieriMarriage))
                            {
                                client._IconStateMgr.AddFlushIconState(14000, client._IconStateMgr.IsAnyJieRiTipActived());
                                client._IconStateMgr.SendIconStateToClient(client);
                            }
                            if (spouseClient._IconStateMgr.CheckJieRiFanLi(spouseClient, ActivityTypes.JieriMarriage))
                            {
                                spouseClient._IconStateMgr.AddFlushIconState(14000, spouseClient._IconStateMgr.IsAnyJieRiTipActived());
                                spouseClient._IconStateMgr.SendIconStateToClient(spouseClient);
                            }
                            SingletonTemplate <CoupleArenaManager> .Instance().OnDivorce(client.ClientData.RoleID, spouseID);
                        }
                        else
                        {
                            GameManager.ClientMgr.AddMoney1(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, spouseClient, MarryLogic.DivorceCost, "自由离婚拒绝返还绑金", false);
                            GameManager.ClientMgr.NotifyImportantMsg(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client, StringUtil.substitute(GLang.GetLang(488, new object[0]), new object[0]), GameInfoTypeIndexes.Error, ShowGameInfoTypes.ErrAndBox, 0);
                            GameManager.ClientMgr.NotifyImportantMsg(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, spouseClient, StringUtil.substitute(GLang.GetLang(488, new object[0]), new object[0]), GameInfoTypeIndexes.Error, ShowGameInfoTypes.ErrAndBox, 0);
                        }
                    }
                    else if (divorceType == MarryDivorceType.DivorceFreeReject)
                    {
                        GameManager.ClientMgr.AddMoney1(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, spouseClient, MarryLogic.DivorceCost, "自由离婚拒绝返还绑金", false);
                        string notifyData = string.Format("{0}:{1}", client.ClientData.RoleID, 3);
                        spouseClient.sendCmd(892, notifyData, false);
                    }
                }
                result = MarryResult.Success;
            }
            return(result);
        }
Esempio n. 12
0
        public static MarryResult MarryReply(GameClient client, int sourceID, int accept)
        {
            MarryResult result;

            if (!MarryLogic.IsVersionSystemOpenOfMarriage())
            {
                result = MarryResult.NotOpen;
            }
            else if (client.ClientData.MyMarriageData.byMarrytype > 0)
            {
                result = MarryResult.SelfMarried;
            }
            else
            {
                GameClient sourceClient = GameManager.ClientMgr.FindClient(sourceID);
                if (sourceClient == null)
                {
                    result = MarryResult.ApplyTimeout;
                }
                else if (sourceClient.ClientData.MyMarriageData.byMarrytype > 0)
                {
                    result = MarryResult.TargetMarried;
                }
                else if (!MarryLogic.RemoveMarryApply(sourceID, MarryApplyType.ApplyInit))
                {
                    result = MarryResult.ApplyTimeout;
                }
                else
                {
                    if (!client.ClientData.IsMainOccupation || !sourceClient.ClientData.IsMainOccupation)
                    {
                        accept = 0;
                    }
                    if (accept == 0 || client.ClientData.MyMarriageData.byAutoReject == 1)
                    {
                        string notifyData = string.Format("{0}:{1}:{2}", 1, client.ClientData.RoleID, client.ClientData.RoleName);
                        sourceClient.sendCmd(894, notifyData, false);
                        GameManager.ClientMgr.AddUserMoney(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, sourceClient, MarryLogic.MarryCost, "求婚被拒绝返还钻石", ActivityTypes.None, "");
                    }
                    else
                    {
                        MarryLogic.RemoveMarryApply(sourceID, MarryApplyType.ApplyNull);
                        MarryLogic.ApplyLogoutClear(client);
                        MarryLogic.RemoveMarryApply(client.ClientData.RoleID, MarryApplyType.ApplyNull);
                        int initRingID = 0;
                        if (null != MarriageOtherLogic.getInstance().WeddingRingDic.SystemXmlItemDict)
                        {
                            initRingID = MarriageOtherLogic.getInstance().WeddingRingDic.SystemXmlItemDict.Keys.First <int>();
                        }
                        if (sourceClient.ClientData.MyMarriageData.nRingID <= 0)
                        {
                            sourceClient.ClientData.MyMarriageData.nRingID = initRingID;
                        }
                        if (client.ClientData.MyMarriageData.nRingID <= 0)
                        {
                            client.ClientData.MyMarriageData.nRingID = initRingID;
                        }
                        sbyte sourceType = (sbyte)(sourceClient.ClientData.RoleSex != 1 || client.ClientData.RoleSex == sourceClient.ClientData.RoleSex ? 1 : 2);
                        sourceClient.ClientData.MyMarriageData.byMarrytype = sourceType;
                        client.ClientData.MyMarriageData.byMarrytype       = (sbyte)(sourceType == 1 ? 2 : 1);
                        sourceClient.ClientData.MyMarriageData.nSpouseID   = client.ClientData.RoleID;
                        client.ClientData.MyMarriageData.nSpouseID         = sourceID;
                        if (sourceClient.ClientData.MyMarriageData.byGoodwilllevel == 0)
                        {
                            sourceClient.ClientData.MyMarriageData.ChangTime       = TimeUtil.NowDateTime().ToString("yyyy-MM-dd HH:mm:ss");
                            sourceClient.ClientData.MyMarriageData.byGoodwilllevel = 1;
                        }
                        if (client.ClientData.MyMarriageData.byGoodwilllevel == 0)
                        {
                            client.ClientData.MyMarriageData.ChangTime       = TimeUtil.NowDateTime().ToString("yyyy-MM-dd HH:mm:ss");
                            client.ClientData.MyMarriageData.byGoodwilllevel = 1;
                        }
                        EventLogManager.AddRingBuyEvent(sourceClient, 0, initRingID, 0, 0, 0, 1, "");
                        EventLogManager.AddRingBuyEvent(client, 0, initRingID, 0, 0, 0, 1, "");
                        MarryFuBenMgr.UpdateMarriageData2DB(sourceClient);
                        MarryFuBenMgr.UpdateMarriageData2DB(client);
                        MarriageOtherLogic.getInstance().SendMarriageDataToClient(sourceClient, true);
                        MarriageOtherLogic.getInstance().SendMarriageDataToClient(client, true);
                        MarriageOtherLogic.getInstance().UpdateRingAttr(sourceClient, true, false);
                        if (client._IconStateMgr.CheckJieRiFanLi(client, ActivityTypes.JieriMarriage))
                        {
                            client._IconStateMgr.AddFlushIconState(14000, client._IconStateMgr.IsAnyJieRiTipActived());
                            client._IconStateMgr.SendIconStateToClient(client);
                        }
                        if (sourceClient._IconStateMgr.CheckJieRiFanLi(sourceClient, ActivityTypes.JieriMarriage))
                        {
                            sourceClient._IconStateMgr.AddFlushIconState(14000, sourceClient._IconStateMgr.IsAnyJieRiTipActived());
                            sourceClient._IconStateMgr.SendIconStateToClient(sourceClient);
                        }
                        FriendData friendData = Global.FindFriendData(client, sourceID);
                        if (friendData != null && friendData.FriendType != 0)
                        {
                            GameManager.ClientMgr.RemoveFriend(Global._TCPManager, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, client, friendData.DbID);
                            friendData = null;
                        }
                        if (friendData == null)
                        {
                            GameManager.ClientMgr.AddFriend(Global._TCPManager, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, client, -1, sourceID, Global.FormatRoleName(sourceClient, sourceClient.ClientData.RoleName), 0);
                        }
                        friendData = Global.FindFriendData(sourceClient, client.ClientData.RoleID);
                        if (friendData != null && friendData.FriendType != 0)
                        {
                            GameManager.ClientMgr.RemoveFriend(Global._TCPManager, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, sourceClient, friendData.DbID);
                            friendData = null;
                        }
                        if (friendData == null)
                        {
                            GameManager.ClientMgr.AddFriend(Global._TCPManager, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, sourceClient, -1, client.ClientData.RoleID, Global.FormatRoleName(client, client.ClientData.RoleName), 0);
                        }
                        string broadCastMsg = string.Format(GLang.GetLang(485, new object[0]), sourceClient.ClientData.RoleName, client.ClientData.RoleName);
                        Global.BroadcastRoleActionMsg(client, RoleActionsMsgTypes.Bulletin, broadCastMsg, true, GameInfoTypeIndexes.Hot, ShowGameInfoTypes.OnlySysHint, 0, 0, 100, 100);
                        SingletonTemplate <CoupleArenaManager> .Instance().OnMarry(sourceClient, client);
                    }
                    result = MarryResult.Success;
                }
            }
            return(result);
        }
Esempio n. 13
0
        public static void initialize()
        {
#if BetaConfig
            int round = 9;
            Console.WriteLine("连接调试器或按任意键继续");
            do
            {
                Console.Write("\b\b" + round);
                if (Console.KeyAvailable)
                {
                    break;
                }
                Thread.Sleep(1000);
            } while (--round > 0);
            Console.Write("\b\b");
#endif
            //战盟事件管理器
            ZhanMengShiJianManager.getInstance().initialize();

            //竞技场管理器
            JingJiChangManager.getInstance().initialize();

            //离线摆摊
            LiXianBaiTanManager.getInstance().initialize();

            //离线挂机
            LiXianGuaJiManager.getInstance().initialize();

            //副本活动组队管理器
            CopyTeamManager.Instance().initialize();

            //指令注册管理器
            CmdRegisterTriggerManager.getInstance().initialize();

            //发送指令管理
            SendCmdManager.getInstance().initialize();

            //Boss AI管理器
            BossAIManager.getInstance().initialize();

            //洗炼管理器
            WashPropsManager.initialize();

            //MU交易所
            SaleManager.getInstance().initialize();

            //炼制系统
            LianZhiManager.GetInstance().initialize();

            // 成就升级
            ChengJiuManager.GetInstance().initialize();

            //声望勋章
            PrestigeMedalManager.getInstance().initialize();

            UnionPalaceManager.getInstance().initialize();
            UserActivateManager.getInstance().initialize();

            PetSkillManager.getInstance().initialize();

            //玩家召回
            UserReturnManager.getInstance().initialize();

            //天赋
            TalentManager.getInstance().initialize();

            //每日专享
            TodayManager.getInstance().initialize();

            FundManager.getInstance().initialize();

            //警告
            WarnManager.getInstance().initialize();

            //恶魔来袭
            EMoLaiXiCopySceneManager.LoadEMoLaiXiCopySceneInfo();

            //罗兰法阵副本
            LuoLanFaZhenCopySceneManager.initialize();

            //情侣副本管理器
            MarryFuBenMgr.getInstance().initialize();
            MarryLogic.LoadMarryBaseConfig();
            MarryPartyLogic.getInstance().LoadMarryPartyConfig();

            //领地
            BuildingManager.getInstance().initialize();

            // 藏宝秘境
            OnePieceManager.getInstance().initialize();

            //初始化跨服相关管理器
            RegisterManager4Scene((int)SceneUIClasses.Normal, KuaFuManager.getInstance());
            // RegisterManager4Scene((int)SceneUIClasses.LangHunLingYu, LangHunLingYuManager.getInstance());

            //注册罗兰城战管理器
            RegisterManager4Scene((int)SceneUIClasses.LuoLanChengZhan, LuoLanChengZhanManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.Normal, FashionManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.HuanYingSiYuan, HuanYingSiYuanManager.getInstance());
            RegisterManager4Scene((int)ManagerTypes.ClientGoodsList, JingLingQiYuanManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.TianTi, TianTiManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.YongZheZhanChang, YongZheZhanChangManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.KingOfBattle, KingOfBattleManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.MoRiJudge, MoRiJudgeManager.Instance());
            RegisterManager4Scene((int)SceneUIClasses.ElementWar, ElementWarManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.CopyWolf, CopyWolfManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.KuaFuBoss, KuaFuBossManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.KuaFuMap, KuaFuMapManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.Spread, SpreadManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.KFZhengBa, ZhengBaManager.Instance());
            RegisterManager4Scene((int)SceneUIClasses.CoupleArena, CoupleArenaManager.Instance());
            RegisterManager4Scene((int)SceneUIClasses.Ally, AllyManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.CoupleWish, CoupleWishManager.Instance());

            // 读取外挂列表和相关配置
            RobotTaskValidator.getInstance().Initialize(false, 0, 0, "");

            //初始化圣物系统相关配置
            HolyItemManager.getInstance().Initialize();

            //初始化塔罗牌相关配置
            TarotManager.getInstance().Initialize();

            // 七日活动
            SevenDayActivityMgr.Instance().initialize();

            // 魂石
            SoulStoneManager.Instance().initialize();

            TradeBlackManager.Instance().LoadConfig();
            //调用所有注册的管理模块的初始化函数
            lock (Scene2ManagerDict)
            {
                foreach (var list in Scene2ManagerDict.Values)
                {
                    foreach (var m in list)
                    {
                        bool      success = m.initialize();
                        IManager2 m2      = m as IManager2;
                        if (null != m2)
                        {
                            success = success && m2.initialize(GameCoreInterface.getinstance());
                        }

                        if (GameManager.ServerStarting && !success)
                        {
                            LogManager.WriteLog(LogTypes.Fatal, string.Format("执行{0}.initialize()失败,按任意键继续启动!", m.GetType()));
                            //Console.ReadKey(); HX_SERVER close the copy scenes;
                        }
                    }
                }
            }

            //应用宝
            TenManager.getInstance().initialize();
            TenRetutnManager.getInstance().initialize();

            //礼包码
            GiftCodeNewManager.getInstance().initialize();
        }
Esempio n. 14
0
        public static void destroy()
        {
            //战盟事件管理器
            ZhanMengShiJianManager.getInstance().destroy();

            //竞技场管理器
            JingJiChangManager.getInstance().destroy();

            //离线摆摊
            LiXianBaiTanManager.getInstance().destroy();

            //离线挂机
            LiXianGuaJiManager.getInstance().destroy();

            //副本活动组队管理器
            CopyTeamManager.Instance().destroy();

            //指令注册管理器
            CmdRegisterTriggerManager.getInstance().destroy();

            //发送指令管理
            SendCmdManager.getInstance().destroy();

            //Boss AI管理器
            BossAIManager.getInstance().destroy();

            //MU交易所
            SaleManager.getInstance().destroy();

            //炼制系统
            LianZhiManager.GetInstance().destroy();

            // 成就升级
            ChengJiuManager.GetInstance().destroy();

            //声望勋章
            PrestigeMedalManager.getInstance().destroy();

            UnionPalaceManager.getInstance().destroy();
            UserActivateManager.getInstance().destroy();

            PetSkillManager.getInstance().destroy();

            //玩家召回
            UserReturnManager.getInstance().destroy();

            //天赋
            TalentManager.getInstance().destroy();

            //每日专享
            TodayManager.getInstance().destroy();

            FundManager.getInstance().destroy();

            WarnManager.getInstance().destroy();

            //情侣副本管理器
            MarryFuBenMgr.getInstance().destroy();

            //领地
            BuildingManager.getInstance().destroy();

            //藏宝秘境
            OnePieceManager.getInstance().destroy();

            TenManager.getInstance().destroy();

            // 七日活动
            SevenDayActivityMgr.Instance().destroy();

            SoulStoneManager.Instance().destroy();

            //调用所有注册的管理模块的销毁函数
            lock (Scene2ManagerDict)
            {
                foreach (var list in Scene2ManagerDict.Values)
                {
                    foreach (var m in list)
                    {
                        m.destroy();
                    }
                }
            }
        }
Esempio n. 15
0
 public static bool UpdateMarriageData2DB(GameClient client)
 {
     return(MarryFuBenMgr.UpdateMarriageData2DB(client.ClientData.RoleID, client.ClientData.MyMarriageData, client));
 }
Esempio n. 16
0
        /// <summary>
        /// 离婚
        /// </summary>
        public static MarryResult MarryDivorce(GameClient client, MarryDivorceType divorceType)
        {
            if (!MarryLogic.IsVersionSystemOpenOfMarriage())
            {
                return(MarryResult.NotOpen);
            }

            if (0 >= client.ClientData.MyMarriageData.byMarrytype)
            {
                return(MarryResult.NotMarried);
            }

            if (!CoupleArenaManager.Instance().IsNowCanDivorce(TimeUtil.NowDateTime()))
            {
                return(MarryResult.DeniedByCoupleAreanTime);
            }

            int        spouseID     = client.ClientData.MyMarriageData.nSpouseID;
            GameClient spouseClient = GameManager.ClientMgr.FindClient(spouseID);

            if (divorceType == MarryDivorceType.DivorceForce || divorceType == MarryDivorceType.DivorceFree || divorceType == MarryDivorceType.DivorceFreeAccept)
            {
                if (client.ClientData.ExchangeID > 0 || true == client.ClientSocket.IsKuaFuLogin || client.ClientData.CopyMapID > 0)
                {
                    return(MarryResult.SelfBusy);
                }
                if (-1 != client.ClientData.FuBenID && MapTypes.MarriageCopy == Global.GetMapType(client.ClientData.MapCode))
                {
                    return(MarryResult.SelfBusy);
                }
                if (null != spouseClient)
                {
                    if (-1 != spouseClient.ClientData.FuBenID && MapTypes.MarriageCopy == Global.GetMapType(spouseClient.ClientData.MapCode))
                    {
                        return(MarryResult.TargetBusy);
                    }
                }

                if (divorceType == MarryDivorceType.DivorceForce || divorceType == MarryDivorceType.DivorceFree)
                {
                    if (true == ApplyExist(client.ClientData.RoleID))
                    {
                        return(MarryResult.SelfBusy);
                    }
                }
            }

            int _man = client.ClientData.RoleID, _wife = spouseID;

            if (client.ClientData.MyMarriageData.byMarrytype == 2)
            {
                DataHelper2.Swap(ref _man, ref _wife);;
            }

            if (divorceType == MarryDivorceType.DivorceForce)
            {
                if (client.ClientData.UserMoney < DivorceForceCost)
                {
                    return(MarryResult.MoneyNotEnough);
                }

                // 情侣竞技和情侣祝福都需要离婚清除数据,所以,可能会导致部分清除失败,由于竞技更要求数据的准确性,所以先清除情侣祝福,再清楚情侣竞技

                // 情侣祝福排行版通知清除排行数据
                // 必须保证先清除成功,才能强制离婚离婚
                if (!CoupleWishManager.Instance().PreClearDivorceData(_man, _wife))
                {
                    return(MarryResult.NotOpen);
                }

                // 情侣竞技通知中心竞技、排行数据,dbserver清除战报数据
                // 必须保证先清除成功,才能强制离婚离婚
                if (!CoupleArenaManager.Instance().PreClearDivorceData(_man, _wife))
                {
                    return(MarryResult.NotOpen);
                }

                //强制离婚
                if (false == GameManager.ClientMgr.SubUserMoney(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, client, DivorceForceCost, "强制离婚", false))
                {
                    // return MarryResult.MoneyNotEnough;
                }

                client.ClientData.MyMarriageData.byMarrytype = -1;
                client.ClientData.MyMarriageData.nSpouseID   = -1;
                MarryFuBenMgr.UpdateMarriageData2DB(client);
                MarriageOtherLogic.getInstance().ResetRingAttr(client);

                if (null != spouseClient)
                {
                    spouseClient.ClientData.MyMarriageData.nSpouseID   = -1;
                    spouseClient.ClientData.MyMarriageData.byMarrytype = -1;
                    MarryFuBenMgr.UpdateMarriageData2DB(spouseClient);
                    MarriageOtherLogic.getInstance().ResetRingAttr(spouseClient);

                    //[bing] 给配偶发送CMD_SPR_MARRY_UPDATE
                    MarriageOtherLogic.getInstance().SendMarriageDataToClient(spouseClient);

                    //[bing] 刷新客户端活动叹号
                    if (spouseClient._IconStateMgr.CheckJieRiFanLi(spouseClient, ActivityTypes.JieriMarriage) == true)
                    {
                        spouseClient._IconStateMgr.AddFlushIconState((ushort)ActivityTipTypes.JieRiActivity, spouseClient._IconStateMgr.IsAnyJieRiTipActived());
                        spouseClient._IconStateMgr.SendIconStateToClient(spouseClient);
                    }
                }
                else
                {
                    string       tcpstring          = string.Format("{0}", spouseID);
                    MarriageData spouseMarriageData = Global.sendToDB <MarriageData, string>((int)TCPGameServerCmds.CMD_DB_GET_MARRY_DATA, tcpstring, client.ServerId);

                    if (null != spouseMarriageData && 0 < spouseMarriageData.byMarrytype)
                    {
                        spouseMarriageData.byMarrytype = -1;
                        spouseMarriageData.nSpouseID   = -1;
                        MarryFuBenMgr.UpdateMarriageData2DB(spouseID, spouseMarriageData, client);
                    }
                }

                // 取消婚宴
                MarryPartyLogic.getInstance().MarryPartyRemove(client.ClientData.RoleID, true, client);
                MarryPartyLogic.getInstance().MarryPartyRemove(spouseID, true, client);

                //[bing] 给自己发送CMD_SPR_MARRY_UPDATE
                MarriageOtherLogic.getInstance().SendMarriageDataToClient(client);

                //[bing] 刷新客户端活动叹号
                if (client._IconStateMgr.CheckJieRiFanLi(client, ActivityTypes.JieriMarriage) == true)
                {
                    client._IconStateMgr.AddFlushIconState((ushort)ActivityTipTypes.JieRiActivity, client._IconStateMgr.IsAnyJieRiTipActived());
                    client._IconStateMgr.SendIconStateToClient(client);
                }

                // send mail
                string msg = string.Format(Global.GetLang("在您收到这封邮件的时候,您的伴侣{0}已经申请与您强制离婚,现在您已经恢复单身。您的定情信物将被封存,所有属性暂时失效,直至下次结婚时生效。最后,预祝您再次觅得真心人,相伴共度美好的游戏时光。感谢您阅读这封邮件。"), client.ClientData.RoleName);
                SendDivorceMail(spouseID, Global.GetLang("离婚"), msg, spouseClient, client.ServerId);

                CoupleArenaManager.Instance().OnDivorce(client.ClientData.RoleID, spouseID);
            }
            else if (divorceType == MarryDivorceType.DivorceFree)
            {
                //申请离婚
                if (null == spouseClient)
                {
                    return(MarryResult.TargetOffline);
                }
                if (spouseClient.ClientData.ExchangeID > 0 || true == spouseClient.ClientSocket.IsKuaFuLogin || spouseClient.ClientData.CopyMapID > 0)
                {
                    return(MarryResult.TargetBusy);
                }

                if (Global.GetTotalBindTongQianAndTongQianVal(client) < DivorceCost)
                {
                    return(MarryResult.MoneyNotEnough);
                }
                if (Global.SubBindTongQianAndTongQian(client, DivorceCost, "申请离婚") == false)
                {
                    return(MarryResult.MoneyNotEnough);
                }

                AddMarryApply(client.ClientData.RoleID, MarryApplyType.ApplyDivorce, spouseID);

                //发送离婚申请
                string notifyData = string.Format("{0}:{1}", client.ClientData.RoleID, (int)MarryDivorceType.DivorceFree);
                spouseClient.sendCmd((int)TCPGameServerCmds.CMD_SPR_MARRY_DIVORCE, notifyData);
                CoupleArenaManager.Instance().OnSpouseRequestDivorce(spouseClient, client);
            }
            else
            {
                if (null == spouseClient)
                {
                    return(MarryResult.TargetOffline);
                }

                if (RemoveMarryApply(spouseID, MarryApplyType.ApplyDivorce) == false)
                {
                    return(MarryResult.ApplyTimeout);
                }
                RemoveMarryApply(spouseID);

                if (divorceType == MarryDivorceType.DivorceFreeAccept)
                {
                    // 情侣竞技通知中心竞技、排行数据,dbserver清除战报数据
                    // 必须保证先清除成功,才能自由离婚
                    if (CoupleWishManager.Instance().PreClearDivorceData(_man, _wife) &&
                        CoupleArenaManager.Instance().PreClearDivorceData(_man, _wife))
                    {
                        client.ClientData.MyMarriageData.byMarrytype       = -1;
                        client.ClientData.MyMarriageData.nSpouseID         = -1;
                        spouseClient.ClientData.MyMarriageData.byMarrytype = -1;
                        spouseClient.ClientData.MyMarriageData.nSpouseID   = -1;

                        MarryFuBenMgr.UpdateMarriageData2DB(client);
                        MarryFuBenMgr.UpdateMarriageData2DB(spouseClient);

                        MarriageOtherLogic.getInstance().SendMarriageDataToClient(client);
                        MarriageOtherLogic.getInstance().SendMarriageDataToClient(spouseClient);

                        //更新婚戒属性
                        MarriageOtherLogic.getInstance().ResetRingAttr(client);
                        MarriageOtherLogic.getInstance().ResetRingAttr(spouseClient);

                        //取消婚宴
                        MarryPartyLogic.getInstance().MarryPartyRemove(client.ClientData.RoleID, true, client);
                        MarryPartyLogic.getInstance().MarryPartyRemove(spouseID, true, client);

                        //[bing] 刷新客户端活动叹号
                        if (client._IconStateMgr.CheckJieRiFanLi(client, ActivityTypes.JieriMarriage) == true)
                        {
                            client._IconStateMgr.AddFlushIconState((ushort)ActivityTipTypes.JieRiActivity, client._IconStateMgr.IsAnyJieRiTipActived());
                            client._IconStateMgr.SendIconStateToClient(client);
                        }
                        //[bing] 刷新客户端活动叹号
                        if (spouseClient._IconStateMgr.CheckJieRiFanLi(spouseClient, ActivityTypes.JieriMarriage) == true)
                        {
                            spouseClient._IconStateMgr.AddFlushIconState((ushort)ActivityTipTypes.JieRiActivity, spouseClient._IconStateMgr.IsAnyJieRiTipActived());
                            spouseClient._IconStateMgr.SendIconStateToClient(spouseClient);
                        }

                        CoupleArenaManager.Instance().OnDivorce(client.ClientData.RoleID, spouseID);
                    }
                    else
                    {
                        GameManager.ClientMgr.AddMoney1(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, spouseClient,
                                                        DivorceCost, "自由离婚拒绝返还绑金", false);
                        //GameManager.ClientMgr.AddUserYinLiang(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, spouseClient, DivorceCost, "自由离婚拒绝返还绑金");

                        Global.BroadcastRoleActionMsg(client, RoleActionsMsgTypes.HintMsg, "自由离婚操作失败", true, GameInfoTypeIndexes.Hot, ShowGameInfoTypes.OnlySysHint);
                        Global.BroadcastRoleActionMsg(spouseClient, RoleActionsMsgTypes.HintMsg, "自由离婚操作失败", true, GameInfoTypeIndexes.Hot, ShowGameInfoTypes.OnlySysHint);
                    }
                }
                else if (divorceType == MarryDivorceType.DivorceFreeReject)
                {
                    GameManager.ClientMgr.AddMoney1(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, spouseClient,
                                                    DivorceCost, "自由离婚拒绝返还绑金", false);
                    //GameManager.ClientMgr.AddUserYinLiang(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, spouseClient, DivorceCost, "自由离婚拒绝返还绑金");

                    //发送离婚拒绝讯息
                    string notifyData = string.Format("{0}:{1}", client.ClientData.RoleID, (int)MarryDivorceType.DivorceFreeReject);
                    spouseClient.sendCmd((int)TCPGameServerCmds.CMD_SPR_MARRY_DIVORCE, notifyData);
                }
            }

            return(MarryResult.Success);
        }
Esempio n. 17
0
 public void UpdateMarriageGoodWill(GameClient client, int addGoodwillValue)
 {
     if (MarryLogic.IsVersionSystemOpenOfMarriage())
     {
         if (client.ClientData.MyMarriageData.byMarrytype != -1)
         {
             if (addGoodwillValue != 0)
             {
                 sbyte tmpGoodwilllv   = client.ClientData.MyMarriageData.byGoodwilllevel;
                 sbyte tmpGoodwillstar = client.ClientData.MyMarriageData.byGoodwillstar;
                 if (tmpGoodwilllv != this.byMaxGoodwillLv || tmpGoodwillstar != this.byMaxGoodwillStar)
                 {
                     int oldLevel = (int)client.ClientData.MyMarriageData.byGoodwilllevel;
                     int oldStart = (int)client.ClientData.MyMarriageData.byGoodwillstar;
                     client.ClientData.MyMarriageData.nGoodwillexp += addGoodwillValue;
                     int nNowLvAddExp = this.GoodwillAllExpList[(int)((tmpGoodwilllv - 1) * this.byMaxGoodwillStar + tmpGoodwillstar)];
                     client.ClientData.MyMarriageData.nGoodwillexp += nNowLvAddExp;
                     bool bUpdateLv   = false;
                     bool bUpdateStar = false;
                     for (int i = 1; i < this.GoodwillAllExpList.Count; i++)
                     {
                         if (i == this.GoodwillAllExpList.Count - 1 && client.ClientData.MyMarriageData.nGoodwillexp >= this.GoodwillAllExpList[i])
                         {
                             client.ClientData.MyMarriageData.byGoodwilllevel = this.byMaxGoodwillLv;
                             client.ClientData.MyMarriageData.byGoodwillstar  = this.byMaxGoodwillStar;
                             bUpdateStar = true;
                             client.ClientData.MyMarriageData.nGoodwillexp = this.GoodwillAllExpList[i] - this.GoodwillAllExpList[i - 1];
                         }
                         else if (client.ClientData.MyMarriageData.nGoodwillexp < this.GoodwillAllExpList[i])
                         {
                             int nLv;
                             int nStar;
                             if (i <= (int)(this.byMaxGoodwillStar + 1))
                             {
                                 nLv   = 1;
                                 nStar = i - 1;
                             }
                             else
                             {
                                 nLv   = (i - 2) / (int)this.byMaxGoodwillStar + 1;
                                 nStar = (i - 1) % (int)this.byMaxGoodwillStar;
                                 if (nStar == 0)
                                 {
                                     nStar = 10;
                                 }
                             }
                             if (nLv != (int)tmpGoodwilllv)
                             {
                                 bUpdateLv = true;
                             }
                             if (nStar != (int)tmpGoodwillstar)
                             {
                                 bUpdateStar = true;
                             }
                             client.ClientData.MyMarriageData.byGoodwilllevel = (sbyte)nLv;
                             client.ClientData.MyMarriageData.byGoodwillstar  = (sbyte)nStar;
                             client.ClientData.MyMarriageData.nGoodwillexp   -= this.GoodwillAllExpList[i - 1];
                             break;
                         }
                     }
                     if (bUpdateLv || bUpdateStar)
                     {
                         client.ClientData.MyMarriageData.ChangTime = TimeUtil.NowDateTime().ToString("yyyy-MM-dd HH:mm:ss");
                     }
                     MarryFuBenMgr.UpdateMarriageData2DB(client);
                     if (bUpdateLv || bUpdateStar)
                     {
                         this.UpdateRingAttr(client, true, false);
                     }
                     this.SendMarriageDataToClient(client, bUpdateLv || bUpdateStar);
                     if (bUpdateLv)
                     {
                         if (client._IconStateMgr.CheckJieRiFanLi(client, ActivityTypes.JieriMarriage) || client._IconStateMgr.CheckSpecialActivity(client) || client._IconStateMgr.CheckEverydayActivity(client))
                         {
                             client._IconStateMgr.AddFlushIconState(14000, client._IconStateMgr.IsAnyJieRiTipActived());
                             client._IconStateMgr.SendIconStateToClient(client);
                         }
                     }
                     if (addGoodwillValue > 0)
                     {
                         string strHint = StringUtil.substitute(GLang.GetLang(490, new object[0]), new object[]
                         {
                             addGoodwillValue
                         });
                         GameManager.ClientMgr.NotifyImportantMsg(client, strHint, GameInfoTypeIndexes.Normal, ShowGameInfoTypes.PiaoFuZi, 0);
                     }
                     EventLogManager.AddRingStarSuitEvent(client, client.ClientData.MyMarriageData.nRingID, oldLevel, (int)client.ClientData.MyMarriageData.byGoodwilllevel, oldStart, (int)client.ClientData.MyMarriageData.byGoodwillstar, "");
                 }
             }
         }
     }
 }
        public static void initialize()
        {
            ZhanMengShiJianManager.getInstance().initialize();
            JingJiChangManager.getInstance().initialize();
            LiXianBaiTanManager.getInstance().initialize();
            LiXianGuaJiManager.getInstance().initialize();
            CmdRegisterTriggerManager.getInstance().initialize();
            SendCmdManager.getInstance().initialize();
            BossAIManager.getInstance().initialize();
            WashPropsManager.initialize();
            SaleManager.getInstance().initialize();
            LianZhiManager.GetInstance().initialize();
            ChengJiuManager.GetInstance().initialize();
            PrestigeMedalManager.getInstance().initialize();
            UnionPalaceManager.getInstance().initialize();
            UserActivateManager.getInstance().initialize();
            PetSkillManager.getInstance().initialize();
            UserReturnManager.getInstance().initialize();
            OlympicsManager.getInstance().initialize();
            TalentManager.getInstance().initialize();
            TodayManager.getInstance().initialize();
            FundManager.getInstance().initialize();
            WarnManager.getInstance().initialize();
            EMoLaiXiCopySceneManager.LoadEMoLaiXiCopySceneInfo();
            LuoLanFaZhenCopySceneManager.initialize();
            MarryFuBenMgr.getInstance().initialize();
            MarryLogic.LoadMarryBaseConfig();
            MarryPartyLogic.getInstance().LoadMarryPartyConfig();
            BuildingManager.getInstance().initialize();
            OnePieceManager.getInstance().initialize();
            GlobalServiceManager.RegisterManager4Scene(0, SingletonTemplate <CopyTeamManager> .Instance());
            GlobalServiceManager.RegisterManager4Scene(0, KuaFuManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(35, LangHunLingYuManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, RebornManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, RebornBoss.getInstance());
            GlobalServiceManager.RegisterManager4Scene(24, LuoLanChengZhanManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, FashionManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, OrnamentManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, ShenJiFuWenManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, YaoSaiJianYuManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, AlchemyManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, EraManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, VideoLogic.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, SpecPlatFuLiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(25, HuanYingSiYuanManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(10000, JingLingQiYuanManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(26, TianTiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(27, YongZheZhanChangManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(39, KingOfBattleManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(45, BangHuiMatchManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(48, CompManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(52, CompBattleManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(53, CompMineManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(57, ZorkBattleManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(47, KuaFuLueDuoManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, KarenBattleManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(41, KarenBattleManager_MapWest.getInstance());
            GlobalServiceManager.RegisterManager4Scene(42, KarenBattleManager_MapEast.getInstance());
            GlobalServiceManager.RegisterManager4Scene(29, SingletonTemplate <MoRiJudgeManager> .Instance());
            GlobalServiceManager.RegisterManager4Scene(28, ElementWarManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(49, WanMoXiaGuManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(34, CopyWolfManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(31, KuaFuBossManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(10003, KuaFuMapManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(10002, SpreadManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(36, SingletonTemplate <ZhengBaManager> .Instance());
            GlobalServiceManager.RegisterManager4Scene(38, SingletonTemplate <CoupleArenaManager> .Instance());
            GlobalServiceManager.RegisterManager4Scene(10004, AllyManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(10005, SingletonTemplate <CoupleWishManager> .Instance());
            GlobalServiceManager.RegisterManager4Scene(40, ZhengDuoManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, AoYunDaTiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, RoleManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, ZhuanPanManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, ShenQiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, JunTuanManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, LingDiCaiJiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, HongBaoManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, YaoSaiBossManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, YaoSaiMissionManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, HuiJiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, DeControl.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, GVoiceManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, ShenShiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, JueXingManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, ZuoQiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, ThemeBoss.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, ArmorManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, JingLingYuanSuJueXingManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, BianShenManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(55, TianTi5v5Manager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, UserRegressActiveManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, MountHolyStampManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, MazingerStoreManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, GlodAuctionProcessCmdEx.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, BoCaiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, FunctionSendManager.GetInstance());
            GlobalServiceManager.RegisterManager4Scene(0, HuanLeDaiBiManager.GetInstance());
            GlobalServiceManager.RegisterManager4Scene(0, NewTimerProc.GetInstance());
            GlobalServiceManager.RegisterManager4Scene(56, ZhanDuiZhengBaManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(59, EscapeBattleManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, TestReceiveModel.getInstance());
            RobotTaskValidator.getInstance().Initialize(false, 0, 0, "");
            HolyItemManager.getInstance().Initialize();
            TarotManager.getInstance().Initialize();
            SingletonTemplate <SevenDayActivityMgr> .Instance().initialize();

            SingletonTemplate <SoulStoneManager> .Instance().initialize();

            SingletonTemplate <TradeBlackManager> .Instance().LoadConfig();

            lock (GlobalServiceManager.Scene2ManagerDict)
            {
                foreach (List <IManager> list in GlobalServiceManager.Scene2ManagerDict.Values)
                {
                    foreach (IManager i in list)
                    {
                        bool success = true;
                        try
                        {
                            success = (success && i.initialize());
                            IManager2 m2 = i as IManager2;
                            if (null != m2)
                            {
                                success = (success && m2.initialize(GameCoreInterface.getinstance()));
                            }
                        }
                        catch (Exception ex)
                        {
                            success = false;
                            LogManager.WriteException(ex.ToString());
                        }
                        if (GameManager.ServerStarting && !success)
                        {
                            LogManager.WriteLog(LogTypes.Fatal, string.Format("执行{0}.initialize()失败,按任意键继续启动!", i.GetType()), null, true);
                            Console.ReadKey();
                        }
                    }
                }
            }
            TenManager.getInstance().initialize();
            TenRetutnManager.getInstance().initialize();
            GiftCodeNewManager.getInstance().initialize();
            FaceBookManager.getInstance().initialize();
            AssemblyPatchManager.getInstance().initialize();
            IPStatisticsManager.getInstance().initialize();
            FuMoManager.getInstance().Initialize();
        }
Esempio n. 19
0
        /// <summary>
        /// 对方回复求婚
        /// </summary>
        public static MarryResult MarryReply(GameClient client, int sourceID, int accept)
        {
            if (!MarryLogic.IsVersionSystemOpenOfMarriage())
            {
                return(MarryResult.NotOpen);
            }

            if (client.ClientData.MyMarriageData.byMarrytype > 0)
            {
                return(MarryResult.SelfMarried);
            }

            GameClient sourceClient = GameManager.ClientMgr.FindClient(sourceID);

            if (sourceClient == null)
            {
                return(MarryResult.ApplyTimeout);
            }
            if (sourceClient.ClientData.MyMarriageData.byMarrytype > 0)
            {
                return(MarryResult.TargetMarried);
            }

            if (RemoveMarryApply(sourceID, MarryApplyType.ApplyInit) == false)
            {
                return(MarryResult.ApplyTimeout);
            }

            if (accept == 0 || client.ClientData.MyMarriageData.byAutoReject == 1)
            {
                // 拒绝返钱
                string notifyData = string.Format("{0}:{1}:{2}", (int)MarryNotifyType.NotifyRejectInit, client.ClientData.RoleID, client.ClientData.RoleName);
                sourceClient.sendCmd((int)TCPGameServerCmds.CMD_SPR_MARRY_NOTIFY, notifyData);

                GameManager.ClientMgr.AddUserMoney(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, sourceClient, MarryCost, "求婚被拒绝返还钻石");
            }
            else
            {
                // 同意
                RemoveMarryApply(sourceID);

                // 如果自己在申请狀态,需取消返钱
                MarryLogic.ApplyLogoutClear(client);
                RemoveMarryApply(client.ClientData.RoleID);

                // 初始婚戒
                int initRingID = 0;
                if (null != MarriageOtherLogic.getInstance().WeddingRingDic.SystemXmlItemDict)
                {
                    initRingID = MarriageOtherLogic.getInstance().WeddingRingDic.SystemXmlItemDict.Keys.First();
                }
                if (sourceClient.ClientData.MyMarriageData.nRingID <= 0)
                {
                    sourceClient.ClientData.MyMarriageData.nRingID = initRingID;
                }
                if (client.ClientData.MyMarriageData.nRingID <= 0)
                {
                    client.ClientData.MyMarriageData.nRingID = initRingID;
                }

                // 更新婚姻狀态
                // marry type 1:丈夫 2:妻子
                sbyte sourceType = (sourceClient.ClientData.RoleSex != 1 || client.ClientData.RoleSex == sourceClient.ClientData.RoleSex)? (sbyte)1 : (sbyte)2;
                sourceClient.ClientData.MyMarriageData.byMarrytype = sourceType;
                client.ClientData.MyMarriageData.byMarrytype       = (sourceType == 1)? (sbyte)2 : (sbyte)1;

                // 更新伴侶role id
                sourceClient.ClientData.MyMarriageData.nSpouseID = client.ClientData.RoleID;
                client.ClientData.MyMarriageData.nSpouseID       = sourceID;

                // 初始化0星1阶 [bing] 因为再结婚还会走这个函数就会被初始化为1阶 应该不初始化它 是个bug 这里FIX下
                if (sourceClient.ClientData.MyMarriageData.byGoodwilllevel == 0)
                {
                    //[bing] 更新时间
                    sourceClient.ClientData.MyMarriageData.ChangTime       = TimeUtil.NowDateTime().ToString("yyyy-MM-dd HH:mm:ss");
                    sourceClient.ClientData.MyMarriageData.byGoodwilllevel = 1;
                }
                if (client.ClientData.MyMarriageData.byGoodwilllevel == 0)
                {
                    client.ClientData.MyMarriageData.ChangTime       = TimeUtil.NowDateTime().ToString("yyyy-MM-dd HH:mm:ss");
                    client.ClientData.MyMarriageData.byGoodwilllevel = 1;
                }

                MarryFuBenMgr.UpdateMarriageData2DB(sourceClient);
                MarryFuBenMgr.UpdateMarriageData2DB(client);

                MarriageOtherLogic.getInstance().SendMarriageDataToClient(sourceClient);
                MarriageOtherLogic.getInstance().SendMarriageDataToClient(client);

                //更新婚戒属性
                MarriageOtherLogic.getInstance().UpdateRingAttr(sourceClient, true);

                //[bing] 刷新客户端活动叹号
                if (client._IconStateMgr.CheckJieRiFanLi(client, ActivityTypes.JieriMarriage) == true)
                {
                    client._IconStateMgr.AddFlushIconState((ushort)ActivityTipTypes.JieRiActivity, client._IconStateMgr.IsAnyJieRiTipActived());
                    client._IconStateMgr.SendIconStateToClient(client);
                }
                //[bing] 刷新客户端活动叹号
                if (sourceClient._IconStateMgr.CheckJieRiFanLi(sourceClient, ActivityTypes.JieriMarriage) == true)
                {
                    sourceClient._IconStateMgr.AddFlushIconState((ushort)ActivityTipTypes.JieRiActivity, sourceClient._IconStateMgr.IsAnyJieRiTipActived());
                    sourceClient._IconStateMgr.SendIconStateToClient(sourceClient);
                }

                // 好友逻辑
                FriendData friendData = Global.FindFriendData(client, sourceID);
                if (friendData != null && friendData.FriendType != 0)
                {
                    GameManager.ClientMgr.RemoveFriend(Global._TCPManager, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool,
                                                       client, friendData.DbID);
                    friendData = null;
                }
                if (friendData == null)
                {
                    GameManager.ClientMgr.AddFriend(Global._TCPManager, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool,
                                                    client, -1, sourceID, Global.FormatRoleName(sourceClient, sourceClient.ClientData.RoleName), 0);
                }

                friendData = Global.FindFriendData(sourceClient, client.ClientData.RoleID);
                if (friendData != null && friendData.FriendType != 0)
                {
                    GameManager.ClientMgr.RemoveFriend(Global._TCPManager, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool,
                                                       sourceClient, friendData.DbID);
                    friendData = null;
                }
                if (friendData == null)
                {
                    GameManager.ClientMgr.AddFriend(Global._TCPManager, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool,
                                                    sourceClient, -1, client.ClientData.RoleID, Global.FormatRoleName(client, client.ClientData.RoleName), 0);
                }

                //扩播消息
                string broadCastMsg = string.Format(Global.GetLang("恭喜 {0} 和 {1} 喜结连理!"), sourceClient.ClientData.RoleName, client.ClientData.RoleName);
                Global.BroadcastRoleActionMsg(client, RoleActionsMsgTypes.Bulletin, broadCastMsg, true, GameInfoTypeIndexes.Hot, ShowGameInfoTypes.OnlySysHint);

                CoupleArenaManager.Instance().OnMarry(sourceClient, client);
            }

            return(MarryResult.Success);
        }