ServerEvents
Note: the original plugin and almost all of the work done on it is by croemmich. He doesn't have the time to work it any more, so he's allowed me to maintain it.
ServerEvents prints customizable messages to chat, Twitter, a database, or to a file. See the configuration file below for a better idea of what the plugin does.
If you appreciate this plugin, you are welcome to .
Installation
- Download mysql-connector-java-bin.jar and twitter4j-core.jar and place them in the root server directory.
- Download ServerEvents.jar and place it in the plugin directory.
- Start the Minecraft server to generate the configuration file.
- To enable output to Twitter, run the command /serverevents register (requires permission serverevents.register) and follow the directions it gives. It can be run from server console or in-game. Alternately, if for whatever reason you don't want to use the command, you can use the old method of running "java -jar ServerEvents.jar" from the command line.
- Edit server_events.xml to your liking.
- Restart the server, or use the command /serverevents reload (requires permission serverevents.reload) to make the plugin re-load any changes you've made to server_events.xml.
Developer API
ServerEvents now has a developer API that allows developers to add, remove, and trigger messages. Currently there is not built in support for custom message types, however you can implement that on your own.
Implementation
Add ServerEvents.jar to your build path. In Eclipse -> Add External Jar
Place the following in your plugin's onEnable().
Plugin serverevents = this.getServer().getPluginManager().getPlugin("ServerEvents"); if (serverevents != null) { if (!serverevents.isEnabled()) { getServer().getPluginManager().enablePlugin(serverevents); } } else { log.info("ServerEvents plugin not installed. Disabling plugin."); this.getServer().getPluginManager().disablePlugin(this); }
Then simply make API calls anywhere in your code.
/* Add/Remove Messages */ ServerEvents.addMessage(Messages.Type.RANDOM, "Hello World!"); ServerEvents.removeMessage(Messages.Type.RANDOM, "Hello World!"); /* Add a message with parameters */ HashMap<String, String> params = new HashMap<String, String>(); params.put("cmd", "/i 1 64"); params.put("full", "true"); ServerEvents.addMessage(Messages.Type.COMMAND, "%n used the command: %cmd", params); /* Display a message right now. */ ServerEvents.displayMessage("Hello World!");
Source - https://github.com/Brettflan/ServerEvents
For old discussion of this mod, you can head over to the main Bukkit forum:
http://forums.bukkit.org/threads/1796/
Thanks to mrgreaper for the idea and messages!
@samdrake112
You probably have the "add_timestamp" Twitter setting (in server_events.xml) as false. People have reported that Twitter will start rejecting duplicate messages, which that setting should prevent if left enabled.
Hello,
I am having issues with this posting to twitter, i have it set up correctly, it has posted once and now it will not, any help would be much appreciated
Thanks
@Liger_XT5
It needs to be loaded as a plugin through Bukkit, yes, if that's what you're asking.
You can run the JAR file externally for the initial setup for Twitter integration, though that's not even necessary as of the 1.5.0 release.
So to be able to send to twitter with this, the .jar has to be running all the time? Or just once?
I have an unfortunate announcement: since I've just closed down my own Minecraft server for various reasons (mostly boiling down to me not having enough time to devote to it), most of my motivation for working on Bukkit plugins is now gone. I most likely will not be actively developing any plugins I'm involved in from this point on. However, I still plan to maintain all plugins as needed for new Bukkit releases and minor bugfixes and such, I just probably won't be adding any major new features or answering much in the way of support questions.
The source will remain available for all plugins, and I'd welcome anyone to take up active development. For Factions, Cayorion / Olof (the original author and still constant contributor for the plugin) will of course remain to develop the plugin and will continue to run the Massivecraft server.
If anyone really wants a particular feature added to one of the plugins I've worked on, I will still consider doing sponsored feature requests; no promises, of course.
Also, for Factions, I plan to try to make sure the 1.7 branch is ready before halting active development on it. There will also be at least one more 1.6.x release before then, probably quite soon. So, this announcement is a bit in advance of me ceasing active development on Factions.
Sorry, guys. Again, I will at least try to bugfix and maintain my plugins for Bukkit updates, but that's about it.
@djrazr
I haven't seen one. Feel free.
Is there a german translation yet? I would really like to have that in german, otherwise i'll translate that now..
@TDB_South_Paw
I don't really see how another plugin and ServerEvents would be conflicting with each other in any way, no; ServerEvents only monitors specific events, it doesn't change them in any way.
@Brettflan
I didn't expect the plugin to cause such a problem either, I was rather surprised when it did.
I'm not much of a coder but, could it possibly be another plugin interfering with the processes?
@TDB_South_Paw
I can't reproduce your problem and there's no apparent reason that ServerEvents would be causing it.
I've actually recently spent a little time testing my plugins using Bukkit's "timings" command to determine how much time each spends handling various events, and ServerEvents was using practically no time at all during PlayerJoinEvent, particularly compared to most other plugins.
I do have my ServerEvents message list trimmed down quite a bit from the default config, but even so that shouldn't make as big of a difference as would be indicated by what you're saying.
Used this before and (specifically for making the server say stuff in game. don't want/need twitter)
However, added it to our 1.2.5 server, lags it up horribly and makes more than half the players unable to connect. Removed this and re-ran server, lag stopped.
3x Xeon Core Server with 32GB RAM.
@Brettflan
I'll run it again, but the lag started when I loaded SE and stopped after I removed it... I'll continue to test. T Hanks Brettflan
@LulzSek
You might want to test that theory out a bit further. This plugin does nothing which should cause server stress. It only monitors players joining, leaving, dying, and using commands, and runs a random message task which only triggers once every 30 minutes by default. For each of those it triggers a separate thread to send messages as needed.
This works really well, bug lags my server horribly.
Server is a 8-core Xeon w/ 16GB RAM.
Released 1.5.0
/serverevents reload - reload data from server_events.xml without having to restart server. Requires serverevents.reload permission.
/serverevents register - register with your Twitter account (this is an alternate method to doing it by executing the JAR outside of CraftBukkit). Requires serverevents.register permission.
Registration process now outputs the initial authorization URL to the file "/plugins/serverevents/twitter_key_info.txt". Once you have entered the appropriate PIN to complete the process, it will also output a completed twitter entry to the same file above, which can be copied over into your server_events.xml file.
This is mainly to help facilitate going through Twitter registration as a player in-game, though running it through the server console is recommended. After completing registration and updating your server_events.xml file accordingly, you can of course then use /serverevents reload to get the Twitter integration up and running.
Note that it's only compatible with CraftBukkit 1.1-R6 and above, so don't expect it to work in 1.1-R4 and lower.
Could we add a command to reload the file in game? I frequently drop new server tips in and out of the file, and a required restart is extremely unwieldy for this type of plugin. Perhaps something that behaves similarly to the mcdocs /reload command?
Released 1.4.4.
Released 1.4.3.
Primarily a compatibility release to support the upcoming CB 1.1-R5 and above.
@ghostofvalen
in the "<twitter" definition in server_events.xml, add this: add_timestamp="true"
So, for example:
<twitter enabled="true" blah="blah" etc="etc" add_timestamp="true" />