Skip to content
This repository has been archived by the owner on Jan 11, 2018. It is now read-only.

no two teleports should happen within, say, two seconds #19

Open
wwevo opened this issue Dec 27, 2017 · 3 comments
Open

no two teleports should happen within, say, two seconds #19

wwevo opened this issue Dec 27, 2017 · 3 comments

Comments

@wwevo
Copy link
Owner

wwevo commented Dec 27, 2017

working on the lobby system, teleporting players back, i encountered the problem of the code being too fast, porting the player back twice or three times in a row. such functions concerning boundaries need to have a check when they were ran last, so this does not happen

@wwevo
Copy link
Owner Author

wwevo commented Dec 31, 2017

best would be to actually have a detached thread that actually waits for the successful teleportation or timeout and block further teleporting for that player until either happens
perhaps all issued commands should work like that, threaded and self-checking

@wwevo
Copy link
Owner Author

wwevo commented Dec 31, 2017

This is going to be bigger. I'm thinking a is_teleport_valid, which searches through a teleport history to check if all criteria meet, denying the request if they don't.

@wwevo
Copy link
Owner Author

wwevo commented Dec 31, 2017

2017-12-31T15:00:12 4544.231 INF PlayerSpawnedInWorld (reason: Teleport, position: 1275, 72, 1318): EntityID=710, PlayerID='76561198040658370', OwnerID='76561198040658370', PlayerName='ecv'

will be exposed after a teleport. so we could use that to see if the player actually arrived.
So initiate teleport, block teleports for player until that line shows up or a timeout occurs, then alllow teleports again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant