Jump to content

Error Converting Economy and Resetting account balance after creating bank cards

Pending 1.3.8

DeutscherRitterPlatz

Posted (edited)

Hello,

We are currently in the process of transitioning to the banking system and shifting from Oxide to Carbon. However, we have encountered an issue after entering the command "bank.convert.economics" in version 1.3.8. The following error message is displayed in the console:

Error: Converting Economy

[18:58:21] > [BankSystem] Error (Object reference not set to an instance of an object)
   at void Oxide.Plugins.BankSystem.ConvertFromEconomics() in C:/DeutscherRitterPlatz/RustServerMRSV3_Carbon/carbon/plugins/BankSystem.cs:line 7031
   at void Oxide.Plugins.BankSystem.CmdConsoleConvertEconomics(Arg arg) in C:/DeutscherRitterPlatz/RustServerMRSV3_Carbon/carbon/plugins/BankSystem.cs:line 6988
   at object System.Reflection.RuntimeMethodInfo.Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)

 

Our economy settings are configured as follows.

"Economy Settings": {
    "Use own economic system?": true,
    "Plugin name": "Economics",
    "Balance add hook": "Deposit",
    "Balance remove hook": "Withdraw",
    "Balance show hook": "Balance"
  },


carbon/data/Economics.json  A small excerpt from the economics.json file, this file contains 4598 entries. I suspect the issue is due to there being too many entries.

{
  "Balances": {
    "76561198953919000": 649457141.0,
    "76561198894121000": 9932561.9,
    "76561199117556000": 723112.7,
    "76561198283163000": 383061.2,
    "76561197984795000": 30177727.45,
    "76561198088498000": 126786.7,
    "76561198065582000": 105552.28,
    "76561199166504000": 30001.0,
    "76561198820048000": 74371.06,
    "76561197976267000": 319541.5,
    "76561198030580000": 73172.6,
    "76561198124777000": 3201047.26,
    "76561198014511000": 205461.88,
    "76561198116440000": 148516908.8
  }
}



Error: Resetting account balance after creating bank cards
We have also observed that when using the economic system within the banking system, with the configuration setting "Use own economic system?": true, the account balance of a user who has earned economic gains through voting or other means prior to creating a bank card is reset to the starting balance.

If there are any uncertainties, I am at your disposal to clarify any questions. Alternatively, I can create a short video to provide a more visual explanation of the matter.


 

Edited by DeutscherRitterPlatz
Mevent

Posted

Hi! Can you send me your Economics data file?

DeutscherRitterPlatz

Posted (edited)

After further testing, I have narrowed down the "Error Converting Economy" issue to the file size. When there is an excess of data, the conversion process is unable to execute successfully, resulting in this error message.

It is of particular importance to me that the "Resetting account balance after creating bank cards" error is addressed promptly. Currently, the conversion of economic data does not make sense, as I do not want every user to possess a bank card immediately. This is done to maintain clarity in the player list during the transfer selection, especially since the account is reset to the starting  balance.

Edited by DeutscherRitterPlatz
MeventSupport

Posted

Regarding "Resetting account balance after creating bank cards":
Try enabling bank card auto-creation in the config:
"Card auto-creation": true,

DeutscherRitterPlatz

Posted (edited)

And I actually want to avoid this option for the sake of clarity and the conversion from economics to the banking system. As mentioned earlier, in the code, the account is set to the starting balance as soon as a card is created. The user does not receive the money credited to their account balance; instead, it is reset.

I have commented out this section in the "CreateCard" function, preventing the account from being reset. However, it should be noted that, due to this commenting, a new user will begin on this server without any starting balance.

/*if (_config.StartingBalance > 0)
    data.Balance = _config.StartingBalance;*/

 

Edited by DeutscherRitterPlatz
1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.2k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.