Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# ShopMC
MC Shop

## Logging
This plugin records shop transactions either to a local YAML file or to a
MySQL database. Logging and lookups run asynchronously to avoid blocking the
server thread. When using MySQL, the table is created with indexes on the
player and timestamp columns to keep queries fast.
## Commands
- `/shop [buy|price|search|admin]` – Buy from the server shop or open GUI
- `/sell <material> <qty>` – Sell to the server shop
- `/sellall` – Sell all sellable items in your inventory
- `/shoplog [player] [limit]` – View transaction log
- `/weeklyshop` – Show weekly shop items

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ private void init() throws Exception {
"amount DOUBLE NOT NULL," +
"INDEX idx_player_time (player, time_ms)" +
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4");
// Ensure efficient global queries by indexing by time as well
st.executeUpdate("CREATE INDEX IF NOT EXISTS idx_time_ms ON servershop_transactions(time_ms)");
}
}

Expand Down
Loading