Esempio n. 1
0
                     } else {
                         $output_array["error"] = true;
                         $output_array["errorMsg"] .= "You've bypassed the deposit page and info for that item doesn't exist! Don't.\n";
                     }
                 } else {
                     $output_array["error"] = true;
                     $output_array["errorMsg"] .= "That item's not really yours (you cheater).\n";
                 }
             }
             if (count($valid_item_list) > 0) {
                 $secure_LOLOL_code = strtoupper(substr(str_shuffle(MD5(microtime())), 0, 5));
                 query_newTrade($mysqli, $trade_id, $_SESSION["user_id"], $trade_bot_id, 'd', $secure_LOLOL_code);
                 $output_array["trade_id"] = $trade_id;
                 foreach ($valid_item_list as $valid_item) {
                     $successful_item_count++;
                     query_addItemToTrade($mysqli, $trade_id, $valid_item->item, -1, $valid_item->classid, $valid_item->item_price);
                 }
                 //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 + $successful_item_count;
                 query_updateBotItemCount($mysqli, $trade_bot_id, $total_item_count);
             }
         } else {
             $output_array["error"] = true;
             $output_array["errorMsg"] .= "Cannot create deposit trade, not enough space on bots.\n";
         }
     }
 } else {
     $output_array["error"] = true;
     $output_array["errorMsg"] .= "No items selected for deposit.\n";
 }
Esempio n. 2
0
         $trade_bot_id = -1;
         foreach ($bots as $bot) {
             $all_bots[$bot["bot_id"]] = $bot;
             if ($bot["bot_type"] == 1) {
                 if ($bot["bot_item_count"] + $item_count < 1000) {
                     $trade_bot_id = $bot["bot_id"];
                     break;
                 }
             }
         }
         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);
Esempio n. 3
0
     $total_item_count = $bot_item_count - $items_count;
     query_updateBotItemCount($mysqli, $from_bot["bot_id"], $total_item_count);
     $multi_trade = null;
     if ($trade["multi_trade_id"] != -1) {
         query_getMultiTradeByMultiTradeID($mysqli, $multi_trade, $trade["multi_trade_id"]);
     }
     foreach ($asset_ids as $asset_id) {
         query_getItemInformationByClassID($mysqli, $item_info, $bot_inventory->{$asset_id}->classid);
         $db_item_id = query_depositItem($mysqli, $item_info["item_information_id"], $user_id, $asset_id, $bot["bot_id"]);
         //
         //
         //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";
     }
 }