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 tp snipe complex #49

Merged
merged 12 commits into from
Oct 23, 2023

Conversation

oversword
Copy link
Contributor

@oversword oversword commented Aug 9, 2021

Fixes BlockySurvival/issue-tracker#83
Fixes BlockySurvival/issue-tracker#320
Choose between this and #51

This PR fixes the teleport conflicts by allowing for multiple teleport requests, and allowing the user to choose between them via a form

The form can also be manually brought up using the new command /tpf for "teleport form"

The form lists all requests made by the player and to the player, and provides buttons for accepting or denying requests, and cancelling their own requests

To make this possible, I have completely re-thought the way teleport requests are stored, the lists tp.tpr_list, tp.tphr_list, tp.tpc_list and tp.tpn_list should no longer be needed. Instead there is request_list, sender_list and receiver_list. Each request gets its own ID and is a unique object, the sender and receiver lists index these IDs by the senders and receivers for easier retrieval later.

This allows for multiple TP requests to exist at the same time without overwriting each other

This needs a lot of testing, effectively every function needs to be tested, or at least: /tpr, /tphr, /tpy, /tpn, /tpc

@Panquesito7 Panquesito7 added Enhancement ⚙️ New feature or request Rebase needed Can't merge; action / change needed labels Aug 9, 2021
This was referenced Aug 9, 2021
@oversword oversword marked this pull request as draft August 9, 2021 01:39
@oversword oversword marked this pull request as ready for review August 31, 2021 09:04
@Panquesito7 Panquesito7 self-requested a review August 31, 2021 20:52
@Panquesito7 Panquesito7 removed the Rebase needed Can't merge; action / change needed label Apr 13, 2023
@Panquesito7
Copy link
Member

Alright, it's been a very long time, going to test this out.

Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and everything else is working amazingly well (on MT 5.7.0).
Thanks so much! 🚀 It appears the only thing is the area requests on the formspec, and it should be done. 🙂

for request_id, _ in pairs(sent_requests) do
if request_id ~= "count" then
local request = request_list[request_id]
if request.direction == "receiver" then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe area requests should be shown here as well.
Without the area requests, the formspec is kind of bugged out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will try to take care of this soon 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks. Let me know if you need any help with it. 🙂

@Panquesito7
Copy link
Member

Hey. Just checking in: do you need any help? Thanks. 🙂

@Panquesito7
Copy link
Member

Ping. @oversword.

@Panquesito7 Panquesito7 self-assigned this Sep 28, 2023
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works.
This is awesome. Thanks! 🚀

@Panquesito7 Panquesito7 merged commit c692fa2 into minetest-mods:master Oct 23, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ⚙️ New feature or request High priority ❗ Immediate attention needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Teleporting seems to be broken Fix TP snipes
2 participants