HooLIGUN Posted June 19, 2017 at 01:33 PM Share Posted June 19, 2017 at 01:33 PM Эта инструкция поможет Вам встроить отображение информации и статуса Steam аккаунта на нашем проекте в Ваш SourceBans. Для начала загрузите скрипт с сайта - Скачать. 1) Закинуть файл RightGameAPI.php в sb/includes/ 2) Открыть файл sb/includes/sb-callback.php 3) Найти $xajax->registerFunction("RefreshServer"); и ниже добавить $xajax->registerFunction("CheckRGbans"); 4) Найти function RemoveMod($mid) И перед ним добавить function CheckRGbans($bid) { $objResponse = new xajaxResponse(); $sb = $GLOBALS['db']->GetAll("SELECT `authid` FROM sb_bans WHERE bid = {$bid}"); foreach ($sb as $res) { $steamid = $res['authid']; } require INCLUDES_PATH.'/RightGameAPI.php'; $api = new rgmix_checkban ("rgbans_full"); $info = $api->checkban($steamid); if ($info['result'] == '1') { $reason = $info['reason']; $data['rgstatus'] = "<a href=\"//bans.rgmix.eu/index.php?p=banlist&searchText=$steamid\" target=\"_blank\" style=\"color:red;font-weight:bold;\">✖ Заблокирован ($reason)</strong></a></span>"; } elseif ($info['result'] == '0') { $data['rgstatus'] = "<span style='color:green;'>✓ Не заблокирован</span>"; } elseif (($info['result'] == '2') or ($info['result'] == '3')) { $data['rgstatus'] = $info['error']; } $objResponse->addAssign("rgstatus_$bid", "innerHTML", $data['rgstatus']); return $objResponse; } 5) Открыть файл sb/themes/Ваша тема/page_bans.tpl 6) Найти {if $ban.server_id != 0} onclick="xajax_ServerHostPlayers({$ban.server_id}, {$ban.ban_id});" {/if} Заменить на {if $ban.server_id != 0} onclick="xajax_ServerHostPlayers({$ban.server_id}, {$ban.ban_id}); xajax_CheckRGbans({$ban.ban_id})" {else} onclick="xajax_CheckRGbans({$ban.ban_id})" {/if} 7) Добавить в подходящие место <tr align=left> <td width=20% height=16 class=listtable_1>Статус RGMIX.eu</td> <td height=16 class=listtable_1 id="rgstatus_{$ban.ban_id}"><span style='color:grey;'>Получение информации...</span></td> </tr> Link to comment Share on other sites More sharing options...
Under Posted June 21, 2017 at 07:47 PM Share Posted June 21, 2017 at 07:47 PM я один не понимаю что это и зачем? Link to comment Share on other sites More sharing options...
vetaldx Posted June 21, 2017 at 07:55 PM Share Posted June 21, 2017 at 07:55 PM я один не понимаю что это и зачем? Думаю это тебе должно быть понятно)Эта инструкция поможет Вам встроить отображение информации и статуса Steam аккаунта на нашем проекте в Ваш SourceBans. Link to comment Share on other sites More sharing options...
del Posted October 18, 2018 at 10:43 PM Share Posted October 18, 2018 at 10:43 PM Проще вам сделать приватную ссылку с информацией о игроке и его бане и выкинуть API в хайд людямВ итоге выйдет пару строчек кода и в том же самом php+ajax указать steam idДа и к тому же,если у вас идет просто callback через php,то можно указать к примеру хайд БД относительно sb_bans, при этом увидеть данные об игроках. В умелых руках можно творить шалости с БД rgmixИ почему-то мне подсказывает шестое чувство,что php не защищен) Link to comment Share on other sites More sharing options...
HooLIGUN Posted October 19, 2018 at 09:47 AM Author Share Posted October 19, 2018 at 09:47 AM @del, я думаю вы немного не поняли суть апи. Оно позволяет внешне получить статус определенного игрока.Делать аякс или нет это уже на усмотрение разработчиков, использующих этот апи. Про защиту попрошу обосновать Link to comment Share on other sites More sharing options...
Recommended Posts