Plugin category: Admin Suggested name: ByYourCommand A bit about me: I'm pretty new into the Minecraft scene, but I now have my own server intergrated into my site. I love Battlestar Galactica (hence the name of the plugin ) And I'm really hoping to have my site and server unified and have seemless transitions from one to the other! What I want: Okay, so basically, it's pretty simple (I think). All I would like, is a plugin that listens for emails from a certain address, and when it recieves said emails, it reads the contents, and if it is a command, it will execute it. I know there is a plugin out there called TextPlayer (Which I have tried, and is amazing), which does some thing like this, but unfortunatley it doesn't seem to like auto generated e-mails from an SMF server, some thing to do with the return e-mail address that is set to none by SMF I think. My over all plan is this: Users post on my forum and gain credits Users can use credits in the forum shop to buy in game items, eg, a dimond sword The forum shop sends an email to a specified email address, with the command /give USER 276 1 The plugin reads the email (For example a gmail account), recognises the email address it is sent from (or maybe even a secret key that has to be put in the body of each email, as the users never see the content of the message that is sent) The plugin executes the command and the user recieves their item Obviously, admins would also be able to email in other commands. Like server messages, commands to back up the server, the possibilites would be endless! Ideas for commands: Maybe just the one, eg: /byc check which could check for new messages on the email (Or just have it check every 60 seconds or so automatically) Ideas for permissions: Probably just byyourcommand.admin which would allow the user to use the check function? When I'd like it by: As soon as possible really Similar plugin requests: None that I know of Thanks in advance to any one that is interested in this idea
I already have a notice in each of the forums items that the user has to be online to receive the items, but maybe a log file that records the commands that are sent? That way if some one does it by accident when they are offline, the admin can view the log, see if they recieved the items, and give them the stuff manually?
I think there's better way to do this: from the forum side should be simple WebService with two methods (to get pending commands and to confirm performed commands). Plugin will check WS each minute and try to perform commands. When user is offline, command will not be confirmed as "done" so plugin will retry next time (until the user will be online). You don't have to add items manually when something went wrong (eg. user offline)
That sounds like a better idea Though would it still be emails form the forums? As that is how the system is set up and I can't change it to some thing else (I'm using a mod for the forums)
Hmm, commands have to be in database to use WS, so it won't work in this case. In this case, plugin should get commands from e-mail and save failed commands in file and then retry them.
The problem that I see with this is that the minecraft server will have to have access to the mail server and maintain a constant connection to listen for the message sent. I mean it can be done under the right circumstances and development of mail client for java however there are more viable options to sending items to players via web as opposed to email. As for the offline issue, you can always cache the info and/or save it till the player logs in. Do you have a pop3 connection to your mail server? If so I can make this happen. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Wouldn't it be easier just to use RCON and something like this? https://github.com/xPaw/PHP-Minecra...77b4719ed2a2fdeb3153b/MinecraftRcon.class.php
Have you tried BuyCraft? http://forums.bukkit.org/threads/mi...tore-bukkit-plugin-paypal-onebip-1-2-5.31848/
lol768 I wouldn't know where to start with that... and as I explained, it needs to be able to recieve from the forum email Norbo11 I have buycraft but that is for using physical money, I want to be able to use the forum points system
I sincerely doubt using email is the best way to do this, even if you already have everything in place but the plugin. For one thing, it opens a number of security holes that will be difficult to patch, unless you use some kind of signing/hashing algorithm. The way you do this is the server listens on a port for something, and the web site hands data to the server using a secret token only the web site and the server know. The "cheaper" way to do it is for the user to enter a command (or any other trigger such as onJoin) which then connects to a web service you have setup (again with a secret token) and requests whatever rewards the player has. The advantage here is no ports need to be opened for the service to be setup, and (slightly) less lag on the server. There might be a plugin out there to do this already for you, also you might be able to use UrlCommands. Something like this would work for simple rewards: Code: getmyrewards: url: http://www.yoursite.com/getrewards.php params: username data: key: secret_key_goes_here action:get_rewards resultConsoleCommand: "%commandToRun%" showPlayerResult: false
Ne0nx3r0 Look, I don't know a lot about this, so keep your facepalms to your self. At the end of the day, I've listed what I need, and if no one wants to help then fine, I can live with out the automated system if need be and I'll give out coupons instead. It would be nice however to be able to have it all automated
I made a semi working version, but this isn't viable. My spam filter started catching the messages. Then my mail server banned my ip for too many connections considering the connection to the server can't be held open for some reason (javax.mail) but out of boredom I attempted it. Code: 18:17:08 [SEVERE] javax.mail.AuthenticationFailedException: [IN-USE] Maximum num ber of connections from user+IP exceeded (mail_max_userip_connections) 18:17:08 [SEVERE] at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store .java:208) 18:17:08 [SEVERE] at javax.mail.Service.connect(Service.java:295) 18:17:08 [SEVERE] at javax.mail.Service.connect(Service.java:176) 18:17:08 [SEVERE] at com.modcrafting.emailcommand.Main$1.run(Main.java:124 ) 18:17:08 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(Craf tWorker.java:34) 18:17:08 [SEVERE] at java.lang.Thread.run(Unknown Source) It read one message which held the command /stop
As it's been said, email isn't the best way to do this. There are a number of other options. You could set up a currency system. Depending on what forums you use, and all this other stuff, you would be able to link your forums to your server. Then, all you have to do is set up a shop. Instead of having this shop send an email, then have the email execute /give (hopefully the user is online), you would set up a shop... Without any emailing involved. My favorite is ChestShop. They click the sign of the item they want. No emailing, simple. The hardest part would be linking your forums to your server. There are many ways to do this, I'm sure, but I don't know which forum system you use, or what it can do, or anything of the sort. Even if I did, I wouldn't be able to help you regarding linking forums, but there are many who could.
Looks like I'll just have to work out how to get TextPlayer working then. Thanks for at least attempting it though!
I'm not making fun of you, I was annoyed because you glazed over the working options I gave you and ignored the warnings about email. What you want to accomplish is very easy, and it's been done thousands of times: one server is the "sender" and the other the "listener", and between the two you hand the data you want. Yes, it requires some custom web site code, but that's still much simpler, more secure, and more stable than trying to write a custom email handler. Introducing email into the equation is akin digging a river between you and the grocery store because you own a jet ski and want to save on gas mileage.