} } } if ($trade_bot_id != -1) { foreach ($bot_items as $bot_id => $each_bot_items) { query_newTrade($mysqli, $trade_id, $all_bots[$trade_bot_id]["bot_user_id"], $bot_id, 'w', "00000"); foreach ($each_bot_items as $item) { query_getItemInformationByInfoID($mysqli, $item_info, $item["item_information_id"]); query_addItemToTrade($mysqli, $trade_id, $item["asset_id"], $item["item_id"], $item_info["class_id"], $item_info["price"]); query_setItemWithdrawn($mysqli, $item["item_id"], 2); } } //Add the successful items to the amount... we'll update this on the bot query_getBotItemCountByBotID($mysqli, $bot_item_count, $trade_bot_id); $total_item_count = $bot_item_count + $db_house_item_count; query_updateBotItemCount($mysqli, $trade_bot_id, $total_item_count); } else { $result["hold_bots_full"] = true; } } } echo $total_value . " - (" . $totalTakeAmount . " - " . $leftTakeAmount . ")\r\n"; $win_value = $total_value - ($totalTakeAmount - $leftTakeAmount); query_setPotWinning($mysqli, $current_pot_id, $winner_id, $total_value, $totalTakeAmount - $leftTakeAmount, $choice_number); $result["total_value"] = $total_value; $result["win_value"] = $win_value; $result["win_choice"] = $choice_number; $context = new ZMQContext(); $socket = $context->getSocket(ZMQ::SOCKET_PUSH, 'my pusher'); $socket->connect("tcp://localhost:5555"); $messageDataItems = array('subscribedTopic' => "newUserItems", 'toSpecificUser' => $winner_id, 'itemsList' => $itemsList);
$total_item_count = $bot_item_count - $items_count; query_updateBotItemCount($mysqli, $bot["bot_id"], $total_item_count); echo "completed"; } } } else { if ($_POST["trade_status"] == 1 || $_POST["trade_status"] == 4 || $_POST["trade_status"] == 5 || $_POST["trade_status"] == 6 || $_POST["trade_status"] == 7 || $_POST["trade_status"] == 8 || $_POST["trade_status"] == 10 || $_POST["trade_status"] == 12 || $_POST["trade_status"] == 14 || $_POST["trade_status"] == 15 || $_POST["trade_status"] == 16 || $_POST["trade_status"] == 17 || $_POST["trade_status"] == 18) { query_getTradeItems($mysqli, $trade_items, $_POST["trade_id"]); if ($updated_trade["trade_type"] == "w") { query_getUserBySteamID($mysqli, $user_id, $_POST["user_steam_id"]); foreach ($trade_items as $item) { query_returnFailedTradeItem($mysqli, $item["item_id"], $user_id); } } else { if ($updated_trade["trade_type"] == "d") { $items_count = count($trade_items); query_getBotBySteamID($mysqli, $bot, $_POST["bot_steam_id"]); query_getBotItemCountByBotID($mysqli, $bot_item_count, $bot["bot_id"]); $total_item_count = $bot_item_count - $items_count; query_updateBotItemCount($mysqli, $bot["bot_id"], $total_item_count); } } } } } if ($success) { echo "success"; } } else { echo "invalidpassword"; }