[INACTIVE][FUN/ADMN] Spyer 1.5_1 - invisibility for moderating and pvp!(alternative to Vanish) SPOUT

Discussion in 'Inactive/Unsupported Plugins' started by nickguletskii, Feb 27, 2011.

  1. Offline

    nickguletskii

    SPYER HAS A NEW HOME!

    WARNING! THIS PLUGIN REQUIRES SERVER SIDE SPOUT! CLIENTS DO NOT HAVE TO DOWNLOAD ANYTHING!
    WARNING! OLD PERMISSION SYSTEM IS NOT SUPPORTED! YOU WILL NEED A BUKKIT PERMISSIONS STANDARD COMPLIANT PERMISSIONS SYSTEM!
    Hotfixed SpyerFun on 16th of August. Version number of the jar didn't change. Fixed a bunch of bugs.
    SpyerFun - a plugin that allows playersto become invisible for some time. Each second the player "eats" one item out of the stack he is holding (hider item, sugar by default). While invisible, mob can and will still attack the player, although other players (exceptions are implemented) can not. The player will reappear when he either runs out of the hider item or switches to another item in his action bar, e.g. a sword.
    SpyerAdmin - a plugin that allows moderators to hide themselves for an unlimited amount of time, as well as simulating them leaving. This is a constantly updated alternative to Vanish, with much more features and configurations!
    Thanks to brafenschlug for this hilarious video of moderators playing pranks on players!

    Features:
    • Now uses Spout! This plugin is no longer CPU heavy!
    • Allows players to become invisible for a set amount of time!
    • Adds more fun to PVP.
    • Allows administrators to hide themselves and simulate them quitting! Overrides msg,r and list.
    • Stops players from picking things up while using SpyerAdmin (see the configuration section)
    • Knocks players out from invisibility (SpyerFun) when they get damaged (see the configuration section)
    • Knocks players out from invisibility (SpyerFun) when they left-click a block (see the configuration section)
    • Now reload friendly!
    How to use (SpyerAdmin):
    • Use /spy to become and stop being invisible (toggled).
    • Use /quit to simulate you quitting/joining (toggled).
    • Place 1 piece of the indicator item into your quickbar. It will indicate if you are hidden or not. By default it is glowstone that turns into sulphur. You can configure that in plugins/Spyer/SpyerAdmin.conf.
    How to use (SpyerFun):
    • Right click with the "hider" item, every second it will eat up one item from the stack.
    • To add/change "hider" items, go to plugins/Spyer/items.yml. You'll see something like this:
      Code:
      {352: 3000, 353: 1000}
      Items are separated by commas. The ID is the right value, and the time of usage (per block) in milliseconds(HAS to be dividable by 50!). So if I want to add clay to work for 10 seconds per piece, I will do something like
      Code:
      {352: 3000, 353: 1000, 337: 10000}
      Note: by default, bones and sugar are used.
    Installation instructions, downloads:

    Install server-side Spout. No Spout client required.
    Extract the contents of the bundle(Spyer.zip) into the plugins folder.
    Bundle downloads:
    Download
    Download command line installer
    Github
    jars (open)

    Instructions for different setups:
    • Essentials: Download SpyerInstaller, put it in the server directory and run it from terminal(console). Go to configuration->4.
    • Vanilla Bukkit: go to (server directory)/plugins/Spyer. Open repo.conf, replace everything with
      Code:
      http://dl.dropbox.com/u/16258042/SpyerAdminRepos/Vanilla/
    • CommandBook: Special version for you! semi-direct Replace SpyerAdminConmmands.jar with this version!
    Configuring:

    List of permissions:
    1. spyer.spy (Players who have this have access to the /spy and /quit commands, without permissions checks for op powers)
    2. spyer.seeAll (Players who have this can see people who are hidden, without permissions checks for op powers)
    3. spyer.fun (Players who have this can use SpyerFun, without permissions defaults to true)
    4. spyer.stopmobs.admin (Stops moderators from being attacked by mobs while hidden)
    5. spyer.stopmobs.fun (Stops players from being attacked by mobs while hidden)
    Files:
    • spyer.yml - responsible for holding timing data. If syncWithScheduler is true, the plugin will use the bukkit's scheduler (recommended). If false, use Java timers. refreshRate defines the time in ticks (in milliseconds if syncWithScheduler = false). Add the optional field coolDown and set its value to your cooldown time in milliseconds (for SpyerFun, time in between invisibility uses). Add pickUp: true to allow picking up items while hidden in SpyerAdmin. To knock out people from SpyerFun when they damage an entity, add "onDamage: true". To knock out people from SpyerFun when they left click a block, add "onBlock: true". To stop invisible players (SpyerFun) from damaging other living entities, add "noDamage: true". Boolean "wait" allows/disallows the plugin to delay reloading to give them time to hide.
    • repo.conf - holds the url of the repository from which SpyerAdmin will update the script.
    • script.js - compatibility layer between plugins. e.g. Essentials script will simulate Essentials commands, Vanilla script will simulate the normal minecraft commands.
    • items.yml - holds the list of items used in SpyerFun
    • SpyerAdmin.conf - holds indicator item ids for SpyerAdmin
    Modifying scripts:
    1. Comment out all the lines in repo.conf.
    2. Modify the script.
    3. If you want to update the script, you can get it from [repopath]/script.js
    Version: v1.5_1

    Known issues
    • If you get a NullPointer when enabled (that contains something like "at nickguletskii200.SpyerAdmin.CustomHandling.<init>(Unknown Source)", then download this and put it into your jre's lib directory. You might also need to install Rhino. Disclaimer: this file is a part of the OpenJDK package.
    Changelog (open)

    Version 1.5
    • Migrated to Spout packet filtering. Timers are now only used for indicators(admin) and item deduction(fun). You can decrease the tick rate now if you want.
    • 1.5_1 Fixed the whole bundle. Nasty bug didn't appear in testing!
    Version 1.4
    • Separated SpyerAdmin into two modules.
    • July 17th - now using bukkit permissions API. Blind update. If you got this plugin before build 1000, then you have the old version. If you got it after build 1000, new version.
    Version 1.3
    • Made plugins reload friendly.
    • _1 Essentials 2.3 compatibility added through autoupdate.
    • _2 Fixed default item pickup. Now doesn't pick up items by default.
    • _3 Added noDamage property for SpyerFun.
    Version 1.2
    • Improved performance.
    • Added position checks.
    Version 1.1
    • Some little customisation upgrades.
    • Some hotfixes.
    • Improved SpyerFun's invisibility system.
    Version 1.0
    • Added mob targeting control.
    • Hotfix: fixed(hopefully) the log spam!
    • Small feature added (13/05/11): cooldown times for SpyerFun.
    Version 0.9
    • Permissions support!
    • Cleaned up code.
    Version 0.8
    • Added indicators.
    • You can now do /spy [on|off] to force.
    • Invisibility persists when you reconnect.
    • Fixed updater to work with Windows.
    • 0.8_1 fixed some problems with commands.
    • 0.8_2 major fixes.
    Version 0.7 (SpyerAdmin only for now)
    • Automatic script updating.
    • Better logging (will help me get rid of bugs) (coming soon)
    Version 0.6
    • Scripting support! That means no more compile-time library linking and more compatibility!
    • Multiple item support for SpyerFun added!
    Version 0.5
    • Added refreshrate and sync method variables. See the usage instructions to learn how to cofnigure them.
    Version 0.4


    • Extended functionality of /quit. Overrides msg and list commands of essentials.
    Version 0.3
    • A rewrite, separated packages. Hopefully removed all known bugs.
    • 0.3_1 Separated in-game configurations into another package.
    • 0.3_2 Fixed some bugs.
    • 0.3_21 Fixed some exceptions, small fix.
    Version 0.2
    • Shadow moderation ("addspy <player>" - allows player to hide with "spy" and "quit", "removespy <player>" - opposite. "addseeall <player>" - allows player to see hidden players, "removeseeall <player>" - oppiste. "spy" - hides you until called again. "quit" - hides and removes you from the list of players.
    • Click in the air now works
    • Migrated to SnakeYaml, no more jars!
    • 0.2_1 upgraded to remove double invisibility, quit now fully simulates player leaving.
    • 0.2_2 fixed player reappearing after "spying".
    • 0.2_3 huuuuuuuge bugfixes!
    • 0.2_4 fixed some bugs, one known: you have to say "/spy" twice to hide after using sugar/other hider item.
    Version 0.1
    • Release



    TODO
    • Some technical cleanups
    • Suggest more!
    Credits (no particular order)
    These people helped me by posting a lot of descriptive bug reports, removing bugs from scripts, making videos, cooperating with debugging and helping other users understand my horrible documentation ;)
    • The PC Tech Guy
    • Sparx
    • Tim Yong
    • Greylocke
    • KevinHouse
    • aidan matzko
    • brafenschlug
    • Nelien
     
  2. Offline

    MrDare360

    Help! im not using commandbook or essentials but everytime i start up my server i get this error:
    01:00:28 [SEVERE] java.net.MalformedURLException: no protocol: importPackage(jav
    a.util);importPackage(org.bukkit.craftbukkit);importClass(java.lang.StringBuilde
    r);function c(sender){ var s = ""; var plrs=Server.getOnlinePlayers();
    var plrn=new ArrayList(); for (i = 0; i < Server.getOnlinePlayers().length
    ; i++) { var m = Server.getOnlinePlayers(); if(!Spye
    rAdmin.isQuit(m) || SpyerAdmin["isSeeAll(org.bukkit.command.CommandSender)"](sen
    der)){ var h = m.getName(); plrn.add(h);
    } } for (i = 0; i < plrn.size(); i++) { if (i >
    0) { s = s + ", "; } s = s + plrn.get
    (i); } return s;}function tell(sender, args){ var from; if(sende
    r instanceof org.bukkit.entity.Player){ from=sender.getName();
    } else { from="CONSOLE"; } var to=args[0]; var msg=args[1];
    s = ChatColour.get("Gray") + from + " whispers " + msg; var plr=Server.g
    etPlayer(to); if(plr.equals(null)) { sender.sendMessage("Ther
    e\'s no player by that name online."); } if(SpyerAdmin["i
    sQuit(java.lang.String)"](plr.getName()) && !SpyerAdmin["isSeeAll(org.bukkit.com
    mand.CommandSender)"](sender)) { sender.sendMessage("There\'s no
    player by that name online."); return; } Server.getLogger().info(
    "[" + from + "->" + to + "] " + s); sender.sendMessage(s); plr.sendMessage(
    s);}function who(sender) { sender.sendMessage("Connected players: " + c(sen
    der));}function playerMsg(sender, args, commandLabel) { tell(sender,args);}funct
    ion playerLeaving(plr) {//Called when a player pseudo-leaves Server.broadcast
    Message(new StringBuilder().append(ChatColour .get("Yellow")).
    append(plr.getName()).append(" left the game.") .toString());}fu
    nction playerJoining(plr) {//Called when a player pseudo-joins Server.broadcast
    Message(new StringBuilder().append(ChatColour .get("Yellow")).
    append(plr.getName()).append(" joined the game.") .toStrin
    g());}function reply(sender, args) {}script.js
    01:00:28 [SEVERE] at java.net.URL.<init>(Unknown Source)
    01:00:28 [SEVERE] at java.net.URL.<init>(Unknown Source)
    01:00:28 [SEVERE] at java.net.URL.<init>(Unknown Source)
    01:00:28 [SEVERE] at nickguletskii200.SpyerAdmin.Updater.download(Unknown
    Source)
    01:00:28 [SEVERE] at nickguletskii200.SpyerAdmin.SpyerAdmin.onEnable(Unkno
    wn Source)
    01:00:28 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlug
    in.java:127)
    01:00:28 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(
    JavaPluginLoader.java:584)
    01:00:28 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(Si
    mplePluginManager.java:218)
    01:00:28 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftSe
    rver.java:116)
    01:00:28 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftS
    erver.java:94)
    01:00:28 [SEVERE] at org.bukkit.craftbukkit.CraftServer.reload(CraftServer
    .java:287)
    01:00:28 [SEVERE] at org.bukkit.command.SimpleCommandMap$ReloadCommand.exe
    cute(SimpleCommandMap.java:196)
    01:00:28 [SEVERE] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCo
    mmandMap.java:80)
    01:00:28 [SEVERE] at org.bukkit.craftbukkit.CraftServer.dispatchCommand(Cr
    aftServer.java:247)
    01:00:28 [SEVERE] at net.minecraft.server.MinecraftServer.b(MinecraftServe
    r.java:394)
    01:00:28 [SEVERE] at net.minecraft.server.MinecraftServer.h(MinecraftServe
    r.java:379)
    01:00:28 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftSer
    ver.java:285)
    01:00:28 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(Sour
    ceFile:394)
    01:00:28 [INFO] SpyerAdmin has completed updating the script successfully.
    01:00:28 [SEVERE] plugins\Spyer\script.js (The system cannot find the file speci
    fied)
    01:00:28 [INFO] SpyerAdmin module version 1.0, a spying utility for administrato
    rs and moderators, is active. Part of the Spyer package by [nickguletskii200]
    01:00:28 [INFO] Found permissions. Using them for SpyerAdmin.
    01:00:28 [INFO] SpyerFun module version 1.0, a spying utility for normal players
    , is active. Part of the Spyer package by [nickguletskii200]


    And my moderators and Guests can see me when it says im invisible
     
  3. Offline

    zaery

    I think you need a vanilla server or a bukkit server with essentials for it to work. And if you don't want essentials, nickguletskii said that he might be releasing a craftbook compatible version today.
     
  4. Offline

    nickguletskii

    Wait wait wait, could you please post the contents of your repo.conf?
    EDIT: Also, does script.js exist? If not, create an empty file called that.
     
  5. Offline

    The PC Tech Guy

    @nickguletskii It appears that the link you gave for the "vanilla bukkit" script.js is broken, or at least it says so in the console. Still having to manually remove the /list command from plugin.yml to restore vanilla list functionality.
     
  6. Offline

    MrDare360

    Yes here is the contents of repo.conf

    //Fresh from the repo! importPackage(java.util); importPackage(org.bukkit.craftbukkit); importClass(java.lang.StringBuilder); function c(sender) { var s = ""; var plrs=Server.getOnlinePlayers(); var plrn=new ArrayList(); for (i = 0; i < Server.getOnlinePlayers().length; i++) { var m = Server.getOnlinePlayers(); if(!SpyerAdmin.isQuit(m) || SpyerAdmin["isSeeAll(org.bukkit.command.CommandSender)"](sender)){ var h = m.getName(); plrn.add(h); } } for (i = 0; i < plrn.size(); i++) { if (i > 0) { s = s + ", "; } s = s + plrn.get(i); } return s; } function tell(sender, args) { var from; if(sender instanceof org.bukkit.entity.Player){ from=sender.getName(); } else { from="CONSOLE"; } var to=args[0]; var msg=args[1]; s = ChatColour.get("Gray") + from + " whispers " + msg; var plr=Server.getPlayer(to); if(plr.equals(null)) { sender.sendMessage("There\'s no player by that name online."); } if(SpyerAdmin["isQuit(java.lang.String)"](plr.getName()) && !SpyerAdmin["isSeeAll(org.bukkit.command.CommandSender)"](sender)) { sender.sendMessage("There\'s no player by that name online."); return; } Server.getLogger().info("[" + from + "->" + to + "] " + s); sender.sendMessage(s); plr.sendMessage(s); } function who(sender) { sender.sendMessage("Connected players: " + c(sender)); } function playerMsg(sender, args, commandLabel) { tell(sender,args); } function playerLeaving(plr) {//Called when a player pseudo-leaves Server.broadcastMessage(new StringBuilder().append(ChatColour .get("Yellow")).append(plr.getName()).append(" left the game.") .toString()); } function playerJoining(plr) {//Called when a player pseudo-joins Server.broadcastMessage(new StringBuilder().append(ChatColour .get("Yellow")).append(plr.getName()).append(" joined the game.") .toString()); } function reply(sender, args) { }


    And yes there is a file called script.js


    Oh and everytime i run my server the script.js file turns into script.js.bak

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 10, 2016
  7. Offline

    nickguletskii

    I am very bad at releasing... Yeah, remove the script.js at the end and it will work.
    How did that get there? You need a URL, not the script itself...
     
  8. Offline

    MrDare360

    Ok ive replaced it with the url but now i get this error
    18:01:31 [SEVERE] SpyerAdmin script update failed: http://dl.dropbox.com/u/16258
    042/SpyerAdminRepos/Vanilla/script.jsscript.js
    18:01:31 [INFO] SpyerAdmin module version 1.0, a spying utility for administrato
    rs and moderators, is active. Part of the Spyer package by [nickguletskii200]
    18:01:31 [INFO] Found permissions. Using them for SpyerAdmin.
    18:01:31 [INFO] SpyerFun module version 1.0, a spying utility for normal players
    , is active. Part of the Spyer package by [nickguletskii200]
     
  9. Offline

    nickguletskii

    Yes, remove script.js from the end of repo.conf.
     
  10. Offline

    MrDare360

    kk that worked tyvm
     
  11. Offline

    Infectedd

    Damn man, what the hell! After it worked (almost) good (except for p1;p1,p2 bug) it SUDDENLY screwed up again.
    I tried running SpyerPatcher multiple times, however i don't know whether it has succeeded. Here's the error log:
    Code:
    22:33:48 [SEVERE] java.lang.NoSuchMethodException: no such method: who
    22:33:48 [SEVERE]       at com.sun.script.javascript.RhinoScriptEngine.invoke(Un
    known Source)
    22:33:48 [SEVERE]       at com.sun.script.javascript.RhinoScriptEngine.invokeFun
    ction(Unknown Source)
    22:33:48 [SEVERE]       at nickguletskii200.SpyerAdmin.CustomHandling.who(Unknow
    n Source)
    22:33:48 [SEVERE]       at nickguletskii200.SpyerAdmin.SpyerAdmin.onCommand(Unkn
    own Source)
    22:33:48 [SEVERE]       at org.bukkit.command.PluginCommand.execute(PluginComman
    d.java:35)
    22:33:48 [SEVERE]       at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCo
    mmandMap.java:85)
    22:33:48 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.dispatchCommand(Cr
    aftServer.java:247)
    22:33:48 [SEVERE]       at net.minecraft.server.MinecraftServer.b(MinecraftServe
    r.java:394)
    22:33:48 [SEVERE]       at net.minecraft.server.MinecraftServer.h(MinecraftServe
    r.java:379)
    22:33:48 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftSer
    ver.java:285)
    22:33:48 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(Sour
    ceFile:394)
    I LOVE this plugin! Using latest Ess and CB714.

    cb733, same problem

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

    nickguletskii

    Contents of both repo.conf and script.js please.
     
  13. Offline

    Infectedd

    repo.conf :

    #<--Lines starting with # are comments
    # This file should only contain one uncommented line at the moment,
    # which contains an updated script.js
    http://dl.dropbox.com/u/16258042/SpyerAdminRepos/Essentials/

    script.js :

    Code:
    /*
     * Erm, sorry for the mess... And ugly workarounds...
     */
    // Fresh from the repo!
    importPackage(java.util);
    importPackage(org.bukkit.craftbukkit);
    importClass(java.lang.StringBuilder);
    function who(sender) { // Called when a player calls the playerlist command.
        // Code shamelessly ripped, translatedd and modified...
        if (!SpyerAdmin.hasPermission(sender, "essentials.list")) {
            return;
        }
        var online = new StringBuilder();
        online.append(ChatColour.get("Blue")).append("There are ")
                .append(ChatColour.get("Red"));
        if (!SpyerAdmin.isSeeAll(sender)) {
            sbIntAppend(online, Server.getOnlinePlayers().length
                            - SpyerAdmin.numOfHidenPlayers());
        } else {
            sbIntAppend(online, Server.getOnlinePlayers().length);
        }
        online.append(ChatColour.get("Blue")).append(" out of a maximum ")
                .append(ChatColour.get("Red"));
        sbIntAppend(online, Server.getMaxPlayers());
        online.append(ChatColour.get("Blue")).append(" players online.");
        sender.sendMessage(online.toString());
        var pl = Server.getPluginManager().getPlugin("Essentials");
        if (pl.getSettings().getSortListByGroups()) {
            var sort = new HashMap();
            for (i = 0; i < Server.getOnlinePlayers().length; i++) {
                var p = Server.getOnlinePlayers()[i];
                if (!SpyerAdmin.isQuit(p.getName()) || SpyerAdmin.isSeeAll(sender)) {
                    var u = getUserFromPlayer(p);
                    var group = u.getGroup();
                    var list = sort.get(group);
                    if (list == null) {
                        list = new ArrayList();
                        sort.put(group, list);
                    }
                    list.add(u);
                }
            }
            var groups = sort.keySet().toArray(java.lang.reflect.Array.newInstance(
                    java.lang.String, 0));
            Arrays.sort(groups, java.lang.String.CASE_INSENSITIVE_ORDER);
            for (i = 0; i < groups.length; i++) {
                var group = groups[i];
                var groupString = new java.lang.StringBuilder();
                groupString.append(group).append(": ");
                var users = sort.get(group);
                Collections.sort(users);
                var first = true;
                for (b = 0; b < users.size(); b++) {
                    var user = users.get(b);
                    if (!SpyerAdmin.isQuit(user.getName())
                            || SpyerAdmin.isSeeAll(sender)) {
    
                        if (!first) {
                            groupString.append(", ");
                        } else {
                            first = false;
                        }
                        if (pl.away.contains(user)) {
                            groupString.append("§7[AFK]§f");
                        }
    
                        groupString.append(user.getDisplayName());
                    }
                    sender.sendMessage(groupString.toString());
                }
            }
        } else {
            var users = new ArrayList();
            for (i = 0; i < Server.getOnlinePlayers().length; i++) {
                var p = Server.getOnlinePlayers()[i];
                if (!SpyerAdmin.isQuit(p.getName()) || SpyerAdmin.isSeeAll(sender)) {
                    users.add(getUserFromPlayer(p));
                }
            }
            Collections.sort(users);
    
            var onlineUsers = new java.lang.StringBuilder();
            onlineUsers.append("Connected players: ");
            var first = true;
            for (b = 0; b < users.size(); b++) {
                var user = users.get(b);
                if (!first) {
                    onlineUsers.append(", ");
                } else {
                    first = false;
                }
                if (pl.away.contains(user)) {
                    onlineUsers.append("§7[AFK]§f");
                }
                onlineUsers.append(user.getDisplayName());
            }
            sender.sendMessage(onlineUsers.toString());
        }
    }
    function getUserFromPlayer(player) { // Ugly workaround... Instantiates a
        // user object.
        var cl = CLLoader.getCl("plugins/Essentials.jar",
                "com.earth2me.essentials.User");
        var getUsr = CLLoader.getFirstMethod(cl, "get");
        var args = java.lang.reflect.Array.newInstance(java.lang.Object, 1);
        args[0] = player;
        return CLLoader.invokeMethod(getUsr, null, args);
    }
    // Load the console...
    var consleClass = CLLoader.getCl("plugins/Essentials.jar",
            "com.earth2me.essentials.Console");
    var consleArgs = java.lang.reflect.Array.newInstance(java.lang.Object, 0);
    var consleParams = java.lang.reflect.Array.newInstance(java.lang.Class, 0);
    var console = CLLoader.invokeMethod(consleClass.getMethod("getConsoleReplyTo",
                    consleParams), null, consleArgs);
    function getReplyToCSL(player) { // Calls getReplyTo in the console object.
        var getReply = CLLoader.getFirstMethod(console.getClass(), "getReplyTo");
        var args = java.lang.reflect.Array.newInstance(java.lang.Object, 0);
        return CLLoader.invokeMethod(getReply, console, args);
    }
    function setReplyToCSL(user) { // Calls setReplyTo in the console object.
        var setReply = CLLoader.getFirstMethod(console, "setReplyTo");
        var args = java.lang.reflect.Array.newInstance(java.lang.Object, 1);
        args[0] = user;
        CLLoader.invokeMethod(setReply, console, args);
    }
    function sbIntAppend(sb, inter) { // Ha ha, dynamic casting is stupid...
        // "There are 0.0 players out of 20.0 max"
        // or something like that... XD
        sb.append(new java.lang.Integer(inter));
    }
    function getFinalArg(args, start) { // getFinalArg from EssentialsCommand
        var bldr = new StringBuilder();
        for (i = start; i < args.length; i++) {
            if (i != start)
                bldr.append(" ");
            bldr.append(args[i]);
        }
        return bldr.toString();
    }
    
    function playerMsg(sender, args, commandLabel) { // Called when a player
                                                        // calls the msg command.
        // Code shamelessly ripped, translatedd and modified...
        if (!SpyerAdmin.hasPermission(sender, "essentials.msg")) {
            return;
        }
        if (args.length < 2 || args[0].trim().length() == 0
                || args[1].trim().length() == 0) {
            sender.sendMessage("§cUsage: /" + commandLabel + " [player] [message]");
            return;
        }
    
        var message = getFinalArg(args, 1);
    
        var replyTo;
        if (sender instanceof org.bukkit.entity.Player) {
            replyTo = getUserFromPlayer(sender);
        } else {
            replyTo = console;
        }
        var senderName;
        if (sender instanceof org.bukkit.entity.Player) {
            senderName = sender.getDisplayName();
        } else {
            senderName = "Console";
        }
    
        if (args[0].equalsIgnoreCase("Console")) {
            sender.sendMessage("[Me -> " + "Console" + "§f] " + message);
            var cs;
            if (!(Server instanceof org.bukkit.craftbukkit.CraftServer)) {
                throw new java.lang.Exception("Invalid server!");
            }
            cs = Server.getServer().console;
            cs.sendMessage("[" + senderName + " -> Me§f] " + message);
            replyTo.setReplyTo(cs);
            console.setReplyTo(sender);
            return;
        }
    
        var matches = Server.matchPlayer(args[0]);
        print(SpyerAdmin.isSeeAll(sender));
        if (!SpyerAdmin.isSeeAll(sender)) {
            var qp = SpyerAdmin.quitPlayers();
            for (i = 0; i < qp.size(); i++) {
                matches.remove(qp.get(i));
            }
        }
        if (matches.isEmpty()) {
            sender.sendMessage("§cThere are no players matching that name.");
            return;
        }
        var count = 0;
        for (i = 0; i < matches.size(); i++) {
            var p = matches.get(i);
            // if ((!SpyerAdmin.isQuit(sender))
            // || (SpyerAdmin.isQuit(sender) && SpyerAdmin.isSeeAll(p))) {
            if (SpyerAdmin.isSeeAll(p) || !SpyerAdmin.isQuit(sender)) {
                sender.sendMessage("[Me -> " + p.getDisplayName() + "§f] "
                        + message);
                p.sendMessage("[" + senderName + " -> Me§f] " + message);
                replyTo.setReplyTo(getUserFromPlayer(p));
                getUserFromPlayer(p).setReplyTo(sender);
                count = count + 1;
            }
    
            // }
        }
        if (count == 0) {
            sender.sendMessage("§cThere are no players matching that name.");
        }
    }
    function playerLeaving(plr) {// Called when a player pseudo-leaves
        Server.broadcastMessage(new StringBuilder()
                .append(ChatColour.get("Yellow")).append(plr.getName())
                .append(" left the game.").toString());
    }
    function playerJoining(plr) {// Called when a player pseudo-joins
        Server.broadcastMessage(new StringBuilder()
                .append(ChatColour.get("Yellow")).append(plr.getName())
                .append(" joined the game.").toString());
    }
    function reply(sender, args, commandLabel) {// Called when a player calls the r
                                                // command.
        // Code shamelessly ripped, translatedd and modified...
        if (!SpyerAdmin.hasPermission(sender, "essentials.msg")) {
            return;
        }
        if (args.length < 1) {
            sender.sendMessage("§cUsage: /" + commandLabel + " [message]");
            return;
        }
    
        var message = getFinalArg(args, 0);
        var replyTo;
        if (sender instanceof org.bukkit.entity.Player) {
            replyTo = getUserFromPlayer(sender);
        } else {
            replyTo = console
        }
        var senderName;
        if (sender instanceof org.bukkit.entity.Player) {
            senderName = (sender).getDisplayName();
        } else {
            senderName = "Console";
        }
        var target = replyTo.getReplyTo();
        var targetName;
        if (target instanceof org.bukkit.entity.Player) {
            targetName = (target).getDisplayName();
        } else {
            targetName = "Console";
        }
        if (target == null || (SpyerAdmin.isQuit(targetName))
                && !SpyerAdmin.isSeeAll(targetName)) {
            sender.sendMessage("§cYou have nobody to whom you can reply.");
        }
        sender.sendMessage("[Me -> " + targetName + "] " + message);
        target.sendMessage("[" + senderName + " -> Me] " + message);
        replyTo.setReplyTo(target);
        if (target != sender) {
            if (target instanceof org.bukkit.entity.Player) {
                getUserFromPlayer(target).setReplyTo(sender);
            } else {
                console.setReplyTo(sender);
            }
        }
    }
    function who()
    {
    
            var out = new StringBuilder();
            var online = plugin.getServer().getOnlinePlayers();
    
            plugin.getServer().getPluginManager().callEvent(
                    new OnlineListSendEvent(sender));
    
            // This applies mostly to the console, so there might be 0 players
            // online if that's the case!
            if (online.length == 0) {
                sender.sendMessage("0 players are online.");
                return;
            }
    
            // Get filter
            String filter = args.getString(0, "").toLowerCase();
            filter = filter.length() == 0 ? null : filter;
    
            // For filtered queries, we say something a bit different
            if (filter == null) {
                out.append(ChatColor.GRAY + "Online (");
                out.append(ChatColor.GRAY + "" + online.length);
                out.append(ChatColor.GRAY + "): ");
                out.append(ChatColor.WHITE);
            } else {
                out.append(ChatColor.GRAY + "Found players (out of ");
                out.append(ChatColor.GRAY + "" + online.length);
                out.append(ChatColor.GRAY + "): ");
                out.append(ChatColor.WHITE);
            }
    
            // To keep track of commas
            boolean first = true;
    
            // Now go through the list of players and find any matching players
            // (in case of a filter), and create the list of players.
            for (Player player : online) {
                // Process the filter
                if (filter != null && !player.getName().toLowerCase().contains(filter)) {
                    break;
                }
    
                if (!first) {
                    out.append(", ");
                }
    
                out.append(player.getName());
    
                first = false;
            }
    
            // This means that no matches were found!
            if (first) {
                sender.sendMessage(ChatColor.RED + "No players (out of "
                        + online.length + ") matched '" + filter + "'.");
                return;
            }
    
            sender.sendMessage(out.toString());
    }
    
     
  14. Offline

    Nipper

    Not for sure what happened but the /who/list stopped working I get this error

    Code:
    17:08:09 [SEVERE] java.lang.NoSuchMethodException: no such method: who
    17:08:09 [SEVERE]       at com.sun.script.javascript.RhinoScriptEngine.invoke(RhinoScriptEngine.java:195)
    17:08:09 [SEVERE]       at com.sun.script.javascript.RhinoScriptEngine.invokeFunction(RhinoScriptEngine.java:167)
    17:08:09 [SEVERE]       at nickguletskii200.SpyerAdmin.CustomHandling.who(Unknown Source)
    17:08:09 [SEVERE]       at nickguletskii200.SpyerAdmin.SpyerAdmin.onCommand(Unknown Source)
    17:08:09 [SEVERE]       at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    17:08:09 [SEVERE]       at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:85)
    17:08:09 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:255)
    17:08:09 [SEVERE]       at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:675)
    17:08:09 [SEVERE]       at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:638)
    17:08:09 [SEVERE]       at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:632)
    17:08:09 [SEVERE]       at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    17:08:09 [SEVERE]       at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
    17:08:09 [SEVERE]       at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
    17:08:09 [SEVERE]       at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    17:08:09 [SEVERE]       at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
    17:08:09 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
    17:08:09 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    
     
  15. Offline

    Juluo2

    /quit don't run.
    When i try it, I have this log :
    Why ?
     
  16. Offline

    suid

    I'm also having that same problem with the latest CB latest Essentials and lasted Spyadmin
    Code:
    2011-04-26 21:17:28 [SEVERE] java.lang.NoSuchMethodException: no such method: who
    2011-04-26 21:17:28 [SEVERE]    at com.sun.script.javascript.RhinoScriptEngine.invoke(RhinoScriptEngine.java:170)
    2011-04-26 21:17:28 [SEVERE]    at com.sun.script.javascript.RhinoScriptEngine.invokeFunction(RhinoScriptEngine.java:142)
    2011-04-26 21:17:28 [SEVERE]    at nickguletskii200.SpyerAdmin.CustomHandling.who(Unknown Source)
    2011-04-26 21:17:28 [SEVERE]    at nickguletskii200.SpyerAdmin.SpyerAdmin.onCommand(Unknown Source)
    2011-04-26 21:17:28 [SEVERE]    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    2011-04-26 21:17:28 [SEVERE]    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:85)
    2011-04-26 21:17:28 [SEVERE]    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:255)
    2011-04-26 21:17:28 [SEVERE]    at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:675)
    2011-04-26 21:17:28 [SEVERE]    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:638)
    2011-04-26 21:17:28 [SEVERE]    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:632)
    2011-04-26 21:17:28 [SEVERE]    at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    2011-04-26 21:17:28 [SEVERE]    at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
    2011-04-26 21:17:28 [SEVERE]    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
    2011-04-26 21:17:28 [SEVERE]    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    2011-04-26 21:17:28 [SEVERE]    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
    2011-04-26 21:17:28 [SEVERE]    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
    2011-04-26 21:17:28 [SEVERE]    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    
     
  17. Offline

    Reterg

    Hi
    Running CB733 I get this error on server start
    Code:
    09:22:36 [SEVERE] sun.org.mozilla.javascript.internal.EvaluatorException: missing ; before statement (<Unknown source>#287) in <Unknown source> at line number 287 
     
  18. Offline

    HowDareYouKitty

    It breaks /who in essentials

    Code:
    [SEVERE]     at nickguletskii200.SpyerAdmin.CustomHandling.who(Unknown Source)
    2011-04-26 19:58:46 [SEVERE]     at nickguletskii200.SpyerAdmin.SpyerAdmin.onCommand(Unknown Source)
    2011-04-26 19:58:46 
     
  19. Offline

    Mineaccount

    I get this error:
    An internal error occurred while performing this command
     
  20. Offline

    Reterg

    Hi

    Not sure what has happened because I haven't changed anything since the last time I started the server. Now when I do the /quit command, it doesn't say that I have left the server. Still says that I am invisible. The console gets this error
    Code:
     14:55:05 [SEVERE] java.lang.NoSuchMethodException: no such method: playerLeaving
     14:55:05 [SEVERE]  at com.sun.script.javascript.RhinoScriptEngine.invoke(Unknown Source)
     14:55:05 [SEVERE]  at com.sun.script.javascript.RhinoScriptEngine.invokeFunction(Unknown Source)
     14:55:05 [SEVERE]  at nickguletskii200.SpyerAdmin.CustomHandling.playerLeave(Unknown Source)
     14:55:05 [SEVERE]  at nickguletskii200.SpyerAdmin.SpyerAdmin.onCommand(Unknown Source)
     14:55:05 [SEVERE]  at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
     14:55:05 [SEVERE]  at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:85)
     14:55:05 [SEVERE]  at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:255)
     14:55:05 [SEVERE]  at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:675)
     14:55:05 [SEVERE]  at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:638)
     14:55:05 [SEVERE]  at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:632)
     14:55:05 [SEVERE]  at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
     14:55:05 [SEVERE]  at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
     14:55:05 [SEVERE]  at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
     14:55:05 [SEVERE]  at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
     14:55:05 [SEVERE]  at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
     14:55:05 [SEVERE]  at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
     14:55:05 [SEVERE]  at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Using CB733
     
  21. Offline

    nickguletskii

  22. Offline

    Infectedd

    ./list doesn't spam errors, but still
    Default: p1
    Default: p1,p2
    Default: p1,p2,p3
    :/
     
  23. Offline

    nickguletskii

    Going to see what might cause that...

    Experimental CommandBook repo opened:
    Code:
    http://dl.dropbox.com/u/16258042/SpyerAdminRepos/CommandBook/
    Use the CommandBook customiser to remove msg, list and reply commands from it. In CommandBook's config change online-on-join to false.
    TODO: Add commandbook aliases, add filtering functionality.

    EDIT: @Infectedd Fixed it, restart the server.
     
  24. Offline

    Juluo2

    OP can teleport at me even if I use / quit or / spy
     
  25. Offline

    Reterg

    Awesome. Thanks for that.
    Love this plugin.
     
  26. Offline

    nickguletskii

    Of course they can, because they are OPs! Seriously...

    Oh, and a little hotfix: fixed the list command for everything not Essentials.
     
  27. Offline

    Juluo2

    Sorry, thanks…
     
  28. Offline

    Tidgxor

    Hello!

    Awesome plugin, our server has used it for sometime and will continue to! :D

    I do have a bug to report, and I do apologize if this has already been pointed out, but I didn't see it when I went through the thread.

    It involves SpyerFun for the players, lets say we set the invisibility item to be block 59, or crops, then set each item to grant 10 seconds of invisibility. Like normal, the player selects the item (in this case 59), right clicks it, and becomes invisible while starting the 10 second countdown. If the player keeps block 59 selected, everything continues as normal. However, if they select anything else, say, a sword for PvP, for example, after 10 seconds *that* item (the sword) is consumed instead. Basically, this not only means that players get their inventory eaten, it allows for abuse, as a player need only keep 1 invisibility item on them, they just let the mod consume 100s and 100s of dirt blocks.

    Is this a problem on our end? The plugin seems to work fine otherwise and gives no errors in the console.

    Any suggestions?
     
  29. Offline

    nickguletskii

    Patched that & some other issues. Redownload and enjoy! Note: as I couldn't track down some nullpointers, I added a temporary empty catch block. So please, if there are any problems/malfunctions, PLEASE PLEASE PLEASE tell me as soon as possible!
     
  30. Offline

    Pomme72

    Does this plugin work with 733 ?!
     
  31. Offline

    Mineaccount

    hmm... I still get the same error
     

Share This Page