Inheritance: Wolfje.Plugins.SEconomy.CmdAliasModule.AliasCommand
コード例 #1
0
        /// <summary>
        /// Creates a javascript alias pointing to a javascript function.
        /// </summary>
        internal void CreateAlias(JScriptAliasCommand alias, bool allowServer = true)
        {
            TShockAPI.Command newCommand = new TShockAPI.Command(alias.Permissions, ChatCommand_AliasExecuted,
                                                                 new string[] {
                alias.CommandAlias,
                "jistalias." + alias.CommandAlias
            })
            {
                AllowServer = allowServer
            };

            newCommand.DoLog = alias.Silent == false;

            TShockAPI.Commands.ChatCommands.RemoveAll(i => i.Names.Contains("jistalias." + alias.CommandAlias));
            TShockAPI.Commands.ChatCommands.Add(newCommand);
            jsAliases.RemoveAll(i => i.CommandAlias == alias.CommandAlias);
            jsAliases.Add(alias);
        }
コード例 #2
0
 /// <summary>
 /// Removes an alias.
 /// </summary>
 internal void RemoveAlias(JScriptAliasCommand alias)
 {
     jsAliases.RemoveAll(i => i.CommandAlias == alias.CommandAlias);
     TShockAPI.Commands.ChatCommands.RemoveAll(i => i.Names.Contains("jistalias." + alias.CommandAlias));
 }
コード例 #3
0
ファイル: JistAlias.cs プロジェクト: GNR092/SEconomy
		/// <summary>
		/// Removes an alias.
		/// </summary>
		internal void RemoveAlias(JScriptAliasCommand alias)
		{
			jsAliases.RemoveAll(i => i.CommandAlias == alias.CommandAlias);
			TShockAPI.Commands.ChatCommands.RemoveAll(i => i.Names.Contains("jistalias." + alias.CommandAlias));
		}
コード例 #4
0
ファイル: JistAlias.cs プロジェクト: GNR092/SEconomy
		/// <summary>
		/// Creates a javascript alias pointing to a javascript function.
		/// </summary>
		internal void CreateAlias(JScriptAliasCommand alias, bool allowServer = true)
		{
			TShockAPI.Command newCommand = new TShockAPI.Command(alias.Permissions, ChatCommand_AliasExecuted,
				                               new string[] { 
					alias.CommandAlias, 
					"jistalias." + alias.CommandAlias 
				}) {
				AllowServer = allowServer
			};

			newCommand.DoLog = alias.Silent == false;

			TShockAPI.Commands.ChatCommands.RemoveAll(i => i.Names.Contains("jistalias." + alias.CommandAlias));
			TShockAPI.Commands.ChatCommands.Add(newCommand);
			jsAliases.RemoveAll(i => i.CommandAlias == alias.CommandAlias);
			jsAliases.Add(alias);
		}