diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/json/ServerProperties.java b/serverlogic/src/main/java/com/ljsd/jieling/config/json/ServerProperties.java index 7d8c37e42..3d1286ae8 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/config/json/ServerProperties.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/json/ServerProperties.java @@ -24,6 +24,8 @@ public class ServerProperties { private boolean guildFight; + private int areaId; + public int getId() { return id; } @@ -88,6 +90,14 @@ public class ServerProperties { this.guildFight = guildFight; } + public int getAreaId() { + return areaId; + } + + public void setAreaId(int areaId) { + this.areaId = areaId; + } + @Override public String toString() { return "ServerProperties{" + @@ -99,6 +109,7 @@ public class ServerProperties { ", num=" + num + ", sendlog37=" + sendlog37 + ", guildFight =" + guildFight + + ", areaId="+areaId+ '}'; } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/db/redis/RedisKey.java b/serverlogic/src/main/java/com/ljsd/jieling/db/redis/RedisKey.java index 5d435fe5b..2d8e4f25d 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/db/redis/RedisKey.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/db/redis/RedisKey.java @@ -189,7 +189,6 @@ public class RedisKey { public static final String SYSMSG = "SYSMSG"; public final static String CDKEY = "CDKEY"; - public static Set familyKey = new HashSet<>(); static { familyKey.add(FAMILY_FIGHT); @@ -207,10 +206,12 @@ public class RedisKey { familyKey.add(FAMILY_FIGHT_FINISH_MATCHING); } public static String getKey(String type, String key, boolean withoutServerId) { - if(RedisKey.TOKEN.equals(type)||RedisKey.USER_SERVER_INFO.equals(type)||familyKey.contains(type)){ + if(RedisKey.TOKEN.equals(type)||RedisKey.USER_SERVER_INFO.equals(type)){ return type + RedisKey.Delimiter_colon + key; } - + if(familyKey.contains(type)){ + return type + RedisKey.Delimiter_colon + GameApplication.serverProperties.getAreaId(); + } if (withoutServerId) { return GameApplication.areaId + Delimiter_colon + type + Delimiter_colon + String.valueOf(key); } else { diff --git a/serverlogic/src/main/java/com/ljsd/jieling/db/redis/RedisUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/db/redis/RedisUtil.java index d32290027..52c18f455 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/db/redis/RedisUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/db/redis/RedisUtil.java @@ -1018,9 +1018,12 @@ public class RedisUtil { public String getKey(String type,String key){ - if(RedisKey.BLOODY_RANK.equals(type) || RedisKey.BLOODY_TEAM.equals(type) || RedisKey.PLAYER_INFO_CACHE.equals(type) || RedisKey.BLOODY_PERSON_BATTLE_INFO.equals(type)||RedisKey.familyKey.contains(type)) { + if(RedisKey.BLOODY_RANK.equals(type) || RedisKey.BLOODY_TEAM.equals(type) || RedisKey.PLAYER_INFO_CACHE.equals(type) || RedisKey.BLOODY_PERSON_BATTLE_INFO.equals(type)) { return type + RedisKey.Delimiter_colon + key; } + if(RedisKey.familyKey.contains(type)){ + return type + RedisKey.Delimiter_colon + GameApplication.serverProperties.getAreaId(); + } if(RedisKey.TOKEN.equals(type)||RedisKey.USER_SERVER_INFO.equals(type)|| RedisKey.CDKEY.equals(type)){ return type + RedisKey.Delimiter_colon + key;