View Single Post
Old December 15, 2017, 16:27   #21
PowerWyrm's Avatar
Join Date: Apr 2008
Posts: 2,417
PowerWyrm is on a distinguished road
I was tired of the MAngband metaserver being down, so I looked at the TomeNET code to see if I could plug connection to the TomeNET metaserver instead. The format is a bit different:
- for MAngband, server info is given as "server name: port Number of players: n Names: player 1 ... player n Version: v"
- for TomeNET, server info is given as "<server url="server" port="port" protocol="2"><game>...</game><version>v</version><player>player 1</player>...<player>player n</player></server>

When a client connects to the metaserver to receive the list of available servers, the format is quite similar:
- for MAngband, a list of zero-terminated strings with "server" for server names, "%port" for port values and " notice" for anything else
- for TomeNET, a unique xml section "<meta>TomeNET metaserver</meta><server>server info 1</server>...<server>server info n></server>, with server info equal to what's sent from each server to the meta

I've implemented the required parsing to display entries from the TomeNET metaserver, while keeping the current code for the MAngband metaserver, and this part works fine (you can see TomeNET servers with their players, and even select them -- you'll just get a "not a PWMAngband server" error when connecting). The only problem is that I cannot register a PWMAngband server on the meta. No idea if it's because I'm doing that from my laptop which connects via a proxy to the internet, or if it's due to some restrictions on the metaserver, or simply because of a malformed request (I can connect a socket and send stuff, but the code doesn't wait for a reply so I cannot tell if the registration succeeded or not). I'll try that again tonight from my PC at home.
PWMAngband variant maintainer - check (or to learn more about this new variant!
PowerWyrm is offline   Reply With Quote