map-rotation retrieval

mario

Junior Member
Joined
Dec 6, 2004
Likes
0
#1
I've this web-based tool running (dbadmin) which I've downloaded from this site (the old one) once. I want to incorporate it somehow in the website but 1 feature I'd like to see if the current maprotation could be shown in the website. As I'm not into php I wonder if somebody knows how to do it or knows a little tool/prog which shows the current maprotation (so not the current map) inside the website. tnx
 
Last edited:

OldDog

Administrator Emeritus
Joined
Oct 31, 2003
Likes
0
Location
Essex Junction, Vermont
#2
Hmmm...I don't know of one, but it would be interesting to play with, and handy to have. I know a little PHP and VBScripting. SQuery has a pretty decent server config retrieval setup (I use it myself on my site)...the problem would be finding the parameters for the full map rotation. I'll screw around with it this weekend, and see what I can come up with.
 

jamiep

Junior Member
Joined
Dec 31, 2004
Likes
0
#3
Well here i am.... the creator of dbadmin :p

Been on a break but i think ive found how to do what your asking ;)

Ill have a quick check and will post my findings :)
 

mario

Junior Member
Joined
Dec 6, 2004
Likes
0
#4
jamiep said:
Well here i am.... the creator of dbadmin :p

Been on a break but i think ive found how to do what your asking ;)

Ill have a quick check and will post my findings :)
hey, that's great, tnx :)
 

OldDog

Administrator Emeritus
Joined
Oct 31, 2003
Likes
0
Location
Essex Junction, Vermont
#5
Jamie,

Have you found anything about a maplist retrieval for CoD (or, q3a, for that matter)? I hunted all over Terragate, searched forums, etc. There was a discussion between narfight and jr about q3a maplists, but it was back in 2004. Here's what jr said in June:

A map list is difficult. IIRC hlife is the only game that provides a maplist and only some games are providng the next map.
So far, all I've been able to retrieve is a blank. See this for an example: http://www.olddogvt.net/SQuery/index2_new.php, using this:

Code:
<table width="100%" cellspacing=1 cellpadding=1>
<? $gameserver->maplist=ucwords(htmlentities($gameserver->maplist)); ?>
<tr><td><font class="color">Current Map List:</font></td><td><font class="color2"><?=$gameserver->maplist?></font></td></tr></table>
The latest version (0.1.1) of gsQuery includes a q2a maplist fix, but I can't seem to get it to work with the q3a protocol.

Let me know if you find something, ok? A code snippet will do...

Thx...

Sorry, Mario, no joy yet...watch this space, tho'
 
Last edited:

OldDog

Administrator Emeritus
Joined
Oct 31, 2003
Likes
0
Location
Essex Junction, Vermont
#6
Well, Mario and Jamie, here's what I found out. Using GSQuery, you can only get "serverinfo" and "status", the former gives you the normal info list, the latter gives you players. So, my code construct in the previous post will never do anything...:eek: The only command you can give to a server for maps is "fdir *.bsp", as far as I've found. This shows you all the current maps AVAILABLE, not just those in the current rotation. For example, I only have 28 maps in my rotation, but the command gives me a listing of 85 BSPs, most of which are the single-player maps. You would have to parse only those BSPs that are "mp_" to get a current multi-player map rotation.

I'm still screwing with it. GSQuery has the ability to do rcon_query_server requests, and I might be able to grab the BSP list, then parse only the MPs.
 

mario

Junior Member
Joined
Dec 6, 2004
Likes
0
#7
OldDog said:
Well, Mario and Jamie, here's what I found out. Using GSQuery, you can only get "serverinfo" and "status", the former gives you the normal info list, the latter gives you players. So, my code construct in the previous post will never do anything...:eek: The only command you can give to a server for maps is "fdir *.bsp", as far as I've found. This shows you all the current maps AVAILABLE, not just those in the current rotation. For example, I only have 28 maps in my rotation, but the command gives me a listing of 85 BSPs, most of which are the single-player maps. You would have to parse only those BSPs that are "mp_" to get a current multi-player map rotation.

I'm still screwing with it. GSQuery has the ability to do rcon_query_server requests, and I might be able to grab the BSP list, then parse only the MPs.
I sometimes use a rcon programm called Takatai serverscan. I think this is made with c++ (I'm not sure). After giving status command the current maprotation is given. So somehow it is possible. This is however a rcon-programm and I want to build it in our website.
 

OldDog

Administrator Emeritus
Joined
Oct 31, 2003
Likes
0
Location
Essex Junction, Vermont
#8
Yeah, I know what you mean...so do I. I've seen the ServerScan product, and its ok, but what I really need is their source code on HOW to get the map rotation list.
 
Joined
Feb 2, 2004
Likes
0
Location
Shrapnet.com
#9
Use this:
Code:
sv_mapRotationCurrent
to show your current map rotation, it's an rcon command so i don't know if you can do it from a webscript without embedding your rcon pass somewhere.

In fact, when you issue that command, the first map shown is the next map in the rotation. Rotate the map and issue the command again and you'll see that string changes showing the next map again in the first position.

Have fun scripting it ;)
 

OldDog

Administrator Emeritus
Joined
Oct 31, 2003
Likes
0
Location
Essex Junction, Vermont
#10
Ok, I think I've got this wired. First of all "sv_mapRotationCurrent", while it works, does not work consistently. Sometimes it shows all the maps, and sometimes it doesn't. This is apparently true for all/most custom (i.e., non-standard) maps. I have "abbey" running, for example, and couldn't the command to show the map 3 times out of 5. This, of course, is not good. So, I went with my original idea of using "fdir *.bsp" as the rcon command to acquire the maps. This, of course, gets every map that's ever been installed, so I wrote a PHP routine that trims it down to ONLY Multi-Player maps, then displays them in two different ways: the first is a single table cell with all the maps comma-separated (see it here: http://www.olddogvt.net/Maplist/viewmaps-horiz.php), and the second is a table with each map having its own cell (see it here: http://www.olddogvt.net/Maplist/viewmaps-vert.php). Clearly, if you're capable enough, you can display it any way you want.

A word about being 'capable': this is admittedly pretty crude PHP code...I'm relatively new at this. Someone knowledgeable can probably do in two or three lines of code, what I needed 6 or 8 to do. If someone can improve on this, I'd be glad to hear from them.

Here's the drawback, though. It doesn't really show the "current map rotation". What it does show is all the AVAILABLE multi-player maps on a given server. For example, when you look at mine, above, you'll notice that both dawnville and uo_dawnville are listed. In my "current" map rotation, I only have uo_dawnville. However, since map voting is enabled on my server, players can grab any map they want, so I consider it moot. But, it works like a charm.

What it does is to create a server instance using the port, protocol, and IP address (or hostname), then it issues an rcon command, using your rconpassword, of "fdir *.bsp". It then, as I said above, strips all the irrelevant stuff out of the results, and displays them on a web page.

The code is based upon gsQuery, and your web site MUST have PHP 4.3 or higher to run it. You can find the code here: http://www.olddogvt.net/downloads/maplist.zip. Just grab the zip, and read the README. There's no implied support, but I'll answer questions...I guess...:rolleyes:.

A word of caution. The fdir command, or even rcon connection to your game server can have a little bit of a lag. If that happens, an empty table box will appear. I had planned on doing a "Please refresh" message as an error condition, but never got around to it. Maybe later in v.01. In any case, a refresh of the page usually corrects this.
 
Last edited:

mario

Junior Member
Joined
Dec 6, 2004
Likes
0
#11
I've been looking at sv_maprotationCurrent. What I read is that this variable loads the maps out off the maprotation. I tried it at my server and when the rotation is running it only shows the coming maps, the current map is out of the list. So I think at the last map this variable is empty and gets filled up again at the start of the rotation again. So maybe the sv_maprotation variable will hold the complete maprotation.

But your proggie is certanely usable cos it shows all available maps on the server. If you only load the used maps on the server then you have the maprotation.
 

OldDog

Administrator Emeritus
Joined
Oct 31, 2003
Likes
0
Location
Essex Junction, Vermont
#12
As I said, I found sv_mapRotationCurrent to be inconsistent. After running it several times in a row, and after force-changing maps, etc., I found that it didn't even always give you the rotation from the current map onward. As well, it didn't consistently show non-standard maps. I only have one custom map on my server, abbey, and 4 times out of 5 it wouldn't show up in a sv_mapRotationCurrent display. So, as a result, I decided that it wasn't worth pursuing. However, you could use it rather than the "fdir *.bsp" as the rcon command. They're not completely interchangeable, you'd have to modify the parsing routine, but I had that working for awhile before I switched to fdir *.bsp, so it is do-able.
 
Last edited:
Top Bottom