Page 1 of 1

Bukkit Plugins: Querying Server

Posted: Sun May 27, 2012 7:55 pm
by Samuel98
Content Deleted

Re: Bukkit Plugins: Querying Server

Posted: Sun May 27, 2012 9:11 pm
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.

Re: Bukkit Plugins: Querying Server

Posted: Sun May 27, 2012 11:42 pm
by Samuel98
Content Deleted

Re: Bukkit Plugins: Querying Server

Posted: Mon May 28, 2012 4:47 pm
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

Re: Bukkit Plugins: Querying Server

Posted: Mon May 28, 2012 7:05 pm
by Samuel98
Content Deleted

Re: Bukkit Plugins: Querying Server

Posted: Mon May 28, 2012 7:57 pm
by Samuel98
Content Deleted

Re: Bukkit Plugins: Querying Server

Posted: Tue May 29, 2012 12:23 am
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.

Re: Bukkit Plugins: Querying Server

Posted: Tue May 29, 2012 12:34 am
by Samuel98
Content Deleted

Re: Bukkit Plugins: Querying Server

Posted: Tue May 29, 2012 6:54 am
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

Re: Bukkit Plugins: Querying Server

Posted: Wed May 30, 2012 10:06 pm
by Samuel98
Content Deleted

Re: Bukkit Plugins: Querying Server

Posted: Wed May 30, 2012 10:26 pm
by jacek
Good job :D

Also "wide" :(

Re: Bukkit Plugins: Querying Server

Posted: Thu May 31, 2012 12:50 am
by Samuel98
Content Deleted

Re: Bukkit Plugins: Querying Server

Posted: Thu May 31, 2012 5:03 pm
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.

Re: Bukkit Plugins: Querying Server

Posted: Thu May 31, 2012 7:53 pm
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.

Re: Bukkit Plugins: Querying Server

Posted: Thu May 31, 2012 8:06 pm
by Samuel98
Content Deleted

Re: Bukkit Plugins: Querying Server

Posted: Thu May 31, 2012 8:44 pm
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.

Re: Bukkit Plugins: Querying Server

Posted: Thu May 31, 2012 9:43 pm
by offluffy
Oh, sorry XD I wasn't aware you wrote MineBans O.o This explains a bit to me now.

Re: Bukkit Plugins: Querying Server

Posted: Thu May 31, 2012 9:56 pm
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 ;)