Inheritance: Wolfje.Plugins.SEconomy.CmdAliasModule.AliasCommand
Ejemplo n.º 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);
        }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
		}
Ejemplo n.º 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);
		}