iconomy5legacy / iConomy

iConomy 5 (Towny Edition)
15 stars 14 forks source link

Error shown when interest is paid out. #1

Closed LlmDl closed 3 years ago

LlmDl commented 5 years ago
[16:59:19] [Timer-0/WARN]: Exception in thread "Timer-0"
[16:59:19] [Timer-0/WARN]: java.lang.NullPointerException
[16:59:19] [Timer-0/WARN]:  at com.iConomy.util.Messaging.argument(Messaging.java:17)
[16:59:19] [Timer-0/WARN]:  at com.iConomy.util.Template.parse(Template.java:121)
[16:59:19] [Timer-0/WARN]:  at com.iConomy.system.Interest.run(Interest.java:148)
[16:59:19] [Timer-0/WARN]:  at java.util.TimerThread.mainLoop(Timer.java:555)
[16:59:19] [Timer-0/WARN]:  at java.util.TimerThread.run(Timer.java:505)

Apparently it only showed up after the server was switched from java 7 to 8.

Config:

# iConomy 5.01 Forked 0.02
# %author     Nijikokun <nijikokun@gmail.com>
# %license    GPLv2
# %copyright  Copyright AniGaiku LLC (C) 2010-2011
##
# Setup Notes
#   - Default
#     This node consists of all the 'default' data.
#   - Formatting
#     Allows you to control the output of how you will
#     see the currency in-game with the major/minor features.
#   - Banking
#     Allows users to store money in a seperate location as
#     well as transfer from bank to bank between users
#     - Multiple
#       Allows users to create multiple accounts with banks
#     - Q & A
#       Q: Why?
#       A: Money on hand can be lost, money in banks should not
#           be altered upon plugin specifictions in iConomy 5.0
#   - Interest amount is done in seconds.
#     - Online
#       If only true, only one bank / account will recieve money for that player.
#       If only false, it will go through each bank / account and deposit money.
#     - Announce
#       Sends message each time a player recieves money.
#     - Amount
#       - On
#         Each time interest runs you can either deposit the money into a bank (Interest)
#         or directly into a players holdings (Wage).
#     - Interval
#       - Seconds
#         Basic Table:
#           1 minute = 60 seconds
#           1 hour = 1 minute * 60 = 3600 seconds
#           1 day = 1 hour * 24 = 86400 seconds
#           1 week = 1 day * 7 = 604800 seconds
#   - Database
#     - Type
#       Can only be h2 or MySQL, no longer supports SQLite.
#     - Settings
#       If you choose h2, only the first two are needed, do not alter MySQL.
#       - MySQL
#         Do not use remote databases from free sites, please use either a
#          remote database from a personal hosted VPS or DEDI or a local
#          database. This will prevent any 'timeout' or 'invalid settings'
#          or 'cannot connect to database' issues. Thank you :)!
##

System:
    Default:
        Currency:
            Major: [ 'Dram', 'Drams' ]                # Major ([Major].Minor) 1.00 Dollar (With Seperate 1 Dollar)
            Minor: [ 'Khansa', 'Khansa' ]                    # Minor (Major.[Minor]) 0.23 Coins  (With Seperate 0 Dollars, 23 Coins)
        Account:
            Holdings: 5.0                             # Default holdings on hand upon join / creation.
        Bank:
            Name: National Bank of Visuban            # Default Bank Name
            Currency:
                Major: [ 'Dram', 'Drams' ]
                Minor: [ 'Khansa', 'Khansa' ]
            Account:
                Fee: 1.0                             # Default cost to register an account
                Holdings: 1.0                        # Default initial account holdings
    Formatting:
        Minor: true                                  # Example (true) 0.23 Coins and 1.23 Dollars (false) 0.23 Dollars and 1.23 Dollars
        Seperate: true                               # Example (true) 1 Dollar, 23 Coins (false) 1.23 Dollars (Only if Minor is true)
    Logging:
        Enabled: true                                # Logs transactions done inside iConomy only, other plugins must utilize the api. (Logs to SQL)
    Banking:
        Enabled: false
        Accounts:
            Multiple: false
    Interest:
        Enabled: true
        Online: true                                  # Only give to players who are online?
        Announce:
            Enabled: true
        Interval:
            Seconds: 3600
        Amount:
            Cutoff: 0.0                               # Amount limit to be met until we stop giving interest. (0.0 for no limit)
            On: 'Players'                             # Banks or Players
            Percent: 0.5                              # Percent of holdings to give / take (Negative to take) (Overrides Min/Max)
            Maximum: 1                                # (Range) Maximum amount for random in between. (Make Max/Min equal for a flat-rate amount ie: 5/5)
            Minimum: 2                                # (Range) Minimum amount for random in between.
    Database:
        Type: 'H2SQL'                                 # H2 or MySQL
        Settings:
          Name: 'minecraft'
          Table: 'iConomy'
          MySQL:
              Username: 'root'
              Password: 'pass'
              Hostname: 'localhost'
              Port: 3306
ElgarL commented 3 years ago

Is this still relevant? In the new code it references https://github.com/iconomy5legacy/iConomy/blob/462897235495cb91ae5f7ec06b385287765a0ef2/src/main/java/com/iConomy/system/Interest.java#L134