Merge pull request #2801 from spjspj/master

Add missing field to userData
This commit is contained in:
spjspj 2017-01-15 23:34:36 +11:00 committed by GitHub
commit ae03ad2453
3 changed files with 17 additions and 3 deletions

View file

@ -45,8 +45,9 @@ public class UserView implements Serializable {
private final String userState;
private final Date muteChatUntil;
private final String clientVersion;
private final String email;
public UserView(String userName, String host, String sessionId, Date timeConnected, String gameInfo, String userState, Date muteChatUntil, String clientVersion) {
public UserView(String userName, String host, String sessionId, Date timeConnected, String gameInfo, String userState, Date muteChatUntil, String clientVersion, String email) {
this.userName = userName;
this.host = host;
this.sessionId = sessionId;
@ -55,6 +56,7 @@ public class UserView implements Serializable {
this.userState = userState;
this.muteChatUntil = muteChatUntil;
this.clientVersion = clientVersion;
this.email = email;
}
public String getUserName() {
@ -89,4 +91,8 @@ public class UserView implements Serializable {
return timeConnected;
}
public String getEmail() {
return email;
}
}

View file

@ -966,7 +966,8 @@ public class MageServerImpl implements MageServer {
user.getGameInfo(),
user.getUserState().toString(),
user.getChatLockedUntil(),
user.getClientVersion()
user.getClientVersion(),
user.getEmail()
));
}
return users;

View file

@ -784,6 +784,13 @@ public class User {
return number;
}
public String getEmail() {
if (authorizedUser != null) {
return authorizedUser.email;
}
return "";
}
private void updateAuthorizedUser() {
if (authorizedUser != null) {
authorizedUser.lastConnection = this.connectionTime;