<?xml version="1.0" encoding="utf-8"?>
<project version="2.0.0a12" title="">
<file path="mcquery.class.php" hash="557b536578119af3cc7ea8f9fa6643d6" package="Fremnet\Minecraft">
<docblock line="2">
<description>Minecraft Query Class - PHP5 method of querying Minecraft servers
Copyright (C) 2013 Shannon Wynter</description>
<long-description><p>This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</p>
<h2>Changelog</h2>
<p>version 1.0, 2013-02-18, Shannon Wynter {@link http://fremnet.net/contact}
- initial release</p></long-description>
<tag line="2" name="version" description="1.0"/>
<tag line="2" name="author" description="Shannon Wynter {@link http://fremnet.net/contact}"/>
<tag line="2" name="copyright" description="Copyright &copy; 2013 Shannon Wynter (Fremnet)"/>
<tag line="2" name="license" description="http://www.gnu.org/licenses/gpl-2.0.html GPL 2.0 or greater"/>
<tag line="2" name="package" description="Fremnet"/>
<tag line="2" name="subpackage" description="Minecraft"/>
</docblock>
<class final="false" abstract="false" namespace="global" line="53" package="Fremnet\Minecraft">
<extends/>
<name>MCQuery</name>
<full_name>\MCQuery</full_name>
<docblock line="33">
<description>Minecraft Query Class</description>
<long-description><p><b>Synopsis:</b></p>
<p><i>General Usage:</i></p>
<pre><code>include('mcquery.class.php');
$q = new MCQuery('121.45.193.22');
$q->connect();
print_r($q->basic_status());
</code></pre></long-description>
<tag line="33" name="version" description="1.0.0"/>
<tag line="33" name="author" description="Shannon Wynter (http://fremnet.net/contact)"/>
<tag line="33" name="copyright" description="Copyright (c) 2013, Shannon Wynter (Fremnet)"/>
<tag line="33" name="license" description="http://www.gnu.org/licenses/gpl-2.0.html GPL 2.0 or greater"/>
<tag line="33" name="package" description="Fremnet"/>
<tag line="33" name="subpackage" description="Minecraft"/>
</docblock>
<constant namespace="global" line="60" package="Fremnet\Minecraft">
<name>PACKET_TYPE_STATUS</name>
<full_name>PACKET_TYPE_STATUS</full_name>
<value>0</value>
<docblock line="57">
<description>Status packet</description>
<long-description></long-description>
</docblock>
</constant>
<constant namespace="global" line="64" package="Fremnet\Minecraft">
<name>PACKET_TYPE_CHALLENGE</name>
<full_name>PACKET_TYPE_CHALLENGE</full_name>
<value>9</value>
<docblock line="61">
<description>Challenge packet</description>
<long-description></long-description>
</docblock>
</constant>
<property final="false" static="false" visibility="private" line="70" namespace="global" package="Default">
<name>$retries</name>
<default>0</default>
<docblock line="67">
<description>Internal handshake retry counter</description>
<long-description></long-description>
</docblock>
</property>
<property final="false" static="false" visibility="private" line="74" namespace="global" package="Default">
<name>$max_retries</name>
<default>3</default>
<docblock line="71">
<description>Maximum attempts at retrying</description>
<long-description></long-description>
</docblock>
</property>
<property final="false" static="false" visibility="private" line="79" namespace="global" package="Default">
<name>$read_timeout</name>
<default>2</default>
<docblock line="76">
<description>How long to wait for UDP packets to become available</description>
<long-description></long-description>
</docblock>
</property>
<property final="false" static="false" visibility="private" line="84" namespace="global" package="Default">
<name>$id</name>
<default>0</default>
<docblock line="81">
<description>Current packet ID, not really used by this class, more to be polite to the server</description>
<long-description></long-description>
</docblock>
</property>
<property final="false" static="false" visibility="private" line="88" namespace="global" package="Default">
<name>$challenge</name>
<default></default>
<docblock line="85">
<description>Storage for the classic protocol challange</description>
<long-description></long-description>
</docblock>
</property>
<property final="false" static="false" visibility="private" line="90" namespace="global" package="Default">
<name>$host</name>
<default></default>
</property>
<property final="false" static="false" visibility="private" line="91" namespace="global" package="Default">
<name>$prot</name>
<default>25565</default>
</property>
<property final="false" static="false" visibility="private" line="93" namespace="global" package="Default">
<name>$socket</name>
<default></default>
</property>
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="103" package="Fremnet\Minecraft">
<name>__construct</name>
<full_name>__construct</full_name>
<docblock line="95">
<description>Construct</description>
<long-description></long-description>
<tag line="95" name="param" description="the host to connect to" type="string" variable="$host">
<type by_reference="false">string</type>
</tag>
<tag line="95" name="param" description="set to null to take the default of 25565" type="integer" variable="$port">
<type by_reference="false">integer</type>
</tag>
<tag line="95" name="param" description="set to null to take the default of 3 retries" type="integer" variable="$max_retries">
<type by_reference="false">integer</type>
</tag>
<tag line="95" name="param" description="set to null to take the default read timeout of 2 seconds" type="integer" variable="$read_timeout">
<type by_reference="false">integer</type>
</tag>
</docblock>
<argument line="103">
<name>$host</name>
<default></default>
<type/>
</argument>
<argument line="103">
<name>$port</name>
<default>null</default>
<type/>
</argument>
<argument line="103">
<name>$max_retries</name>
<default>null</default>
<type/>
</argument>
<argument line="103">
<name>$read_timeout</name>
<default>null</default>
<type/>
</argument>
</method>
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="121" package="Fremnet\Minecraft">
<name>connect</name>
<full_name>connect</full_name>
<docblock line="114">
<description>Connect</description>
<long-description><p>'Connect' the udp socket and initiate handshake</p></long-description>
<tag line="114" name="throws" description="" type="\Exception">
<type by_reference="false">\Exception</type>
</tag>
</docblock>
</method>
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="140" package="Fremnet\Minecraft">
<name>disconnect</name>
<full_name>disconnect</full_name>
<docblock line="133">
<description>Disconnect</description>
<long-description><p>Disconnect the udp socket (is it ever really connected?)</p></long-description>
<tag line="133" name="throws" description="" type="\MCNotConnectedException">
<type by_reference="false">\MCNotConnectedException</type>
</tag>
</docblock>
</method>
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="155" package="Fremnet\Minecraft">
<name>handshake</name>
<full_name>handshake</full_name>
<docblock line="147">
<description>Handshake</description>
<long-description><p>Perform the MCQuery protocol handshake described on dinnerbone's website</p></long-description>
<tag line="147" name="see" description="\http://dinnerbone.com/blog/2011/10/14/minecraft-19-has-rcon-and-query/" refers="\http://dinnerbone.com/blog/2011/10/14/minecraft-19-has-rcon-and-query/"/>
<tag line="147" name="throws" description="" type="\MCNotConnectedException">
<type by_reference="false">\MCNotConnectedException</type>
</tag>
</docblock>
</method>
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="196" package="Fremnet\Minecraft">
<name>basic_status</name>
<full_name>basic_status</full_name>
<docblock line="176">
<description>Basic Status</description>
<long-description><p>Retrieve basic server status</p>
<p>Example output
Array (
[motd] => A Minecraft Server
[gametype] => SMP
[map] => world
[numplayers] => 2
[maxplayers] => 20
[hostname] => 127.0.0.1
[port] => 25565
)</p></long-description>
<tag line="176" name="throws" description="" type="\MCNotConnectedException">
<type by_reference="false">\MCNotConnectedException</type>
</tag>
<tag line="176" name="throws" description="" type="\MCNoChallengeException">
<type by_reference="false">\MCNoChallengeException</type>
</tag>
<tag line="176" name="returns" description="array associative array of name => value"/>
</docblock>
</method>
<method final="false" abstract="false" static="false" visibility="public" namespace="global" line="251" package="Fremnet\Minecraft">
<name>full_status</name>
<full_name>full_status</full_name>
<docblock line="224">
<description>Full status</description>
<long-description><p>Retrieve the full server status including player list</p>
<p>Example output
Array (
[motd] => A Minecraft Server
[gametype] => SMP
[game_id] => MINECRAFT
[version] => 1.4.7
[plugins] =>
[map] => world
[numplayers] => 2
[maxplayers] => 20
[hostport] => 25565
[hostip] => 127.0.0.1
[players] => Array (
[0] => fredblogs
[1] => maryblogs
)
)</p></long-description>
<tag line="224" name="throws" description="" type="\MCNotConnectedException">
<type by_reference="false">\MCNotConnectedException</type>
</tag>
<tag line="224" name="throws" description="" type="\MCNoChallengeException">
<type by_reference="false">\MCNoChallengeException</type>
</tag>
<tag line="224" name="return" description="associative array of server data" type="array">
<type by_reference="false">array</type>
</tag>
</docblock>
</method>
<method final="false" abstract="false" static="false" visibility="protected" namespace="global" line="288" package="Fremnet\Minecraft">
<name>array_mutate</name>
<full_name>array_mutate</full_name>
<docblock line="276">
<description>Array Mutate</description>
<long-description><p>Quickly convert any given array of name, value into an
associative array of name => value.</p>
<p>NB: Not really sutable for large arrays.</p></long-description>
<tag line="276" name="throws" description="" type="\LengthException">
<type by_reference="false">\LengthException</type>
</tag>
<tag line="276" name="param" description="even [name, value] array" type="array" variable="$array">
<type by_reference="false">array</type>
</tag>
<tag line="276" name="return" description="associative array of [name => value]" type="array">
<type by_reference="false">array</type>
</tag>
</docblock>
<argument line="288">
<name>$array</name>
<default></default>
<type>array</type>
</argument>
</method>
<method final="false" abstract="false" static="false" visibility="protected" namespace="global" line="311" package="Fremnet\Minecraft">
<name>write_packet</name>
<full_name>write_packet</full_name>
<docblock line="301">
<description>Write packet</description>
<long-description><p>Send a MCQuery packet to the server</p>
<p>$type would be PACKET_TYPE_STATUS or PACKET_TYPE_CHALLENGE</p></long-description>
<tag line="301" name="param" description="type of packet to send" type="integer" variable="$type">
<type by_reference="false">integer</type>
</tag>
<tag line="301" name="param" description="usually a string to send as a payload" type="mixed" variable="$payload">
<type by_reference="false">mixed</type>
</tag>
</docblock>
<argument line="311">
<name>$type</name>
<default></default>
<type/>
</argument>
<argument line="311">
<name>$payload</name>
<default></default>
<type/>
</argument>
</method>
<method final="false" abstract="false" static="false" visibility="protected" namespace="global" line="326" package="Fremnet\Minecraft">
<name>read_packet</name>
<full_name>read_packet</full_name>
<docblock line="316">
<description>Read Packet</description>
<long-description><p>Really when hooked up to smart udp read it's going to read as much as
it can, not just one packet.</p>
<p>Read and unpack the basic information from a MCQuery packet</p></long-description>
<tag line="316" name="return" description="Type of packet, Id of packet, Buffer" type="array">
<type by_reference="false">array</type>
</tag>
</docblock>
</method>
<method final="false" abstract="false" static="false" visibility="protected" namespace="global" line="342" package="Fremnet\Minecraft">
<name>smart_udp_read</name>
<full_name>smart_udp_read</full_name>
<docblock line="332">
<description>Smart UDP Read</description>
<long-description><p>Face it, when it comes to reading UDP packets, PHP is rather dumb
This gives us a slightly smarter udp read that waits for the socket to be unblocked
and keeps reading until there's no more waiting data.</p></long-description>
<tag line="332" name="throws" description="" type="\MCNotConnectedException">
<type by_reference="false">\MCNotConnectedException</type>
</tag>
<tag line="332" name="return" description="" type="string">
<type by_reference="false">string</type>
</tag>
</docblock>
</method>
</class>
<class final="false" abstract="false" namespace="global" line="369" package="Default">
<extends>\Exception</extends>
<name>MCException</name>
<full_name>\MCException</full_name>
</class>
<class final="false" abstract="false" namespace="global" line="370" package="Default">
<extends>\MCException</extends>
<name>MCNotConnectedException</name>
<full_name>\MCNotConnectedException</full_name>
</class>
<class final="false" abstract="false" namespace="global" line="371" package="Default">
<extends>\MCException</extends>
<name>MCNoChallengeException</name>
<full_name>\MCNoChallengeException</full_name>
</class>
<parse_markers>
<error line="90" code="50018">No DocBlock was found for property $host</error>
<error line="91" code="50018">No DocBlock was found for property $prot</error>
<error line="93" code="50018">No DocBlock was found for property $socket</error>
<error line="369" code="50000">No DocBlock was found for \MCException</error>
<error line="370" code="50000">No DocBlock was found for \MCNotConnectedException</error>
<error line="371" code="50000">No DocBlock was found for \MCNoChallengeException</error>
</parse_markers>
</file>
<package name="Default" full_name="Default"/>
<package name="Fremnet" full_name="Fremnet">
<package name="Minecraft" full_name="Fremnet\Minecraft"/>
</package>
<namespace name="global" full_name="global"/>
<marker count="0">todo</marker>
<marker count="0">fixme</marker>
<deprecated count="0"/>
</project>
|