ChestShop Notifier
Note: The latest version of this plugin works with every UUID-compatible CraftBukkit or Spigot version!
CSN (ChestShop Notifier) is a plugin that records ChestShop transactions to a SQLite or MySQL database. When a shop owner logs onto the server, they will be presented with an option to view sales from when they were offline.
Installation Instructions
Commands
- /csn help → Shows available commands
- /csn history [<page>] → Shows unread sale history from database
- /csn history [<username> [<page>]] → Shows sale history of another player
- /csn clear [<usernamse>] → Marks all sale history as read for your user
- /csn cleandatabase → Remove database entries. Parameters:
--older-than, -o days
→ Removes entries older than days--user, -user username/uuid
→ Removes entries from a single user only--read-only, -r
→ Removes only read entries, default behaviour--all, -a
→ Removes all entries - /csn upload → Forces the plugin to upload all data to the database (in v1.1 and higher this should be only used after database connection problems!)
- /csn reload → Reloads configuration and connects to database using new config
- /csn convert → Converts the database table csn to UUIDs. (table csn gets converted in csnUUID and the username table renamed to csnOLD)
Permissions
- csn.user → Allows user to receive notifications when they log in, and access to /csn history.
- csn.admin → Super permission node. Access to all commands. (especially upload, reload and convert)
For all permissions take a look at the plugin.yml
Config
# Chest Shop Notifier<br /> logging: admin-shop: true notifications: notify-on-user-join: true delay-seconds: 5 history: max-rows: 10 query-limit: 10000 debugging: verbose: true database: # Possible types: SQLite and MySQL type: sqlite dbname: 'database' # MySQL specific settings host: 'localhost' port: 3306 username: 'dbadmin' password: '123456' ssl: false clean-on-startup: enabled: false parameters: "--older-than 30 --all" messages: sales: "&c ** You made &f{sales} sales&c since you last checked." history-cmd: "&c ** To see them, type &f/csn history&c." history-caption: "&dChestShop Notifier // &7Latest Commissions" history-empty: "&cNothing to show." history-bought: "&a+ &9{player} &7bought &a{count}x&9{item} &f{timeago}&7 ago &a(+{money})" history-bought-read: "&a+ &7{player} &8bought &a{count}x&7{item} &7{timeago}&8 ago &a(+{money})" history-sold: "&c- &9{player} &7sold you &c{count}x&9{item} &f{timeago}&7 ago &c(-{money})" history-sold-read: "&c- &7{player} &8sold you &c{count}x&7{item} &7{timeago}&8 ago &c(-{money})" history-footer-page: "&c- Page &f{current}&c/&f{pages}&6 - &7/csn history <page>" history-footer-clear: "&f- &cTo remove all old entries, type /csn clear" history-clear: "&cHistory cleared! New sales will continue to be recorded." history-marked-read: "&cUnread entries marked read!" history-others-not-allowed: "&cYou are not allowed to check the history of {username}" # new translations reload-cmd: "&dChestShop Notifier // &7Reloading, please wait..." reload-success: "&aReloaded!" reload-database-success: "&aDatabase connected!" reload-database-fail: "&cDatabase failed to connect!" user-not-found: "&cThe user '{player}' was not found." page-not-found: "&e{page} &cis not a valid page number input for /csn history <page>!" page-not-found-other: "&e{page} &cis not a valid page number input for /csn history <user> <page>!" database-error: "&cInvalid database connection. Please edit config and /csn reload." database-error-oncommand: "&cDatabase error while executing this command!" database-cleaned: "&cCleaned database from {amount} entries!" database-uploaded: "&cBatch executed!" database-convert: "&cAttempting to convert database..." database-convert-fail: "&cError while trying to convert! Maybe you don't have a 'csn' table?" database-converted: "&cDatabase converted!" unrecognized-command: "&cCommand not recognized. Type /csn help for help." missing-arguments: "&cMissing parameter arguments: {usage}" invalid-number: "&c{typo} is not a valid number input for {usage}!" invalid-username: "&c{typo} is not a valid username/uuid input for {usage}!" missing-permission: "&cYou don't have the permission {permission}!" help: header: "&dChestShop Notifier // &7Commands" help: "&7 /csn &dhelp &f- Plugin usage & commands" history: "&7 /csn &dhistory [<page>]&f- View sales" clear: "&7 /csn &dclear &f- Remove read sales" history-others: "&7 /csn &dhistory <username> [<page>]&f- View sales of another account" clear-others: "&7 /csn &dclear <username>&f- Remove read sales of another account" cleandatabase: "&7 /csn &ccleandatabase &f- Remove database entries. Parameters:" cleandatabase-older-than: "&c --older-than, -o <days> &f- Removes entries older than <days>" cleandatabase-user: "&c --user, -user <username/uuid> &f- Removes entries from a single user only" cleandatabase-read-only: "&c --read-only, -r &f- Removes only read entries, default behaviour" cleandatabase-all: "&c --all, -a &f- Removes all entries" upload: "&7 /csn &cupload &f- Force update databases" convert: "&7 /csn &cconvert &f- Convert database to UUIDs" reload: "&7 /csn &creload &f- Reload configuration"
Requirements
- ChestShop installed and running.
- Optionally: MySQL server if you want to store the information in a real database/share it between servers.
Planned Features
UUID supportdone in v1.1.2Look up the sales of offline playersdone in v1.1.2Ignore ChestShop's Admin Shopdone in v1.1.2History paginationdone in v1.2SQLite supportdone in v1.3.3- Auto updater & version checker
- Translation system (partially done in v1.1.2, you can set your own messages in the config)
For more features and suggestion use the GitHub issues page!
Source Code & Dev Builds
- You can view the source code online at:
https://github.com/ChestShop-authors/ChestShopNotifier - Development builds are available on the Minebench.de Jenkins build server:
http://ci.minebench.de/job/ChestShopNotifier/
Donations
Feel free to comment with your ideas, bugs, or requests, ideally by opening an issue on the github repo.
If you really want to monetarily then click here.
The Database loads and it also created a table, but the table has no entries, what can i do?
I recently updated ChestShop and reset the config. The default naming of an admin shop in the config file is "Admin Shop", so I proceeded to change all my shops from "AdminShop" to "Admin Shop" (looks cleaner), but when I try typing /csn history [Admin Shop] it says there are no commissions even right after I buy something. Last year it worked fine using AdminShop. Does it have to do with spacing, even though the name is in brackets?
Console output:
[23:24:31 INFO]: [ChestShopNotifier] Item added to batch.
[23:24:31 INFO]: [ChestShopNotifier] Uploading a batch...
[23:24:31 INFO]: [ChestShop] ZigZag10 bought 1 Raw Beef for 11.70 from Admin Shop at [SunnyShadowz] -242, 66, 72
[23:24:31 INFO]: [ChestShopNotifier] Update: INSERT INTO csnUUID (`ShopOwnerId`, `CustomerId`, `ItemId`, `Mode`, `Amount`, `Time`, `Quantity`, `Unread`) VALUES (?,?,?,?,?,?,?,?)
[23:24:31 INFO]: [ChestShopNotifier] Batch completed.
In reply to Forge_User_13104794:
In reply to Forge_User_13104794:
In reply to Forge_User_13104794:
In reply to Phoenix616:
Great plugin, I only have one issue. The plugin manages to record sales from AdminShop as I can see the database being updated in MySQL, but the commands in-game don't seem to find the database, i.e. the response is always "Nothing to show." after issuing the </csn history> command. I have tried typing </csn history adminshop> but to no avail. When I join the server the console says the following: "Found rows: 0", even though the database contains information. The server is currently using the latest craftbukkit build from BuildTools (Spigot).
Update. I just tried typing <csn history> in the console and the list popped up. It just doesn't work for me in-game.
Update 2. I typed </csn history (AdminShop)> in-game and it worked... So the name had to be in brackets (</csn history [Admin Shop] > worked as well). Kind of funny I found the problem so quickly after posting, but I'll leave this out there if anyone runs into the same issue.
Update 3. I just realized the command is described on this page as /csn history [username]... Might need some clarification though as the command works without brackets making it look like something else is wrong. A message should pop up saying you need to surround the name in brackets instead of "Nothing to show.", but you could just call me stupid. Otherwise 10/10 plugin!
That's interesting that it does work this way. The square brackets were only there to indicate that the username parameter is optional, the shouldn't bee needed to run the command. I guess the issue with the admin shop is that it can contain spaces which the command doesn't account for as normal usernames can't contain them. I'll look into adding support for that in a future version.
Are there an update anywhere?
@Nick96894
This might have been already possible by just running /csn history AdminShop (or any other admin shop name you configured in chestshop's config, just not with spaces). In the latest dev builds you will also get the AdminShop account when you are running /csn history or /csn clear from the console!
@wrecktify80
This sounds odd. This should only happen when a database issue occurs. That should be logged in your console/logfiles.
Is it possible to see the csn history of the admin shop? Would be really nice!
Any response?
IT has worked great but /csn clear is not working on my server. It still shows a large number of sales after even if the /csn clear command is typed.
@GodsDead
ChestShop still works and will probably get updated if something might break in an update as there are still a lot of people using it and interested in fixing it if the original author decides to stop the development.
I think about making this plugin compatible with others but I can't guarantee anything as time is always limited.
I requested this exact feature from SignShop, Saving a log to MySQL and then displaying the information like this on shop owner login! Is there any chance we could get this made for SignShop aswell? I looked into chestshop and its become inactive! :(
I really enjoy using this plugin, but I would really like an option to view Admin Shop sales instead of it being disabled overall. Maybe having a permission to view admin shop sales would be nice also.
can you make some kind of toggle for the messages in the chat, I really get rid of those messages with: Player123 sold ** blocks for ** fl to you. can you make a command like /csn toggle to disable the messages?