It is currently January 21st, 2018, 10:17 am


All times are UTC




Post new topic Reply to topic  [ 29 posts ] 
Author Message
 Post subject: Mojang Account Support
PostPosted: March 23rd, 2013, 8:01 pm 
User avatar

Joined: May 6th, 2012, 8:01 pm
Posts: 32
Location: Classified
Hello! I'm sure that most people here are aware that Mojang has made it so that users could only have a MineCraft account if they purchased premium. Users can still make mojang accounts, but their log-in-name is the email they used for verification. This means that when logging into a server, their name is [email protected] or something along those lines. Obviously, IsValidName catches the '@' (at sign), and returns false, kicking the player before they can log in. By allowing the at-sign into a player name, we can allow mojang accounts to log into fcraft servers.

Image

Now, what I'm here to ask is, how can we trim a player.Name to something more appealing than [email protected] over to SirTacoMan314_.

I tried something to edit the name, but player.Name is readonly. Does anyone know a proper fix to this?

_________________
The early bird gets the worm, but the second mouse gets the cheese.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 25th, 2013, 5:43 am 
fCraft Developer
User avatar

Joined: May 21st, 2011, 10:53 pm
Posts: 1386
For "proper fix" information, see this post.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 26th, 2013, 12:48 am 
User avatar

Joined: May 6th, 2012, 8:01 pm
Posts: 32
Location: Classified
So, its all on Mojang? The only real issue with emails is that it looks bad in chat and, well, people will know your email. Obviously it is easy to set a displayed name for a player, but is it even possible to modify a user's name in the db?

_________________
The early bird gets the worm, but the second mouse gets the cheese.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 26th, 2013, 8:01 am 
User avatar

Joined: October 20th, 2011, 9:20 am
Posts: 220
Location: Subnet
It's not possible to change the playerDB names automatically, you could do it by hand but then fragmer will shout at you for not being responsible for loss of data and stuff.

I could probably paste some code to work around your read-only problem but I don't think I have time for that until thursday.

Hey why not give all players with email a displayedname automatically? I think that may solve your issues

_________________
A = {x ∈ P(U) | x ∉ x}

Show
Mods:
  1. /Su - Allows players to temporarily become a different rank
  2. /Snap - Like /Line but only draws straight or diagonal lines.
  3. pre-0.630 skip/none block


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 26th, 2013, 4:49 pm 
User avatar

Joined: May 6th, 2012, 8:01 pm
Posts: 32
Location: Classified
Hellenion wrote:
It's not possible to change the playerDB names automatically, you could do it by hand but then fragmer will shout at you for not being responsible for loss of data and stuff.

I could probably paste some code to work around your read-only problem but I don't think I have time for that until thursday.

Hey why not give all players with email a displayedname automatically? I think that may solve your issues


Making a displayedname for users logging in is pretty simple, but what about when players want to whisper or /info the mojang account user. They would have to type the whole thing out. Plus, since the mojang account user's still have their email as their player name, their email is still rather public, posing a privacy issue. Finally, if a mojang account user sets their displayedname to something else, when they reset that name, it would just go back to showing the server their email. Changing the displayedname is only a very temporary fix. If we could somehow make the player name read-write instead of read, then we could automatically catch emails, and rewrite their names to be more user friendly. Also, there really is no reason for the player name to be readonly. It shouldn't pose any data risk, should it?

_________________
The early bird gets the worm, but the second mouse gets the cheese.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 26th, 2013, 6:30 pm 
User avatar

Joined: October 20th, 2011, 9:20 am
Posts: 220
Location: Subnet
Well, everything that can change poses a risk. Just as an example, I'm sure this is not the only issue, but Playernames must be unique, if it somehow happened that a duplicate playername was written, the player in question would most likely be unidentifiable by the server. As it is now this cannot happen.

I don't know why playername was decided upon to be read-only, but I myself have a habit of making rewritable variables the exception. That way the systems I develop are much more predictable and understandable. If you have any skill in modding then let me hint you this:
read-only variables cannot only be read, they can be assigned to exactly once, which is then usually done at a defined (early) point in time such as the constructor. They are often initialized from the value of another object, so if you modify the value before it is first assigned, then you can still make the change you want to. But find where it is written and where the value comes from.

Hope that helps!

_________________
A = {x ∈ P(U) | x ∉ x}

Show
Mods:
  1. /Su - Allows players to temporarily become a different rank
  2. /Snap - Like /Line but only draws straight or diagonal lines.
  3. pre-0.630 skip/none block


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 26th, 2013, 9:52 pm 
User avatar

Joined: May 6th, 2012, 8:01 pm
Posts: 32
Location: Classified
Well, it kidna works. But the playernames don't bypass the player verification yet.

Image
Honestly, for now, I am okay with this. I'm prob going to give mojang account users a default displayedname without the @, but I'll have to leave the @ so that their name wont conflict with normal account names. Also, I'll need to work with the error message above.
Thanks for your little hints hellenion!

Edit: Email users now get a displayedname without the @!
(All of this is on git if anyone was actually interested.)

_________________
The early bird gets the worm, but the second mouse gets the cheese.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 28th, 2013, 1:19 pm 

Joined: January 6th, 2013, 12:17 am
Posts: 24
Hellenion wrote:
Well, everything that can change poses a risk. Just as an example, I'm sure this is not the only issue, but Playernames must be unique, if it somehow happened that a duplicate playername was written, the player in question would most likely be unidentifiable by the server. As it is now this cannot happen.


Hi,
I would like to comment on the above statement first.
On maiome (an fcraft server) we have a character called jacob (he is staff) if you do /info jacob it brings up a comment stating there are a number of names conforming to that and gives a list i.e. jacob, jacob154, jacobsname etc (i cant remember the exact names here). I can /info any of the others but can't /info jacob. is this what you are implying above? Is there any way I can /info him?

I am trying to get on maiome. I can get on as matelo2, I am a moderator. To do some testing I wanted to get on as a newb so I registered with mojang and got, unfortunately, an e-mail address. The server refuses to let me on, sometimes it lets me on with the e-mail address but recognises me as matelo2 a moderator? This might be because I am pressing the resume button on the wom client after checking the server is online with my matelo2 password now I think about it.
I don't have the facility to get at the source software but could you give me some idea how I could alter the source code to get round this so I can pass it on to the owner if I can contact him?
Thanks.
Matelo2


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 28th, 2013, 4:03 pm 
User avatar

Joined: May 6th, 2012, 8:01 pm
Posts: 32
Location: Classified
Yes, mojang accounts will give you an email username, that's the whole reason I was trying to add mojang account support. The resume button on wom will bring you back to the last server you successfully joined. Also, I'm pretty sure fCraft will look at your ip and try to allow you to connect if ips match.

_________________
The early bird gets the worm, but the second mouse gets the cheese.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 29th, 2013, 8:51 pm 
User avatar

Joined: May 6th, 2012, 8:01 pm
Posts: 32
Location: Classified
In order to guarantee unique names, I'm thinking of adding a small xml database for all mojang account users. When logging in, the server checks if the xml db has the player. If not, it creates a new element for that user, with an attribute of a number. The number increases as the entrees increase. So for example, the first user to log in with a mojang account would get the a number one of 1, and the second person would get 2. Then, when they log in from that point, a person with an email of [email protected] becomes [email protected](the number of their position in the xml db goes here).

It's a work in progress :D

_________________
The early bird gets the worm, but the second mouse gets the cheese.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 29th, 2013, 10:45 pm 
User avatar

Joined: October 20th, 2011, 9:20 am
Posts: 220
Location: Subnet
matelo2 wrote:
Hellenion wrote:
if it somehow happened that a duplicate playername was written, the player in question would most likely be unidentifiable by the server.

we have a character called jacob (he is staff) if you do /info jacob it brings up a comment stating there are a number of names conforming to that and gives a list i.e. jacob, jacob154, jacobsname etc (i cant remember the exact names here). I can /info any of the others but can't /info jacob. is this what you are implying above? Is there any way I can /info him?

That is a great example of what I meant, but you should be able to /info jacob by typing jacobs exact playername. It might be jacob is just a "displayedname", which is like a nickname. If you type the exact and real name of jacob you should get their info.

The source code is accessible by something called "subversion", here is the latest tag: http://svn.fcraft.net:8080/svn/fcraft/tags/0.639/
I believe fcraft's author recommends some version of Microsoft Visual Studio to edit the source, but I use monodevelop, myself. This all does require quite some practise, though, it is certainly not something you can learn in a few days.

LechosenOne, your project has some very interesting solutions for the problems with e-mail accounts. I cannot find the Git repository you mean (or is it Legendcraft?) Would you mind throwing in a link?

_________________
A = {x ∈ P(U) | x ∉ x}

Show
Mods:
  1. /Su - Allows players to temporarily become a different rank
  2. /Snap - Like /Line but only draws straight or diagonal lines.
  3. pre-0.630 skip/none block


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 30th, 2013, 1:01 am 
User avatar

Joined: May 6th, 2012, 8:01 pm
Posts: 32
Location: Classified
Yes, LegendCraft is my mod on 800Craft. It's mostly for educational purposes but 3-4 servers use it as their server software. Here's the link if you wanted https://github.com/LeChosenOne/LegendCr ... its/master

Edit: Updated the software again with the experimental xml db.

_________________
The early bird gets the worm, but the second mouse gets the cheese.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 31st, 2013, 12:16 am 

Joined: January 6th, 2013, 12:17 am
Posts: 24
Hellenion wrote:
matelo2 wrote:
Hellenion wrote:
if it somehow happened that a duplicate playername was written, the player in question would most likely be unidentifiable by the server.

we have a character called jacob (he is staff) if you do /info jacob it brings up a comment stating there are a number of names conforming to that and gives a list i.e. jacob, jacob154, jacobsname etc (i cant remember the exact names here). I can /info any of the others but can't /info jacob. is this what you are implying above? Is there any way I can /info him?

That is a great example of what I meant, but you should be able to /info jacob by typing jacobs exact playername. It might be jacob is just a "displayedname", which is like a nickname. If you type the exact and real name of jacob you should get their info.


How do I find jacobs full name, everything I have tried just calls him jacob?
I don't know if you could go on maiome and get the info as a newb but you would see what I mean.
Thanks anyway.

Is it possible to be able to alter the messages that keep appearing on the server globally as an administrator or can it only be done from the consol? Including the one that appears every time someone joins the server?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 31st, 2013, 1:10 am 
User avatar

Joined: May 6th, 2012, 8:01 pm
Posts: 32
Location: Classified
When a player logs into a server, the console will be able to see their full name. I don't know if fCraft has /whois, which in 800craft, displays the all the names associated with a given displayedname. Otherwise, I'm pretty sure when a player logs in, there is a server message that displays both the full player.Name, and the displayedname. Here, I'll go see if that's true.

Edit:
Code:
Logger.Log( LogType.UserActivity,
                        "Player {0} connected from {1} (session #{2})",
                        Name, IP, Info.TimesVisited );

Yup, when a player joins a server, the console is given their full username.
Also, you should be able to type /list displayednames, which will give a list of all nicknames, along with the players' full usernames.

_________________
The early bird gets the worm, but the second mouse gets the cheese.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 31st, 2013, 8:54 pm 

Joined: January 6th, 2013, 12:17 am
Posts: 24
if I do /whois jacob I get a list of names including jacob but no other name for him?
there is no /list displayednames in maiome but we are using a fairly old version, is the one in the present version?
Either way it gives me no way of getting info on our jacob the moderator


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 31st, 2013, 9:09 pm 

Joined: January 6th, 2013, 12:17 am
Posts: 24
LeChosenOne wrote:
Yes, mojang accounts will give you an email username, that's the whole reason I was trying to add mojang account support. The resume button on wom will bring you back to the last server you successfully joined. Also, I'm pretty sure fCraft will look at your ip and try to allow you to connect if ips match.

Which is possibly why it is logging me on a matelo2 when i try to go on as my e-mail user name from the same ip address do you think. If so is there any way of correcting this?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 31st, 2013, 9:58 pm 
User avatar

Joined: May 6th, 2012, 8:01 pm
Posts: 32
Location: Classified
...Yup I lost you. Just try updating to the latest fCraft, and then use /list displayednames.

_________________
The early bird gets the worm, but the second mouse gets the cheese.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: March 31st, 2013, 10:55 pm 

Joined: January 6th, 2013, 12:17 am
Posts: 24
i will try to get the owner to do that. He doesn't use the fb any more so it is not easy to contact him.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: April 1st, 2013, 4:53 am 
fCraft Developer
User avatar

Joined: May 21st, 2011, 10:53 pm
Posts: 1386
LeChosenOne wrote:
...Yup I lost you. Just try updating to the latest fCraft, and then use /list displayednames.

There is no such feature in vanilla fCraft. You must be thinking of a mod.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: April 3rd, 2013, 9:44 pm 
User avatar

Joined: May 6th, 2012, 8:01 pm
Posts: 32
Location: Classified
Back on track, does anyone know the best way to work the playerDB instead of making and xml (it is probably faster and easier from the playerDB).

_________________
The early bird gets the worm, but the second mouse gets the cheese.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: April 7th, 2013, 8:51 am 
fCraft Developer
User avatar

Joined: May 21st, 2011, 10:53 pm
Posts: 1386
Adding PlayerDB fields is not that hard. Just keep in mind that you can't back away from an added field -- if you change your mind at a later date, and you'll have to add compatibility code forever to avoid breaking old files.

There are four basic steps to adding a PlayerDB field:
  1. add a new property to the PlayerInfo class
  2. add code to serialize/save this property, at the end of PlayerInfo.Serialize()
  3. add code to parse/load this property at the end of PlayerInfo.LoadFormat2()
  4. document what you did: add new property's name to PlayerDB.Header string, and write some comments


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: April 7th, 2013, 5:21 pm 
User avatar

Joined: May 6th, 2012, 8:01 pm
Posts: 32
Location: Classified
The only issue is, it seems rather difficult to determine how many of a certain playerDB's are filled in. Also, for players that don't need this feature, can their section on the DB be left blank.

pseudo code:
if(player is using mojangaccout)
int i = (players in the playerDB using a mojang account) +1
player.Name = player.Name + 1;

If you can understand that, then that is where my dilemma comes into play. Is it possible to count up the playerDB and find how many players have a certain field in use?

_________________
The early bird gets the worm, but the second mouse gets the cheese.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: April 7th, 2013, 6:33 pm 
User avatar

Joined: October 20th, 2011, 9:20 am
Posts: 220
Location: Subnet
Easy with LINQ, just select the playerInfos Where the field is not blank and retrieve the Count

It'll look a bit like:
Code:
playerinfos.Where( info => info.mojang != null ).Count();

Probably.

Instead of my unchecked, probably horribly wrong LINQ, have a reference: http://msdn.microsoft.com/en-us/library/bb308959.aspx

_________________
A = {x ∈ P(U) | x ∉ x}

Show
Mods:
  1. /Su - Allows players to temporarily become a different rank
  2. /Snap - Like /Line but only draws straight or diagonal lines.
  3. pre-0.630 skip/none block


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: April 8th, 2013, 7:39 pm 
fCraft Developer
User avatar

Joined: May 21st, 2011, 10:53 pm
Posts: 1386
Hellenion wrote:
Code:
playerinfos.Where( info => info.mojang != null ).Count();

Even simpler:
Code:
playerinfos.Count( info => info.mojang != null );


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: April 8th, 2013, 10:12 pm 
User avatar

Joined: May 6th, 2012, 8:01 pm
Posts: 32
Location: Classified
I think i'll make info.mojang an int, and on default it will be zero.

Code:
playerinfos.Count( info => info.mojang < 0 );

I can take that count, and set that number + 1, then set that as the current player's info.mojang. Does that seem reasonable?

_________________
The early bird gets the worm, but the second mouse gets the cheese.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: April 9th, 2013, 6:15 am 
User avatar

Joined: October 20th, 2011, 9:20 am
Posts: 220
Location: Subnet
What exactly were you planning on doing with your number? Did you not need a way to relate an e-mail address to a playerinfo object?

_________________
A = {x ∈ P(U) | x ∉ x}

Show
Mods:
  1. /Su - Allows players to temporarily become a different rank
  2. /Snap - Like /Line but only draws straight or diagonal lines.
  3. pre-0.630 skip/none block


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: April 9th, 2013, 10:00 pm 
User avatar

Joined: May 6th, 2012, 8:01 pm
Posts: 32
Location: Classified
I want to shorten a player's name when they use a mojang account. Chart thing:

[email protected]
becomes
[email protected]

The problem here is that [email protected], [email protected], [email protected] and etc all would fit under the same playerDB slot, since they would all have the same name. In order to prevent this, I needed to create a playerDB entree with a unique number for each mojang account user. Now, the outcome for the first player to log in with a mojang account would look like this.

[email protected]

If the 253th player to log on with a mojang account had an email of [email protected], then that would become

[email protected]

The entire purpose of this is to guarantee each player a unique name, while still granting them privacy for their email. I have to leave the @ in the name, otherwise there is a risk of mojang account [email protected] and normal account minecraftFan1 logging in under the same name in the player database. Does that clarify it up? I'm going to go ahead and serialize this and see if I get a result. I'll post back if I run into a brick wall or get it to work.

_________________
The early bird gets the worm, but the second mouse gets the cheese.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: May 24th, 2013, 11:20 pm 
User avatar

Joined: May 6th, 2012, 8:01 pm
Posts: 32
Location: Classified
https://github.com/GlennMR/800craft/com ... 81dbfcd8ba

_________________
The early bird gets the worm, but the second mouse gets the cheese.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Mojang Account Support
PostPosted: July 30th, 2013, 10:08 am 
fCraft Developer
User avatar

Joined: May 21st, 2011, 10:53 pm
Posts: 1386
As of fCraft 0.640, there is now built-in Mojang account support.

To create a "Name" from an email address, the domain part of the email is cut off, so e.g. "[email protected]" becomes "[email protected]". If more players later join with the same local part, but different domain part, a number is added after the @-sign, starting with number 2. So e.g. "[email protected]" joining later would become "[email protected]".

Adding support included adding Email (string) field to PlayerDB, modifying Trie<T> to support dots and @-signs in player names, changing Player.IsValidName logic, changes to PlayerDB.FindOrCreatePlayerInfo, and changes to Player.LoginSequence.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net