GithubHelp home page GithubHelp logo

hybridmind1337 / case19 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 1.44 MB

Case19 е разработка от екипа на WEBOcean.INFO. Тя е изключително добре направена мулти-гейминг система, която е предназначена за всякакви игри. Може да се ползва и за блог, който е с насоченост - игри. (Ревюта и прочие) Интегрирана е напълно с phpBB, като може да работи и с версия 3.2.х и с 3.3.х.

License: GNU General Public License v3.0

CSS 4.65% PHP 59.96% HTML 9.41% JavaScript 25.98%

case19's Introduction

case19's People

Contributors

hybridmind1337 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

webocean-info

case19's Issues

Problem adding servers

Go to includes/funcs.php and add at the bottom:

//CS:GO
function query_csgo($ip,$port) {
error_reporting(0);
$ServerinfoCommand = "\xFF\xFF\xFF\xFFTSource Engine Query\x00";
$fp = @fsockopen("udp://".''.$ip.':'.$port.'', $errno, $errstr);
@fwrite($fp, $ServerinfoCommand);
@stream_set_timeout($fp, 1);
@stream_set_blocking($fp, TRUE); 
$JunkHead3 = @fread($fp,1000);
fclose($fp);

$packet_array = explode("\x00", substr($JunkHead3, 6), 5);
$server['name'] = $packet_array[0];
$server['map'] = $packet_array[1];

$packet = $packet_array[4];
$server['players'] = ord(substr($packet, 2, 1));
$server['playersmax'] = ord(substr($packet, 3, 1));
$server['server_os']= substr($packet, 6,1);
$server['vac']         = ord(substr($packet, 8, 1));  
$server['bots']        = ord(substr($packet, 4, 1)); 
$server['gamedir'] = $packet_array[2];
 

///////////GET PLAYERS
$ServerinfoCommand = "\xFF\xFF\xFF\xFFU\xFF\xFF\xFF\xFF";
$fp = @fsockopen("udp://".''.$ip.':'.$port.'', $errno, $errstr);
@fwrite($fp, $ServerinfoCommand);
@stream_set_timeout($fp, 1);
@stream_set_blocking($fp, TRUE); 
$JunkHead3 = @fread($fp,1000);
fclose($fp);
$challenge = substr($JunkHead3, 5);
   
$ServerinfoCommand = "\xFF\xFF\xFF\xFFU" . $challenge;
$fp = @fsockopen("udp://".''.$ip.':'.$port.'', $errno, $errstr);
@fwrite($fp, $ServerinfoCommand);
@stream_set_timeout($fp, 1);
@stream_set_blocking($fp, TRUE); 
$infos = @fread($fp,1000);
fclose($fp);
//bullshit end
      
$infos = chunk_split(substr(bin2hex($infos), 12), 2, '\\');
$infos = explode('\\', $infos);
$players = array();

for ($i = 0; isset($infos[$i + 1]); $i = $j + 9) {

// Player name
$name = '';
for ($j = $i + 1; isset($infos[$j]) && $infos[$j] != '00'; $j++) $name .= chr(hexdec($infos[$j]));
         
if (!isset($infos[$j + 8])) break;
         
// Gametime
eval('$time="\x'.trim(chunk_split($infos[$j + 5] . $infos[$j + 6] . $infos[$j + 7] . $infos[$j + 8], 2,"\x"), "\x") . '";');
list(,$time) = unpack('f', $time);
         
// Score
$score = ltrim($infos[$j + 4] . $infos[$j + 3] . $infos[$j + 2] . $infos[$j + 1], '0');
         
//hexdecs
$dec = hexdec($score);
$max = pow(2, 4 * (strlen($score) + (strlen($score) % 2)));
$_dec = $max - $dec;
$scoredesc = $dec > $_dec ? -$_dec : $dec;
//hexdecs
         
$players[] = array(
'id'   =>   hexdec($infos[$i]),
'name'   =>   $name,
'score'   =>   empty($score)? 0 : $scoredesc,
'time'   =>   $time
);
}
//////////GET PLAYERS

switch($server['server_os']) {
case 'w': {
$server['server_os'] = "Windows";
break;
}
case 'l': {
$server['server_os'] = "Linux";
break;
}
}

///////////////////////KRAI NA QUERYTATA//////////////////////////////
return array('s_name'=>$server['name'],'s_map'=>$server['map'],'s_players'=>$server['players'],'s_maxplayers'=>$server['playersmax'],'s_os'=>$server['server_os'],'s_game'=>$server['gamedir'],'s_vac'=>$server['vac'],'s_bots'=>$server['bots'],'s_playerlist'=>$players);
}

//CS 16
function query_cs16($ip,$port) {
error_reporting(0);
$ServerinfoCommand = "\xFF\xFF\xFF\xFFTSource Engine Query\x00";
$fp = @fsockopen("udp://".''.$ip.':'.$port.'', $errno, $errstr);
@fwrite($fp, $ServerinfoCommand);
@stream_set_timeout($fp, 1);
@stream_set_blocking($fp, TRUE); 
$JunkHead3 = @fread($fp,1000);
fclose($fp);

$packet_array = explode("\x00", substr($JunkHead3, 6), 5);
$server['name'] = $packet_array[0];
$server['map'] = $packet_array[1];

 

$packet = $packet_array[4];
$server['players'] = ord(substr($packet, 2, 1));
$server['playersmax'] = ord(substr($packet, 3, 1));
$server['server_os']= substr($packet, 6,1);
$server['vac']         = ord(substr($packet, 8, 1));  
$server['bots']        = ord(substr($packet, 4, 1)); 
$server['gamedir'] = $packet_array[2];

//////OLD QUERY BY DEDIHOST/////
if (preg_match("/27.0.0.1/i", $server['name'])){
$server['name'] = $packet_array[1];
$server['map'] = $packet_array[2];
$tmp = explode("\x00", $JunkHead3);
$place = strlen($tmp[0].$tmp[1].$tmp[2].$tmp[3].$tmp[4]) + 5;
$server['players'] = ord($JunkHead3[$place]);
$server['playersmax'] = ord($JunkHead3[$place + 1]);
$server['server_os']= $JunkHead3[$place + 4];
$server['gamedir'] = $tmp[3];
$server['bots'] = ord($tmp[15]); 
$server['vac'] =  ord($tmp[14]); 
if($tmp[3] == "cstrike" || strpos($JunkHead3, "1.1.2.7") !== false ||  strpos($JunkHead3, "1.1.2.6") !== false) {
$server['gamedir'] = "cs16";
}
}
//END OLD QUERY BY DEDIHOST/////

///////////GET PLAYERS
$ServerinfoCommand = "\xFF\xFF\xFF\xFFU\xFF\xFF\xFF\xFF";
$fp = @fsockopen("udp://".''.$ip.':'.$port.'', $errno, $errstr);
@fwrite($fp, $ServerinfoCommand);
@stream_set_timeout($fp, 1);
@stream_set_blocking($fp, TRUE); 
$JunkHead3 = @fread($fp,1000);
fclose($fp);
$challenge = substr($JunkHead3, 5);
   
$ServerinfoCommand = "\xFF\xFF\xFF\xFFU" . $challenge;
$fp = @fsockopen("udp://".''.$ip.':'.$port.'', $errno, $errstr);
@fwrite($fp, $ServerinfoCommand);
@stream_set_timeout($fp, 1);
@stream_set_blocking($fp, TRUE); 
$infos = @fread($fp,1000);
fclose($fp);
//bullshit end
      
$infos = chunk_split(substr(bin2hex($infos), 12), 2, '\\');
$infos = explode('\\', $infos);
$players = array();

for ($i = 0; isset($infos[$i + 1]); $i = $j + 9) {

// Player name
$name = '';
for ($j = $i + 1; isset($infos[$j]) && $infos[$j] != '00'; $j++) $name .= chr(hexdec($infos[$j]));
         
if (!isset($infos[$j + 8])) break;
         
// Gametime
eval('$time="\x'.trim(chunk_split($infos[$j + 5] . $infos[$j + 6] . $infos[$j + 7] . $infos[$j + 8], 2,"\x"), "\x") . '";');
list(,$time) = unpack('f', $time);
         
// Score
$score = ltrim($infos[$j + 4] . $infos[$j + 3] . $infos[$j + 2] . $infos[$j + 1], '0');
         
//hexdecs
$dec = hexdec($score);
$max = pow(2, 4 * (strlen($score) + (strlen($score) % 2)));
$_dec = $max - $dec;
$scoredesc = $dec > $_dec ? -$_dec : $dec;
//hexdecs
         
$players[] = array(
'id'   =>   hexdec($infos[$i]),
'name'   =>   $name,
'score'   =>   empty($score)? 0 : $scoredesc,
'time'   =>   $time
);
}
//////////GET PLAYERS

switch($server['server_os']) {
case 'w': {
$server['server_os'] = "Windows";
break;
}
case 'l': {
$server['server_os'] = "Linux";
break;
}
}

///////////////////////KRAI NA QUERYTATA//////////////////////////////
return array('s_name'=>$server['name'],'s_map'=>$server['map'],'s_players'=>$server['players'],'s_maxplayers'=>$server['playersmax'],'s_os'=>$server['server_os'],'s_game'=>$server['gamedir'],'s_vac'=>$server['vac'],'s_bots'=>$server['bots'],'s_playerlist'=>$players);
}

грешки в funcs.php

[phpBB Debug] PHP Warning: in file D:/xampp/htdocs/includes/funcs.php on line 20: Undefined array key 1

Fatal error: Uncaught TypeError: mysqli_free_result(): Argument #1 ($result) must be of type mysqli_result, bool given in D:\xampp\htdocs\includes\funcs.php:129 Stack trace: #0 D:\xampp\htdocs\includes\funcs.php(129): mysqli_free_result(true) #1 D:\xampp\htdocs\index.php(12): require_once('D:\xampp\htdocs...') #2 {main} thrown in D:\xampp\htdocs\includes\funcs.php on line 129

Излиза ми тази грешка. Ако премахна секция "// Изтриване на старите реклами" излиза друга:

[phpBB Debug] PHP Warning: in file D:/xampp/htdocs/includes/funcs.php on line 20: Undefined array key 1

Fatal error: Uncaught TypeError: mysqli_free_result(): Argument #1 ($result) must be of type mysqli_result, bool given in D:\xampp\htdocs\includes\funcs.php:140 Stack trace: #0 D:\xampp\htdocs\includes\funcs.php(140): mysqli_free_result(true) #1 D:\xampp\htdocs\includes\funcs.php(142): unique_statistic() #2 D:\xampp\htdocs\index.php(12): require_once('D:\xampp\htdocs...') #3 {main} thrown in D:\xampp\htdocs\includes\funcs.php on line 140

След като изтрия и секцията "// Уникални посещения", която е на тези редове, системата се отваря без проблем. Как мога да оправя този проблем, за да не махам тези две фукции?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.