Mythruna
May 11, 2024, 05:05:41 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the new forums. See "Announcements" for a note for new users.
 
   Home   Help Search Login Register  
Pages: 1 [2] 3
  Print  
Author Topic: A servers list for Mythruna  (Read 23542 times)
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #15 on: May 18, 2013, 05:17:09 PM »

I thought about finding an active server yesterday. Unless the game can search and save for me I will prob not switch servers much. I want to play so bad!

It will probably be more inviting with more RPG elements, anyway.  Then the character of the server could really change from admin to admin, player set to player set.
Logged
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #16 on: May 18, 2013, 06:57:04 PM »

What sort of protection system did you have in mind?  The property system is supposed to cover that.

An aside, not in this next version of Mythruna but hopefully the next one, there will be some level of default server list support built into the client.  I only mention it because by then a registered server will be able to specify that it only allows "real users" on, ie: users who have actually paid.  This should cut down on the griefing tremendously, I think... for servers that don't want to go so far as to require a whitelist.

I don't mean to side track your site because I think it's cool.  Just trying to keep everyone abreast of the fact that sooner rather than later, you will be able to run a server that isn't open to every guest who comes along.

...or course, all of these releases were supposed to be done by now.   Undecided

A property system will be a good start to protect things.

Also the option to limit a server to "real users" is a good choice. Minecraft servers works also that way (you can choose to allow real users or not).
Within the 'server.properties' file, it contains a setting 'online-mode=' and it uses a boolean expression for it. Uses that feature to check if the user is verified or not, but they are a troll, they tell you ( or at least for bukkit servers ) to include '-o true' in your run.bat file, so no matter what online-mode is set to true, they don't want people with cracked mc to get on..
Logged
Endimmion
Donators
Newbie
***
Posts: 12


View Profile WWW
« Reply #17 on: July 13, 2013, 07:49:16 AM »

Hello,

I have added a little script I made (groovy is rather easy to learn) that wrote the number of players connected to a file.

Now my servers list will check if a webserver is available for each registered servers on the same IP as the server and then get the content of the players count file.

That allow me to display the number of connected players on the list. It's really sucks to have to do that, but at least it works.

If someone want to register his server and want this plugin, just ask.
Logged

pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #18 on: July 13, 2013, 10:25:01 AM »

Hello,

I have added a little script I made (groovy is rather easy to learn) that wrote the number of players connected to a file.

Now my servers list will check if a webserver is available for each registered servers on the same IP as the server and then get the content of the players count file.

That allow me to display the number of connected players on the list. It's really sucks to have to do that, but at least it works.

If someone want to register his server and want this plugin, just ask.

Do you only show this in the server's details or do you show it on an overview screen with the list of all servers?

How much control do you have over what's running on your server?

Architecturally speaking, it is better if the Mythruna servers can notify you about the number of players, etc. that they have.  This changes rather infrequently compared to the other direction... where you ask every server what it's player count is every time the page is refreshed.  In the first case, no activity means no traffic.  In the second case, every server gets hit for every viewer of the page (or if you cache it a minimum of X times a day).  If I added this support right to Mythruna as you requested then that either means I add a lighweight web server into Mythruna (like JAX-RS's built in server), implement a separate connection/response custom protocol, or hack this into the existing game connections.  The first option of these is the best, architecturally speaking but that means every time some page needs this info then they are hitting the server with a web request.

This is why the official server list will go with the reverse approach I mentioned earlier.  When the servers come online or have changes in status, they will make an xml-rpc call to the main server list (because that's what my site already supports... I'd actually prefer a REST API but I can avoid writing code this way).  For registered game servers, this also means that other web pages can ask for this status from mythruna.com directly.

Then it's just a matter of pinging the servers to see if they are still online once in a while... which could be metered by how recently they last reported.
Logged
Endimmion
Donators
Newbie
***
Posts: 12


View Profile WWW
« Reply #19 on: July 13, 2013, 10:43:10 AM »

Every values on my list is cached. Each servers is queried every 5 minutes and the results is cached. It's a "background process" who handle that.

And as I said in a previous post, I don't ask for a lightweight server into Mythruna. I asked the same solution as every game used, aka: A query protocol inside the game that return some values, like "server version", "connected players" and "max players allowed on the server".


You solution for the official servers list seems good, but how will it work for players count? Every time the number of players change, the server will make a call to the main server list?
Logged

pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #20 on: July 13, 2013, 11:05:01 AM »

Every values on my list is cached. Each servers is queried every 5 minutes and the results is cached. It's a "background process" who handle that.

And as I said in a previous post, I don't ask for a lightweight server into Mythruna. I asked the same solution as every game used, aka: A query protocol inside the game that return some values, like "server version", "connected players" and "max players allowed on the server".

How else would this be supported than to implement some light weight connection server into the Mythruna server?  If I used JAX-RS and a simple REST interface than it could trivially be queried in standard mash-up style.  It's just not a good idea for these poor servers to be answering this question 100s of times.  Otherwise, I have to implement some custom protocol which is still another port and still another set of classes managing those connections.  It may be slightly lighter weight but that doesn't change the real architectural issue.

(BTW: using JAX-RS it would probably take less than an hour or two to write a plugin for this... presuming a certain familiarity with REST concepts.)

I suppose the ping protocol could include some info as its ping response.  That would all be done with UDP so wouldn't even require a full connection setup... on the other hand, it also means that queriers will be potentially hitting the server multiple times if they don't get a response right away.

You solution for the official servers list seems good, but how will it work for players count? Every time the number of players change, the server will make a call to the main server list?

Yes... they are already calling the server to verify the user anyway.  It's just an extra call when the user logs out again... which could also be batched and cached. 

On average, this count will change much less often than 20 times an hour X number of server lists querying... and that presumes they are all nice about not querying more often than 20 times an hour.
Logged
Endimmion
Donators
Newbie
***
Posts: 12


View Profile WWW
« Reply #21 on: July 13, 2013, 12:19:10 PM »

It's just not a good idea for these poor servers to be answering this question 100s of times. 

We are talking about dedicated servers here. Not an on old pentium running on a 56K connection. If a server cannot hold several queries (something less than a 1kb), then it will not be able to support more than a few players.

On Minecraft there are thousand servers (I'm tracking myself more than 8,400 on my Minecraft servers list) with more than 100 players connected along the day on each server. Theses servers are registered on several lists and are queried from every direction several times per seconds: and there is no problem.


Your system reminds me the one using by Counter-Strike. But it was using two ways:
- a first way with a master list like your idea
- a second way with a basic query protocol (to allow users create their own script to display server status on a website without overloading the master list)

Logged

pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #22 on: July 13, 2013, 12:32:52 PM »

I can make it part of the ping protocol.  If you need me to implement this now then I could probably put regular development on hold until August or so to get this plugin done.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #23 on: July 13, 2013, 12:39:12 PM »

Or maybe someone else that doesn't already have three development environments open could implement it.

The plugin would look something like:
Code:
AtomicInteger numPlayers = new AtomicInteger(0);
on( serverStarted ) {
    // Start a server thread or whatever with access to numPlayers
}

on( playerJoined ) {
    numPlayers.incrementAndGet();
}

on( playerLeft) {
    numPlayers.decrementAndGet();
}

With JAX-RS you should be able to start a server in one or two lines, I think... I don't know if they have built in groovy niceness or if you will have to create a Java class to act as the resource.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #24 on: July 13, 2013, 12:57:29 PM »

The jersey JAX-RS implementation would look something like this in Java:

Code:
package stats;

import whatever stuff
import com.sun.jersey.api.container.grizzly2.GrizzlyServerFactory;
import com.sun.jersey.api.core.*;

public class StatsServerConfig extends DefaultResourceConfig {
    private AtomicInteger playerCount;

    public StatsServerConfig(AtomicInteger playerCount) {
        super( StatsResource.class );
    }

    public AtomicInteger getPlayerCount() {
        return playerCount;
    }

    public static HttpServer startServer( URI baseUri, AtomicInteger playerCount ) {
        StatsServer config = new StatsServer(playerCount);
        return GrizzlyServerFactory.createHttpServer(baseUri, config);
    }
}

Code:
package stats;

import whatever stuff

@Path("/stats")
public class StatsResource {
    @Context
    private Application app;
   
    @GET
    @Produces("text/plain")
    public String getPlayerCount()
    {
        return ((StatsServerConfig)app).getPlayerCount().get();
    }
}

Or something like that.  It's just kind of off the top of my head but it should be clear that for a Java dev it's not particularly difficult.  The query for this would then be "http://host/stats/playerCount"  If the baseURI was "http://host/"

It would surprise me very very much if groovy didn't have a way to do this easier.  I've just never looked but I have made a few REST resources using jersey before so I had stuff to look at.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #25 on: July 13, 2013, 12:58:19 PM »

Reference: https://jersey.java.net/
Logged
Endimmion
Donators
Newbie
***
Posts: 12


View Profile WWW
« Reply #26 on: July 13, 2013, 01:01:49 PM »

I can make it part of the ping protocol.  If you need me to implement this now then I could probably put regular development on hold until August or so to get this plugin done.

I think that a new public build is much important for Mythruna community than a query/ping protocol for the moment  Smiley

I will try to look with the few examples you gave, if I can do something (never do groovy or java).
Logged

pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #27 on: July 13, 2013, 01:43:59 PM »

I can make it part of the ping protocol.  If you need me to implement this now then I could probably put regular development on hold until August or so to get this plugin done.

I think that a new public build is much important for Mythruna community than a query/ping protocol for the moment  Smiley

I will try to look with the few examples you gave, if I can do something (never do groovy or java).

Hopefully someone else chomping at the bit to help with plugins can give you a hand.  Someone who knows Java well should be able to run through the jersey samples and figure it out pretty quickly.
Logged
belgariad87
Donators
Hero Member
***
Posts: 507


RPG player for life


View Profile
« Reply #28 on: July 13, 2013, 11:27:34 PM »

Maybe Shzylo cld help?
Logged

Specs for future reference:
Windows 7 64bit ; Intel Quad Core ; 8GB RAM ; AMD Radeon HD 6800 ; TB HD
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #29 on: July 13, 2013, 11:39:00 PM »

Maybe Shzylo cld help?
o.o when did I get in this? all I did was make an API XD
EDIT: I do plan into looking into those scripts that Paul posted a bit.
Logged
Pages: 1 [2] 3
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!