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 String userState;
private final Date muteChatUntil; private final Date muteChatUntil;
private final String clientVersion; 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.userName = userName;
this.host = host; this.host = host;
this.sessionId = sessionId; this.sessionId = sessionId;
@ -55,6 +56,7 @@ public class UserView implements Serializable {
this.userState = userState; this.userState = userState;
this.muteChatUntil = muteChatUntil; this.muteChatUntil = muteChatUntil;
this.clientVersion = clientVersion; this.clientVersion = clientVersion;
this.email = email;
} }
public String getUserName() { public String getUserName() {
@ -88,5 +90,9 @@ public class UserView implements Serializable {
public Date getTimeConnected() { public Date getTimeConnected() {
return timeConnected; return timeConnected;
} }
public String getEmail() {
return email;
}
} }

View file

@ -157,7 +157,7 @@ public class MageServerImpl implements MageServer {
} }
return true; return true;
} }
@Override @Override
public boolean resetPassword(String sessionId, String email, String authToken, String password) throws MageException { public boolean resetPassword(String sessionId, String email, String authToken, String password) throws MageException {
if (!ConfigSettings.getInstance().isAuthenticationActivated()) { if (!ConfigSettings.getInstance().isAuthenticationActivated()) {
@ -966,7 +966,8 @@ public class MageServerImpl implements MageServer {
user.getGameInfo(), user.getGameInfo(),
user.getUserState().toString(), user.getUserState().toString(),
user.getChatLockedUntil(), user.getChatLockedUntil(),
user.getClientVersion() user.getClientVersion(),
user.getEmail()
)); ));
} }
return users; return users;

View file

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