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.
Thank you so much for this plugin! I have a suggestion. Would it be possible to also show the history of when someone tries to buy an item of yours while it's out-of-stock? It would be useful in a way that we would know if we should restock something because it has a demand again.
What should I fill in the database line? The ip only? Or can someone post his config here? Thanks :)
Hi ! Could you add possibility to modify variables "days", "minutes" and "seconds" please ?
Thanks, But i was thinkig more in line of seeing the spesific server to. So when you log into one server you see the following:
You made 10 sales on SERVER-A since you last checked. You made 5 sales on SERVER-B since you last checked.
Another thing, could you please make it so that the plugin does not use the main thread?
[Server thread/WARN]: [AutoSaveWorld] Plugin ChestShopNotifier attempted to establish connection socket://localhost:3306 in main server thread
Thanks.
@erik1988
CSN works totally fine when you run it on multiple servers with the same database. Instant Bungee-wide transaction notifications however should be a feature ChestShop itself or a separate plugin implements as this plugin focuses on storing information on transactions when the player is offline.
@TheOnlyOmlet
This plugin only manages notifications of transactions occurring while a player is offline. The feature you are requesting would have to be implemented in ChestShop or directly in your economy plugin. (most already do have a bank functionality nowadays)
Also on a personal note: A player should be smart enough to not make it possible to get broke by buying items. One guide on how to do that can even be found on the ChestShop's plugin page here.
Really like this plugin. I have a request, but I'm not sure how difficult it would be on your end to code. Is it possible to make separate bank accounts for the chestshop? So as not to run the owner dry if someone sells them a large quantity of items.
would it be possible to make this into a bungee plugin? So that if you are on another server in the network you will get a notification if someone is buying from one of your shops even if you are not on that server.
@Kane_Hart
This plugin works fine with 1.8 and 1.8.3. Bukkit plugins generally don't need an update if they only use the Bukkit API (which this plugin does).
Does this work for 1.8.1?
Hi, i like to know why the plugin is not working in my server beacuse i test in my computer and the plugin work, when i change the server to a Centos 6 (64 bits) VPS the plugin not working, can anyone help me ?
Thank´s :)
Please add the ability to delete certain date and time previous data regularly.
@Phoenix616
I will wait and record data on it at peek server hours and record timings with old version and new versions. I had an sql problem around the same time I updated this plugin, so assumption was this plugin, since then I have repaired the issue and no problems. But I am interested to see about its performance.
@asmit119
This was intended because in my opinion inserting into a MySQL database has no real impact on the performance as you don't have to search the whole table like you do with an update for example. Actually I think that using a batch would use more resourced because you have to schedule an reoccurring event.
But if you can provide me with some hard evidence that this change resulted in a performance loss I am willing to implement a config option for this.
Batch's are upload for EACH item sold. Instantly. Rather than sending them in waves. This is very demanding of a SQL system. Was this intended in the update? Can we have an update timer?
To everyone waiting for the 1.1.2 UUID update:
The file got uploaded 7 days ago but has not been confirmed by the Bukkit Dev staff yet. I guess this delay is because of the recent Bukkit/Mojang kerfuffle. If you really need UUIDs I would suggest that you get the source from the github repo and built it yourself.
As you can see from the github commits I have more or less taken over the development of this plugin. I will be updating it here to UUIDs as soon as I finished writing a converter and testing it.
The next version will also implement the ability to disable logging for ChestShop's Admin Shop, like Durand1w suggested, and the ability to setup your own messages in the config.
@Durand1w
Not right now, but sounds like a good idea. I'm going to be working on an update sometime this week which will fix the 'Unread' bug as well as add an option to ignore certain users.
Is there a method to disable logging for a specific user (server account)? I don't think this will be an issue for a while and I can probably drop the specific account information manually, but disabling server shops would be useful.
@Erbros
Thank you for posting the fix. This worked for me as well.
I just added a field named 'Unread' with smallint length 1 default 0 to the table and it works just fine.