Please allow /town deposit to work
cecell opened this issue · 16 comments
On my server we are using a bit of a hybrid physical/virtual currency for Towny. For most if not all Towny servers i'm sure the [town vault] vault meets the needs perfectly. However on our server we would prefer to use /town deposit as usual. Currently when typing /town deposit # it deducts # from the players inventory but does not deposit the amount into either the town's bank or the town's vault. Would you be willing to support this functionality?
If so it would be greatly appreciated!
If I may ask for a quick clarification: Would you like to be able to have virtual money only for town vaults, but physical vaults for players? What is the motivation for this?
The behavior you describe can happen when a town has no town vault, and thus no space to deposit money.
Well to be honest we would prefer to not make use of vaults at all. We
want the money to remain as exposed as is reasonably possible. Players
won't be able to use banks or the like. Also players on servers are just a
major pain in the @$$ and can't figure out how to make even the simplest of
signs (but those same players are oh so fun to kill lol). I would honestly
prefer to use the player's inventory as the town vault. Perhaps you can
make that happen? Then for my server I will just disable town vaults.
Towny apparently does not have a config option to use player inventory
instead of the "town bank." If you could make that happen then I could
most definitely make a donation go your way.
Thanks!
On Dec 26, 2012 6:13 PM, "Justin Kaeser" [email protected] wrote:
If I may ask for a quick clarification: Would you like to be able to have
virtual money only for town vaults, but physical vaults for players? What
is the motivation for this?The behavior you describe can happen when a town has no town vault, and
thus no space to deposit money.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/47#issuecomment-11697368.
I don't think I completely expressed what I wanted. I definitely don't by
any means want to designate a specific player's inv as the vault, i.e. the
mayor's inv for example. I want it to use the inventory of the player that
is issuing the command. If that player doesn't have the gold in their inv
then the transaction just fails. As you may have gathered I've disabled
enderchest vaults and personal vaults completely. This is because, again,
I want the players to have to expose the currency in order to spend it. We
use an auction plugin as our main form of trade so if you don't keep at
least some currency on hand you may miss out big time.
On Dec 27, 2012 1:37 AM, "Justin Kaeser" [email protected] wrote:
I see. My next planned step is supporting virtual accounts not directly
backed by any inventory. That should solve your immediate problem.I will also include messages when a deposit to a vault fails.
There are some issues with using a player's inventory as town vault
though. Whose inventory to take the money from? It's technically possible,
but I see some potential for abuse. If you have any good ideas on that, or
how to make vault creation simpler, let me know.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/47#issuecomment-11702770.
Okay, I understand. However, this might not be possible easily, because the interaction of Towny with Gringotts goes over the Vault interface, and that does not pass who issued a command. There is also the issue of what to do with transactions that don't originate from a player, such as town upkeep costs.
Could you designate the inventory of the player issuing the command as the
vault for just a moment and then when the command is complete have it
revert?
On Thu, Dec 27, 2012 at 6:47 AM, Justin Kaeser [email protected]:
Okay, I understand. However, this might not be possible easily, because
the interaction of Towny with Gringotts goes over the Vault interface, and
that does not pass who issued a command. There is also the issue of what to
do with transactions that don't originate from a player, such as town
upkeep costs.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/47#issuecomment-11707199.
lol and to head off the question of "revert to what?" I have no idea. Whatever it would be when the plugin is first installed so nothing I guess lol.
Are you thinking that I could catch the towny command event to figure out who is issuing the command, and set the player accordingly? Technically, probably. It sounds kind of hackish though, and a lot of extra logic for such a specific feature.
Well then it sounds like it would be best to revert to the original request of players being able to use /town deposit as usual. Since the deduction part from the player's inventory is working fine it would just be the matter of passing the amount to the Towny town bank. That will solve my problems just fine.
Here is an example of a portion of the code that points to the towny town payment: https://github.com/ElgarL/Towny/blob/master/src/com/palmergames/bukkit/towny/command/TownCommand.java#L1843
I'm a total noob but am trying to teach myself how to read javadocs, etc and am playing with eclipse. Please don't think that i'm trying to be a know it all. I'm actually trying to learn so be gentle xD lol.
I've been going through the javadocs and even though I see that that bit refers back to import com.palmergames.bukkit.towny.tasks.TownClaim; I don't see where the pay() function is referenced. OHH There it is: com.palmergames.bukkit.towny.object.TownyEconomyObject.pay().
Wow i'm reading these javadocs and well it doesn't seem like there is very much documentation lol. Looks like someone clicked an export button and mostly just moved on from there.
I see. My next planned step is supporting virtual accounts not directly backed by any inventory. That should solve your immediate problem.
I will also include messages when a deposit to a vault fails.
There are some issues with using a player's inventory as town vault though. Whose inventory to take the money from? It's technically possible, but I see some potential for abuse. If you have any good ideas on that, or how to make vault creation simpler, let me know.
The thing is, the deposit works fine, but only when a town has a vault. Towny does call the deposit, but doesn't check if it fails, and thus doesn't refund a failed transfer.
Can you allow a deposit into the default towny vault please?
Think Green. Please don’t print this message unless it’s really necessary.
On Thu, Dec 27, 2012 at 6:26 PM, Justin Kaeser [email protected]:
The thing is, the deposit works fine, but only when a town has a vault.
Towny does call the deposit, but doesn't check if it fails, and thus
doesn't refund a failed transfer.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/47#issuecomment-11722210.
Towny passes the account handling to Gringotts completely, and if Gringotts fails to add anything to a town vault, there is no other place for it to go currently. I will add configurable support for virtual aka "fake" accounts, which should work with Towny or anything else without space restriction - just like non-item economies.
Thanks man!!
Think Green. Please don’t print this message unless it’s really necessary.
On Thu, Dec 27, 2012 at 6:49 PM, Justin Kaeser [email protected]:
Towny passes the account handling to Gringotts completely, and if
Gringotts fails to add anything to a town vault, there is no other place
for it to go currently. I will add configurable support for virtual aka
"fake" accounts, which should work with Towny or anything else without
space restriction - just like non-item economies.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/47#issuecomment-11722537.
I would like to say that I fixed the "refund problem" in my own version of towny, available there : https://dl.dropbox.com/u/3016631/Towny.jar
If it doesn't work, post an issue there :
https://github.com/roblabla/Towny
since you've added the pull request at ElgarL/Towny#79, I will close this issue.