Net_GameServerQuery
[ class tree: Net_GameServerQuery ] [ index: Net_GameServerQuery ] [ all elements ]

Source for file example3.php

Documentation is available at example3.php

  1. <html>
  2. <head>
  3.     <title>Net_GameServerQuery Example 3: Accessing communication classes</title>
  4. </head>
  5. <body>
  6. <h1>Net_GameServerQuery Example 3: Accessing communication classes</h1>
  7. <p>This example shows how the communication class manually with Net_GameServerQuery.</p>
  8. <p>We ask a Half-Life server for its status.</p>
  9. <pre>
  10. <?php
  11. require_once 'Net/GameServerQuery.php';
  12.  
  13. // Get the packet to send
  14. list($packetname$packet$cfg->getPacket('HalfLife''status');
  15.  
  16. // Create array of server information
  17. $serverdata = array(
  18.     0 => array(
  19.         'packet'    => $packet,
  20.         'addr'      => '202.12.147.111',
  21.         'port'      => 27045,
  22.         ));
  23.  
  24. // Query
  25. $results $gsq_comm->query($serverdata200);
  26.  
  27. ?>
  28. </pre>
  29. </body>
  30. </html>

Documentation generated on Mon, 11 Mar 2019 15:39:46 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.