Exemple #1
0
        private EChangeGuildNameError HandleChangeBangHuiName(GameClient client, string newName)
        {
            EChangeGuildNameError ne = EChangeGuildNameError.OperatorDenied;

            // 非法字符
            if (string.IsNullOrEmpty(newName) || NameServerNamager.CheckInvalidCharacters(newName) <= 0)
            {
                ne = EChangeGuildNameError.InvalidName;
            }
            else if (!IsNameLengthOK(newName)) // 检测长度
            {
                ne = EChangeGuildNameError.LengthError;
            }
            else
            {
                string[] result = Global.ExecuteDBCmd((int)TCPGameServerCmds.CMD_SPR_CHANGE_BANGHUI_NAME, string.Format("{0}:{1}:{2}", client.ClientData.RoleID, client.ClientData.Faction, newName), client.ServerId);
                if (result == null || result.Length < 1)
                {
                    ne = EChangeGuildNameError.DBFailed;
                }
                else
                {
                    ne = (EChangeGuildNameError)Convert.ToInt32(result[0]);
                }
            }

            if (ne == EChangeGuildNameError.Success)
            {
                client.ClientData.BHName = newName;

                //通知所有指定帮会的在线用户帮会已经改名
                GameManager.ClientMgr.NotifyBangHuiChangeName(client.ClientData.Faction, newName);

                //通知GameServer同步领地帮会分布
                JunQiManager.NotifySyncBangHuiLingDiItemsDict();

                //更新缓存项
                Global.UpdateBangHuiMiniDataName(client.ClientData.Faction, newName);

                //罗兰城主
                LuoLanChengZhanManager.getInstance().ReShowLuolanKing();

                // pk之王
                if (GameManager.ArenaBattleMgr.GetPKKingRoleID() == client.ClientData.RoleID)
                {
                    GameManager.ArenaBattleMgr.ReShowPKKing();
                }

                AllyManager.getInstance().UnionDataChange(client.ClientData.Faction, client.ServerId);
            }

            return(ne);
        }
Exemple #2
0
        /// <summary>
        /// 加载参数配置文件
        /// </summary>
        /// <returns></returns>
        private static int ReloadXmlFile_config_systemparams()
        {
            int ret = GameManager.systemParamsList.ReloadLoadParamsList();

            //解析插旗战的日期和时间
            JunQiManager.ParseWeekDaysTimes();

            //解析皇城战的日期和时间
            HuangChengManager.ParseWeekDaysTimes();

            //解析王城战的日期和时间
            WangChengManager.ParseWeekDaysTimes();

            //重置皇城地图编号
            Global.ResetHuangChengMapCode();

            //重置皇宫的地图编号
            Global.ResetHuangGongMapCode();

            //坐骑的名称
            Global.HorseNamesList = null;

            //坐骑的速度
            Global.HorseSpeedList = null;

            //生肖竞猜配置
            GameManager.ShengXiaoGuessMgr.ReloadConfig();

            //古墓配置
            Global.InitGuMuMapCodes();
            Global.InitVipGumuExpMultiple();

            //充值限制掉落的时间项
            GameManager.GoodsPackMgr.ResetLimitTimeRange();

            //缓存的二锅头物品列表
            Global.ErGuoTouGoodsIDList = null;

            //绑定铜钱符每日使用次数列表缓存
            Global._VipUseBindTongQianGoodsIDNum = null;

            //自动给予的物品的
            GameManager.AutoGiveGoodsIDList = null;

            //加载采集配置
            CaiJiLogic.LoadConfig();

            return(ret);
        }
        public static bool IsExistCityWarToday()
        {
            int day = TimeUtil.NowDateTime().DayOfYear;
            BangHuiLingDiItemData lingDiItem = JunQiManager.GetItemByLingDiID(6);
            bool result;

            if (null == lingDiItem)
            {
                result = false;
            }
            else
            {
                Dictionary <int, int> warRequestMap = WangChengManager.GetWarRequstMap(lingDiItem.WarRequest);
                result = warRequestMap.ContainsValue(day);
            }
            return(result);
        }
        public static int SetCityWarRequestToDBServer(int lingDiID, string nowWarRequest)
        {
            int    retCode = -200;
            string strcmd  = string.Format("{0}:{1}", lingDiID, nowWarRequest);

            string[] fields = Global.ExecuteDBCmd(10098, strcmd, 0);
            int      result;

            if (fields == null || fields.Length != 5)
            {
                result = retCode;
            }
            else
            {
                retCode = Global.SafeConvertToInt32(fields[0]);
                JunQiManager.NotifySyncBangHuiLingDiItemsDict();
                result = retCode;
            }
            return(result);
        }
 private static void HandleHuangChengResultEx(bool isBattleOver = false)
 {
     if (WangChengManager.WangZuBHid <= 0)
     {
         if (isBattleOver)
         {
             WangChengManager.HandleWangChengFailed();
         }
     }
     else
     {
         JunQiManager.HandleLingDiZhanResultByMapCode(6, Global.GetHuangGongMapCode(), WangChengManager.WangZuBHid, true, false);
         Global.BroadcastHuangChengOkHintEx(WangChengManager.WangZuBHName, isBattleOver);
         JunQiManager.NotifySyncBangHuiJunQiItemsDict(null);
         if (isBattleOver)
         {
             HuodongCachingMgr.UpdateHeFuWCKingBHID(WangChengManager.WangZuBHid);
         }
     }
 }
Exemple #6
0
        private EChangeGuildNameError HandleChangeBangHuiName(GameClient client, string newName)
        {
            EChangeGuildNameError ne;

            if (string.IsNullOrEmpty(newName) || NameServerNamager.CheckInvalidCharacters(newName, false) <= 0)
            {
                ne = EChangeGuildNameError.InvalidName;
            }
            else if (!this.IsNameLengthOK(newName))
            {
                ne = EChangeGuildNameError.LengthError;
            }
            else
            {
                string[] result = Global.ExecuteDBCmd(14006, string.Format("{0}:{1}:{2}", client.ClientData.RoleID, client.ClientData.Faction, newName), client.ServerId);
                if (result == null || result.Length < 1)
                {
                    ne = EChangeGuildNameError.DBFailed;
                }
                else
                {
                    ne = (EChangeGuildNameError)Convert.ToInt32(result[0]);
                }
            }
            if (ne == EChangeGuildNameError.Success)
            {
                client.ClientData.BHName = newName;
                GameManager.ClientMgr.NotifyBangHuiChangeName(client.ClientData.Faction, newName);
                JunQiManager.NotifySyncBangHuiLingDiItemsDict();
                Global.UpdateBangHuiMiniDataName(client.ClientData.Faction, newName);
                LuoLanChengZhanManager.getInstance().ReShowLuolanKing(0);
                if (GameManager.ArenaBattleMgr.GetPKKingRoleID() == client.ClientData.RoleID)
                {
                    GameManager.ArenaBattleMgr.ReShowPKKing();
                }
                AllyManager.getInstance().UnionDataChange(client.ClientData.Faction, client.ServerId, false, 0);
                JunTuanManager.getInstance().OnBangHuiChangeName(client.ClientData.Faction, newName);
            }
            return(ne);
        }