-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdebug-investigation.php
More file actions
49 lines (41 loc) · 1.9 KB
/
debug-investigation.php
File metadata and controls
49 lines (41 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
require_once __DIR__ . '/lib/Database.php';
try {
$db = Database::getInstance();
echo "=== Negotiation Status Counts ===\n";
$statusCounts = $db->query("SELECT status, COUNT(*) as count FROM negotiations GROUP BY status");
foreach ($statusCounts as $row) {
echo "{$row['status']}: {$row['count']}\n";
}
echo "\n";
echo "=== Rejected Negotiations (Last 5) ===\n";
$rejected = $db->query("SELECT id, initiator_name, responder_name, chemical, type, last_offer_by, updated_at FROM negotiations WHERE status = 'rejected' ORDER BY updated_at DESC LIMIT 5");
if (empty($rejected)) {
echo "No rejected negotiations found.\n";
}
foreach ($rejected as $row) {
echo "ID: {$row['id']}\n";
echo " Initiator: {$row['initiator_name']} ({$row['type']})\n";
echo " Responder: {$row['responder_name']}\n";
echo " Chemical: {$row['chemical']}\n";
echo " Last Offer By: {$row['last_offer_by']}\n";
echo " Time: " . date('Y-m-d H:i:s', $row['updated_at']) . "\n";
// Get offers for this negotiation
$offers = $db->query("SELECT from_team_name, price, quantity, heat_total, created_at FROM negotiation_offers WHERE negotiation_id = ? ORDER BY created_at ASC", [$row['id']]);
echo " Offers:\n";
foreach ($offers as $offer) {
echo " - {$offer['from_team_name']}: {$offer['quantity']} @ {$offer['price']} (Heat: {$offer['heat_total']})\n";
}
echo "\n";
}
echo "=== NPC Configuration ===\n";
$configs = $db->query("SELECT key, value FROM config WHERE key LIKE '%npc%'");
foreach ($configs as $row) {
// Truncate value if too long
$val = $row['value'];
if (strlen($val) > 100) $val = substr($val, 0, 100) . "...";
echo "{$row['key']}: $val\n";
}
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
}