Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Some thoughts regarding commands whenever multi-currency support is added #9

Open
Ifera opened this issue Jun 10, 2020 · 2 comments
Open

Comments

@Ifera
Copy link
Member

Ifera commented Jun 10, 2020

Description

Whenever multi-currency support is added (see #4), commands would need work in order to make them compatible. Here's what I have in mind.

1. Add a new currency argument to the current commands

Add a new argument in the existing command which would accept the currency. Example /eco <string:currency> pay ... or eco pay <string:currency> .... I would prefer the latter if this is to be done.

2. Store players active currency

Making another table which would store the current active currency of the player and each time player executes a command that table is queried and results used. Player would be able to change the active currency with the help of another command.

3. Using currency ids for commands

Having a currencies key in a config like so:

currencies: {
	"dollars": {
		"symbol": "$",
		"default": 0,
		"max": 1000
		//add more stuff
	},
	
	"coins": {
		"symbol": "coins",
		"default": 0,
		"max": 1000
		//add more stuff
	}
};

Using the array keys of currencies, which are the currency ids, a new command (not a subcommand) is registered with the all the subcommands that are currently there for eco command. Essentially the commands would be somewhat like dollars pay ... or coins pay ... etc. Furthermore, the command name can be used to identify the currency the player is wanting to use.

Any suggestion, improvements or thoughts would be appreciated.

@Ifera
Copy link
Member Author

Ifera commented Jun 10, 2020

Personally I am more interested in option 3 but I am open to suggestions..

@SOF3
Copy link

SOF3 commented Jun 10, 2020

I don't think a generic pay command is appropriate, because some currencies might not be tradable. What if you add in the config to allow server owner to register payment commands based on currency type? In this case we can also make it easier if the owner wants to add stuff like taxing direct payments.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants