Exemplo n.º 1
0
        public void ReloadGuild(TPlayObject PlayObject, string[] @Params)
        {
            int    nPermission = @Params.Length > 0 ? int.Parse(@Params[0]) : 0;
            string sParam1     = @Params.Length > 1 ? @Params[1] : "";

            if ((sParam1 == "") || ((sParam1 != "") && (sParam1[1] == '?')))
            {
                PlayObject.SysMsg(String.Format(GameMsgDef.g_sGameCommandParamUnKnow, this.Attributes.Name, GameMsgDef.g_sGameCommandReloadGuildHelpMsg),
                                  TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            if (M2Share.nServerIndex != 0)
            {
                PlayObject.SysMsg(GameMsgDef.g_sGameCommandReloadGuildOnMasterserver, TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            TGUild Guild = GuildManager.FindGuild(sParam1);

            if (Guild == null)
            {
                PlayObject.SysMsg(String.Format(GameMsgDef.g_sGameCommandReloadGuildNotFoundGuildMsg, sParam1), TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            Guild.LoadGuild();
            PlayObject.SysMsg(String.Format(GameMsgDef.g_sGameCommandReloadGuildSuccessMsg, sParam1), TMsgColor.c_Red, TMsgType.t_Hint);
            // UserEngine.SendServerGroupMsg(SS_207, nServerIndex, sParam1);
        }
        public void ChangeSabukLord(TPlayObject PlayObject, string[] @Params)
        {
            string sCASTLENAME = @Params.Length > 0 ? @Params[0] : "";
            string sGuildName  = @Params.Length > 1 ? @Params[1] : "";
            bool   boFlag      = @Params.Length > 2 ? bool.Parse(@Params[2]) : false;

            if ((sCASTLENAME == "") || (sGuildName == ""))
            {
                PlayObject.SysMsg("命令格式: @" + this.Attributes.Name + " 城堡名称 行会名称", TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            TUserCastle Castle = M2Share.g_CastleManager.Find(sCASTLENAME);

            if (Castle == null)
            {
                PlayObject.SysMsg(String.Format(GameMsgDef.g_sGameCommandSbkGoldCastleNotFoundMsg, sCASTLENAME), TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            TGUild Guild = GuildManager.FindGuild(sGuildName);

            if (Guild != null)
            {
                M2Share.AddGameDataLog("27" + "\09" + Castle.m_sOwnGuild + "\09" + '0' + "\09" + '1' + "\09" + "sGuildName" + "\09"
                                       + PlayObject.m_sCharName + "\09" + '0' + "\09" + '1' + "\09" + '0');
                Castle.GetCastle(Guild);

                UserEngine.SendServerGroupMsg(Grobal2.SS_211, M2Share.nServerIndex, sGuildName);
                PlayObject.SysMsg(Castle.m_sName + " 所属行会已经更改为 " + sGuildName, TMsgColor.c_Green, TMsgType.t_Hint);
            }
            else
            {
                PlayObject.SysMsg("行会 " + sGuildName + "还没建立!!!", TMsgColor.c_Red, TMsgType.t_Hint);
            }
        }
Exemplo n.º 3
0
        public void ReloadGuild(TPlayObject PlayObject, string[] @Params)
        {
            string sParam1 = @Params.Length > 0 ? @Params[0] : "";

            if ((sParam1 == "") || ((sParam1 != "") && (sParam1[0] == '?')))
            {
                if (GameConfig.boGMShowFailMsg)
                {
                    PlayObject.SysMsg(string.Format(GameMsgDef.g_sGameCommandParamUnKnow, Attributes.Name, GameMsgDef.g_sGameCommandReloadGuildHelpMsg), TMsgColor.c_Red, TMsgType.t_Hint);
                }
                return;
            }
            if (M2Share.nServerIndex != 0)
            {
                PlayObject.SysMsg(GameMsgDef.g_sGameCommandReloadGuildOnMasterserver, TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            TGUild Guild = GuildManager.FindGuild(sParam1);

            if (Guild == null)
            {
                PlayObject.SysMsg(string.Format(GameMsgDef.g_sGameCommandReloadGuildNotFoundGuildMsg, sParam1), TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            Guild.LoadGuild();
            PlayObject.SysMsg(string.Format(GameMsgDef.g_sGameCommandReloadGuildSuccessMsg, sParam1), TMsgColor.c_Red, TMsgType.t_Hint);
            UserEngine.SendServerGroupMsg(Grobal2.SS_207, M2Share.nServerIndex, sParam1);
        }
Exemplo n.º 4
0
        public void ForcedWallconquestWar(TPlayObject PlayObject, string[] @Params)
        {
            string sCASTLENAME = @Params.Length > 0 ? @Params[0] : "";
            string s20;
            TGUild Guild = null;

            if (sCASTLENAME == "")
            {
                if (GameConfig.boGMShowFailMsg)
                {
                    PlayObject.SysMsg("命令格式: @" + base.Attributes.Name + " 城堡名称", TMsgColor.c_Red, TMsgType.t_Hint);
                }
                return;
            }
            TUserCastle Castle = M2Share.g_CastleManager.Find(sCASTLENAME);

            if (Castle != null)
            {
                Castle.m_boUnderWar = !Castle.m_boUnderWar; // 设置为可以攻城
                if (Castle.m_boUnderWar)                    // 正在攻城
                {
                    if (GuildManager.GuildList.Count > 0)   // 增加所有行会为攻城行会
                    {
                        for (int I = 0; I < GuildManager.GuildList.Count; I++)
                        {
                            Guild = GuildManager.GuildList[I];
                            Castle.m_AttackGuildList.Add(Guild);
                        }
                    }
                    Castle.m_boShowOverMsg        = false;
                    Castle.m_WarDate              = DateTime.Now;
                    Castle.m_dwStartCastleWarTick = HUtil32.GetTickCount();
                    Castle.StartWallconquestWar();
                    UserEngine.SendServerGroupMsg(Grobal2.SS_212, M2Share.nServerIndex, "");
                    s20 = "[" + Castle.m_sName + " 攻城战已经开始]";
                    UserEngine.SendBroadCastMsg(s20, TMsgType.t_System);
                    UserEngine.SendServerGroupMsg(Grobal2.SS_204, M2Share.nServerIndex, s20);
                    Castle.MainDoorControl(true);
                }
                else
                {
                    Castle.StopWallconquestWar();
                }
            }
            else
            {
                PlayObject.SysMsg(string.Format(GameMsgDef.g_sGameCommandSbkGoldCastleNotFoundMsg, sCASTLENAME), TMsgColor.c_Red, TMsgType.t_Hint);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 新建行会
        /// </summary>
        /// <param name="sGuildName"></param>
        /// <param name="sChief"></param>
        /// <returns></returns>
        public bool AddGuild(string sGuildName, string sChief)
        {
            bool   result = false;
            TGUild Guild;

            if (M2Share.CheckGuildName(sGuildName) && (FindGuild(sGuildName) == null))
            {
                Guild = new TGUild(sGuildName);
                Guild.SetGuildInfo(sChief);
                Guild.m_nGuildMemberCount = M2Share.g_Config.nGuildMemberCount;// 行会成员上限
                GuildList.Add(Guild);
                SaveGuildList();
                result = true;
            }
            return(result);
        }
Exemplo n.º 6
0
        // 取玩家所属的行会
        public TGUild MemberOfGuild(string sName)
        {
            TGUild result = null;

            if (GuildList.Count > 0)
            {
                for (int I = 0; I < GuildList.Count; I++)
                {
                    if (GuildList[I].IsMember(sName))
                    {
                        result = GuildList[I];
                        break;
                    }
                }
            }
            return(result);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 查找行会
        /// </summary>
        /// <param name="sGuildName"></param>
        /// <returns></returns>
        public TGUild FindGuild(string sGuildName)
        {
            TGUild result = null;

            if (GuildList.Count > 0)
            {
                for (int I = 0; I < GuildList.Count; I++)
                {
                    if (GuildList[I].sGuildName == sGuildName)
                    {
                        result = GuildList[I];
                        break;
                    }
                }
            }
            return(result);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 加载游戏行会
        /// </summary>
        public void LoadGuildInfo()
        {
            TStringList LoadList;
            TGUild      Guild;
            string      sGuildName;

            if (File.Exists(M2Share.g_Config.sGuildFile))
            {
                LoadList = new TStringList();
                LoadList.LoadFromFile(M2Share.g_Config.sGuildFile);
                if (LoadList.Count > 0)
                {
                    for (int I = 0; I < LoadList.Count; I++)
                    {
                        sGuildName = LoadList[I].Trim();
                        if (sGuildName != "")
                        {
                            Guild = new TGUild(sGuildName);
                            GuildList.Add(Guild);
                        }
                    }
                }
                Dispose(LoadList);
                for (int I = GuildList.Count - 1; I >= 0; I--)
                {
                    if (GuildList.Count <= 0)
                    {
                        break;
                    }
                    Guild = GuildList[I];
                    if (!Guild.LoadGuild())
                    {
                        M2Share.MainOutMessage(Guild.sGuildName + " 读取出错!!!");
                        Dispose(Guild);
                        GuildList.RemoveAt(I);
                        SaveGuildList();
                    }
                }
                M2Share.MainOutMessage("已读取 [" + (GuildList.Count).ToString() + "] 个行会信息...");
            }
            else
            {
                M2Share.MainOutMessage("行会信息文件未找到!!!");
            }
        }
Exemplo n.º 9
0
        public void ContestPoint(TPlayObject PlayObject, string[] @Params)
        {
            string sGuildName = @Params.Length > 0 ? @Params[0] : "";

            if ((sGuildName == "") || ((sGuildName != "") && (sGuildName[0] == '?')))
            {
                PlayObject.SysMsg("查看行会战的得分数。", TMsgColor.c_Red, TMsgType.t_Hint);
                PlayObject.SysMsg(String.Format("命令格式: @{0} 行会名称", this.Attributes.Name), TMsgColor.c_Red, TMsgType.t_Hint);
                return;
            }
            TGUild Guild = GuildManager.FindGuild(sGuildName);

            if (Guild != null)
            {
                PlayObject.SysMsg(String.Format("{0} 的得分为: {1}", sGuildName, Guild.nContestPoint), TMsgColor.c_Green, TMsgType.t_Hint);
            }
            else
            {
                PlayObject.SysMsg(String.Format("行会: {0} 不存在!!!", sGuildName), TMsgColor.c_Green, TMsgType.t_Hint);
            }
        }