mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 19:11:59 -08:00
Merge origin/master
This commit is contained in:
commit
d71ebdcea9
11 changed files with 57 additions and 25 deletions
|
|
@ -62,7 +62,7 @@ public interface MageServer {
|
|||
|
||||
boolean resetPassword(String sessionId, String email, String authToken, String password) throws MageException;
|
||||
|
||||
boolean connectUser(String userName, String password, String sessionId, MageVersion version) throws MageException;
|
||||
boolean connectUser(String userName, String password, String sessionId, MageVersion version, String userIdStr) throws MageException;
|
||||
|
||||
boolean connectAdmin(String password, String sessionId, MageVersion version) throws MageException;
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ public interface MageServer {
|
|||
List<CardInfo> getMissingCardsData(List<String> classNames);
|
||||
|
||||
// user methods
|
||||
boolean setUserData(String userName, String sessionId, UserData userData, String clientVersion) throws MageException;
|
||||
boolean setUserData(String userName, String sessionId, UserData userData, String clientVersion, String userIdStr) throws MageException;
|
||||
|
||||
void sendFeedbackMessage(String sessionId, String username, String title, String type, String message, String email) throws MageException;
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ public class Connection {
|
|||
private String proxyPassword;
|
||||
private int clientCardDatabaseVersion;
|
||||
private boolean forceDBComparison;
|
||||
private String userIdStr;
|
||||
|
||||
private UserData userData;
|
||||
|
||||
|
|
@ -167,6 +168,14 @@ public class Connection {
|
|||
this.username = username;
|
||||
}
|
||||
|
||||
public String getUserIdStr() {
|
||||
return userIdStr;
|
||||
}
|
||||
|
||||
public void setUserIdStr(String userIdStr) {
|
||||
this.userIdStr = userIdStr;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,9 +222,9 @@ public class SessionImpl implements Session {
|
|||
boolean registerResult;
|
||||
if (connection.getAdminPassword() == null) {
|
||||
// for backward compatibility. don't remove twice call - first one does nothing but for version checking
|
||||
registerResult = server.connectUser(connection.getUsername(), connection.getPassword(), sessionId, client.getVersion());
|
||||
registerResult = server.connectUser(connection.getUsername(), connection.getPassword(), sessionId, client.getVersion(), connection.getUserIdStr());
|
||||
if (registerResult) {
|
||||
server.setUserData(connection.getUsername(), sessionId, connection.getUserData(), client.getVersion().toString());
|
||||
server.setUserData(connection.getUsername(), sessionId, connection.getUserData(), client.getVersion().toString(), connection.getUserIdStr());
|
||||
}
|
||||
} else {
|
||||
registerResult = server.connectAdmin(connection.getAdminPassword(), sessionId, client.getVersion());
|
||||
|
|
@ -1466,7 +1466,7 @@ public class SessionImpl implements Session {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean setActivation(String userName, boolean active) {
|
||||
try {
|
||||
|
|
@ -1571,7 +1571,7 @@ public class SessionImpl implements Session {
|
|||
public boolean updatePreferencesForServer(UserData userData) {
|
||||
try {
|
||||
if (isConnected()) {
|
||||
server.setUserData(connection.getUsername(), sessionId, userData, null);
|
||||
server.setUserData(connection.getUsername(), sessionId, userData, null, null);
|
||||
}
|
||||
return true;
|
||||
} catch (MageException ex) {
|
||||
|
|
|
|||
|
|
@ -46,8 +46,9 @@ public class UserView implements Serializable {
|
|||
private final Date muteChatUntil;
|
||||
private final String clientVersion;
|
||||
private final String email;
|
||||
private final String userIdStr;
|
||||
|
||||
public UserView(String userName, String host, String sessionId, Date timeConnected, String gameInfo, String userState, Date muteChatUntil, String clientVersion, String email) {
|
||||
public UserView(String userName, String host, String sessionId, Date timeConnected, String gameInfo, String userState, Date muteChatUntil, String clientVersion, String email, String userIdStr) {
|
||||
this.userName = userName;
|
||||
this.host = host;
|
||||
this.sessionId = sessionId;
|
||||
|
|
@ -57,6 +58,7 @@ public class UserView implements Serializable {
|
|||
this.muteChatUntil = muteChatUntil;
|
||||
this.clientVersion = clientVersion;
|
||||
this.email = email;
|
||||
this.userIdStr = userIdStr;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
|
|
@ -90,9 +92,12 @@ public class UserView implements Serializable {
|
|||
public Date getTimeConnected() {
|
||||
return timeConnected;
|
||||
}
|
||||
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public String getUserIdStr() {
|
||||
return userIdStr;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue