1. These forums are still being retired! Please use GitHub discussions or Discord. You cannot create new threads or new accounts now. If you need to contact some user of the forums, you should do it sooner, rather than later. This notice was last updated on May 30th, 2021.

SEconomy - Server-sided economy, currency and ranking - Update 16 1.0.23

Server-sided currency, ranking and economy system

  1. Onsen

    Onsen Level 8

    Joined:
    Dec 8, 2015
    Messages:
    282
    Probably your database account doesn't have sufficient privileges for initial setup of SEconomy.

    There are several ways to do that. Here is my way:
    1. If you haven't added authority for creating other database to TShock's database account, grant it temporarily.
      Code:
      $ mysql -u root -p
      Enter password: *****
      
      mysql> GRANT ALL ON *.* TO YourMysqlUser@localhost IDENTIFIED BY 'YourMysqlPassword';
      mysql> FLUSH PRIVILEGES;
      mysql> quit
      
    2. Edit "tshock/SEconomy/SEconomy.config.json"
      Code:
      ...
        "JournalType": "mysql",
      ...
        "SQLConnectionProperties": {
        "DbHost": "localhost",
        "DbUsername": "YourMysqlUser",
        "DbPassword": "YourMysqlPassword",
        "DbName": "seconomy",
        "DbOverrideConnectionString": ""
      ...
      
    3. Launch TShock
      Code:
      ...
      The database seconomy on MySQL server localhost does not exist or cannot be accessed.
      If the schema does exist, make sure the SQL user has access to it.
      New database seconomy on MySQL Server localhost, retry or cancel? (n/r/c) n <--- choose "n"
      
      Loading  [############################################################] 100%
      
      Journal clean: 0 accounts, 0 transactions
      ...
      
      If no error occurred, terminate (Ctrl+C) server for now.
    4. Take away privileges which was given above and restrict that to "seconomy" database only.
      Code:
      $ mysql -u root -p
      Enter password: *****
      
      mysql> REVOKE ALL PRIVILEGES ON *.* FROM YourMysqlUser@localhost;
      mysql> GRANT ALL ON seconomy.* TO YourMysqlUser@localhost IDENTIFIED BY 'YourMysqlPassword';
      mysql> FLUSH PRIVILEGES;
      
      mysql> SHOW GRANTS FOR YourMysqlUser@localhost;
      +---------------------------------------------------------------------------------------------+
      | Grants for YourMysqlUser@localhost                                                          |
      +---------------------------------------------------------------------------------------------+
      | GRANT USAGE ON *.* TO 'YourMysqlUser'@'localhost' IDENTIFIED BY PASSWORD '*blah*blah*blah*' |
      | GRANT ALL PRIVILEGES ON `terrariadatabase`.* TO 'YourMysqlUser'@'localhost'                 |
      | GRANT ALL PRIVILEGES ON `seconomy`.* TO 'YourMysqlUser'@'localhost'                         |
      +---------------------------------------------------------------------------------------------+
      mysql> quit
      
    5. Launch TShock again
    And make sure you add permission seconomy.world.mobgains to proper group (e.g. 'default' group).

    It appears to be an alternative connection string for connecting to database server (from source).
    But it doesn't override in actually. Conversely it will be overridden by normal connection string even if DbOverrideConnectionString was set.
     
  2. Exrex

    Exrex Level 4

    Joined:
    Jul 26, 2015
    Messages:
    94
    Give me dump mysql please :)
     
    • Dumb Dumb x 1
  3. tlworks

    tlworks Level 2

    Joined:
    Aug 22, 2016
    Messages:
    31
    Give you a what?
     
  4. Exrex

    Exrex Level 4

    Joined:
    Jul 26, 2015
    Messages:
    94
    Table seconomy for mysql
     
    • Dumb Dumb x 1
  5. Onsen

    Onsen Level 8

    Joined:
    Dec 8, 2015
    Messages:
    282
    $ mysqldump -u YourMysqlUser -p --no-data --databases seconomy
    http://pastebin.com/RqcwgDfV

    But any data won't be added unless your database user has proper privileges.
     
  6. tlworks

    tlworks Level 2

    Joined:
    Aug 22, 2016
    Messages:
    31
    Generates on first use of plugin, are you mental?
     
  7. Lugia_101

    Lugia_101 Level 4

    Joined:
    Mar 13, 2015
    Messages:
    51
    People are losing their money every month can someone help me?
     
  8. tlworks

    tlworks Level 2

    Joined:
    Aug 22, 2016
    Messages:
    31
    Elaborate please, what kind of Journal are you using? (XML or MySQL) & are you squashing your journal?
     
  9. Lugia_101

    Lugia_101 Level 4

    Joined:
    Mar 13, 2015
    Messages:
    51
    XML and no squashing
    Shall I use MySql instead?
     
    #189 Lugia_101, Sep 3, 2016
    Last edited: Sep 3, 2016
  10. tlworks

    tlworks Level 2

    Joined:
    Aug 22, 2016
    Messages:
    31
    I currently do not know if squashing an XML Journal is possible, but you should either /bank squashjournal every hour or so at all times to clear out the Journal & additionally you can switch to MySQL, when using MySQL the chance is lower of ever losing any currency data.
     
  11. Kojiro_S

    Kojiro_S Level 11

    Joined:
    Feb 16, 2014
    Messages:
    659
    It is possible and advisable. Once upon a time I didn't squash for over a month and my journal was over 100mb and suddenly got corrupted. Luckily Icy helped me restore it back then, but now I make sure to squash at least once every day, and to make a general backup every sunday.
    Squashing, however, seems to deletes bank history. So if you regularly use Bank Manager, then you should probably reduce your squash frequency to weekly.
     
    • Informative Informative x 1
  12. tlworks

    tlworks Level 2

    Joined:
    Aug 22, 2016
    Messages:
    31
    I also advice, when using MySQL and depending on the amount of your player base to squash more frequently due to the fact MySQL can suddenly eat up all your CPU if you do not clear your journal on a frequent basis.
     
  13. HawksEdge

    HawksEdge Level 5

    Joined:
    Aug 25, 2016
    Messages:
    110
    Hey Seconomy guy why does when i try to download the Seconomy gambling plugin it says that it has no page to download it on. I'm trying to add it to my server.
    and how do i use the gain money by killing monsters thing and change the money to do it?
     
  14. Kojiro_S

    Kojiro_S Level 11

    Joined:
    Feb 16, 2014
    Messages:
    659
    I'm getting this error whenever I exit the server, about 1 or 2 seconds before TShock finishes its shutdown.
    Code:
    [10-11-16 01:50:55] [Server API] Error: Plugin "SEconomy (Milestone 1) Update 23" has thrown an exception while being disposed:
    System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
       en Wolfje.Plugins.SEconomy.EventHandlers.Dispose(Boolean disposing)
       en Wolfje.Plugins.SEconomy.SEconomy.Dispose(Boolean disposing)
       en Wolfje.Plugins.SEconomy.SEconomyPlugin.Dispose(Boolean disposing)
       en TerrariaApi.Server.ServerApi.UnloadPlugins()
    I haven't noticed anything particularly wrong with accounts afterwards. Just reporting.

    EDIT: Ah, using one of the latest unofficial builds from when Bamboo was still a thing. As for the SEconomy version, the one in the original post with a forced API tick (since there was no other choice).
     
  15. HawksEdge

    HawksEdge Level 5

    Joined:
    Aug 25, 2016
    Messages:
    110
    i get one similar to that.
     
  16. -xXx-MLG-xXx-

    -xXx-MLG-xXx- Level 1

    Joined:
    Aug 24, 2016
    Messages:
    20
    I love this plugin and i need it, update it somewhen pls.
     
  17. Kojiro_S

    Kojiro_S Level 11

    Joined:
    Feb 16, 2014
    Messages:
    659
    Has anybody managed to get SEconomy to run on the latest unstable build? I get this error just after the server finishes settling liquids at startup:
    Code:
    2016-11-27 20:57:54 - TShock: ERROR: System.MissingMethodException: Método no encontrado: 'System.String TShockAPI.TSPlayer.get_UserAccountName()'.
       en Wolfje.Plugins.SEconomy.SEconomy.<BindToWorldAsync>d__41.MoveNext()
       en System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
       en Wolfje.Plugins.SEconomy.SEconomy.BindToWorldAsync()
       en Wolfje.Plugins.SEconomy.EventHandlers.<GameHooks_PostInitialize>d__14.MoveNext()
    --- Fin del seguimiento de la pila de la ubicación anterior donde se produjo la excepción ---
       en System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_1(Object state)
       en System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
       en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       en System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
       en System.Threading.ThreadPoolWorkQueue.Dispatch()
       en System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
    2016-11-27 20:58:00 - Utils: INFO: Broadcast: World saved.
    2016-11-27 20:58:00 - SaveManager: INFO: World saved at (Mundo-Actual.wld.crash)
    
     
  18. LoveOryks

    LoveOryks Level 4

    Joined:
    May 12, 2014
    Messages:
    88
    Same here, seems like an API tick doesn't seem to work anymore. Also I bet the UserAccountName() in TShock itself has been replaced with something else
     
    • Agree Agree x 2
  19. Onsen

    Onsen Level 8

    Joined:
    Dec 8, 2015
    Messages:
    282
    This error is caused by the recent update.
    - Removed all obsolete methods from TShock · NyxStudios/TShock@a0c4864

    Tried patching personally as a workaround.
    What I did:

    - JIST plugin
    • tick API 1.26
    • update JINT to 2.10.1 (because NuGet fails installing latest 2.10.2)
    • update references of other DLLs (e.g. Newtonsoft.Json)
    - SEconomy plugin
    • tick API 1.26
    • fix errors above (UserAccountName -> User.Name)
    • update references of other DLLs
    • rebuild with updated JIST plugin
    * Both plugins were rebuilt with current source tree of TerrariaServerAPI and TShockAPI. (not DLL)

    [​IMG]
    download -> DLLs / build source (80mb)

    Disclaimer: All of commands (/sec and /bank) didn't show any error though, I'm not sure that is working perfect internally. Please backup whole folder relevant TShock and Terraria, if you want to use this.
     
    • Informative Informative x 1
    • Useful Useful x 1
  20. LoveOryks

    LoveOryks Level 4

    Joined:
    May 12, 2014
    Messages:
    88
    @Onsen

    Noone seems to get the money from killing, bank transferring and money spawning doesn't seem to work either:

    [​IMG]
    [Tested on clean TShock with SEconomy only on a registered superadmin account]

    No error appears on the console while executing any command or killing any mob.

    *Edit: Also, this happens whenever someone creates an account:
    [Object or reference not set to instance of object]
    [​IMG]
     
    #200 LoveOryks, Nov 28, 2016
    Last edited: Nov 28, 2016