Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function changeNewHonorPoints(&$_result,$_points){
- global $_LANG,$_INI,$_DB, $_APPLICATION;
- if(wow_Utils::isUserOnline()){
- $_result['OK'] = false;
- $_result['ERRMSG'] = youAreOnline;
- PayService_Utils::reset();
- }else{
- $_char = &$_SESSION['_cache']['CHARACTERS'][$_result['charGuid']];
- $_service = &$_SESSION['_cache']['SERVICES'][$_result['fkey']];
- $_db = $_APPLICATION->getConnection('chars');
- $_ret = $_db->Query("select * from character_currency where currency=392 and guid=".$_char['guid']);
- if($_ret && $_ret->numRows()==1){
- $_hInfo = $_ret->fetchRow();
- $_INI['ADDHONOR']['MAX'] = 400000;
- if(($_hInfo['totalHonorPoints']+$_points)<=$_INI['ADDHONOR']['MAX'])
- {
- $_ret = $_db->simpleQuery("update character_currency set count=count+".$_points." where currency=392 and guid=".$_char['guid']);
- if(mysql_errno()==0){
- $_result['fbonus']= 1*$_result['fbonus'];
- $_char['totalHonorPoints'] = $_row['totalHonorPoints'];
- $_SESSION['_logic']['bonus']['activate'] = null;
- $_result['OK'] = true;
- Module_Log::getInstance()->info("Character ".$_char['name']." add ".$_points." new cata honor points for ".$_result['fbonus']." bonuses.");
- }else{
- $_result['ERRSERVICE'] = "Ошибка добавления очков чести. Обратитесь к Администрации.";
- Module_Log::getInstance()->info($_result['ERRSERVICE']);
- }
- }else{
- $_result['ERRSERVICE'] = "Operation is failed.You are have ".$_hInfo['totalHonorPoints'].' honors.';
- Module_Log::getInstance()->info($_result['ERRSERVICE']);
- }
- }else{
- $_result['ERRSERVICE'] = "Operation is failed. Contact to Administrator.";
- Module_Log::getInstance()->error($_result['ERRSERVICE']);
- $_result['OK'] = false;
- PayService_Utils::reset();
- }
- }
- return true;
- }
Add Comment
Please, Sign In to add comment