mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
XMage 1.4.17V0
This commit is contained in:
parent
b2bd7f5e24
commit
8b62eece68
43 changed files with 182 additions and 157 deletions
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-root</artifactId>
|
<artifactId>mage-root</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-root</artifactId>
|
<artifactId>mage-root</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-common</artifactId>
|
<artifactId>mage-common</artifactId>
|
||||||
|
|
|
@ -79,7 +79,7 @@ public interface MageServer {
|
||||||
List<CardInfo> getMissingCardsData(List<String> classNames);
|
List<CardInfo> getMissingCardsData(List<String> classNames);
|
||||||
|
|
||||||
// user methods
|
// user methods
|
||||||
boolean setUserData(String userName, String sessionId, UserData userData) throws MageException;
|
boolean setUserData(String userName, String sessionId, UserData userData, String clientVersion) throws MageException;
|
||||||
|
|
||||||
void sendFeedbackMessage(String sessionId, String username, String title, String type, String message, String email) throws MageException;
|
void sendFeedbackMessage(String sessionId, String username, String title, String type, String message, String email) throws MageException;
|
||||||
|
|
||||||
|
|
|
@ -223,7 +223,7 @@ public class SessionImpl implements Session {
|
||||||
// for backward compatibility. don't remove twice call - first one does nothing but for version checking
|
// 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());
|
||||||
if (registerResult) {
|
if (registerResult) {
|
||||||
server.setUserData(connection.getUsername(), sessionId, connection.getUserData());
|
server.setUserData(connection.getUsername(), sessionId, connection.getUserData(), client.getVersion().toString());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
registerResult = server.connectAdmin(connection.getAdminPassword(), sessionId, client.getVersion());
|
registerResult = server.connectAdmin(connection.getAdminPassword(), sessionId, client.getVersion());
|
||||||
|
@ -1544,7 +1544,7 @@ public class SessionImpl implements Session {
|
||||||
public boolean updatePreferencesForServer(UserData userData) {
|
public boolean updatePreferencesForServer(UserData userData) {
|
||||||
try {
|
try {
|
||||||
if (isConnected()) {
|
if (isConnected()) {
|
||||||
server.setUserData(connection.getUsername(), sessionId, userData);
|
server.setUserData(connection.getUsername(), sessionId, userData, null);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (MageException ex) {
|
} catch (MageException ex) {
|
||||||
|
|
|
@ -40,8 +40,8 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
|
||||||
*/
|
*/
|
||||||
public final static int MAGE_VERSION_MAJOR = 1;
|
public final static int MAGE_VERSION_MAJOR = 1;
|
||||||
public final static int MAGE_VERSION_MINOR = 4;
|
public final static int MAGE_VERSION_MINOR = 4;
|
||||||
public final static int MAGE_VERSION_PATCH = 16;
|
public final static int MAGE_VERSION_PATCH = 17;
|
||||||
public final static String MAGE_VERSION_MINOR_PATCH = "v4";
|
public final static String MAGE_VERSION_MINOR_PATCH = "V0";
|
||||||
public final static String MAGE_VERSION_INFO = "";
|
public final static String MAGE_VERSION_INFO = "";
|
||||||
|
|
||||||
private final int major;
|
private final int major;
|
||||||
|
|
|
@ -44,8 +44,9 @@ public class UserView implements Serializable {
|
||||||
private final String gameInfo;
|
private final String gameInfo;
|
||||||
private final String userState;
|
private final String userState;
|
||||||
private final Date muteChatUntil;
|
private final Date muteChatUntil;
|
||||||
|
private final String clientVersion;
|
||||||
|
|
||||||
public UserView(String userName, String host, String sessionId, Date timeConnected, String gameInfo, String userState, Date muteChatUntil) {
|
public UserView(String userName, String host, String sessionId, Date timeConnected, String gameInfo, String userState, Date muteChatUntil, String clientVersion) {
|
||||||
this.userName = userName;
|
this.userName = userName;
|
||||||
this.host = host;
|
this.host = host;
|
||||||
this.sessionId = sessionId;
|
this.sessionId = sessionId;
|
||||||
|
@ -53,6 +54,7 @@ public class UserView implements Serializable {
|
||||||
this.gameInfo = gameInfo;
|
this.gameInfo = gameInfo;
|
||||||
this.userState = userState;
|
this.userState = userState;
|
||||||
this.muteChatUntil = muteChatUntil;
|
this.muteChatUntil = muteChatUntil;
|
||||||
|
this.clientVersion = clientVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserName() {
|
public String getUserName() {
|
||||||
|
@ -67,10 +69,6 @@ public class UserView implements Serializable {
|
||||||
return sessionId;
|
return sessionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getConnectionTime() {
|
|
||||||
return timeConnected;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGameInfo() {
|
public String getGameInfo() {
|
||||||
return gameInfo;
|
return gameInfo;
|
||||||
}
|
}
|
||||||
|
@ -83,4 +81,12 @@ public class UserView implements Serializable {
|
||||||
return muteChatUntil;
|
return muteChatUntil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getClientVersion() {
|
||||||
|
return clientVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getTimeConnected() {
|
||||||
|
return timeConnected;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-plugins</artifactId>
|
<artifactId>mage-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-counter-plugin</artifactId>
|
<artifactId>mage-counter-plugin</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-root</artifactId>
|
<artifactId>mage-root</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-plugins</artifactId>
|
<artifactId>mage-plugins</artifactId>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-root</artifactId>
|
<artifactId>mage-root</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
|
|
|
@ -388,8 +388,9 @@ class TableUserModel extends AbstractTableModel {
|
||||||
public static final int POS_GAME_INFO = 4;
|
public static final int POS_GAME_INFO = 4;
|
||||||
public static final int POS_USER_STATE = 5;
|
public static final int POS_USER_STATE = 5;
|
||||||
public static final int POS_CHAT_MUTE = 6;
|
public static final int POS_CHAT_MUTE = 6;
|
||||||
|
public static final int POS_CLIENT_VERSION = 7;
|
||||||
|
|
||||||
private final String[] columnNames = new String[]{"User Name", "Host", "Time Connected", "SessionId", "Gameinfo", "User state", "Chat mute"};
|
private final String[] columnNames = new String[]{"User Name", "Host", "Time Connected", "SessionId", "Gameinfo", "User state", "Chat mute", "Client Version"};
|
||||||
private UserView[] users = new UserView[0];
|
private UserView[] users = new UserView[0];
|
||||||
private static final DateFormat formatterTime = new SimpleDateFormat("HH:mm:ss");
|
private static final DateFormat formatterTime = new SimpleDateFormat("HH:mm:ss");
|
||||||
private static final DateFormat formatterTimeStamp = new SimpleDateFormat("yy-M-dd HH:mm:ss");
|
private static final DateFormat formatterTimeStamp = new SimpleDateFormat("yy-M-dd HH:mm:ss");
|
||||||
|
@ -417,7 +418,7 @@ class TableUserModel extends AbstractTableModel {
|
||||||
case POS_HOST:
|
case POS_HOST:
|
||||||
return users[arg0].getHost();
|
return users[arg0].getHost();
|
||||||
case POS_TIME_CONNECTED:
|
case POS_TIME_CONNECTED:
|
||||||
return formatterTime.format(users[arg0].getConnectionTime());
|
return formatterTime.format(users[arg0].getTimeConnected());
|
||||||
case POS_SESSION_ID:
|
case POS_SESSION_ID:
|
||||||
return users[arg0].getSessionId();
|
return users[arg0].getSessionId();
|
||||||
case POS_GAME_INFO:
|
case POS_GAME_INFO:
|
||||||
|
@ -429,6 +430,8 @@ class TableUserModel extends AbstractTableModel {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return formatterTimeStamp.format(users[arg0].getMuteChatUntil());
|
return formatterTimeStamp.format(users[arg0].getMuteChatUntil());
|
||||||
|
case POS_CLIENT_VERSION:
|
||||||
|
return users[arg0].getClientVersion();
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-deck-constructed</artifactId>
|
<artifactId>mage-deck-constructed</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-deck-limited</artifactId>
|
<artifactId>mage-deck-limited</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-game-commanderduel</artifactId>
|
<artifactId>mage-game-commanderduel</artifactId>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-game-commanderfreeforall</artifactId>
|
<artifactId>mage-game-commanderfreeforall</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-game-freeforall</artifactId>
|
<artifactId>mage-game-freeforall</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-game-momirduel</artifactId>
|
<artifactId>mage-game-momirduel</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-game-tinyleadersduel</artifactId>
|
<artifactId>mage-game-tinyleadersduel</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-game-twoplayerduel</artifactId>
|
<artifactId>mage-game-twoplayerduel</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-player-ai-draftbot</artifactId>
|
<artifactId>mage-player-ai-draftbot</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-player-ai-ma</artifactId>
|
<artifactId>mage-player-ai-ma</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-player-ai</artifactId>
|
<artifactId>mage-player-ai</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-player-ai-mcts</artifactId>
|
<artifactId>mage-player-ai-mcts</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-player-aiminimax</artifactId>
|
<artifactId>mage-player-aiminimax</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-player-human</artifactId>
|
<artifactId>mage-player-human</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-tournament-boosterdraft</artifactId>
|
<artifactId>mage-tournament-boosterdraft</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-tournament-constructed</artifactId>
|
<artifactId>mage-tournament-constructed</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-tournament-sealed</artifactId>
|
<artifactId>mage-tournament-sealed</artifactId>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-root</artifactId>
|
<artifactId>mage-root</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-server-plugins</artifactId>
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-root</artifactId>
|
<artifactId>mage-root</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-server</artifactId>
|
<artifactId>mage-server</artifactId>
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class ChatSession {
|
||||||
if (user != null && !clients.containsKey(userId)) {
|
if (user != null && !clients.containsKey(userId)) {
|
||||||
String userName = user.getName();
|
String userName = user.getName();
|
||||||
clients.put(userId, userName);
|
clients.put(userId, userName);
|
||||||
broadcast(null, userName + " has joined", MessageColor.BLUE, true, MessageType.STATUS, null);
|
broadcast(null, userName + " has joined (" + user.getClientVersion() + ")", MessageColor.BLUE, true, MessageType.STATUS, null);
|
||||||
logger.trace(userName + " joined chat " + chatId);
|
logger.trace(userName + " joined chat " + chatId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,11 +211,11 @@ public class MageServerImpl implements MageServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setUserData(final String userName, final String sessionId, final UserData userData) throws MageException {
|
public boolean setUserData(final String userName, final String sessionId, final UserData userData, final String clientVersion) throws MageException {
|
||||||
return executeWithResult("setUserData", sessionId, new ActionWithBooleanResult() {
|
return executeWithResult("setUserData", sessionId, new ActionWithBooleanResult() {
|
||||||
@Override
|
@Override
|
||||||
public Boolean execute() throws MageException {
|
public Boolean execute() throws MageException {
|
||||||
return SessionManager.getInstance().setUserData(userName, sessionId, userData);
|
return SessionManager.getInstance().setUserData(userName, sessionId, userData, clientVersion);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1073,7 +1073,8 @@ public class MageServerImpl implements MageServer {
|
||||||
user.getConnectionTime(),
|
user.getConnectionTime(),
|
||||||
user.getGameInfo(),
|
user.getGameInfo(),
|
||||||
user.getUserState().toString(),
|
user.getUserState().toString(),
|
||||||
user.getChatLockedUntil()
|
user.getChatLockedUntil(),
|
||||||
|
user.getClientVersion()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
return users;
|
return users;
|
||||||
|
|
|
@ -251,9 +251,12 @@ public class Session {
|
||||||
this.userId = user.getId();
|
this.userId = user.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean setUserData(String userName, UserData userData) {
|
public boolean setUserData(String userName, UserData userData, String clientVersion) {
|
||||||
User user = UserManager.getInstance().getUserByName(userName);
|
User user = UserManager.getInstance().getUserByName(userName);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
|
if (clientVersion != null) {
|
||||||
|
user.setClientVersion(clientVersion);
|
||||||
|
}
|
||||||
if (user.getUserData() == null || user.getUserData().getGroupId() == UserGroup.DEFAULT.getGroupId()) {
|
if (user.getUserData() == null || user.getUserData().getGroupId() == UserGroup.DEFAULT.getGroupId()) {
|
||||||
user.setUserData(userData);
|
user.setUserData(userData);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -122,10 +122,10 @@ public class SessionManager {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean setUserData(String userName, String sessionId, UserData userData) throws MageException {
|
public boolean setUserData(String userName, String sessionId, UserData userData, String clientVersion) throws MageException {
|
||||||
Session session = sessions.get(sessionId);
|
Session session = sessions.get(sessionId);
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
session.setUserData(userName, userData);
|
session.setUserData(userName, userData, clientVersion);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -95,6 +95,7 @@ public class User {
|
||||||
private boolean active;
|
private boolean active;
|
||||||
private Date lockedUntil;
|
private Date lockedUntil;
|
||||||
private final AuthorizedUser authorizedUser;
|
private final AuthorizedUser authorizedUser;
|
||||||
|
private String clientVersion;
|
||||||
|
|
||||||
public User(String userName, String host, AuthorizedUser authorizedUser) {
|
public User(String userName, String host, AuthorizedUser authorizedUser) {
|
||||||
this.userId = UUID.randomUUID();
|
this.userId = UUID.randomUUID();
|
||||||
|
@ -125,6 +126,7 @@ public class User {
|
||||||
this.watchedGames = new ArrayList<>();
|
this.watchedGames = new ArrayList<>();
|
||||||
this.tablesToDelete = new ArrayList<>();
|
this.tablesToDelete = new ArrayList<>();
|
||||||
this.sessionId = "";
|
this.sessionId = "";
|
||||||
|
this.clientVersion = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
@ -172,6 +174,14 @@ public class User {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setClientVersion(String clientVersion) {
|
||||||
|
this.clientVersion = clientVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getClientVersion() {
|
||||||
|
return clientVersion;
|
||||||
|
}
|
||||||
|
|
||||||
public void setChatLockedUntil(Date chatLockedUntil) {
|
public void setChatLockedUntil(Date chatLockedUntil) {
|
||||||
this.chatLockedUntil = chatLockedUntil;
|
this.chatLockedUntil = chatLockedUntil;
|
||||||
updateAuthorizedUser();
|
updateAuthorizedUser();
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-root</artifactId>
|
<artifactId>mage-root</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-root</artifactId>
|
<artifactId>mage-root</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-root</artifactId>
|
<artifactId>mage-root</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-tests</artifactId>
|
<artifactId>mage-tests</artifactId>
|
||||||
|
|
|
@ -1,16 +1,5 @@
|
||||||
package org.mage.test.clientside.base;
|
package org.mage.test.clientside.base;
|
||||||
|
|
||||||
import mage.interfaces.MageException;
|
|
||||||
import mage.interfaces.Server;
|
|
||||||
import mage.interfaces.ServerState;
|
|
||||||
import mage.interfaces.callback.CallbackClient;
|
|
||||||
import mage.interfaces.callback.CallbackClientDaemon;
|
|
||||||
import mage.interfaces.callback.ClientCallback;
|
|
||||||
import mage.server.Main;
|
|
||||||
import mage.sets.Sets;
|
|
||||||
import mage.util.Logging;
|
|
||||||
import mage.view.*;
|
|
||||||
|
|
||||||
import java.rmi.NotBoundException;
|
import java.rmi.NotBoundException;
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
import java.rmi.registry.LocateRegistry;
|
import java.rmi.registry.LocateRegistry;
|
||||||
|
@ -22,14 +11,25 @@ import java.util.logging.Logger;
|
||||||
import mage.constants.MultiplayerAttackOption;
|
import mage.constants.MultiplayerAttackOption;
|
||||||
import mage.constants.RangeOfInfluence;
|
import mage.constants.RangeOfInfluence;
|
||||||
import mage.game.match.MatchOptions;
|
import mage.game.match.MatchOptions;
|
||||||
|
import mage.interfaces.MageException;
|
||||||
|
import mage.interfaces.Server;
|
||||||
|
import mage.interfaces.ServerState;
|
||||||
|
import mage.interfaces.callback.CallbackClient;
|
||||||
|
import mage.interfaces.callback.CallbackClientDaemon;
|
||||||
|
import mage.interfaces.callback.ClientCallback;
|
||||||
|
import mage.server.Main;
|
||||||
|
import mage.sets.Sets;
|
||||||
|
import mage.util.Logging;
|
||||||
|
import mage.view.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base for starting Mage server.
|
* Base for starting Mage server. Controls interactions between MageAPI and Mage
|
||||||
* Controls interactions between MageAPI and Mage Server.
|
* Server.
|
||||||
*
|
*
|
||||||
* @author nantuko
|
* @author nantuko
|
||||||
*/
|
*/
|
||||||
public class MageBase {
|
public class MageBase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MageBase single instance
|
* MageBase single instance
|
||||||
*/
|
*/
|
||||||
|
@ -96,10 +96,10 @@ public class MageBase {
|
||||||
Registry reg = LocateRegistry.getRegistry(serverName, port);
|
Registry reg = LocateRegistry.getRegistry(serverName, port);
|
||||||
server = (Server) reg.lookup("mage-server");
|
server = (Server) reg.lookup("mage-server");
|
||||||
sessionId = server.registerClient(userName, UUID.randomUUID());
|
sessionId = server.registerClient(userName, UUID.randomUUID());
|
||||||
CallbackClient client = new CallbackClient(){
|
CallbackClient client = new CallbackClient() {
|
||||||
@Override
|
@Override
|
||||||
public void processCallback(ClientCallback callback) {
|
public void processCallback(ClientCallback callback) {
|
||||||
logger.info("IN >> " + callback.getMessageId() + " - " + callback.getMethod());
|
logger.log(Level.INFO, "IN >> {0} - {1}", new Object[]{callback.getMessageId(), callback.getMethod()});
|
||||||
try {
|
try {
|
||||||
if (callback.getMethod().equals("startGame")) {
|
if (callback.getMethod().equals("startGame")) {
|
||||||
TableClientMessage data = (TableClientMessage) callback.getData();
|
TableClientMessage data = (TableClientMessage) callback.getData();
|
||||||
|
@ -119,14 +119,14 @@ public class MageBase {
|
||||||
}
|
}
|
||||||
} else if (callback.getMethod().equals("gameTarget")) {
|
} else if (callback.getMethod().equals("gameTarget")) {
|
||||||
GameClientMessage message = (GameClientMessage) callback.getData();
|
GameClientMessage message = (GameClientMessage) callback.getData();
|
||||||
logger.info("TARGET >> " + message.getMessage() + " >> " + message.getTargets());
|
logger.log(Level.INFO, "TARGET >> {0} >> {1}", new Object[]{message.getMessage(), message.getTargets()});
|
||||||
if (message.getMessage().equals("Select a starting player")) {
|
if (message.getMessage().equals("Select a starting player")) {
|
||||||
logger.info(" Sending >> " + playerId);
|
logger.log(Level.INFO, " Sending >> {0}", playerId);
|
||||||
server.sendPlayerUUID(gameId, sessionId, playerId);
|
server.sendPlayerUUID(gameId, sessionId, playerId);
|
||||||
}
|
}
|
||||||
} else if (callback.getMethod().equals("gameSelect")) {
|
} else if (callback.getMethod().equals("gameSelect")) {
|
||||||
GameClientMessage message = (GameClientMessage) callback.getData();
|
GameClientMessage message = (GameClientMessage) callback.getData();
|
||||||
logger.info("SELECT >> " + message.getMessage());
|
logger.log(Level.INFO, "SELECT >> {0}", message.getMessage());
|
||||||
if (phaseToWait == null) {
|
if (phaseToWait == null) {
|
||||||
synchronized (sync) {
|
synchronized (sync) {
|
||||||
sync.wait();
|
sync.wait();
|
||||||
|
@ -195,7 +195,6 @@ public class MageBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean giveme(String cardName) throws Exception {
|
public boolean giveme(String cardName) throws Exception {
|
||||||
return server.cheat(gameId, sessionId, playerId, cardName);
|
return server.cheat(gameId, sessionId, playerId, cardName);
|
||||||
}
|
}
|
||||||
|
@ -239,9 +238,9 @@ public class MageBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkBattlefield(String cardName) throws Exception {
|
public boolean checkBattlefield(String cardName) throws Exception {
|
||||||
gameView = server.getGameView(gameId, sessionId, playerId);
|
gameView = server.getGameView(gameId, sessionId, playerId);
|
||||||
for (PlayerView player: gameView.getPlayers()) {
|
for (PlayerView player : gameView.getPlayers()) {
|
||||||
if (player.getPlayerId().equals(playerId)) {
|
if (player.getPlayerId().equals(playerId)) {
|
||||||
for (PermanentView permanent : player.getBattlefield().values()) {
|
for (PermanentView permanent : player.getBattlefield().values()) {
|
||||||
if (permanent.getName().equals(cardName)) {
|
if (permanent.getName().equals(cardName)) {
|
||||||
|
@ -249,17 +248,17 @@ public class MageBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkGraveyardsEmpty() throws Exception {
|
public boolean checkGraveyardsEmpty() throws Exception {
|
||||||
gameView = server.getGameView(gameId, sessionId, playerId);
|
gameView = server.getGameView(gameId, sessionId, playerId);
|
||||||
for (PlayerView player: gameView.getPlayers()) {
|
for (PlayerView player : gameView.getPlayers()) {
|
||||||
if (player.getGraveyard().size() > 0) {
|
if (player.getGraveyard().size() > 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>mage-root</artifactId>
|
<artifactId>mage-root</artifactId>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|
|
@ -1,76 +1,76 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-root</artifactId>
|
<artifactId>mage-root</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage-verify</artifactId>
|
<artifactId>mage-verify</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>Mage Verify</name>
|
<name>Mage Verify</name>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>${project.groupId}</groupId>
|
<groupId>${project.groupId}</groupId>
|
||||||
<artifactId>mage</artifactId>
|
<artifactId>mage</artifactId>
|
||||||
<version>${mage-version}</version>
|
<version>${mage-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>${project.groupId}</groupId>
|
<groupId>${project.groupId}</groupId>
|
||||||
<artifactId>mage-sets</artifactId>
|
<artifactId>mage-sets</artifactId>
|
||||||
<version>${mage-version}</version>
|
<version>${mage-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
<version>2.6.3</version>
|
<version>2.6.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>log4j</groupId>
|
<groupId>log4j</groupId>
|
||||||
<artifactId>log4j</artifactId>
|
<artifactId>log4j</artifactId>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<pluginManagement>
|
<pluginManagement>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<argLine>-Dfile.encoding=UTF-8</argLine>
|
<argLine>-Dfile.encoding=UTF-8</argLine>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<!-- <configuration>
|
<!-- <configuration>
|
||||||
<compilerArgument>-Xlint:unchecked</compilerArgument>
|
<compilerArgument>-Xlint:unchecked</compilerArgument>
|
||||||
</configuration> -->
|
</configuration> -->
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<encoding>UTF-8</encoding>
|
<encoding>UTF-8</encoding>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
</pluginManagement>
|
||||||
<finalName>mage-verify</finalName>
|
<finalName>mage-verify</finalName>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<properties/>
|
<properties/>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-root</artifactId>
|
<artifactId>mage-root</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>mage</artifactId>
|
<artifactId>mage</artifactId>
|
||||||
|
|
|
@ -108,6 +108,9 @@ git log 73a2ccda9b36552a09cb2b6a5aef37559866d7fc..head --diff-filter=A --name-st
|
||||||
since 1.4.16v0
|
since 1.4.16v0
|
||||||
git log a6747590b336329404d34f3b1780b5fe9aab7340..head --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
|
git log a6747590b336329404d34f3b1780b5fe9aab7340..head --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
|
||||||
|
|
||||||
|
since 1.4.17V0
|
||||||
|
git log b2bd7f5e24db9a1e5c07c64e66583ec183bb5bd8..head --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
|
||||||
|
|
||||||
3. Copy added_cards.txt to trunk\Utils folder
|
3. Copy added_cards.txt to trunk\Utils folder
|
||||||
4. Run script:
|
4. Run script:
|
||||||
> perl extract_in_wiki_format.perl
|
> perl extract_in_wiki_format.perl
|
||||||
|
|
4
pom.xml
4
pom.xml
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<groupId>org.mage</groupId>
|
<groupId>org.mage</groupId>
|
||||||
<artifactId>mage-root</artifactId>
|
<artifactId>mage-root</artifactId>
|
||||||
<version>1.4.16</version>
|
<version>1.4.17</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>Mage Root</name>
|
<name>Mage Root</name>
|
||||||
<description>Mage Root POM</description>
|
<description>Mage Root POM</description>
|
||||||
|
@ -84,7 +84,7 @@
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<mage-version>1.4.16</mage-version>
|
<mage-version>1.4.17</mage-version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue