Deposit, withdraw and delete ignore economy failures

Aperta Adatta ai principianti
#66 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java

Direzione di ricerca

Leggi Transaction.process e TransactionTest per esaminare la gestione degli errori e il modello di test esistenti, quindi individua le implementazioni di deposit, withdraw e DeleteCommand. Verifica come viene gestita ogni risposta di economy prima che cambi il saldo dello store e aggiungi test con una economy che rifiuta le operazioni per tutti e tre i comandi. Il lavoro è completato quando ogni transazione rifiutata lascia invariato lo store e segnala TRANSACTION_FAILED.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Problem

/shop deposit, /shop withdraw and /shop delete ignore the result of their economy calls. If the economy plugin rejects the change, the store's balance changes anyway and the player is told it worked.

Transaction.process already handles this correctly by moving the player's money first and stopping if that fails.

Reproduced with an economy that rejects every change:

  • /shop deposit 100 added 100 to the store without taking anything from the player, and reported success.
  • /shop withdraw 40 removed 40 from the store without paying the player, and reported success.

DeleteCommand has the same pattern: it clears the balance and removes the store whatever depositPlayer returns.

Scope

  • Check EconomyResponse.transactionSuccess() before changing the store, in all three commands.
  • Send TRANSACTION_FAILED when the economy rejects the change, and leave the store as it was.

Done when

  • A rejected deposit, withdrawal or delete payout changes nothing and tells the player it failed.
  • Tests cover each command with a rejecting economy, using the existing approach in TransactionTest.
Lingua principale
Java
Stelle
1
Fork
0
Merge medio
2h 35m
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di BrendonButler/Shops

Tutte le issue di BrendonButler/Shops

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.