Adjusted rank algorithm to match in-game "rank" command

This commit is contained in:
pricetx 2015-12-28 01:09:57 +00:00
parent 7e96d0d4ae
commit 5fb995f5f6

View File

@ -89,7 +89,7 @@ function getFlag($flag, $type='url')
*/ */
function valid_request($str, $numeric = false) function valid_request($str, $numeric = false)
{ {
$search_pattern = array("/[^A-Za-z0-9\[\]*.,=()!\"$%&^`´':;ß²³#+~_\-|<>\/\\\\@{}äöüÄÖÜ ]/"); $search_pattern = array("/[^A-Za-z0-9\[\]*.,=()!\"$%&^`<EFBFBD>':;߲<>#+~_\-|<>\/\\\\@{}<7D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ]/");
$replace_pattern = array(''); $replace_pattern = array('');
$str = preg_replace($search_pattern, $replace_pattern, $str); $str = preg_replace($search_pattern, $replace_pattern, $str);
if ( $numeric == false ) if ( $numeric == false )
@ -511,7 +511,6 @@ function get_player_rank($playerdata) {
WHERE WHERE
game='".$playerdata['game']."' game='".$playerdata['game']."'
AND hideranking = 0 AND hideranking = 0
AND kills >= 1
AND ( AND (
(".$g_options['rankingtype']." > '".$playerdata[$g_options['rankingtype']]."') OR ( (".$g_options['rankingtype']." > '".$playerdata[$g_options['rankingtype']]."') OR (
(".$g_options['rankingtype']." = '".$playerdata[$g_options['rankingtype']]."') AND (kills/IF(deaths=0,1,deaths) > ".($playerdata['kills']/$tempdeaths).") (".$g_options['rankingtype']." = '".$playerdata[$g_options['rankingtype']]."') AND (kills/IF(deaths=0,1,deaths) > ".($playerdata['kills']/$tempdeaths).")