Bukkit Plugins: Querying Server

Any help topics that don't fit in the current categories can go here.
Post Reply
User avatar
Samuel98
Posts: 46
Joined: Wed Oct 05, 2011 1:20 am
Location: United Kingdom
Contact:

Bukkit Plugins: Querying Server

Post by Samuel98 »

Content Deleted
Last edited by Samuel98 on Sun Mar 22, 2015 9:39 pm, edited 1 time in total.
Image

Samuel Carr
Server Developer
W: http://epiccrafts.co.uk
E: [url]mailto://samuel.carr@epiccrafts.co.uk[/url]
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Bukkit Plugins: Querying Server

Post by jacek »

It might be easier to read the banned-players.txt file ?

All I could advise it to look at Minequery and try to do something similar.
Image
User avatar
Samuel98
Posts: 46
Joined: Wed Oct 05, 2011 1:20 am
Location: United Kingdom
Contact:

Re: Bukkit Plugins: Querying Server

Post by Samuel98 »

Content Deleted
Last edited by Samuel98 on Sun Mar 22, 2015 9:39 pm, edited 1 time in total.
Image

Samuel Carr
Server Developer
W: http://epiccrafts.co.uk
E: [url]mailto://samuel.carr@epiccrafts.co.uk[/url]
User avatar
offluffy
Posts: 65
Joined: Tue Mar 20, 2012 7:04 am

Re: Bukkit Plugins: Querying Server

Post by offluffy »

It seems like if you have access to the file, you can use something like AJAX to fetch the file from the web page's code. But I guess then the webpage would have to be hosted on the same system the server is on, and you'd probably need the full path to the file on the webpage when it fetches it (which wouldn't make it very useful to a lotta minecraft server). Then probably split the file into substrings if you need an array. Or you can have the plugin to read from the file somehow and insert a value into a database (which then can be remote or local) for each user in the list. But in order to make a plugin that can be queried by a remote server, from what I've heard, you'd have to create a virtual server inside the MC server that can be queried, which just sounds too complicated for me XD
User avatar
Samuel98
Posts: 46
Joined: Wed Oct 05, 2011 1:20 am
Location: United Kingdom
Contact:

Re: Bukkit Plugins: Querying Server

Post by Samuel98 »

Content Deleted
Last edited by Samuel98 on Sun Mar 22, 2015 9:39 pm, edited 1 time in total.
Image

Samuel Carr
Server Developer
W: http://epiccrafts.co.uk
E: [url]mailto://samuel.carr@epiccrafts.co.uk[/url]
User avatar
Samuel98
Posts: 46
Joined: Wed Oct 05, 2011 1:20 am
Location: United Kingdom
Contact:

Re: Bukkit Plugins: Querying Server

Post by Samuel98 »

Content Deleted
Last edited by Samuel98 on Sun Mar 22, 2015 9:40 pm, edited 1 time in total.
Image

Samuel Carr
Server Developer
W: http://epiccrafts.co.uk
E: [url]mailto://samuel.carr@epiccrafts.co.uk[/url]
User avatar
offluffy
Posts: 65
Joined: Tue Mar 20, 2012 7:04 am

Re: Bukkit Plugins: Querying Server

Post by offluffy »

Well, says there's an error in your plugin judging by the
at me.samzrulez.bukkit.samzrulez.util.QueryServer.<init>(QueryServer.java:22)
at me.samzrulez.bukkit.samzrulez.SamzRulez.<init>(SamzRulez.java:54)

I'm no good at query servers, but might help if ya included the code from the QueryServer class. Maybe just the chunk that code is in at least. I bet the SamzRulez line 54 is just pointing to the QueryServer class.
User avatar
Samuel98
Posts: 46
Joined: Wed Oct 05, 2011 1:20 am
Location: United Kingdom
Contact:

Re: Bukkit Plugins: Querying Server

Post by Samuel98 »

Content Deleted
Last edited by Samuel98 on Sun Mar 22, 2015 9:40 pm, edited 1 time in total.
Image

Samuel Carr
Server Developer
W: http://epiccrafts.co.uk
E: [url]mailto://samuel.carr@epiccrafts.co.uk[/url]
bowersbros
Posts: 534
Joined: Thu May 05, 2011 8:19 pm

Re: Bukkit Plugins: Querying Server

Post by bowersbros »

SamzRulez wrote:Hello,

Yh the main class file (SamzRulez.java:54) is just pointing to (QueryServer.java).

I cant show u the code for that cause a while after i post about that error i remove code and start again. Now im getting a different error, but im on my laptop and my pc is when im making it on.

-Samuel


Post that error when you can, and the code that makes it, and we'll take a look at it
I don't like to brag, but I wasn't circumcised. I was circumnavigated. ;)

Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
User avatar
Samuel98
Posts: 46
Joined: Wed Oct 05, 2011 1:20 am
Location: United Kingdom
Contact:

Re: Bukkit Plugins: Querying Server

Post by Samuel98 »

Content Deleted
Last edited by Samuel98 on Sun Mar 22, 2015 9:41 pm, edited 1 time in total.
Image

Samuel Carr
Server Developer
W: http://epiccrafts.co.uk
E: [url]mailto://samuel.carr@epiccrafts.co.uk[/url]
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Bukkit Plugins: Querying Server

Post by jacek »

Good job :D

Also "wide" :(
Image
User avatar
Samuel98
Posts: 46
Joined: Wed Oct 05, 2011 1:20 am
Location: United Kingdom
Contact:

Re: Bukkit Plugins: Querying Server

Post by Samuel98 »

Content Deleted
Last edited by Samuel98 on Sun Mar 22, 2015 9:41 pm, edited 1 time in total.
Image

Samuel Carr
Server Developer
W: http://epiccrafts.co.uk
E: [url]mailto://samuel.carr@epiccrafts.co.uk[/url]
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Bukkit Plugins: Querying Server

Post by jacek »

I was just kidding ;)

I have never used GroupManager, sorry :(

SamzRulez wrote:Also How can I add temporary bans to ur ban plugin?

You mean MineBans ? Have a look at the API docs, there is a method you can use.
Image
User avatar
offluffy
Posts: 65
Joined: Tue Mar 20, 2012 7:04 am

Re: Bukkit Plugins: Querying Server

Post by offluffy »

I think maybe he was referring to the one you made in the tutorial? O.o Or was that just a kick plugin? .-. Dun remember.

In a plugin I made, I just had to keep a file of users and it would write when a player was banned (UNIX Time stamp, my fave), then it would check the current time stamp against the one in the file, and if the difference is greater than the time specified (also in the file) when the user attempts to log in, then the ban is removed. Being a UNIX time stamp, the ban time would need to be in seconds, but that's no big deal converting to/from seconds even if you want to be able to use minutes or whatever.
User avatar
Samuel98
Posts: 46
Joined: Wed Oct 05, 2011 1:20 am
Location: United Kingdom
Contact:

Re: Bukkit Plugins: Querying Server

Post by Samuel98 »

Content Deleted
Last edited by Samuel98 on Sun Mar 22, 2015 9:41 pm, edited 1 time in total.
Image

Samuel Carr
Server Developer
W: http://epiccrafts.co.uk
E: [url]mailto://samuel.carr@epiccrafts.co.uk[/url]
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Bukkit Plugins: Querying Server

Post by jacek »

offluffy wrote:In a plugin I made, I just had to keep a file of users and it would write when a player was banned (UNIX Time stamp, my fave), then it would check the current time stamp against the one in the file, and if the difference is greater than the time specified (also in the file) when the user attempts to log in, then the ban is removed. Being a UNIX time stamp, the ban time would need to be in seconds, but that's no big deal converting to/from seconds even if you want to be able to use minutes or whatever.


Exactly how I did it too :)

This https://github.com/betterphp/MineBans/b ... .java#L109 might be useful.
Image
User avatar
offluffy
Posts: 65
Joined: Tue Mar 20, 2012 7:04 am

Re: Bukkit Plugins: Querying Server

Post by offluffy »

Oh, sorry XD I wasn't aware you wrote MineBans O.o This explains a bit to me now.
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Bukkit Plugins: Querying Server

Post by jacek »

offluffy wrote:Oh, sorry XD I wasn't aware you wrote MineBans O.o This explains a bit to me now.

I think you were probably right ;)
Image
Post Reply