Server-website scripting
Moderators: Forum moderators, developers
- M8DNephelim
- Posts: 7
- Joined: Tue Mar 16, 2004 3:40 am
- Location: Sundsvall, Sweden
- Contact:
Server-website scripting
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!
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!
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
If this is what You are looking for I can send You a copy
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]);
- M8DNephelim
- Posts: 7
- Joined: Tue Mar 16, 2004 3:40 am
- Location: Sundsvall, Sweden
- Contact:
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
I really liked [pH*Deus] code. ...So Yes! I would appriciate a copy of the code!
mailto: nephelim@home.se
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
Is this intentionaly Bani ??
ohh btw i was also impressed with the layout of [pH*Deus] contribution.
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://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://et.efterlyst.org/\_Location\Stockholm, Sweden\_Connection\Gigabit (BBB)\_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 (EFTERLYST)\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[^3YD^4]^7nUmb" 0 999 "^b'^7c4 ^0sD^b*" 84 51 "^0b^7.^0leemurs" 82 48 "^0[^7XT^0]^lLord Death" 73 95 "^0[^7XT^0]^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"
ohh btw i was also impressed with the layout of [pH*Deus] contribution.
- M8DNephelim
- Posts: 7
- Joined: Tue Mar 16, 2004 3:40 am
- Location: Sundsvall, Sweden
- Contact:
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...
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...
- M8DNephelim
- Posts: 7
- Joined: Tue Mar 16, 2004 3:40 am
- Location: Sundsvall, Sweden
- Contact:
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.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
Is this intentionaly Bani ??.Code: Select all
ÿÿÿÿstatusResponse \mod_version\2.1.14\mod_url\http://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://et.efterlyst.org/\_Location\Stockholm, Sweden\_Connection\Gigabit (BBB)\_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 (EFTERLYST)\sv_privateClients\6\mapname\caen\protocol\83\timelimit\30\version\ET 2.56 linux-i386 Sep 10 2003
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
- Chairman Kaga
- Posts: 64
- Joined: Mon Aug 04, 2003 9:00 pm
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).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
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
Proud member of Major League Killers
=MLK= International House of Panzer: 64.185.229.60:27960
What about using a bitmask for each ?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
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.
- Chairman Kaga
- Posts: 64
- Joined: Mon Aug 04, 2003 9:00 pm
Bah. Not really necessary, though, now that I think about it a bit more.bani wrote:cant change the player list format unfortunately...
Steve (aka Chairman Kaga)
Proud member of Major League Killers
=MLK= International House of Panzer: 64.185.229.60:27960
Proud member of Major League Killers
=MLK= International House of Panzer: 64.185.229.60:27960