Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nation deleted message showing when a predeletenationevent iscancelled. #7381

Closed
wants to merge 1 commit into from

Conversation

LlmDl
Copy link
Member

@LlmDl LlmDl commented Apr 25, 2024

Description:

Not really happy with the implementation of this, as it changes our DataSource pattern to one where only a single removeObject method returns a boolean. The TownUtil change is also not ideal now or before this PR as the Nation can be prevented from being deleted, while still processing a refund.

Potential alternative solutions:

  • Run the message in the DatabaseHandler method, and lose the custom deleted by admin message sent to the admin who deleted the nation.
  • Run the PreDeleteNation event before the removeNation(Nation) in order to prevent the TownUtil method being made redundant, and causing issues.

New Nodes/Commands/ConfigOptions:


Relevant Towny Issue ticket:

Closes #7380.


  • I have tested this pull request for defects on a server.

By making this pull request, I represent that I have the right to waive copyright and related rights to my contribution, and agree that all copyright and related rights in my contributions are waived, and I acknowledge that the TownyAdvanced organization has the copyright to use and modify my contribution under the Towny License for perpetuity.

cancelled.

Not really happy with the implementation of this, as it changes our
DataSource pattern to one where only a single removeObject method
returns a boolean. The TownUtil change is also not ideal now or before
this PR as the Nation can be prevented from being deleted, while still
processing a refund.

Potential alternative solutions:
- Run the message in the DatabaseHandler method, and lose the custom
deleted by admin message sent to the admin who deleted the nation.
- Run the PreDeleteNation event before the removeNation(Nation) in order
to prevent the TownUtil method being made redundant, and causing issues.

Closes #7380.
@LlmDl LlmDl added this to the 0.100.3.0 milestone Apr 25, 2024
LlmDl added a commit that referenced this pull request Apr 26, 2024
iscancelled.

Uses the nation.exists to determine if the removal of the nation was
successful or not, and displays messages to match the outcome.

Closes #7380.
Supercedes #7381.
@LlmDl LlmDl removed this from the 0.100.3.0 milestone Apr 26, 2024
@LlmDl LlmDl closed this Apr 26, 2024
@LlmDl LlmDl deleted the fix/nation_delete_message branch April 26, 2024 15:06
LlmDl added a commit that referenced this pull request Apr 26, 2024
…celled. (#7383)

* Fix nation deleted message showing when a predeletenationevent
iscancelled.

Uses the nation.exists to determine if the removal of the nation was
successful or not, and displays messages to match the outcome.

Closes #7380.
Supercedes #7381.

* Remove event handler used in testing.

* Fix sending message to the non-existant nation.

* Do the same for TownUtil, removing call to sendPrefixedNationMessage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nation deletion message is broadcast after cancelling PreDeleteNationEvent
1 participant