Перейти к содержанию

xlest

Пользователи
  • Публикаций

    107
  • Зарегистрирован

  • Посещение

  • Победитель дней

    1
  • Отзывы

    0%

xlest стал победителем дня 2 апреля 2019

xlest имел наиболее популярный контент!

Репутация

18

4 Подписчика

Информация о xlest

  • Звание
    Постелил коврик

Посетители профиля

5610 просмотров профиля
  1. Если есть деньги почему бы некупить готовый? В чем странность
  2. Дело в том что лицензия у меня есть, меня интересует именно датапак и концепция готовая, так как самому лень делать...
  3. Датапак родной или с концепцией?
  4. xlest

    Unitpay и lucera 1.7

    Скину на пивко пару соток кто подскажет
  5. xlest

    Unitpay и lucera 1.7

    Кто может поправить код для автовыдачи доната (поправить названия таблиц) в данном варианте приходят только после релога игрока таблицы итемделей в люцере нет, тут как временная используется character_items <?php include_once 'ConfigWritter.php'; class Model { private $mysqli; static function getInstance() { return new self(); } private function __construct() { $config = ConfigWritter::getInstance(); $dbhost = $config->getParameter('DB_HOST'); $dbname = $config->getParameter('DB_NAME'); $dbpass = $config->getParameter('DB_PASS'); $dbuser = $config->getParameter('DB_USER'); $dbport = $config->getParameter('DB_PORT'); if (empty($dbhost) || empty($dbname) || empty($dbuser)) { throw new Exception('Не установлены конфигурационные параметры для соединения с БД'); } $dbport = empty($dbport)?ini_get("mysqli.default_port"):$dbport; $this->mysqli = @new mysqli ( $dbhost, $dbuser, $dbpass, $dbname, $dbport ); $this->mysqli->query("SET NAMES 'utf8'"); /* проверка подключения */ if (mysqli_connect_errno()) { throw new Exception('Не получается соединиться с БД, проверьте правильность параметров. Ошибка: ' . mysqli_connect_error()); } } function searchItemTableName() { $type = null; if(mysqli_query($this->mysqli, 'select 1 from items_delayed') !== FALSE) { $type = 'items_delayed'; } else if(mysqli_query($this->mysqli, 'select 1 from `character_items`') !== FALSE) { $type = 'character_items'; } else if(mysqli_query($this->mysqli, 'select 1 from `items`') !== FALSE) { $type = 'items'; } return $type; } function searchCharsTableName() { if(mysqli_query($this->mysqli, 'select 1 from `characters`') !== FALSE) { return 'characters'; } return false; } function getChar($charName) { $query = ' SELECT * FROM characters WHERE char_name = "'.$this->mysqli->real_escape_string($charName).'" LIMIT 1 '; $result = $this->mysqli->query($query); if (!$result->num_rows) { //result } return $result->fetch_object(); } function addItemToChar($charId, $itemId, $itemsCount = 1) { $itemTable = ConfigWritter::getInstance()->getParameter('ITEM_TABLE'); switch ($itemTable) { case 'character_items': $result = $this->mysqli->query("SELECT max(payment_id) as maxId FROM character_items"); $maxId = $result->fetch_object(); $maxId = $maxId->maxId; return $this->mysqli->query("INSERT INTO `character_items` (`payment_id`, `owner_id`, `item_id`, `count`, `payment_status`, `description`) VALUES ('".($maxId+1)."', '".$charId."', '".$itemId."', '".$itemsCount."', '0', 'Unitpay')"); break; case 'items': $query = ' INSERT INTO character_items (owner_id, item_id, count, enchant_level) VALUES ( "'.$this->mysqli->real_escape_string($charId).'", "'.$this->mysqli->real_escape_string($itemId).'", "'.$this->mysqli->real_escape_string($itemsCount).'", 0 ) '; return $this->mysqli->query($query); break; case 'items': default: $query = ' SELECT * FROM items WHERE item_id = "'.$this->mysqli->real_escape_string($itemId).'" and owner_id = "'.$this->mysqli->real_escape_string($charId).'" LIMIT 1 '; $item = $this->mysqli->query($query)->fetch_object(); // Если предмет у персонажа есть, то наращиваем его if ($item && $item->count) { $query = ' UPDATE items SET count = "'.($item->count + $itemsCount).'" WHERE object_id = "'.$item->object_id.'"'; // В противном случае создаем новый в его инвентаре } else { $result = $this->mysqli->query("SELECT max(object_id) as maxId FROM items"); $maxId = $result->fetch_object(); $maxId = $maxId->maxId; $query = ' INSERT INTO character_items (object_id, owner_id, item_id, count, enchant_level, loc) VALUES ( "'.($maxId+1).'", "'.$this->mysqli->real_escape_string($charId).'", "'.$this->mysqli->real_escape_string($itemId).'", "'.$this->mysqli->real_escape_string($itemsCount).'", 0, "INVENTORY" ) '; } return $this->mysqli->query($query); } } function removeItemFromChar($charId, $itemId, $itemsCount = 1) { $itemTable = ConfigWritter::getInstance()->getParameter('ITEM_TABLE'); switch ($itemTable) { case 'character_items': $sql = " DELETE FROM character_items WHERE owner_id = ".$this->mysqli->real_escape_string($charId)." AND item_id = ".$this->mysqli->real_escape_string($itemId)." AND count = ".$this->mysqli->real_escape_string($itemsCount)." LIMIT 1 "; return $this->mysqli->query($sql); break; case 'items': default: $sql = ' SELECT * FROM items WHERE item_id = "'.$this->mysqli->real_escape_string($itemId).'" and owner_id = "'.$this->mysqli->real_escape_string($charId).'" LIMIT 1 '; $item = $this->mysqli->query($sql) ->fetch_object(); if ($item && $item->count) { $query = ' UPDATE items SET count = "'.($item->count - $itemsCount).'" WHERE object_id = "'.$item->object_id.'"'; return $this->mysqli->query($query); } return; break; } } function createPayment($unitpayId, $charId, $sum, $itemsCount) { $query = ' INSERT INTO unitpay_payments (unitpayId, account, sum, itemsCount, dateCreate, status) VALUES ( "'.$this->mysqli->real_escape_string($unitpayId).'", "'.$this->mysqli->real_escape_string($charId).'", "'.$this->mysqli->real_escape_string($sum).'", "'.$this->mysqli->real_escape_string($itemsCount).'", NOW(), 0 ) '; return $this->mysqli->query($query); } function cancelPaymentByUnitpayId($unitpayId) { $query = ' UPDATE unitpay_payments SET status = 2, dateComplete = NOW() WHERE unitpayId = "'.$this->mysqli->real_escape_string($unitpayId).'" LIMIT 1 '; return $this->mysqli->query($query); } function getPaymentByUnitpayId($unitpayId) { $query = ' SELECT * FROM unitpay_payments WHERE unitpayId = "'.$this->mysqli->real_escape_string($unitpayId).'" LIMIT 1 '; $result = $this->mysqli->query($query); return $result->fetch_object(); } function confirmPaymentByUnitpayId($unitpayId) { $query = ' UPDATE unitpay_payments SET status = 1, dateComplete = NOW() WHERE unitpayId = "'.$this->mysqli->real_escape_string($unitpayId).'" LIMIT 1 '; return $this->mysqli->query($query); } }
  6. Такой бред автора просто невозможно читать. Испанский стыд
  7. xlest

    Лаги на сервере

    Xmx3550m вроде как маловато остается самой впски
  8. xlest

    Лаги на сервере

    Как минимум заглянуть для начала в батник и проверить что там выставлено по ОЗУ
  9. xlest

    Лаги на сервере

    тачка 4гб оперативы всё хорошо
  10. xlest

    L2J-Dev

    Привет напиши свой скайп
  11. Да это топ .. сервер только админа . Спс помогло. Лайк
  12. Кто в шс даст фикс . Дам -
×
×
  • Создать...