MNCDS Ports and Query Protocol Question - From a GSP

Discussion in 'Monday Night Combat PC Dedicated Server Discussion' started by PhantomYoda, February 11, 2011.

  1. PhantomYoda

    PhantomYoda New Member

    Messages:
    9
    Likes Received:
    0
    Hello,

    I work for a GSP who has been heavily involved in getting this game to work in TCAdmin. I've noticed a few things and had some questions and comments.

    I've noticed that each server will utilize the following ports, each incremented by 1 based on the -serverinstance= number. The ports listed below are based on -serverinstance=0

    7777
    27000
    27016
    13000 - This port is always 13000 regardless of the serverinstance= number.

    I know 7777 is the server port, 27016 is the query port(?), but what is 27000 and 13000 used for?

    I've also noticed that serviceinstance 0 will start the server on 27016, not 27015. 27015 is the server port used by most HL2 Engine games. 27020 is also the default HLTV/SourceTV port, but can be changed in that games server.cfg file.

    What we would like to do is enable TCAdmin's built in server monitoring, status, rcon, and game-monitor.com query capabilities. Which port above is the query port, and which, if any is the rcon port?

    Also, what query/rcon protocols does the game use? We can sometimes get rcon functions to work through TCAdmin for UT3 games by using various UT or Gamespy3/4 protocols.

    Do you also plan to remove the requirement for steam from the standalone dedicated server files so the -STEAM_DEDSERVER doesn't need to be used? It's been reported to interfere with some server query sites pulling all information from a server instance. Most dedicated stand alone servers don't run steam.
  2. Joh

    Joh New Member

    Messages:
    10
    Likes Received:
    0
    Port 13000 is the default statistics port for Unreal Engine games. If you want to see it in action you can download UDK, which contains the StatsViewer as well (StatsViewer.exe in the Binaries folder). This port is also open and active for game clients and not just servers (though it crashed mine, probably nothing uber prioritized). Port 27000 I have no idea about however.

    The query port would be the 27016+ ports, and they accept the same query as source servers do (TSource Engine Query), however they don't really expose anything useful unless you figure out what each part of the returned string means. For dedicated servers lauched with -STEAM_DEDSERVER it will always display the map as HostileLobby for example, though I believe one of the numbers maps to what map is actually in play.

    As for RCON, I believe it's still under development. Looking at this post however, I believe something will be announced really soon.
  3. racquemis

    racquemis New Member

    Messages:
    289
    Likes Received:
    0
    incorrect Joh, Uberent stores the current map in the string, that contains all te rules, as an integer.
    the packet returned by the server contains a string like this:
    Crossfire!True!True!True!True!True!True!False!True!True!12!True!True!False!Dedicated!0!4!0!2!2!2!2!2!2!
    if you split that string into an array using the "!" as the break mark, array element 16 will represent the map.

    0 equals to Ammo Mule Arena
    1 equals to Steel Peel Arena
    2 equals to Grenade III Arena
    3 equals to LazeRazor Arena
    4 equals to Spunky Cola Arena

    Uberent is working on a query system of there own which will have far more features then the source query offers, currently there are some issues witht eh source protocol for example, A2S_player does not return all players in the server, and there is nothing uberent can do about it, since the protocl works behind the scenes and they don't have control over it. one of the devs told me that they don't officially support the source query protocol and he was surprised A2S_player even returned anything.

    So i think it's best to wait until the new system is released, so you don't have to throw your scripts in the garbage.
  4. Joh

    Joh New Member

    Messages:
    10
    Likes Received:
    0
    Isn't that what I said? ;)

    Edit: Though my memory told me it also returned HostileLobby in there somewhere.
  5. racquemis

    racquemis New Member

    Messages:
    289
    Likes Received:
    0
    overread that, it indeed says hostilelobby, but that part uberent does not use at all.
  6. PhantomYoda

    PhantomYoda New Member

    Messages:
    9
    Likes Received:
    0
    Thanks for the replies. What I am also looking at is if the 2700x port might be rcon? I've noticed some features working with query if we use UT3 protocols and GameSpy4 protocols. It pulls the same data as game-monitor.com (hostilegame, dedicated, etc), but we've never been able to get rcon to function remotely...

    by remotely I mean directly from the box. TCAdmin acts like the local user on the box, sending the commands directly to the game server from the box its running on. The client can access rcon remotely through the web interface in tcadmin. If that makes sense...

    TCAdmin has some pre-configured protocols based on existing game types and compatibility, which is mostly used to send rcon commands and pull current map, players, etc directly from the server running on the box TCAdmin is on.
  7. Bakey

    Bakey New Member

    Messages:
    115
    Likes Received:
    0
    Anyone get a good server query script going?

    I hacked one together in PHP to return the server name and current map, but it's pretty specific to our server and I'm sure it's shoddy code.

    Code:
    <?php
        $fp = fsockopen('udp://208.167.246.214', 27016);
    	fwrite ($fp, "\377\377\377\377TSource Engine Query\0");
    	$serverinfo = fread($fp,200);
    	$servername= substr($serverinfo, 40, 17);
    	$serverdetail= explode ("!", $serverinfo);
    	print ("<h2>");
    	print ($servername);
    	print ("</h2>");
    	print ("<table border=1><tr>");
    	print ("<td>Current Map</td>");
    	print ("<td>");	
    	if ($serverdetail[16] == "0"){
    	print ("Ammo Mule Arena");}
    	else if ($serverdetail[16] == "1") {
    	print ("Steel Peel Arena");}
    	else if ($serverdetail[16] == "2") {
    	print ("Grenade III Arena");}
    	else if ($serverdetail[16] == "3") {
    	print ("LazeRazor Arena");}
    	else if ($serverdetail[16] == "4") {
    	print ("Spunky Cola Arena");}
    	print ("</td></tr>");
    	print ("</table>");
    	fclose ($fp);
    ?>
  8. racquemis

    racquemis New Member

    Messages:
    289
    Likes Received:
    0
    thats pretty much how i have it to.
    i just split the string you used into an array using the ! as the split mark,

    followed by defining each row:
    Code:
    $split_rules=split('!',$split_result[8]);
    	$Gametype=str_split($split_rules[0],19);
    	$Purch_Juice=$split_rules[1];
    	$Purch_Bots=$split_rules[2];
    	$Hazards=$split_rules[3];
    	$Mascot=$split_rules[4];
    	$Custom_class=$split_rules[5];
    	$Change_class=$split_rules[6];
    	$Random_class=$split_rules[7];
    	$Team_select=$split_rules[8];
    	$Auto_Balance=$split_rules[9];
    	$Pub_conn=$split_rules[10];
    	$Hostname=$split_rules[14];
    	$l_Assault=$split_rules[19];
    	$l_Tank=$split_rules[20];
    	$l_Support=$split_rules[21];	
    	$l_Assasin=$split_rules[22];
    	$l_Gunner=$split_rules[23];	
    	$l_Sniper=$split_rules[24];	
    and for overtime and matchtime:

    Code:
    	$MatchTime=$split_rules[17]*5+5;
    	if (Matchtime==50) {
    		$MatchTime=60;
    	}
    	$Overtime=$split_rules[18];
    	if ($Overtime==6){
    		$Overtime=10;}
    	if ($Overtime==7){
    		$Overtime=15;}
    	if ($Overtime==8){
    		$Overtime=20;}
    i also set a timeout of 1 seconds with a isempty check on the data.

    thats pretty much the way to do it until uberent introduces their own query system, which will be far better and more feature rich then the steam protocol currently is for this game.
  9. Bakey

    Bakey New Member

    Messages:
    115
    Likes Received:
    0
    Right, I'm splitting into an array as well, with this line:

    Code:
     $serverdetail= explode ("!", $serverinfo);
    Have you found a good way to get player info from the servers yet?
  10. racquemis

    racquemis New Member

    Messages:
    289
    Likes Received:
    0
    :mrgreen: i can read the response, but i' m not quite sure how i can format it correctly. since this (the website) is actually my first ever php project with no prior knowledge i need to stumble upon the answer

    currently its just single unformatted string. also currently A2S_player only returns the names of the first 9 players, the rest is not listed. uberent doesnt support the A2S_player, one of the devs i talked to was surprised that i actually able to retrieve any information.

    Better to wait for uberent to get to the their own query protocol. they said no ETA but ASAP.

    the code to retrieve the player info:
    Code:
    	define('A2S_SERVERQUERY_GETCHALLENGE',"\xFF\xFF\xFF\xFF\x55\xFF\xFF\xFF\xFF");
    	define('A2S_PLAYER',"\xFF\xFF\xFF\xFF\x55");
    	//challenge
    $fp = fsockopen("udp://$ip", $port, $errno, $error, 5) OR die($error.(".$errno."));
     fwrite($fp,A2S_SERVERQUERY_GETCHALLENGE);
     $challenge=fread($fp, 4096);
     $challenge=str_split($challenge,5);
    	
    	//Player info
    $fp = fsockopen("udp://$ip", $port, $errno, $error, 5) OR die($error.(".$errno."));
    fwrite($fp, A2S_PLAYER.$challenge[1]);
    do you have any idea how the result can be formatted into an array?
  11. Bakey

    Bakey New Member

    Messages:
    115
    Likes Received:
    0
    No idea. :(

    I really hope Uber gives us something useful soon.
  12. cobramike

    cobramike New Member

    Messages:
    1
    Likes Received:
    0
    Teamnoobless.com is working on a server online list. And we have so far this

    http://www.teamnoobless.com/server.php

    And still working on it. Working wit arrys and ill update when its done.

    Greets Mike
  13. FlyveHest

    FlyveHest New Member

    Messages:
    34
    Likes Received:
    0
    I'm just hoping for some sort of offiicial statement / support for some sort of query protocol in the next update.

    As an admin running 5 instances, it would be very, very nice to be able to work with the servers as I do all the others I run.
  14. o

    o Head Honcho Official PA

    Messages:
    132
    Likes Received:
    39
    Sorry it's taking so long. There's been so much activity stalling progress here, DICE, GDC, and now PAX East next week. I literally only get to work on it on my weekends! Speaking of which ... heading in to the office today to try to move the ball down the field a little more.
  15. devicenull

    devicenull New Member

    Messages:
    7
    Likes Received:
    0
    Please just fix the existing A2S code. We don't need yet another query protocol when A2S is universally supported by any sort of server query library.

Share This Page