1 registered members (AndrewAMD),
945
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: [ANet or other maybe] Auto-remove dead servers from serverlist
[Re: Dark_samurai]
#344827
10/20/10 22:12
10/20/10 22:12
|
Joined: Jun 2001
Posts: 1,004 Dossenbach
nfs42
Serious User
|
Serious User
Joined: Jun 2001
Posts: 1,004
Dossenbach
|
GSTChannels uses php/mysql on a http-server to register servers. every 60 secs the different 3dgs gstnet servers execute a non-blocking http request to update various properties for the appropriate server in the list with a timestamp.
the serverlist call is also an http request which execute at first a query to delete those servers where the last timestamp is older than 120 seconds (gui or non gui version).
that should work for most mp games.
Andreas GSTools - Home of GSTScript 0.9.8: lua scripting for A6/7/8 GSTNet 0.7.9.20: network plugin for A6/7/8 GSTsqlite 1.3.7: sql database plugin for A6/7/8 3DGS Codebase: 57 snippets || 3DGS Downloads: 248 files
|
|
|
Re: [ANet or other maybe] Auto-remove dead servers from serverlist
[Re: nfs42]
#349056
12/03/10 15:14
12/03/10 15:14
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
Hey guys,
I've got a similar set-up for my serverlist (PHP and MySQL). I want to prevent servers behind routers that haven't set up port-forwarding from being able to create an online server, but I don't actually know anything about socket programming (neither A8 socket programming nor what to do on the PHP side).
Can anyone give me some hints? I can normally get through things by some trial and error, but this time I'm trying to solve 3 problems, and I won't know if any of them work until they all work: 1. Being able to receive information on A8's side; 2. Being able to send information from the PHP serverlist; 3. Port-forwarding on my own machine -- I'm behind a router, and while I think I've set it up I don't have a way of testing that it works :S
Thanks,
Jibb
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: [ANet or other maybe] Auto-remove dead servers from serverlist
[Re: JibbSmart]
#349130
12/04/10 09:00
12/04/10 09:00
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
You could do this without writing your own socket program. You could let the game server open a "test server" before the real game server is started. Then this server sends a http_post() for calling a php script on the php/mysql server. This script starts a client.exe that tries to connect with the "test server" (so you should send the port of the game server to the script; you can get the ip address through a php instruction). If the connection is successful, the client.exe calls a php script on the localhost (because the php server and the client.exe run on the same machine) and this script adds the server to the list. If the connection event is called on your game server it knows that the client could successfully connect. => the "test server" is closed and the real server is started. Shouldn't be to hard to implement with ANet. Just a few lines of code Also the php part is easy.
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]
#349178
12/04/10 17:18
12/04/10 17:18
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
Thanks, I like the idea, but I'm using a free (for now) PHP/MySQL host, and while relatively soon I'm going to use a paid host, I'm still aiming for something really cheap (and thus it's really just PHP/MySQL). I'm not actually hosting the server myself, so I don't think I have enough freedom with it to run executables on the serverlist server.
Any code snippets or small examples from anyone for having A8 communicate with a PHP server through socket_connect?
I really have no idea.
Jibb
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
|