Server-website scripting

Discussion for Admins of ETPro/BayonET servers.
If you don't run a server, please don't post here...

Moderators: Forum moderators, developers

User avatar
M8DNephelim
Posts: 7
Joined: Tue Mar 16, 2004 3:40 am
Location: Sundsvall, Sweden
Contact:

Server-website scripting

Post by M8DNephelim »

Hi!

I am a poor scripter and we got 3 ET Pro servers running at M8D International. This is the prob I have:
I want a script that shows wich players are on the servers directly from the website and IF it´s possible a link for direct connect to the server(s)...
I been searching the web and found some scripts in use but no code.
If anyone knows anything about this plz help me out here. ;)

thx!
Image

Fragging is NOT a crime! Yet........ | www.m8d-clan.com | #m8d on QuakeNet
User avatar
Deus
Posts: 1053
Joined: Fri Mar 12, 2004 2:24 am
Location: Germany
Contact:

Post by Deus »

Plz take a look at www.poohunter.de and click on "server"

If this is what You are looking for I can send You a copy
AKP
Posts: 24
Joined: Mon Dec 15, 2003 12:26 am

Post by AKP »

On our website www.enemyterritory.dk we have a similar service. We extract the information via a php script. Here is some of the code to give you an idea of how its done:

Code: Select all

$serverstreng = "";
$serverforbindelse = @fsockopen("udp://" .$ServerIp , $ServerPort ,  $errno, $errstr);
$fwrite = @fwrite($serverforbindelse, "ÿÿÿÿgetstatus");
$continue = true;
while ($continue) {
  $serverstreng .= @fgetc($serverforbindelse);
  $status = socket_get_status($serverforbindelse);
  $continue = $status["unread_bytes"];
}
$fclose = @fclose($fp);
$result_array = explode ("\n", $serverstreng);
$status_array = explode ("\\", $result_array[1]);
User avatar
M8DNephelim
Posts: 7
Joined: Tue Mar 16, 2004 3:40 am
Location: Sundsvall, Sweden
Contact:

Post by M8DNephelim »

thx for fast feedback guys!

I really liked [pH*Deus] code. ...So Yes! I would appriciate a copy of the code! ;)

mailto: nephelim@home.se
Image

Fragging is NOT a crime! Yet........ | www.m8d-clan.com | #m8d on QuakeNet
AKP
Posts: 24
Joined: Mon Dec 15, 2003 12:26 am

Post by AKP »

I just discovered that the new et pro 2.1.14 does not give the same information in the server string as expected/earlier.

eg you cant see which players are on which team!

See example http://www.poohunter.de/index.php?page= ... port=27600

Code: Select all

ÿÿÿÿstatusResponse \mod_version\2.1.14\mod_url\http&#58;//bani.anime.net/etpro/\g_maxlivesRespawnPenalty\0\voteFlags\129451\g_balancedteams\1\g_maxGameClients\0\g_covertopsChargeTime\30000\g_soldierChargeTime\20000\g_LTChargeTime\40000\g_engineerChargeTime\30000\g_medicChargeTime\45000\g_bluelimbotime\25000\g_redlimbotime\15000\gamename\etpro\g_heavyWeaponRestriction\20\_Stats\http&#58;//et.efterlyst.org/\_Location\Stockholm, Sweden\_Connection\Gigabit &#40;BBB&#41;\_IRC\#efterlyst @ QuakeNet\_E-mail\vio@swertcw.com\_Administrator\Vio\g_gametype\2\g_antilag\1\g_voteFlags\0\g_alliedmaxlives\0\g_axismaxlives\0\g_minGameClients\8\g_needpass\0\g_maxlives\0\g_friendlyFire\1\sv_allowAnonymous\0\sv_floodProtect\0\sv_maxPing\400\sv_minPing\0\sv_maxRate\25000\sv_minguidage\0\sv_punkbuster\1\sv_maxclients\24\sv_hostname\Bredbandsbolaget ET#1 &#40;EFTERLYST&#41;\sv_privateClients\6\mapname\caen\protocol\83\timelimit\30\version\ET 2.56 linux-i386 Sep 10 2003 81 48 "^dDSky^4.^7viz" 6 48 "^7sib|^cpelle" 0 50 "^8Naa^9puri" 88 59 "^7 ^7RoyaL^1.^7Ji^1n^7tah^3 <3" 23 17 "^1$^5*^4KENTES" 73 51 "^ip^0!^7Morpheu^is" 78 48 "^1V^0oo^1D^0oo" 86 48 "^4&#91;^3YD^4&#93;^7nUmb" 0 999 "^b'^7c4 ^0sD^b*" 84 51 "^0b^7.^0leemurs" 82 48 "^0&#91;^7XT^0&#93;^lLord Death" 73 95 "^0&#91;^7XT^0&#93;^9Racker" 84 48 "^0TW*^7Call^1ist^0o" 38 98 "^3AXCI" 77 48 "^2Dep^7artutto" 88 54 "^164^0.^7wertti" 88 83 "t^lr^7ant" 0 999 "^0|lpk|^/RockY" 59 48 "^DD^cM^wZ" 99 96 "^Q*^PRoswell ^Q47" 
Is this intentionaly Bani ??

ohh btw i was also impressed with the layout of [pH*Deus] contribution.
User avatar
M8DNephelim
Posts: 7
Joined: Tue Mar 16, 2004 3:40 am
Location: Sundsvall, Sweden
Contact:

Post by M8DNephelim »

ahh... :(

in that case this script would be without use...
and yup - it is a good design! :)
Image

Fragging is NOT a crime! Yet........ | www.m8d-clan.com | #m8d on QuakeNet
Vio
Posts: 28
Joined: Wed Sep 24, 2003 9:57 am
Location: Stockholm, Sweden
Contact:

Post by Vio »

I noticed that too. This is what bani said about it.
<Vio> is players_allies etc excluded in the new etpro ?
<Vio> i dont see it in serverinfo
<[av]bani> yes, because it causes server crashes
User avatar
Deus
Posts: 1053
Joined: Fri Mar 12, 2004 2:24 am
Location: Germany
Contact:

Post by Deus »

Ok, then I have to do a redesign :/
As I see there is a list of members online in the serverstatusmessage, but we cannot make difference what team they are in. So if u only need a list of players this is no problem, but you can not see what team they are in...

sry for that, didn't get the fact that with 2.1 and up this wont work...
User avatar
M8DNephelim
Posts: 7
Joined: Tue Mar 16, 2004 3:40 am
Location: Sundsvall, Sweden
Contact:

Post by M8DNephelim »

k m8 :) plz mail me a copy when da masterpiece is done! :D
Image

Fragging is NOT a crime! Yet........ | www.m8d-clan.com | #m8d on QuakeNet
User avatar
bani
Site Admin
Posts: 2780
Joined: Sun Jul 21, 2002 3:58 am
Contact:

Post by bani »

AKP wrote:I just discovered that the new et pro 2.1.14 does not give the same information in the server string as expected/earlier.

eg you cant see which players are on which team!

See example http://www.poohunter.de/index.php?page= ... port=27600

Code: Select all

ÿÿÿÿstatusResponse \mod_version\2.1.14\mod_url\http&#58;//bani.anime.net/etpro/\g_maxlivesRespawnPenalty\0\voteFlags\129451\g_balancedteams\1\g_maxGameClients\0\g_covertopsChargeTime\30000\g_soldierChargeTime\20000\g_LTChargeTime\40000\g_engineerChargeTime\30000\g_medicChargeTime\45000\g_bluelimbotime\25000\g_redlimbotime\15000\gamename\etpro\g_heavyWeaponRestriction\20\_Stats\http&#58;//et.efterlyst.org/\_Location\Stockholm, Sweden\_Connection\Gigabit &#40;BBB&#41;\_IRC\#efterlyst @ QuakeNet\_E-mail\vio@swertcw.com\_Administrator\Vio\g_gametype\2\g_antilag\1\g_voteFlags\0\g_alliedmaxlives\0\g_axismaxlives\0\g_minGameClients\8\g_needpass\0\g_maxlives\0\g_friendlyFire\1\sv_allowAnonymous\0\sv_floodProtect\0\sv_maxPing\400\sv_minPing\0\sv_maxRate\25000\sv_minguidage\0\sv_punkbuster\1\sv_maxclients\24\sv_hostname\Bredbandsbolaget ET#1 &#40;EFTERLYST&#41;\sv_privateClients\6\mapname\caen\protocol\83\timelimit\30\version\ET 2.56 linux-i386 Sep 10 2003
Is this intentionaly Bani ??.
yes. the server status is limited to 1022 chars and if you go over that, the server crashes (stock etmain bug). lots of servers crash because Players_Axis and Players_Allies can easily push the server status over 1022 chars. it's removed from etpro 2.1 for that reason. it's possible to put some other system in, but old Players_Axis and Players_Allies will not return.

maybe I can put "Players" in as a 64 char string? 0 = no player, 1 = axis, 2 = allies, 3 = spectator

so it would look eg like \Players\11212202133
User avatar
Chairman Kaga
Posts: 64
Joined: Mon Aug 04, 2003 9:00 pm

Post by Chairman Kaga »

bani wrote:maybe I can put "Players" in as a 64 char string? 0 = no player, 1 = axis, 2 = allies, 3 = spectator

so it would look eg like \Players\11212202133
That would be great, since it would also make it easy to tell if a server is really full or if some people are in reserved slots (since the reserved slots are always the first $sv_privateclients slots).

Does that mean you'll be tweaking the player list format as well, so one can connect player to slot number? Currently it just returns "score ping name", since the old format would just renumerate all the players starting at 0, and use the resulting numbers for Players_(Allies|Axis).
Steve (aka Chairman Kaga)
Proud member of Major League Killers
=MLK= International House of Panzer: 64.185.229.60:27960
User avatar
bani
Site Admin
Posts: 2780
Joined: Sun Jul 21, 2002 3:58 am
Contact:

Post by bani »

cant change the player list format unfortunately...
User avatar
Deus
Posts: 1053
Joined: Fri Mar 12, 2004 2:24 am
Location: Germany
Contact:

Post by Deus »

bani wrote: maybe I can put "Players" in as a 64 char string? 0 = no player, 1 = axis, 2 = allies, 3 = spectator

so it would look eg like \Players\11212202133
What about using a bitmask for each ?

shorten the cvarnames:
p_ax
p_al
and use a bitmask
0 = not on the team, 1 = on the team.
a phpscript can then split them into the information that is needed.
There is no need to announce the specing players, because if a player isnt on either ax or al he must be a spec.

f.E.:
Player 1 = Axis (1)(0)
Player 2 = Axis (1)(0)
Player 3 = Allies (0)(1)
Player 4 = Axis (1)(0)
Player 5 = Allies (0)(1)
Player 6 = allies (0)(1)

Then we have Ax:
1011

ans Al:
110100

what will be for ax
11
and for al
52

so it would look like...\p_ax\11\p_al\52\...

I know this has nothing to do with competition, and its not useful for any kind of gameplay, just for the guys who want to display their servers on their homepage.
User avatar
Chairman Kaga
Posts: 64
Joined: Mon Aug 04, 2003 9:00 pm

Post by Chairman Kaga »

bani wrote:cant change the player list format unfortunately...
Bah. Not really necessary, though, now that I think about it a bit more.
Steve (aka Chairman Kaga)
Proud member of Major League Killers
=MLK= International House of Panzer: 64.185.229.60:27960
Orinoco
Posts: 3
Joined: Tue Oct 21, 2003 6:21 am
Location: UK
Contact:

Post by Orinoco »

Just looked at the webpage gr8 work pH*Deus, any chance you can send me a copy, its exactly what I have been lookin for



Thanks in advance, keep up the good work
Post Reply