Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- set_time_limit(0);
- ignore_user_abort(1);
- ob_implicit_flush(1);
- //ob_implicit_flush(0);
- error_reporting(0);
- //ob_start();
- class MSG {
- private static $buffer_r;
- private static $size_r;
- private static $cursor_r;
- private static $bits_r;
- private static $buffer_w;
- private static $bits_w;
- static function ReadStart( $buffer ) {
- self::$buffer_r = $buffer;
- self::$size_r = strlen( $buffer );
- self::$cursor_r = 0;
- self::$bits_r = 0;
- }
- static private function ReadOneBit() {
- $byte = ord( self::$buffer_r[ self::$cursor_r ] );
- $bit = ( $byte >> self::$bits_r++ ) & 0x01;
- if ( self::$bits_r === 8 ) {
- self::$bits_r = 0;
- self::$cursor_r++;
- }
- return $bit;
- }
- static private function ReadOneByte() {
- if ( self::$bits_r === 0 )
- return ord( self::$buffer_r[ self::$cursor_r++ ] );
- return
- ( sefl::ReadOneBit() ) |
- ( sefl::ReadOneBit() << 1 ) |
- ( sefl::ReadOneBit() << 2 ) |
- ( sefl::ReadOneBit() << 3 ) |
- ( sefl::ReadOneBit() << 4 ) |
- ( sefl::ReadOneBit() << 5 ) |
- ( sefl::ReadOneBit() << 6 ) |
- ( sefl::ReadOneBit() << 7 ) ;
- }
- static function ReadBitsEnd() {
- if ( self::$bits_r > 0 ) {
- self::$bits_r = 0;
- self::$cursor_r++;
- }
- }
- static function ReadBits( $n ) {
- $res = 0;
- for ( $i = 0; $i < $n; $i++ )
- $res |= ( self::ReadOneBit() << $i );
- return $res;
- }
- static function ReadDWord() {
- return ( self::ReadOneByte() ) | ( self::ReadOneByte() << 8 ) | ( self::ReadOneByte() << 16 ) | ( self::ReadOneByte << 24 );
- }
- static function ReadWord() {
- return ( self::ReadOneByte() ) | ( self::ReadOneByte() << 8 );
- }
- static function ReadByte() {
- return ( self::ReadOneByte() );
- }
- static function ReadPString() {
- $res = "";
- while( ( $ch = self::ReadOneByte() ) !== 0 )
- $res .= chr( $ch );
- return $res;
- }
- static function WriteStart() {
- self::$buffer_w = $buffer;
- self::$bits_w = 0;
- }
- static private function WriteOneBit( $bit ) {
- $bit &= 0x01;
- if ( self::$bits_w === 0 ) {
- self::$buffer_w .= chr( $bit );
- self::$bits_w++;
- return;
- }
- $i = strlen( self::$buffer_w ) - 1;
- $byte = ord( self::$buffer_w[ $i ] );
- $byte |= ( ( $bit & 0x01 ) << ( self::$bits_w++ ) );
- self::$buffer_w[ $i ] = chr( $byte );
- if ( self::$bits_w === 8 )
- self::$bits_w = 0;
- }
- static private function WriteOneByte( $byte ) {
- $byte &= 0xFF;
- if ( self::$bits_w === 0 ) {
- self::$buffer_w .= chr( $byte );
- return;
- }
- self::WriteOneBit( ( $byte ) & 0x01 );
- self::WriteOneBit( ( $byte >> 1 ) & 0x01 );
- self::WriteOneBit( ( $byte >> 2 ) & 0x01 );
- self::WriteOneBit( ( $byte >> 3 ) & 0x01 );
- self::WriteOneBit( ( $byte >> 4 ) & 0x01 );
- self::WriteOneBit( ( $byte >> 5 ) & 0x01 );
- self::WriteOneBit( ( $byte >> 6 ) & 0x01 );
- self::WriteOneBit( ( $byte >> 7 ) & 0x01 );
- }
- static function WriteBitsEnd() {
- self::$bits_w = 0;
- }
- static function WriteBits( $num , $n ) {
- for ( $i = 0; $i < $n; $i++ )
- self::WriteOneBit( ( $num >> $i ) & 0x01 );
- }
- static function WriteDWord( $num ) {
- self::WriteOneByte( ( $num ) & 0xFF );
- self::WriteOneByte( ( $num >> 8 ) & 0xFF );
- self::WriteOneByte( ( $num >> 16 ) & 0xFF );
- self::WriteOneByte( ( $num >> 24 ) & 0xFF );
- }
- static function WriteWord( $num ) {
- self::WriteOneByte( ( $num ) & 0xFF );
- self::WriteOneByte( ( $num >> 8 ) & 0xFF );
- }
- static function WriteByte( $num ) {
- self::WriteOneByte( ( $num ) & 0xFF );
- }
- static function WritePString( $st ) {
- $l = strlen($st);
- for ( $i = 0; $i < $l; $i++ )
- self::WriteOneByte( ord( $st[$i] ) );
- self::WriteOneByte( 0 );
- }
- static function WriteGet() {
- return self::$buffer_w;
- }
- }
- class __MSG {
- static $bits_table = Array(
- 0x00 , 0x01 , 0x03 , 0x07 ,
- 0x0F , 0x1F , 0x3F , 0x7F
- );
- static $buffer;
- static $size;
- static $cursor;
- static $bits;
- static function ReadBegin( $buffer ) {
- self::$buffer = &$buffer;
- self::$size = strlen( self::$buffer );
- self::$cursor = 0;
- self::$bits = 0;
- }
- static function ReadBitsEnd() {
- if ( self::$bits === 0 )
- return;
- self::$bits = 0;
- self::$cursor++;
- }
- static function ReadBits( $n ) { // n in [1..32]
- if ( $n === 0 )
- return false;
- if ( ( ( self::$cursor << 3 ) + self::$bits + $n ) > ( self::$size << 3 ) )
- return false;
- $bytes = $n >> 3;
- $n -= $bytes << 3;
- $ret = self::ReadString( $bytes );
- if ( $n !== 0 ) {
- if ( self::$bits === 0 ) {
- $ret .= chr( ord( self::$buffer[ self::$cursor ] ) & self::$bits_table[ $n ] );
- self::$bits = $n;
- } else {
- $last = 8 - self::$bits;
- if ( $last <= $n ) {
- $ret .= chr(
- ( ( ord( self::$buffer[ self::$cursor++ ] ) >> self::$bits ) & self::$bits_table[ $last ] ) |
- ( ( ord( self::$buffer[ self::$cursor ] ) << $last ) & self::$bits_table[ $n ] )
- );
- self::$bits += $n - 8;
- } else {
- $ret .= chr( ( ord( self::$buffer[ self::$cursor ] ) >> self::$bits ) & self::$bits_table[ $n ] );
- self::$bits += $n;
- }
- }
- }
- if ( strlen( $ret ) > 4 )
- return $ret;
- switch ( strlen( $ret ) ) {
- case 0: $ret .= "\x00\x00\x00\x00"; break;
- case 1: $ret .= "\x00\x00\x00"; break;
- case 2: $ret .= "\x00\x00"; break;
- case 3: $ret .= "\x00"; break;
- }
- return unpack( "L" , $ret )[1];
- }
- static function ReadOneBit() {
- return self::ReadBits( 1 );
- }
- static function ReadInt32() {
- if ( self::$bits === 0 ) {
- if ( self::$cursor + 3 >= self::$size )
- return false;
- else
- $ret = unpack( "l" , substr( self::$buffer , self::$cursor , 4 ) )[1];
- self::$cursor += 4;
- return $ret;
- }
- if ( self::$cursor + 4 >= self::$size )
- return false;
- $ret = self::ReadChar() . self::ReadChar() . self::ReadChar() . self::ReadChar();
- $ret = unpack( "l" , $ret )[1];
- self::$cursor += 4;
- return $ret;
- }
- static function ReadInt16() {
- $ret1 = self::ReadByte();
- if ( $ret1 === false )
- return false;
- $ret2 = self::ReadByte();
- if ( $ret2 === false ) {
- self::$cursor--;
- return false;
- }
- $ret = (int) ( $ret1 + ( $ret2 << 8 ) );
- return ( $ret2 >> 7 ) ? ( ( $ret & 0x7FFF ) - 32768 ) : $ret;
- }
- static function ReadInt8() {
- $ret = self::ReadByte();
- if ( $ret1 === false )
- return false;
- return ( $ret >> 7 ) ? ( ( $ret & 0x7F ) - 128 ) : $ret;
- }
- static function ReadDWord() {
- if ( self::$bits === 0 ) {
- if ( self::$cursor + 3 >= self::$size )
- return false;
- else
- $ret = unpack( "L" , substr( self::$buffer , self::$cursor , 4 ) )[1];
- self::$cursor += 4;
- return $ret;
- }
- if ( self::$cursor + 4 >= self::$size )
- return false;
- $ret = self::ReadChar() . self::ReadChar() . self::ReadChar() . self::ReadChar();
- $ret = unpack( "L" , $ret )[1];
- self::$cursor += 4;
- return $ret;
- }
- static function ReadWord() {
- $ret1 = self::ReadByte();
- if ( $ret1 === false )
- return false;
- $ret2 = self::ReadByte();
- if ( $ret2 === false ) {
- self::$cursor--;
- return false;
- }
- return (int) ( $ret1 + ( $ret2 << 8 ) );
- }
- static function ReadByte() {
- if ( self::$bits === 0 )
- return ( self::$cursor >= self::$size ) ? false : ord( self::$buffer[ self::$cursor++ ] );
- return ( self::$cursor + 1 >= self::$size ) ? false : ( (int) (
- ( ord( self::$buffer[ self::$cursor++ ] ) >> self::$bits ) |
- ( ord( self::$buffer[ self::$cursor ] ) & self::$bits_table << ( 8 - self::$bits ) )
- ) );
- }
- static function ReadBool32() {
- $ret = self::ReadDWord();
- if ( $ret === false )
- return false;
- return ( $ret ) ? 1 : 0;
- }
- static function ReadBool16() {
- $ret = self::ReadWord();
- if ( $ret === false )
- return false;
- return ( $ret ) ? 1 : 0;
- }
- static function ReadBool8() {
- $ret = self::ReadByte();
- if ( $ret === false )
- return false;
- return ( $ret ) ? 1 : 0;
- }
- static function ReadBool1() {
- $ret = self::ReadBits( 1 );
- if ( $ret === false )
- return false;
- return ( $ret ) ? 1 : 0;
- }
- static function ReadChar() {
- if ( self::$bits === 0 )
- return ( self::$cursor >= self::$size ) ? false : self::$buffer[ self::$cursor++ ];
- return ( self::$cursor + 1 >= self::$size ) ? false : chr( (int) (
- ( ord( self::$buffer[ self::$cursor++ ] ) >> self::$bits ) |
- ( ord( self::$buffer[ self::$cursor ] ) & self::$bits_table << ( 8 - self::$bits ) )
- ) );
- }
- static function ReadPString() {
- if ( self::$bits === 0 ) {
- $begin = self::$cursor;
- while ( ( self::$cursor < self::$size ) && ( self::$buffer[ self::$cursor++ ] !== "\x00" ) );
- return ( self::$buffer[ self::$cursor - 1 ] === "\x00" ) ? substr( self::$buffer , $begin , self::$cursor - $begin - 1 ) : substr( self::$buffer , $begin , self::$cursor - $begin );
- }
- $ret = "";
- $c = self::ReadChar();
- while ( !( ( $c === false ) || ( $c === "\x00" ) ) ) {
- $ret .= $c;
- $c = self::ReadChar();
- }
- return $ret;
- }
- static function ReadString( $len = false ) {
- if ( $len === 0 )
- return "";
- if ( self::$bits === 0 ) {
- if ( self::$cursor + $len > self::$size )
- return false;
- if ( $len === false )
- $len = self::$size - self::$cursor;
- $ret = substr( self::$buffer , self::$cursor , $len );
- self::$cursor += $len;
- return $ret;
- }
- if ( self::$cursor + $len + 1 > self::$size )
- return false;
- $ret = "";
- while ( $len ) {
- $ret .= self::ReadChar();
- $len--;
- }
- return $ret;
- }
- }
- class TBUF {
- public $buf = "";
- public $bufPos = 0;
- public $bufSize = 0;
- public $posBit = 0;
- public function movBufL( $i = 0 ) {
- $this->setBuf( $this -> getBuf( $i ) );
- }
- public function movR( $i = 0 ) {
- $this -> bufPos += $i;
- if ( $this -> bufPos >= $this -> bufSize )
- $this -> bufSize = $this -> bufPos + 1;
- }
- public function movL( $i = 0 ) {
- $this -> bufPos -= $i;
- }
- public function movE() {
- $this -> bufPos = $this -> bufSize;
- }
- public function movB() {
- $this -> bufPos = 0;
- }
- public function ifEnd() {
- return (bool)( $this -> bufPos >= $this -> bufSize );
- }
- public function ifEmpty() {
- return ((bool)( $this -> bufSize === 0 ));
- }
- public function ifPos( $b = Null , $search ) {
- $b = ( $b === Null ) ? $this -> bufPos : $b;
- return ( (bool) ( substr( $this -> buf , $b , strlen( $search ) ) === $search ) );
- }
- public function setCursor( $i = 0 ) {
- $this -> bufPos = $i;
- }
- public function setBuf( $buf = "" ) {
- $this->buf = $buf;
- $this->bufPos = 0;
- $this->bufSize = strlen( $buf );
- }
- public function addBuf( $buf ) {
- $this->buf .= $buf;
- $this->bufSize = strlen( $this->buf );
- $this->bufPos = $this->bufSize;
- }
- public function getBuf( $b = 0 , $l = 65535 ) {
- return substr( $this->buf , $b , $l );
- }
- public function readPString( $len = 65535 ) {
- $res = "";
- $len += $this->bufPos;
- $posNull = strpos( $this->buf , "\x00" , $this->bufPos );
- if ( !( $posNull === false ) ) {
- if ( $posNull < $len ) {
- $res = substr( $this->buf , $this->bufPos , $posNull - $this->bufPos );
- $this->bufPos = $posNull + 1;
- return $res;
- }
- $res = substr( $this->buf , $this->bufPos , $len - $this->bufPos );
- $this->bufPos = $len;
- return $res;
- }
- $res = substr( $this->buf , $this->bufPos , $len );
- $this->bufPos = $this->bufSize;
- return $res;
- }
- public function readString( $len = true ) {
- $res = "";
- if ( $len === true ) {
- $res = $this -> getBuf( $this -> bufPos );
- $this -> bufPos = $this -> bufSize;
- } else {
- $res = $this -> getBuf( $this -> bufPos , $len );
- $this -> movR( $len );
- }
- return $res;
- }
- public function readInt32() {
- $res = unpack( "l" , substr( $this->buf , $this->bufPos , 4 ) )[1];
- $this->bufPos += 4;
- return $res;
- }
- public function readInt16() {
- $res = ord( $this->buf[ $this->bufPos ] ) + ord( $this->buf[ $this->bufPos+1 ] ) * 256;
- $this->bufPos += 2;
- return $res;
- }
- public function readInt8() {
- $res = ord( $this->buf[ $this->bufPos ] );
- $this->bufPos++;
- return $res;
- }
- public function readFloat32() {
- $res = unpack( "f" , substr( $this->buf , $this->bufPos , 4 ) )[1];
- $this->bufPos += 4;
- return $res;
- }
- private function __ReadOneBit() {
- $byte = ord( $this->buf[ $this->bufPos ] );
- $bit = ( $byte >> ($this->posBit++) ) & 0x01;
- //return $bit;
- if ( $this->posBit === 8 ) {
- $this->posBit = 0;
- $this->bufPos++;
- }
- return $bit;
- }
- private function readBits_sys( $count = 0 ) {//max 24 bit
- if ( ( $count < 1 ) || ( $count > 24 ) )
- return false;
- /*
- $res = 0;
- for ( $i = 0; $i < $count; $i++ )
- $res |= ( $this->__ReadOneBit() << $i );
- return $res;
- */
- $r_byte = $count >> 3;
- if ( $this->bufPos + 4 > $this->bufSize ) {
- $st = $this->readString();
- $len = strlen( $st );
- for( $i=0; $i<(4-$len); $i++ )
- $st .= "\x00";
- $b = unpack( "l" , $st )[1];
- $this->movL($len - $r_byte);
- } else {
- $b = $this->readInt32();
- $this->movL(4 - $r_byte);
- }
- $bits = ( $b >> $this->posBit ) & ( ~( ((int)1xAAAAAAAA) << $count ) );
- $this->posBit += ( $count - ( $r_byte << 3 ) );
- if ( $this->posBit >= 8 ) {
- $this->posBit -= 8;
- $this->movR(1);
- }
- //echo "posBit = " . $this->posBit." | posByte = " . $this->bufPos. "\n";
- return $bits;
- }
- public function readBits( $count = 0 ) {//max 32 bit
- if ( ( $count < 1 ) || ( $count > 32 ) )
- return false;
- if ( $count > 24 ) {
- return ( $this->readBits_sys( 24 ) | ( $this->readBits_sys( $count - 24 ) << 24 ) );
- } else
- return $this->readBits_sys( $count );
- }
- public function readOneBitBool() {
- return ( $this->readBits(1) === 1 );
- }
- public function readBitsBegin() {
- $this->posBit = 0;
- }
- public function readBitsEnd() {
- if ( $this->posBit > 0 ) {
- $this->posBit = 0;
- $this->movR(1);
- }
- }
- public function readBitsRelease() {
- if ( $this->posBit > 0 ) {
- $this->posBit = 0;
- $this->movR(1);
- }
- }
- public function readBitPString() {
- $result = "";
- while( ($byte = $this->readBits( 8 )) !== 0 )
- $result .= chr($byte);
- return $result;
- }
- public function readBitBufferByte( $byte ) {
- $res = "";
- for ( $i = 0; $i < $byte; $i++ )
- $res .= chr( $this->readBits(8) );
- return $res;
- }
- private $ReadBitNum = 0;
- private function readBitOne_sys() {
- $byte = ord($this->buf[$this->bufPos]);
- $bit = ( $byte >> $this->ReadBitNum ) & 0x01;
- if ( $this->ReadBitNum === 8 ) {
- $this->bufPos++;
- $this->ReadBitNum = 0;
- }
- return $bit;
- }
- public function readBitsM( $n ) {
- $res = 0;
- for ( $i = 0; $i < $n; $i++ )
- $res |= ( $this->readBitOne_sys() << $i );
- return $res;
- }
- public function readBitsEndM() {
- if ( !( $this->ReadBitNum === 0 ) ) {
- $this->bufPos++;
- $this->ReadBitNum = 0;
- }
- }
- public function writePString( $str ) {
- $this -> writeString( $str . "\x00" );
- $this -> movR( strlen($str) + 1 );
- }
- public function writeString( $str , $bPos = false ) {
- if ( $bPos === false )
- $bPos = $this -> bufPos;
- $buf1 = $this -> getBuf( 0 , $bPos ); //substr( $this->buf , 0 , $bPos );
- $buf2 = $this -> getBuf( $bPos ); //substr( $this->buf , 0 , $bPos );
- $this -> buf = $buf1 . $str . $buf2;
- $this -> movR( strlen($str) );
- }
- public function writeInt32( $option ) {
- $res = pack( "l" , ( (int) $option ) );
- $this -> writeString( $res );
- }
- public function writeInt16( $option ) {
- $f1 = ( (int) $option ) & 0xFF;
- $f2 = ( ( (int) $option ) >> 8 ) & 0xFF;
- $res = chr( $f1 ) . chr( $f2 );
- $this -> writeString( $res );
- }
- public function writeInt8( $option ) {
- $res = chr( ( ( (int) $option ) & 0xFF ) );
- $this -> writeString( $res );
- }
- public function writeFloat32( $option ) {
- $res = pack( "f" , ( (float) $option ) );
- $this -> writeString( $res );
- }
- }
- class SVC_CMD {
- public $_list_ = Array (
- Array( "Name" => "BAD" , "Index" => 0 , "params_type" => "1" , "Size" => Null ) ,
- Array( "Name" => "NOP" , "Index" => 1 , "params_type" => "1" , "Size" => Null ) ,
- Array( "Name" => "DISCONNECT" , "Index" => 2 , "params_type" => "p" , "Size" => Null ) ,
- Array( "Name" => "EVENT" , "Index" => 3 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "VERSION" , "Index" => 4 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "SETVIEW" , "Index" => 5 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "SOUND" , "Index" => 6 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "TIME" , "Index" => 7 , "params_type" => "Float" , "Size" => Null ) ,
- Array( "Name" => "PRINT" , "Index" => 8 , "params_type" => "n" , "Size" => Null ) ,
- Array( "Name" => "STUFFTEXT" , "Index" => 9 , "params_type" => "n" , "Size" => Null ) ,
- Array( "Name" => "SETANGLE" , "Index" => 10 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "SERVERINFO" , "Index" => 11 , "params_type" => "_SERVERINFO" , "Size" => Null ) ,
- Array( "Name" => "LIGHTSTYLE" , "Index" => 12 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "UPDATEUSERINFO" , "Index" => 13 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "DELTADESCRIPTION" , "Index" => 14 , "params_type" => "_DELTADESCRIPTION" , "Size" => Null ) ,
- Array( "Name" => "CLIENTDATA" , "Index" => 15 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "STOPSOUND" , "Index" => 16 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "PINGS" , "Index" => 17 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "PARTICLE" , "Index" => 18 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "DAMAGE" , "Index" => 19 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "SPAWNSTATIC" , "Index" => 20 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "EVENT_RELIABLE" , "Index" => 21 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "SPAWNBASELINE" , "Index" => 22 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "TEMPENTITY" , "Index" => 23 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "SETPAUSE" , "Index" => 24 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "SIGNONNUM" , "Index" => 25 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "CENTERPRINT" , "Index" => 26 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "KILLEDMONSTER" , "Index" => 27 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "FOUNDSECRET" , "Index" => 28 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "SPAWNSTATICSOUND" , "Index" => 29 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "INTERMISSION" , "Index" => 30 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "FINALE" , "Index" => 31 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "CDTRACK" , "Index" => 32 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "RESTORE" , "Index" => 33 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "CUTSCENE" , "Index" => 34 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "WEAPONANIM" , "Index" => 35 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "DECALNAME" , "Index" => 36 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "ROOMTYPE" , "Index" => 37 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "ADDANGLE" , "Index" => 38 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "NEWUSERMSG" , "Index" => 39 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "PACKETENTITIES" , "Index" => 40 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "DELTAPACKETENTITIES" , "Index" => 41 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "CHOKE" , "Index" => 42 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "RESOURCELIST" , "Index" => 43 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "NEWMOVEVARS" , "Index" => 44 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "RESOURCEREQUEST" , "Index" => 45 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "CUSTOMIZATION" , "Index" => 46 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "CROSSHAIRANGLE" , "Index" => 47 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "SOUNDFADE" , "Index" => 48 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "FILETXFERFAILED" , "Index" => 49 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "HLTV" , "Index" => 50 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "DIRECTOR" , "Index" => 51 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "VOICEINIT" , "Index" => 52 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "VOICEDATA" , "Index" => 53 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "SENDEXTRAINFO" , "Index" => 54 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "TIMESCALE" , "Index" => 55 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "RESOURCELOCATION" , "Index" => 56 , "params_type" => "_default" , "Size" => Null ) ,
- Array( "Name" => "SENDCVARVALUE" , "Index" => 57 , "params_type" => "p" , "Size" => Null ) ,
- Array( "Name" => "SENDCVARVALUE2" , "Index" => 58 , "params_type" => "ip" )
- );
- public $buf;
- public function checkCMD( $name ) {
- foreach ( $this -> _list_ as &$cmd ) {
- if ( $cmd["Name"] === $name )
- return true;
- }
- return false;
- }
- public function getCMD( $search ) {
- if ( getType( $search ) === "string" ) {
- foreach ( $this -> _list_ as &$cmd ) {
- if ( $cmd["Name"] === $search )
- return $cmd;
- }
- } else {
- foreach( $this->_list_ as &$cmd ) {
- if ( $cmd["Index"] === $search )
- return $cmd;
- }
- }
- return false;
- }
- public function getCMDName ( $id ) {
- $t = $this -> getCMD( $id );
- return ( $t ) ? $t["Name"] : false;
- }
- public function writeCMD( $cmd , $options , $my_type = false ) {
- $cmd = $this -> getCMD( $cmd );
- if ( $cmd === false )
- return false;
- if ( $my_type )
- return chr( $cmd["Index"] ) . ( (string) $options );
- if ( $cmd["params_type"] === "PString" )
- return chr( $cmd["Index"] ) . ( (string) $options ) . "\x00";
- if ( $cmd["params_type"] === "PStringNewLine" )
- return chr( $cmd["Index"] ) . ( (string) $options ) . "\x0A\x00";
- if ( $cmd["params_type"] === "Int32_PString" )
- return chr( $cmd["Index"] ) . pack( "l" , ( (int) $options [0] ) ) . ( (string) $options [1] ) . "\x00";
- }
- public function parseFormatRead( $buf , $cmd , $i ) {
- switch ( substr( $cmd["params_type"] , $i ) ) {
- case "_SERVERINFO":
- $prev = $buf -> bufPos;
- $options = Array(
- $buf -> readInt32() ,
- $buf -> readInt32() ,
- $buf -> readInt32() ,
- $buf -> readInt8() ,
- $buf -> readInt8() ,
- $buf -> readInt16() ,
- $buf -> readPString() ,
- $buf -> readPString() ,
- //$buf -> readInt8() ,
- $buf -> readPString() ,
- //$buf -> readInt32() ,
- $buf -> readInt32()
- );
- return Array( "cmd" => $cmd , "options" => $options , "options_string" => $buf->getBuf( $prev , $buf->bufPos - $prev ) );
- break;
- case "_DELTADESCRIPTION":
- $prev = $buf -> bufPos;
- $options = Array(
- $buf -> readPString()
- );
- return Array( "cmd" => $cmd , "options" => $options , "options_string" => $buf->getBuf( $prev , $buf->bufPos - $prev ) );
- case "_default":
- return Array( "cmd" => $cmd , "options" => Null , "options_string" => $buf->readString() );
- break;
- default:
- $buf->movL( 1 );
- return -1;
- }
- }
- public function readCMD( $buf ) {
- $cmd = $buf->readInt8();
- if ( $cmd === 0 )
- return -1;
- $cmd = $this -> getCMD( $cmd );
- if ( $cmd === false ) {
- $buf->movL( 1 );
- return 0;
- }
- $t_len = strlen( $cmd["params_type"] );
- $prevPos = $buf -> bufPos;
- $options = Array();
- for ( $i = 0; $i < $t_len; $i++ ) {
- switch ( $cmd["params_type"][$i] ) {
- case "1":
- return Array( "cmd" => $cmd , "options" => Null , "options_string" => substr( $buf->buf , $prevPos , $buf -> bufPos - $prevPos ) );
- break;
- case "i":
- $options[] = $buf->readInt32();
- break;
- case "s":
- $options[] = $buf->readInt16();
- break;
- case "b":
- $options[] = $buf->readInt8();
- break;
- case "p":
- $options[] = $buf->readPString();
- break;
- case "n":
- $options[] = $buf->readPString();
- break;
- case "_":
- return $this -> parseFormatRead( $buf , $cmd , $i );
- break;
- default:
- return -1;
- }
- }
- return Array( "cmd" => $cmd , "options" => $options , "options_string" => substr( $buf->buf , $prevPos , $buf -> bufPos - $prevPos ) );
- }
- public function __construct() {
- $this -> buf = NET_BUFER_IN::getCL();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class USER_MESSAGE extends TBUF {
- public $_list_ = Array(
- Array( "Name" => "ReqState" , "Index" => 65 , "Size" => 0 ) ,
- Array( "Name" => "VoiceMask" , "Index" => 64 , "Size" => 8 ) ,
- Array( "Name" => "ShowMenu" , "Index" => 96 , "Size" => -1 ) ,
- Array( "Name" => "Scenario" , "Index" => 134 , "Size" => -1 ) ,
- Array( "Name" => "TaskTime" , "Index" => 133 , "Size" => 4 ) ,
- Array( "Name" => "BarTime2" , "Index" => 138 , "Size" => 4 ) ,
- Array( "Name" => "BarTime" , "Index" => 108 , "Size" => 2 ) ,
- Array( "Name" => "RoundTime" , "Index" => 101 , "Size" => 2 ) ,
- Array( "Name" => "BlinkAcct" , "Index" => 104 , "Size" => 1 ) ,
- Array( "Name" => "Money" , "Index" => 102 , "Size" => 5 ) ,
- Array( "Name" => "StatusIcon" , "Index" => 107 , "Size" => -1 ) ,
- Array( "Name" => "TextMsg" , "Index" => 77 , "Size" => -1 ) ,
- Array( "Name" => "SecAmmoIcon" , "Index" => 0 , "Size" => 0 ) ,
- Array( "Name" => "SecAmmoVal" , "Index" => 0 , "Size" => 0 ) ,
- Array( "Name" => "DeathMsg" , "Index" => 83 , "Size" => -1 ) ,
- Array( "Name" => "StatusValue" , "Index" => 105 , "Size" => -1 ) ,
- Array( "Name" => "StatusText" , "Index" => 106 , "Size" => -1 ) ,
- Array( "Name" => "GameTitle" , "Index" => 82 , "Size" => 1 ) ,
- Array( "Name" => "HudTextArgs" , "Index" => 145 , "Size" => -1 ) ,
- Array( "Name" => "HudTextPro" , "Index" => 74 , "Size" => -1 ) ,
- Array( "Name" => "HudText" , "Index" => 75 , "Size" => -1 ) ,
- Array( "Name" => "FlashBat" , "Index" => 69 , "Size" => 1 ) ,
- Array( "Name" => "Flashlight" , "Index" => 68 , "Size" => 2 ) ,
- Array( "Name" => "ArmorType" , "Index" => 103 , "Size" => 1 ) ,
- Array( "Name" => "Battery" , "Index" => 72 , "Size" => 2 ) ,
- Array( "Name" => "Train" , "Index" => 73 , "Size" => 1 ) ,
- Array( "Name" => "Geiger" , "Index" => 67 , "Size" => 1 ) ,
- Array( "Name" => "SendAudio" , "Index" => 100 , "Size" => -1 ) ,
- Array( "Name" => "SayText" , "Index" => 76 , "Size" => -1 ) ,
- Array( "Name" => "ReceiveW" , "Index" => 129 , "Size" => 1 ) ,
- Array( "Name" => "ClCorpse" , "Index" => 122 , "Size" => -1 ) ,
- Array( "Name" => "ScoreAttrib" , "Index" => 84 , "Size" => 2 ) ,
- Array( "Name" => "Radar" , "Index" => 112 , "Size" => 7 ) ,
- Array( "Name" => "Damage" , "Index" => 71 , "Size" => 12 ) ,
- Array( "Name" => "Health" , "Index" => 70 , "Size" => 1 ) ,
- Array( "Name" => "Crosshair" , "Index" => 110 , "Size" => 1 ) ,
- Array( "Name" => "AmmoX" , "Index" => 99 , "Size" => 2 ) ,
- Array( "Name" => "HideWeapon" , "Index" => 94 , "Size" => 1 ) ,
- Array( "Name" => "ItemPickup" , "Index" => 93 , "Size" => -1 ) ,
- Array( "Name" => "WeapPickup" , "Index" => 92 , "Size" => 1 ) ,
- Array( "Name" => "AmmoPickup" , "Index" => 91 , "Size" => 2 ) ,
- Array( "Name" => "WeaponList" , "Index" => 78 , "Size" => -1 ) ,
- Array( "Name" => "CurWeapon" , "Index" => 66 , "Size" => 3 ) ,
- Array( "Name" => "NVGToggle" , "Index" => 111 , "Size" => 1 ) ,
- Array( "Name" => "ItemStatus" , "Index" => 139 , "Size" => 1 ) ,
- Array( "Name" => "BotProgress" , "Index" => 141 , "Size" => -1 ) ,
- Array( "Name" => "SpecHealth2" , "Index" => 137 , "Size" => 2 ) ,
- Array( "Name" => "BuyClose" , "Index" => 136 , "Size" => 0 ) ,
- Array( "Name" => "TutorClose" , "Index" => 118 , "Size" => -1 ) ,
- Array( "Name" => "TutorState" , "Index" => 117 , "Size" => -1 ) ,
- Array( "Name" => "TutorLine" , "Index" => 116 , "Size" => -1 ) ,
- Array( "Name" => "TutorText" , "Index" => 115 , "Size" => -1 ) ,
- Array( "Name" => "VGUIMenu" , "Index" => 114 , "Size" => -1 ) ,
- Array( "Name" => "ForceCam" , "Index" => 127 , "Size" => 3 ) ,
- Array( "Name" => "AllowSpec" , "Index" => 119 , "Size" => 1 ) ,
- Array( "Name" => "Spectator" , "Index" => 113 , "Size" => 2 ) ,
- Array( "Name" => "Location" , "Index" => 140 , "Size" => -1 ) ,
- Array( "Name" => "TeamInfo" , "Index" => 86 , "Size" => -1 ) ,
- Array( "Name" => "TeamScore" , "Index" => 87 , "Size" => -1 ) ,
- Array( "Name" => "ScoreInfo" , "Index" => 85 , "Size" => 9 ) ,
- Array( "Name" => "ServerName" , "Index" => 90 , "Size" => -1 ) ,
- Array( "Name" => "RandomPC" , "Index" => 0 , "Size" => 0 ) ,
- Array( "Name" => "BuildSt" , "Index" => 0 , "Size" => 0 ) ,
- Array( "Name" => "MOTD" , "Index" => 89 , "Size" => -1 ) ,
- Array( "Name" => "Detpack" , "Index" => 0 , "Size" => 0 ) ,
- Array( "Name" => "Feign" , "Index" => 0 , "Size" => 0 ) ,
- Array( "Name" => "TeamNames" , "Index" => 0 , "Size" => 0 ) ,
- Array( "Name" => "ShowTimer" , "Index" => 144 , "Size" => 0 ) ,
- Array( "Name" => "Fog" , "Index" => 143 , "Size" => 7 ) ,
- Array( "Name" => "Brass" , "Index" => 142 , "Size" => -1 ) ,
- Array( "Name" => "BotVoice" , "Index" => 135 , "Size" => 2 ) ,
- Array( "Name" => "ShadowIdx" , "Index" => 132 , "Size" => 4 ) ,
- Array( "Name" => "CZCareerHUD" , "Index" => 131 , "Size" => -1 ) ,
- Array( "Name" => "HostageK" , "Index" => 124 , "Size" => 1 ) ,
- Array( "Name" => "HostagePos" , "Index" => 123 , "Size" => 8 ) ,
- Array( "Name" => "ADStop" , "Index" => 128 , "Size" => 0 ) ,
- Array( "Name" => "BombPickup" , "Index" => 121 , "Size" => 0 ) ,
- Array( "Name" => "BombDrop" , "Index" => 120 , "Size" => 7 ) ,
- Array( "Name" => "ReloadSound" , "Index" => 109 , "Size" => 2 ) ,
- Array( "Name" => "Concuss" , "Index" => 0 , "Size" => 0 ) ,
- Array( "Name" => "SpecHealth" , "Index" => 126 , "Size" => 1 ) ,
- Array( "Name" => "HLTV" , "Index" => 125 , "Size" => 2 ) ,
- Array( "Name" => "SetFOV" , "Index" => 95 , "Size" => 1 ) ,
- Array( "Name" => "ViewMode" , "Index" => 81 , "Size" => 0 ) ,
- Array( "Name" => "InitHUD" , "Index" => 80 , "Size" => 0 ) ,
- Array( "Name" => "GameMode" , "Index" => 88 , "Size" => 1 ) ,
- Array( "Name" => "ResetHUD" , "Index" => 79 , "Size" => 0 ) ,
- Array( "Name" => "Logo" , "Index" => 0 , "Size" => 0 ) ,
- Array( "Name" => "ScreenFade" , "Index" => 98 , "Size" => 10 )
- );
- public $buf;
- public function checkCMD( $name ) {
- foreach ( $this -> _list_ as &$cmd ) {
- if ( $cmd["Name"] === $name )
- return true;
- }
- return false;
- }
- public function getCMD( $search ) {
- if ( getType( $search ) === "string" ) {
- foreach ( $this -> _list_ as &$cmd ) {
- if ( $cmd["Name"] === $search )
- return $cmd;
- }
- } else {
- foreach( $this->_list_ as &$cmd ) {
- if ( $cmd["Index"] === $search )
- return $cmd;
- }
- }
- return false;
- }
- public function getCMDName ( $id ) {
- $t = $this -> getCMD( $id );
- return ( $t ) ? $t["Name"] : false;
- }
- public function writeCMD( $cmd , $options , $my_type = true/*false*/ ) {
- $cmd = $this -> getCMD( $cmd );
- if ( $cmd === false )
- return false;
- if ( $my_type )
- return chr( $cmd["Index"] ) . ( (string) $options );
- /*
- if ( $cmd["params_type"] === "PString" )
- return chr( $cmd["Index"] ) . ( (string) $options ) . "\x00";
- if ( $cmd["params_type"] === "PStringNewLine" )
- return chr( $cmd["Index"] ) . ( (string) $options ) . "\x0A\x00";
- if ( $cmd["params_type"] === "Int32_PString" )
- return chr( $cmd["Index"] ) . pack( "l" , ( (int) $options [0] ) ) . ( (string) $options [1] ) . "\x00";
- */
- }
- public function readCMD( $buf ) {
- $cmdId = $this->readInt8();
- $cmd = $this -> getCMD( $cmdId );
- if ( ( $cmd === false ) || ( $cmd["Index"] === 0 ) ) {
- $buf->movL( 1 );
- return false;
- }
- $Size = ( $cmd["Size"] === -1 ) ? $this->readInt8() : $cmd["Size"];
- $res = $this -> readString( $Size );
- return Array( "cmd" => $cmd , "options" => Null , "options_string" => $res );
- }
- public function read() {
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class CLC_CMD extends TBUF {
- public $_list_ = Array(
- Array( "Name" => "BAD" , "Index" => 0 , "params_type" => "1" , "Size" => Null ) ,
- Array( "Name" => "NOP" , "Index" => 1 , "params_type" => "1" , "Size" => Null ) ,
- Array( "Name" => "MOVE" , "Index" => 2 , "params_type" => "_MOVE" , "Size" => Null ) ,
- Array( "Name" => "STRINGCMD" , "Index" => 3 , "params_type" => "n" , "Size" => Null ) ,
- Array( "Name" => "DELTA" , "Index" => 4 , "params_type" => "b" , "Size" => Null ) ,
- Array( "Name" => "RESOURCELIST" , "Index" => 5 , "params_type" => "_RESOURCELIST" , "Size" => Null ) ,
- Array( "Name" => "USERINFO" , "Index" => 6 , "params_type" => "p" , "Size" => Null ) ,
- Array( "Name" => "FILECONSISTENCY" , "Index" => 7 , "params_type" => "_Fileconsistency_Format" , "Size" => Null ) ,
- Array( "Name" => "VOICEDATA" , "Index" => 8 , "params_type" => "_VOICEDATA" , "Size" => Null ) ,
- Array( "Name" => "REQUESTCVARVALUE" , "Index" => 10 , "params_type" => "p" , "Size" => Null ) ,
- Array( "Name" => "REQUESTCVARVALUE2" , "Index" => 11 , "params_type" => "ipp" , "Size" => Null )
- );
- public function checkCMD( $name ) {
- foreach ( $this -> _list_ as &$cmd ) {
- if ( $cmd["Name"] === $name )
- return true;
- }
- return false;
- }
- public function getCMD( $search ) {
- if ( getType( $search ) === "string" ) {
- foreach ( $this -> _list_ as &$cmd ) {
- if ( $cmd["Name"] === $search )
- return $cmd;
- }
- } else {
- foreach( $this->_list_ as &$cmd ) {
- if ( $cmd["Index"] === $search )
- return $cmd;
- }
- }
- return false;
- }
- public function getCMDName ( $id ) {
- $t = $this -> getCMD( $id );
- return ( $t ) ? $t["Name"] : false;
- }
- public function parseFormat( $format , &$options , $optI , $ifWrite = false ) {
- $format = substr( $format , $optI );
- switch ( $format ) {
- case "_Move_Format":
- break;
- case "_Fileconsistency_Format":
- if ( $ifWrite ) {
- $this -> writeInt8($options[$optI]);
- $this -> writeInt8($options[$optI+1]);
- $this -> writeString($options[$optI+2]);
- }
- break;
- case "_Voicedata_Format":
- if ( $ifWrite ) {
- $this -> writeInt8($options[$optI]);
- $this -> writeInt8($options[$optI+1]);
- $this -> writeString($options[$optI+2]);
- }
- break;
- }
- }
- public function parseFormatWrite( $format , &$options ) {
- switch ( $format ) {
- case "_RESOURCELIST":
- $count = count( $options );
- $this -> writeInt16( $count );
- for( $i = 0; $i <= $count; $i++ ) {
- $this -> writePString( $options[$i][0] );
- $this -> writeInt8( $options[$i][1] );
- $this -> writeInt16( $options[$i][2] );
- $this -> writeInt32( $options[$i][3] );
- $this -> writeInt8( $ucFlags = $options[$i][4] );
- $ucFlags &= 0xFD;
- if ( ( $ucFlags & 0x04 ) !== 0 )
- $this -> writeInt16( $options[$i][5] );
- }
- return $this -> getBuf();
- break;
- case "__MOVE":
- $this -> writeInt8( strlen($options[0]) );
- COM::setAsistMungeTable(1);
- $this -> writeString( COM::Munge( $options[0] , $options[1] ) );
- COM::setAsistMungeTable(2);
- return $this -> getBuf();
- break;
- case "_Fileconsistency_Format":
- return $this -> getBuf();
- break;
- case "_VOICEDATA":
- $this -> writeInt16( strlen( $options[0] ) );
- $this -> writeString( $options[0] );
- return $this -> getBuf();
- break;
- }
- return $this -> getBuf();
- }
- public function parseFormatRead( $buf , $cmd ) {
- $format = substr( $format , $optI );
- switch ( $cmd["params_type"] ) {
- case "__MOVE":
- $size = $buf -> readInt16();
- $prevPos = $buf->bufPos;
- $buf -> writeString( $size );
- $options = Array( $buf -> readString( $size ) );
- return Array( "cmd" => $cmd , "options" => $options , "options_string" => substr( $buf->buf , $prevPos , $buf -> bufPos - $prevPos ) );
- break;
- case "_VOICEDATA":
- $size = $buf -> readInt16();
- $prevPos = $buf->bufPos;
- $buf -> writeString( $size );
- $options = Array( $buf -> readString( $size ) );
- return Array( "cmd" => $cmd , "options" => $options , "options_string" => substr( $buf->buf , $prevPos , $buf -> bufPos - $prevPos ) );
- break;
- }
- return -1;
- }
- public function writeCMD( $cmd , $options , $my_type = false ) {
- $cmd = $this -> getCMD( $cmd );
- if ( $cmd === false )
- return false;
- if ( gettype( $options ) === "string" )
- $options = Array( $options );
- $this -> setBuf();
- $this -> writeInt8( $cmd["Index"] );
- if ( $my_type ) {
- $this -> writeString( $options [0] );
- return $this -> getBuf();
- }
- $t_len = strlen( $cmd["params_type"] );
- $o_len = count( $options );
- $noParse = false;
- for ( $i = 0; $i < $t_len; $i++ ) {
- switch ( $cmd["params_type"][$i] ) {
- case "1":
- return $this -> getBuf();
- break;
- case "i":
- $this -> writeInt32( $options [$i] );
- break;
- case "s":
- $this -> writeInt16( $options [$i] );
- break;
- case "b":
- $this -> writeInt8( $options [$i] );
- break;
- case "p":
- $this -> writePString( $options [$i] );
- break;
- case "n":
- $this -> writePString( $options [$i] . "\x0A" );
- break;
- case "_":
- return $this -> parseFormatWrite( $cmd["params_type"] , $options );
- break;
- default:
- return false;
- }
- }
- return $this -> getBuf();
- }
- public function readCMD( $buf ) {
- $cmd = $buf->readInt8();
- if ( $cmd === 0 )
- return -1;
- $cmd = $this -> getCMD( $cmd );
- if ( $cmd === false ) {
- $buf->movL( 1 );
- return 0;
- }
- $t_len = strlen( $cmd["params_type"] );
- $prevPos = $buf -> bufPos;
- $options = Array();
- for ( $i = 0; $i < $t_len; $i++ ) {
- switch ( $cmd["params_type"][$i] ) {
- case "1":
- return Array( "cmd" => $cmd , "options" => Null , "options_string" => substr( $buf->buf , $prevPos , $buf -> bufPos - $prevPos ) );
- break;
- case "i":
- $options[] = $buf->readInt32();
- break;
- case "s":
- $options[] = $buf->readInt16();
- break;
- case "b":
- $options[] = $buf->readInt8();
- break;
- case "p":
- $options[] = $buf->readPString();
- break;
- case "n":
- $options[] = $buf->readPString();
- break;
- case "_":
- return $this -> parseFormatRead( $buf , $cmd );
- break;
- default:
- return -1;
- }
- }
- return Array( "cmd" => $cmd , "options" => $options , "options_string" => substr( $buf->buf , $prevPos , $buf -> bufPos - $prevPos ) );
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class CLIENT_USER_INFO_LIST {
- public $engine;
- public $_list_ = Array(
- "prot" => Array( "string" => "3" , "int" => Null , "float" => Null ) ,
- "unique" => Array( "string" => "-1" , "int" => Null , "float" => Null ) ,
- "raw" => Array( "string" => "steam" , "int" => Null , "float" => Null ) ,
- "cdkey" => Array( "string" => "gqrgoiugerg5487hfgddjfgjfgj4tyru" , "int" => Null , "float" => Null ) ,
- "prot" => Array( "string" => "3" , "int" => Null , "float" => Null ) ,
- );
- public $cvar = Array( "_cl_autowepswitch" , "bottomcolor" , "cl_dlmax" , "cl_lc" , "cl_lw" , "cl_updaterate" , "cl_cmdrate" , "model" , "name" , "topcolor" , "rate" );
- // $hexSTRING .= "connect 48 ".$unicalID." \"\prot\\3\unique\-1\\raw\steam\cdkey\gqrgoiugerg5487hfgddjfgjfgj4tyru\"
- // \"\_cl_autowepswitch\\1\bottomcolor\\6\cl_dlmax\\128\cl_lc\\1\cl_lw\\1\cl_updaterate\\20\model\gordon\\name\\".$nick ."\\topcolor\\30\\rate\\1000\"";
- public function get( $name ) {
- if ( getType( $name ) === "string" ) {
- $name = strtolower( $name );
- return empty( $this -> _list_[$name] ) ? false : $this -> _list_[$name];
- }
- return false;
- }
- public function check( $name ) {
- $name = strtolower( $name );
- return empty( $this -> _list_[$name] ) ? false : true;
- }
- public function add( $name , $val ) {
- $name = strtolower( $name );
- if ( empty( $this -> _list_[$name] ) ){
- $this -> _list_[$name] = Array(
- "string" => ( (string) $val ) ,
- "int" => ( (float) $val ) ,
- "float" => ( (float) $val )
- );
- return true;
- } else
- return false;
- }
- public function remove( $name ) {
- $name = strtolower( $name );
- if ( empty( $this -> _list_[$name] ) ){
- unset( $this -> _list_[$name] );
- return true;
- } else
- return false;
- }
- public function set( $name , $val ) {
- $name = strtolower( $name );
- $this -> _list_[$name] = Array(
- "string" => ( (string) $val ) ,
- "int" => ( (float) $val ) ,
- "float" => ( (float) $val )
- );
- return true;
- }
- public function addCVAR( $name ) {
- $name = strtolower( $name );
- foreach ( $this->cvar as &$val )
- if ( $val === $name )
- return true;
- $this->cvar[] = $name;
- return true;
- }
- public function removeCVAR( $name ) {
- $name = strtolower( $name );
- foreach ( $this->cvar as $i => &$val )
- if ( $val === $name ) {
- unset($this->cvar[$i]);
- return true;
- }
- return false;
- }
- public function release() {
- foreach( $this -> _list_ as &$val ) {
- $val["int"] = ( (int) $val["string"] );
- $val["float"] = ( (float) $val["string"] );
- }
- }
- public function __construct() {
- $this -> release();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class CLIENT_CVAR_LIST {
- public $_list_ = Array(
- "_cl_autowepswitch" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "_snd_mixahead" => Array( "string" => "0.100" , "int" => Null , "float" => Null ) ,
- "ambient_fade" => Array( "string" => "100" , "int" => Null , "float" => Null ) ,
- "ambient_level" => Array( "string" => "0.300" , "int" => Null , "float" => Null ) ,
- "ati_npatch" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "bannedcfgfile" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "bgmvolume" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "bottomcolor" => Array( "string" => "6" , "int" => Null , "float" => Null ) ,
- "brightness" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "c_maxdistance" => Array( "string" => "200" , "int" => Null , "float" => Null ) ,
- "c_maxpitch" => Array( "string" => "90" , "int" => Null , "float" => Null ) ,
- "c_maxyaw" => Array( "string" => "135" , "int" => Null , "float" => Null ) ,
- "c_mindistance" => Array( "string" => "30" , "int" => Null , "float" => Null ) ,
- "c_minpitch" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "c_minyaw" => Array( "string" => "-135" , "int" => Null , "float" => Null ) ,
- "cam_command" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cam_idealdist" => Array( "string" => "64" , "int" => Null , "float" => Null ) ,
- "cam_idealpitch" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cam_idealyaw" => Array( "string" => "90" , "int" => Null , "float" => Null ) ,
- "cam_snapto" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "chase_active" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "chase_back" => Array( "string" => "100" , "int" => Null , "float" => Null ) ,
- "chase_right" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "chase_up" => Array( "string" => "16" , "int" => Null , "float" => Null ) ,
- "cl_allowdownload" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_allowupload" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_anglespeedkey" => Array( "string" => "0.670" , "int" => Null , "float" => Null ) ,
- "cl_backspeed" => Array( "string" => "400" , "int" => Null , "float" => Null ) ,
- "cl_bob" => Array( "string" => "0.010" , "int" => Null , "float" => Null ) ,
- "cl_bobcycle" => Array( "string" => "0.800" , "int" => Null , "float" => Null ) ,
- "cl_bobup" => Array( "string" => "0.500" , "int" => Null , "float" => Null ) ,
- "cl_chasedist" => Array( "string" => "112" , "int" => Null , "float" => Null ) ,
- "cl_clockreset" => Array( "string" => "0.100" , "int" => Null , "float" => Null ) ,
- "cl_cmdbackup" => Array( "string" => "2" , "int" => Null , "float" => Null ) ,
- "cl_cmdrate" => Array( "string" => "60" , "int" => Null , "float" => Null ) ,
- "cl_corpsestay" => Array( "string" => "600" , "int" => Null , "float" => Null ) ,
- "cl_crosshair_color" => Array( "string" => "50" , "int" => Null , "float" => Null ) ,
- "cl_crosshair_size" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_crosshair_translucent" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_dlmax" => Array( "string" => "80" , "int" => Null , "float" => Null ) ,
- "cl_download_ingame" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_dynamiccrosshair" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_filterstuffcmd" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_fixtimerate" => Array( "string" => "7.500" , "int" => Null , "float" => Null ) ,
- "cl_forwardspeed" => Array( "string" => "400" , "int" => Null , "float" => Null ) ,
- "cl_gaitestimation" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_gg" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_himodels" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_idealpitchscale" => Array( "string" => "0.800" , "int" => Null , "float" => Null ) ,
- "cl_lc" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_logocolor" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_logofile" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_lw" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_min_ct" => Array( "string" => "2" , "int" => Null , "float" => Null ) ,
- "cl_min_t" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_minmodels" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_mousegrab" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_movespeedkey" => Array( "string" => "0.520" , "int" => Null , "float" => Null ) ,
- "cl_needinstanced" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_nosmooth" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_observercrosshair" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_pitchdown" => Array( "string" => "89" , "int" => Null , "float" => Null ) ,
- "cl_pitchspeed" => Array( "string" => "225" , "int" => Null , "float" => Null ) ,
- "cl_pitchup" => Array( "string" => "89" , "int" => Null , "float" => Null ) ,
- "cl_pmanstats" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_radartype" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_resend" => Array( "string" => "6" , "int" => Null , "float" => Null ) ,
- "cl_righthand" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_shadows" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_showerror" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_showevents" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_showfps" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_showmessages" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_shownet" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_sidespeed" => Array( "string" => "400" , "int" => Null , "float" => Null ) ,
- "cl_slist" => Array( "string" => "10" , "int" => Null , "float" => Null ) ,
- "cl_smoothtime" => Array( "string" => "0.100" , "int" => Null , "float" => Null ) ,
- "cl_solid_players" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_timeout" => Array( "string" => "60" , "int" => Null , "float" => Null ) ,
- "cl_updaterate" => Array( "string" => "60" , "int" => Null , "float" => Null ) ,
- "cl_upspeed" => Array( "string" => "320" , "int" => Null , "float" => Null ) ,
- "cl_vsmoothing" => Array( "string" => "0.050" , "int" => Null , "float" => Null ) ,
- "cl_waterdist" => Array( "string" => "4" , "int" => Null , "float" => Null ) ,
- "cl_weaponlistfix" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "cl_weather" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "cl_yawspeed" => Array( "string" => "210" , "int" => Null , "float" => Null ) ,
- "clientport" => Array( "string" => "27005" , "int" => Null , "float" => Null ) ,
- "clockwindow" => Array( "string" => "0.500" , "int" => Null , "float" => Null ) ,
- "con_color" => Array( "string" => "255" , "int" => Null , "float" => Null ) ,
- "con_fastmode" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "con_mono" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "con_notifytime" => Array( "string" => "4" , "int" => Null , "float" => Null ) ,
- "con_shifttoggleconsole" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "console" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "coop" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "crosshair" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "d_spriteskip" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "deathmatch" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "default_fov" => Array( "string" => "90" , "int" => Null , "float" => Null ) ,
- "dev_overview" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "developer" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "direct" => Array( "string" => "0.900" , "int" => Null , "float" => Null ) ,
- "edgefriction" => Array( "string" => "2" , "int" => Null , "float" => Null ) ,
- "ex_interp" => Array( "string" => "0.100" , "int" => Null , "float" => Null ) ,
- "fakelag" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "fakeloss" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "fastsprites" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "fps_max" => Array( "string" => "101" , "int" => Null , "float" => Null ) ,
- "fps_override" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "fs_lazy_precache" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "fs_perf_warnings" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "fs_precache_timings" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "fs_startup_timings" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "gamma" => Array( "string" => "2.500" , "int" => Null , "float" => Null ) ,
- "gl_affinemodels" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "gl_alphamin" => Array( "string" => "0.250" , "int" => Null , "float" => Null ) ,
- "gl_ansio" => Array( "string" => "16" , "int" => Null , "float" => Null ) ,
- "gl_clear" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "gl_cull" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "gl_dither" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "gl_flipmatrix" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "gl_fog" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "gl_keeptjunctions" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "gl_lightholes" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "gl_max_size" => Array( "string" => "512" , "int" => Null , "float" => Null ) ,
- "gl_monolights" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "gl_overbright" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "gl_palette_tex" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "gl_picmip" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "gl_polyoffset" => Array( "string" => "0.100" , "int" => Null , "float" => Null ) ,
- "gl_round_down" => Array( "string" => "3" , "int" => Null , "float" => Null ) ,
- "gl_spriteblend" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "gl_vsync" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "gl_wateramp" => Array( "string" => "0.300" , "int" => Null , "float" => Null ) ,
- "gl_wireframe" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "gl_zmax" => Array( "string" => "4096" , "int" => Null , "float" => Null ) ,
- "gl_ztrick_old" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "graphheight" => Array( "string" => "64" , "int" => Null , "float" => Null ) ,
- "hisound" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "host_framerate" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "host_killtime" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "host_limitlocal" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "host_profile" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "host_speeds" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "HostMap" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "hostname" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "hostport" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "hpk_maxsize" => Array( "string" => "4" , "int" => Null , "float" => Null ) ,
- "hud_capturemouse" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "hud_centerid" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "hud_deathnotice_time" => Array( "string" => "6" , "int" => Null , "float" => Null ) ,
- "hud_draw" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "hud_drawhistory_time" => Array( "string" => "5" , "int" => Null , "float" => Null ) ,
- "hud_fastswitch" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "hud_saytext_internal" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "hud_saytext_time" => Array( "string" => "5" , "int" => Null , "float" => Null ) ,
- "hud_takesshots" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "ip" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "ip_clientport" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "ip_hostport" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "ipx_clientport" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "ipx_hostport" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "joyadvanced" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "joyadvaxisr" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "joyadvaxisu" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "joyadvaxisv" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "joyadvaxisx" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "joyadvaxisy" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "joyadvaxisz" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "joyforwardsensitivity" => Array( "string" => "-1" , "int" => Null , "float" => Null ) ,
- "joyforwardthreshold" => Array( "string" => "0.150" , "int" => Null , "float" => Null ) ,
- "joyname" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "joypitchsensitivity" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "joypitchthreshold" => Array( "string" => "0.150" , "int" => Null , "float" => Null ) ,
- "joysidesensitivity" => Array( "string" => "-1" , "int" => Null , "float" => Null ) ,
- "joysidethreshold" => Array( "string" => "0.150" , "int" => Null , "float" => Null ) ,
- "joystick" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "joywwhack1" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "joywwhack2" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "joyyawsensitivity" => Array( "string" => "-1" , "int" => Null , "float" => Null ) ,
- "joyyawthreshold" => Array( "string" => "0.150" , "int" => Null , "float" => Null ) ,
- "lambert" => Array( "string" => "1.500" , "int" => Null , "float" => Null ) ,
- "lightgamma" => Array( "string" => "2.500" , "int" => Null , "float" => Null ) ,
- "loadas8bit" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "logsdir" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "lookspring" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "lookstrafe" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "lservercfgfile" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "m_customaccel" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "m_customaccel_exponent" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "m_customaccel_max" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "m_customaccel_scale" => Array( "string" => "0.040" , "int" => Null , "float" => Null ) ,
- "m_filter" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "m_forward" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "m_mousethread_sleep" => Array( "string" => "10" , "int" => Null , "float" => Null ) ,
- "m_pitch" => Array( "string" => "0.022" , "int" => Null , "float" => Null ) ,
- "m_rawinput" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "m_side" => Array( "string" => "0.800" , "int" => Null , "float" => Null ) ,
- "m_yaw" => Array( "string" => "0.022" , "int" => Null , "float" => Null ) ,
- "mapchangecfgfile" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "mapcyclefile" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "max_queries_sec" => Array( "string" => "3" , "int" => Null , "float" => Null ) ,
- "max_queries_sec_global" => Array( "string" => "30" , "int" => Null , "float" => Null ) ,
- "max_queries_window" => Array( "string" => "60" , "int" => Null , "float" => Null ) ,
- "max_shells" => Array( "string" => "120" , "int" => Null , "float" => Null ) ,
- "max_smokepuffs" => Array( "string" => "120" , "int" => Null , "float" => Null ) ,
- "model" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "motdfile" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "MP3FadeTime" => Array( "string" => "2" , "int" => Null , "float" => Null ) ,
- "MP3Volume" => Array( "string" => "0.800" , "int" => Null , "float" => Null ) ,
- "mp_consistency" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "mp_decals" => Array( "string" => "300" , "int" => Null , "float" => Null ) ,
- "mp_footsteps" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "mp_logecho" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "mp_logfile" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "multicastport" => Array( "string" => "27025" , "int" => Null , "float" => Null ) ,
- "name" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "net_address" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "net_chokeloop" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "net_drawslider" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "net_graph" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "net_graphpos" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "net_graphwidth" => Array( "string" => "150" , "int" => Null , "float" => Null ) ,
- "net_log" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "net_scale" => Array( "string" => "5" , "int" => Null , "float" => Null ) ,
- "net_showdrop" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "net_showpackets" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "nosound" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "password" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "pausable" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "port" => Array( "string" => "27015" , "int" => Null , "float" => Null ) ,
- "r_bmodelinterp" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "r_cachestudio" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "r_cullsequencebox" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "r_decals" => Array( "string" => "4096" , "int" => Null , "float" => Null ) ,
- "r_detailtextures" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "r_detailtexturessupported" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "r_drawentities" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "r_drawviewmodel" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "r_dynamic" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "r_fullbright" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "r_glowshellfreq" => Array( "string" => "2.200" , "int" => Null , "float" => Null ) ,
- "r_lightmap" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "r_mirroralpha" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "r_mmx" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "r_norefresh" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "r_novis" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "r_speeds" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "r_traceglow" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "r_wadtextures" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "r_wateralpha" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "rate" => Array( "string" => "25000" , "int" => Null , "float" => Null ) ,
- "rcon_address" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "rcon_password" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "rcon_port" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "room_delay" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "room_dlylp" => Array( "string" => "2" , "int" => Null , "float" => Null ) ,
- "room_feedback" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "room_left" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "room_lp" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "room_mod" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "room_off" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "room_refl" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "room_rvblp" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "room_size" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "room_type" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "s_show" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "scr_centertime" => Array( "string" => "2" , "int" => Null , "float" => Null ) ,
- "scr_connectmsg" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "scr_connectmsg1" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "scr_connectmsg2" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "scr_ofsx" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "scr_ofsy" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "scr_ofsz" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "scr_printspeed" => Array( "string" => "8" , "int" => Null , "float" => Null ) ,
- "sdl_double_click_size" => Array( "string" => "2" , "int" => Null , "float" => Null ) ,
- "sdl_double_click_time" => Array( "string" => "400" , "int" => Null , "float" => Null ) ,
- "sensitivity" => Array( "string" => "3" , "int" => Null , "float" => Null ) ,
- "servercfgfile" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "showpause" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "skill" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "skin" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "snd_noextraupdate" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "snd_show" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "speak_enabled" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "spec_autodirector_internal" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "spec_drawcone_internal" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "spec_drawnames_internal" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "spec_drawstatus_internal" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "spec_mode_internal" => Array( "string" => "4" , "int" => Null , "float" => Null ) ,
- "spec_pip" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "spec_scoreboard" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "suitvolume" => Array( "string" => "0.250" , "int" => Null , "float" => Null ) ,
- "sv_accelerate" => Array( "string" => "10" , "int" => Null , "float" => Null ) ,
- "sv_aim" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_airaccelerate" => Array( "string" => "10" , "int" => Null , "float" => Null ) ,
- "sv_allow_dlfile" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_allowdownload" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_allowupload" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_bounce" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_cheats" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_clienttrace" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_contact" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_downloadurl" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_enableoldqueries" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_failuretime" => Array( "string" => "0.500" , "int" => Null , "float" => Null ) ,
- "sv_filetransfercompression" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_filetransfermaxsize" => Array( "string" => "10485760" , "int" => Null , "float" => Null ) ,
- "sv_filterban" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_friction" => Array( "string" => "4" , "int" => Null , "float" => Null ) ,
- "sv_gravity" => Array( "string" => "800" , "int" => Null , "float" => Null ) ,
- "sv_instancedbaseline" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_lan" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_lan_rate" => Array( "string" => "20000" , "int" => Null , "float" => Null ) ,
- "sv_log_onefile" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_log_singleplayer" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_logbans" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_logblocks" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_logrelay" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_logsecret" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_maxrate" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_maxspeed" => Array( "string" => "320" , "int" => Null , "float" => Null ) ,
- "sv_maxunlag" => Array( "string" => "0.500" , "int" => Null , "float" => Null ) ,
- "sv_maxupdaterate" => Array( "string" => "30" , "int" => Null , "float" => Null ) ,
- "sv_maxvelocity" => Array( "string" => "2000" , "int" => Null , "float" => Null ) ,
- "sv_minrate" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_minupdaterate" => Array( "string" => "10" , "int" => Null , "float" => Null ) ,
- "sv_newunit" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_outofdatetime" => Array( "string" => "1800" , "int" => Null , "float" => Null ) ,
- "sv_password" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_proxies" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_rcon_banpenalty" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_rcon_maxfailures" => Array( "string" => "10" , "int" => Null , "float" => Null ) ,
- "sv_rcon_minfailures" => Array( "string" => "5" , "int" => Null , "float" => Null ) ,
- "sv_rcon_minfailuretime" => Array( "string" => "30" , "int" => Null , "float" => Null ) ,
- "sv_send_logos" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_send_resources" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_skycolor_b" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_skycolor_g" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_skycolor_r" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_skyname" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_skyvec_x" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_skyvec_y" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_skyvec_z" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_spectatormaxspeed" => Array( "string" => "500" , "int" => Null , "float" => Null ) ,
- "sv_stats" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_stepsize" => Array( "string" => "18" , "int" => Null , "float" => Null ) ,
- "sv_stopspeed" => Array( "string" => "100" , "int" => Null , "float" => Null ) ,
- "sv_timeout" => Array( "string" => "60" , "int" => Null , "float" => Null ) ,
- "sv_unlag" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_unlagpush" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_unlagsamples" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_uploadmax" => Array( "string" => "0.500" , "int" => Null , "float" => Null ) ,
- "sv_version" => Array( "string" => "112.700" , "int" => Null , "float" => Null ) ,
- "sv_visiblemaxplayers" => Array( "string" => "-1" , "int" => Null , "float" => Null ) ,
- "sv_voiceenable" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_wateraccelerate" => Array( "string" => "10" , "int" => Null , "float" => Null ) ,
- "sv_wateramp" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "sv_waterfriction" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "sv_zmax" => Array( "string" => "4096" , "int" => Null , "float" => Null ) ,
- "sys_ticrate" => Array( "string" => "100" , "int" => Null , "float" => Null ) ,
- "team" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "texgamma" => Array( "string" => "2" , "int" => Null , "float" => Null ) ,
- "topcolor" => Array( "string" => "30" , "int" => Null , "float" => Null ) ,
- "traceralpha" => Array( "string" => "0.500" , "int" => Null , "float" => Null ) ,
- "tracerblue" => Array( "string" => "0.400" , "int" => Null , "float" => Null ) ,
- "tracergreen" => Array( "string" => "0.800" , "int" => Null , "float" => Null ) ,
- "tracerlength" => Array( "string" => "0.800" , "int" => Null , "float" => Null ) ,
- "traceroffset" => Array( "string" => "30" , "int" => Null , "float" => Null ) ,
- "tracerred" => Array( "string" => "0.800" , "int" => Null , "float" => Null ) ,
- "tracerspeed" => Array( "string" => "6000" , "int" => Null , "float" => Null ) ,
- "v_centermove" => Array( "string" => "0.150" , "int" => Null , "float" => Null ) ,
- "v_centerspeed" => Array( "string" => "500" , "int" => Null , "float" => Null ) ,
- "v_dark" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "viewsize" => Array( "string" => "120" , "int" => Null , "float" => Null ) ,
- "violence_ablood" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "violence_agibs" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "violence_hblood" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "violence_hgibs" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "voice_avggain" => Array( "string" => "0.500" , "int" => Null , "float" => Null ) ,
- "voice_clientdebug" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "voice_dsound" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "voice_enable" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "voice_fadeouttime" => Array( "string" => "0.100" , "int" => Null , "float" => Null ) ,
- "voice_forcemicrecord" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "voice_inputfromfile" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "voice_loopback" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "voice_maxgain" => Array( "string" => "5" , "int" => Null , "float" => Null ) ,
- "voice_modenable" => Array( "string" => "1" , "int" => Null , "float" => Null ) ,
- "voice_overdrive" => Array( "string" => "2" , "int" => Null , "float" => Null ) ,
- "voice_overdrivefadetime" => Array( "string" => "0.400" , "int" => Null , "float" => Null ) ,
- "voice_profile" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "voice_recordtofile" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "voice_scale" => Array( "string" => "0.750" , "int" => Null , "float" => Null ) ,
- "voice_showchannels" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "voice_showincoming" => Array( "string" => "0" , "int" => Null , "float" => Null ) ,
- "volume" => Array( "string" => "0.800" , "int" => Null , "float" => Null ) ,
- "waterroom_type" => Array( "string" => "14" , "int" => Null , "float" => Null ) ,
- "zoom_sensitivity_ratio" => Array( "string" => "1.200" , "int" => Null , "float" => Null ) ,
- );
- public $engine;
- public function getCVAR( $name ) {
- if ( getType( $name ) === "string" ) {
- $name = strtolower( $name );
- return empty( $this -> _list_[$name] ) ? false : $this -> _list_[$name];
- }
- return false;
- }
- public function checkCVAR( $name ) {
- $name = strtolower( $name );
- return empty( $this -> _list_[$name] ) ? false : true;
- }
- public function addCVAR( $name , $val ) {
- $name = strtolower( $name );
- if ( empty( $this -> _list_[$name] ) ){
- $this -> _list_[$name] = Array(
- "string" => ( (string) $val ) ,
- "int" => ( (float) $val ) ,
- "float" => ( (float) $val )
- );
- return true;
- } else
- return false;
- }
- public function removeCVAR( $name ) {
- $name = strtolower( $name );
- if ( empty( $this -> _list_[$name] ) ){
- unset( $this -> _list_[$name] );
- return true;
- } else
- return false;
- }
- public function setCVAR( $name , $val ) {
- $name = strtolower( $name );
- $this -> _list_[$name] = Array(
- "string" => ( (string) $val ) ,
- "int" => ( (float) $val ) ,
- "float" => ( (float) $val )
- );
- return true;
- }
- public function releaseCVAR() {
- foreach( $this -> _list_ as &$val ) {
- $val["int"] = ( (int) $val["string"] );
- $val["float"] = ( (float) $val["string"] );
- }
- }
- public function __construct() {
- $this -> releaseCVAR();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class CLIENT_CMD_LIST {
- public $_list_ = Array(
- "appenddemo" => Null ,
- "cl_messages" => Null ,
- "commentator" => Null ,
- "connect" => "connect" ,
- "disconnect" => "disconnect" ,
- "endmovie" => Null ,
- "entities" => Null ,
- "fullserverinfo" => Null ,
- "gamedir" => Null ,
- "gg" => Null ,
- "httpstop" => Null ,
- "list" => Null ,
- "listdemo" => Null ,
- "listen" => Null ,
- "pingservers" => Null ,
- "playdemo" => Null ,
- "rcon" => Null ,
- "record" => Null ,
- "removedemo" => Null ,
- "retry" => Null ,
- "setdemoinfo" => Null ,
- "slist" => Null ,
- "snapshot" => Null ,
- "spec_pos" => Null ,
- "startmovie" => Null ,
- "stop" => Null ,
- "swapdemo" => Null ,
- "timedemo" => Null ,
- "upload" => Null ,
- "viewdemo" => Null ,
- "voice_showbanned" => Null ,
- "spec_autodirecto" => Null ,
- "spec_drawstatus" => Null ,
- "spec_drawcone" => Null ,
- "spec_drawnames" => Null ,
- "togglescores" => Null ,
- "spec_menu" => Null ,
- "spec_help" => Null ,
- "spec_decal" => Null ,
- "spec_toggleinset" => Null ,
- "spec_mode" => Null ,
- "hud_saytext" => Null ,
- "hideradar" => Null ,
- "drawradar" => Null ,
- "clearplayers" => Null ,
- "trackplayer" => Null ,
- "adjust_crosshair" => Null ,
- "invprev" => Null ,
- "invnext" => Null ,
- "cancelselect" => Null ,
- "slot10" => Null ,
- "slot9" => Null ,
- "slot8" => Null ,
- "slot7" => Null ,
- "slot6" => Null ,
- "slot5" => Null ,
- "slot4" => Null ,
- "slot3" => Null ,
- "slot2" => Null ,
- "slot1" => Null ,
- "-nvgadjust" => Null ,
- "+nvgadjust" => Null ,
- "buy" => Null ,
- "rebuy" => Null ,
- "autobuy" => Null ,
- "gunsmoke" => Null ,
- "-commandmenu" => Null ,
- "+commandmenu" => Null ,
- "joyadvancedupdat" => Null ,
- "force_centerview" => Null ,
- "snapto" => Null ,
- "-camdistance" => Null ,
- "+camdistance" => Null ,
- "-cammousemove" => Null ,
- "+cammousemove" => Null ,
- "firstperson" => Null ,
- "thirdperson" => Null ,
- "-camout" => Null ,
- "+camout" => Null ,
- "-camin" => Null ,
- "+camin" => Null ,
- "-camyawright" => Null ,
- "+camyawright" => Null ,
- "-camyawleft" => Null ,
- "+camyawleft" => Null ,
- "-campitchdown" => Null ,
- "+campitchdown" => Null ,
- "-campitchup" => Null ,
- "+campitchup" => Null ,
- "-break" => Null ,
- "+break" => Null ,
- "-graph" => Null ,
- "+graph" => Null ,
- "-showscores" => Null ,
- "+showscores" => Null ,
- "-score" => Null ,
- "+score" => Null ,
- "-alt1" => Null ,
- "+alt1" => Null ,
- "-reload" => Null ,
- "+reload" => Null ,
- "-duck" => Null ,
- "+duck" => Null ,
- "-jlook" => Null ,
- "+jlook" => Null ,
- "-mlook" => Null ,
- "+mlook" => Null ,
- "-klook" => Null ,
- "+klook" => Null ,
- "impulse" => Null ,
- "-jump" => Null ,
- "+jump" => Null ,
- "-use" => Null ,
- "+use" => Null ,
- "-attack2" => Null ,
- "+attack2" => Null ,
- "-attack" => Null ,
- "+attack" => Null ,
- "-speed" => Null ,
- "+speed" => Null ,
- "-moveright" => Null ,
- "+moveright" => Null ,
- "-moveleft" => Null ,
- "+moveleft" => Null ,
- "-strafe" => Null ,
- "+strafe" => Null ,
- "-lookdown" => Null ,
- "+lookdown" => Null ,
- "-lookup" => Null ,
- "+lookup" => Null ,
- "-back" => Null ,
- "+back" => Null ,
- "-forward" => Null ,
- "+forward" => Null ,
- "-right" => Null ,
- "+right" => Null ,
- "-left" => Null ,
- "+left" => Null ,
- "-movedown" => Null ,
- "+movedown" => Null ,
- "-moveup" => Null ,
- "+moveup" => Null ,
- "dem_save" => Null ,
- "dem_start" => Null ,
- "dem_speed" => Null ,
- "dem_pause" => Null ,
- "dem_forcehltv" => Null ,
- "dem_jump" => Null ,
- "condump" => Null ,
- "+voicerecord" => Null ,
- "-voicerecord" => Null ,
- "_careeraudio" => Null ,
- "_restart" => Null ,
- "_set_vid_level" => Null ,
- "_setaddons_folde" => Null ,
- "_setgamedir" => Null ,
- "_sethdmodels" => Null ,
- "_setrenderer" => Null ,
- "_setvideomode" => Null ,
- "addip" => Null ,
- "alias" => Null ,
- "autosave" => Null ,
- "banid" => Null ,
- "bind" => Null ,
- "career" => Null ,
- "cd" => Null ,
- "changelevel" => Null ,
- "changelevel2" => Null ,
- "clear" => Null ,
- "cmd" => Null ,
- "cmdlist" => Null ,
- "condebug" => Null ,
- "contimes" => Null ,
- "cvarlist" => Null ,
- "delta_clear" => Null ,
- "delta_stats" => Null ,
- "demos" => Null ,
- "dlfile" => Null ,
- "dropclient" => Null ,
- "echo" => "echo" ,
- "envmap" => Null ,
- "escape" => Null ,
- "exec" => Null ,
- "exit" => Null ,
- "flush" => Null ,
- "fly" => Null ,
- "fullinfo" => Null ,
- "fullupdate" => Null ,
- "gl_dump" => Null ,
- "gl_texels" => Null ,
- "gl_texturemode" => Null ,
- "god" => Null ,
- "heartbeat" => Null ,
- "hideconsole" => Null ,
- "hpkextract" => Null ,
- "hpklist" => Null ,
- "hpkremove" => Null ,
- "hpkval" => Null ,
- "interp" => Null ,
- "kick" => Null ,
- "kill" => Null ,
- "listid" => Null ,
- "listip" => Null ,
- "load" => Null ,
- "localinfo" => Null ,
- "log" => Null ,
- "logaddress" => Null ,
- "logaddress_add" => Null ,
- "logaddress_del" => Null ,
- "map" => Null ,
- "maps" => Null ,
- "maxplayers" => Null ,
- "mcache" => Null ,
- "messagemode" => Null ,
- "messagemode2" => Null ,
- "motd" => Null ,
- "motd_write" => Null ,
- "mp3" => Null ,
- "new" => Null ,
- "noclip" => Null ,
- "notarget" => Null ,
- "pause" => Null ,
- "ping" => Null ,
- "play" => Null ,
- "playvol" => Null ,
- "pointfile" => Null ,
- "quit" => Null ,
- "reconnect" => Null ,
- "reload" => Null ,
- "removeid" => Null ,
- "removeip" => Null ,
- "resetrcon" => Null ,
- "restart" => Null ,
- "save" => Null ,
- "say" => "say" ,
- "say_team" => Null ,
- "screenshot" => Null ,
- "sendents" => Null ,
- "sendres" => Null ,
- "serverinfo" => Null ,
- "setinfo" => "setinfo" ,
- "setmaster" => Null ,
- "setpause" => Null ,
- "showinfo" => Null ,
- "shutdownserver" => Null ,
- "sizedown" => Null ,
- "sizeup" => Null ,
- "soundfade" => Null ,
- "soundinfo" => Null ,
- "soundlist" => Null ,
- "spawn" => Null ,
- "speak" => Null ,
- "spk" => Null ,
- "startdemos" => Null ,
- "stat" => Null ,
- "stats" => Null ,
- "status" => Null ,
- "stopdemo" => Null ,
- "stopsound" => Null ,
- "stuffcmds" => Null ,
- "tell" => Null ,
- "timerefresh" => Null ,
- "toggleconsole" => Null ,
- "unbind" => Null ,
- "unbindall" => Null ,
- "unpause" => Null ,
- "user" => Null ,
- "users" => Null ,
- "version" => Null ,
- "viewframe" => Null ,
- "viewmodel" => Null ,
- "viewnext" => Null ,
- "viewprev" => Null ,
- "wait" => Null ,
- "waveplaylen" => Null ,
- "writecfg" => Null ,
- "writeid" => Null ,
- "writeip" => Null ,
- );
- public function getCMD( $name ) {
- $name = strtolower( $name );
- return ( empty( $this->_list_[$name] ) ? false : $this->_list_[$name] );
- }
- public function checkCMD( $name ) {
- $name = strtolower( $name );
- return ( empty( $this->_list_[$name] ) ? false : true );
- }
- public function addCMD( $name , $val ) {
- $name = strtolower( $name );
- if ( empty( $this->_list_[$name] ) ) {
- $this->_list_[$name] = $val;
- return true;
- } else
- return false;
- }
- public function removeCMD( $name ) {
- $name = strtolower( $name );
- if ( empty( $this->_list_[$name] ) ) {
- unset( $this->_list_[$name] );
- return true;
- } else
- return false;
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class GET_USER_INFO {
- public $engine;
- public $userinfolist;
- public $cvarlist;
- public function getUserInfoString( $id ) {
- $user_info_1 = "\"";
- $user_info_2 = "\"";
- $protocol = "connect " . $this -> engine -> cl -> protocol . " " . $id;
- foreach ( $this -> userinfolist -> _list_ as $name => &$val ) {
- $user_info_1 .= "\\" . $name . "\\" . $val["string"];
- }
- $user_info_1 .= "\"";
- foreach ( $this -> userinfolist -> cvar as &$name ) {
- $cmd = $this -> cvarlist -> getCVAR( $name );
- if ( $cmd )
- $user_info_2 .= "\\" . $name . "\\" . $cmd["string"];
- }
- $user_info_2 .= "\"";
- return $protocol . " " . $user_info_1 . " " . $user_info_2 . "\x0A";
- }
- public function __construct() {
- global $engine;
- $this -> engine = $engine;
- $this -> userinfolist = CLIENT_USER_INFO_LIST::getCL();
- $this -> cvarlist = CLIENT_CVAR_LIST::getCL();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class TEXECUTE {
- public $engine;
- public function execute( $name , $opitons = Null ) {
- if ( !( gettype( $name ) === "string" ) )
- return false;
- if ( ( $opitons ) && ( gettype( $opitons ) === "string" ) )
- $opitons = Array( $opitons );
- $name = strtolower( $name );
- $name = "exe_" . $name;
- if ( method_exists ( $this , $name ) ) {
- if ( $opitons === Null )
- $this -> {$name}();
- else
- $this -> {$name}($opitons);
- return true;
- } else
- return false;
- }
- public function __construct() {
- global $engine;
- $this -> engine = $engine;
- }
- }
- class CLIENT_CMD_FUNCTIONS extends TEXECUTE {
- public function exe_setinfo() {
- if ( $this -> engine -> Cmd_Argc < 2 )
- return false;
- $cvar = $this -> engine -> Cvar_Get( $this -> engine -> Cmd_Argv[1] );
- if ( !$cvar )
- $this -> engine -> cvarlist -> addCVAR( $this -> engine -> Cmd_Argv[1] , $this -> engine -> Cmd_Argv[2] );
- else
- $this -> engine -> Cvar_Set( $this -> engine -> Cmd_Argv[1] , $this -> engine -> Cmd_Argv[2] );
- $this -> engine -> userinfolist -> addCVAR( $this -> engine -> Cmd_Argv[1] );
- }
- public function exe_echo() {
- if ( $this -> engine -> Cmd_Argc < 1 )
- return false;
- $text = "";
- for( $i = 1; $i < $this -> engine -> Cmd_Argc; $i++ )
- $text .= $this -> engine -> Cmd_Argv[$i] . " ";
- $this -> engine -> console -> print_str( $text );
- }
- public function exe_say() {
- $this -> engine -> clc -> execute( "STRINGCMD" , $this -> engine -> Cmd_Args );
- }
- public function exe_connect() {
- if ( $this -> engine -> server -> set( preg_replace( "/\s*connect\s*/si" , "" , $this -> engine -> Cmd_Args ) ) ) {
- $this -> engine -> net -> connect();
- return true;
- } else
- return false;
- }
- public function exe_disconnect() {
- $this -> engine -> net -> disconnect();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class CLIENT_CLC_FUNCTIONS extends TEXECUTE {
- private $clc;
- private $net;
- public function exe_stringcmd( $opitons ) {
- $cmdString = $this -> clc -> writeCMD( "STRINGCMD" , $opitons );
- $this -> net -> add( $cmdString );
- }
- public function exe_resourcelist( $options ) {
- $cmdString = $this -> clc -> writeCMD( "RESOURCELIST" , $options );
- $this -> net -> add( $cmdString );
- }
- public function exe_voicedata( $opitons ) {
- $cmdString = $this -> clc -> writeCMD( "VOICEDATA" , $opitons );
- $this -> net -> add( $cmdString );
- }
- public function exe_requestcvarvalue( $opitons ) {
- $cmdString = $this -> clc -> writeCMD( "REQUESTCVARVALUE" , $opitons );
- $this -> net -> add( $cmdString );
- }
- public function exe_requestcvarvalue2( $opitons ) {
- $cmdString = $this -> clc -> writeCMD( "REQUESTCVARVALUE2" , $opitons );
- //echo COM::showHtmlContent($cmdString)."\n";
- $this -> net -> add( $cmdString );
- }
- public function __construct() {
- $this -> clc = CLC_CMD::getCL();
- $this -> net = NET::getCL();
- parent::__construct();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class CLIENT_SVC_FUNCTIONS_old extends TEXECUTE {
- public function exe_bad() {
- $this -> engine -> console -> print_str( "SERVER send BAD command" );
- }
- public function exe_nop() {
- }
- public function exe_stufftext( $options ) {
- if ( !( gettype($options) === "string" ) )
- $options = $options[0];
- echo "SVC_STUFFTEXT " . $options ."\n";
- $this -> engine -> CBuf_AddText( $options , "svc_stufftext" );
- }
- public function exe_print( $options ) {
- if ( !( gettype($options) === "string" ) )
- $options = $options[0];
- $this -> engine -> console -> print_str( $options );
- }
- public function exe_sendcvarvalue( $options ) {
- if ( empty( $options[0] ) )
- return false;
- $name = $options[0];
- $cvar = $this -> engine -> Cvar_Get( $name );
- if ( !$cmd )
- return false;
- $cvar = $cvar["string"];
- $this -> engine -> clc -> execute( "REQUESTCVARVALUE" , Array( $cvar ) );
- }
- public function exe_sendcvarvalue2( $options ) {
- if ( empty( $options[1] ) )
- return false;
- $request_id = $options[0];
- $name = $options[1];
- $cvar = $this -> engine -> Cvar_Get( $name );
- if ( !$cvar )
- return false;
- $cvar = $cvar["string"];
- echo "SVC_SENDCVARVALUE2 " . $name ."\n";
- $this -> engine -> clc -> execute( "REQUESTCVARVALUE2" , Array( $request_id , $name , $cvar ) );
- }
- public function exe_disconnect( $options ) {
- if ( !( gettype($options) === "string" ) )
- $options = $options[0];
- $this -> engine -> CBuf_AddText( "disconnect" , "svc_disconnect" );
- $this -> engine -> console -> print_str( $options );
- }
- public function exe_serverinfo( $options ) {
- var_dump($options);
- $this -> engine -> cl -> servercount = $options[1];
- $this -> engine -> cl -> checksum = $options[2];
- $this -> engine -> cl -> playernum = $options[3];
- $this -> engine -> cl -> maxclients = $options[4];
- $this -> engine -> clgame -> maxEntities = $options[5];
- $this -> engine -> clgame -> mapname = $options[6];
- $this -> engine -> clgame -> maptitle = $options[7];
- $this -> engine -> clgame -> maptitle = $options[8];
- $this -> engine -> cl -> background = $options[9];
- $this -> engine -> clgame -> gamefolder = $options[10];
- $this -> engine -> clgame -> features = $options[11];
- }
- public function __construct() {
- parent::__construct();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class CLIENT_SVC_FUNCTIONS {
- public $engine;
- public $buf;
- static $svc_list = Array( 0=>"svc_bad",1=>"svc_nop",2=>"svc_disconnect",3=>"svc_event",4=>"svc_version",5=>"svc_setview",6=>"svc_sound",7=>"svc_time",8=>"svc_print",9=>"svc_stufftext",10=>"svc_setangle",11=>"svc_serverinfo",12=>"svc_lightstyle",13=>"svc_updateuserinfo",14=>"svc_deltadescription",15=>"svc_clientdata",16=>"svc_stopsound",17=>"svc_pings",18=>"svc_particle",19=>"svc_damage",20=>"svc_spawnstatic",21=>"svc_event_reliable",22=>"svc_spawnbaseline",23=>"svc_tempentity",24=>"svc_setpause",25=>"svc_signonnum",26=>"svc_centerprint",27=>"svc_killedmonster",28=>"svc_foundsecret",29=>"svc_spawnstaticsound",30=>"svc_intermission",31=>"svc_finale",32=>"svc_cdtrack",33=>"svc_restore",34=>"svc_cutscene",35=>"svc_weaponanim",36=>"svc_decalname",37=>"svc_roomtype",38=>"svc_addangle",39=>"svc_newusermsg",40=>"svc_packetentities",41=>"svc_deltapacketentities",42=>"svc_choke",43=>"svc_resourcelist",44=>"svc_newmovevars",45=>"svc_resourcerequest",46=>"svc_customization",47=>"svc_crosshairangle",48=>"svc_soundfade",49=>"svc_filetxferfailed",50=>"svc_hltv",51=>"svc_director",52=>"svc_voiceinit",53=>"svc_voicedata",54=>"svc_sendextrainfo",55=>"svc_timescale",56=>"svc_resourcelocation",57=>"svc_sendcvarvalue",58=>"svc_sendcvarvalue2" );
- public function setBuf( $buf ) {
- $this->buf = $buf;
- }
- public function read( $cmdID = false ) {
- if ( $cmdID === false )
- $cmd = $this->buf->readInt8();
- else
- $cmd = $cmdID;
- if ( empty( self::$svc_list[$cmd] ) ) {
- if ( $cmdID === false )
- $this->buf->movL(1);
- return false;
- }
- $name = strtolower( self::$svc_list[$cmd] );
- echo " >>> " . $name . "\n";
- if ( method_exists( $this , $name ) )
- $this->{$name}();
- else
- return 0;
- return true;
- }
- public function __construct() {
- global $engine;
- $this -> engine = $engine;
- $this -> buf = NET_BUFER_IN::getCL();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- public function svc_stufftext() {
- $s = $this->buf->readPString();
- echo "SVC_STUFFTEXT " . $s ."\n";
- //--------------------------------------------
- if ( strpos( "connect" , $s ) !== false )
- return;
- //--------------------------------------------
- $this -> engine -> CBuf_AddText( $s , "svc_stufftext" );
- }
- public function svc_print() {
- $s = $this->buf->readPString();
- $this -> engine -> console -> print_str( $s );
- }
- public function svc_sendcvarvalue() {
- $name = $this->buf->readPString();
- $cvar = $this -> engine -> Cvar_Get( $name );
- if ( !$cmd )
- return false;
- $cvar = $cvar["string"];
- $this -> engine -> clc -> execute( "REQUESTCVARVALUE" , Array( $cvar ) );
- }
- public function svc_sendcvarvalue2() {
- $request_id = $this->buf->readInt32();
- $name = $this->buf->readPString();
- $cvar = $this -> engine -> Cvar_Get( $name );
- if ( !$cvar )
- return false;
- $cvar = $cvar["string"];
- echo "SVC_SENDCVARVALUE2 " . $name ."\n";
- $this -> engine -> clc -> execute( "REQUESTCVARVALUE2" , Array( $request_id , $name , $cvar ) );
- }
- public function svc_disconnect() {
- $s = $this->buf->readPString();
- $this -> engine -> CBuf_AddText( "disconnect" , "svc_disconnect" );
- $this -> engine -> console -> print_str( $s );
- }
- public function svc_serverinfo( $options ) {
- $protocol = $this->buf->readInt32();
- $this -> engine -> cl -> servercount = $this->buf->readInt32();
- $this -> engine -> cl -> checksum = $this->buf->readInt32();
- $usedpadding = $this->buf->readString(0x10);
- $this -> engine -> cl -> playernum = $this->buf->readInt8();
- $this -> engine -> cl -> maxclients = $this->buf->readInt8();
- $this -> engine -> clgame -> maxEntities = $this->buf->readInt8();
- $this -> engine -> clgame -> maptitle = $this->buf->readPString();
- $this -> engine -> clgame -> hostname = $this->buf->readPString();
- $this -> engine -> cl -> background = $this->buf->readPString();
- $this -> engine -> clgame -> gamefolder = $this->buf->readPString();
- $this -> engine -> clgame -> features = $this->buf->readInt8();
- echo $this -> engine -> clgame -> maptitle."\n";
- echo $this -> engine -> clgame -> hostname."\n";
- echo $this -> engine -> cl -> background."\n";
- echo $this -> engine -> clgame -> gamefolder."\n";
- }
- public function svc_sendextrainfo() {
- $this->buf->readPString();
- $this->buf->readInt8();
- }
- public function _svc_deltadescription() {
- $event_name = $this->buf->readPString();
- $head = $this->buf->readInt8();
- $name = $this->buf->readPString();
- $numDelta = $this->buf->readInt16();
- $c = $this->buf->getBuf();
- $this->buf->setBuf( substr( $c , strpos( $c , "\x09fullserverinfo" ) ) );
- $this->buf->setCursor(0);
- //echo COM::showHex($c)."\n";
- //echo COM::showHtmlContent( substr( $c , strpos( $c , "\x09fullserverinfo" ) ) )."\n";
- /*
- echo $event_name."\n";
- echo $head."\n";
- echo $name."\n";
- echo $numDelta."\n";
- */
- }
- public function svc_updateuserinfo() {
- $player_id = $this->buf->readInt8();
- $player_uid = $this->buf->readInt32();
- $player_info = $this->buf->readPString();
- $player_info_2 = $this->buf->readString(16);
- //echo $player_id."\n";
- //echo $player_uid."\n";
- echo $player_info."\n";
- //echo $player_info_2."\n";
- }
- public function svc_resourcerequest() {
- $ServerCount = $this->buf->readInt32();
- $Nil_Var = $this->buf->readInt32();
- $Sign = $this->buf->readInt8();
- if ( $Sign === 0x2B ) {
- $Site = "";
- } else
- if ( $Sign === 0x38 ) {
- $Site = $this->buf->readPString();
- $Sign = $this->buf->readInt8();
- }
- $this->buf->readBitsBegin();
- $SomeMaxValue = $this->buf->readBits( 0x0C );
- echo "ServerCount => " . $ServerCount . "\n";
- echo "Nil_Var => " . $Nil_Var . "\n";
- echo "Sign => " . $Sign . "\n";
- echo "Site => " . $Site . "\n";
- echo "SomeMaxValue => " . $SomeMaxValue . "\n";
- $ConsistencyData = Array();
- for ( $i = 0; $i < $SomeMaxValue; $i++ ) {
- $ConsistencyData[$i] = Array();
- $ConsistencyData[$i]["type"] = $this->buf->readBits( 0x04 );
- //$this->buf->readBitsEnd();
- $ConsistencyData[$i]["szFileName"] = $this->buf->readBitPString();//readPString();
- //$this->buf->readBitsBegin();
- $ConsistencyData[$i]["nIndex"] = $this->buf->readBits( 0x0C );
- $ConsistencyData[$i]["nDownloadSize"] = $this->buf->readBits( 0x18 );
- $ConsistencyData[$i]["ucFlags"] = $this->buf->readBits( 0x03 );
- if ( $this->buf->readBits( 0x01 ) === 1 )
- $ConsistencyData[$i]["rguc_reserved"] = $this->buf->readBitBufferByte( 0x20 );
- else
- $ConsistencyData[$i]["rguc_reserved"] = false;
- echo "ConsistencyData[ ".$i." ]->type => " . $ConsistencyData[$i]["type"] . "\n";
- echo "ConsistencyData[ ".$i." ]->szFileName => " . $ConsistencyData[$i]["szFileName"] . "\n";
- echo "ConsistencyData[ ".$i." ]->nIndex => " . $ConsistencyData[$i]["nIndex"] . "\n";
- echo "ConsistencyData[ ".$i." ]->nDownloadSize => " . $ConsistencyData[$i]["nDownloadSize"] . "\n";
- echo "ConsistencyData[ ".$i." ]->ucFlags => " . $ConsistencyData[$i]["ucFlags"] . "\n";
- echo "ConsistencyData[ ".$i." ]->rguc_reserved => " . $ConsistencyData[$i]["rguc_reserved"] . "\n";
- }
- $id = 0;
- if ( $this->buf->readBits( 0x01 ) === 1 )
- while( $this->buf->readBits( 0x01 ) === 1 ) {
- if ( !( $this->buf->readBits( 0x01 ) === 1 ) )
- $id = ( $m = $this->buf->readBits( 0x0A ) );
- else
- $id += ( $d = $this->buf->readBits( 0x05 ) );
- $ConsistencyData[$id]["advr"] = true;
- echo "ConsistencyData[ ".$id." ] = true;\n";
- }
- $this->buf->readBitsEnd();
- $Sign = $this->buf->readInt8();
- }
- public function svc_resourcelist() {
- //return false;
- echo ":D:D:D:D\n";
- echo ":D:D:D:D\n";
- echo ":D:D:D:D\n";
- echo COM::showHex($this->buf->readString(128)) . "\n";
- $this->buf->movL(128);
- echo $this->buf->readString(128) . "\n";
- $this->buf->movL(128);
- $resource = Array();
- $this->buf->readBitsBegin();
- $count = $this->buf->readBits( 0x0C );
- echo $count."\n";
- for ( $i=0; $i<$count; $i++ ) {
- //$this->buf->readBitsBegin();
- $resource[$i]["type"] = $this->buf->readBits( 4 );
- $this->buf->readBitsEnd();
- $resource[$i]["name"] = $this->buf->readPString();
- echo COM::showHex($this->buf->readString(128)) . "\n";
- $this->buf->movL(128);
- $this->buf->readBitsBegin();
- $resource[$i]["index"] = $this->buf->readBits( 12 );
- $resource[$i]["download_size"] = $this->buf->readBits( 24 );
- $resource[$i]["uc_flags"] = $this->buf->readBits( 3 );
- if ( $resource[$i]["uc_flags"] & 4 <> 0 ) {
- $resource[$i]["rgucMD5_hash"] = $this->buf->readBits( 16 );
- }
- $resource[$i]["if_rguc_reserved"] = $this->buf->readOneBitBool();
- if ( $resource[$i]["if_rguc_reserved"] ) {
- $resource[$i]["rguc_reserved"] = $this->buf->readBits( 32 );
- }
- $this->buf->readBitsEnd();
- echo COM::showHex($this->buf->readString(128)) . "\n";
- $this->buf->movL(128);
- echo $resource[$i]["type"] . "\n";
- echo $resource[$i]["name"] . "\n";
- echo $resource[$i]["index"] . "\n";
- echo $resource[$i]["download_size"] . "\n";
- echo $resource[$i]["uc_flags"] . "\n";
- echo "\n";
- }
- if ( $this->buf->readOneBitBool() ) {
- while( $this->buf->readOneBitBool() ) {
- if ( $this->buf->readOneBitBool() ) {
- $this->buf->readBits( 5 );
- } else {
- $this->buf->readBits( 10 );
- }
- }
- }
- $this->buf->readBitsEnd();
- echo ":Ds:D:D:D\n";
- echo ":Ds:D:D:D\n";
- echo ":Ds:D:D:D\n";
- }
- }
- class CLIENT_USER_MESSAGE_FUNCTIONS {
- public $engine;
- public $buf;
- public $user_message_list = Array( 65=>Array("Name"=>"ReqState","Size"=>"0"),64=>Array("Name"=>"VoiceMask","Size"=>"8"),96=>Array("Name"=>"ShowMenu","Size"=>"-1"),134=>Array("Name"=>"Scenario","Size"=>"-1"),133=>Array("Name"=>"TaskTime","Size"=>"4"),138=>Array("Name"=>"BarTime2","Size"=>"4"),108=>Array("Name"=>"BarTime","Size"=>"2"),101=>Array("Name"=>"RoundTime","Size"=>"2"),104=>Array("Name"=>"BlinkAcct","Size"=>"1"),102=>Array("Name"=>"Money","Size"=>"5"),107=>Array("Name"=>"StatusIcon","Size"=>"-1"),77=>Array("Name"=>"TextMsg","Size"=>"-1"),83=>Array("Name"=>"DeathMsg","Size"=>"-1"),105=>Array("Name"=>"StatusValue","Size"=>"-1"),106=>Array("Name"=>"StatusText","Size"=>"-1"),82=>Array("Name"=>"GameTitle","Size"=>"1"),145=>Array("Name"=>"HudTextArgs","Size"=>"-1"),74=>Array("Name"=>"HudTextPro","Size"=>"-1"),75=>Array("Name"=>"HudText","Size"=>"-1"),69=>Array("Name"=>"FlashBat","Size"=>"1"),68=>Array("Name"=>"Flashlight","Size"=>"2"),103=>Array("Name"=>"ArmorType","Size"=>"1"),72=>Array("Name"=>"Battery","Size"=>"2"),73=>Array("Name"=>"Train","Size"=>"1"),67=>Array("Name"=>"Geiger","Size"=>"1"),100=>Array("Name"=>"SendAudio","Size"=>"-1"),76=>Array("Name"=>"SayText","Size"=>"-1"),129=>Array("Name"=>"ReceiveW","Size"=>"1"),122=>Array("Name"=>"ClCorpse","Size"=>"-1"),84=>Array("Name"=>"ScoreAttrib","Size"=>"2"),112=>Array("Name"=>"Radar","Size"=>"7"),71=>Array("Name"=>"Damage","Size"=>"12"),70=>Array("Name"=>"Health","Size"=>"1"),110=>Array("Name"=>"Crosshair","Size"=>"1"),99=>Array("Name"=>"AmmoX","Size"=>"2"),94=>Array("Name"=>"HideWeapon","Size"=>"1"),93=>Array("Name"=>"ItemPickup","Size"=>"-1"),92=>Array("Name"=>"WeapPickup","Size"=>"1"),91=>Array("Name"=>"AmmoPickup","Size"=>"2"),78=>Array("Name"=>"WeaponList","Size"=>"-1"),66=>Array("Name"=>"CurWeapon","Size"=>"3"),111=>Array("Name"=>"NVGToggle","Size"=>"1"),139=>Array("Name"=>"ItemStatus","Size"=>"1"),141=>Array("Name"=>"BotProgress","Size"=>"-1"),137=>Array("Name"=>"SpecHealth2","Size"=>"2"),136=>Array("Name"=>"BuyClose","Size"=>"0"),118=>Array("Name"=>"TutorClose","Size"=>"-1"),117=>Array("Name"=>"TutorState","Size"=>"-1"),116=>Array("Name"=>"TutorLine","Size"=>"-1"),115=>Array("Name"=>"TutorText","Size"=>"-1"),114=>Array("Name"=>"VGUIMenu","Size"=>"-1"),127=>Array("Name"=>"ForceCam","Size"=>"3"),119=>Array("Name"=>"AllowSpec","Size"=>"1"),113=>Array("Name"=>"Spectator","Size"=>"2"),140=>Array("Name"=>"Location","Size"=>"-1"),86=>Array("Name"=>"TeamInfo","Size"=>"-1"),87=>Array("Name"=>"TeamScore","Size"=>"-1"),85=>Array("Name"=>"ScoreInfo","Size"=>"9"),90=>Array("Name"=>"ServerName","Size"=>"-1"),89=>Array("Name"=>"MOTD","Size"=>"-1"),144=>Array("Name"=>"ShowTimer","Size"=>"0"),143=>Array("Name"=>"Fog","Size"=>"7"),142=>Array("Name"=>"Brass","Size"=>"-1"),135=>Array("Name"=>"BotVoice","Size"=>"2"),132=>Array("Name"=>"ShadowIdx","Size"=>"4"),131=>Array("Name"=>"CZCareerHUD","Size"=>"-1"),124=>Array("Name"=>"HostageK","Size"=>"1"),123=>Array("Name"=>"HostagePos","Size"=>"8"),128=>Array("Name"=>"ADStop","Size"=>"0"),121=>Array("Name"=>"BombPickup","Size"=>"0"),120=>Array("Name"=>"BombDrop","Size"=>"7"),109=>Array("Name"=>"ReloadSound","Size"=>"2"),126=>Array("Name"=>"SpecHealth","Size"=>"1"),125=>Array("Name"=>"HLTV","Size"=>"2"),95=>Array("Name"=>"SetFOV","Size"=>"1"),81=>Array("Name"=>"ViewMode","Size"=>"0"),80=>Array("Name"=>"InitHUD","Size"=>"0"),88=>Array("Name"=>"GameMode","Size"=>"1"),79=>Array("Name"=>"ResetHUD","Size"=>"0"),98=>Array("Name"=>"ScreenFade","Size"=>"10",) );
- public function setBuf( $buf ) {
- $this->buf = $buf;
- }
- public function read( $cmdID = false ) {
- if ( $cmdID === false )
- $cmd = $this->buf->readInt8();
- else
- $cmd = $cmdID;
- if ( empty( self::$user_message_list[$cmd] ) ) {
- if ( $cmdID === false )
- $this->buf->movL(1);
- return false;
- }
- $name = "user_msg_".stretolower( self::$user_message_list[$cmd]["Name"] );
- $size = ( self::$user_message_list[$cmd]["Size"] === -1 ) ? $this->buf->readInt8() : self::$user_message_list[$cmd]["Size"];
- $data = $this->buf->readString( $size );
- echo " >>> " . $name . "\n";
- if ( method_exists( $this , $name ) )
- $this->{$name}( $name , $size , $data );
- else
- return 0;
- return true;
- }
- public function __construct() {
- global $engine;
- $this -> engine = $engine;
- $this -> buf = NET_BUFER_IN::getCL();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class CL_SERVER {
- public $ip = "";
- public $port = "";
- public $addr = "";
- public function set( $ip , $port = Null ) {
- if ( $port === Null ) {
- $this -> addr = $ip;
- preg_match( "/([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})\:([0-9]{1,5})/si" , $ip , $res );
- if ( ( empty( $res [ 1 ] ) ) || ( empty( $res [ 2 ] ) ) )
- return false;
- $this -> ip = $res [ 1 ];
- $this -> port = $res [ 2 ];
- return true;
- } else {
- $this -> ip = $ip;
- $this -> port = $port;
- $this -> addr = $ip . ":" . $port;
- return true;
- }
- }
- public function __construct( $ip = Null , $port = Null ) {
- $this -> ip = $ip;
- $this -> port = $port;
- $this -> addr = $ip . ":" . $port;
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class NET_MESSAGE_FRAGMENTS extends TBUF {
- public $fragments_total;
- public $fragments_get = false;
- public $fragments_last = false;
- public $fragments_now_fragments = false;
- public $fragments_fragments = Array();
- public $fragments_count = 0;
- private $fragments_curr_head;
- private $fragments_curr_total;
- private $fragments_curr_sequence;
- private $fragments_curr_size;
- private $fragments_curr_part;
- private $fragments_curr_last;
- private function fragments_setLast() {
- if ( $this -> fragments_curr_last ) {
- $this -> addBuf( $this -> fragments_curr_last );
- $this -> fragments_last = true;
- } else
- $this -> fragments_last = false;
- }
- private function fragments_newFragments() {
- $this -> fragments_destroyFragments();
- $this -> fragments_total = $this -> fragments_curr_total;
- $this -> fragments_now_fragments = true;
- $this -> fragments_fragments = Array();
- $this -> fragments_addFragments();
- }
- private function fragments_addFragments() {
- //echo " part " . $this -> fragments_curr_sequence ."/" . $this->fragments_curr_total . "\n";
- $this -> fragments_fragments[$this -> fragments_curr_sequence] = $this -> fragments_curr_part;
- $this -> fragments_count = count( $this -> fragments_fragments );
- }
- private function fragments_destroyFragments() {
- $this -> fragments_total = Null;
- $this -> fragments_now_fragments = false;
- $this -> fragments_fragments = Array();
- }
- private function fragments_get() {
- $this -> setBuf();
- if ( ( !$this -> fragments_now_fragments ) || ( $this -> fragments_total > $this -> fragments_count ) )
- return false;
- ksort( $this -> fragments_fragments );
- $r_str = implode( $this -> fragments_fragments );
- $this -> setBuf( ( substr( $r_str , 0 , 4 ) === "BZ2\x00" ) ? bzdecompress( substr( $r_str , 4 ) ) : $r_str );
- $this -> fragments_destroyFragments();
- return true;
- }
- public function fragments_process() {
- $this -> fragments_curr_head = $this -> readInt8();
- $this -> fragments_curr_total = $this -> readInt16();
- $this -> fragments_curr_sequence = $this -> readInt16();
- $this -> movR( 2 );
- $this -> fragments_curr_size = $this -> readInt16();
- $this -> movR( 1 );
- $this -> fragments_curr_part = $this -> readString( $this -> fragments_curr_size );
- $this -> fragments_curr_last = $this -> readString();
- if ( $this -> fragments_now_fragments ) {
- if ( ( $this -> fragments_total === $this -> fragments_curr_total ) ) {
- if ( empty( $this -> fragments_fragments[$this -> fragments_curr_sequence] ) )
- $this -> fragments_addFragments();
- else {
- if ( !( $this -> fragments_fragments[$this -> fragments_curr_sequence] === $this -> fragments_curr_part ) )
- $this -> fragments_newFragments();
- }
- } else
- $this -> fragments_newFragments();
- } else
- $this -> fragments_newFragments();
- if ( $this -> fragments_get() ) {
- $this -> fragments_setLast();
- $this -> setCursor( 0 );
- return true;
- }
- $this -> setBuf();
- if ( $this -> fragments_setLast() ) {
- $this -> setCursor( 0 );
- return true;
- } else
- return false;
- }
- }
- class NET_BUFER_IN extends NET_MESSAGE_FRAGMENTS {
- public $sequence = 1;
- public $acknowledgement = 0x00000000;
- public $reliable_message = false;
- public $reliable_ack = false;
- public $message_contains_fragments = false;
- public $state; // 0 => no_pack | 1 => no_sequence | 2 => full_nops | 3 => sequence
- public $buf_out;
- public static $full_nop_pack = "\x01\x01\x01\x01\x01\x01\x01\x01";
- public function read() { // return 0 if false , 1 if no_sequence , 2 if full_nops , 3 if sequence
- //echo "IN PACK >>> " . COM::showHex( substr( $this->getBuf() , 0,8 ) ) . "\n";
- $sequence_p = $this -> readInt32();
- if ( $sequence_p === ((int)0xFFFFFFFF) ) {
- $this -> state = 1;
- return 1;
- }
- $acknowledgement_p = $this -> readInt32();
- $this -> sequence = $sequence_p & ((int)0x00FFFFFF);
- $this -> acknowledgement = $acknowledgement_p & ((int)0x00FFFFFF);
- $this -> reliable_message = ( ( $sequence_p & ((int)0x80000000) ) === ((int)0x80000000) );
- $this -> reliable_ack = ( ( $acknowledgement_p & ((int)0x80000000) ) === ((int)0x80000000) );
- if ( $this -> reliable_message )
- $this -> buf_out -> acknowledgement = $this -> sequence;
- else
- $this -> buf_out -> acknowledgement++;
- $this -> message_contains_fragments = ( ( $sequence_p & ((int)0xC0000000) ) === ((int)0xC0000000) );
- $this -> setBuf( COM::UnMunge( $this -> readString() , $this -> sequence ) );
- //echo " " . COM::showHex( $this->getBuf() ) . "\n";
- //echo " " . COM::showHtmlContent( $this->getBuf() ) . "\n";
- //if ( $this -> message_contains_fragments )
- // echo "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ message contains fragments ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n";
- if ( $this -> message_contains_fragments )
- $this -> fragments_process();
- //if ( $this -> message_contains_fragments )
- // echo "In frament ".$this->fragments_count." / ".$this->fragments_total."\n";
- if ( $this -> ifEmpty() ) {
- $this -> state = 0;
- return 0;
- }
- if ( $this -> ifPos( 0 , self::$full_nop_pack ) ) {
- $this -> state = 2;
- return 2;
- }
- $this -> state = 3;
- return 3;
- }
- public function __construct() {
- $this -> buf_out = NET_BUFER_OUT::getCL();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class NET_BUFER_OUT extends TBUF {
- public $sequence = 1;
- public $min_size = 8;
- public $max_size = 1024;
- public $acknowledgement = 0;
- public $receiving_is_reliable = true;
- public $run_validation = false;
- public $reliable_confirmation = false;
- public $require_security = false;
- public $packReadId = 1;
- public $packs = Array();
- public function add( $str ) {
- if ( $this -> bufSize + strlen( $str ) > $this -> max_size )
- $this -> release();
- $this -> addBuf( $str );
- }
- public function get() {
- if ( $this -> packReadId >= $this -> sequence )
- $this -> release();
- $res = $this -> packs[$this->packReadId];
- unset( $this -> packs[$this->packReadId] );
- $this->packReadId++;
- return $res;
- }
- public function begin() {
- $this -> setBuf();
- $this -> sequence = 1;
- $this -> packReadId = 1;
- $this -> packs = Array();
- }
- public function release() {
- $to_nop_c = $this -> min_size - $this -> bufSize;
- for ( $i = 0; $i < $to_nop_c; $i++ )
- $this -> writeInt8( 0x01 );
- $buf = $this -> getBuf();
- $this -> setBuf();
- $this -> reliable_confirmation = !$this -> reliable_confirmation;
- $sequence_p = $this -> sequence;
- $acknowledgement_p = $this -> acknowledgement;
- if ( $this -> receiving_is_reliable )
- $sequence_p |= ((int)0x80000000);
- if ( $this -> run_validation )
- $sequence_p |= ((int)0x40000000);
- if ( $this -> reliable_confirmation )
- $acknowledgement_p |= ((int)0x80000000);
- if ( $this -> require_security )
- $acknowledgement_p |= ((int)0x40000000);
- $this -> writeInt32( $sequence_p );
- $this -> writeInt32( $acknowledgement_p );
- //echo "OUT PACK >>> " . COM::showHex( $this->getBuf() ) . "\n";
- //echo " " . COM::showHex( $buf ) . "\n";
- //echo " " . COM::showHtmlContent( $buf ) . "\n";
- $this -> addBuf( COM::Munge( $buf , $this -> sequence ) );
- $this -> packs[$this -> sequence] = $this -> getBuf();
- $this -> sequence++;
- $this -> setBuf();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class NET_READ_COMMAND {
- public $engine;
- public $buf_in;
- public $svc;
- public $user_msg;
- public $svc_exe;
- public function checkWord( $str ) {
- if ( !$str )
- return false;
- $len = strlen( $str );
- if ( $len == 0 )
- return false;
- for( $i=0; $i<$len; $i++ ) {
- $c = $str[$i];
- if ( ( ord($c) <= ((int)0x20) ) && ( $c !== "\r" ) && ( $c !== "\n" ) && ( $c !== "\x00" ) )
- return false;
- }
- return true;
- }
- public function getStuffTextAllVariants( $pos = 0 ) {
- $buf = $this->buf_in->getBUf();
- while( !( ( $pos = strpos( $buf , "\x09" , $pos ) ) === false ) ) {
- $this->buf_in->setCursor( $pos + 1 );
- $s_t = $this->buf_in->readPString();
- if ( !preg_match( "/^[^a-zA-Z0-9\_]/si" , $s_t ) ) {
- $this->buf_in->setCursor( $pos );
- $this -> svc -> read();
- }
- $pos++;
- }
- $this->buf_in->setCursor( 0 );
- }
- public function getQcc2AllVariants( $pos = 0 ) {
- $buf = $this->buf_in->getBUf();
- while( !( ( $pos = strpos( $buf , chr(58) , $pos ) ) === false ) ) {
- $this->buf_in->setCursor( $pos+4 );
- $s_t = $this->buf_in->readPString();
- if ( $this->checkWord( $s_t ) ) {
- if ( !preg_match( "/[^a-zA-Z0-9\_]/si" , $s_t ) ) {
- $this->buf_in->setCursor( $pos );
- $this -> svc -> read();
- }
- }
- $pos++;
- }
- $this->buf_in->setCursor( 0 );
- }
- public function readOne() {
- if ( $this->buf_in->ifEnd() )
- return false;
- $svc = $this -> svc -> readCMD( $this->buf_in );
- if ( $svc === -1 ) {/*
- $this->buf_in->movL(0);
- echo COM::showHex( $this->buf_in->readString() )."\n";
- echo COM::showHtmlContent( $this->buf_in->readPString() )."\n";
- echo COM::showHtmlContent( $this->buf_in->readPString() )."\n";
- echo COM::showHtmlContent( $this->buf_in->readPString() )."\n";
- echo COM::showHtmlContent( $this->buf_in->readPString() )."\n";
- return false;
- */
- $this -> engine -> console -> print_str( "BAD SVC Message" );
- return false;
- }
- if ( $svc === 0 ) {
- $user_msg = $this -> user_msg -> readCMD( $this->buf_in );
- if ( $user_msg ) {
- echo $user_msg["cmd"]["Name"] . " " . $user_msg["options_string"] ."\n";
- } else
- return false;
- } else {
- /*
- $i = $this->buf_in->bufPos;
- while( $i < $this->buf_in->bufSize ) {
- $this->buf_in->setCursor( $i );
- $cmd = $this -> svc -> getCMD( $this->buf_in->readInt8() );
- if ( $cmd ) {
- echo $cmd["Name"] . " " . COM::showHtmlContent( $this->buf_in->readString() )."\n";
- }
- $i++;
- }
- */
- echo $svc["cmd"]["Name"] . " " . $svc["options_string"] ."\n";
- //echo COM::showHtmlContent( $svc["options_string"] )."\n";
- $this -> svc_exe -> execute( $svc["cmd"]["Name"] , $svc["options"] );
- return true;
- }
- return false;
- }
- public function read() {
- $this->buf_in->setCursor(0);
- while( !$this->buf_in->ifEnd() ) {
- $cmdID = $this->buf_in->readInt8();
- echo "Curr CMD :: " . $cmdID . "\n";
- $res = $this->svc->read( $cmdID );
- if ( $res === false )
- $res = $this->user_msg->read( $cmdID );
- if ( !$res ) {
- $this -> getStuffTextAllVariants( $this->buf_in->bufPos );
- $this -> getQcc2AllVariants( $this->buf_in->bufPos );
- return false;
- }
- }
- echo "Curr END CMD :: " . $cmdID . "\n";
- }
- public function __construct() {
- global $engine;
- $this -> engine = $engine;
- $this -> buf_in = NET_BUFER_IN::getCL();
- $this -> svc = CLIENT_SVC_FUNCTIONS::getCL();
- $this -> user_msg = USER_MESSAGE::getCL();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class CL_SOCKET {
- public $developer = false;
- public $engine;
- public $server;
- public $buf_in;
- public $buf_out;
- public $maxRecvSize = 4096;
- public $recvTime = 500000; // mcr seck
- public $recvInterval = 1000; // mcr seck ( 1/10^6 )
- private function developer( $info , $head ) {
- echo
- "\n>>>>>>>>============================================== ".$head." ==============================================>>>>>>>>\n".
- COM::showHex( $info ) . "\n" . COM::showHtmlContent( $info ) .
- "\n<<<<<<<<============================================== ".$head." ==============================================<<<<<<<<\n";
- }
- function open () {
- if ( !( $this -> socket = @socket_create ( AF_INET, SOCK_DGRAM, SOL_UDP ) ) )
- return Array ( "ERROR" => 1, "msg" => "Ошибка создания сокета" );
- if ( !socket_set_nonblock ( $this -> socket ) )
- return Array ( "ERROR" => 1, "msg" => "Ошибка... Невозможна перевести сокет в неблокирующий режим" );
- return Array ( "ERROR" => 0 );
- }
- function release() {
- $this -> close();
- $this -> open();
- }
- function send () {
- if ( $this -> engine -> state >= 2 ) {
- $pack = $this -> buf_out -> get();
- if ( $this -> developer ) $this -> developer( $pack , "PACK OUT" );
- @socket_sendto ( $this -> socket , $pack , strlen( $pack ) , 0 , $this -> server -> ip , $this -> server -> port );
- return true;
- } elseif ( $this -> engine -> state === 1 ) {
- if ( $this -> developer ) $this -> developer( $this -> buf_out -> getBuf() , "PACK OUT" );
- @socket_sendto ( $this -> socket , $this -> buf_out -> getBuf() , $this -> buf_out -> bufSize , 0 , $this -> server -> ip , $this -> server -> port );
- return true;
- }
- return false;
- }
- function recv ( $time = Null ) {
- if ( $this -> engine -> state >= 2 ) {
- $recvCount = ( $time === Null ) ? 0 : floor( $time / $this -> recvInterval );
- for ( $i = 0; $i <= $recvCount; $i++ ) {
- socket_recvfrom ( $this -> socket, $temp, $this->maxRecvSize, 0, $ip, $port );
- if ( !( ( $temp === false ) || ( $temp === Null ) ) ) {
- $this->buf_in->setBuf( $temp );
- if ( $this -> developer )
- $this -> developer( $temp , "PACK IN" );
- return true;
- }
- if ( $time === Null )
- return false;
- usleep( $this -> recvInterval );
- }
- return false;
- } elseif ( $this -> engine -> state === 1 ) {
- $time = ( $time === Null ) ? $this -> recvTime : $time;
- $recvCount = floor( $time / $this -> recvInterval );
- for ( $i = 0; $i <= $recvCount; $i++ ) {
- socket_recvfrom ( $this -> socket, $temp, $this->maxRecvSize, 0, $ip, $port );
- if ( !( ( $temp === false ) || ( $temp === Null ) ) ) {
- $this->buf_in->setBuf( $temp );
- if ( $this -> developer )
- $this -> developer( $temp , "PACK IN" );
- return true;
- }
- usleep( $this -> recvInterval );
- }
- if ( $this -> developer )
- $this -> developer( "ERROR recv TimeOut" , "PACK IN" );
- return false;
- }
- return false;
- }
- function close() {
- @socket_close( $this -> socket );
- }
- public function __construct() {
- global $engine;
- $this -> engine = $engine;
- $this -> server = CL_SERVER::getCL();
- $this -> buf_in = NET_BUFER_IN::getCL();
- $this -> buf_out = NET_BUFER_OUT::getCL();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class GET_TICKET extends TBUF {
- public static $DEFAULT_STEAM_PACK = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00";
- public function getRandomHash( $minL = 6 , $maxL = 16 ) {
- $len = mt_rand( $minL , $maxL );
- $hash = "";
- $mTable = Array (
- Array ( ord( "a" ) , ord("z") ) ,
- Array ( ord( "A" ) , ord("Z") ) ,
- Array ( ord( "0" ) , ord("9") )
- );
- $cTable = count( $mTable )-1;
- for ( $i = 0; $i < $len; $i++ ) {
- $j = mt_rand( 0 , $cTable );
- $hash .= chr( mt_rand( $mTable[$j][0] , $mTable[$j][1] ) );
- }
- return $hash;
- }
- public function getIdRevEmu( $hash ) {
- $len = strlen( $hash );
- $steam = ((int)0x4E67C6A7);
- for( $i = 0; $i < $len; $i++ ) {
- $ch = ord( $hash[$i] );
- if ( $ch === 0 )
- return $steam;
- // Hash ^= (Hash >> 2) + CurChar + 32 * Hash;
- $steam ^= ( ( ( ( ((int)$steam >> 2) ) + $ch ) + ( ((int)$steam << 5 )) ) & ((int)0xFFFFFFFF) );
- }
- return $steam;
- }
- public function getTicketRevEmu( $hash = Null ) {
- if ( $hash === Null )
- $hash = $this -> getRandomHash();
- $steam = $this -> getIdRevEmu( $hash );
- $this -> setBuf();
- $this -> writeInt32( ((int)0x0000004A) );
- $this -> writeInt32( ((int)$steam) );
- $this -> writePString( "ver" );
- $this -> writeInt32( ((int)0x00000000) );
- $this -> writeInt32( ((int)( $steam << 1 )) );
- $this -> writeInt32( ((int)0x01100001) );
- $this -> writePString( $hash );
- $this -> writeString( self::$DEFAULT_STEAM_PACK );
- return $this -> getBuf();
- }
- public function getTicketGreenLuma( $steam = Null , $mod2steam64 = 0 ) {
- $steam = (int)( ( (((int)$steam) & ((int)0xFFFFFFFF) ) << 1 ) >> 1 );
- if ( $steam === 0 )
- return $this -> getTicketGreenLuma( (int)( (mt_rand(0,10)+1)*100000000 + 702354683 + mt_rand(0,100000000) ) , mt_rand(0,1) );
- $this -> setBuf();
- $this -> writeInt32( ((int)0x00000014) );
- for ( $i=0; $i < 8; $i++ )
- $this -> writeInt8( mt_rand( 0,255 ) & 0xFF );
- $this -> writeInt32( ( ((int)$steam) << 2 ) + $mod2steam64 );
- $this -> writeInt32( ((int)0x01100001) );
- for ( $i=0; $i < 4; $i++ )
- $this -> writeInt8( mt_rand( 0,255 ) & 0xFF );
- $this -> writeInt32( ((int)0x00000000) );
- return $this -> getBuf();
- }
- public function getTicket( $emul = "revemu" , $hash = Null , $mod2steam64 = 0 ) {
- switch ( $emul ) {
- case "revemu":
- return $this -> getTicketRevEmu( $hash );
- break;
- case "greenluma":
- return $this -> getTicketGreenLuma( $hash , $mod2steam64 );
- break;
- }
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class FIRST_PACKETS {
- public $engine;
- public $userinfo;
- public $socket;
- public $server;
- public $buf_in;
- public $buf_out;
- public $ticket;
- public function chalenge() {
- $this -> buf_out -> setBuf();
- $this -> buf_out -> writeInt32( 0xFFFFFFFF );
- $this -> buf_out -> writePString( "getchallenge steam" );
- }
- public function connect( $id ) {
- $this -> buf_out -> setBuf();
- $this -> buf_out -> writeInt32( 0xFFFFFFFF );
- $this -> buf_out -> writeString( $this -> userinfo -> getUserInfoString( $id ) );
- $this -> buf_out -> writeString( $this -> ticket -> getTicketGreenLuma() );
- }
- public function __construct() {
- global $engine;
- $this -> engine = $engine;
- $this -> userinfo = GET_USER_INFO::getCL();
- $this -> socket = CL_SOCKET::getCL();
- $this -> server = CL_SERVER::getCL();
- $this -> buf_in = NET_BUFER_IN::getCL();
- $this -> buf_out = NET_BUFER_OUT::getCL();
- $this -> ticket = GET_TICKET::getCL();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class NET {
- public $engine;
- public $socket;
- public $server;
- public $buf_in;
- public $buf_out;
- public $first_packets;
- public $readCMD;
- public $time = Null;
- public $maxOutTime = 8; // sec
- public $lastTime = 0;
- public function getTime() {
- $time = microtime();
- $time = explode ( " " , $time );
- return ((float)$time[0]) + ((float)$time[1]);
- }
- public function needSleep() {
- $interval = ( ( 1 / $this -> engine -> Cvar_Get( "cl_cmdrate" )["int"] ) * 1000000 );
- $time_s = $this -> getTime();
- if ( $this -> time === Null ) {
- $this -> time = $time_s;
- return false;
- }
- $time = $interval - ( ( $time_s - $this -> time ) * 1000000 );
- $this -> time = $time_s;
- if ( $time > 0 )
- usleep( $time );
- }
- public function add( $str ) {
- $this -> buf_out -> add( $str );
- }
- public function connect() {
- $this -> engine -> state = 1;
- $this -> socket -> release();
- $this -> first_packets -> chalenge();
- $this -> socket -> send();
- if ( !$this -> socket -> recv() ) {
- $this->engine->console->print_str("Нет ответа от сервера на покет getchalenge");
- $this -> disconnect();
- return false;
- }
- $head = $this -> buf_in -> readString( 4 );
- $A_1_head = $this -> buf_in -> readString( 1 );
- $A_2_head = $this -> buf_in -> readString( 8 );
- $A_3_head = $this -> buf_in -> readString( 1 );
- if ( $head == "\xFF\xFF\xFF\xFF" ) {
- if ( ( $A_1_head === "\x6C" ) || ( $A_1_head === "\x39" ) ) {
- $this -> engine -> console -> print_str( $this -> buf_in -> getBuf( 5 ) );
- $this -> disconnect();
- return false;
- }
- if ( !( ( $A_1_head === "A" ) && ( $A_2_head === "00000000" ) && ( $A_3_head === "\x20" ) ) ) {
- $this -> disconnect();
- return false;
- }
- } else {
- $this->engine->console->print_str("Нее верный фармат ответа от сервера на покет getchalenge");
- $this -> disconnect();
- return false;
- }
- $buf = $this -> buf_in -> getBuf( 14 );
- $connect_try_id = trim( substr( $buf , 0 , strpos( $buf , "\x20" ) ) );
- if ( $connect_try_id === "" ) {
- $this -> disconnect;
- return false;
- }
- $this -> first_packets -> connect( $connect_try_id );
- $this -> socket -> send();
- if ( !$this -> socket -> recv() ) {
- $this->engine->console->print_str("Нет ответа от сервера на покет connect");
- $this -> disconnect();
- return false;
- }
- $head = $this -> buf_in -> readString( 4 );
- $A_1_head = $this -> buf_in -> readString( 1 );
- $A_2_head = $this -> buf_in -> readString( 8 );
- $A_3_head = $this -> buf_in -> readString( 1 );
- if ( $head == "\xFF\xFF\xFF\xFF" ) {
- if ( ( $A_1_head === "\x6C" ) || ( $A_1_head === "\x39" ) ) {
- $this -> engine -> console -> print_str( $this -> buf_in -> getBuf( 5 ) );
- $this -> disconnect();
- return false;
- }
- } else {
- $this->engine->console->print_str("Нее верный фармат ответа от сервера на покет connect");
- $this -> disconnect();
- return false;
- }
- $this -> lastTime = time();
- $this -> engine -> state = 2;
- $this -> buf_out -> begin();
- $this -> run();
- }
- public function disconnect() {
- if ( $this -> engine -> state >= 2 ) {
- $this -> engine -> clc -> execute( "STRINGCMD" , "dropclient" );
- $len = $this -> buf_out -> sequence - $this -> buf_out -> packReadId;
- for( $i=0; $i<=$len; $i++ )
- $this -> socket -> send();
- }
- $this -> engine -> state = 0;
- $this -> socket -> close();
- return true;
- }
- public function run() {
- $this -> engine -> NET_FRAME_FIRST();
- $this -> socket -> send();
- $this -> needSleep();
- while( $this -> engine -> state >= 2 ) {
- while ( $this -> socket -> recv() ) {
- $this -> lastTime = time();
- if ( $this -> buf_in -> read() >= 3 ) {
- echo "size in buffer = ".$this->buf_in->bufSize."\n";
- $this -> readCMD -> read();
- //echo $this -> buf_in -> state . "\n";
- //echo COM::showHtmlContent( $this->buf_in->getBuf() ) . "\n";
- }
- }
- if ( $this->lastTime + $this->maxOutTime < time() ) {
- $this -> disconnect();
- $this->engine->console->print_str("Нет ответа от сервера ".$this->maxOutTime." sec");
- return;
- }
- $this -> engine -> NET_FRAME();
- $this -> socket -> send();
- $this -> needSleep();
- }
- }
- public function __construct() {
- global $engine;
- $this -> engine = $engine;
- $this -> socket = CL_SOCKET::getCL();
- $this -> server = CL_SERVER::getCL();
- $this -> buf_in = NET_BUFER_IN::getCL();
- $this -> buf_out = NET_BUFER_OUT::getCL();
- $this -> first_packets = FIRST_PACKETS::getCL();
- $this -> readCMD = NET_READ_COMMAND::getCL();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class COM {
- private static $MungeTable = Array(
- Array( 0x7A, 0x64, 0x05, 0xF1, 0x1B, 0x9B, 0xA0, 0xB5, 0xCA, 0xED, 0x61, 0x0D, 0x4A, 0xDF, 0x8E, 0xC7 ) ,
- Array( 0x05, 0x61, 0x7A, 0xED, 0x1B, 0xCA, 0x0D, 0x9B, 0x4A, 0xF1, 0x64, 0xC7, 0xB5, 0x8E, 0xDF, 0xA0 ) ,
- Array( 0x20, 0x07, 0x13, 0x61, 0x03, 0x45, 0x17, 0x72, 0x0A, 0x2D, 0x48, 0x0C, 0x4A, 0x12, 0xA9, 0xB5 )
- );
- private static $NeedMungeTable = Array( 0x05, 0x61, 0x7A, 0xED, 0x1B, 0xCA, 0x0D, 0x9B, 0x4A, 0xF1, 0x64, 0xC7, 0xB5, 0x8E, 0xDF, 0xA0 );
- public static function Munge ( $pack , $sequence ) {
- $size_b = strlen ( $pack );
- $size = floor ( $size_b / 4 );
- $sequence &= 0xFF;
- $notSequence = ( ~$sequence ) & 0xFF;
- $res = "";
- for ( $i=0; $i<$size; $i++ ) {
- $res .=
- chr( ~( ord( $pack[$i*4+3] ) ^ ( self::$NeedMungeTable[ ( $i ) & 0x0F ] | 165 ) ) ^ $sequence ) .
- chr( ~( ord( $pack[$i*4+2] ) ^ ( self::$NeedMungeTable[ ( $i + 1 ) & 0x0F ] | 167 ) ) ) .
- chr( ~( ord( $pack[$i*4+1] ) ^ ( self::$NeedMungeTable[ ( $i + 2 ) & 0x0F ] | 175 ) ) ) .
- chr( ~( ord( $pack[$i*4 ] ) ^ ( self::$NeedMungeTable[ ( $i + 3 ) & 0x0F ] | 191 ) ) ^ $sequence ) ;
- }
- if ( $size * 4 < $size_b )
- $res .= substr( $pack , $size * 4 );
- return $res;
- }
- public static function UnMunge ( $pack , $sequence ) {
- $size_b = strlen ( $pack );
- $size = floor ( $size_b / 4 );
- $sequence &= 0xFF;
- $res = "";
- for ( $i=0; $i<$size; $i++ ) {
- $res .=
- chr( ~( ord( $pack[$i*4+3] ) ^ ( self::$NeedMungeTable[ ( $i + 3 ) & 0x0F ] | 191 ) ) ^ $sequence ) .
- chr( ~( ord( $pack[$i*4+2] ) ^ ( self::$NeedMungeTable[ ( $i + 2 ) & 0x0F ] | 175 ) ) ) .
- chr( ~( ord( $pack[$i*4+1] ) ^ ( self::$NeedMungeTable[ ( $i + 1 ) & 0x0F ] | 167 ) ) ) .
- chr( ~( ord( $pack[$i*4 ] ) ^ ( self::$NeedMungeTable[ ( $i ) & 0x0F ] | 165 ) ) ^ $sequence ) ;
- }
- if ( $size * 4 < $size_b )
- $res .= substr( $pack , $size * 4 );
- return $res;
- }
- public static function setAsistMungeTable( $tbId = 2 ) {
- self::$NeedMungeTable = &self::$MungeTable[$tbId-1];
- }
- public static function getStructurePacket( $pack = Null ) {
- if ( $pack === Null ) {
- CL_BUFER::getCL()->setCursor( 0 );
- $num1 = CL_BUFER::getCL()->readInt32();
- $num2 = CL_BUFER::getCL()->readInt32();
- $pack = CL_BUFER::getCL()->readString();
- $count = $num1 & 0x00FFFFFF;
- $res = new CL_StructurePacket( $num1 , $num2 , $count , $pack );
- } else {
- $num1 = unpack( "l" , substr( $pack , 0 , 4) )[1];
- $num2 = unpack( "l" , substr( $pack , 4 , 4) )[1];
- $pack = substr( $pack , 8);
- $count = $num1 & 0x00FFFFFF;
- $num = unpack( "l" , substr( $pack , 0 , 4) )[1];
- $res = new CL_StructurePacket( $num1 , $num2 , $count , $pack );
- }
- return $res;
- }
- public static function getPacket( $struct ) {
- return pack( "l" , $struct->num ) . pack( "l" , $struct->num2 ) . $struct->content;
- }
- public static function showHex ( $st, $rd = " ", $type = false ) {
- $len = strlen ( $st .= "" );
- if ( $type )
- for ( $i = $len - 1; $i >= 0; $i-- )
- $res .= ( ( ( $buf = ord ( $st [ $i ] ) ) > 15 ) ? base_convert ( $buf, 10, 16 ) : "0" . base_convert ( $buf, 10, 16 ) ) . $rd;
- else
- for ( $i = 0; $i < $len; $i++ )
- $res .= ( ( ( $buf = ord ( $st [ $i ] ) ) > 15 ) ? base_convert ( $buf, 10, 16 ) : "0" . base_convert ( $buf, 10, 16 ) ) . $rd;
- return strtoupper ( $res );
- }
- public static function showHex2 ( $st, $rd = " ", $type = false ) {
- $len = strlen ( $st .= "" );
- if ( $type )
- for ( $i = $len - 1; $i >= 0; $i-- )
- $res .= "\x" . strtoupper( ( ( $buf = ord ( $st [ $i ] ) ) > 15 ) ? base_convert ( $buf, 10, 16 ) : "0" . base_convert ( $buf, 10, 16 ) ) . $rd;
- else
- for ( $i = 0; $i < $len; $i++ )
- $res .= "\x" . strtoupper( ( ( $buf = ord ( $st [ $i ] ) ) > 15 ) ? base_convert ( $buf, 10, 16 ) : "0" . base_convert ( $buf, 10, 16 ) ) . $rd;
- return ( $res );
- }
- public static function showHtmlContent( $st ) {
- $res = "";
- //$res = "<style type=\"text/css\" >.normalViev{ color: #424242; display: inline;}.hexViev{ color: #3000FF;display: inline; }</style>";
- //$nameClassText = "normalViev";
- //$nameClassHexViev = "hexViev";
- $len = strlen( $st );
- $firstFL = true;
- $endFL = false;
- for ( $i = 0; $i < $len; $i++ ) {
- $ch = ord($st[$i]);
- if (
- ( ( $ch >= 97 ) && ( $ch <= 127 ) ) ||
- ( ( $ch >= 65 ) && ( $ch <= 90 ) ) ||
- ( ( $ch >= 48 ) && ( $ch <= 57 ) ) ||
- ( $ch === 0x20 ) ||
- ( $ch === 47 ) //||
- //( ( $ch > 0x0A ) && ( $ch < 150 ) )
- || ( $ch >= 32 )
- ) {
- /*
- if ( $firstFL ) {
- $res .= "<p class=\"".$nameClassText."\" >";
- $firstFL = false;
- $endFL = true;
- }
- */
- $res .= $st[$i];
- } else {
- /*
- if ( $endFL ) {
- $res .= "</p>";
- $firstFL = true;
- $endFL = false;
- }
- */
- //$res .= "<p class=\"".$nameClassHexViev."\">\x".COM::showHex($st[$i] , "" )."</p>";
- $res .= "\\x".COM::showHex($st[$i] , "" );
- }
- }
- return $res;
- }
- public static function getPartBuildPack( $buf ) {
- $head = ord($buf[0]);
- $total = ord($buf[1]) + ord($buf[2]) * 256;
- $curr = ord($buf[3]) + ord($buf[4]) * 256;
- $size = ord($buf[7]) + ord($buf[8]) * 256;
- //echo substr( $buf , 10 , $size ) . "\n";
- // head total curr size
- // pack = \x01 \x01\x00 \x01\x00 \x00\x00 \x1A\x00 \x00 09 65 63 68 6F 20 22 2A 20 50 72 69 76 69 6C 65 67 65 73 20 73 65 74 22 0A 00
- // pack = \x01 \x06\x00 \x01\x00 \x00\x00 \x00\x04 \x00 BZ2\x00BZh91AY&SYэЌ
- // pack = \x01 \x01\x00 \x01\x00 \x00\x00 \x5C\x00 \x00 09 65 63 68 6F 20 22 2A 20 D0 9F D1 80 D0 B0 D0 B2 D0 B0 20 D0 B4 D0 BE D1 81 D1 82 D1 83 D0 BF D0 B0 20 D0 BF D1 80 D0 B5 D0 B4 D0 BE D1 81 D1 82 D0 B0 D0 B2 D0 BB D0 B5 D0 BD D1 8B 21 22 0A 00 09 62 69 6E 64 20 22 46 33 22 20 22 6D 65 6E 75 5F 73 65 72 76 65 72 61 22 0A 00
- return Array(
- "total" => $total ,
- "curr" => $curr ,
- "size" => $size ,
- "part" => substr( $buf , 10 , $size ) ,
- "last" => substr( $buf , 10 + $size )
- );
- }
- public static function addPartToArrayPartsPack( &$parts , $buf ) {
- if ( empty( $buf["total"] ) || empty( $buf["curr"] ) )
- return false;
- if ( empty( $parts ) )
- $parts = Array(
- "total" => $buf["total"] ,
- "parts" => Array( $buf["curr"] => $buf )
- );
- else {
- if ( $parts["parts"]["total"] === $buf["total"] )
- $parts["parts"][$buf["curr"]] = $buf;
- else
- return false;
- }
- return true;
- }
- public static function getBuildPack( &$buf ) {
- $count = count( $buf["parts"] );
- if ( $count !== count( $buf["total"] ) )
- return false;
- ksort( $buf["parts"] );
- $res = "";
- foreach( $buf["parts"] as &$val )
- $res .= $val["part"];
- return ( substr( $res , 0 , 4 ) === "BZ2\x00" ) ? bzdecompress( substr( $res , 4 ) ) : $res;
- }
- public static function ParseFile( $data , &$token ) {
- $i = 0;
- $len = 0;
- $token = "";
- $dataLen = strlen( $data );
- if ( !$data )
- return false;
- // skip whitespace
- $skipwhite = true;
- while( $skipwhite ) {
- $skipwhite = false;
- while( ( $c = ord( $ch = $data[$i] ) ) <= 32 ) {
- if ( $c === 0 )
- return false;
- $i++;
- }
- if ( ( $ch === "/" ) && ( $data[$i+1] === "/" ) ) {
- while( ( $data[$i] === "\x00" ) || ( $data[$i] === "\n" ) )
- $i++;
- $skipwhite = true;
- }
- }
- // handle quoted strings specially
- if ( $ch === "\"" ) {
- $i++;
- while( true ) {
- $c = ord( $ch = $data[$i] );
- $i++;
- if ( ( $ch === "\"" ) || ( $c === 0 ) )
- return ( $data = substr( $data , $i ) ) ? $data : "";
- $token .= $ch;
- $len++;
- }
- }
- // parse single characters
- if ( ( $ch == '{' ) || ( $ch == '}' ) || ( $ch == ')' ) || ( $ch == '(' ) || ( $ch == '\'' ) || ( $ch == ',' ) ) {
- $token .= $ch;
- $len++;
- return ( $data = substr( $data , $i + 1 ) ) ? $data : "";
- }
- // parse a regular word
- do {
- $token .= $ch;
- $len++;
- $i++;
- $c = ord( $ch = $data[$i] );
- if ( ( $ch == '{' ) || ( $ch == '}' ) || ( $ch == ')' ) || ( $ch == '(' ) || ( $ch == '\'' ) || ( $ch == ',' ) )
- break;
- } while( $c > 32 );
- return ( $data = substr( $data , $i ) ) ? $data : "";
- }
- }
- class CONSOLE {
- public $text = "";
- public $event_out = true;
- public $new_line = true;
- public function event_out_f( $line , $new_line ) {
- echo ( ( $new_line ) ? "CONSOLE: " : "" ) . $line;
- }
- public function print_str( $text , $new_line = Null ) {
- $new_line = ( $new_line === Null ) ? $this -> new_line : $new_line;
- $line = $text . ( ( $new_line ) ? "\n" : "" );
- if ( $this -> event_out )
- $this -> event_out_f( $line , $new_line );
- $this -> text .= $line;
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class CLIENT_CLGAME {
- public $engine;
- public $maxEntities;
- public $mapname;
- public $maptitle;
- public $gamefolder;
- public $features;
- public function __construct() {
- global $engine;
- $this->engine = $engine;
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class CLIENT_CL {
- public $engine;
- public $protocol = 48;
- public $servercount;
- public $checksum;
- public $playernum;
- public $maxclients;
- public $background;
- public function __construct() {
- global $engine;
- $this->engine = $engine;
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class SOUND_VOICE {
- public $voice_data;
- public $curr_id = 0;
- public $min_time = 0;
- public $last_time = 0;
- public $need_interval = 2147483640;
- public $speed = 20;
- public $begin_run = true;
- public $voice_count = 0;
- public function getTime() {
- $time = microtime();
- $time = explode( " " , $time );
- return (int)( ($time[1] + $time[0] )*1000 );
- }
- public function get() {
- $time = $this->getTime();
- if ( $this -> begin_run ) {
- $this->last_time = $time - $this->voice_data[$this->curr_id]["t"];
- $this->curr_id = 0;
- $this->voice_count = count($this->voice_data);
- $this->begin_run = false;
- }
- if ( $time - $this->last_time > $this->voice_data[$this->curr_id+1]["t"] ) {
- $this->curr_id++;
- if ( $this->curr_id >= $this->voice_count ) {
- $this->begin_run = true;
- return false;
- }
- return $this->voice_data[$this->curr_id-1]["d"];
- }
- return false;
- }
- public function __construct() {
- global $VOICE_DATA;
- $this -> voice_data = &$VOICE_DATA;
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- class CLIENT_ENGINE {
- public $cvarlist;
- public $cmdlist;
- public $userinfolist;
- public $cmdExecute;
- public $svc;
- public $user_msg;
- public $clc;
- public $net;
- public $server;
- public $console;
- public $cl;
- public $clgame;
- public $voice;
- public $max_frame = 100;
- public $state = 0; // 0 => disconnected | 1 => connect_first | 2 => connect
- private $NET_FRAME_LIST = Array();
- public $NET_FRAME_COUNT = 1;
- public $Cmd_Args = "";
- public $Cmd_Argv = Array();
- public $Cmd_Argc = 0;
- public function Cvar_Get( $name ) {
- return $this -> cvarlist -> getCVAR( $name , $val );
- }
- public function Cvar_Set( $name , $val ) {
- return $this -> cvarlist -> setCVAR( $name , $val );
- }
- public function Cmd_TokenizeString( $text ) {
- $MAX_CMD_TOKENS = 255;
- $this -> Cmd_Argf = "";
- $this -> Cmd_Args = "";
- $this -> Cmd_Argv = Array();
- $this -> Cmd_Argc = 0;
- if( !$text )
- return;
- $this -> Cmd_Argf = $text;
- $i = 0;
- while( strlen( $text ) > 0 ) {
- // skip whitespace up to a /n
- while( ( $text[$i] ) && ( ( $c = ord( $ch = $text[$i] ) ) > 0 ) && ( $c <= 32 ) && ( $ch !== "\n" ) )
- $i++;
- if ( $ch === "\n" ) {
- // a newline seperates commands in the buffer
- $i++;
- break;
- }
- if ( !( $text[$i] ) )
- return;
- if ( $this -> Cmd_Argc === 1 )
- $this -> Cmd_Args = $text;
- $cmd_token = "";
- $text = COM::ParseFile( $text , $cmd_token );
- if ( $text === false )
- return;
- if( $this -> Cmd_Argc < $MAX_CMD_TOKENS ) {
- $this -> Cmd_Argv[$this -> Cmd_Argc] = $cmd_token;
- $this -> Cmd_Argc++;
- }
- }
- }
- public function Cmd_ExecuteString( $text, $source = "Cmd_ExecuteString", $notFWD = false ) {
- if ( !$text )
- return false;
- $text = trim( $text );
- $this -> Cmd_TokenizeString( $text );
- if ( ( $this -> Cmd_Argc === 0 ) || ( !$this -> Cmd_Argc ) )
- return false;
- $cmd = $this -> cmdlist ->getCMD( $this -> Cmd_Argv[0] );
- if ( $cmd ) {
- $this -> cmdExecute -> execute( $cmd );
- return true;
- }
- $cvar = $this -> cvarlist ->getCVAR( $this -> Cmd_Argv[0] );
- if ( $cvar ) {
- $this -> cvarlist -> setCvar( $this -> Cmd_Argv[0] , $this -> Cmd_Argv[1] );
- return true;
- }
- if ( ( $this -> state >= 2 ) && ( !$notFWD ) )
- $this -> Cmd_ForwardToServer( $source );
- return false;
- }
- public function Cbuf_Execute( $text , $source = "Cbuf_Execute" ) {
- $not_quotes = true;
- $i = 0;
- $len = strlen( $text );
- while( $i < $len ) {
- $b = $i;
- while( $i < $len ) {
- $ch = $text[$i];
- $i++;
- if ( $ch === "\"" )
- $not_quotes = !$not_quotes;
- if ( ( $not_quotes ) && ( $ch === ";" ) )
- break; // don't break if inside a quoted string
- if ( ( ord($ch) === 0 ) || ( $ch === "\n" ) || ( $ch === "\r" ) )
- break;
- }
- $this -> Cmd_ExecuteString( substr( $text , $b , $i - $b ) , $source );
- }
- }
- public function ClientCmd( $text , $source = "ClientCmd" ) {
- $this -> Cmd_ExecuteString( $text , $source , false );
- }
- public function CBuf_AddText( $text , $source = "CBuf_AddText" ) {
- $text = trim( $text );
- $this -> Cbuf_Execute( $text , $source );
- }
- public function Cmd_ForwardToServer( $source = "Cmd_ForwardToServer" ) {
- if ( $this -> state >= 2 )
- return $this -> clc -> execute( "STRINGCMD" , $this -> Cmd_Argv[0] . $this -> Cmd_Args );
- else
- return false;
- }
- public function NET_FRAME_FIRST() {
- $this -> NET_FRAME_COUNT = 1;
- $this -> clc -> execute( "STRINGCMD" , "new" );
- }
- public function NET_FRAME() {
- if ( $this -> NET_FRAME_COUNT >= $this -> max_frame )
- $this -> net -> disconnect();
- if ( $this -> NET_FRAME_COUNT == 40 )
- $this -> clc -> execute( "STRINGCMD" , "sendres" );
- $this -> NET_FRAME_EXECUTE();
- $this -> NET_FRAME_COUNT++;
- }
- public function NET_FRAME_ADD( $c1 , $c2 = Null ) {
- $id = $this -> NER_FRAME_GET_ID( $c1 , $c2 );
- if ( !( $id === false ) )
- return false;
- if ( $c2 === Null ) {
- if ( function_exists( $c1 ) ) {
- $this -> NET_FRAME_LIST[] = Array( "type" => "function" , "c1" => $c1 );
- return true;
- }
- return false;
- } else {
- if ( method_exists( $c1 , $c2 ) ) {
- $this -> NET_FRAME_LIST[] = Array( "type" => "method" , "c1" => $c1 , "c2" => $c2 );
- return true;
- }
- }
- }
- public function NET_FRAME_REMOVE( $c1 , $c2 = Null , $index = Null ) {
- if ( !( $index === Null ) ) {
- if ( empty( $this -> NET_FRAME_LIST[$index] ) )
- return false;
- else {
- unset( $this -> NET_FRAME_LIST[$index] );
- return true;
- }
- }
- $id = $this -> NER_FRAME_GET_ID( $c1 , $c2 );
- if ( $id === false )
- return false;
- unset( $this -> NET_FRAME_LIST[$id] );
- return true;
- }
- private function NER_FRAME_GET_ID( $c1 , $c2 = Null ) {
- if ( $c2 === Null ) {
- foreach ( $this -> NET_FRAME_LIST as $id => &$val )
- if ( ( $val["type"] === "function" ) && ( $val["c1"] === $c1 ) )
- return $id;
- } else {
- foreach ( $this -> NET_FRAME_LIST as $id => &$val )
- if ( ( $val["type"] === "method" ) & ( $val["c1"] === $c1 ) & ( $val["c2"] === $c2 ) )
- return $id;
- }
- return false;
- }
- private function NET_FRAME_EXECUTE(1;) {
- foreach ( $this -> NET_FRAME_LIST as &$val ) {
- if ( $val["type"] === "function" ) {
- $val["c1"]();
- } elseif ( $val["type"] === "method" ) {
- $val["c1"]->{$val["c2"]}();
- }
- }
- }
- public function construct(0) {
- Global Crossing
- $engine;
- $engine = $this;
- $this -> userinfolist = CLIENT_USER_INFO_LIST::getCL();
- $this -> cvarlist = CLIENT_CVAR_LIST::getCL();
- $this -> cmdlist = CLIENT_CMD_LIST::getCL();
- $this -> cmdExecute = CLIENT_CMD_FUNCTIONS::getCL();
- $this -> svs = SVC_CMD::getCL();
- $this -> user_msg = USER_MESSAGE::getCL();
- $this -> net = NET::getCL();
- $this -> clc = CLIENT_CLC_FUNCTIONS::getCL();
- $this -> server = CL_SERVER::getCL();
- $this -> console = CONSOLE::getCL();
- $this -> cl = CLIENT_CL::getCL();
- $this -> clgame = CLIENT_CLGAME::getCL();
- $this -> voice = SOUND_VOICE::getCL();
- }
- public static $thisCL = Null;
- public static function getCL() {
- ( self::$thisCL === Null ) &&
- ( self::$thisCL = new self() );
- return self::$thisCL;
- }
- }
- echo "<pre></pre><head></head>";
- $ engine = CLIENT_ENGINE::getCL(1);
- $engine -> max_frame = 1000;
- $engine -> CBuf_AddText( "name \"dfgsdg\"" );
- $engine -> CBuf_AddText( "cl_cmdrate 80" );
- $engine -> CBuf_AddText( "setinfo _pw \"afk\"" );
- $engine -> CBuf_AddText( "connect 127.0.0.1:43" );
- $ if_voice_enabled = true; (Aussage)
- $ say_count_add = 123;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement