Stargate Rewritten

Stargate Rewritten

241 Downloads

Stargate `gateOwnerRevenue` behaviour [TMS] [222177]

Pheotis opened this issue ยท 9 comments

commented

Environment: vault_1 (core FTP)

Problem One

(This could just be a symptom of problem two)
Users receive gateOwnerRevenue from themselves when they use their own gate.
This is spams chat a bit and should probably be suppressed.
image

Problem Two

When an offline user uses another offline user's gate, they receive the gateOwnerRevenue, even though they are not the gate owner.

(This example is the user "UserTest" using portal 8 by "PreLoad2).
(This also repros for the user "Central" using that same portal).
image

commented

I looked into this. Can you double check how the balance changes. I think I made a typo on this one, where the obtained message is sent to the player that gets deducted

commented

From further TMS testing, this is environment specific.
This only repros on modern spigot running the old config simulation.
(see the vault)

commented

ECO_OBTAIN is sent to the paying player rather than the recever.
An it seems that if GATE_OWNER_REVENUE is disabled, players are charged for their own Stargates. But this is not the case if GATE_OWNER_REVENUE is enabled and it's on a personal network.

commented

A summary of how economy works, and some unwanted behavior:

If the user is the owner, the gate is on a personal network and gate owner revenue is enabled, payment is skipped
If the amount is zero, payment is skipped
If the player is the transaction target, (the entry portal's owner), chargePlayer will fail. Basically, if the owner uses their own portal on a non-personal network and economy is enabled, chargePlayer will return false. (this will be an issue after the second problem of #186 is fixed)
If GATE_OWNER_REVENUE is disabled, the player is charged even if on their own network or using their owned gate

Another problem: If vault is missing, any transactions will return true even if no money is paid. This might be a problem if economy is enabled using SG-Command.

commented

I think commit d784de8 fixes this?

commented

does commit d784de8 fix this?

Unsure. I've mainly made it readable, but I'm not sure exactly what it's supposed to do in each case.

It fixes two bugs though:

  • The player being denied from using their own gate (after the #186 fix)
  • The money received message being displayed to the payer rather than the receiver.
commented

Let's see.
So I think it should follow this behavior (this is kind of stupid, but I'm writing it anyways):

if usingGateOwnerRevenue:
    charge and send respective messages if transaction target does not equal depositor
else if taxAccount is not empty:
    charge and send respective messages to tax account and depositor
else:
    charge and send messages to depositor
commented

I think that's what we are doing, so it's fine I say

commented

Ima close this for now