[MECH] Unknown Command v1.7 - Returns "Unknown Command" messages [818]

Discussion in 'Inactive/Unsupported Plugins' started by LRFLEW, Jan 23, 2011.

  1. Offline

    LRFLEW

    Unknown Command - Returns "Unknown Command" messages

    As of a recent build, CraftBukkit had an "Unknown Command" message (although there are two of them). As of UC 1.2, this plugin now instead allows for custom UC messages to be sent to the player. All you have to do is run the plugin once, and edit the file at /plugins/UC/Messages.txt. You can have more than one message (separated by lines) and it will randomly choose which one to say to the player. Here is an example of that.

    Features:
    • Returns custom "Unknown Command" from a txt file whenever a command doesn't exist.
    Download (to all my projects and source):
    http://lrflew.ismywebsite.com/bukkit.html
    Mirror:
    http://dl.dropbox.com/u/22202470/UC.jar
    Source: http://dl.dropbox.com/u/22202470/UC.zip

    *Licence Notice*
    There has been some confusion about what kinds of permissions I'm giving for this, particularly with @544nick101 trying to make a branch. From here on out, Unknown Command is licensed under the Creative Commons - Attribution license with attribution being linking back to this forum thread and mentioning my username LRFLEW.

    Changelog:
    • 1.7: Removed redundant source code hidden in the jar file
    • 1.6: "\g" now returns the command used and fixed bug with commands with '/' in them (special thanks to Cutch)
    • 1.5: Set universally to getDataFolder() to fix any errors
    • 1.4: added ebean dependency
    • 1.3: Now Messages.txt allows colors with "\[0-F]" ("\\" makes a backslash). This should help unicode errors. Also includes small coding changes.
    • 1.2: Now has another file at "plugins/UC/Messages.txt" to put custom messages. To prevent the default message from appearing, I have to cancel missing commands, so any unruly commands not in "plugins/UC/Commands.txt" may not run at all and the console will no longer say "LRFLEW issued server command: apple". If requested, I'll make it return it again.
    • 1.1: As per request, the file with default commands has been moved from "UC.txt" to "plugins/UC/Commands.txt". You happy now?
    • 1.0: Added a txt file that will install itself to the server's folder containing the default commands of CraftBukkit. You can add any commands not properly working with this in that file and reload the file even while running the server with "/uc reload" (no "/" if ran from the console; OPs are the only players that can run this command)
    • 0.6: Added missing CraftBukkit commands and created a static TreeSet for faster command checking.
    • 0.5: Added an Enum to check if the command is a command built into CraftBukkit itself.
    • 0.4: uses onPlayerCommandPreproccess() and server.getPluginCommand() to find unknown commands.
    • 0.3: now uses short call (0.2 works on latest build with warning, but 0.3 won't work with old builds)
    • 0.2.1: ACTUALLY changed the package, both the actual one and the one in plugin.yml :p
    • 0.2: changed package name to comply with EvilSeth's request
    • 0.1: First Itteration (note: some plugins don't cancel their events, making this plugin say "Unknown Command" to actuall commands. It's not my fault)
     
  2. Offline

    LRFLEW

    It's not that they don't register with my command, as it doesn't register with Bukkit :p. Bukkit's API for commands is the ground work for this plugin. Weird variants won't work, but with the removal of onPlayerCommand(), it's harder to find plugins that don't use it.
     
  3. Offline

    Jandalf

    simple but great plugin:)
     
  4. Offline

    ScottSpittle

    download link is dead
     
  5. Offline

    Nekpek

    true. . .
     
  6. Offline

    LRFLEW

    My host is down for some reason. I'm looking into it. In the mean time, I'll see if I can host a mirror. Keep an eye out
    --- merged: Mar 6, 2011 8:49 PM ---
    Mirror up
     
  7. Offline

    Jandalf

    could u maybe put the UC.txt to /plugins/UC/ like all other plugins?
     
  8. Offline

    LRFLEW

    All the other plugins? I guess I haven't been looking at what everybody else does. I was just looking for a way to let unruly commands work. If that's where it's suppose to go, I'll fix it, but there really isn't a standard as far as I know.
     
  9. Offline

    Phaedrus

    It's kind of a standard because a lot of game service providers want all plugin related stuff sequestered to the plugins folder.

    BTW, is this working with 493?
     
  10. Offline

    Jandalf

    yes it isnt a standart but i have 14 plugins and all do so... i think its clearer.
     
  11. Offline

    LRFLEW

    Fine, I'll change it :p.

    Last I checked it does. If it isn't working for you, just tell me.
     
  12. Offline

    Jandalf

    yeah im happy:)
     
  13. Offline

    DontMakeWaves

    It would be nice if the unknown command message was customizable. Then I could make it say "I'm sorry, Dave. I'm afraid I can't do that." It would be really cool if I could make a list of messages, and one would be randomly chosen each time. : )
     
  14. Offline

    Mohammad

    hi I really wanted this plugin.
    I placed the UC.jar into my plugins folder does everything fine and in command prompt it said that its activated.
    When I try something like /sdasfpgagniopasdnfiopasdn it doesnt show anything no unkown command
     
  15. Offline

    LRFLEW

    I'll work on it ;)

    I have trouble trying to troubleshoot when all I get is "didn't show anything."
    To cover the basics first, are you submitting the command from the console? Only players can receive "unknown command". Also, can you check to see if you have a /plugins/UC/Commands.txt and I'll look into it a little more.
     
  16. Offline

    MacG32

    Confirmed working with build #556. [​IMG]
     
  17. Offline

    emoknight

    Code:
    2011-03-17 19:23:40 [SEVERE] Could not pass event PLAYER_COMMAND_PREPROCESS to Unknown Command
    java.lang.NoSuchMethodError: org.bukkit.Server.getPluginCommand(Ljava/lang/String;)Lorg/bukkit/command/PluginCommand;
        at com.LRFLEW.UC.PlayerEvents.onPlayerCommandPreprocess(PlayerEvents.java:115)
        at org.bukkit.plugin.java.JavaPluginLoader$6.execute(JavaPluginLoader.java:155)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:225)
        at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:625)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:596)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:590)
        at net.minecraft.server.Packet3Chat.a(SourceFile:24)
        at net.minecraft.server.NetworkManager.a(SourceFile:230)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:70)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:338)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:253)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    i keep getting this error
     
  18. Offline

    LRFLEW

    I can't recreate the error. I looked at the point of error, and I put too much on one line :p. Delete the /plugins/UC folder and see if you get the errors again. If you still get that error, I can give you a version that will give me a more informative help on what's happening.

    This plugin has another problem though. The latest build already has a "Unknown Console Command" message (granted two of them, but still). I will make custom messages work, and then I'll work on canceling the default message :).

    EDIT: I think I found the problem. Make sure you're up-to-date :p
     
  19. Offline

    LRFLEW

    Finished. Check out v1.2 :)
     
  20. Offline

    emoknight

    hi the message keep displaying CUnknown Command in white text and also all worldedit command keep getting Unknown Command on them only if do put them in the command.txt it still display it.
    using CB 556
     
  21. Offline

    LRFLEW

    The "CUnknown Command" problem was foreseen (unicode doesn't work too well cross-platform). I am working on a non-unicode system for colors that will fix it. For now, try copying the following character and putting it before the C in the txt file:
    Code:
    ยง
    if that doesn't work, try deleting the file and making a new one in a txt editor.

    As for the command.txt problem, I haven't had any issues. Similar to the problem above, try checking the console for errors (they usually appear shortly before "Unknown Command v-whatever is enabled"). If there are none, try making a new file and trying again :p. If that doesn't work, tell me.
     
  22. Offline

    user_2408

    Dig it, this mod is great (CB559).
     
  23. Hey, seems like you made a small mistake with the settings folder :):
    Code:
    2011-04-08 19:02:22 [INFO] While loading Unknown Command (plugins\UC.jar) found old-data folder: plugins\UC next to the new one: plugins\Unknown Command
    This message will come if I delete the UC folder:
    Code:
    2011-04-08 19:06:33 [INFO] [UC] couldn't find Commands.txt.  Creating a new file with default settings
    2011-04-08 19:06:33 [INFO] [UC] couldn't find Messages.txt.  Creating a new file with default settings
    Could you please fix it? Thanks for the plugin, works great in craftbukkit 670!
     
  24. Offline

    user_2408

    Confirming the above.
     
  25. Offline

    LRFLEW

    This has to do with build #670 changing the plugin's default folder. Running it once and deleting the UC folder should fix it, but I am finishing up a new version that should fix any strange issues with this.
     
  26. Offline

    emoknight

    why is plugin making 2 folder called Unknown Command and UC?
    Edit: oops should of read post above b4 posting is lol ..fail..
     
  27. If you have read the posts above you can see that's a bug between the latest craftbukkit and unknown command.
     
  28. Offline

    LRFLEW

    Try 1.5
     
  29. Thanks for the update, bug is gone now :)
     
  30. Offline

    Pythros

    My server is on build 670
    UC version: Currently 1.6, was on whatever was the current build yesterday around this same time...
    We use HeroChat v4.10.0 then updated to v.4.10.2 trying to figure this out...
    For whatever reason, UC worked with no problem when using the channel specific commands on HC. Such as "/staff blah blah blah". Now if I do the same thing, it outputs the chat to the channel and then tells me "Unknown Command". I've updated both UC and HC to latest version... any reason why this is happening?
     
  31. Offline

    LRFLEW

    There are two possibilities:

    a) the other plugin broke completely (the command doesn't work by itself). The only way to test this well is to temporarily remove UC.jar and see if the command works. If it does work, go to part b
    b) the other plugin broke compatibility. I have had problems with other plugins breaking compatibility many times, so I added a override. Any commands not working, add them as a new line to the file at "plugins/Unknown Command/Commands.txt" (each command needs to be on it's own line without ANY spaces).

    If neither of those work, tell me here as it may be a bigger problem I am not aware of.
     

Share This Page