Пример #1
0
        /// <summary>
        /// 本服增加祝福特效
        /// </summary>
        /// <param name="from"></param>
        /// <param name="toMan"></param>
        /// <param name="toWife"></param>
        private void HandleWishEffect(CoupleWishNtfWishEffectData effectData)
        {
            if (effectData == null)
            {
                return;
            }

            int dayFlag = TimeUtil.MakeYearMonthDay(TimeUtil.NowDateTime());

            int        index  = 0;
            GameClient client = null;

            while ((client = GameManager.ClientMgr.GetNextClient(ref index)) != null)
            {
//                 if (Global.GetMapSceneType(client.ClientData.MapCode) != SceneUIClasses.Normal)
//                     continue;

                // 还未登录成功的,不发了,不然特效把客户端搞死了。
                if (client.ClientData.FirstPlayStart)
                {
                    continue;
                }

                if (!CanEffectAwardMap.Contains(client.ClientData.MapCode))
                {
                    continue;
                }

                // 只有在安全区的才能收到祝福特效
                GameMap gameMap = null;
                if (!GameManager.MapMgr.DictMaps.TryGetValue(client.ClientData.MapCode, out gameMap))
                {
                    continue;
                }

                if (!gameMap.InSafeRegionList(client.CurrentGrid))
                {
                    continue;
                }

                // TODO: 祝福特效公式尚未给出
                effectData.GetBinJinBi    = 0;
                effectData.GetBindZuanShi = 0;
                effectData.GetExp         = 0;

                EWishEffectAwardType awardType;
                int canGetMax;
                if (!GetNextCanEffectAward(client, dayFlag, out awardType, out canGetMax))
                {
                    // 仅播放祝福特效,不获得实际奖励
                    client.sendCmd((int)TCPGameServerCmds.CMD_COUPLE_WISH_NTF_WISH_EFFECT, effectData);
                    continue;
                }

                int calcKey = client.ClientData.ChangeLifeCount * 100 + client.ClientData.Level;
                int realGet = 0;
                if (awardType == EWishEffectAwardType.BangJin)
                {
                    // 绑金:400*(玩家转*100+玩家等级)
                    effectData.GetBinJinBi = Math.Max(0, Math.Min(400 * calcKey, canGetMax));
                    realGet = effectData.GetBinJinBi;
                }
                else if (awardType == EWishEffectAwardType.BangZuan)
                {
                    // 绑钻:int(0.08*(玩家转*100+玩家等级)
                    effectData.GetBindZuanShi = Math.Max(0, Math.Min((int)(0.08 * calcKey), canGetMax));
                    realGet = effectData.GetBindZuanShi;
                }
                else if (awardType == EWishEffectAwardType.Exp)
                {
                    // 经验:4000*(玩家转*100+玩家等级)
                    effectData.GetExp = Math.Max(0, Math.Min(4000 * calcKey, canGetMax));
                    realGet           = effectData.GetExp;
                }
                else
                {
                    continue;
                }

                if (effectData.GetBinJinBi > 0)
                {
                    GameManager.ClientMgr.AddMoney1(client, effectData.GetBinJinBi, "情侣祝福特效", true);
                    string tip = string.Format(Global.GetLang("【{0}】送出一生一世祝福,你获得{1}绑定金币"), effectData.From.RoleName, realGet);
                    GameManager.ClientMgr.SendSystemChatMessageToClient(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool,
                                                                        client, tip);
                }

                if (effectData.GetBindZuanShi > 0)
                {
                    GameManager.ClientMgr.AddUserGold(client, effectData.GetBindZuanShi, "情侣祝福特效");
                    string tip = string.Format(Global.GetLang("【{0}】送出一生一世祝福,你获得{1}绑定钻石"), effectData.From.RoleName, realGet);
                    GameManager.ClientMgr.SendSystemChatMessageToClient(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool,
                                                                        client, tip);
                }

                if (effectData.GetExp > 0)
                {
                    GameManager.ClientMgr.ProcessRoleExperience(client, effectData.GetExp, false);
                    GameManager.ClientMgr.NotifyAddExpMsg(client, effectData.GetExp);
                    string tip = string.Format(Global.GetLang("【{0}】送出一生一世祝福,你获得{1}经验"), effectData.From.RoleName, realGet);
                    GameManager.ClientMgr.SendSystemChatMessageToClient(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool,
                                                                        client, tip);
                }

                client.sendCmd((int)TCPGameServerCmds.CMD_COUPLE_WISH_NTF_WISH_EFFECT, effectData);
                SaveGetNextEffectAward(client, dayFlag, awardType, realGet);
            }
        }
Пример #2
0
 private void HandleWishEffect(CoupleWishNtfWishEffectData effectData)
 {
     if (effectData != null)
     {
         int        dayFlag = TimeUtil.MakeYearMonthDay(TimeUtil.NowDateTime());
         int        index   = 0;
         GameClient client;
         while ((client = GameManager.ClientMgr.GetNextClient(ref index, false)) != null)
         {
             if (!client.ClientData.FirstPlayStart)
             {
                 if (this.CanEffectAwardMap.Contains(client.ClientData.MapCode))
                 {
                     GameMap gameMap = null;
                     if (GameManager.MapMgr.DictMaps.TryGetValue(client.ClientData.MapCode, out gameMap))
                     {
                         if (gameMap.InSafeRegionList(client.CurrentGrid))
                         {
                             effectData.GetBinJinBi    = 0;
                             effectData.GetBindZuanShi = 0;
                             effectData.GetExp         = 0;
                             CoupleWishManager.EWishEffectAwardType awardType;
                             int canGetMax;
                             if (!this.GetNextCanEffectAward(client, dayFlag, out awardType, out canGetMax))
                             {
                                 client.sendCmd <CoupleWishNtfWishEffectData>(1393, effectData, false);
                             }
                             else
                             {
                                 int calcKey = client.ClientData.ChangeLifeCount * 100 + client.ClientData.Level;
                                 int realGet;
                                 if (awardType == CoupleWishManager.EWishEffectAwardType.BangJin)
                                 {
                                     effectData.GetBinJinBi = Math.Max(0, Math.Min(400 * calcKey, canGetMax));
                                     realGet = effectData.GetBinJinBi;
                                 }
                                 else if (awardType == CoupleWishManager.EWishEffectAwardType.BangZuan)
                                 {
                                     effectData.GetBindZuanShi = Math.Max(0, Math.Min((int)(0.08 * (double)calcKey), canGetMax));
                                     realGet = effectData.GetBindZuanShi;
                                 }
                                 else
                                 {
                                     if (awardType != CoupleWishManager.EWishEffectAwardType.Exp)
                                     {
                                         continue;
                                     }
                                     effectData.GetExp = Math.Max(0, Math.Min(4000 * calcKey, canGetMax));
                                     realGet           = effectData.GetExp;
                                 }
                                 if (effectData.GetBinJinBi > 0)
                                 {
                                     GameManager.ClientMgr.AddMoney1(client, effectData.GetBinJinBi, "情侣祝福特效", true);
                                     string tip = string.Format(GLang.GetLang(481, new object[0]), effectData.From.RoleName, realGet);
                                     GameManager.ClientMgr.SendSystemChatMessageToClient(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client, tip);
                                 }
                                 if (effectData.GetBindZuanShi > 0)
                                 {
                                     GameManager.ClientMgr.AddUserGold(client, effectData.GetBindZuanShi, "情侣祝福特效");
                                     string tip = string.Format(GLang.GetLang(482, new object[0]), effectData.From.RoleName, realGet);
                                     GameManager.ClientMgr.SendSystemChatMessageToClient(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client, tip);
                                 }
                                 if (effectData.GetExp > 0)
                                 {
                                     GameManager.ClientMgr.ProcessRoleExperience(client, (long)effectData.GetExp, false, true, false, "none");
                                     GameManager.ClientMgr.NotifyAddExpMsg(client, (long)effectData.GetExp);
                                     string tip = string.Format(GLang.GetLang(483, new object[0]), effectData.From.RoleName, realGet);
                                     GameManager.ClientMgr.SendSystemChatMessageToClient(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client, tip);
                                 }
                                 client.sendCmd <CoupleWishNtfWishEffectData>(1393, effectData, false);
                                 this.SaveGetNextEffectAward(client, dayFlag, awardType, realGet);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Пример #3
0
        /// <summary>
        /// 玩家请求祝福他人
        /// </summary>
        /// <param name="client"></param>
        /// <param name="nID"></param>
        /// <param name="bytes"></param>
        /// <param name="cmdParams"></param>
        private void HandleWishOtherRoleCommand(GameClient client, int nID, byte[] bytes, string[] cmdParams)
        {
            var      cliReq = DataHelper.BytesToObject <CoupleWishWishReqData>(bytes, 0, bytes.Length);
            DateTime now    = TimeUtil.NowDateTime();

            if (client.ClientSocket.IsKuaFuLogin)
            {
                client.sendCmd(nID, StdErrorCode.Error_Operation_Denied.ToString());
                return;
            }

            if (cliReq.CostType != (int)CoupleWishWishReqData.ECostType.Goods &&
                cliReq.CostType != (int)CoupleWishWishReqData.ECostType.ZuanShi)
            {
                client.sendCmd(nID, StdErrorCode.Error_Invalid_Params.ToString());
                return;
            }

            // 是否是活动时间
            int wishWeek;

            if (!_Config.IsInWishTime(now, out wishWeek))
            {
                client.sendCmd(nID, StdErrorCode.Error_Wish_In_Balance_Time.ToString());
                return;
            }

            // 祝福类型检查
            CoupleWishTypeConfig wishCfg = _Config.WishTypeCfgList.Find(_w => _w.WishType == cliReq.WishType);

            if (wishCfg == null)
            {
                client.sendCmd(nID, StdErrorCode.Error_Config_Fault.ToString());
                return;
            }

            // 道具检查
            if (cliReq.CostType == (int)CoupleWishWishReqData.ECostType.Goods &&
                wishCfg.CostGoodsId > 0 && wishCfg.CostGoodsNum > 0 &&
                Global.GetTotalGoodsCountByID(client, wishCfg.CostGoodsId) < wishCfg.CostGoodsNum)
            {
                client.sendCmd(nID, StdErrorCode.Error_Goods_Not_Enough.ToString());
                return;
            }

            // 钻石检查
            if (cliReq.CostType == (int)CoupleWishWishReqData.ECostType.ZuanShi &&
                wishCfg.CostZuanShi > 0 && client.ClientData.UserMoney < wishCfg.CostZuanShi)
            {
                client.sendCmd(nID, StdErrorCode.Error_ZuanShi_Not_Enough.ToString());
                return;
            }

            // 祝福寄语检查
            if (!string.IsNullOrEmpty(cliReq.WishTxt))
            {
                if (wishCfg.CanHaveWishTxt != 1)
                {
                    client.sendCmd(nID, StdErrorCode.Error_Cannot_Have_Wish_Txt.ToString());
                    return;
                }
                else if (cliReq.WishTxt.Length > CoupleWishConsts.MaxWishTxtLen)
                {
                    client.sendCmd(nID, StdErrorCode.Error_Wish_Txt_Length_Limit.ToString());
                    return;
                }
            }

            CoupleWishWishRoleReq centerReq = new CoupleWishWishRoleReq();

            centerReq.From.RoleId   = client.ClientData.RoleID;
            centerReq.From.ZoneId   = client.ClientData.ZoneID;
            centerReq.From.RoleName = client.ClientData.RoleName;
            centerReq.WishType      = cliReq.WishType;
            centerReq.WishTxt       = cliReq.WishTxt;

            RoleData4Selector     toManSelector  = null;
            RoleData4Selector     toWifeSelector = null;
            CoupleWishCoupleDataK rankCoupleData = null;

            if (cliReq.IsWishRankRole)
            {
                centerReq.IsWishRank = true;
                // 跨服排行榜祝福
                lock (Mutex)
                {
                    int coupleIdx;
                    if (!this.SyncData.ThisWeek.CoupleIdex.TryGetValue(cliReq.ToRankCoupleId, out coupleIdx))
                    {
                        client.sendCmd(nID, StdErrorCode.Error_Operation_Denied.ToString());
                        return;
                    }

                    rankCoupleData = this.SyncData.ThisWeek.RankList[coupleIdx];
                    if (rankCoupleData == null || rankCoupleData.DbCoupleId != cliReq.ToRankCoupleId || rankCoupleData.Rank > CoupleWishConsts.MaxRankNum * 2)
                    {
                        // 因为客户端看到的不是实时的数据,客户端看到的时候某对情侣可能处于前20名,但是当祝福的时候,可能已经不是前20名了,优化下体验,如果是前40名就允许
                        client.sendCmd(nID, StdErrorCode.Error_Operation_Denied.ToString());
                        return;
                    }

                    centerReq.ToCoupleId = cliReq.ToRankCoupleId;

                    // 赠送排行榜情侣,检测是否是本服的情侣,尝试更新角色形象
                    toManSelector = Global.sendToDB <RoleData4Selector,
                                                     string>((int)TCPGameServerCmds.CMD_SPR_GETROLEUSINGGOODSDATALIST, string.Format("{0}", rankCoupleData.Man.RoleId), client.ServerId);
                    toWifeSelector = Global.sendToDB <RoleData4Selector,
                                                      string>((int)TCPGameServerCmds.CMD_SPR_GETROLEUSINGGOODSDATALIST, string.Format("{0}", rankCoupleData.Wife.RoleId), client.ServerId);
                    if (toManSelector == null || toWifeSelector == null || toManSelector.RoleID <= 0 || toWifeSelector.RoleID <= 0)
                    {
                        toManSelector = toWifeSelector = null;
                    }
                }
            }
            else
            {
                // 本服祝福
                int toRoleId = -1;
                if (!string.IsNullOrEmpty(cliReq.ToLocalRoleName))
                {
                    toRoleId = RoleName2IDs.FindRoleIDByName(cliReq.ToLocalRoleName, true);
                }
                if (toRoleId <= 0)
                {
                    client.sendCmd(nID, StdErrorCode.Error_Wish_Player_Not_Exist.ToString());
                    return;
                }
                if (toRoleId == client.ClientData.RoleID)
                {
                    client.sendCmd(nID, StdErrorCode.Error_Cannot_Wish_Self.ToString());
                    return;
                }

                int nSpouseId = MarryLogic.GetSpouseID(toRoleId);
                if (nSpouseId <= 0)
                {
                    client.sendCmd(nID, StdErrorCode.Error_Wish_Player_Not_Marry.ToString());
                    return;
                }

                toManSelector = Global.sendToDB <RoleData4Selector,
                                                 string>((int)TCPGameServerCmds.CMD_SPR_GETROLEUSINGGOODSDATALIST, string.Format("{0}", toRoleId), client.ServerId);
                toWifeSelector = Global.sendToDB <RoleData4Selector,
                                                  string>((int)TCPGameServerCmds.CMD_SPR_GETROLEUSINGGOODSDATALIST, string.Format("{0}", nSpouseId), client.ServerId);

                if (toManSelector == null || toWifeSelector == null || toManSelector.RoleSex == toWifeSelector.RoleSex)
                {
                    client.sendCmd(nID, StdErrorCode.Error_DB_Faild.ToString());
                    return;
                }

                if (toManSelector.RoleSex == (int)ERoleSex.Girl)
                {
                    DataHelper2.Swap(ref toManSelector, ref toWifeSelector);
                }
            }

            if (toManSelector != null && toWifeSelector != null)
            {
                // 不管是排行榜赠送还是选中好友赠送,都尝试更新被赠送者形象数据
                // 排行榜赠送时,toManSelector和toWifeSelector可能都为null,或者都不为null
                // 选中好友赠送,toManSelector和toWifeSelector一定都不为null
                centerReq.ToMan.RoleId   = toManSelector.RoleID;
                centerReq.ToMan.ZoneId   = toManSelector.ZoneId;
                centerReq.ToMan.RoleName = toManSelector.RoleName;
                centerReq.ToManSelector  = DataHelper.ObjectToBytes <RoleData4Selector>(toManSelector);

                centerReq.ToWife.RoleId   = toWifeSelector.RoleID;
                centerReq.ToWife.ZoneId   = toWifeSelector.ZoneId;
                centerReq.ToWife.RoleName = toWifeSelector.RoleName;
                centerReq.ToWifeSelector  = DataHelper.ObjectToBytes <RoleData4Selector>(toWifeSelector);
            }

            int ec = TianTiClient.getInstance().CoupleWishWishRole(centerReq);

            if (ec < 0)
            {
                client.sendCmd(nID, ec.ToString());
                return;
            }

            // 扣除物品
            if (cliReq.CostType == (int)CoupleWishWishReqData.ECostType.Goods &&
                wishCfg.CostGoodsId > 0 && wishCfg.CostGoodsNum > 0)
            {
                bool oneUseBind      = false;
                bool oneUseTimeLimit = false;
                Global.UseGoodsBindOrNot(client, wishCfg.CostGoodsId, wishCfg.CostGoodsNum, true, out oneUseBind, out oneUseTimeLimit);
            }

            // 扣除钻石
            if (cliReq.CostType == (int)CoupleWishWishReqData.ECostType.ZuanShi &&
                wishCfg.CostZuanShi > 0)
            {
                GameManager.ClientMgr.SubUserMoney(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool,
                                                   client, wishCfg.CostZuanShi, "情侣祝福");
            }

            // 增加本服祝福特效
            if (wishCfg.IsHaveEffect == 1)
            {
                CoupleWishNtfWishEffectData effectData = new CoupleWishNtfWishEffectData();
                effectData.From     = centerReq.From;
                effectData.WishType = cliReq.WishType;
                effectData.WishTxt  = cliReq.WishTxt;
                effectData.To       = new List <KuaFuRoleMiniData>();

                if (cliReq.IsWishRankRole)
                {
                    effectData.To.Add(rankCoupleData.Man);
                    effectData.To.Add(rankCoupleData.Wife);
                }
                else
                {
                    if (centerReq.ToMan.RoleName == cliReq.ToLocalRoleName)
                    {
                        effectData.To.Add(centerReq.ToMan);
                    }
                    else
                    {
                        effectData.To.Add(centerReq.ToWife);
                    }
                }

                lock (Mutex)
                {
                    // 这里必须锁住,不然多个人同时祝福,都有可能修改所有在线玩家的奖励数据
                    HandleWishEffect(effectData);
                }
            }

            client.sendCmd(nID, StdErrorCode.Error_Success.ToString());
        }
Пример #4
0
        private void HandleWishOtherRoleCommand(GameClient client, int nID, byte[] bytes, string[] cmdParams)
        {
            CoupleWishWishReqData cliReq = DataHelper.BytesToObject <CoupleWishWishReqData>(bytes, 0, bytes.Length);
            DateTime now = TimeUtil.NowDateTime();
            int      wishWeek;

            if (client.ClientSocket.IsKuaFuLogin)
            {
                client.sendCmd(nID, -12);
            }
            else if (cliReq.CostType != 1 && cliReq.CostType != 2)
            {
                client.sendCmd(nID, -18);
            }
            else if (!this._Config.IsInWishTime(now, out wishWeek))
            {
                client.sendCmd(nID, -31);
            }
            else
            {
                CoupleWishTypeConfig wishCfg = this._Config.WishTypeCfgList.Find((CoupleWishTypeConfig _w) => _w.WishType == cliReq.WishType);
                if (wishCfg == null)
                {
                    client.sendCmd(nID, -3);
                }
                else if (cliReq.CostType == 1 && wishCfg.CostGoodsId > 0 && wishCfg.CostGoodsNum > 0 && Global.GetTotalGoodsCountByID(client, wishCfg.CostGoodsId) < wishCfg.CostGoodsNum)
                {
                    client.sendCmd(nID, -6, false);
                }
                else if (cliReq.CostType == 2 && wishCfg.CostZuanShi > 0 && client.ClientData.UserMoney < wishCfg.CostZuanShi)
                {
                    client.sendCmd(nID, -10, false);
                }
                else
                {
                    if (!string.IsNullOrEmpty(cliReq.WishTxt))
                    {
                        if (wishCfg.CanHaveWishTxt != 1)
                        {
                            client.sendCmd(nID, -25, false);
                            return;
                        }
                        if (cliReq.WishTxt.Length > CoupleWishConsts.MaxWishTxtLen)
                        {
                            client.sendCmd(nID, -26, false);
                            return;
                        }
                    }
                    CoupleWishWishRoleReq centerReq = new CoupleWishWishRoleReq();
                    centerReq.From.RoleId   = client.ClientData.RoleID;
                    centerReq.From.ZoneId   = client.ClientData.ZoneID;
                    centerReq.From.RoleName = client.ClientData.RoleName;
                    centerReq.WishType      = cliReq.WishType;
                    centerReq.WishTxt       = cliReq.WishTxt;
                    RoleData4Selector     toManSelector  = null;
                    RoleData4Selector     toWifeSelector = null;
                    CoupleWishCoupleDataK rankCoupleData = null;
                    if (cliReq.IsWishRankRole)
                    {
                        centerReq.IsWishRank = true;
                        lock (this.Mutex)
                        {
                            int coupleIdx;
                            if (!this.SyncData.ThisWeek.CoupleIdex.TryGetValue(cliReq.ToRankCoupleId, out coupleIdx))
                            {
                                client.sendCmd(nID, -12, false);
                                return;
                            }
                            rankCoupleData = this.SyncData.ThisWeek.RankList[coupleIdx];
                            if (rankCoupleData == null || rankCoupleData.DbCoupleId != cliReq.ToRankCoupleId || rankCoupleData.Rank > CoupleWishConsts.MaxRankNum * 2)
                            {
                                client.sendCmd(nID, -12, false);
                                return;
                            }
                            centerReq.ToCoupleId = cliReq.ToRankCoupleId;
                            toManSelector        = Global.sendToDB <RoleData4Selector, int>(10232, rankCoupleData.Man.RoleId, client.ServerId);
                            toWifeSelector       = Global.sendToDB <RoleData4Selector, int>(10232, rankCoupleData.Wife.RoleId, client.ServerId);
                            if (toManSelector == null || toWifeSelector == null || toManSelector.RoleID <= 0 || toWifeSelector.RoleID <= 0)
                            {
                                toWifeSelector = (toManSelector = null);
                            }
                        }
                    }
                    else
                    {
                        int toRoleId = -1;
                        if (!string.IsNullOrEmpty(cliReq.ToLocalRoleName))
                        {
                            toRoleId = RoleName2IDs.FindRoleIDByName(cliReq.ToLocalRoleName, true);
                        }
                        if (toRoleId <= 0)
                        {
                            client.sendCmd(nID, -28, false);
                            return;
                        }
                        if (toRoleId == client.ClientData.RoleID)
                        {
                            client.sendCmd(nID, -27, false);
                            return;
                        }
                        int nSpouseId = MarryLogic.GetSpouseID(toRoleId);
                        if (nSpouseId <= 0)
                        {
                            client.sendCmd(nID, -29, false);
                            return;
                        }
                        toManSelector  = Global.sendToDB <RoleData4Selector, int>(10232, toRoleId, client.ServerId);
                        toWifeSelector = Global.sendToDB <RoleData4Selector, int>(10232, nSpouseId, client.ServerId);
                        if (toManSelector == null || toWifeSelector == null)
                        {
                            client.sendCmd(nID, -15, false);
                            return;
                        }
                        if (!MarryLogic.SameSexMarry(false))
                        {
                            if (toManSelector.RoleSex == toWifeSelector.RoleSex)
                            {
                                client.sendCmd(nID, -15, false);
                                return;
                            }
                            if (toManSelector.RoleSex == 1)
                            {
                                DataHelper2.Swap <RoleData4Selector>(ref toManSelector, ref toWifeSelector);
                            }
                        }
                    }
                    if (toManSelector != null && toWifeSelector != null)
                    {
                        centerReq.ToMan.RoleId    = toManSelector.RoleID;
                        centerReq.ToMan.ZoneId    = toManSelector.ZoneId;
                        centerReq.ToMan.RoleName  = toManSelector.RoleName;
                        centerReq.ToManSelector   = DataHelper.ObjectToBytes <RoleData4Selector>(toManSelector);
                        centerReq.ToWife.RoleId   = toWifeSelector.RoleID;
                        centerReq.ToWife.ZoneId   = toWifeSelector.ZoneId;
                        centerReq.ToWife.RoleName = toWifeSelector.RoleName;
                        centerReq.ToWifeSelector  = DataHelper.ObjectToBytes <RoleData4Selector>(toWifeSelector);
                    }
                    int ec = TianTiClient.getInstance().CoupleWishWishRole(centerReq);
                    if (ec < 0)
                    {
                        client.sendCmd(nID, ec);
                    }
                    else
                    {
                        if (cliReq.CostType == 1 && wishCfg.CostGoodsId > 0 && wishCfg.CostGoodsNum > 0)
                        {
                            bool oneUseBind      = false;
                            bool oneUseTimeLimit = false;
                            Global.UseGoodsBindOrNot(client, wishCfg.CostGoodsId, wishCfg.CostGoodsNum, true, out oneUseBind, out oneUseTimeLimit);
                        }
                        if (cliReq.CostType == 2 && wishCfg.CostZuanShi > 0)
                        {
                            GameManager.ClientMgr.SubUserMoney(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, client, wishCfg.CostZuanShi, "情侣祝福", true, true, false, DaiBiSySType.None);
                        }
                        if (wishCfg.IsHaveEffect == 1)
                        {
                            CoupleWishNtfWishEffectData effectData = new CoupleWishNtfWishEffectData();
                            effectData.From     = centerReq.From;
                            effectData.WishType = cliReq.WishType;
                            effectData.WishTxt  = cliReq.WishTxt;
                            effectData.To       = new List <KuaFuRoleMiniData>();
                            if (cliReq.IsWishRankRole)
                            {
                                effectData.To.Add(rankCoupleData.Man);
                                effectData.To.Add(rankCoupleData.Wife);
                            }
                            else if (centerReq.ToMan.RoleName == cliReq.ToLocalRoleName)
                            {
                                effectData.To.Add(centerReq.ToMan);
                            }
                            else
                            {
                                effectData.To.Add(centerReq.ToWife);
                            }
                            lock (this.Mutex)
                            {
                                this.HandleWishEffect(effectData);
                            }
                        }
                        client.sendCmd(nID, 1);
                    }
                }
            }
        }