Inheritance: Wolfje.Plugins.SEconomy.CmdAliasModule.AliasCommand
Exemple #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);
        }
Exemple #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));
 }
Exemple #3
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));
		}
Exemple #4
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);
		}