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

TPControl plugin: tp mode "ask" sometimes does not ask #192

Open
totemo opened this issue Mar 31, 2014 · 3 comments
Open

TPControl plugin: tp mode "ask" sometimes does not ask #192

totemo opened this issue Mar 31, 2014 · 3 comments

Comments

@totemo
Copy link
Member

totemo commented Mar 31, 2014

I believe that this is caused by invalidation of the Player object retained by class User:
https://github.com/NerdNu/TPControl/blob/master/src/nu/nerd/tpcontrol/User.java#L17
when the request recipient relogs, dies or transitions between worlds.

I know from my experience working on CutePvP that I was not able to keep Player instances around because they were invalidated by those kinds of occurences. The code that sends the teleport request is otherwise fairly mundane and I can't see how it would go wrong.

As discussed in the forums (https://nerd.nu/forums/index.php?/topic/1832-tp-issue-on-c/#entry13540), I recommend redeclaring the player field as a String.

I can submit a patch for this, but I'm holding off on a point of etiquette, which is that I have stood down as a tech, so I'm not sure whether I'm supposed to still be able to directly push to the repo or whether you would prefer that I submit a pull request. Please advise.

@Deaygo
Copy link
Member

Deaygo commented Mar 31, 2014

I would be fine if you submitted a pull request. But instead of name if you'd be able to use uuid. But, the user class should be removed on logout and not retain anything if I recall correctly. I'd have to look at the code to make sure.

edit: I was wrong about being removed on disconnect. But yes, I think that it should be changed to use UUID instead of username, including the file storage.

@LadyCailin
Copy link

A PR is fine. Code reviews are a good thing either way ^_^

On Mar 31, 2014, at 3:49, totemo [email protected] wrote:

I believe that this is caused by invalidation of the Player object retained by class User:
https://github.com/NerdNu/TPControl/blob/master/src/nu/nerd/tpcontrol/User.java#L17
when the request recipient relogs, dies or transitions between worlds.

I know from my experience working on CutePvP that I was not able to keep Player instances around because they were invalidated by those kinds of occurences. The code that sends the teleport request is otherwise fairly mundane and I can't see how it would go wrong.

As discussed in the forums (https://nerd.nu/forums/index.php?/topic/1832-tp-issue-on-c/#entry13540), I recommend redeclaring the player field as a String.

I can submit a patch for this, but I'm holding off on a point of etiquette, which is that I have stood down as a tech, so I'm not sure whether I'm supposed to still be able to directly push to the repo or whether you would prefer that I submit a pull request. Please advise.


Reply to this email directly or view it on GitHub.

@totemo
Copy link
Member Author

totemo commented Mar 31, 2014

But instead of name if you'd be able to use uuid.

Sure. I read about Bukkit's deprecation of various methods yesterday.

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

No branches or pull requests

3 participants