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

Better relogin code #13

Merged
merged 6 commits into from
Nov 25, 2017
Merged

Better relogin code #13

merged 6 commits into from
Nov 25, 2017

Conversation

Notabilis
Copy link
Contributor

Improved the relogin code by adding semi-constant user ids.

Reconnecting to the same name on the metaserver should now work for most cases, even when the complete client computer crashes. The id is used to recognize the user and assign his old name to him instead of giving him the requested name. When the user does a clean logout the reservation is removed.

If logging in with a registered account a second time, a new name will be assigned to the new client automatically instead of displaying an error message.

This branch should be deployed at the same time as merging the related branch of Widelands, since compatibility with the old trunk version breaks. Compatibility with build19 is still maintained.

@SirVer SirVer self-requested a review October 23, 2017 21:03
if len(c.replaceCandidates) == 0 {
// Noone connected with our nonce
// TODO(Notabilis): Maybe do the ContainsName() check here case-insensitive?
// Having "Peter" and "peter" is quite strange. Same for HasClient().
Copy link
Contributor

Choose a reason for hiding this comment

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

We'd need to make sure then that Widelands itself is also case-insensitive. Too much effort?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be no problem implementing this, though I don't think we have to change anything ingame for this. Except maybe when we also want to be case-insensitive when using whisper messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just wondering: Are you waiting for me to implement this? I wouldn't have done it as part of this branch but of course I can do so.

I looked into the code and for internet gaming it should be possible to change this as a pure metaserver-side change. When we also want to have this in LAN games we have to change Widelands, too.
Two questions regarding the SQL user database:

  • Is the username column of the auth_user table an index? In that case the performance would most likely drop when we perform case-insensitive queries. (Could probably be circumvented by adding an always lower-case column which could be indexed.)
  • Are there any usernames registered which will break when we implement this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we can always fix this later. I was sort of hoping that SirVer would pitch in, but looks like he doesn't have time at the moment.

Maybe wait with merging until Wednesday, when the current tournament games have been played - just in case?

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not that familiar with the things you are working on but will try to answer some questions:

The username of auth_user is a field of type vchar. So this is not an index.
A username "Kaputtnik" is a different user as "kaputtnik" (usernames are always case sensitive)

Are there any usernames registered which will break when we implement this?

If you mean a case insensitive search: I didn't searched for usernames, but if have found none it would mean to implement a thing to forbid a username 'Kaputtnik' when a username 'kaputtnik' already exists. This has to be done before you implement a case insensitive search.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review! We could merge this, but as far as I know SirVer has to deploy it manually anyway. So lets just wait until he has time for it and merge the related Widelands branch when he deploys the metaserver.

Also thanks for the information regarding the database server, I totally forgot about the registration process. So we have to update the website, the metaserver and Widelands itself when we want to add this. I will open a bug report / feature request on launchpad for implementing this in the future.

Copy link
Contributor

@gunchleoc gunchleoc left a comment

Choose a reason for hiding this comment

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

All this server stuff is pretty much Greek to me, but I can' find any obvious errors.

@SirVer
Copy link
Contributor

SirVer commented Nov 14, 2017

I am right now in my last week at Google which is a bit draining, so I do not have the energy for reviews right now. I have two weeks of vacation starting next week, I will do it then.

@Notabilis
Copy link
Contributor Author

No problem, take your time. This isn't urgent and it makes no sense doing a review when you don't want to do so.

@SirVer
Copy link
Contributor

SirVer commented Nov 15, 2017

I really want to do the review though. This feature is the most anticipated on my wish list since zoom is implemented.

@SirVer
Copy link
Contributor

SirVer commented Nov 22, 2017

Code lgtm!

@SirVer
Copy link
Contributor

SirVer commented Nov 22, 2017

@gunchleoc @frankystone you should have all the rights to do the deploy of this on the server as well, right?

@Notabilis if you want to get an ssh account on the server to do the deploying, just send me an email directly.

@frankystone
Copy link
Contributor

I should have the rights... but i am feeling not able to deploy it. I don't know anything about this Github stuff...

@gunchleoc
Copy link
Contributor

Maybe we should have a session together where you can teach us?

@SirVer
Copy link
Contributor

SirVer commented Nov 23, 2017

I am happy to have a session. We haven't talked in a long while anyways, so its time.

I do not think I can teach much more than what is in the README of this repository already though.

@SirVer
Copy link
Contributor

SirVer commented Nov 25, 2017

Will merge now and redeploy once https://code.launchpad.net/~widelands-dev/widelands/net-uuid/+merge/332264 is submitted. Probably tomorrow.

@SirVer SirVer merged commit 273e653 into widelands:master Nov 25, 2017
@SirVer
Copy link
Contributor

SirVer commented Nov 26, 2017

The widelands branch has been merged at r8503. I just now redeployed the current master of this repo (including this PR) onto the server.

Expect people to start asking questions why the have trouble with dev versions before 8503.

@Notabilis
Copy link
Contributor Author

Seems to be working fine, thanks!

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

Successfully merging this pull request may close these issues.

None yet

4 participants