[INACTIVE][ECON] Cookies! v0.5 - Economic System w/ API [424]

Discussion in 'Inactive/Unsupported Plugins' started by Coelho, Feb 21, 2011.

  1. Offline

    ShadowDrakken

    haha, you beat me to it Halo, I was just about to post a link to your comment :)
    --- merged: Feb 24, 2011 5:58 AM ---
    I totally agree though, split Cookies! off into JUST a money handler, and make the other features their own plugins.
    Modularity = power
    Modularity = simplicity
    Modularity = player choice
     
  2. Offline

    Coelho

    I can not lie and say I completely understood what you had said, but yes, a suggestion is a suggestion and it will be added nonetheless.
    --- merged: Feb 24, 2011 6:00 AM ---
    Like permissions, yes I understand, however all parts of Cookies that are extra have a turn off, so if you don't like them you can make your own :p
     
  3. Offline

    ShadowDrakken

    @Coelho basically by splitting it off into a very simple lookup, add, remove API with no other fluff, it makes your job keeping it up to date much easier. It also means plugin developers will almost never have to change their own code to support it indefinitely.
    --- merged: Feb 24, 2011 6:03 AM ---
    Ah, but by breaking them into their own modules, it makes updating them easier, and lets users choose which ones to have installed... on/off like they are now still uses memory/resources even if they're off, where as a modular approach they can be left out entirely thus saving memory/resources
     
  4. Offline

    Coelho

    Ah I understand, however its not nessessary at all at the current point, however in the near future, maybe.
    --- merged: Feb 24, 2011 6:07 AM ---
    It will not be using up any more than it would if it was standalone, if not, a couple kilos more (Which isn't much compared to what Bukkit's Server actually uses)
    Plus at the moment I have enough time on my hands to keep this up-to-date, and if I ever at one point don't, I will hand it over to someone who will code it like I did. (However if they do a SINGLE thing crappy, I will rage)
     
  5. Offline

    HaloInverse

    Testing DynamicMarket with the iConomy wrapper...

    It appears that the iConomy wrapper doesn't implement iConomy.l.showBalance(String name, Player viewing, boolean mine). While I can write around this (by restricting calls to the three core functions in Database.class, and building my own showBalance()), other plugins may still call it. You might want to implement that call to improve the wrapper's compatibility.
     
  6. Offline

    Coelho

    Will look into it, I had only implemented methods on iConomy's API.
    --- merged: Feb 24, 2011 7:04 AM ---
    @HaloInverse Implemented in v0.2 of the iConomy Wrapper.
     
  7. Offline

    HaloInverse

    That was quick. :)

    Okay, one more: Naming of SQLite/MySQL connector .jars was mentioned earlier in this thread. Due to assumptions made by other plugins, you could probably improve this plugin's compatibility further by editing your Cookies.jar/META-INF/MANIFEST.MF to:

    Code:
    Manifest-Version: 1.0
    Class-Path:  ../sqlite-jdbc.jar ../sqlitejdbc-v056.jar ../mysql-connector-java-5.1.14-bin.jar ../mysql-connector-java-bin.jar
    
    I ran into this issue myself ironing out DynamicMarket's database access "misfeatures". :)

    Also: The iConomy wrapper appears to have no means to rename currency from the default "money".
     
  8. Offline

    Coelho

    Will do in just a second, working on my website as the creator gave me FTP :p
    --- merged: Feb 24, 2011 7:41 AM ---
    Reuploaded 0.4 with a different MANIFEST to support more plugins.
     
  9. Offline

    Phantom Index

    It seems that this does not work.
    Is it compatible with CB # 435 and permissions 2.1?

    I can view and send money, but.. I can't really add any money or get it to connect to mySQL database. consoel also gives me an error






    Code:
    2011-02-24 00:54:42 [SEVERE] java.lang.NullPointerException
    2011-02-24 00:54:42 [SEVERE]    at com.pi.coelho.Cookies.Cookies.onDisable(Cookies.java:160)
    2011-02-24 00:54:42 [SEVERE]    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:142)
    2011-02-24 00:54:42 [SEVERE]    at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:441)
    2011-02-24 00:54:42 [SEVERE]    at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:199)
    2011-02-24 00:54:42 [SEVERE]    at com.pi.coelho.Cookies.Cookies.onEnable(Cookies.java:126)
    2011-02-24 00:54:42 [SEVERE]    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:140)
    2011-02-24 00:54:42 [SEVERE]    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:426)
    2011-02-24 00:54:42 [SEVERE]    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:187)
    2011-02-24 00:54:42 [SEVERE]    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:76)
    2011-02-24 00:54:42 [SEVERE]    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:57)
    2011-02-24 00:54:42 [SEVERE]    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:187)
    2011-02-24 00:54:42 [SEVERE]    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:174)
    2011-02-24 00:54:42 [SEVERE]    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:120)
    2011-02-24 00:54:42 [SEVERE]    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:227)
    2011-02-24 00:54:42 [SEVERE]    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    
     
  10. Offline

    ShadowDrakken

    #432 is the current "Recommended Build" that plugin devs are supposed to use
    Almost no one is using Permissions 2.1 because it breaks too many things. It's recommended to roll back to Permissions 2.0 or use Group Manager with the FakePermissions.jar wrapper to emulate Permissions 2.0
     
  11. Offline

    Coelho

    You gave me the wrong error plus you did not give me enough information on what type of MySQL your using etc.
     
  12. Offline

    HaloInverse

    Further question: How often is the specified interest rate applied to the accounts?

    Also, I've had no problems so far with Permissions 2.1. The config files just needed adjusting for the new multiworld support.
     
  13. Offline

    Coelho

    Interest is once every Minecraft day from server start-up. (I may change it so its at a specified time instead, so if you restart the server it won't take more time)

    On the Permissions 2.1 note, I have had no problems with it as well.
     
  14. Offline

    HaloInverse

    WHOA! Serious error found!

    - Converted everybody's bank balances with "/c admin set <player> <amount>". Works fine.
    - Checked with "/c top", "/c admin status", etc. Balances all set.
    - "/c admin save-all" for good measure.
    - Log out. (Server still running.)
    - Log in again.
    - Cookies balance on just my account has reset to 100 (same value as .properties/initial-money=)
    No error messages thrown. Just a reset balance.

    I'd like to either fix this or find a workaround for this before my users start clobbering their balances just by logging in (or logging out, I'm not sure which).

    CB#432, recent build of Cookies v.0.4 from svgamers, "sql-lite=yes".

    EDIT: Found it: cPlayerListener, line 26: your check is "(!(Cookies.getBalances().containsKey(p.getName())))", but your methods getPlayerMoney() and setPlayerMoney() convert names to lower-case before using them as keys. Thus, anyone with upper-case characters in their player name fails the check on line 26, despite having a previous balance, and gets their money reset.
     
  15. Offline

    GhOsTeth

    I am getting this error when trying to use NPCtrader. At first I thought it was with NPC trader but the Caused by has me concerned that maybe the Iconomy wrapper is involved.

    Running CB 432

    Code:
    2011-02-24 04:10:46 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'npc' in plugin NPCTrader v1.0.8
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:21)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:77)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:173)
        at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:633)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:596)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:590)
        at net.minecraft.server.Packet3Chat.a(SourceFile:24)
        at net.minecraft.server.NetworkManager.a(SourceFile:230)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:70)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:338)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:253)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.IncompatibleClassChangeError: Expected static method com.nijikokun.bukkit.iConomy.Misc.formatCurrency(ILjava/lang/String;)Ljava/lang/String;
        at com.MatCat.NPCTrader.NPCTraderMySQL.NPCMessage(NPCTraderMySQL.java:542)
        at com.MatCat.NPCTrader.Commands.npcSellCommand.Run(npcSellCommand.java:146)
        at com.MatCat.NPCTrader.NPCTrader.onCommand(NPCTrader.java:344)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:19)
        ... 12 more
    
     
  16. Offline

    Coelho

    Actually.. One second let me look into this, it might be due to case sensitivity. I can't fix it until tomorrow, however I can identify the problem.
    --- merged: Feb 24, 2011 9:20 AM ---
    I'll fix it tomorrow.
    --- merged: Feb 24, 2011 9:23 AM ---
    Yes it is due to case sensitivity. If you have a capital letter in your name at the moment it won't save, i'll fix it tomorrow.

    EDIT: Just noticed I did not make myself clear enough. This is due to the server checking if you need the default money. When it checks the HashMap if it contains your name, it dosent make your name lowercase, so its searching for "Player" when the HashMap contains "player".
    --- merged: Feb 24, 2011 9:41 AM ---
    0.45 Released, I just couldn't go to sleep without fixing it.
    • Fixed Bug with Initial Money
    • EVERYONE SHOULD UPDATE
    --- merged: Feb 24, 2011 9:45 AM ---
    0.25 Wrapper Released.
     
  17. Offline

    HaloInverse

    You're a man rabbit whatever after my own heart. :)

    EDIT: The iConomy wrapper has been changed, but the bug's still there in Cookies/cPlayerListener (line 26).
     
  18. Offline

    Moe041991

    Iam so freakin confused. I just want some economy and some shops on my server. now i have to deal with SQL and all that stuff whats seemes to be pretty hard (but i dont really know).

    So as far as i understood i can still use the iconomy plugins with this wrapper.
    But is there any kind of tutorial how to set up the wrapper?
    or is it just the usual ".jar file into pluginsfolder and restart" stuff?
     
  19. Offline

    ShadowDrakken

    just drop in both jar files and have sqlite-jdbc.jar in your Bukkit directory
    it'll error the first time you run the server, just stop the server, and edit the newly created .properties file to enable sqlite, then you're good to go
     
  20. Offline

    Plyz

    maybe make that .properties file into settings.properties , so us people on linux would have a chance ^^
     
  21. Offline

    Avous

    do you need SQ to make this work? i have a long string of errors dealing with cookie. here they are btw it looks like a perfect mod! and i appreciate all the hard work you've done on it!

    [​IMG]
     
  22. Offline

    Brocklehurst

    I'm still having the problem with the balance resetting to the intitial value :(

    Also I get the same errors as above
     
  23. Offline

    Avous

    woo i got it! i did have to enable SQlite and install it! danke! anyways! i was wondering in your professional opinion if this would be possible...

    (Not Requesting it just want your opinion)

    I was thinking about disabling animals in the world but having like a sign purchase system so you could buy animals and put them in pins and barns for farming for their goods. like in Harvest Moon. would it be possible to have them presist and do everything animals do now? and place them like a block??? i think it would be awesome and add a whole new depth of farming gameplay and fun! so would it be possible to do that or no clue?
     
  24. Offline

    jwideman

    What build of CB does this need? Not loading in 432 or 438.
     
  25. Offline

    Avous

    i was using 430
    --- merged: Feb 24, 2011 3:10 PM ---
    works fine with 438 as well. i just installed and tested her.
     
  26. Offline

    jwideman

    CB 438, no other plugins:
    2011-02-24 10:15:48 [SEVERE] Could not load plugins/iConomy.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:65)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:129)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:94)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:58)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:187)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:174)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:120)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:227)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:199)
    at java.util.zip.ZipFile.<init>(ZipFile.java:129)
    at java.util.jar.JarFile.<init>(JarFile.java:150)
    at java.util.jar.JarFile.<init>(JarFile.java:114)
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:52)
    ... 8 more
    2011-02-24 10:15:48 [SEVERE] Could not load plugins/Cookies.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:65)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:129)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:94)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:58)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:187)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:174)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:120)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:227)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:199)
    at java.util.zip.ZipFile.<init>(ZipFile.java:129)
    at java.util.jar.JarFile.<init>(JarFile.java:150)
    at java.util.jar.JarFile.<init>(JarFile.java:114)
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:52)
    ... 8 more
    2011-02-24 10:15:48 [INFO] Done (887551134ns)! For help, type "help" or "?"
    --- merged: Feb 24, 2011 3:32 PM ---
    Is it possible the links in the OP are not up to date?
     
  27. Offline

    Erbros

    I still get this with 0.45

    Properties file not generated yet.
     
  28. Offline

    fugue2005

    cookies isn't giving monster drops
     
  29. Offline

    Phantom Index

    Yeah this isn't working.
     
  30. Offline

    jwideman

    Had to get the version off the website. Cookies (and the wrapper) loads, but now I get
    2011-02-24 11:25:00 [SEVERE] java.lang.ClassNotFoundException: org.sqlite.JDBC
    2011-02-24 11:25:00 [SEVERE] at java.net.URLClassLoader$1.run(URLClassLoader.java:299)
    2011-02-24 11:25:00 [SEVERE] at java.net.URLClassLoader$1.run(URLClassLoader.java:288)
    2011-02-24 11:25:00 [SEVERE] at java.security.AccessController.doPrivileged(Native Method)
    2011-02-24 11:25:00 [SEVERE] at java.net.URLClassLoader.findClass(URLClassLoader.java:287)
    2011-02-24 11:25:00 [SEVERE] at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:30)
    2011-02-24 11:25:00 [SEVERE] at java.lang.ClassLoader.loadClass(ClassLoader.java:422)
    2011-02-24 11:25:00 [SEVERE] at java.lang.ClassLoader.loadClass(ClassLoader.java:355)
    2011-02-24 11:25:00 [SEVERE] at java.lang.Class.forName0(Native Method)
    2011-02-24 11:25:00 [SEVERE] at java.lang.Class.forName(Class.java:186)
    2011-02-24 11:25:00 [SEVERE] at com.pi.coelho.Cookies.net.cDatabase.<init>(cDatabase.java:16)
    2011-02-24 11:25:00 [SEVERE] at com.pi.coelho.Cookies.Cookies.onEnable(Cookies.java:114)
    2011-02-24 11:25:00 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:140)
    2011-02-24 11:25:00 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:426)
    2011-02-24 11:25:00 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:187)
    2011-02-24 11:25:00 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:79)
    2011-02-24 11:25:00 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:60)
    2011-02-24 11:25:00 [SEVERE] at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:187)
    2011-02-24 11:25:00 [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:174)
    2011-02-24 11:25:00 [SEVERE] at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:120)
    2011-02-24 11:25:00 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:227)
    2011-02-24 11:25:00 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    2011-02-24 11:25:00 [SEVERE] java.lang.NullPointerException
    2011-02-24 11:25:00 [SEVERE] at com.pi.coelho.Cookies.Cookies.onDisable(Cookies.java:160)
    2011-02-24 11:25:00 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:142)
    2011-02-24 11:25:00 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:441)
    2011-02-24 11:25:00 [SEVERE] at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:199)
    2011-02-24 11:25:00 [SEVERE] at com.pi.coelho.Cookies.Cookies.onEnable(Cookies.java:126)
    2011-02-24 11:25:00 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:140)
    2011-02-24 11:25:00 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:426)
    2011-02-24 11:25:00 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:187)
    2011-02-24 11:25:00 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:79)
    2011-02-24 11:25:00 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:60)
    2011-02-24 11:25:00 [SEVERE] at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:187)
    2011-02-24 11:25:00 [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:174)
    2011-02-24 11:25:00 [SEVERE] at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:120)
    2011-02-24 11:25:00 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:227)
    2011-02-24 11:25:00 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    2011-02-24 11:25:00 [INFO] [COOKIES] Failed to save list into database.
    2011-02-24 11:25:00 [INFO] [COOKIES] Script has stored cookies in a safe spot for later use.
    2011-02-24 11:25:00 [INFO] [COOKIES] Failed to retrieve list from database.
    2011-02-24 11:25:00 [WARNING] Plugin 'Cookies' (ver 0.4) is registering events before it is enabled. It may be misbehaving and the author needs to fix this.
    2011-02-24 11:25:00 [WARNING] Plugin 'Cookies' (ver 0.4) is registering events before it is enabled. It may be misbehaving and the author needs to fix this.
    2011-02-24 11:25:00 [INFO] [COOKIES] Script is ready to start giving out cookies.
     

Share This Page