<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<? require("unreal.php");?>
<HTML>
<HEAD>
<TITLE>Unrealstatus</TITLE>
<script type="text/javascript">
function vars_popup(serveraddress,serverport) {
    window.open('showvars.php?serveradr=' + serveraddress + '&serverport=' + serverport ,'','width=450,height=550,left=150,top=100,resizable=1,scrollbars=yes');
}
</script>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<DIV ALIGN="CENTER">Sourcefiles : <A HREF="show_unrealstatus.php">unrealstatus.php</A> | <A HREF="show_showvars.php">showvars.php</A> | <A HREF="show_showunreal.php">unreal.php</A></DIV>
<HR>
<?
  $unreal
=new Unreal;
  
$serveradr="play.unreal-tournament.org";
  
$serverport=7777;
  
$status=$unreal->getServerStatus($serveradr,$serverport,2000);
  if (
$status) {
?>
<DIV ALIGN="CENTER">
<TABLE>
<TR>
    <TD ALIGN="CENTER" VALIGN="TOP">
    <TABLE>
    <TR>
        <TD COLSPAN="3" ALIGN="CENTER"><?=$unreal->m_servervars["hostname"]?></TD>
    </TR>
    <TR>
        <TD COLSPAN="3" ALIGN="CENTER"><?=$unreal->m_servervars["numplayers"]?> of max. <?=$unreal->m_servervars["maxplayers"]?> players</TD>
    </TR>
    
    <TR>
        <TD WIDTH="150"><STRONG>Name</STRONG></TD><TD><STRONG>Ping</STRONG></TD><TD><STRONG>Frags</STRONG></TD>
    </TR>
    <TR>
        <TD COLSPAN="3"><HR></TD>
    </TR>
    <? if (is_array($unreal->m_playerinfo)) { ?>
    <? while (list(,$player) = each ($unreal->m_playerinfo)) { ?>
    <TR>
        <TD><?=htmlspecialchars($player["name"])?>&nbsp;</TD><TD>&nbsp;<?=$player["ping"]?></TD><TD><?=$player["frags"]?></TD>
    </TR>
    <? ?>
    <? } else { ?>
    <TR>
        <TD COLSPAN="3">No players on server right now</TD>
    </TR>
    <? ?>    
    <TR>
        <TD COLSPAN="3"><HR></TD>
    </TR>
    <TR>
        <TD COLSPAN="3">&nbsp;</TD>
    </TR>
    <TR>
        <TD COLSPAN="3" ALIGN="CENTER"><IMG SRC="/images/unrealmaps/<?=$unreal->m_servervars["mapname"]?>.jpg" width="175" height="131" ALT="<?=$unreal->m_servervars["maptitle"]?>"></TD>
    </TR>
    <TR>
        <TD COLSPAN="3" ALIGN="CENTER">Mapname : <?=$unreal->m_servervars["maptitle"]?></TD>
    </TR>
    <TD COLSPAN="3" VALIGN="TOP" ALIGN="CENTER"><FONT SIZE="1">
        <A HREF="javascript:vars_popup('<?=$serveradr?>','<?=$serverport?>');" onMouseOver="window.status='Show servervars'; return true;" onMouseOut="window.status=' ';return true;">Servervars</A></FONT>
    </TD>    
    </TABLE>
    </TD>
</TR>
</TABLE>
</DIV>
<? } else { ?>
<DIV ALIGN="CENTER">Error communicating with server</DIV>
<BR>

<? ?>    

</BODY>
</HTML>