Run commands without outputting text?

Discussion in 'Archived: Plugin Requests' started by coolperez8, Nov 2, 2014.

Thread Status:
Not open for further replies.
  1. Offline


    Plugin Name: Anti-Output

    Plugin Description:
    This plugin will allow you to run commands without outputting text, normally, most plugins will display a message to indicate an action has been started or completed. What this plugin does, however, actually runs the command, but will not output the text, this is useful if you have other plugins to spam commands but it spams console and chat too, here are the modes:

    -g or --global: Applies to console, executor, and peers.
    -c or --console: Applies to console
    -e or --executor: Applies to executor (person running the command)
    -p, --pe or --peers: Applies to peers (Everybody but the person running the command)
    --players, --people, or --pl: Applies to all the players in the game (Like executor and peers)

    Note: for each mode, you can put yes or no, such as:

    -g:y - Output as normal
    -e:n - Don't output to yourself

    Also, if the command is invoked with no arguments, the plugin assumes your using the are not outputting to anyone, like "-g:n". Also, the plugin doesn't output things meant for just you to the whole game, it outputs what was meant for whoever to just themselves, or doesn't if the executor tells the plugin to do so.

    Also, the plugin doesn't ignore outputs completely, it stores the logs for each player in

    (root of server)/plugins/AntiOutput/Logs/Players/(playername)/*.txt

    And for the server it's

    (root of server)/plugins/AntiOutput/Logs/ConsoleOutput/*.txt

    The "*" is basically what date and time it was when the plugin loaded, each log is stored similar to console.

    And, the plugin works by running a command as the player who ran it, but tricking the plugin to output to the plugin's own logs instead of the servers.

    Commands: /an (arguments) (command, with "/")

    The permission for the command you're running, associated with the plugin:
    (Example: the plugin doesn't try to run it as console, it tells the plugin who's running it, but makes it output to the plugin itself, which, for Factions home, would be f.home?)
    antioutput.command.* for all commands
  2. Offline


    You would have to fetch packets or overwrite the sendMessage method.

    It would be easier if you ask the author of your plugins to add an option/flag to prevent a message, ...
  3. Offline

    timtower Administrator Administrator Moderator

    MisterErwin Overwriting the sendmessage method is way too much work.
    Protocollib is the way to go here.
  4. Offline


    timtower I just listed the ways I knew - I never said it will be easy :p

    But you could work better w/ the overwritten method, than having to compare the packets

    So the "normal" chat won't get blocked
  5. Offline

    timtower Administrator Administrator Moderator

    MisterErwin At start: start catching for player, run commands, wait 1 tick, stop catching
  6. Offline


    timtower But if a player sends a msg at that exact time...
    (see edited post above)
  7. Offline

    timtower Administrator Administrator Moderator

    Then the chances are that the OP is picky.
    How do you want to override the method then?
  8. Offline


    timtower That would be the problem :p

    Maybe a custom class that extends the Player class and change the player reference?
  9. Offline

    timtower Administrator Administrator Moderator

    Then you get to the point that every plugin existing would need to start using that class.
    MisterErwin likes this.
Thread Status:
Not open for further replies.

Share This Page