Author |
Message |
k0zy Server Help Squatter
Gender: Joined: Jan 11 2003 Posts: 571 Location: Germany Offline
|
Posted: Mon Apr 24, 2006 7:18 am Post subject: |
|
|
|
|
Smong wrote: | [..]
I don't think that's a good idea. There's only one dirserv and a webpage that talks to it could easily be abused. |
How?
And last time I checked there were multiple dir servers...
Ok, I haven't been around for a while, but I don't think that changed.
Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole.... _________________ It's a shark! Oh my god! Unbelievable! |
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Mon Apr 24, 2006 10:18 am Post subject: |
|
|
|
|
You have to connect to the server by the Core Protocol first, then use the core protocol's reliable packets for the directory section. You cannot do this in a blocking mode, because with this many packets you might lose one or two and would cause the socket to time out.
Smong wrote: | I don't think that's a good idea. There's only one dirserv and a webpage that talks to it could easily be abused. |
There is a feature called caching. If someone goes to the page, and it hasn't been updated in around 5 minutes, check the directory server for a new list. If hasn't been updated in a minute, check the zone's pings. Otherwise, use old cached data you have stored, which I'm assuming you might as well store so you could create pretty graphs of zone population/pings from a database. Or just cache directly to a text file. |
|
Back to top |
|
|
k0zy Server Help Squatter
Gender: Joined: Jan 11 2003 Posts: 571 Location: Germany Offline
|
Posted: Mon Apr 24, 2006 10:51 am Post subject: |
|
|
|
|
Mine GO BOOM wrote: | There is a feature called caching. If someone goes to the page, and it hasn't been updated in around 5 minutes, check the directory server for a new list. |
Exactly what I thought of.
Well, seeing as this is the first time I actually code something with sockets, it might take me a while to figure out.
What I'm looking forward to is, we'll learn about using sockets in C in our operating systems lesson at university. So this will be good practise
Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole.... |
|
Back to top |
|
|
Rog Newbie
Joined: Oct 18 2007 Posts: 18 Offline
|
Posted: Sat Oct 20, 2007 6:25 am Post subject: |
|
|
|
|
One note for this dated topic: If you are going to do anything with UDP you should set your sockets to a short time out (2 seconds should be more than enough). Otherwise, if your Subspace server is down and there is no answer at the ip+port your webpage will likely hang. Use: stream_set_timeout()
You could also extend it this way to indicate whether your server is online / offline. |
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Sat Oct 20, 2007 11:21 am Post subject: |
|
|
|
|
dated?
over a year... that's not dated, that's ancient _________________ (Insert a bunch of dead links here) |
|
Back to top |
|
|
CypherJF I gargle nitroglycerin
Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Sat Oct 20, 2007 4:40 pm Post subject: |
|
|
|
|
I would never let my webpage script's directly make a call to the directory server. When I did begin playing around with it I created PHP scripts which were executed by a scheduler (CRON) which pulled down current population, ip, and port. _________________ Performance is often the art of cheating carefully. - James Gosling |
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: Sun Oct 21, 2007 12:17 pm Post subject: |
|
|
|
|
a webpage that links directly to my directory server would get ip banned. (ie request to dir server made for every page refresh)
I only update the cache on my server of the main dir server every 30 - 60 mins, to minimize the bandwidth, whilst making it useful. If people have my server directry entered they get instant updates.
Cached queries as cypherJF says are the only acceptable and polite way, anything else is just abuse. _________________ Rediscover online gaming. Get Subspace | STF The future...prehaps |
|
Back to top |
|
|
k0zy Server Help Squatter
Gender: Joined: Jan 11 2003 Posts: 571 Location: Germany Offline
|
Posted: Sun Oct 21, 2007 2:28 pm Post subject: |
|
|
|
|
Why would someone ever not cache the results?
It's just stupid do query the directory server with every page refresh.
Not only because it creates unnecessary load on the dir server, but the page will also take longer to load.
Plus, if the dir server goes down, the page is useless. |
|
Back to top |
|
|
Goldeye Novice
Gender: Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Wed Dec 26, 2007 8:24 am Post subject: |
|
|
|
|
I made a PHP class to use the new ping protocol to report playing/total players for either the server or individual arenas. Requires minimal customization (IP,Port,and arena names).
I put it on the wiki: http://wiki.minegoboom.com/index.php/PHP_ping_client |
|
Back to top |
|
|
|