Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Trading Journey
by 7th_zorro. 04/27/24 04:42
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 770 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
[ANet or other maybe] Auto-remove dead servers from serverlist #341083
09/10/10 14:00
09/10/10 14:00
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline OP
Senior Member
Razoron  Offline OP
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
Hi,
the serverlist is stored in a MySQL database on a debian root server.
Everyone can host games. But what, when the internet connection of the hosting gamer is interrupted?
The server is still in the serverlist, but in reality it doesn't exist anymore.
How to remove the "server corpses"?

- Let the server do "cronjobs" every minute to check if he can connect to the server.

But how to do that? I could code a program using winsock, that runs on the server. The problem: How to connect to an ANet game server without calling the EVENT_CONNECT events.

Any suggestions how to do this and cleanup the serverlist?

Last edited by Razoron; 09/10/10 14:01.
Re: [ANet or other maybe] Auto-remove dead servers from serverlist [Re: Razoron] #341085
09/10/10 14:20
09/10/10 14:20
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
We send updates. If a server on the list isn't updated after waiting for 60 seconds, then that means the server is not running any more.

Then (if I remember correctly) every time someone attempts to download the list of servers, we run a code to check which server entries in the list have not been updated during the past 60 seconds, and those are deleted before returning the server list to the one who requested it.

May not be the best method, but it works great for us.


~"I never let school interfere with my education"~
-Mark Twain
Re: [ANet or other maybe] Auto-remove dead servers from serverlist [Re: Germanunkol] #341086
09/10/10 14:26
09/10/10 14:26
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline OP
Senior Member
Razoron  Offline OP
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
Yes, thats a solution without an external cleaner program. It is not the fastest, but possible. Thanks laugh.
Other suggestions are still welcome.

Re: [ANet or other maybe] Auto-remove dead servers from serverlist [Re: Razoron] #341095
09/10/10 16:54
09/10/10 16:54
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline
User
SchokoKeks  Offline
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
I've once used the same method as Germanunkol, it worked ok.

problem was that the few servers made by players were usually unconnectable because the users didn't forward the ports the server needed. They didn't know their servers were unconnectable and they stayed in the list because regular updates were send.

Others players quickly got frustrated when they couldn't connect to any game.

A much cleaner solution would be server-side checking for the "connectablility" of the servers. You could try to connect via raw UDP with ANET and PHP (if UDP is allowed on your server), or you'd have to use an external program.

Re: [ANet or other maybe] Auto-remove dead servers from serverlist [Re: SchokoKeks] #341098
09/10/10 17:48
09/10/10 17:48
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline OP
Senior Member
Razoron  Offline OP
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
You can open an UDP socket with PHP?
Great, I will check it out.
We have root access to our, server I think this won't be the problem.

Re: [ANet or other maybe] Auto-remove dead servers from serverlist [Re: Razoron] #341099
09/10/10 18:35
09/10/10 18:35
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Why not use NAT-PMP and/or UPnP to open the ports? The players want to play the game, not play with their routers. (I know that this is Off-Topic)


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: [ANet or other maybe] Auto-remove dead servers from serverlist [Re: WretchedSid] #341106
09/10/10 20:40
09/10/10 20:40
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline OP
Senior Member
Razoron  Offline OP
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
That's a point we can think about if the game is ready.
There is also Warcraft III, a very popular game, where the host has to open the port manually, but it is still very succesfull. I hope, that won't be the problem.

Re: [ANet or other maybe] Auto-remove dead servers from serverlist [Re: Razoron] #341607
09/18/10 16:08
09/18/10 16:08
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Quote:
Then (if I remember correctly) every time someone attempts to download the list of servers, we run a code to check which server entries in the list have not been updated during the past 60 seconds, and those are deleted before returning the server list to the one who requested it.


The serverlist template of ANet does it exactly this way. This method is great because it can be done in PHP+SQL without a special program or setting on the server.

Quote:
A much cleaner solution would be server-side checking for the "connectablility" of the servers.


You could also implement the first methode and let the client (the one who is searching) check if he can connect to the servers in the list. This way you can also get informations about the ping to the server.


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [ANet or other maybe] Auto-remove dead servers from serverlist [Re: Dark_samurai] #344770
10/20/10 15:49
10/20/10 15:49
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
how would you accomplish that check? i mean, not like you can make him join all the servers and disconnect.. [srry, not a pro at mp just yet]

Re: [ANet or other maybe] Auto-remove dead servers from serverlist [Re: darkinferno] #344776
10/20/10 16:36
10/20/10 16:36
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
You could do it with sockets. Every server has an opened udp socket and the client tries to send a packet to them and waits for an acknowledge packet. ANet although only supports one udp socket opened at the same time so this would be slow. But if you access the windows socket functions from Lite-C you could open more sockets at the same time => faster
But I never tested this, so it's possible that this idea won't work good/fast enough.

Checking it through a timestamp in the sql db is also no bad methode at all. So the decision is yours if you think it's worth to try the socket based methode. I never did...


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1