mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-24 19:25:13 +01:00
Lowercase PlayerAuth nickname in constructor and setter.
This commit is contained in:
parent
69361de262
commit
a8f3a441d5
@ -23,9 +23,8 @@ public class PlayerAuth {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public PlayerAuth(String serialized)
|
public PlayerAuth(String serialized) {
|
||||||
{
|
this.deserialize(serialized);
|
||||||
this.unserialize(serialized);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -163,8 +162,10 @@ public class PlayerAuth {
|
|||||||
* @param email String
|
* @param email String
|
||||||
* @param realName String
|
* @param realName String
|
||||||
*/
|
*/
|
||||||
public PlayerAuth(String nickname, String hash, String salt, int groupId, String ip, long lastLogin, double x, double y, double z, String world, String email, String realName) {
|
public PlayerAuth(String nickname, String hash, String salt, int groupId, String ip,
|
||||||
this.nickname = nickname;
|
long lastLogin, double x, double y, double z, String world, String email,
|
||||||
|
String realName) {
|
||||||
|
this.nickname = nickname.toLowerCase();
|
||||||
this.hash = hash;
|
this.hash = hash;
|
||||||
this.ip = ip;
|
this.ip = ip;
|
||||||
this.lastLogin = lastLogin;
|
this.lastLogin = lastLogin;
|
||||||
@ -203,7 +204,7 @@ public class PlayerAuth {
|
|||||||
* @param nickname String
|
* @param nickname String
|
||||||
*/
|
*/
|
||||||
public void setName(String nickname) {
|
public void setName(String nickname) {
|
||||||
this.nickname = nickname;
|
this.nickname = nickname.toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -455,34 +456,32 @@ public class PlayerAuth {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to serialize playerauth
|
* Method to serialize PlayerAuth
|
||||||
*
|
*
|
||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
public String serialize()
|
public String serialize() {
|
||||||
{
|
|
||||||
StringBuilder str = new StringBuilder();
|
StringBuilder str = new StringBuilder();
|
||||||
str.append(this.nickname).append(';');
|
char d = ';';
|
||||||
str.append(this.realName).append(';');
|
str.append(this.nickname).append(d);
|
||||||
str.append(this.ip).append(';');
|
str.append(this.realName).append(d);
|
||||||
str.append(this.email).append(';');
|
str.append(this.ip).append(d);
|
||||||
str.append(this.hash).append(';');
|
str.append(this.email).append(d);
|
||||||
str.append(this.salt).append(';');
|
str.append(this.hash).append(d);
|
||||||
str.append(this.groupId).append(';');
|
str.append(this.salt).append(d);
|
||||||
str.append(this.lastLogin).append(';');
|
str.append(this.groupId).append(d);
|
||||||
str.append(this.world).append(';');
|
str.append(this.lastLogin).append(d);
|
||||||
str.append(this.x).append(';');
|
str.append(this.world).append(d);
|
||||||
str.append(this.y).append(';');
|
str.append(this.x).append(d);
|
||||||
|
str.append(this.y).append(d);
|
||||||
str.append(this.z);
|
str.append(this.z);
|
||||||
return str.toString();
|
return str.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to unserialize playerauth
|
* Method to deserialize PlayerAuth
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void unserialize(String str)
|
public void deserialize(String str) {
|
||||||
{
|
|
||||||
String[] args = str.split(";");
|
String[] args = str.split(";");
|
||||||
this.nickname = args[0];
|
this.nickname = args[0];
|
||||||
this.realName = args[1];
|
this.realName = args[1];
|
||||||
@ -504,17 +503,17 @@ public class PlayerAuth {
|
|||||||
|
|
||||||
public static final class Builder {
|
public static final class Builder {
|
||||||
private String name;
|
private String name;
|
||||||
private String realName;
|
private String realName = "Player";
|
||||||
private String hash;
|
private String hash = "";
|
||||||
private String salt;
|
private String salt = "";
|
||||||
private String ip;
|
private String ip = "127.0.0.1";
|
||||||
private String world;
|
private String world = "world";
|
||||||
private double x;
|
private double x = 0.0f;
|
||||||
private double y;
|
private double y = 0.0f;
|
||||||
private double z;
|
private double z = 0.0f;
|
||||||
private long lastLogin;
|
private long lastLogin = System.currentTimeMillis();
|
||||||
private int groupId;
|
private int groupId = -1;
|
||||||
private String email;
|
private String email = "your@email.com";
|
||||||
|
|
||||||
public PlayerAuth build() {
|
public PlayerAuth build() {
|
||||||
return new PlayerAuth(
|
return new PlayerAuth(
|
||||||
|
Loading…
Reference in New Issue
Block a user