include 'lib_graph/class/pDraw.class.php';
include 'lib_graph/class/pData.class.php';
include 'lib_graph/class/pImage.class.php';
include 'conect_mysql.php';
include 'include/fonction.php';
include 'include/MinecraftQuery.class.php';
include 'include/GameQ.php';
$gid = $_GET['GID'];
$sql_game = "SELECT * FROM pa_game WHERE id_game='".$gid."' ";
$ret_game = mysql_query($sql_game,$connexion_web) or die('Erreur SQL !
'.$sql_game.'
'.mysql_error());
$aff_game =mysql_fetch_array ($ret_game);
$sql_trn = "SELECT * FROM pa_gm_trn WHERE id_trn='".$aff_game['id_trn']."' ";
$ret_trn = mysql_query($sql_trn,$connexion_web) or die('Erreur SQL !
'.$sql_trn.'
'.mysql_error());
$aff_trn = mysql_fetch_array ($ret_trn);
$sql_type = "SELECT * FROM pa_gm_type WHERE id_type='".$aff_game['id_type']."' ";
$ret_type = mysql_query($sql_type,$connexion_web) or die('Erreur SQL !
'.$sql_type.'
'.mysql_error());
$aff_type = mysql_fetch_array ($ret_type);
/* Create and populate the pData object */
$MyData = new pData();
/* Create the pChart object */
$myPicture = new pImage(500,80,$MyData);
$myPicture->drawGradientArea(0,0,500,80,DIRECTION_VERTICAL,array("StartR"=>100,"StartG"=>100,"StartB"=>100,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100));
$myPicture->drawGradientArea(0,0,500,50,DIRECTION_HORIZONTAL,array("StartR"=>100,"StartG"=>100,"StartB"=>100,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>20));
//$myPicture->drawGradientArea(0,0,60,230,DIRECTION_HORIZONTAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100));
/* Left orange surrounding box with an alpha factor of 30% */
//$RectangleSettings = array("R"=>255,"G"=>255,"B"=>255,"Alpha"=>10);
//$myPicture->drawRoundedFilledRectangle(10,5,400,75,10,$RectangleSettings);
if(!$aff_game)
{
/* Block information */
$myPicture->setFontProperties(array("FontName"=>"lib_graph/fonts/calibri.ttf"));
$TextSettings = array("R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>12);
$myPicture->drawText(220,40, 'Serveur inexistant',$TextSettings);
}
else
{
if($aff_type['protocol'] == "bk")
{
$Timer = MicroTime( true );
$Query = new MinecraftQuery( );
$Query->Connect( $aff_trn['ip'], $aff_game['port'] + 100, 1 );
$data['info'] = $Query->GetInfo( );
$data['info']['players'] = $Query->GetPlayers( );
}
else
{
$var['info'] = array($aff_type['protocol'], $aff_trn['ip'], $aff_game['port']);
$gq = new GameQ();
$gq->addServers($var);
$data = $gq->requestData();
}
//echo '
'.print_r($data,true).''; $Settings = array("R"=>255, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); $myPicture->drawFilledRectangle(0,0,500,10,$Settings); /* Block adresse */ $myPicture->setFontProperties(array("FontName"=>"lib_graph/fonts/calibri.ttf")); $TextSettings = array("R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10); $myPicture->drawText(200,10, $aff_trn['ip'].':'.$aff_game['port'],$TextSettings); /* Block nom */ $myPicture->setFontProperties(array("FontName"=>"lib_graph/fonts/calibri.ttf")); $TextSettings = array("R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10); $myPicture->drawText(30,25, 'Nom du serveur :'.host_color($aff_type['protocol'], infovar('hostname', $aff_game['id_type'], $data)),$TextSettings); /* Block player */ $myPicture->setFontProperties(array("FontName"=>"lib_graph/fonts/calibri.ttf")); $TextSettings = array("R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10); $myPicture->drawText(30,45, 'Joueur : '.count($data['info']['players']).'/'.infovar('maxplayers', $aff_game['id_type'], $data),$TextSettings); /* Block map */ $myPicture->setFontProperties(array("FontName"=>"lib_graph/fonts/calibri.ttf")); $TextSettings = array("R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10); $myPicture->drawText(30,65, 'Map : '.infovar('mapname', $aff_game['id_type'], $data),$TextSettings); /* Block Passe */ $myPicture->setFontProperties(array("FontName"=>"lib_graph/fonts/calibri.ttf")); $TextSettings = array("R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10); $myPicture->drawText(200,50, 'Mot de passe : ',$TextSettings); $myPicture->drawFromPNG(285,35,'images/ico_gm/'.infovar('password', $aff_game['id_type'], $data).'.png'); /* Block Passe */ $myPicture->setFontProperties(array("FontName"=>"lib_graph/fonts/calibri.ttf")); $TextSettings = array("R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>10); $myPicture->drawText(200,65, 'Protection : ',$TextSettings); $myPicture->drawFromPNG(285,55,'images/ico_gm/'.infovar('protect', $aff_game['id_type'], $data).'.png'); // $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); /* Block copyright */ $myPicture->setFontProperties(array("FontName"=>"lib_graph/fonts/calibri.ttf")); $TextSettings = array("R"=>255,"G"=>255,"B"=>255,"Angle"=>0,"FontSize"=>6); $myPicture->drawText(420,78, 'MONITOR BY TSCAST',$TextSettings); /* Draw a PNG object */ /* Turn off shadow */ $myPicture->setShadow(FALSE); $myPicture->drawFromPNG(450,20,'images/ico_gm/'.$aff_type['nom_var'].'.gif'); /* Do some cosmetics */ //$myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); //$myPicture->drawLine(60,0,60,230,array("R"=>70,"G"=>70,"B"=>70)); //$myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); //$myPicture->setFontProperties(array("FontName"=>"/var/www/virtual/tscast.com/monitor/htdocs/lib_graph/fonts/Forgotte.ttf","FontSize"=>11)); //$myPicture->drawText(35,115,$aff_machine['ip'].":".$aff_srv['port'],array("R"=>255,"G"=>255,"B"=>255,"FontSize"=>20,"Angle"=>90,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); /* Draw a spline chart */ //$myPicture->setGraphArea(100,30,680,190); //$myPicture->drawFilledRectangle(100,30,680,190,array("R"=>255,"G"=>255,"B"=>255,"Alpha"=>20)); //$myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); //$myPicture->setFontProperties(array("R"=>255,"G"=>255,"B"=>255,"FontName"=>"/var/www/virtual/tscast.com/monitor/htdocs/lib_graph/fonts/pf_arma_five.ttf","FontSize"=>6)); //$myPicture->drawScale(array("AxisR"=>255,"AxisG"=>255,"AxisB"=>255,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE)); } $myPicture->drawSplineChart(); /* Write the data bounds */ $myPicture->writeBounds(); //$myPicture->setShadow(FALSE); $myPicture->Stroke(); ?>