|
@@ -30,7 +30,45 @@ public class GameServerDTO implements Serializable {
|
|
|
public List<SuperGameServerBean> superGameServerList;
|
|
|
|
|
|
/**
|
|
|
- * 通过游戏id,区服id获取区服
|
|
|
+ * 通过游戏id获取原始区服
|
|
|
+ *
|
|
|
+ * @param gameId : 游戏id
|
|
|
+ * @return : 返回区服信息
|
|
|
+ */
|
|
|
+ public List<GameServerBean> getAllGameServerByGameId(Long gameId) {
|
|
|
+ if (CollectionUtils.isEmpty(this.superGameServerList)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ SuperGameServerBean superGameServer = this.superGameServerList.stream()
|
|
|
+ .filter(superGameServerBean -> superGameServerBean.getGameIdList().contains(gameId))
|
|
|
+ .findFirst().orElse(null);
|
|
|
+ if (superGameServer == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return superGameServer.getSourceGameServerList();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过超父游戏id获取原始区服
|
|
|
+ *
|
|
|
+ * @param superGameId : 超父游戏id
|
|
|
+ * @return : 返回区服信息
|
|
|
+ */
|
|
|
+ public List<GameServerBean> getAllGameServerBySupperGameId(Long superGameId) {
|
|
|
+ if (CollectionUtils.isEmpty(this.superGameServerList)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ SuperGameServerBean superGameServer = this.superGameServerList.stream()
|
|
|
+ .filter(superGameServerBean -> Objects.equals(superGameId, superGameServerBean.getSuperGameId()))
|
|
|
+ .findFirst().orElse(null);
|
|
|
+ if (superGameServer == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return superGameServer.getSourceGameServerList();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过游戏id,区服id获取原始区服
|
|
|
*
|
|
|
* @param gameId : 游戏id
|
|
|
* @param serverId : 区服id
|
|
@@ -52,7 +90,7 @@ public class GameServerDTO implements Serializable {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 通过游戏id,区服id获取区服
|
|
|
+ * 通过游戏id,区服id获取原始区服
|
|
|
*
|
|
|
* @param superGameId : 超父游戏id
|
|
|
* @param serverId : 区服id
|