Skocz do zawartości

X3nO

Użytkownicy
  • Zawartość

    93
  • Rejestracja

  • Ostatnio

  • Wygrane dni

    4

X3nO wygrał w ostatnim dniu 30 Grudzień 2016

X3nO ma najbardziej lubianą zawartość!

Reputacja

7 Neutral

O X3nO

  • Ranga
    Powoli zdobywa wiedzę
  • Urodziny 14.11.2000

Informacje o profilu

  • Płeć
    Mężczyzna
  • Skąd
    Polska

Metody kontaktu

Informacje o forum

  • Wersja Forum
    IPS Community Suite 4.1.x
  • Adres Forum

Ostatnio na profilu byli

5921 wyświetleń profilu
  1. Próbuję to przerobić pod IPS 4. You have used a file management function directly (/public_html/applications/amxxpanel/sources/GameServerQuery.php::86). Please use the proper APIs instead. protected function ping($host, $port, $command) { $socket = @stream_socket_client('udp://'.$host.':'.$port, $errno, $errstr, 2); if (!$errno && $socket) { stream_set_timeout($socket, 2); fwrite($socket, $command); $buffer = @fread($socket, 1500); fclose($socket); return $buffer; } return false; }
  2. Witam, mam taki problem: RuntimeException thrown with message "UDP_SCHEME_NOT_PERMITTED" Przerabiam http://alexou.net/pub/?GameServerQuery/GameServerQuery.php pod IPS 4, mój kod obecnie wygląda tak: <?php namespace IPS\amxxpanel\sources; class _GameServerQuery { protected function getByte(&$chaine) { $data = ord($chaine{0}); $chaine = substr($chaine, 1); return $data; } protected function getString(&$chaine, $chr = "\x00") { $data = strstr($chaine, $chr, true); $chaine = substr($chaine, strlen($data) + 1); return $data; } protected function getLong(&$chaine) { $long = unpack('l', substr($chaine, 0, 4)); $chaine = substr($chaine, 4); return $long[1]; } protected function getInteger16(&$chaine) { $int = unpack('Sint', substr($chaine, 0, 2)); $chaine = substr($chaine, 2); return $int['int']; } protected function getInteger32(&$chaine) { $int = unpack('Sint', substr($chaine, 0, 4)); $chaine = substr($chaine, 4); return $int['int']; } protected function getInteger8(&$chaine) { $chaine = substr($chaine, 1); return ord($chaine{0}); } protected function getVarInt(&$socket) { $int = 0; $i = 0; do { $byte = @fgetc($socket); if($byte === false) { return 0; } $byte = ord($byte); $int |= ($byte & 0x7F) << $i++ * 7; } while ($i < 6 && ($byte & 0x80) == 128); return $int; } protected function ping($host, $port, $command) { $socket = \IPS\Http\Url::external('udp://'.$host.':'.$port)->request()->get(); if (!$errno && $socket) { stream_set_timeout($socket, 2); fwrite($socket, $command); $buffer = @fread($socket, 1500); fclose($socket); return $buffer; } return false; } public function query ($host, $port, $type) { if (method_exists('GameServerQuery', 'query'.$type)) { return call_user_func('self::query'.$type, $host, $port); } else { throw new exception('Typpe de serveur invalide!'); } } public function isOnline ($host, $port, $type) { if ($type == 'minecraft') { // No need for the full ping return @fclose (@fsockopen ( $host , $port , $err , $errstr , 2 )); } if (method_exists('GameServerQuery', 'query'.$type)) { return self::{'query'.$type}($host , $port); } return @fclose (@fsockopen ( $host , $port , $err , $errstr , 2 )); } public function querySource($host, $port) { if ($reponse = self::ping($host, $port, "\xFF\xFF\xFF\xFFTSource Engine Query")) { $cs15 = false; $info = array(); $header = substr($reponse, 0, 5); if ($header !== "\xFF\xFF\xFF\xFF\x6D" && $header !== "\xFF\xFF\xFF\xFF\x49") { return false; } if ($reponse[4] == 'm') { //Le moteur CS1.5 $reponse = substr($reponse, 5); $reponse = strstr($reponse, chr(0)); $cs15 = true; } elseif ($reponse[4] == 'I') { // Le moteur source $reponse = substr($reponse, 5); } else { return false; } $info['version'] = self::getByte($reponse); $info['name'] = trim(self::getString($reponse)); $info['mapname'] = self::getString($reponse); $info['gamedir'] = self::getString($reponse); $info['gamedesc'] = self::getString($reponse); if (!$cs15) $reponse = substr($reponse, 2); $info['numplayers'] = self::getByte($reponse); $info['maxplayers'] = self::getByte($reponse); $info['bot'] = self::getByte($reponse); $info['dedicated'] = (chr(self::getByte($reponse)) === 'd') ? 1 : 0; $info['os'] = chr(self::getByte($reponse)); $info['password'] = self::getByte($reponse); $info['secure'] = self::getByte($reponse); return $info; } return false; } public function queryGS2($host, $port) { $reponse = self::ping($host, $port, "\xFE\xFD\x00PiNG\xFF\x00\x00"); if ($reponse === false || substr($reponse, 0, 5) !== "\x00PiNG") { return false; } $info = array(); $reponse=substr($reponse, 5); while($reponse != '') { $info[self::getString($reponse)] = self::getString($reponse); } return $info; } public function queryQuake3($host, $port) { $reponse = self::ping($host, $port, "\xFF\xFF\xFF\xFFgetstatus\x00"); if ($reponse === false || substr($reponse, 0, 5) !== "\xFF\xFF\xFF\xFFs") { return false; } $reponse = substr($reponse, strpos($reponse, chr(10))+2); $info = array(); $joueurs = substr($reponse, strpos($reponse,chr(10))+2); $reponse = substr($reponse, 0, strpos($reponse, chr(10))); while($reponse != ''){ $info[self::getString($reponse, '\\')] = self::getString($reponse, '\\'); } if (!empty($joueurs)) { $info['players'] = array(); while ($joueurs != ''){ $details = self::getString($joueurs, chr(10)); $info['players'][] = array('frag' => self::getString($details, ' '), 'ping' => self::getString($details, ' '), 'name' => $details); } } return $info; } public function queryDoom3($host, $port) { $reponse = self::ping($host, $port, "\xFF\xFFgetInfo\x00PiNGPoNG\x00"); if ($reponse === false || substr($reponse, 0, 5) !== "\xFF\xFFinf") { return false; } $reponse = substr($reponse, strpos($reponse, chr(0).chr(0))+2); while($reponse != '') { $variable = self::getString($reponse); $valeur = self::getString($reponse); if (empty($variable) && empty($valeur)) break; $info[$variable] = $valeur; } $info['players'] = array(); while (self::getInteger8($reponse) != 32 && $reponse != '') { $info['players'][] = array('ping' => self::getInteger16($reponse), 'frag' => self::getInteger32($reponse), 'name' => htmlentities(self::getString($reponse))); $reponse = substr($reponse, 1); } return $info; } public function queryMinecraft($host, $port) { $socket = @fsockopen( $host, $port, $errno, $errstr, 2); if (!$socket) { return false; } $header = "\x00"; // Packet ID $header .= "\x04"; // Protocol Version $header .= pack('c', strlen($host)) . $host; // server host + its length $header .= pack('n', $port); // server port $header .= "\x01"; // status $payload = pack('c', strlen($header)) . $header . "\x01\x00"; fwrite($socket, $payload); // handshake $length = self::getVarInt($socket); if($length < 15) { return false; } fgetc($socket); // Ping $length = self::getVarInt($socket); //payload $data = ''; while ($length != strlen($data) && $block = fread($socket, $length)) { $data .= $block; } if (strlen($data) < $length || $data === false) { return false; //Oh oh... } return json_decode($data, true); } } function parse_minecraft_string ($string) { $colors = array ( 1 => '#4c00c8', 2 => '#00d400', 3 => '#00c1c1', 4 => '#be0000', 5 => '#c900c3', 6 => '#d2ac00', 7 => '#bcbcbc', 8 => '#414141', 9 => '#7400ff', 0 => '#000000', 'a' => '#00ff00', 'b' => '#34ffff', 'c' => '#ff0000', 'd' => '#ff00ff', 'e' => '#eeff00', 'f' => '#ffffff', 'r' => '#ffffff', ); $format = array( 'l' => 'font-weight:bold;', 'm' => 'text-decoration: line-through', 'n' => 'text-decoration: underline', 'o' => 'font-style:italic', 'r' => '', ); foreach($colors as $a => $color) { $search[] = chr(194) . chr(167) . $a; $replace[] = '</span><span style="color: ' . $color . ';">'; } foreach($format as $a => $style) { $search[] = chr(194) . chr(167) . $a; $replace[] = ''; } return '<span>' . str_replace($search, $replace, $string) . '</span>'; } I mam kłopot z dokładnie tą funkcją: protected function ping($host, $port, $command) { $socket = \IPS\Http\Url::external('udp://'.$host.':'.$port)->request()->get(); if (!$errno && $socket) { stream_set_timeout($socket, 2); fwrite($socket, $command); $buffer = @fread($socket, 1500); fclose($socket); return $buffer; } return false; } Oryginalna wygląda tak: private static function ping($host, $port, $command) { $socket = @stream_socket_client('udp://'.$host.':'.$port, $errno, $errstr, 2); if (!$errno && $socket) { stream_set_timeout($socket, 2); fwrite($socket, $command); $buffer = @fread($socket, 1500); fclose($socket); return $buffer; } return false; } Jest ktoś w stanie mi pomóc? Z góry dziękuję
  3. (GS) Player Panel [AMX Mod X]

    No nie wysłał, twierdzi że Cię zablokował. Nie zabraniam Ci pisać aplikacji ale wytłumacz dlaczego 1:1 skopiowałeś ode mnie design? Menu z ikonkami i tym samym tekstem, lista banów, popup dot. szczegółów bana, apelacje i skargi. Reszta faktycznie Twoja.
  4. (GS) Player Panel [AMX Mod X]

    Nawet się nic nie dowiedziałem na ten temat.
  5. (GS) Player Panel [AMX Mod X]

    Nie polecam, projekt kradziony.
  6. Witam, mam problem z autocmplete, konsola wywala błąd z JS $output = '<script type="text/javascript"> new ipb.Autocomplete( $(\'main_search\'), { multibox: false, url: ipb.vars[\'base_url\'] + app=core&module=ajax&section=findnames&do=get-member-names&secure_key=\' + ipb.vars[\'secure_hash\'] + \'&name=\', templates: { wrap: ipb.templates[\'autocomplete_wrap\'], item: ipb.templates[\'autocomplete_item\'] } } ); </script><h3 class="maintitle">Gracze</h3><br /> <div id="search" style="width: 400px"> <form action="#" method="post" id="search-box"> <fieldset> <span id="search_wrap"> <input type="text" id="main_search" name="entered_name" class="" size="17" tabindex="1" placeholder="Wyszukiwanie..."> <span id="search_options" style="">Nazwa konta</span> <input type="submit" class="submit_input clickable" value=""> </span> </fieldset> </form> </div>'; SyntaxError: Left hand side of operator '=' must be a reference. Proszę o pomoc ;/
  7. Tylko buildandfetch daje 1 rekord a ja potrzebuje pętle ;/
  8. while ($row = $this->registry->DB('samp_db')->buildAndFetch( array( 'select' => 'lastvisit, name, premium, premiumtime, skin, online', 'from' => 'Accounts', 'where' => 'premium>=1', 'order'=> 'premium desc' ))) { $output .= '<tr class="row2"> <td style="text-align: center;">'.$panel->formatSkin($row['skin']).'</td> <td style="text-align: center;">'.$panel->formatName($row['name'], '1').' ('.$panel->formatName($row['name'], '2').')</td> <td style="text-align: center;">'; if ($row['online'] == 1) { $output .= '<span data-tooltip="Aktualnie przebywa na serwerze." class="ipsBadge ipsBadge_green">Aktywny</span>'; } else { $output .= '<span class="ipsText_small desc">'.$this->registry->class_localization->getDate( $row['lastvisit'], 'LONG', 1, 1 ).'</span>'; } $output .= '</td> <td style="text-align: center;"><span class="ipsText_small desc">'.$this->registry->class_localization->getDate( $row['premiumtime'], 'LONG', 1, 1 ).'</span></td> </tr>'; } i error 500
  9. Chodzi bardziej o to, że print_r($this->registry->DB('samp_db')->fetch()); daje 1 rekord: Array( [lastvisit] => 1445788842 [name] => Comb [premium] => 2 [premiumtime] => 2147483647 [skin] => 21 [online] => 0 )
  10. Witam, mam problem z zapytaniem SQL w IP.Board 3, mianowicie wyświetla mi tylko pierwszy rekord, jest ktoś w stanie naprowadzić mnie na błąd? $this->registry->DB('samp_db')->build( array( 'select' => 'lastvisit, name, premium, premiumtime, skin, online', 'from' => 'Accounts', 'where' => 'premium>=1', 'order'=> 'premium desc' )); $this->registry->DB('samp_db')->execute(); while ($row = $this->registry->DB('samp_db')->fetch()) { $output .= '<tr class="row2"> <td style="text-align: center;">'.$panel->formatSkin($row['skin']).'</td> <td style="text-align: center;">'.$panel->formatName($row['name'], '1').' ('.$panel->formatName($row['name'], '2').')</td> <td style="text-align: center;">'; if ($row['online'] == 1) { $output .= '<span data-tooltip="Aktualnie przebywa na serwerze." class="ipsBadge ipsBadge_green">Aktywny</span>'; } else { $output .= '<span class="ipsText_small desc">'.$this->registry->class_localization->getDate( $row['lastvisit'], 'LONG', 1, 1 ).'</span>'; } $output .= '</td> <td style="text-align: center;"><span class="ipsText_small desc">'.$this->registry->class_localization->getDate( $row['premiumtime'], 'LONG', 1, 1 ).'</span></td> </tr>'; }
  11. Witam, mam na sprzedanie szablon pod IP.Board 3.4 (Aplikacja od SSów trochę przycięła.) Cena jaka mnie interesuje to 300PLN. Kontakt GG:10055455 Dorzucam PSD do szablonu.
  12. dam caly kod, $check = \IPS\Db::i()->select( 'id', 'amx_rejestracja_konta', array('ipsid=?', \IPS\Member::loggedIn()->member_id) ); $check = count($check); if (!$check) { $form = new \IPS\Helpers\Form( 'form', 'amxPanel_auth'); $form->addHeader(\IPS\Member::loggedIn()->language()->addToStack( 'amxPanel_auth_header' )); $form->add( new \IPS\Helpers\Form\Text( 'amxPanel_auth_name', NULL, TRUE, array( 'minLength' => 2, 'maxLength' => 20), NULL, NULL, NULL, 'nazwa' ) ); $form->add( new \IPS\Helpers\Form\Password('amxPanel_auth_pass', NULL, TRUE, array( 'minLength' => 2, 'maxLength' => 20 ), NULL, NULL, NULL, 'pass' ) ); if ($values = $form->values()) { try { $check_values = \IPS\Db::i()->select( 'id', 'amx_rejestracja_konta', array("Name=? AND Password=?", $values['amxPanel_auth_name'], $values['amxPanel_auth_pass']) )->first(); } catch( \UnderflowException $e ) {} if ($check_values['id']) { try { $check_authed = \IPS\Db::i()->select( 'id', 'amx_rejestracja_konta', array("Name=? AND ipsid=?", $values['amxPanel_auth_name'], 0) )->first(); } catch( \UnderflowException $e ) {} if ($check_authed) { \IPS\Db::i()->update( 'amx_rejestracja_konta', array( "Name=? AND ipsid=?", $values['amxPanel_auth_name'], \IPS\Member::loggedIn()->member_id ) )->first(); \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Zautoryzowano konto.') ); } else { \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Podane konto jest już zautoryzowane') ); } } else { \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Podane dane są nieprawidłowe.') ); } } \IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'main' )->authArea($form); zmienilem requesty na $values, dodalem try catch i to samo ;x
  13. Tak to ma wyglądać? if ($values = $form->values()) { try { $check_values = \IPS\Db::i()->select( 'id', 'amx_rejestracja_konta', array("Name=? AND Password=?", \IPS\Request::i()->amxPanel_auth_name, \IPS\Request::i()->amxPanel_auth_pass) )->first(); } catch( \UnderflowException $e ) { if ($check_values['id']) { $check_authed = \IPS\Db::i()->select( 'id', 'amx_rejestracja_konta', array("Name=? AND ipsid=?", \IPS\Request::i()->amxPanel_auth_name, 0) )->first(); if ($check_authed) { \IPS\Db::i()->update( 'amx_rejestracja_konta', array( "Name=? AND ipsid=?", \IPS\Request::i()->amxPanel_auth_name, \IPS\Member::loggedIn()->member_id ) )->first(); \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Zautoryzowano konto.') ); } else { \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Podane konto jest już zautoryzowane') ); } } else { \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Podane dane są nieprawidłowe.') ); } } }
  14. Witam, mam problem z funkcją first(), mianowicie to zapytanie: $check_values = \IPS\Db::i()->select( 'id', 'amx_rejestracja_konta', array("Name=? AND Password=?", \IPS\Request::i()->amxPanel_auth_name, \IPS\Request::i()->amxPanel_auth_pass) )->first(); Daje ten błąd: Reszta kodu $check = \IPS\Db::i()->select( 'id', 'amx_rejestracja_konta', array('ipsid=?', \IPS\Member::loggedIn()->member_id) ); $check = count($check); if (!$check) { $form = new \IPS\Helpers\Form( 'form', 'amxPanel_auth'); $form->addHeader(\IPS\Member::loggedIn()->language()->addToStack( 'amxPanel_auth_header' )); $form->add( new \IPS\Helpers\Form\Text( 'amxPanel_auth_name', NULL, TRUE, array( 'minLength' => 2, 'maxLength' => 20), NULL, NULL, NULL, 'nazwa' ) ); $form->add( new \IPS\Helpers\Form\Password('amxPanel_auth_pass', NULL, TRUE, array( 'minLength' => 2, 'maxLength' => 20 ), NULL, NULL, NULL, 'pass' ) ); if ($values = $form->values()) { $check_values = \IPS\Db::i()->select( 'id', 'amx_rejestracja_konta', array("Name=? AND Password=?", \IPS\Request::i()->amxPanel_auth_name, \IPS\Request::i()->amxPanel_auth_pass) )->first(); if ($check_values['id']) { $check_authed = \IPS\Db::i()->select( 'id', 'amx_rejestracja_konta', array("Name=? AND ipsid=?", \IPS\Request::i()->amxPanel_auth_name, 0) )->first(); if ($check_authed) { \IPS\Db::i()->update( 'amx_rejestracja_konta', array( "Name=? AND ipsid=?", \IPS\Request::i()->amxPanel_auth_name, \IPS\Member::loggedIn()->member_id ) )->first(); \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Zautoryzowano konto.') ); } else { \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Podane konto jest już zautoryzowane') ); } } else { \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Podane dane są nieprawidłowe.') ); } } \IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'main' )->authArea($form); Próbowałem try catch lecz wtedy wyświetla komunikat o nieprawidłowych danych, bardzo proszę o pomoc ;x
×

Ważne informacje

Kontynuując przeglądanie strony, wyrażasz zgodę na używanie przez nas plików cookies.