daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest May 16th, 2018 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static function changeNewHonorPoints(&$_result,$_points){
  2.     global $_LANG,$_INI,$_DB, $_APPLICATION;
  3.     if(wow_Utils::isUserOnline()){
  4.      $_result['OK'] = false;
  5.      $_result['ERRMSG'] = youAreOnline;
  6.      PayService_Utils::reset();
  7.     }else{
  8.      $_char = &$_SESSION['_cache']['CHARACTERS'][$_result['charGuid']];
  9.      $_service = &$_SESSION['_cache']['SERVICES'][$_result['fkey']];
  10.      $_db = $_APPLICATION->getConnection('chars');
  11.      $_ret = $_db->Query("select * from character_currency where currency=392 and guid=".$_char['guid']);
  12.      if($_ret && $_ret->numRows()==1){
  13.        $_hInfo = $_ret->fetchRow();      
  14.        $_INI['ADDHONOR']['MAX'] = 400000;
  15.        if(($_hInfo['totalHonorPoints']+$_points)<=$_INI['ADDHONOR']['MAX'])
  16.        {
  17.          $_ret = $_db->simpleQuery("update character_currency set count=count+".$_points." where currency=392 and guid=".$_char['guid']);
  18.          if(mysql_errno()==0){
  19.           $_result['fbonus']= 1*$_result['fbonus'];
  20.           $_char['totalHonorPoints'] = $_row['totalHonorPoints'];
  21.           $_SESSION['_logic']['bonus']['activate'] = null;
  22.           $_result['OK'] = true;
  23.           Module_Log::getInstance()->info("Character ".$_char['name']." add ".$_points." new cata honor points for ".$_result['fbonus']." bonuses.");
  24.          }else{
  25.           $_result['ERRSERVICE'] = "Ошибка добавления очков чести. Обратитесь Рє Администрации.";
  26.           Module_Log::getInstance()->info($_result['ERRSERVICE']);
  27.          }
  28.        }else{
  29.           $_result['ERRSERVICE'] = "Operation is failed.You are have ".$_hInfo['totalHonorPoints'].' honors.';
  30.           Module_Log::getInstance()->info($_result['ERRSERVICE']);
  31.        }
  32.      }else{
  33.        $_result['ERRSERVICE'] = "Operation is failed. Contact to Administrator.";
  34.        Module_Log::getInstance()->error($_result['ERRSERVICE']);
  35.        $_result['OK'] = false;
  36.        PayService_Utils::reset();    
  37.      }
  38.     }
  39.     return true;
  40.  }
RAW Paste Data
Top