예제 #1
0
     $all_bots[$bot["bot_id"]] = $bot;
     if ($trade_bot_id == -1 && $bot["bot_item_count"] + ($item_count - count($bot_items[$bot["bot_id"]])) < 1000) {
         $trade_bot_id = $bot["bot_id"];
     }
 }
 if ($trade_bot_id != -1) {
     $secure_LOLOL_code = strtoupper(substr(str_shuffle(MD5(microtime())), 0, 5));
     query_newTrade($mysqli, $trade_id, $_SESSION["user_id"], $trade_bot_id, 'w', $secure_LOLOL_code);
     $output_array["trade_id"] = $trade_id;
     foreach ($bot_items[$trade_bot_id] 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);
     }
     if (count($bot_items) > 1) {
         query_updateTrade($mysqli, $trade_id, 13);
         query_newMultiTrade($mysqli, $multi_trade_id, $trade_id);
         $successful_item_count = 0;
         foreach ($bot_items as $bot_id => $each_bot_items) {
             if ($bot_id == $trade_bot_id) {
                 continue;
             }
             $successful_item_count += count($each_bot_items);
             query_newTrade($mysqli, $specific_trade_id, $all_bots[$bot_id]["bot_user_id"], $trade_bot_id, 't', "00000");
             query_setTrade_MultiTradeID($mysqli, $specific_trade_id, $multi_trade_id);
             foreach ($each_bot_items as $item) {
                 query_getItemInformationByInfoID($mysqli, $item_info, $item["item_information_id"]);
                 query_addItemToTrade($mysqli, $specific_trade_id, $item["asset_id"], $item["item_id"], $item_info["class_id"], $item_info["price"]);
                 query_setItemWithdrawn($mysqli, $item["item_id"], 2);
             }
         }
예제 #2
0
                 //
                 //NEED TO SET NEW ITEM ID OF EACH TRADE ITEM
                 //
                 //
                 if (isset($multi_trade)) {
                     query_addItemToTrade($mysqli, $multi_trade["final_trade_id"], $asset_id, $db_item_id, $item_info["class_id"], $item_info["price"]);
                     query_setItemWithdrawn($mysqli, $db_item_id, 2);
                     query_getTradesByMultiTradeID($mysqli, $trades, $trade["multi_trade_id"]);
                     $all_done = true;
                     foreach ($trades as $individual_trades) {
                         if ($individual_trades["trade_status"] != 3) {
                             $all_done = false;
                         }
                     }
                     if ($all_done) {
                         query_updateTrade($mysqli, $multi_trade["final_trade_id"], 0);
                     }
                 }
                 echo "completed";
             }
         }
     }
 } else {
     if ($updated_trade["trade_type"] == "w") {
         query_getTradeItems($mysqli, $trade_items, $_POST["trade_id"]);
         foreach ($trade_items as $item) {
             query_setItemWithdrawn($mysqli, $item["item_id"], 1);
         }
         $items_count = count($trade_items);
         query_getBotBySteamID($mysqli, $bot, $_POST["bot_steam_id"]);
         query_getBotItemCountByBotID($mysqli, $bot_item_count, $bot["bot_id"]);