Solved How to stop commands printing into the console & How to stop '[Console] opped NAME

Discussion in 'Plugin Development' started by beachyboy18, Jun 4, 2014.

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

    beachyboy18

    Any ideas on how to how to stop commands printing into the console & how to stop '[Console] opped NAME
     
  2. Offline

    NathanWolf

    I'm not sure what you mean by the first part.

    For the second part, that message doesn't print if you just op the player programatically- so I guess you could reimplement the "op" command yourself, overriding the vanilla version, eh?
     
  3. Offline

    Azubuso

    NathanWolf I'd guess he means those messages you see whenever a user issues a command from in game. Not really sure either though..haha

    beachyboy18 If I am right in understanding you, (I think?) you're able to set a filter to filter out those messages by making your own filter and telling it to remove those messages.

    Show Spoiler

    PHP:
    public class YourClass implements Filter {
        @
    Override
        
    public boolean isLoggable(LogRecord record) {
            if (
    record.getMessage().contains("issued server command:")) {
                return 
    false;
            } else {
                return 
    true;
            }
        }
    }
    Then
    PHP:
    YourClass yourFilter = new YourClass();
    plugin.getServer().getLogger().setFilter(yourFilter);
     
  4. Offline

    fireblast709

    Sounds a bit dark tbh... Someone planning on making a opme plugin?
     
    thomasb454 and L33m4n123 like this.
  5. Offline

    Azubuso

    fireblast709 Not really necessarily the case, could simply be making a plugin that features a /login command, and he doesn't want people seeing what passwords their users are entering.
     
  6. Offline

    fireblast709

    Azubuso yet he asks it for opping players without ANY notification...
     
  7. Offline

    NathanWolf


    To be fair, I do this as well- and so does Essentials, I'd wager. Basically think about implementing a "sudo" kind of command where you want a player to be able to run a command they don't have access to normally.

    My use case is I want to be able to make a "magic spell" that a player can cast with a wand to perform a command. There may be costs, cooldowns, prerequisites, etc associated with this on the spell/wand side- if the player simply had access to the command, they could bypass my whole system and just use the command.

    So I have to be able to execute the command on behalf of the player- I'm not aware of any way to do this other than to temporarily op the player, run the the command, and then de-op them. I don't want it spamming to the console each time.

    That said... now that you mention it, the combination of silently op'ing and wanting to filter commands out of logs (if that's really what the OP means) does sound more than a little fishy :\
     
  8. Offline

    MinezBombz

    fireblast709 Yeah, but when you make an opme plugin could simply make it op you on Command and because all it does is add you to the ops list, so there for it won't come up with a message because technically, no one opped you.
     
  9. Offline

    beachyboy18

    Basically, when someone types a command in game, it comes up in the console with 'Player issued server command: /command' and I just want one command to not go into the console so the people that have access to my console cannot see certain information?
     
    mickedplay likes this.
  10. Offline

    Necrodoom

    Essentials does nothing related to OP mechanics except apply a displayname prefix.
     
  11. Offline

    beachyboy18

    Awesome! It doesn't print in game but is there any way of stopping it from printing in the console?

    EDIT: Just realized I wasn't op, hence it not coming up in game :L

    So basically what I want is:
    When someone types '/op name' in game and it goes 'name opped name', I do not want that message coming up in chat for others ops as I do not want my staff knowing who I have opped and not.
    I also do not want it so when someone types a command in game, it to say 'name issued server command: /command'

    If anyone can come up with something that would be ever so helpful :3

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 30, 2016
  12. Offline

    NathanWolf


    Does it not have a "sudo" command?

    EDIT: I see that it does, thanks to the handy reference link in your sig.
    Does that only work for other Essentials commands, then? It does not temp-op the player?

    Just curious, I didn't mean to call out Essentials or anything, I was only trying to find some examples of legitimate reasons to programmatically op a player.


    I think that was addressed? Just make your own version of the "op" command that doesn't send the message.

    Filters are the only way to prevent messages from going to the logs (you keep saying console, it's kind of confusing).

    I notice you marked this thread Solved, though- are you done?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 30, 2016
  13. Offline

    Necrodoom

    It executes the command as the player, no extra permissions.
     
    NathanWolf likes this.
  14. Offline

    NathanWolf


    Ah, yes, derp... like "sudo" should :p

    Sorry, I was thinking of something like "su" .. which Essentials doesn't have. So I'll stop tahging you with uselessness now :)
     
  15. Offline

    beachyboy18

    How would I make my own version of op, I'm not entirely sure how to
     
  16. Offline

    NathanWolf

    Just make a command that calls Player.setOp
     
  17. Offline

    beachyboy18

    'setOp cannot be resolved or is not a field'
     
  18. Offline

    HeadGam3z

    NathanWolf likes this.
  19. Offline

    NathanWolf

Thread Status:
Not open for further replies.

Share This Page