AFK Message plugin

Discussion in 'Archived: Plugin Requests' started by PHLegacy, Dec 10, 2012.

  1. Offline

    gomeow

    What is the error?
     
  2. Offline

    3DDarren

    I couldn't copy it, it was rapidly spamming.
     
  3. Offline

    gomeow

    stop the server, then go back and copy some. It is necessary to fix it.
     
  4. Offline

    PHLegacy

    Awesome, i'll test it out! :)
     
  5. Offline

    Kevn1997

    Sorry, my mod gives NPE on everything it does. Trying to fix it, so in the mean time, other alternatives ? :c

    Okay, I have seemed to fixed the NPE error. Try if any problem and do let me know. Download [removed]

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

    PHLegacy

    Works great! I just gave it a go and it does exactly what I wanted! :D Curious though (and it doesn't have to be done). But is it possible to make the line with the away message on it scroll so that it can fit long sentences on it? If it's too much or if it's impossible then don't worry about it. Just curious.
     
  8. Offline

    Kevn1997

    Hmm. I probably will try to work on it. Good idea. So do you need any permission with the commands ?

    I think there is a need for the permissions as you would not want your players to go setting god mode on or off.
     
  9. Offline

    PHLegacy

    Sounds good! and as far as permissions go, yes we do need permissions. Basically, I want to give out the ability to go into god-mode while afk to only certain individuals, not everybody. Also the ability to give certain people the ability to use the message system (afk away message).

    So simply:

    afksigns.god - gives the ability for users to toggle god mode for themselves
    afksigns.god.admin - gives the ability for the admin to toggle god mode for all users (op by default)
    afksigns.god.others - gives a user the ability to toggle god mode for others (op by default)
    afksigns.sign -gives the user the ability to toggle whether the sign shows up in front of him or not
    afksigns.sign.admin - gives the ability to toggle sign use for everyone
    afksigns.sign.others -gives the ability to toggle sign use for others
    afksigns.* -gives all perms
    afksigns.message -gives the ability to write a message

    Also, is there a way for the ops to delete a users message in case it is vulgar or something? That might also be a useful thing to include.
     
  10. I got some error... Have I missed something ?
    Src on github.
    Code:
    14:12:38 [INFO] This server is running CraftBukkit version git-Bukkit-1.4.6-R0.1-15-g8d3c04d-b2573jnks (MC: 1.4.6) (Implementing API version 1.4.6-R0.2-SNAPSHOT)
    14:12:38 [SEVERE] Could not load 'plugins/AFKMsg.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.IllegalAccessException: Class org.bukkit.plugin.java.JavaPluginLoader can not access a member of class se.minecraft.snakehult.plugins.afkmsg.AFKMsg with modifiers "public"
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:184)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230)
            at org.bukkit.craftbukkit.v1_4_6.CraftServer.loadPlugins(CraftServer.java:235)
            at org.bukkit.craftbukkit.v1_4_6.CraftServer.<init>(CraftServer.java:213)
            at net.minecraft.server.v1_4_6.PlayerList.<init>(PlayerList.java:52)
            at net.minecraft.server.v1_4_6.DedicatedPlayerList.<init>(SourceFile:11)
            at net.minecraft.server.v1_4_6.DedicatedServer.init(DedicatedServer.java:104)
            at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:399)
            at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:849)
    Caused by: java.lang.IllegalAccessException: Class org.bukkit.plugin.java.JavaPluginLoader can not access a member of class se.minecraft.snakehult.plugins.afkmsg.AFKMsg with modifiers "public"
            at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:95)
            at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:261)
            at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:253)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:516)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:178)
            ... 9 more
    
     
  11. Offline

    Kevn1997

    Good news. I have managed to work out the scrolling text part ! I have made it to pause for 2 and a half seconds on the first character in case people could not catch the word. Also in this version, I have added the capability of editing other's message. Worked quite long to get it working. Also, I have included some permission check:
    "afksigns.message.personal" for using the message
    "afksigns.message.others" for editing another player's message

    Download here. -ADF.LY links were removed meaning no income. :'(-

    I also don't think there is a need for disabling the sign from working for people as other's would want to see if the player is AFK.

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

    PHLegacy

    Sounds good! I'll update it right now :D and I think you might be right about disabling it for certain players.

    Awesome! I originally tried to update it by "saving as..." with the original one you posted and wasn't able to download it. So I deleted both the folder and the jar file and redownloaded it. Works perfectly! :D

    My admins have already taken to it as well as I have too! Thank you!

    Kevn1997 The only problem I come up with (and it's not a huge problem) is whenever I reload the server (afk or not) i receive the message "You are now not AFK". Even though I was clearly not afk before lol.

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

    Kevn1997

    I think that was a bug. I have set the plugin to automatically remove AFK status when the server shuts down as I am only using temporary memory, HashMap, to store important data. I will fix that soon. Also, if you restart server, the custom message should be gone as it is only stored in HashMap.
     
  14. Offline

    PHLegacy

    oh okay that explains a bit more.
     
  15. Offline

    Kevn1997

    Oh yea, I have made a DevBukkit page for this, link here. Also, a new update ! :D I fixed the "You are now not AFK" message and a hidden bug. I have also re-added back the god mode and this time, you can select who can be god-mode.

    New commands (also found in /AFK help) :
    /AFKSigns god <true / false>
    /AFKSigns god current
    /AFKSigns god <player> <true / false>
    /AFKSigns god <player> current

    New permissions :
    afksigns.god.personal
    afksigns.god.others

    Dropbox link here.
     
    PHLegacy likes this.
  16. Offline

    PHLegacy

    Love it! haha :D
     
  17. Offline

    Chloe-chan

    Hey, here's an add-on to your plugin. ^^ Link here.
     
  18. Offline

    Chloe-chan

    PHLegacy

    New update : 1.1.2
    Download link: Here, since unapproved yet, here.

    Fixed a major error in code of saving messages
    *Note: Please delete the save files, as it is basically useless before the update.
    If you can remember who have what messages, and you wish to use it back, copy it out somewhere, then paste back in the new save file.
     

Share This Page