cvs: pear /Net_GameServerQuery/GameServerQuery/Protocol GameSpy04.php
| From: | Tom Buskens | Date: | Fri, 05 Nov 2004 15:23:33 +0000 |
| Subject: | cvs: pear /Net_GameServerQuery/GameServerQuery/Protocol GameSpy04.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-25706@lists.php.net to get a copy of this message | ||
ortega Fri Nov 5 10:23:33 2004 EDT
Modified files:
/pear/Net_GameServerQuery/GameServerQuery/Protocol GameSpy04.php
Log:
misc updates
http://cvs.php.net/diff.php/pear/Net_GameServerQuery/GameServerQuery/Protocol/GameSpy04.php?r1=1.12&r2=1.13&ty=u
Index: pear/Net_GameServerQuery/GameServerQuery/Protocol/GameSpy04.php
diff -u pear/Net_GameServerQuery/GameServerQuery/Protocol/GameSpy04.php:1.12
pear/Net_GameServerQuery/GameServerQuery/Protocol/GameSpy04.php:1.13
--- pear/Net_GameServerQuery/GameServerQuery/Protocol/GameSpy04.php:1.12 Sat Sep 18 10:20:51 2004
+++ pear/Net_GameServerQuery/GameServerQuery/Protocol/GameSpy04.php Fri Nov 5 10:23:33 2004
@@ -16,7 +16,7 @@
// | Tom Buskens <ortega@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: GameSpy04.php,v 1.12 2004/09/18 14:20:51 aidan Exp $
+// $Id: GameSpy04.php,v 1.13 2004/11/05 15:23:33 ortega Exp $
/**
@@ -25,7 +25,7 @@
* @category Net
* @package Net_GameServerQuery
* @author Tom Buskens <ortega@php.net>
- * @version $Revision: 1.12 $
+ * @version $Revision: 1.13 $
*/
class Net_GameServerQuery_Protocol_GameSpy04 extends Net_GameServerQuery_Protocol
{
@@ -39,8 +39,6 @@
{
// Header
$this->_getHeader();
- throw new Exception('Parsing error');
- }
// Variable / value pairs
while ($this->_match("([^\x00]+)\x00([^\x00]*)\x00")) {
@@ -61,9 +59,7 @@
protected function _players()
{
// Header
- if (!$this->_getHeader()) {
- throw new Exception('Parsing error');
- }
+ $this->_getHeader();
// Get values
if (!$this->_getValues('player')) {
@@ -87,8 +83,8 @@
protected function _team($from_players = false)
{
// Header
- if (!$from_players && !$this->_getHeader()) {
- throw new Exception('Parsing error');
+ if (!$from_players) {
+ $this->_getHeader();
}
// Get values
@@ -106,10 +102,11 @@
*/
private function _getHeader()
{
- if ($this->_match("\x00NGSQ")) {
+ if ($this->_getPrefix(5) == "\x00NGSQ") {
return true;
}
else {
+ throw new Exception('Parsing error: header not matched');
return false;
}
}
@@ -179,4 +176,4 @@
}
-?>
\ No newline at end of file
+?>