Location: PHPKode > scripts > Valve RCON > valve-rcon/doc/Fremnet/Valve_RCON/Valve_RCON.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Valve_RCON</title>
			<link rel="stylesheet" href="../../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			

<h2 class="class-name">Class Valve_RCON</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
											<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
						
			</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Valve RCON Class</p>
<p class="description"><p><strong>Synopsis:</strong></p><p><em>General Usage:</em>  <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-inc">include</span><span class="src-sym">(</span><span class="src-str">'valve_rcon.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$r&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../../Fremnet/Valve_RCON/Valve_RCON.html">Valve_RCON</a></span><span class="src-sym">(</span><span class="src-str">'secret'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'121.45.193.22'</span><span class="src-sym">,&nbsp;</span><span class="src-num">27015</span><span class="src-sym">,&nbsp;</span><span class="src-id"><a href="../../Fremnet/Valve_RCON/Valve_RCON.html">Valve_RCON</a></span><span class="src-sym">::</span><span class="src-id">PROTO_SOURCE</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$r</span><span class="src-sym">-&gt;</span><a href="../../Fremnet/Valve_RCON/Valve_RCON.html#methodconnect">connect</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$r</span><span class="src-sym">-&gt;</span><a href="../../Fremnet/Valve_RCON/Valve_RCON.html#methodauthenticate">authenticate</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;print&nbsp;<span class="src-var">$r</span><span class="src-sym">-&gt;</span><a href="../../Fremnet/Valve_RCON/Valve_RCON.html#methodexecute">execute</a><span class="src-sym">(</span><span class="src-str">'status'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;print&nbsp;<span class="src-var">$r</span><span class="src-sym">-&gt;</span><a href="../../Fremnet/Valve_RCON/Valve_RCON.html#methodexecute">execute</a><span class="src-sym">(</span><span class="src-str">'kick&nbsp;user'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;$<span class="src-sym">-&gt;</span><a href="../../Fremnet/Valve_RCON/Valve_RCON.html#methoddisconnect">disconnect</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol></div></p><p><em>Traditional Lazy Usage:</em>  <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-inc">include</span><span class="src-sym">(</span><span class="src-str">'valve_rcon.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$r&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../../Fremnet/Valve_RCON/Valve_RCON.html">Valve_RCON</a></span><span class="src-sym">(</span><span class="src-str">'secret'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'121.45.193.22'</span><span class="src-sym">,&nbsp;</span><span class="src-num">27015</span><span class="src-sym">,&nbsp;</span><span class="src-id"><a href="../../Fremnet/Valve_RCON/Valve_RCON.html">Valve_RCON</a></span><span class="src-sym">::</span><span class="src-id">PROTO_SOURCE</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;print&nbsp;<span class="src-var">$r</span><span class="src-sym">-&gt;</span><a href="../../Fremnet/Valve_RCON/Valve_RCON.html#methodexecute">execute</a><span class="src-sym">(</span><span class="src-str">'status'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol></div></p><p><em>Note: Traditional usage has performance penalties over multiple commands.</em></p></p>
	<ul class="tags">
				<li><span class="field">author:</span> Shannon Wynter (http://fremnet.net/contact)</li>
				<li><span class="field">version:</span> 1.0.0</li>
				<li><span class="field">copyright:</span> Copyright (c) 2008, Shannon Wynter (Fremnet)</li>
				<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/gpl-2.0.html">GPL 2.0 or greater</a></li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_valve_rcon.php.html">/valve_rcon.php</a> (line <span class="field">65</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>


	<a name="sec-const-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Class Constant Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Constants</span> (<a href="#sec-consts">details</a>)
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<div class="const-summary">
								<div class="const-title">
					<img src="../../media/images/Constant.png" alt=" " />
					<a href="#PROTO_CLASSIC" title="details" class="const-name">PROTO_CLASSIC</a> = 					<span class="var-type"> 1</span>

				</div>
								<div class="const-title">
					<img src="../../media/images/Constant.png" alt=" " />
					<a href="#PROTO_SOURCE" title="details" class="const-name">PROTO_SOURCE</a> = 					<span class="var-type"> 2</span>

				</div>
								<div class="const-title">
					<img src="../../media/images/Constant.png" alt=" " />
					<a href="#SERVERDATA_AUTH" title="details" class="const-name">SERVERDATA_AUTH</a> = 					<span class="var-type"> 3</span>

				</div>
								<div class="const-title">
					<img src="../../media/images/Constant.png" alt=" " />
					<a href="#SERVERDATA_AUTH_RESPONSE" title="details" class="const-name">SERVERDATA_AUTH_RESPONSE</a> = 					<span class="var-type"> 2</span>

				</div>
								<div class="const-title">
					<img src="../../media/images/Constant.png" alt=" " />
					<a href="#SERVERDATA_EXECCOMMAND" title="details" class="const-name">SERVERDATA_EXECCOMMAND</a> = 					<span class="var-type"> 2</span>

				</div>
								<div class="const-title">
					<img src="../../media/images/Constant.png" alt=" " />
					<a href="#SERVERDATA_RESPONSE_VALUE" title="details" class="const-name">SERVERDATA_RESPONSE_VALUE</a> = 					<span class="var-type"> 0</span>

				</div>
							</div>
		</div>
	</div>


	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
							
									<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																																																																				
												<div class="method-definition">
											<span class="method-result">Valve_RCON</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$password</span> = <span class="var-default">''</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$host</span> = <span class="var-default">'127.0.0.1'</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$port</span> = <span class="var-default">27015</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$protocol</span> = <span class="var-default">self::PROTO_SOURCE</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#assemble_packets" title="details" class="method-name">assemble_packets</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$packets</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#authenticate" title="details" class="method-name">authenticate</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#classic_read" title="details" class="method-name">classic_read</a>
											([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$strip_first</span> = <span class="var-default">true</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">integer</span>
										<a href="#classic_timeout" title="details" class="method-name">classic_timeout</a>
											([<span class="var-type"></span>&nbsp;<span class="var-name">$timout</span> = <span class="var-default">null</span>], <span class="var-type">integer</span>&nbsp;<span class="var-name">$timeout</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#classic_write" title="details" class="method-name">classic_write</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$string</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#connect" title="details" class="method-name">connect</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#disconnect" title="details" class="method-name">disconnect</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#execute" title="details" class="method-name">execute</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$command</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#host" title="details" class="method-name">host</a>
											([<span class="var-type">string</span>&nbsp;<span class="var-name">$host</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">integer</span>
										<a href="#port" title="details" class="method-name">port</a>
											([<span class="var-type">integer</span>&nbsp;<span class="var-name">$port</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">integer</span>
										<a href="#protocol" title="details" class="method-name">protocol</a>
											([<span class="var-type">integer</span>&nbsp;<span class="var-name">$protocol</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#smart_udp_read" title="details" class="method-name">smart_udp_read</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#socket_timeout" title="details" class="method-name">socket_timeout</a>
											([<span class="var-type">integer</span>&nbsp;<span class="var-name">$timeout_seconds</span> = <span class="var-default">null</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$timeout_microseconds</span> = <span class="var-default">null</span>], <span class="var-type">integer</span>&nbsp;<span class="var-name">$timeout_mircoseconds</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#source_read" title="details" class="method-name">source_read</a>
											([<span class="var-type">integer</span>&nbsp;<span class="var-name">$expected_id</span> = <span class="var-default">null</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$expected_packets</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">integer</span>
										<a href="#source_write" title="details" class="method-name">source_write</a>
											(<span class="var-type">integer</span>&nbsp;<span class="var-name">$serverdata</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$string1</span> = <span class="var-default">''</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$string2</span> = <span class="var-default">''</span>])
									</div>
								</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
							
										<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>

<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">133</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Class Constructor</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Valve_RCON</span>
		<span class="method-name">
			__construct
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$password</span> = <span class="var-default">''</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$host</span> = <span class="var-default">'127.0.0.1'</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$port</span> = <span class="var-default">27015</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$protocol</span> = <span class="var-default">self::PROTO_SOURCE</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$password</span><span class="var-description">: (''          ) The password to connect to the server with</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$host</span><span class="var-description">: ('127.0.0.1' ) The host to connect to</span>			</li>
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$port</span><span class="var-description">: (27015       ) The port to connect on</span>			</li>
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$protocol</span><span class="var-description">: (PROTO_SOURCE) The protocol to use</span>			</li>
				</ul>
		
			
	</div>
<a name="methodassemble_packets" id="assemble_packets"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">assemble_packets</span> (line <span class="line-number">384</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Assemble Packets</p>
<p class="description"><p>By default source packets are not very useful. If you pass an array of them  to this function it will do it's best to aggrogate the packets into one  concise response.</p><p><strong>Return array structure</strong>  <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'Request&nbsp;ID'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'id'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Request&nbsp;ID'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'response'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Response&nbsp;code'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'string1'&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'The&nbsp;response&nbsp;string'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'string2'&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'The&nbsp;null&nbsp;string'</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,&nbsp;</span>...</div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">)</span></div></li>
</ol></div></p></p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			assemble_packets
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$packets</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$packets</span><span class="var-description">: The packets to be assembled</span>			</li>
				</ul>
		
			
	</div>
<a name="methodauthenticate" id="authenticate"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">authenticate</span> (line <span class="line-number">299</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Authenticate</p>
<p class="description"><p>In the case of source, connect and send password  In the case of classic, connect and ask the server to say hi back</p></p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			authenticate
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodclassic_read" id="classic_read"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">classic_read</span> (line <span class="line-number">557</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Classic Read</p>
<p class="description"><p>Read data from servers using the classic protocol  Optionally strips that extra character from the front of the return.  Not entirely sure it's a good idea to do that - as it does serve a purpose...</p></p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			classic_read
		</span>
					([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$strip_first</span> = <span class="var-default">true</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">boolean</span>
				<span class="var-name">$strip_first</span><span class="var-description">: (true       ) Strip that extra byte from the front</span>			</li>
				</ul>
		
			
	</div>
<a name="methodclassic_timeout" id="classic_timeout"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">classic_timeout</span> (line <span class="line-number">222</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Classic Timeout Getter/Setter</p>
<p class="description"><p>Returns the current value of the classic timeout, or replaces it  with a passed value.</p><p>You shouldn't need to tweak this, but it's here in case you do</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> The current timeout</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">integer</span>
		<span class="method-name">
			classic_timeout
		</span>
					([<span class="var-type"></span>&nbsp;<span class="var-name">$timout</span> = <span class="var-default">null</span>], <span class="var-type">integer</span>&nbsp;<span class="var-name">$timeout</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$timeout</span><span class="var-description">: (null        ) The new timeout</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$timout</span>			</li>
				</ul>
		
			
	</div>
<a name="methodclassic_write" id="classic_write"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">classic_write</span> (line <span class="line-number">597</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Classic Write</p>
<p class="description"><p>Write data to servers using the classic protocol</p></p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			classic_write
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$string</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$string</span><span class="var-description">: The string to send to the servr</span>			</li>
				</ul>
		
			
	</div>
<a name="methodconnect" id="connect"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">connect</span> (line <span class="line-number">266</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Connect</p>
<p class="description"><p>Connect to the server</p></p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			connect
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methoddisconnect" id="disconnect"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">disconnect</span> (line <span class="line-number">284</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Disconnect</p>
<p class="description"><p>Disconnect from the server</p></p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			disconnect
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodexecute" id="execute"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">execute</span> (line <span class="line-number">330</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Execute</p>
<p class="description"><p>This is the big function, this right here is the portal to the whole  entire complex world that this class represents</p><p>It doesn't matter which type of rcon you are using, be it classic or source.  To get somewhere in life all you have to do is execute($command)</p><p><a href="../../Fremnet/Valve_RCON/Valve_RCON.html">See Valve_RCON for a synopsis</a></p></p>
	<ul class="tags">
				<li><span class="field">return:</span> The results of that command</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			execute
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$command</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$command</span><span class="var-description">: The rcon command to send to the server</span>			</li>
				</ul>
		
			
	</div>
<a name="methodhost" id="host"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">host</span> (line <span class="line-number">181</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Host Getter/Setter</p>
<p class="description"><p>Returns the current value of host, or replaces it with passed value</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> The current host</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			host
		</span>
					([<span class="var-type">string</span>&nbsp;<span class="var-name">$host</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$host</span><span class="var-description">: (null        ) The new host name/ip</span>			</li>
				</ul>
		
			
	</div>
<a name="methodport" id="port"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">port</span> (line <span class="line-number">193</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Port Getter/Setter</p>
<p class="description"><p>Returns the current value of port, or replaces it with passed value</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> The current port</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">integer</span>
		<span class="method-name">
			port
		</span>
					([<span class="var-type">integer</span>&nbsp;<span class="var-name">$port</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$port</span><span class="var-description">: (null        ) The new port</span>			</li>
				</ul>
		
			
	</div>
<a name="methodprotocol" id="protocol"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">protocol</span> (line <span class="line-number">207</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Protocol Getter/Setter</p>
<p class="description"><p>Returns the current value of protocol, or replaces it with passed value</p><p>Defined constants:  	PROTO_CLASSIC, PROTO_SOURCE</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> The current protocol</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">integer</span>
		<span class="method-name">
			protocol
		</span>
					([<span class="var-type">integer</span>&nbsp;<span class="var-name">$protocol</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$protocol</span><span class="var-description">: (null        ) The new protocol</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsmart_udp_read" id="smart_udp_read"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">smart_udp_read</span> (line <span class="line-number">520</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Smart UDP Read</p>
<p class="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></p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			smart_udp_read
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodsocket_timeout" id="socket_timeout"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">socket_timeout</span> (line <span class="line-number">238</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Socket Timeout Setter/Getter</p>
<p class="description"><p>Sets the socket timeout to the number of seconds + the number of microseconds if passed  otherwise just returns the current settings</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> (timeout_seconds, timeout_microseconds)</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			socket_timeout
		</span>
					([<span class="var-type">integer</span>&nbsp;<span class="var-name">$timeout_seconds</span> = <span class="var-default">null</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$timeout_microseconds</span> = <span class="var-default">null</span>], <span class="var-type">integer</span>&nbsp;<span class="var-name">$timeout_mircoseconds</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$timeout_seconds</span><span class="var-description">: (null       ) The number of seconds</span>			</li>
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$timeout_mircoseconds</span><span class="var-description">: (null       ) The number of microseconds</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$timeout_microseconds</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsource_read" id="source_read"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">source_read</span> (line <span class="line-number">425</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Source Read</p>
<p class="description"><p>Read data from servers using the source protocol  Optionally ignores all packets that don't match the ID passed  Optionally can speed up the process slightly (a few MS nothing more) by only  waiting for a specific number of packets - useful if you KNOW how many packets  your command is going to return, but generally not recommended.  <strong>Return array structure</strong>  <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'id'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Request&nbsp;ID'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'response'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Response&nbsp;code'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'string1'&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'The&nbsp;response&nbsp;string'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'string2'&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">'The&nbsp;null&nbsp;string'</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,&nbsp;</span>...</div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">)</span></div></li>
</ol></div></p></p>
	<ul class="tags">
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			source_read
		</span>
					([<span class="var-type">integer</span>&nbsp;<span class="var-name">$expected_id</span> = <span class="var-default">null</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$expected_packets</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$expected_id</span><span class="var-description">: (null       ) The id of the request/response</span>			</li>
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$expected_packets</span><span class="var-description">: (null       ) The expected number of packets</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsource_write" id="source_write"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">source_write</span> (line <span class="line-number">472</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Source Write</p>
<p class="description"><p>Write data to servers using the source protocol</p><p>Defined constants:  	SERVERDATA_EXECCOMMAND, SERVERDATA_AUTH</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> The id of this request</li>
				<li><span class="field">throws:</span> Exception</li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">integer</span>
		<span class="method-name">
			source_write
		</span>
					(<span class="var-type">integer</span>&nbsp;<span class="var-name">$serverdata</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$string1</span> = <span class="var-default">''</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$string2</span> = <span class="var-default">''</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$serverdata</span><span class="var-description">: One of the above two constants...</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$string1</span><span class="var-description">: (''         ) The string to send to the server</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$string2</span><span class="var-description">: (''         ) The docs say this should stay blank</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>

	<a name="sec-consts"></a>
	<div class="info-box">
		<div class="info-box-title">Class Constants</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Constants</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="constPROTO_CLASSIC" id="PROTO_CLASSIC"><!-- --></A>
<div class="evenrow">

	<div class="const-header">
		<img src="../../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">PROTO_CLASSIC</span>
			 = <span class="const-default"> 1</span>
			(line <span class="line-number">73</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Classic Protocol</p>
<p class="description"><p>Constants required for setting which protocol the class is using</p></p>
	
	
</div>
<a name="constPROTO_SOURCE" id="PROTO_SOURCE"><!-- --></A>
<div class="oddrow">

	<div class="const-header">
		<img src="../../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">PROTO_SOURCE</span>
			 = <span class="const-default"> 2</span>
			(line <span class="line-number">78</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Source Protocol - The default mode of operation</p>
<p class="description"><p>Constants required for setting which protocol the class is using</p></p>
	
	
</div>
<a name="constSERVERDATA_AUTH" id="SERVERDATA_AUTH"><!-- --></A>
<div class="evenrow">

	<div class="const-header">
		<img src="../../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">SERVERDATA_AUTH</span>
			 = <span class="const-default"> 3</span>
			(line <span class="line-number">85</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constants used internally for talking to/from the server</p>
	
	
</div>
<a name="constSERVERDATA_AUTH_RESPONSE" id="SERVERDATA_AUTH_RESPONSE"><!-- --></A>
<div class="oddrow">

	<div class="const-header">
		<img src="../../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">SERVERDATA_AUTH_RESPONSE</span>
			 = <span class="const-default"> 2</span>
			(line <span class="line-number">88</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constants used internally for talking to/from the server</p>
	
	
</div>
<a name="constSERVERDATA_EXECCOMMAND" id="SERVERDATA_EXECCOMMAND"><!-- --></A>
<div class="evenrow">

	<div class="const-header">
		<img src="../../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">SERVERDATA_EXECCOMMAND</span>
			 = <span class="const-default"> 2</span>
			(line <span class="line-number">84</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constants used internally for talking to/from the server</p>
	
	
</div>
<a name="constSERVERDATA_RESPONSE_VALUE" id="SERVERDATA_RESPONSE_VALUE"><!-- --></A>
<div class="oddrow">

	<div class="const-header">
		<img src="../../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">SERVERDATA_RESPONSE_VALUE</span>
			 = <span class="const-default"> 0</span>
			(line <span class="line-number">87</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constants used internally for talking to/from the server</p>
	
	
</div>

						
		</div>
	</div>

	<p class="notes" id="credit">
		Documentation generated on Thu, 07 Aug 2008 09:42:37 +1000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.2</a>
	</p>
	</div></body>
</html>
Return current item: Valve RCON