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

Source for file BC2Conn.php

Documentation is available at BC2Conn.php

  1. <?php
  2. /*
  3.  * BC2Conn - PHP class for communicating with a Battlefield Bad Company 2 gameserver
  4.  * http://bc2conn.sf.net/
  5.  * Copyright (C) 2010 by JLNNN <JLN@hush.ai>
  6.  *
  7.  * This program is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU General Public License
  9.  * as published by the Free Software Foundation; either version 2
  10.  * of the License, or (at your option) any later version.
  11.  *
  12.  * This program is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15.  * GNU General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU General Public License
  18.  * along with this program; if not, write to the Free Software
  19.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20.  */
  21.  
  22. /**
  23.  * <b>Project page:</b>
  24.  * http://bc2conn.sf.net/<br />
  25.  * <br /><br />
  26.  * <b>Message board:</b><br /><br />
  27.  * http://bc2conn.sf.net/board/<br />
  28.  * <br /><br />
  29.  * <b>API:</b><br /><br />
  30.  * http://bc2conn.sf.net/API/
  31.  *
  32.  * @author JLNNN <JLN@hush.ai>
  33.  * @version 1.05
  34.  *
  35.  *  $Id: BC2Conn.php 16 2010-08-01 09:17:15Z jlnnn $
  36.  */
  37. class BC2Conn {
  38.     private $_serverIP null;
  39.     private $_serverRconQueryPort null;
  40.     private $_clientSequenceNr 0;
  41.     private $_sock null;
  42.     private $_connection false;
  43.  
  44.     private $_playerdata null// used for caching
  45.     private $_playerdata_admin null// used for caching
  46.     private $_serverdata null// used for caching
  47.  
  48.     private $_isLoggedIn false;
  49.     private $_sockType null;
  50.  
  51.     /*-- configuration vars --*/
  52.  
  53.     private $_globalMsg array(
  54.         "PLAYER_NOT_FOUND" => "PlayerNotFoundError",
  55.         "TEAM_NOT_FOUND" => "TeamNameNotFoundError",
  56.         "SQUAD_NOT_FOUND" => "SquadNameNotFoundError",
  57.         "PLAYMODE_NOT_FOUND" => "PlaymodeNameNotFoundError",
  58.         "MAPNAME_NOT_FOUND" => "MapNameNotFoundError",
  59.         "ADMIN_YELL_DURATION_MAX" => 59999,
  60.         "NOT_LOGGED_IN" => "NotLoggedInAsAdmin",
  61.         "LOGIN_FAILED" => "LoginFailed",
  62.     );
  63.  
  64.     private $_globalVars array(
  65.         "mapsFileXML" => "mapNames.xml",
  66.         "playmodesFileXML" => "playModes.xml",
  67.         "squadnamesFileXML" => "squadNames.xml",
  68.         "teamnamesFileXML" => "teamNames.xml",
  69.         "defaultServerResponse" => "OK",
  70.         "cachingEnabled" => true// change this to false if you want caching disabled
  71.     );
  72.  
  73.     /*-- constructor and destructor --*/
  74.  
  75.     /**
  76.      * @param String 
  77.      * @param Integer 
  78.      * @param String (optional) - for debugging, use "-d"
  79.      */
  80.     function __construct($serverIP$serverRconQueryPort$debug null{
  81.         if($this->_serverIP == null{
  82.             $this->_serverIP $serverIP;
  83.             $this->_serverRconQueryPort $serverRconQueryPort;
  84.             $this->_connection $this->_openConnection($debug);
  85.         }
  86.     }
  87.  
  88.     function __destruct({
  89.         if($this->_connection{
  90.             $this->_closeConnection();
  91.             $this->_connection false;
  92.         }
  93.     }
  94.  
  95.     /*-- required methods for communicating with the gameserver --*/
  96.  
  97.     private function _encodeClientRequest($data{
  98.         $packet $this->_encodePacket(falsefalse$this->_clientSequenceNr$data);
  99.         $this->_clientSequenceNr ($this->_clientSequenceNr 10x3fffffff;
  100.  
  101.         return $packet;
  102.     }
  103.  
  104.     private function _encodeHeader($isFromServer$isResponse$sequence{
  105.         $header $sequence 0x3fffffff;
  106.         if($isFromServer{
  107.             $header += 0x80000000;
  108.         }
  109.         if($isResponse{
  110.             $header += 0x40000000;
  111.         }
  112.  
  113.         return pack('I'$header);
  114.     }
  115.  
  116.     private function _decodeHeader($data{
  117.         $header unpack('I'$data);
  118.  
  119.         return array(
  120.         $header 0x80000000,
  121.         $header 0x40000000,
  122.         $header 0x3fffffff
  123.         );
  124.     }
  125.  
  126.     private function _encodeInt32($size{
  127.         return pack('I'$size);
  128.     }
  129.  
  130.     private function _decodeInt32($data{
  131.         $decode unpack('I'$data);
  132.  
  133.         return $decode[1];
  134.     }
  135.  
  136.     private function _encodeWords($words{
  137.         $size 0;
  138.         $encodedWords '';
  139.         foreach($words as $word{
  140.             $strWord $word;
  141.             $encodedWords .= $this->_encodeInt32(strlen($strWord));
  142.             $encodedWords .= $strWord;
  143.             $encodedWords .= "\x00";
  144.             $size += strlen($strWord5;
  145.         }
  146.  
  147.         return array(
  148.         $size,
  149.         $encodedWords
  150.         );
  151.     }
  152.  
  153.     private function _decodeWords($size$data{
  154.         $numWords $this->_decodeInt32($data);
  155.         $offset 0;
  156.         while($offset $size{
  157.             $wordLen $this->_decodeInt32(substr($data$offset4));
  158.             $word substr($data$offset 4$wordLen);
  159.             $words[$word;
  160.             $offset += $wordLen 5;
  161.         }
  162.  
  163.         return $words;
  164.     }
  165.  
  166.     private function _encodePacket($isFromServer$isResponse$sequence$data{
  167.         $data explode(' '$data);
  168.         if($data[0== "admin.yell" && isset($data[1])) {
  169.             $adminYell array($data[0]'''''');
  170.  
  171.             $yellStyle '';
  172.             $yellKey 0;
  173.             foreach($data as $key => $content{
  174.                 if($key != 0{
  175.                     if($content == "{%player%}"{
  176.                         $yellStyle "player";
  177.                         $yellKey $key;
  178.                         break;
  179.                     else if($content == "{%team%}"{
  180.                         $yellStyle "team";
  181.                         $yellKey $key;
  182.                         break;
  183.                     else if($content == "{%all%}"{
  184.                         $yellStyle "all";
  185.                         $yellKey $key;
  186.                         break;
  187.                     }
  188.                 }
  189.             }
  190.  
  191.             if($yellStyle == "all"{
  192.                 foreach($data as $key => $content{
  193.                     if($key != && $key $yellKey 1{
  194.                         $adminYell[1.= $content ' ';
  195.                     else if($key == $yellKey{
  196.                         $adminYell[3$yellStyle;
  197.                     else if($key == $yellKey-1{
  198.                         $adminYell[2$data[$yellKey-1];
  199.                     }
  200.                 }
  201.  
  202.                 $adminYell[1trim($adminYell[1]);
  203.             else if($yellStyle == "player" || $yellStyle == "team"{
  204.                 $adminYell[4'';
  205.  
  206.                 foreach($data as $key => $content{
  207.                     if($key != && $key $yellKey 1{
  208.                         $adminYell[1.= $content ' ';
  209.                     else if($key == $yellKey{
  210.                         $adminYell[3$yellStyle;
  211.                     else if($key == $yellKey-1{
  212.                         $adminYell[2$data[$yellKey-1];
  213.                     else if($key $yellKey{
  214.                         $adminYell[4.= $content ' ';
  215.                     }
  216.                 }
  217.  
  218.                 $adminYell[4trim($adminYell[4])// trim whitespaces
  219.             }
  220.  
  221.             $data $adminYell;
  222.         else if($data[0== "vars.serverDescription" && isset($data[1])) {
  223.             $serverDesc array($data[0]'');
  224.             foreach($data as $key => $value{
  225.                 if($key != 0{
  226.                     $serverDesc[1.= $value ' ';
  227.                 }
  228.             }
  229.             $serverDesc[1trim($serverDesc[1]);
  230.  
  231.             $data $serverDesc;
  232.         else if($data[0== "admin.kickPlayer" && isset($data[1])) {
  233.             $reason false;
  234.             foreach($data as $key => $value{
  235.                 if($value == "{%reason%}"{
  236.                     $reason true;
  237.                 }
  238.             }
  239.  
  240.             if(!$reason{
  241.                 $kickPlayer array($data[0]'');
  242.                 foreach($data as $key => $value{
  243.                     if($key != 0{
  244.                         $kickPlayer[1.= $value ' ';
  245.                     }
  246.                 }
  247.                 $kickPlayer[1trim($kickPlayer[1]);
  248.             else {
  249.                 $kickPlayer array($data[0]'''');
  250.                 $i 0;
  251.                 foreach($data as $key => $value{
  252.                     if($key != 0{
  253.                         if($value == "{%reason%}"{
  254.                             $i $key;
  255.                         }
  256.  
  257.                         if($i == 0{
  258.                             $kickPlayer[1.= $value ' ';
  259.                         else {
  260.                             if($key != $i{
  261.                                 $kickPlayer[2.= $value ' ';
  262.                             }
  263.                         }
  264.                     }
  265.                 }
  266.                 $kickPlayer[1trim($kickPlayer[1])// trim whitespaces
  267.                 $kickPlayer[2trim($kickPlayer[2])// trim whitespaces
  268.             }
  269.  
  270.             $data $kickPlayer;
  271.         else if($data[0== "banList.add" || $data[0== "banList.remove" && isset($data[1])) {
  272.             $dataCount count($data1;
  273.             $banPlayer array($data[0]$data[1],    '');
  274.             foreach($data as $key => $value{
  275.                 if($key != && $key != 1{
  276.                     if($data[0== "banList.add" && $key != $dataCount{
  277.                         $banPlayer[2.= $value ' ';
  278.                     else if($data[0== "banList.remove"{
  279.                         $banPlayer[2.= $value ' ';
  280.                     }
  281.                 }
  282.             }
  283.  
  284.             $banPlayer[2trim($banPlayer[2])// trim whitespace
  285.  
  286.             if($data[0== "banList.add"{
  287.                 $banPlayer[3$data[$dataCount];
  288.             }
  289.  
  290.             $data $banPlayer;
  291.         else if($data[0== "admin.listPlayers" || $data[0== "listPlayers" && isset($data[1])) {
  292.             $listPlayer array($data[0]);
  293.             if($data[1!= "all"{
  294.                 if($data[1== "player"{
  295.                     $listPlayer[1$data[1];
  296.                     $listPlayer[2'';
  297.                     foreach($data as $key => $value{
  298.                         if($key != && $key != 1{
  299.                             $listPlayer[2.= $value ' ';
  300.                         }
  301.                     }
  302.  
  303.                     $listPlayer[2trim($listPlayer[2])// trim ending whitespace
  304.                 }
  305.             else {
  306.                 $listPlayer[1$data[1];
  307.             }
  308.  
  309.             $data $listPlayer;
  310.         else if($data[0== "reservedSlots.addPlayer" || $data[0== "reservedSlots.removePlayer" && isset($data[1])) {
  311.             $reservedSlots array($data[0]'');
  312.             foreach($data as $key => $value{
  313.                 if($key != 0{
  314.                     $reservedSlots[1.= $value ' ';
  315.                 }
  316.             }
  317.  
  318.             $reservedSlots[1trim($reservedSlots[1])// trim whitespace
  319.  
  320.             $data $reservedSlots;
  321.         else if($data[0== "admin.say" && isset($data[1])) {
  322.             $adminSay array($data[0]'''''');
  323.             $i 0;
  324.             foreach($data as $key => $value{
  325.                 if($key != 0{
  326.                     if($value == "{%player%}" || $value == "{%team%}" || $value == "{%all%}"{
  327.                         $i $key;
  328.                         $adminSay[2preg_replace("/[{}%]/"''$value);
  329.                     }
  330.                     if($i == 0{
  331.                         $adminSay[1.= $value ' ';
  332.                     else {
  333.                         if($key != $i && $adminSay[2!= "all"{
  334.                             $adminSay[3.= $value ' ';
  335.                         }
  336.                     }
  337.                 }
  338.             }
  339.  
  340.  
  341.             $adminSay[1trim($adminSay[1])// trim whitespace
  342.             $adminSay[3trim($adminSay[3])// trim whitespace
  343.  
  344.             if($adminSay[2== "all"{
  345.                 unset($adminSay[3]);
  346.             }
  347.  
  348.             $data $adminSay;
  349.         else if($data[0== "admin.killPlayer" && isset($data[1])) {
  350.             $adminKillPlayer array($data[0]'');
  351.             $i 0;
  352.             foreach($data as $key => $value{
  353.                 if($key != 0{
  354.                     $adminKillPlayer[1.= $value ' ';
  355.                 }
  356.             }
  357.  
  358.             $adminKillPlayer[1trim($adminKillPlayer[1])// trim whitespace
  359.  
  360.             $data $adminKillPlayer;
  361.         else if($data[0== "admin.movePlayer" && isset($data[1])) {
  362.             $dataCount count($data3;
  363.             $adminMovePlayer array($data[0]'''''''');
  364.             $i 0;
  365.             foreach($data as $key => $value{
  366.                 if($key != && $key $dataCount{
  367.                     $adminMovePlayer[1.= $value ' ';
  368.                 }
  369.             }
  370.  
  371.             $adminMovePlayer[1trim($adminMovePlayer[1])// trim whitespace
  372.             $adminMovePlayer[2$data[$dataCount];
  373.             $adminMovePlayer[3$data[$dataCount 1];
  374.             $adminMovePlayer[4$data[$dataCount 2];
  375.  
  376.             $data $adminMovePlayer;
  377.         }
  378.  
  379.         $encodedHeader $this->_encodeHeader($isFromServer$isResponse$sequence);
  380.         $encodedNumWords $this->_encodeInt32(count($data));
  381.         list($wordsSize$encodedWords$this->_encodeWords($data);
  382.         $encodedSize $this->_encodeInt32($wordsSize 12);
  383.  
  384.         return $encodedHeader $encodedSize $encodedNumWords $encodedWords;
  385.     }
  386.  
  387.     private function _decodePacket($data{
  388.         list($isFromServer$isResponse$sequence$this->_decodeHeader($data);
  389.         $wordsSize $this->_decodeInt32(substr($data44)) 12;
  390.         $words $this->_decodeWords($wordsSizesubstr($data12));
  391.  
  392.         return array(
  393.         $isFromServer,
  394.         $isResponse,
  395.         $sequence,
  396.         $words
  397.         );
  398.     }
  399.  
  400.     private function _containsCompletePacket($data{
  401.         if(strlen($data8{
  402.             return false;
  403.         }
  404.  
  405.         if(strlen($data$this->_decodeInt32(substr($data44)))
  406.         {
  407.             return false;
  408.         }
  409.  
  410.         return true;
  411.     }
  412.  
  413.     private function _receivePacket($receiveBuffer{
  414.         while(!$this->_containsCompletePacket($receiveBuffer)) {
  415.             if($this->_sockType == 1{
  416.                 $receiveBuffer .= socket_read($this->_sock4096);
  417.             else {
  418.                 $receiveBuffer .= fread($this->_sock4096);
  419.             }
  420.         }
  421.  
  422.         $packetSize $this->_decodeInt32(substr($receiveBuffer44));
  423.  
  424.         $packet substr($receiveBuffer0$packetSize);
  425.         $receiveBuffer substr($receiveBuffer$packetSizestrlen($receiveBuffer));
  426.  
  427.         return array(
  428.         $packet,
  429.         $receiveBuffer
  430.         );
  431.     }
  432.  
  433.     private function _hex_str($hex{
  434.         $string '';
  435.         for($i 0$i strlen($hex1$i += 2{
  436.             $string .= chr(hexdec($hex[$i$hex[$i 1]));
  437.         }
  438.  
  439.         return $string;
  440.     }
  441.  
  442.     private function _bool2String($boolean{
  443.         $onOrOff '';
  444.         if($boolean{
  445.             $onOrOff "true";
  446.         else {
  447.             $onOrOff "false";
  448.         }
  449.  
  450.         return $onOrOff;
  451.     }
  452.  
  453.     private function _array2String($array$key 1{
  454.         return $array[$key];
  455.     }
  456.  
  457.     private function _array2boolean($array$key 1{
  458.         if($array[$key== "true"{
  459.             return true;
  460.         else {
  461.             return false;
  462.         }
  463.     }
  464.  
  465.     /*-- internal methods --*/
  466.  
  467.     private function _openConnection($debug null{
  468.         $connection false;
  469.  
  470.         if(function_exists("socket_create"&& function_exists("socket_connect"&& function_exists("socket_strerror"&& function_exists("socket_last_error"&& function_exists("socket_set_block"&& function_exists("socket_read"&& function_exists("socket_write"&& function_exists("socket_close")) {
  471.             $this->_sock socket_create(AF_INETSOCK_STREAMSOL_TCP);
  472.             @$connection socket_connect($this->_sock$this->_serverIP$this->_serverRconQueryPort);
  473.             if($debug == "-d"{
  474.                 echo "[DEBUG]: " socket_strerror(socket_last_error()) ".\n";
  475.             }
  476.             if($connection{
  477.                 socket_set_block($this->_sock);
  478.             }
  479.  
  480.             $this->_sockType 1;
  481.         else if(function_exists("fsockopen")) {
  482.             if($debug == "-d"{
  483.                 @$this->_sock fsockopen("tcp://" $this->_serverIP$this->_serverRconQueryPort$errno$errstr500000);
  484.                 if(!$this->_sock{
  485.                     echo "[DEBUG]: " $errno " - " $errstr "\n";
  486.                 }
  487.             else {
  488.                 @$this->_sock fsockopen("tcp://" $this->_serverIP$this->_serverRconQueryPort);
  489.             }
  490.  
  491.             $connection $this->_sock;
  492.  
  493.             $this->_sockType 2;
  494.         }
  495.  
  496.         return $connection;
  497.     }
  498.  
  499.     private function _closeConnection({
  500.         $this->_clientRequest("quit");
  501.  
  502.         if($this->_sockType == 1{
  503.             socket_close($this->_sock);
  504.         else {
  505.             fclose($this->_sock);
  506.         }
  507.  
  508.         $this->_sockType null;
  509.     }
  510.  
  511.     private function _clientRequest($clientRequest{
  512.         $data $this->_encodeClientRequest($clientRequest);
  513.  
  514.         if($this->_sockType == 1{
  515.             socket_write($this->_sock$datastrlen($data));
  516.         else {
  517.             fwrite($this->_sock$datastrlen($data));
  518.         }
  519.  
  520.         $receiveBuffer '';
  521.         list($packet$receiveBuffer$this->_receivePacket($receiveBuffer);
  522.         list($isFromServer$isResponse$sequence$requestAnswer$this->_decodePacket($packet);
  523.  
  524.         return $requestAnswer;
  525.     }
  526.  
  527.     /**
  528.      * returns true if connected to a gameserver, otherwise false
  529.      *
  530.      * @see isServerOnline()
  531.      *
  532.      * @return boolean 
  533.      */
  534.     function isConnected({
  535.         return $this->_connection;
  536.     }
  537.  
  538.     /*-- login and logout --*/
  539.  
  540.     /**
  541.      * plain text login to gameserver<br />
  542.      * [ RCON password MUST NOT contain whitespaces!! ]
  543.      *
  544.      * @param String 
  545.      *
  546.      * @return String 
  547.      */
  548.     function loginInsecure($rconPassword{
  549.         $loginStatus $this->_array2String($this->_clientRequest("login.plainText " $rconPassword)0);
  550.  
  551.         if($loginStatus == $this->_globalVars['defaultServerResponse']{
  552.             $this->_isLoggedIn true;
  553.             return $loginStatus;
  554.         else {
  555.             return $this->_globalMsg['LOGIN_FAILED'];
  556.         }
  557.     }
  558.  
  559.     /**
  560.      * salted hash login to gameserver<br />
  561.      * [ RCON password MUST NOT contain whitespaces!! ]
  562.      *
  563.      * @param String 
  564.      *
  565.      * @return String 
  566.      */
  567.     function loginSecure($rconPassword{
  568.         $salt $this->_array2String($this->_clientRequest("login.hashed"));
  569.  
  570.         $hashedPW $this->_hex_str($salt$rconPassword;
  571.         $saltedHashedPW strtoupper(md5($hashedPW));
  572.  
  573.         $loginStatus $this->_array2String($this->_clientRequest("login.hashed " $saltedHashedPW)0);
  574.  
  575.         if($loginStatus == $this->_globalVars['defaultServerResponse']{
  576.             $this->_isLoggedIn true;
  577.             return $loginStatus;
  578.         else {
  579.             return $this->_globalMsg['LOGIN_FAILED'];
  580.         }
  581.     }
  582.  
  583.     /**
  584.      * logging out
  585.      *
  586.      * @return String 
  587.      */
  588.     function logout({
  589.         $this->_isLoggedIn false;
  590.         return $this->_array2String($this->_clientRequest("logout")0);
  591.     }
  592.  
  593.     /**
  594.      * if logged in with rcon && successful, return true, otherwise false
  595.      *
  596.      * @return boolean 
  597.      */
  598.     public function isLoggedIn({
  599.         return $this->_isLoggedIn;
  600.     }
  601.  
  602.     /*-- replacements --*/
  603.  
  604.     /**
  605.      * returns the name of the given map<br /><br />
  606.      * example: getMapName("Levels/MP_002")
  607.      *
  608.      * @param String 
  609.      *
  610.      * @return String name of the given map
  611.      */
  612.     function getMapName($mapURI{
  613.         $mapNamesXML simplexml_load_file($this->_globalVars['mapsFileXML']);
  614.         $mapName $this->_globalMsg['MAPNAME_NOT_FOUND'];
  615.  
  616.         for($i 0$i <= (count($mapNamesXML->map1)$i++{
  617.             if($mapURI == $mapNamesXML->map[$i]->attributes()->uri{
  618.                 $mapName $mapNamesXML->map[$i]->attributes()->name;
  619.             }
  620.         }
  621.  
  622.         return $mapName;
  623.     }
  624.  
  625.     /**
  626.      * returns the name of the given playmode<br /><br />
  627.      * example: getPlaymodeName("RUSH")
  628.      *
  629.      * @param String 
  630.      *
  631.      * @return String name of the given playmode
  632.      */
  633.     function getPlaymodeName($playmodeURI{
  634.         $playModesXML simplexml_load_file($this->_globalVars['playmodesFileXML']);
  635.         $playmodeName $this->_globalMsg['PLAYMODE_NOT_FOUND'];
  636.  
  637.         for($i 0$i <= (count($playModesXML->playmode1)$i++{
  638.             if($playmodeURI == $playModesXML->playmode[$i]->attributes()->uri{
  639.                 $playmodeName $playModesXML->playmode[$i]->attributes()->name;
  640.             }
  641.         }
  642.  
  643.         return $playmodeName;
  644.     }
  645.  
  646.     /**
  647.      * returns the name of the given squad<br /><br />
  648.      * example: getSquadName(1) - will return "Bravo Squad"
  649.      *
  650.      * @param Integer 
  651.      *
  652.      * @return String 
  653.      */
  654.     function getSquadName($squadID{
  655.         $squadNamesXML simplexml_load_file($this->_globalVars['squadnamesFileXML']);
  656.         $squadName $this->_globalMsg['SQUAD_NOT_FOUND'];
  657.  
  658.         for($i 0$i <= (count($squadNamesXML->squad1)$i++{
  659.             if($squadID == $squadNamesXML->squad[$i]->attributes()->id{
  660.                 $squadName $squadNamesXML->squad[$i]->attributes()->name;
  661.             }
  662.         }
  663.  
  664.         return $squadName;
  665.     }
  666.  
  667.     /**
  668.      * gets the teamname of a given map, playmode and teamid (DIFFERENT IN SQDM!)
  669.      *
  670.      * @param String 
  671.      * @param String 
  672.      * @param Integer 
  673.      * @param Integer (optional) - if playmode = SQDM, a squadid is required!
  674.      *
  675.      * @return String 
  676.      */
  677.     function getTeamName($mapURI$playmodeURI$teamID$squadID null{
  678.         $teamNameXML simplexml_load_file($this->_globalVars['teamnamesFileXML']);
  679.         $teamName $this->_globalMsg['TEAM_NOT_FOUND'];
  680.  
  681.         if($mapURI == "Levels/MP_012GR"// xml case 'Levels/MP_012GR'
  682.             if(count($teamNameXML->teamName[1]->playMode[0]>= $teamID{
  683.                 $teamName $teamNameXML->teamName[1]->playMode[0]->team[$teamID]->name;
  684.             }
  685.         else
  686.         if($mapURI == "Levels/MP_008"// xml case 'Levels/MP_008'
  687.             if(count($teamNameXML->teamName[2]->playMode[0]>= $teamID{
  688.                 $teamName $teamNameXML->teamName[2]->playMode[0]->team[$teamID]->name;
  689.             }
  690.         else
  691.         if($mapURI != "Levels/MP_012GR" && $playmodeURI == "SQDM"// xml case 'SQDM'
  692.             if($squadID != null{
  693.                 if($squadID == 24{
  694.                     $squadID 0;
  695.                 }
  696.                 if(count($teamNameXML->teamName[3]->playMode[0]>= $squadID{
  697.                     $teamName $teamNameXML->teamName[3]->playMode[0]->squad[$squadID]->name;
  698.                 }
  699.             }
  700.         else // xml case 'default'
  701.             $playModes count($teamNameXML->teamName[0]1;
  702.             if($playModes >= $teamID{
  703.                 for($i 0$i <= $playModes$i++{
  704.                     if($teamNameXML->teamName[0]->playMode[$i]->attributes()->uri == $playmodeURI{
  705.                         $teamName $teamNameXML->teamName[0]->playMode[$i]->team[$teamID]->name;
  706.                     }
  707.                 }
  708.             }
  709.         }
  710.  
  711.         return $teamName;
  712.     }
  713.  
  714.     /*-- server information --*/
  715.  
  716.     /**
  717.      * returns the server ip as a string
  718.      *
  719.      * @return String 
  720.      */
  721.     function getServerIP({
  722.         return $this->_serverIP;
  723.     }
  724.  
  725.     /**
  726.      * returns the server information as an array
  727.      *
  728.      * @return array 
  729.      */
  730.     function getServerInfo({
  731.         if($this->_serverdata == null || !$this->_globalVars['cachingEnabled']{
  732.             $this->_serverdata $this->_clientRequest("serverInfo");
  733.         }
  734.  
  735.         return $this->_serverdata;
  736.     }
  737.  
  738.     /**
  739.      * returns the server name as a string
  740.      *
  741.      * @return String 
  742.      */
  743.     function getServerName({
  744.         $serverInfo $this->getServerInfo();
  745.  
  746.         return $this->_array2String($serverInfo);
  747.     }
  748.  
  749.     /**
  750.      * returns the current players on server as an integer
  751.      *
  752.      * @return Integer 
  753.      */
  754.     function getCurrentPlayers({
  755.         $serverInfo $this->getServerInfo();
  756.  
  757.         return (int) $this->_array2String($serverInfo2);
  758.     }
  759.  
  760.     /**
  761.      * returns the max amount of players allowed on server as an integer
  762.      *
  763.      * @return Integer 
  764.      */
  765.     function getMaxPlayers({
  766.         $serverInfo $this->getServerInfo();
  767.  
  768.         return (int) $this->_array2String($serverInfo3);
  769.     }
  770.  
  771.     /**
  772.      * returns the current playmode as a string
  773.      *
  774.      * @return String 
  775.      */
  776.     function getCurrentPlaymode({
  777.         $serverInfo $this->getServerInfo();
  778.  
  779.         return $this->_array2String($serverInfo4);
  780.     }
  781.  
  782.     /**
  783.      * returns the current playmode (human readable) as a string
  784.      *
  785.      * @return String 
  786.      */
  787.     function getCurrentPlaymodeName({
  788.         $serverInfo $this->getServerInfo();
  789.  
  790.         return $this->getPlaymodeName($this->getCurrentPlaymode());
  791.     }
  792.  
  793.     /**
  794.      * returns the current map as a string
  795.      *
  796.      * @return String 
  797.      */
  798.     function getCurrentMap({
  799.         $serverInfo $this->getServerInfo();
  800.  
  801.         return $this->_array2String($serverInfo5);
  802.     }
  803.  
  804.     /**
  805.      * returns the current map (human readable) as a string
  806.      *
  807.      * @return String 
  808.      */
  809.     function getCurrentMapName({
  810.         $serverInfo $this->getServerInfo();
  811.  
  812.         return $this->getMapName($this->getCurrentMap());
  813.     }
  814.  
  815.     /**
  816.      * returns the server version as an array
  817.      *
  818.      * @return array 
  819.      */
  820.     function getVersion({
  821.         return $this->_clientRequest("version");
  822.     }
  823.  
  824.     /**
  825.      * returns the build-id of the game
  826.      *
  827.      * @return Integer 
  828.      */
  829.     function getVersionID({
  830.         return (int) $this->_array2String($this->getVersion()2);
  831.     }
  832.  
  833.     /**
  834.      * returns the game type currently running
  835.      *
  836.      * @return String 
  837.      */
  838.     function getGameType({
  839.         return $this->_array2String($this->getVersion());
  840.     }
  841.  
  842.     /**
  843.      * returns the current round of the game
  844.      *
  845.      * @return Integer 
  846.      */
  847.     function getCurrentGameRound({
  848.         return (int) $this->_array2String($this->getServerInfo()6);
  849.     }
  850.  
  851.     /**
  852.      * returns the max amount of rounds of the current game
  853.      *
  854.      * @return Integer 
  855.      */
  856.     function getGameMaxRounds({
  857.         return (int) $this->_array2String($this->getServerInfo()7);
  858.     }
  859.  
  860.     /**
  861.      * returns the current teamscores
  862.      *
  863.      * @return Integer 
  864.      */
  865.     function getTeamScores({
  866.         return (int) $this->_array2String($this->getServerInfo()8);
  867.     }
  868.  
  869.     /**
  870.      * returns the current online state of the gameserver
  871.      *
  872.      * @return String 
  873.      */
  874.     function getOnlineState({
  875.         return $this->_array2String($this->getServerInfo()9);
  876.     }
  877.  
  878.     /**
  879.      * returns list of all players on the server, but with zeroed out GUIDs
  880.      *
  881.      * @return array 
  882.      */
  883.     function getPlayerlist({
  884.         if($this->_playerdata == null || !$this->_globalVars['cachingEnabled']{
  885.             $this->_playerdata $this->_clientRequest("listPlayers all");
  886.         }
  887.  
  888.         return $this->_playerdata;
  889.     }
  890.  
  891.     /**
  892.      * returns list of all playernames on server (useful for other functions)
  893.      *
  894.      * @return array 
  895.      */
  896.     function getPlayerlistNames({
  897.         $players $this->getPlayerlist();
  898.         $playersAmount $this->getCurrentPlayers();
  899.  
  900.         if($playersAmount == 0{
  901.             $playersNames array();
  902.         }
  903.  
  904.         $playersParameters = (int) $players[1];
  905.         for($i 0$i $playersAmount$i++{
  906.             $playersNames[$players[($playersParameters$i $playersParameters +4];
  907.         }
  908.  
  909.         return $playersNames;
  910.     }
  911.  
  912.     /**
  913.      * TODO: check for caching if playername = all
  914.      *
  915.      * returns gamedata of given playername with zeroed out GUID
  916.      *
  917.      * @param String (if not set, all players will be listed)
  918.      *
  919.      * @return array 
  920.      */
  921.     function getPlayerdata($playerName ''{
  922.         if(!isset($playerName|| $playerName == ''{
  923.             $playerName "all";
  924.         else {
  925.             $playerName "player " $playerName;
  926.         }
  927.  
  928.         return $this->_clientRequest("listPlayers " $playerName);
  929.     }
  930.  
  931.     /**
  932.      * returns true if server is available, otherwise false
  933.      *
  934.      * @see isConnected()
  935.      *
  936.      * @return boolean 
  937.      */
  938.     function isServerOnline({
  939.         return $this->isConnected();
  940.     }
  941.  
  942.     /*-- admin server information --*/
  943.  
  944.     /**
  945.      * returns the gamepassword as a string
  946.      *
  947.      * @return String 
  948.      */
  949.     function adminGamePasswordGet({
  950.         return $this->_array2String($this->_clientRequest("vars.gamePassword"));
  951.     }
  952.  
  953.     /**
  954.      * gets the full gamedata of all players on the gameserver
  955.      *
  956.      * @return array 
  957.      */
  958.     function adminGetPlayerlist({
  959.         if($this->_playerdata_admin == null || !$this->_globalVars['cachingEnabled']{
  960.             $this->_playerdata_admin $this->_clientRequest("admin.listPlayers all");
  961.         }
  962.  
  963.         return $this->_playerdata_admin;
  964.     }
  965.  
  966.     /**
  967.      * gets the gamedata of a given playername on the gameserver
  968.      *
  969.      * TODO: check for playerNotFound
  970.      *
  971.      * @param String (optional) - if not set, all players will be listed
  972.      *
  973.      * @return array 
  974.      */
  975.     function adminGetPlayerdata($playerName ''{
  976.         if(!isset($playerName|| $playerName == ''{
  977.             $playerName "all";
  978.         else {
  979.             $playerName "player " $playerName;
  980.         }
  981.  
  982.         return $this->_clientRequest("admin.listPlayers " $playerName);
  983.     }
  984.  
  985.     /**
  986.      * returns all commands available on the server - requires login
  987.      *
  988.      * @return array 
  989.      */
  990.     function adminGetAllCommands({
  991.         return $this->_clientRequest("help");
  992.     }
  993.  
  994.     /**
  995.      * returns true/false, if server events are enabled in this connection or
  996.      * not
  997.      *
  998.      * @return array 
  999.      */
  1000.     function adminEventsEnabledStatusGet({
  1001.         return $this->_clientRequest("eventsEnabled");
  1002.     }
  1003.  
  1004.     /**
  1005.      * sets the server events on/off in this connection<br />
  1006.      * [ Useless, if you set them on and use this class only ;) ]
  1007.      *
  1008.      * @param boolean 
  1009.      *
  1010.      * @return array 
  1011.      */
  1012.     //    function adminEventsEnabledStatusSet($boolean) {
  1013.     //        return $this->_clientRequest("eventsEnabled " .
  1014.     //        $this->_bool2String($boolean));
  1015.     //    }
  1016.  
  1017.     /**
  1018.      * returns the clantag of a given playername
  1019.      *
  1020.      * @param String 
  1021.      *
  1022.      * @return String 
  1023.      */
  1024.     function getPlayerClantag($playerName{
  1025.         $playerInfo $this->getPlayerdata($playerName);
  1026.         if(!isset($playerInfo[12])) {
  1027.             return $this->_globalMsg['PLAYER_NOT_FOUND'];
  1028.         }
  1029.  
  1030.         return $this->_array2String($playerInfo12);
  1031.     }
  1032.  
  1033.     /**
  1034.      * returns the playername of a given playername
  1035.      *
  1036.      * @param String 
  1037.      *
  1038.      * @return String 
  1039.      */
  1040.     function getPlayername($playerName{
  1041.         $playerInfo $this->getPlayerdata($playerName);
  1042.         if(!isset($playerInfo[12])) {
  1043.             return $this->_globalMsg['PLAYER_NOT_FOUND'];
  1044.         }
  1045.  
  1046.         return $this->_array2String($playerInfo13);
  1047.     }
  1048.  
  1049.     /**
  1050.      * returns the teamid of a given playername
  1051.      *
  1052.      * @param String 
  1053.      *
  1054.      * @return Integer 
  1055.      */
  1056.     function getPlayerTeamID($playerName{
  1057.         $playerInfo $this->getPlayerdata($playerName);
  1058.         if(!isset($playerInfo[12])) {
  1059.             return $this->_globalMsg['PLAYER_NOT_FOUND'];
  1060.         }
  1061.  
  1062.         return (int) $this->_array2String($playerInfo15);
  1063.     }
  1064.  
  1065.     /**
  1066.      * returns the squadid of a given playername
  1067.      *
  1068.      * @param String 
  1069.      *
  1070.      * @return Integer 
  1071.      */
  1072.     function getPlayerSquadID($playerName{
  1073.         $playerInfo $this->getPlayerdata($playerName);
  1074.         if(!isset($playerInfo[12])) {
  1075.             return $this->_globalMsg['PLAYER_NOT_FOUND'];
  1076.         }
  1077.  
  1078.         return (int) $this->_array2String($playerInfo16);
  1079.     }
  1080.  
  1081.     /**
  1082.      * returns the current kills of a given playername
  1083.      *
  1084.      * @param String 
  1085.      *
  1086.      * @return Integer 
  1087.      */
  1088.     function getPlayerKills($playerName{
  1089.         $playerInfo $this->getPlayerdata($playerName);
  1090.         if(!isset($playerInfo[12])) {
  1091.             return $this->_globalMsg['PLAYER_NOT_FOUND'];
  1092.         }
  1093.  
  1094.         return (int) $this->_array2String($playerInfo17);
  1095.     }
  1096.  
  1097.     /**
  1098.      * returns the current deaths of a given playername
  1099.      *
  1100.      * @param String 
  1101.      *
  1102.      * @return Integer 
  1103.      */
  1104.     function getPlayerDeaths($playerName{
  1105.         $playerInfo $this->getPlayerdata($playerName);
  1106.         if(!isset($playerInfo[12])) {
  1107.             return $this->_globalMsg['PLAYER_NOT_FOUND'];
  1108.         }
  1109.  
  1110.         return (int) $this->_array2String($playerInfo18);
  1111.     }
  1112.  
  1113.     /**
  1114.      * returns the score of a given playername
  1115.      *
  1116.      * @param String 
  1117.      *
  1118.      * @return Integer 
  1119.      */
  1120.     function getPlayerScore($playerName{
  1121.         $playerInfo $this->getPlayerdata($playerName);
  1122.         if(!isset($playerInfo[12])) {
  1123.             return $this->_globalMsg['PLAYER_NOT_FOUND'];
  1124.         }
  1125.  
  1126.         return (int) $this->_array2String($playerInfo19);
  1127.     }
  1128.  
  1129.     /**
  1130.      * returns the ping of a given playername
  1131.      *
  1132.      * @param String 
  1133.      *
  1134.      * @return Integer 
  1135.      */
  1136.     function getPlayerPing($playerName{
  1137.         $playerInfo $this->getPlayerdata($playerName);
  1138.         if(!isset($playerInfo[12])) {
  1139.             return $this->_globalMsg['PLAYER_NOT_FOUND'];
  1140.         }
  1141.  
  1142.         return (int) $this->_array2String($playerInfo20);
  1143.     }
  1144.  
  1145.     /*-- admin commands --*/
  1146.  
  1147.     /**
  1148.      * sends an admin-yell message to a specified player (or all)<br />
  1149.      * example: adminYellMessage("Storm the front!", "JLNNN") - send the message to player "JLNNN"
  1150.      *
  1151.      * TODO: Need fix for sending messages to squads
  1152.      * TODO: Cut strings with length more than 100 chars
  1153.      *
  1154.      * @param String 
  1155.      * @param String (optional) - if not set, message will be sent to all
  1156.      *  players
  1157.      * @param Integer (optional) - amount of time the message will be displayed,
  1158.      *  must be 1-59999
  1159.      *
  1160.      * @return String 
  1161.      */
  1162.     function adminYellMessage($text$playerName "{%all%}"$durationInMS 15000{
  1163.         if($durationInMS $this->_globalMsg['ADMIN_YELL_DURATION_MAX']{
  1164.             $durationInMS == $this->_globalMsg['ADMIN_YELL_DURATION_MAX'];
  1165.         }
  1166.  
  1167.         if($playerName != "{%all%}"{
  1168.             $playerName "{%player%}" " " $playerName;
  1169.         }
  1170.  
  1171.         return $this->_array2String($this->_clientRequest("admin.yell " $text " " .
  1172.         $durationInMS " " $playerName)0);
  1173.     }
  1174.  
  1175.     /**
  1176.      * sends an admin-yell message to a specified team<br />
  1177.      * example: adminYellMessageToTeam("Storm the front!", 1) - send the message to teamID 1
  1178.      *
  1179.      * TODO: Cut strings with length more than 100 chars
  1180.      *
  1181.      * @param String 
  1182.      * @param Integer 
  1183.      * @param Integer (optional) - amount of time the message will be displayed,
  1184.      *  must be 1-59999
  1185.      *
  1186.      * @return String 
  1187.      */
  1188.     function adminYellMessageToTeam($text$teamID$durationInMS 15000{
  1189.         if($durationInMS $this->_globalMsg['ADMIN_YELL_DURATION_MAX']{
  1190.             $durationInMS == $this->_globalMsg['ADMIN_YELL_DURATION_MAX'];
  1191.         }
  1192.  
  1193.         return $this->_array2String($this->_clientRequest("admin.yell " $text " " .
  1194.         $durationInMS " {%team%} " $teamID)0);
  1195.     }
  1196.  
  1197.     /**
  1198.      * sends a chat message to a player. the message must be less than 100 characters long.
  1199.      *
  1200.      * @param String 
  1201.      * @param String 
  1202.      *
  1203.      * @return String 
  1204.      */
  1205.     function adminSayMessageToPlayer($playerName$text{
  1206.         return $this->_array2String($this->_clientRequest("admin.say " $text " {%player%} " $playerName)0);
  1207.     }
  1208.  
  1209.     /**
  1210.      * sends a chat mesage to a team. the message must be less than 100 characters long.
  1211.      *
  1212.      * @param String 
  1213.      * @param Integer 
  1214.      *
  1215.      * @return String 
  1216.      */
  1217.     function adminSayMessageToTeam($teamID$text{
  1218.         return $this->_array2String($this->_clientRequest("admin.say " $text " {%team%} " $teamID)0);
  1219.     }
  1220.  
  1221.     /**
  1222.      * sends a chat mesage to all. the message must be less than 100 characters long.
  1223.      *
  1224.      * @param String 
  1225.      *
  1226.      * @return String 
  1227.      */
  1228.     function adminSayMessageToAll($text{
  1229.         return $this->_array2String($this->_clientRequest("admin.say " $text " {%all%}")0);
  1230.     }
  1231.  
  1232.     /**
  1233.      * runs the next level on maplist
  1234.      *
  1235.      * @return String 
  1236.      */
  1237.     function adminRunNextLevel({
  1238.         return $this->_array2String($this->_clientRequest("admin.runNextLevel")0);
  1239.     }
  1240.  
  1241.     /**
  1242.      * TODO: planned feature adminSetNextLevel() ?
  1243.      *
  1244.      * sets the next level to play
  1245.      *
  1246.      * @param String 
  1247.      *
  1248.      * @return String 
  1249.      */
  1250.     //function adminSetNextLevel($mapURI) {
  1251.     //
  1252.     //}
  1253.  
  1254.     /**
  1255.      * restarts the current level
  1256.      *
  1257.      * @return String 
  1258.      */
  1259.     function adminRestartMap({
  1260.         return $this->_array2String($this->_clientRequest("admin.restartMap")0);
  1261.     }
  1262.  
  1263.     /**
  1264.      * sets a new playlist<br /><br />
  1265.      * example: adminSetPlaylist("SQDM") - for setting playmode to 'Squad Deathmatch'
  1266.      *
  1267.      * @param String 
  1268.      *
  1269.      * @return String 
  1270.      */
  1271.     function adminSetPlaylist($playmodeURI{
  1272.         return $this->_array2String($this->_clientRequest("admin.setPlaylist " $playmodeURI)0);
  1273.     }
  1274.  
  1275.     /**
  1276.      * returns all available playmodes on server
  1277.      *
  1278.      * @return array 
  1279.      */
  1280.     function adminGetPlaylists({
  1281.         return $this->_clientRequest("admin.getPlaylists");
  1282.     }
  1283.  
  1284.     /**
  1285.      * returns current playmode on server
  1286.      *
  1287.      * @see getCurrentPlaymode()
  1288.      *
  1289.      * @return String 
  1290.      */
  1291.     function adminGetPlaylist({
  1292.         return $this->_array2String($this->_clientRequest("admin.getPlaylist"));
  1293.     }
  1294.  
  1295.     /**
  1296.      * loads the maplist
  1297.      *
  1298.      * @see adminMaplistList()
  1299.      *
  1300.      * @return array 
  1301.      */
  1302.     function adminMaplistLoad({
  1303.         return $this->_clientRequest("mapList.load");
  1304.     }
  1305.  
  1306.     /**
  1307.      * saves the current maplist to file
  1308.      *
  1309.      * @return String 
  1310.      */
  1311.     function adminMaplistSave({
  1312.         return $this->_array2String($this->_clientRequest("mapList.save")0);
  1313.     }
  1314.  
  1315.     /**
  1316.      * returns the maplist from map file
  1317.      *
  1318.      * @return array 
  1319.      */
  1320.     function adminMaplistList({
  1321.         $this->adminMaplistLoad();
  1322.  
  1323.         return $this->_clientRequest("mapList.list");
  1324.     }
  1325.  
  1326.     /**
  1327.      * clears the maplist file
  1328.      *
  1329.      * @return String 
  1330.      */
  1331.     function adminMaplistClear({
  1332.         return $this->_array2String($this->_clientRequest("mapList.clear")0);
  1333.     }
  1334.  
  1335.     /**
  1336.      * removes a given map from maplist<br />
  1337.      * [ index = Integer! ]
  1338.      *
  1339.      * @param Integer 
  1340.      *
  1341.      * @return String 
  1342.      */
  1343.     function adminMaplistRemove($rowID{
  1344.         return $this->_array2String($this->_clientRequest("mapList.remove " $rowID)0);
  1345.     }
  1346.  
  1347.     /**
  1348.      * appends a given map to the end of the maplist file
  1349.      *
  1350.      * @param String 
  1351.      *
  1352.      * @return String 
  1353.      */
  1354.     function adminMaplistAppend($mapURI{
  1355.         return $this->_array2String($this->_clientRequest("mapList.append " $mapURI)0);
  1356.     }
  1357.  
  1358.     /**
  1359.      * gets index of next map to be run
  1360.      *
  1361.      * @return Integer 
  1362.      */
  1363.     function adminMaplistGetNextMapIndex({
  1364.         return (int) $this->_array2String($this->_clientRequest("mapList.nextLevelIndex"));
  1365.     }
  1366.  
  1367.     /**
  1368.      * sets index of next map to be run<br />
  1369.      * [ index = Integer! ]
  1370.      *
  1371.      * @param Integer 
  1372.      *
  1373.      * @return String 
  1374.      */
  1375.     function adminMaplistSetNextMapIndex($index{
  1376.         return $this->_array2String($this->_clientRequest("mapList.nextLevelIndex " $index)0);
  1377.     }
  1378.  
  1379.     /**
  1380.      * adds map with name at the specified index to the maplist
  1381.      *
  1382.      * @param Integer 
  1383.      * @param String 
  1384.      *
  1385.      * @return String 
  1386.      */
  1387.     function adminMaplistInsertMapInIndex($index$mapURI{
  1388.         return $this->_array2String($this->_clientRequest("mapList.insert " $index " " $mapURI)0);
  1389.     }
  1390.  
  1391.     /**
  1392.      * gets list of maps supported by given playmode
  1393.      *
  1394.      * @param String 
  1395.      *
  1396.      * @return array 
  1397.      */
  1398.     function adminGetSupportedMaps($playmode{
  1399.         return $this->_clientRequest("admin.supportedMaps " $playmode);
  1400.     }
  1401.  
  1402.     /**
  1403.      * kicks a specified player by playername
  1404.      *
  1405.      * @param String 
  1406.      *
  1407.      * @return String 
  1408.      */
  1409.     function adminKickPlayer($playerName{
  1410.         return $this->_array2String($this->_clientRequest("admin.kickPlayer " $playerName)0);
  1411.     }
  1412.  
  1413.     /**
  1414.      * kicks a specified player by playername with a given kickreason
  1415.      *
  1416.      * @param String 
  1417.      * @param String (optional) - if not set, default kickreason is given
  1418.      *
  1419.      * @return String 
  1420.      */
  1421.     function adminKickPlayerWithReason($playerName$reason "Kicked by administrator"{
  1422.         return $this->_array2String($this->_clientRequest("admin.kickPlayer " $playerName " {%reason%} " $reason)0);
  1423.     }
  1424.  
  1425.     /**
  1426.      * bans a specified player by playername for a given range of time.<br />
  1427.      * range of time can be: perm = permanent, round = current round<br />
  1428.      * if no range is given, the player will be banned permanently
  1429.      *
  1430.      * TODO: ban for xx seconds
  1431.      * TODO: banreason
  1432.      *
  1433.      * @param String 
  1434.      * @param String (optional) - if not set, given player will be banned permanently
  1435.      *
  1436.      * @return String 
  1437.      */
  1438.     function adminBanAddPlayername($playerName$timerange "perm"{
  1439.         return $this->_array2String($this->_clientRequest("banList.add name " $playerName " " $timerange));
  1440.     }
  1441.  
  1442.     /**
  1443.      * bans a specified player by given playerip<br />
  1444.      * range of time can be: perm = permanent, round = current round<br />
  1445.      * if no range is given, the ip will be banned permanently
  1446.      *
  1447.      * TODO: ban for xx seconds
  1448.      * TODO: banreason
  1449.      *
  1450.      * @param String 
  1451.      * @param String (optional) - if not set, ip will be banned permanently
  1452.      *
  1453.      * @return String 
  1454.      */
  1455.     function adminBanAddPlayerIP($playerIP$timerange "perm"{
  1456.         return $this->_array2String($this->_clientRequest("banList.add ip " $playerIP " " $timerange)0);
  1457.     }
  1458.  
  1459.     /**
  1460.      * bans a specified player by given playerguid<br />
  1461.      * range of time can be: perm = permanent, round = current round<br />
  1462.      * if no range is given, the ip will be banned permanently
  1463.      *
  1464.      * TODO: ban for xx seconds
  1465.      * TODO: banreason
  1466.      *
  1467.      * @param String 
  1468.      * @param String (optional) - if not set, guid will be banned permanently
  1469.      *
  1470.      * @return String 
  1471.      */
  1472.     function adminBanAddPlayerGUID($playerName$timerange "perm"{
  1473.         $playerGUID $this->adminGetPlayerGUID($playerName);
  1474.         if($playerGUID != $this->_globalMsg['PLAYER_NOT_FOUND']{
  1475.             return $this->_array2String($this->_clientRequest("banList.add guid " $playerGUID " " $timerange)0);
  1476.         else {
  1477.             return $this->_globalMsg['PLAYER_NOT_FOUND'];
  1478.         }
  1479.     }
  1480.  
  1481.     /**
  1482.      * saves the current banlist to banlist file
  1483.      *
  1484.      * @return String 
  1485.      */
  1486.     function adminBanlistSave({
  1487.         return $this->_array2String($this->_clientRequest("banList.save")0);
  1488.     }
  1489.  
  1490.     /**
  1491.      * loads the banlist from banlist file
  1492.      *
  1493.      * @return String 
  1494.      */
  1495.     function adminBanlistLoad({
  1496.         return $this->_array2String($this->_clientRequest("banList.load")0);
  1497.     }
  1498.  
  1499.     /**
  1500.      * unbans a player by playername
  1501.      *
  1502.      * @param String 
  1503.      *
  1504.      * @return String 
  1505.      */
  1506.     function adminBanRemovePlayername($playerName{
  1507.         return $this->_array2String($this->_clientRequest("banList.remove name " $playerName)0);
  1508.     }
  1509.  
  1510.     /**
  1511.      * unbans a player by playerip
  1512.      *
  1513.      * @param String 
  1514.      *
  1515.      * @return String 
  1516.      */
  1517.     function adminBanRemovePlayerIP($playerIP{
  1518.         return $this->_array2String($this->_clientRequest("banList.remove ip " $playerIP)0);
  1519.     }
  1520.  
  1521.     /**
  1522.      * clears all bans from playername banlist
  1523.      *
  1524.      * @return String 
  1525.      */
  1526.     function adminBanlistClear({
  1527.         return $this->_array2String($this->_clientRequest("banList.clear")0);
  1528.     }
  1529.  
  1530.     /**
  1531.      * lists all bans from banlist
  1532.      *
  1533.      * @return array 
  1534.      */
  1535.     function adminBanlistList({
  1536.         return $this->_clientRequest("banList.list");
  1537.     }
  1538.  
  1539.     /**
  1540.      * loads the file containing all reserved slots<br />
  1541.      * [ I don't know if this function is useful.. ]
  1542.      *
  1543.      * @return String 
  1544.      */
  1545.     function adminReservedSlotsLoad({
  1546.         return $this->_array2String($this->_clientRequest("reservedSlots.load")0);
  1547.     }
  1548.  
  1549.     /**
  1550.      * saves made changes to reserved slots file
  1551.      *
  1552.      * @return String 
  1553.      */
  1554.     function adminReservedSlotsSave({
  1555.         return $this->_array2String($this->_clientRequest("reservedSlots.save")0);
  1556.     }
  1557.  
  1558.     /**
  1559.      * adds a player by given playername to reserved slots file
  1560.      *
  1561.      * @param String 
  1562.      *
  1563.      * @return String 
  1564.      */
  1565.     function adminReservedSlotsAddPlayer($playerName{
  1566.         return $this->_array2String($this->_clientRequest("reservedSlots.addPlayer " $playerName)0);
  1567.     }
  1568.  
  1569.     /**
  1570.      * removes a player by given playername from reserved slots file
  1571.      *
  1572.      * @param String 
  1573.      *
  1574.      * @return String 
  1575.      */
  1576.     function adminReservedSlotsRemovePlayer($playerName{
  1577.         return $this->_array2String($this->_clientRequest("reservedSlots.removePlayer " $playerName)0);
  1578.     }
  1579.  
  1580.     /**
  1581.      * clears the file containing all reserved slots
  1582.      *
  1583.      * @return String 
  1584.      */
  1585.     function adminReservedSlotsClear({
  1586.         return $this->_array2String($this->_clientRequest("reservedSlots.clear")0);
  1587.     }
  1588.  
  1589.     /**
  1590.      * lists all playernames in reserved slots file
  1591.      *
  1592.      * @return array 
  1593.      */
  1594.     function adminReservedSlotsList({
  1595.         return $this->_clientRequest("reservedSlots.list");
  1596.     }
  1597.  
  1598.     /**
  1599.      * returns the GUID of a given playername
  1600.      *
  1601.      * @param String 
  1602.      *
  1603.      * @return String 
  1604.      */
  1605.     function adminGetPlayerGUID($playerName{
  1606.         $playerInfo $this->adminGetPlayerdata($playerName);
  1607.         if(!isset($playerInfo[12])) {
  1608.             return $this->_globalMsg['PLAYER_NOT_FOUND'];
  1609.         }
  1610.  
  1611.         return $this->_array2String($playerInfo14);
  1612.     }
  1613.  
  1614.     /**
  1615.      * kills the given player without counting this death on the playerstats
  1616.      *
  1617.      * @param $playerName 
  1618.      *
  1619.      * @return String 
  1620.      */
  1621.     function adminKillPlayer($playerName{
  1622.         return $this->_array2String($this->_clientRequest("admin.killPlayer " .
  1623.         $playerName)0);
  1624.     }
  1625.  
  1626.     /**
  1627.      * moves the given player to the opponent team<br />
  1628.      * if $forceKill is true, the player will be killed<br />
  1629.      * [ Works only if the player is dead! Otherwise $forceKill has to be true! ]
  1630.      *
  1631.      * @param $playerName 
  1632.      * @param $forceKill (optional) - if not set, player will not be killed
  1633.      *
  1634.      * @return String 
  1635.      */
  1636.     function adminMovePlayerSwitchTeam($playerName$forceKill false{
  1637.         $playerTeam $this->getPlayerTeamID($playerName);
  1638.  
  1639.         $forceKill $this->_bool2String($forceKill);
  1640.  
  1641.         if($playerTeam == 1{
  1642.             $newPlayerTeam 2;
  1643.         else {
  1644.             $newPlayerTeam 1;
  1645.         }
  1646.  
  1647.         return $this->_array2String($this->_clientRequest("admin.movePlayer " .
  1648.         $playerName " " .    $newPlayerTeam " 0 " $forceKill)0);
  1649.     }
  1650.  
  1651.     /**
  1652.      * moves the given player to another specific squad<br />
  1653.      * if $forceKill is true, the player will be killed<br />
  1654.      * [ Works only if the player is dead! Otherwise $forceKill has to be true! ]
  1655.      *
  1656.      * @param $playerName 
  1657.      * @param $newSquadID 
  1658.      * @param $forceKill (optional) - if not set, player will not be killed
  1659.      * @param $newTeamID (optional) - if not set, player will stay in his team
  1660.      *
  1661.      * @return String 
  1662.      */
  1663.     function adminMovePlayerSwitchSquad($playerName$newSquadID$forceKill false$newTeamID null{
  1664.         if ($newTeamID == null || !is_int($newTeamID)) {
  1665.             $newTeamID $this->getPlayerTeamID($playerName);
  1666.         }
  1667.  
  1668.         $forceKill $this->_bool2String($forceKill);
  1669.  
  1670.         return $this->_array2String($this->_clientRequest("admin.movePlayer " .
  1671.         $playerName " " $newTeamID " " $newSquadID " " $forceKill)0);
  1672.     }
  1673.  
  1674.     /**
  1675.      * ends the current round, declaring the given teamId as winner
  1676.      *
  1677.      * @param $teamId 
  1678.      *
  1679.      * @return String 
  1680.      */
  1681.     function adminEndRound($teamId{
  1682.         return $this->_array2String($this->_clientRequest("admin.endRound " $teamId)0);
  1683.     }
  1684.  
  1685.     /*-- admin server settings --*/
  1686.  
  1687.     /**
  1688.      * sets a new password on the gameserver.<br />
  1689.      * password MUST NOT contain whitespaces!!<br /><br />
  1690.      * to clear the password, use adminGamePasswordSet("")
  1691.      *
  1692.      * @param String 
  1693.      *
  1694.      * @return String 
  1695.      */
  1696.     function adminGamePasswordSet($serverPassword{
  1697.         return $this->_array2String($this->_clientRequest("vars.gamePassword " $serverPassword)0);
  1698.     }
  1699.  
  1700.     /**
  1701.      * sets punkbuster on/off
  1702.      *
  1703.      * @param boolean 
  1704.      *
  1705.      * @return String 
  1706.      */
  1707.     function adminVarSetPunkbuster($boolean{
  1708.         return $this->_array2String($this->_clientRequest("vars.punkBuster " .
  1709.         $this->_bool2String($boolean))0);
  1710.     }
  1711.  
  1712.     /**
  1713.      * gets true/false, if punkbuster is enabled or not
  1714.      *
  1715.      * @return boolean 
  1716.      */
  1717.     function adminVarGetPunkbuster({
  1718.         return $this->_array2boolean($this->_clientRequest("vars.punkBuster"));
  1719.     }
  1720.  
  1721.     /**
  1722.      * sets the admin (rcon) password<br />
  1723.      * [ I haven't tested this ]
  1724.      *
  1725.      * @param String 
  1726.      *
  1727.      * @return String 
  1728.      */
  1729.     function adminVarSetAdminPassword($string{
  1730.         return $this->_array2String($this->_clientRequest("vars.adminPassword " $string)0);
  1731.     }
  1732.  
  1733.     /**
  1734.      * gets the admin (rcon) password<br />
  1735.      * [ I only get the result: PasswordRetrievalNotAllowed ]
  1736.      *
  1737.      * @return String 
  1738.      */
  1739.     function adminVarGetAdminPassword({
  1740.         return $this->_array2String($this->_clientRequest("vars.adminPassword")0);
  1741.     }
  1742.  
  1743.     /**
  1744.      * sets hardcore mode on/off
  1745.      *
  1746.      * @param boolean 
  1747.      *
  1748.      * @return String 
  1749.      */
  1750.     function adminVarSetHardcore($boolean{
  1751.         return $this->_array2String($this->_clientRequest("vars.hardCore " .
  1752.         $this->_bool2String($boolean))0);
  1753.     }
  1754.  
  1755.     /**
  1756.      * gets true/false, if hardcore mode is enabled or not
  1757.      *
  1758.      * @return boolean 
  1759.      */
  1760.     function adminVarGetHardcore({
  1761.         return $this->_array2boolean($this->_clientRequest("vars.hardCore"));
  1762.     }
  1763.  
  1764.     /**
  1765.      * sets ranked server on/off
  1766.      *
  1767.      * @param boolean 
  1768.      *
  1769.      * @return String 
  1770.      */
  1771.     function adminVarSetRanked($boolean{
  1772.         return $this->_array2String($this->_clientRequest("vars.ranked " .
  1773.         $this->_bool2String($boolean))0);
  1774.     }
  1775.  
  1776.     /**
  1777.      * gets true/false if ranked server settings are enabled or not
  1778.      *
  1779.      * @return boolean 
  1780.      */
  1781.     function adminVarGetRanked({
  1782.         return $this->_array2boolean($this->_clientRequest("vars.ranked"));
  1783.     }
  1784.  
  1785.     /**
  1786.      * sets the max rank limit players are allowed to join<br /><br />
  1787.      * ##QA: Says 'OK' but still allow higher ranked players to join.
  1788.      *
  1789.      * @param Integer 
  1790.      *
  1791.      * @return String 
  1792.      */
  1793.     function adminVarSetRankLimit($integer{
  1794.         return $this->_array2String($this->_clientRequest("vars.rankLimit " $integer)0);
  1795.     }
  1796.  
  1797.     /**
  1798.      * gets rank limit set on server
  1799.      *
  1800.      * @return String 
  1801.      */
  1802.     function adminVarGetRankLimit({
  1803.         return $this->_array2String($this->_clientRequest("vars.rankLimit"));
  1804.     }
  1805.  
  1806.     /**
  1807.      * sets teambalance on/off
  1808.      *
  1809.      * @param boolean 
  1810.      *
  1811.      * @return String 
  1812.      */
  1813.     function adminVarSetTeambalance($boolean{
  1814.         return $this->_array2String($this->_clientRequest("vars.teamBalance " .
  1815.         $this->_bool2String($boolean))0);
  1816.     }
  1817.  
  1818.     /**
  1819.      * gets true/false, if teambalance is enabled or not
  1820.      *
  1821.      * @return boolean 
  1822.      */
  1823.     function adminVarGetTeambalance({
  1824.         return $this->_array2boolean($this->_clientRequest("vars.teamBalance"));
  1825.     }
  1826.  
  1827.     /**
  1828.      * sets friendly fire on/off
  1829.      *
  1830.      * @param boolean 
  1831.      *
  1832.      * @return String 
  1833.      */
  1834.     function adminVarSetFriendlyFire($boolean{
  1835.         return $this->_array2String($this->_clientRequest("vars.friendlyFire " .
  1836.         $this->_bool2String($boolean))0);
  1837.     }
  1838.  
  1839.     /**
  1840.      * gets true/false, if friendly fire is enabled or not
  1841.      *
  1842.      * @return boolean 
  1843.      */
  1844.     function adminVarGetFriendlyFire({
  1845.         return $this->_array2boolean($this->_clientRequest("vars.friendlyFire"));
  1846.     }
  1847.  
  1848.     /**
  1849.      * sets the banner url to given address
  1850.      * [ The banner url needs to be less than 64 characters long.<br />
  1851.      * The banner needs to be a 512x64 picture and smaller than 127kbytes. ]
  1852.      *
  1853.      * @param String 
  1854.      *
  1855.      * @return String 
  1856.      */
  1857.     function adminVarSetBannerURL($string{
  1858.         return $this->_array2String($this->_clientRequest("vars.bannerUrl " $string)0);
  1859.     }
  1860.  
  1861.     /**
  1862.      * gets the banner url
  1863.      *
  1864.      * @return String 
  1865.      */
  1866.     function adminVarGetBannerURL({
  1867.         return $this->_array2String($this->_clientRequest("vars.bannerUrl"));
  1868.     }
  1869.  
  1870.     /**
  1871.      * sets the server description to given text<br />
  1872.      * [ Character '|' doesn't work for now as a 'newline'. ]<br /><br />
  1873.      * ##Request from RSPs: In addition being able to enter a new line would be<br />
  1874.      * great, BF2142 used the "|" character as newline.
  1875.      *
  1876.      * @param String 
  1877.      *
  1878.      * @return String 
  1879.      */
  1880.     function adminVarSetServerDescription($string{
  1881.         return $this->_array2String($this->_clientRequest("vars.serverDescription " $string)0);
  1882.     }
  1883.  
  1884.     /**
  1885.      * gets the server description
  1886.      *
  1887.      * @return String 
  1888.      */
  1889.     function adminVarGetServerDescription({
  1890.         return $this->_array2String($this->_clientRequest("vars.serverDescription"));
  1891.     }
  1892.  
  1893.     /**
  1894.      * sets killcam on/off
  1895.      *
  1896.      * @param boolean 
  1897.      *
  1898.      * @return String 
  1899.      */
  1900.     function adminVarSetKillCam($boolean{
  1901.         return $this->_array2String($this->_clientRequest("vars.killCam " .
  1902.         $this->_bool2String($boolean))0);
  1903.     }
  1904.  
  1905.     /**
  1906.      * gets true/false, if killcam is enabled or not
  1907.      *
  1908.      * @return boolean 
  1909.      */
  1910.     function adminVarGetKillCam({
  1911.         return $this->_array2boolean($this->_clientRequest("vars.killCam"));
  1912.     }
  1913.  
  1914.     /**
  1915.      * sets minimap on/off
  1916.      *
  1917.      * @param boolean 
  1918.      *
  1919.      * @return String 
  1920.      */
  1921.     function adminVarSetMiniMap($boolean{
  1922.         return $this->_array2String($this->_clientRequest("vars.miniMap " .
  1923.         $this->_bool2String($boolean))0);
  1924.     }
  1925.  
  1926.     /**
  1927.      * gets true/false, if minimap is enabled or not
  1928.      *
  1929.      * @return boolean 
  1930.      */
  1931.     function adminVarGetMiniMap({
  1932.         return $this->_array2boolean($this->_clientRequest("vars.miniMap"));
  1933.     }
  1934.  
  1935.     /**
  1936.      * sets crosshair on/off
  1937.      *
  1938.      * @param boolean 
  1939.      *
  1940.      * @return String 
  1941.      */
  1942.     function adminVarSetCrosshair($boolean{
  1943.         return $this->_array2String($this->_clientRequest("vars.crossHair " .
  1944.         $this->_bool2String($boolean))0);
  1945.     }
  1946.  
  1947.     /**
  1948.      * gets true/false, if crosshair is enabled or not
  1949.      *
  1950.      * @return boolean 
  1951.      */
  1952.     function adminVarGetCrosshair({
  1953.         return $this->_array2boolean($this->_clientRequest("vars.crossHair"));
  1954.     }
  1955.  
  1956.     /**
  1957.      * sets 3d spotting on maps on/off
  1958.      *
  1959.      * @param boolean 
  1960.      *
  1961.      * @return String 
  1962.      */
  1963.     function adminVarSet3dSpotting($boolean{
  1964.         return $this->_array2String($this->_clientRequest("vars.3dSpotting " .
  1965.         $this->_bool2String($boolean))0);
  1966.     }
  1967.  
  1968.     /**
  1969.      * gets true/false, if 3d spotting is enabled or not
  1970.      *
  1971.      * @return boolean 
  1972.      */
  1973.     function adminVarGet3dSpotting({
  1974.         return $this->_array2boolean($this->_clientRequest("vars.3dSpotting"));
  1975.     }
  1976.  
  1977.     /**
  1978.      * sets minimap spotting on/off
  1979.      *
  1980.      * @param boolean 
  1981.      *
  1982.      * @return String 
  1983.      */
  1984.     function adminVarSetMiniMapSpotting($boolean{
  1985.         return $this->_array2String($this->_clientRequest("vars.miniMapSpotting " .
  1986.         $this->_bool2String($boolean))0);
  1987.     }
  1988.  
  1989.     /**
  1990.      * gets true/false, if minimap spotting is enabled or not
  1991.      *
  1992.      * @return boolean 
  1993.      */
  1994.     function adminVarGetMiniMapSpotting({
  1995.         return $this->_array2boolean($this->_clientRequest("vars.miniMapSpotting"));
  1996.     }
  1997.  
  1998.     /**
  1999.      * sets the 3rd person vehicle cam on/off<br /><br />
  2000.      * ##QA: Works but is bugged. If you change the setting and someone is in
  2001.      * a vehicle in 3rd person view when at end of round, that player will be
  2002.      * stuck in 3rd person view even though the setting should only allow 1st
  2003.      * person view.
  2004.      *
  2005.      * @param boolean 
  2006.      *
  2007.      * @return String 
  2008.      */
  2009.     function adminVarSet3rdPersonVehiCam($boolean{
  2010.         return $this->_array2String($this->_clientRequest("vars.thirdPersonVehicleCameras " .
  2011.         $this->_bool2String($boolean))0);
  2012.     }
  2013.  
  2014.     /**
  2015.      * gets true/false, if 3rd person vehicle cam is enabled or not
  2016.      *
  2017.      * @return boolean 
  2018.      */
  2019.     function adminVarGet3rdPersonVehiCam({
  2020.         return $this->_array2boolean($this->_clientRequest("vars.thirdPersonVehicleCameras"));
  2021.     }
  2022.  
  2023.     /**
  2024.      * sets a new servername
  2025.      *
  2026.      * @param $serverName 
  2027.      *
  2028.      * @return String 
  2029.      */
  2030.     function adminVarSetServername($serverName{
  2031.         return $this->_array2String($this->_clientRequest("vars.serverName " $serverName)0);
  2032.     }
  2033.  
  2034.     /**
  2035.      * sets the number of teamkills allowed during one round, before the game kicks
  2036.      * the player in question
  2037.      *
  2038.      * @param $integer 
  2039.      *
  2040.      * @return String 
  2041.      */
  2042.     function adminVarSetTeamKillCountForKick($integer{
  2043.         return $this->_array2String($this->_clientRequest("vars.teamKillCountForKick " $integer)0);
  2044.     }
  2045.  
  2046.     /**
  2047.      * gets the number of teamkills allowed during one round
  2048.      *
  2049.      * @return Integer 
  2050.      */
  2051.     function adminVarGetTeamKillCountForKick({
  2052.         return (int) $this->_array2String($this->_clientRequest("vars.teamKillCountForKick"));
  2053.     }
  2054.  
  2055.     /**
  2056.      * sets the highest kill-value allowed before a player is kicked for teamkilling<br />
  2057.      * set to 0 to disable kill value mechanism
  2058.      *
  2059.      * @param $integer 
  2060.      *
  2061.      * @return String 
  2062.      */
  2063.     function adminVarSetTeamKillValueForKick($integer{
  2064.         return $this->_array2String($this->_clientRequest("vars.teamKillValueForKick " $integer)0);
  2065.     }
  2066.  
  2067.     /**
  2068.      * gets the highest kill-value allowed before a player is kicked for teamkilling
  2069.      *
  2070.      * @return Integer 
  2071.      */
  2072.     function adminVarGetTeamKillValueForKick({
  2073.         return (int) $this->_array2String($this->_clientRequest("vars.teamKillValueForKick"));
  2074.     }
  2075.  
  2076.     /**
  2077.      * sets the value of a teamkill (adds to the player's current kill-value)
  2078.      *
  2079.      * @param $integer 
  2080.      *
  2081.      * @return String 
  2082.      */
  2083.     function adminVarSetTeamKillValueIncrease($integer{
  2084.         return $this->_array2String($this->_clientRequest("vars.teamKillValueIncrease " $integer)0);
  2085.     }
  2086.  
  2087.     /**
  2088.      * gets the value of a teamkill
  2089.      *
  2090.      * @return Integer 
  2091.      */
  2092.     function adminVarGetTeamKillValueIncrease({
  2093.         return (int) $this->_array2String($this->_clientRequest("vars.teamKillValueIncrease"));
  2094.     }
  2095.  
  2096.     /**
  2097.      * sets how much every player's kill-value should decrease per second
  2098.      *
  2099.      * @param $integer 
  2100.      *
  2101.      * @return String 
  2102.      */
  2103.     function adminVarSetTeamKillValueDecreasePerSecond($integer{
  2104.         return $this->_array2String($this->_clientRequest("vars.teamKillValueDecreasePerSecond " v)0);
  2105.     }
  2106.  
  2107.     /**
  2108.      * gets the decrease value
  2109.      *
  2110.      * @return Integer 
  2111.      */
  2112.         return (int) $this->_array2String($this->_clientRequest("vars.teamKillValueDecreasePerSecond"));
  2113.     }
  2114.  
  2115.     /**
  2116.      * sets how many seconds a player can be idle before he/she is kicked from the server
  2117.      *
  2118.      * @param $timeInSeconds 
  2119.      *
  2120.      * @return String 
  2121.      */
  2122.     function adminVarSetIdleTimeout($timeInSeconds{
  2123.         return $this->_array2String($this->_clientRequest("vars.idleTimeout " $timeInSeconds)0);
  2124.     }
  2125.  
  2126.     /**
  2127.      * gets the current idle time allowed
  2128.      *
  2129.      * @return Integer 
  2130.      */
  2131.     function adminVarGetIdleTimeout({
  2132.         return (int) $this->_array2String($this->_clientRequest("vars.idleTimeout " $timeInSeconds));
  2133.     }
  2134.  
  2135.     /**
  2136.      * enabled/disables the profanity filter
  2137.      *
  2138.      * @param $boolean 
  2139.      *
  2140.      * @return String 
  2141.      */
  2142.     function adminVarSetProfanityFilter($boolean{
  2143.         return $this->_array2String($this->_clientRequest("vars.profanityFilter " $this->_bool2String($boolean))0);
  2144.     }
  2145.  
  2146.     /**
  2147.      * gets the current value for the profanity filter
  2148.      *
  2149.      * @return boolean 
  2150.      */
  2151.     function adminVarGetProfanityFilter({
  2152.         return $this->_array2boolean($this->_clientRequest("vars.profanityFilter"));
  2153.     }
  2154. }
  2155. ?>

Documentation generated on Sun, 01 Aug 2010 12:55:31 +0200 by phpDocumentor 1.4.3