Web Inventory
Web Inventory
Ever wanted to have a database of players like in WoW and any other RPG game where you are able to view others player inventories and see their items? Well, here it is! You can view inventory of any player and see all their items and stuff like custom item names, lores, level, hp and last logout time.
Plugin synchronizes the database everytime player leaves the server. I have seen many people asking about something like this but I have need been able to find any suitable plugin so I decided to write one myself. This plugin is mainly for RPG servers or servers which have a lot of custom items.
Features:
- Show player inventory and their items
- Player's Level
- Player's HP
- Player's logout time
- Support for Item enchantments
- Support for item stack size
- Armor support (v0.4)
You can try and see how it works right HERE (type example for a good preview of what plugin can show or any other player name)
How to install:
Installation can be a little bit complicated relative to other plugins but it is fairly straight forward!
1) Download .jar plugin and place it in your plugin folder
2) This plugin requires SQLibrary! Download it HERE. Without it this plugin wont work!
3) Start server and let plugin generate config
4) Open config.yml and put your MySQL details
5) Restart your server
Next part is about the web.
6) Open up folder which contains web files
7) Open config.php and put your MySQL details
8) Upload whole folder on your web and test it! Or if you are more advanced you can implement this wherever you want on your website :)
9) Done!
I am open up for any suggestions. For those who are unable to implement my code to their websites I will be making more nicer default web page. As I said this is very early stage of the plugin and I will be improving it as well as the web side part and again I am open for suggestions or criticism.
THIS PLUGIN DOES NOT SYNCHRONIZE PLAYERS INVENTORIES ACROSS THE SERVERS
GitHub
Ever wanted to have a database of players like in WoW and any other RPG game where you are able to view others player inventories and see their items? Well, here it is! You can view inventory of any player and see all their items and stuff like custom item names, lores, level, hp and last logout time.
Plugin synchronizes the database everytime player leaves the server. I have seen many people asking about something like this but I have need been able to find any suitable plugin so I decided to write one myself. This plugin is mainly for RPG servers or servers which have a lot of custom items.
Features:
- Show player inventory and their items
- Player's Level
- Player's HP
- Player's logout time
- Support for Item enchantments
- Support for item stack size
- Armor support (v0.4)
You can try and see how it works right HERE (type example for a good preview of what plugin can show or any other player name)
How to install:
Installation can be a little bit complicated relative to other plugins but it is fairly straight forward!
1) Download .jar plugin and place it in your plugin folder
2) This plugin requires SQLibrary! Download it HERE. Without it this plugin wont work!
3) Start server and let plugin generate config
4) Open config.yml and put your MySQL details
5) Restart your server
Next part is about the web.
6) Open up folder which contains web files
7) Open config.php and put your MySQL details
8) Upload whole folder on your web and test it! Or if you are more advanced you can implement this wherever you want on your website :)
9) Done!
I am open up for any suggestions. For those who are unable to implement my code to their websites I will be making more nicer default web page. As I said this is very early stage of the plugin and I will be improving it as well as the web side part and again I am open for suggestions or criticism.
THIS PLUGIN DOES NOT SYNCHRONIZE PLAYERS INVENTORIES ACROSS THE SERVERS
GitHub
[13:32:55] [WebInventory] Enabling WebInventory v0.51
[13:32:55] [WebInventory] Enabled.
[13:32:55] Error occurred while enabling WebInventory v0.51 (Is it up to date?)
[13:32:55] java.lang.NoClassDefFoundError: lib/PatPeter/SQLibrary/MySQL
[13:32:55] at com.webinv.dubcat.App.mysqlConnection(App.java:73) ~[?:?]
[13:32:55] at com.webinv.dubcat.App.onEnable(App.java:43) ~[?:?]
[13:32:55] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[craftbukkit-1.12.2-1564.jar:git-Bukkit-2f3ed3b]
[13:32:55] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:329) [craftbukkit-1.12.2-1564.jar:git-Bukkit-2f3ed3b]
[13:32:55] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:402) [craftbukkit-1.12.2-1564.jar:git-Bukkit-2f3ed3b]
[13:32:55] at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:367) [craftbukkit-1.12.2-1564.jar:git-Bukkit-2f3ed3b]
[13:32:55] at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:328) [craftbukkit-1.12.2-1564.jar:git-Bukkit-2f3ed3b]
[13:32:55] at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:412) [craftbukkit-1.12.2-1564.jar:git-Bukkit-2f3ed3b]
[13:32:55] at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:373) [craftbukkit-1.12.2-1564.jar:git-Bukkit-2f3ed3b]
[13:32:55] at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:328) [craftbukkit-1.12.2-1564.jar:git-Bukkit-2f3ed3b]
[13:32:55] at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:248) [craftbukkit-1.12.2-1564.jar:git-Bukkit-2f3ed3b]
[13:32:55] at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:522) [craftbukkit-1.12.2-1564.jar:git-Bukkit-2f3ed3b]
[13:32:55] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
[13:32:55] Caused by: java.lang.ClassNotFoundException: lib.PatPeter.SQLibrary.MySQL
[13:32:55] at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_131]
[13:32:55] at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:128) ~[craftbukkit-1.12.2-1564.jar:git-Bukkit-2f3ed3b]
[13:32:55] at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:76) ~[craftbukkit-1.12.2-1564.jar:git-Bukkit-2f3ed3b]
[13:32:55] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_131]
[13:32:55] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_131]
[13:32:55] ... 13 more
Hope you'll update your plugin! I can't find easy to setup plugin with custom item names and lores like yours!
@lyghtkruz
Ok, yeah i am aware of that if u use quotes in the name of items it will kinda break it :/ (to be realistic sql injections from that are very unrealistic) but this project was as a concept but if u rly want me i would ofc fix that and update to 1.9 but since idk if there is any interest in this plugin to continue updating. And tbh i havent looked at the php files like for ages xD (i would say they are very messy) so ty gonna include that in future update (if one is gooing to come) and sourcecode is avaliable at https://github.com/qifi/WebInventory
I wanted to make you aware of a few bugs I found. I'm running spigot 1.9
I use a more items plugin for quests/rpg elements to have unique weapons. One of my weapons has a single quote and it errors on logout. I removed that item from my inventory and I had to restart the server for it to recognize that I no longer had the item.
I also use the herobrine AI plugin which drops some items with single quotes in the name. Ex: Herobrine's Artifact
This one is considered "dangerous" as the data is not being sanitized for MySQL and is currently open to a SQL injection attack. Granted, it means that you have to have privileges to create an item, but it can still be done.
Here's the output of my JavaError:
Once I remove the items from my inventory and restart the server, next time I logout without items with quotes in the name, it works well. I assume you can do a string replacement for ' with " since that will work for the website when you pull the data to use it in the web. If the SQL library has a MySQL escape string type function, I would use that.
I also found a few issues with the website files. I did fix these as the code is available for me to modify. Here's the error output, I'll give you a link to my fix at the end of the post.
Here's my mostly corrected index file: http://linuxscripts.net/mc/index.txt (watch out with my include, I just remembered I forgot to change that back for your usage. I don't like putting things in the document root with passwords. I moved the database config file.)
Basically, your loop was assuming that an index in the array existed, I added "count" variables and checked against those. There were several checks with == "null" instead of null. I added a wrapper around one of the elements that kept failing. I wasn't sure if any of that HTML was even needed, but I spat out a font /font anyway which I don't think will make a difference. I don't have a full inventory and all of my items which have lore or are enchanted have 's in them so I wasn't able to do further testing.
I plan to mostly revamp the web front end anyway, so that's not a big deal. I just can't go in and fix the java class myself.
I noticed the SQL plugin suggests to use the bukkit API to access the database. Is there any chance of you updating the plugin to use the bukkit API?
If not, is your source available somewhere? I'd hate for an update to break the SQL plugin and be out of a great plugin like this one.
Keep up the good work :D !
Great plugin! Keep going!
@jommeke
Hmm, thats nothing to worry about (just says that the column already exists), I am gonna fix it tho
I get this error wen i enable the plugin.
[00:14:21] [Server thread/WARN]: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate column name 'armor' [00:14:21] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [00:14:21] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [00:14:21] [Server thread/WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [00:14:21] [Server thread/WARN]: at java.lang.reflect.Constructor.newInstance(Unknown Source) [00:14:21] [Server thread/WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) [00:14:21] [Server thread/WARN]: at com.mysql.jdbc.Util.getInstance(Util.java:382) [00:14:21] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) [00:14:21] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593) [00:14:21] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525) [00:14:21] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986) [00:14:21] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) [00:14:21] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620) [00:14:21] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2570) [00:14:21] [Server thread/WARN]: at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:779) [00:14:21] [Server thread/WARN]: at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:622) [00:14:21] [Server thread/WARN]: at lib.PatPeter.SQLibrary.Database.query(Database.java:242) [00:14:21] [Server thread/WARN]: at com.webinv.dubcat.App.createTable(App.java:77) [00:14:21] [Server thread/WARN]: at com.webinv.dubcat.App.onEnable(App.java:43) [00:14:21] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) [00:14:21] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [00:14:21] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [00:14:21] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [00:14:21] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [00:14:21] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:414) [00:14:21] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:378) [00:14:21] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:333) [00:14:21] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:263) [00:14:21] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [00:14:21] [Server thread/WARN]: at java.lang.Thread.run(Unknown Source)>>