chris_2 Posted January 11, 2005 Share Posted January 11, 2005 Voila j'ai trouver, j'ai vu, sa marche mais pas chez vous je mexplique. j'ai modifier quelque ligne et j'ai teste sur un server TS dans pote louer chez auter que VG, mais de que je mais le mien qui est chez vous sa marche pas Warning: fsockopen(): unable to connect to ts.verygames.net:51234 in /home/espacep/public_html/modules/TeamSpeak/index.php on line 83 Eil y a r connection sur le serveur si un Admin pouvais me dire qu'il y a quelque chose sinon je suis fou. Quote Link to comment Share on other sites More sharing options...
Volti Posted January 11, 2005 Share Posted January 11, 2005 Hello, Apparemment soit ton serv est off soit teamspeak est pas lancé : [17:38:20] Connecting to ts.verygames.net:51234 [17:38:23] No reply from server Maybe the server is offline or maybe teamspeak is not running on it ++ Quote Link to comment Share on other sites More sharing options...
chris_2 Posted January 11, 2005 Author Share Posted January 11, 2005 il est tout ok serv est on ,teamspeak est lancé : Quote Link to comment Share on other sites More sharing options...
Sappy Posted January 12, 2005 Share Posted January 12, 2005 On ne bloque pas le port TCP. Le port est (49000 + X) Sachant que X est un entier, et que X = $votre_server_ID / 100 . http://forum.verygames.net/viewtopic.php?t=993&start=15 J'ai vu que t'as mis :ts.verygames.net:51234 Alors que tu devrais mettre à la place de "51234" => le port de ton serveur teamspeak! Pour le query port, calcule le comme l'a indiqué DjoDjo et ça devrait fonctionner, excepté si ton hébergeur n'accepte pas la fonction "fsockopen". Quote Link to comment Share on other sites More sharing options...
chris_2 Posted January 12, 2005 Author Share Posted January 12, 2005 donc sa serai ts.verygames.net:49234 Quote Link to comment Share on other sites More sharing options...
Cr3V3TT3 Posted January 12, 2005 Share Posted January 12, 2005 mici Quote Link to comment Share on other sites More sharing options...
chris_2 Posted January 12, 2005 Author Share Posted January 12, 2005 Voila les code que jai fais, un seul peutit sousi ces que le serveur supereure a 50099 marche pas <?php if(!$user){$visiteur="0";} else{$visiteur=$user[1];} $ModName = basename( dirname( __FILE__ ) ); if ($visiteur>=nivo_mod($ModName)){ $ipteamspeak='ts.verygames.net'; $portteamspeak='50237'; //ts.verygames.net opentable(); echo "<center> <font size=3>[b]<big>Serveur Teamspeak</big>[/b]</font> "; // ************************************************************************************* // *** DEBUT DE LA CLASS *************************************************************** // ************************************************************************************* // RIEN CHANGER DEDANS SAUF LE HTML ET LES CSS... class TeamSpeakServeurInfo { // Public variables... var $DNS; var $QueryPort; var $ServerPort; // Private variables... var $Socket; // Class constructor function TeamSpeakServeurInfo($DNS, $QueryPort, $ServerPort) { // init variables... $this->DNS = $DNS; $this->QueryPort = $QueryPort; $this->ServerPort = $ServerPort; } function Send($query) { fputs($this->Socket, $query."\n"); } function Recive() { /* $T = fgets($this->Socket); echobr('<code>'.$T.'</code>'); Return $T; // */ return fgets($this->Socket); } function MakeTwoDigit($Val) { return str_pad($Val, 2, '0', STR_PAD_LEFT); } function GetCodec($Num) { switch($Num) { case 0: return "CELP 5.1 Kbit"; case 1: return "CELP 6.3 Kbit"; case 2: return "GSM 14.8 Kbit"; case 3: return "GSM 16.4 Kbit"; case 4: return "CELP Windows 5.2 Kbit"; default: return "unknown ($codec)"; } } function ProcessOutput() { $this->Socket = fsockopen($this->DNS, $this->QueryPort, &$errno, &$errstr, 10); // timeout 10sec if($errno!=0 or !$this->Socket) // Test if connection opened without error { Return "Error : $errstr ($errno)"; } iF($this->Recive()!="[TS]\r\n") // Test the first TS server response (Must be [TS] or then error) { fclose($this->Socket); Return 'Error : No server TeamSpeak at this address'; } // === Select the server === $this->Send('sel '.$this->ServerPort); if($this->Recive()!="OK\r\n") // check select server error { fputs($this->Socket, "quit"); fclose($this->Socket); return 'Error when selecting the TS server port'; } // === Get the users list === $this->Send('pl'); // pl for PlayersList $PlayerList = array(); $NumPlayer = 0; while($PlayerID!='OK') // exit loop if no more player { $Buffer = trim($this->Recive()); $PlayerInfo = explode("\t", $Buffer); $PlayerID = $PlayerInfo[0]; if($PlayerID=='OK') break; // exit loop if no more player if($PlayerID!='p_id') { // find all player info... $PlayerChannel = $PlayerInfo[1]; $PlayerPing = $PlayerInfo[7]; $LoginTime = $PlayerInfo[8]; $LoginTime = $this->MakeTwoDigit(floor($LoginTime / 3600)). ':'.$this->MakeTwoDigit(floor(($LoginTime % 3600) / 60)). ':'.$this->MakeTwoDigit($LoginTime % 60); $IDLE_Time = $PlayerInfo[9]; $IDLE_Time = $this->MakeTwoDigit(floor($IDLE_Time / 3600)). ':'.$this->MakeTwoDigit(floor(($IDLE_Time % 3600) / 60)). ':'.$this->MakeTwoDigit($IDLE_Time % 60); $PlayerName = trim($PlayerInfo[14], '"'); // Add the current player info to the list array_push($PlayerList, array('ID'=>$PlayerID, 'Name'=>$PlayerName, 'Channel'=>$PlayerChannel, 'Ping'=>$PlayerPing, 'LoginTime'=>$LoginTime, 'IDLE_Time'=>$IDLE_Time)); $NumPlayer++; } } // === Get the users list === $this->Send('cl'); // cl for ChannelList $ChannelList = array(); while($ChannelID != "OK") // exit loop if no more channel { $Buffer = trim($this->Recive()); $ChannelInfo = explode("\t", $Buffer); $ChannelID = $ChannelInfo[0]; if($ChannelID=='OK') break; // exit loop if no more channel // find all channel info... $ChannelCodec = $ChannelInfo[1]; $ChannelParent = $ChannelInfo[2]; $MaxPlayers = $ChannelInfo[4]; $ChannelName = trim($ChannelInfo[5],'"'); $ChannelPassword = $ChannelInfo[7]; $ChannelIsDefault = $ChannelInfo[8]; // Add the current channel info to the list array_push($ChannelList, array('ID'=>$ChannelID, 'Name'=>$ChannelName, 'Parent'=>$ChannelParent, 'Codec'=>$this->GetCodec($ChannelCodec), 'MaxPlayers'=>$MaxPlayers, 'Password'=>$ChannelPassword, 'IsDefault'=>$ChannelIsDefault)); } ob_start(); ?> <Style type="text/css"> .CSS_TS_TableOutside { border:2px #000000 solid; background-color:#A3A3CB; color:#000000} .CSS_TS_Table { border:1px #000000 solid; background-color:#A3A3CB; color:#000000; padding: 3px} .CSS_TS_TableInside { font-size:8pt; font-family:MS Sans Serif, Arial, Helvetica, sans-serif; background-color:#A3A3CB; color:#000000} .CSS_TS_Codec { font-size:8pt; font-family:MS Sans Serif, Arial, Helvetica, sans-serif; color:#BABADE} </Style> <Table border="0" cellpadding="0" cellspacing="3" Class="CSS_TS_TableOutside"> <TR> <TD Class="CSS_TS_Table"> <Table border="0" cellpadding="0" cellspacing="0" Class="CSS_TS_TableInside"> <TR> <TD> [img=modules/TeamSpeak/images/serverimage.png]Restless - Teamspeak server </TD> <TD Align="center"> </TD> <TD Align="center"> </TD> </TR> <? Foreach($ChannelList as $Channel) { If($Channel['Parent']==-1) { ?> <TR> <TD> [img=modules/TeamSpeak/images/channelimage.png]<?=IIF($Channel['Password']=='1', '[img][/img]', '')?><?=$Channel['Name']?><Span Class="CSS_TS_Codec">(<?=$Channel['Codec']?>)</Span> </TD><TD></TD><TD></TD><TD></TD> </TR> <? Foreach($ChannelList as $SubChannel) { If($SubChannel['Parent']==$Channel['ID']) { ?> <TR> <TD> [img=modules/TeamSpeak/images/channelimage.png]<?=IIF($Channel['Password']=='1', '[img=.GetImageName(5,3).]', '')?><?=$SubChannel['Name']?> <Span Class="CSS_TS_Codec">(<?=$SubChannel['Codec']?>)</Span> </TD><TD></TD><TD></TD><TD></TD> </TR> <? Foreach($PlayerList as $Player) { If($Player['Channel']==$SubChannel['ID']) { ?> <TR> <TD> [img=modules/TeamSpeak/images/playerimage.png][img=<?=GetImageName(1,2)?>] Class="IMGT"><?=$Player['Name']?> </TD> <TD Align="center"> <?=$Player['LoginTime']?> </TD> <TD Align="center"> <?=$Player['IDLE_Time']?> </TD> <TD> <Span Class="CSS_TS_Codec">(Ping <?=$Player['Ping']?>)</Span> </TD> </TR> <? } } } } Foreach($PlayerList as $Player) { If($Player['Channel']==$Channel['ID']) { ?> <TR> <TD> [img=modules/TeamSpeak/images/playerimage.png]<?=$Player['Name']?> </TD> <TD Align="center"> <?=$Player['LoginTime']?> </TD> <TD Align="center"> <?=$Player['IDLE_Time']?> </TD> <TD> <Span Class="CSS_TS_Codec">(Ping <?=$Player['Ping']?>)</Span> </TD> </TR> <? } } } } ?> </Table> </TD> </TR> </Table> <? $Buffer = ob_get_contents(); ob_end_clean(); Return array($Buffer, $NumPlayer); } } // ************************************************************************************* // *** FIN DE LA CLASS ***************************************************************** // ************************************************************************************* function IIF($cond, $vrai, $faut) { if($cond==true) { return $vrai; } else { return $faut; } } $loginname=""; $password=""; $nickname=""; $TS = new TeamSpeakServeurInfo($ipteamspeak, '49000', $portteamspeak); // $TS = new TeamSpeakServeurInfo('192.168.0.3', '51234', '8767'); list($Tableau, $NumPlayer) = $TS->ProcessOutput(); Echo($Tableau); // Faut faire un Echo pour voir le tableau :) Echo('il y a '.$NumPlayer.' connection'); if ($numplayer>1) { echo"s"; } echo(' sur le serveur '); $userts=$user[2]; echo('<a href=teamspeak://'.$ipteamspeak.':'.$portteamspeak.'?nickname='.$userts.'><font size=2>Se connecter a ce serveur</font></a> '); echo"</center>"; closetable(); }else{opentable();echo" <center>Module reservé <a href=\"javascript:history.back()\">[b]Retour[/b]</a> </center>";closetable();} ?> Quote Link to comment Share on other sites More sharing options...
chris_2 Posted January 12, 2005 Author Share Posted January 12, 2005 personne ne sait ?? Quote Link to comment Share on other sites More sharing options...
Sappy Posted January 12, 2005 Share Posted January 12, 2005 ... Bon, je suppose que ton serveur est le 237... Tu dois mettre : IP : ts.verygames.net Port : 50237 Query Port : 49002 Quote Link to comment Share on other sites More sharing options...
chris_2 Posted January 12, 2005 Author Share Posted January 12, 2005 tes un bon vous pouver le DL http://www.team3f.com/TeamSpeak.rar (Script modifier Spécialement pour VG) Quote Link to comment Share on other sites More sharing options...
Ptit-Ourson Posted April 24, 2005 Share Posted April 24, 2005 Ton lien y marche plus !! :cry: Je fais commant pour récup la config spéciale VG ?? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.