Hello,
In hopes of making it easier for people to find and actually play games
I have been working on automatic server discovery. There are two parts
to this,
* local LAN discovery
* metaserver discovery
The unit of discovery is not server as one might first jump to but a
"game". Each game has a set of "locations" which is can be found at.
A game record has the following details,
Required Parameters:
tp, comma seperated list of version strings (0.3, 0.2)
server, version of the server
servtype, server type (tpserver-cpp, tpserver-py)
rule, ruleset name (MiniSec, TPSec, MyCustomRuleset)
rulever, version of the ruleset
Optional parameters:
plys, 1 number of players in the game
cons, 2 number of clients currently connected
objs, 3 number of "objects" in the game universe
admin, 4 admin email address
cmt, 5 comment about the game
turn, 6 unixtime stamp (GMT) when next turn is generated
A location is specified as a tuple of
protocol tp, tps, tphttp, tphttps
dns A resolvable name of the server
ip Resloved ip address of the server
port The port of the server
Local LAN discovery is being done with ZeroConf MDNS. Each server should
advertise a record PER GAME. The location details are automatically
discovered. The required and optional parameters should be found in the
TXT record.
A metaserver exists at metaserver.thousandparsec.net, to register a new
server you must send either a HTTP get or post request with the require
parameters. Each location is specified by doing the following
type0, dns0, ip0, port0 - details for first location
type1, dns1, ip1, port1 - details for second location
You must also send a "key", if the game with this name has never been
seen before the "key" will be stored. The key must then be sent for all
updates to take effect.
An example (using get) would be the following,
http://metaserver.thousandparsec.net/?action=update&tp=0.3,0.2&key=mykey&server=0.3.0&name=MyGame1&sertype=tpserver-cpp&rule=MiniSec&rulever=0.1&type0=tp&dns0=mithro.dyndns.org&ip0=203.122.246.117&port0=8000
All parameters are sanity checked but most are treated as a string.
To get the details about which servers exist the client should get the
following page.
http://metaserver.thousandparsec.net/?action=get
The server will return in the body of the message a Sequence frame
telling the number of "Game" frames to come. Game frames are described
as follows,
* a string, (name) Game name
* a string, (key) Empty on receive
* a list of Strings, (tp) List of protocol versions supported
* a string, (server) Server Version
* a string, (servtype) Server Type
* a string, (rule) Ruleset Name
* a string, (rulever) Ruleset version
* a list of,
* a string, (type) Connection type (tp, tps, ...)
* a string, (dns) Resolvable DNS name
* a string, (ip) IP Address
* a uint32, (port) Port to connect on
* a list of,
* a id, Optional param id
* a string, Optional param string value
* a uint32, Optional param int value
I plan for the metaserver to eventually support sending packets directly
without using HTTP (IE connect to port xxxx and send a game frame -
maybe even a UDP connectionless method), but for now it's just easier to
do it over HTTP.
The metaserver also has a "human" mode, just browse to
http://metaserver.thousandparsec.net/ and you should get a webpage
listing the the servers with clickable URLs.
I also plan to add a http://metaserver.thousandparsec.net/?rss version
which will display the same data as an RSS feed.
Any thoughts?
Mithro
_______________________________________________
tp-devel mailing list
[email protected]
http://www.thousandparsec.net/tp/mailman.php/listinfo/tp-devel