公会日志

back_recharge
jiahuiwen 2022-04-19 17:11:20 +08:00
parent bdf6666064
commit 318b1505eb
5 changed files with 23 additions and 10 deletions

View File

@ -1224,6 +1224,7 @@ public class RedisUtil {
return result;
}
} catch (Exception e) {
LOGGER.info("getAllSetToList key={} exception={}", key, e);
TimeUtils.sleep(FAILED_SLEEP);
}
}
@ -1419,7 +1420,7 @@ public class RedisUtil {
else if (
RedisKey.PLAYER_INFO_CACHE.equals(type) || RedisKey.FAMILY_INFO.equals(type) ||
RedisKey.PIDGIDTEMP.equals(type) || RedisKey.SERVER_WORLDLEVE_INFO.equals(type) ||
RedisKey.SERVER_SPLIT_INFO.equals(type) ||
RedisKey.SERVER_SPLIT_INFO.equals(type) || RedisKey.FAMILY_LOGS.equals(type) ||
RedisKey.SERVER_SPLIT_MAIL_INFO.equals(type) || RedisKey.CROSS_ARENA_ROBOT_INFO.equals(type) ||
RedisKey.CROSS_SERVICE_ARENA.equals(type) || RedisKey.WORLD_ARENA_RANK_MY_MATH.equals(type) ||
RedisKey.WORLD_ARENA_MY_PRON.equals(type) || RedisKey.WORLD_ARENA_RRECORD.equals(type) ||

View File

@ -9,6 +9,7 @@ import com.ljsd.jieling.logic.dao.GuilidManager;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.GuildInfo;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.player.PlayerLogic;
import rpc.protocols.CommonProto;
import rpc.protocols.Family;
import rpc.protocols.MessageTypeProto;
@ -50,7 +51,7 @@ public class GuildHelpGetAllRequestHandler extends BaseHandler<Family.GuildHelpG
Family.GuildHelpGetAllResponse.Builder builder1 = Family.GuildHelpGetAllResponse.newBuilder();
for (Integer sendUid : sendUids) {
User target = UserManager.getUser(sendUid);
User target = PlayerLogic.getInstance().getUserByRpc(sendUid);
Set<Map.Entry<Integer, Integer>> entries = target.getGuildMyInfo().getGuidHelpInfo().entrySet();
Family.GuildHelpInfoIndication.Builder builder = Family.GuildHelpInfoIndication.newBuilder();
Map<Integer, Integer> guidHelpHadTakeInfo = target.getGuildMyInfo().getGuidHelpHadTakeInfo();

View File

@ -117,9 +117,14 @@ public class GuilidManager {
}
public static List<GuildLog> getGuilidLog(int guildId) {
String key = RedisKey.FAMILY_LOGS + RedisKey.Delimiter_colon + guildId;
List<GuildLog> allSetToList = RedisUtil.getInstence().getAllSetToList(key, GuildLog.class);
return allSetToList;
List<String> allSetToList = RedisUtil.getInstence().lGet(RedisKey.FAMILY_LOGS, Integer.toString(guildId), 0, -1);
Gson gson = RedisUtil.getInstence().getGson();
List<GuildLog> logs = new ArrayList<>(allSetToList.size());
for (String s : allSetToList) {
GuildLog guildLog = gson.fromJson(s, GuildLog.class);
logs.add(guildLog);
}
return logs;
}
public static void init() throws Exception {

View File

@ -416,6 +416,12 @@ public class GuildLogic {
}
Family.GetFamilyLogResponse.Builder builder = Family.GetFamilyLogResponse.newBuilder();
List<GuildLog> guildLogs = GuilidManager.getGuilidLog(user.getPlayerInfoManager().getGuildId());
Collections.sort(guildLogs, new Comparator<GuildLog>(){
@Override
public int compare(GuildLog o1, GuildLog o2) {
return Integer.compare(o2.getLogTime(), o1.getLogTime());
}
});
if(guildLogs!=null){
for(GuildLog guildLog : guildLogs){
builder.addFamilyLogInfo(Family.FamilyLogInfo.newBuilder()
@ -1034,7 +1040,7 @@ public class GuildLogic {
}
MailLogic.getInstance().sendMail(uid,title,content,"",(int) (TimeUtils.now()/1000), Global.MAIL_EFFECTIVE_TIME);
Family.FamilyPositionUpdateIndication build = Family.FamilyPositionUpdateIndication.newBuilder().setPosition(position).setUid(uid).build();
User userInMem = UserManager.getUserInMem(uid);
User userInMem = PlayerLogic.getInstance().getUserByRpc(uid);
sendIndicationToMember(GuilidManager.getGuildInfo(userInMem.getPlayerInfoManager().getGuildId()), MessageTypeProto.MessageType.FAMILY_POSITION_UPDATE_INDICAITON,build);
}

View File

@ -566,7 +566,7 @@ public class PlayerLogic {
}
public CommonProto.TeamOneInfo.Builder getUserTeamOneInfo(int uid,int teamId) throws Exception {
User user = UserManager.getUser(uid);
User user = PlayerLogic.getInstance().getUserByRpc(uid);
CommonProto.TeamOneInfo.Builder oneInfo = CBean2Proto.getTeamOneInfo(user);
TeamPosManager teamPosManager = user.getTeamPosManager();
CommonProto.TeamOneTeamInfo.Builder teamInfo = CommonProto.TeamOneTeamInfo.newBuilder();
@ -630,6 +630,9 @@ public class PlayerLogic {
}
oneInfo.setTeam(teamInfo);
if(user.getFriendManager().getMyApplyFriends().contains(uid)){
oneInfo.setIsApplyed(1);
}
return oneInfo;
}
@ -693,9 +696,6 @@ public class PlayerLogic {
oneInfo = getRobotOneInfo(sArenaRobotConfig,info);
}else{
oneInfo = getUserTeamOneInfo(id, teamId);
if(UserManager.getUser(id).getFriendManager().getMyApplyFriends().contains(id)){
oneInfo.setIsApplyed(1);
}
}
PlayerInfoProto.GetPlayerOneTeamInfoResponse.Builder playerTeamInfo = PlayerInfoProto.GetPlayerOneTeamInfoResponse.newBuilder().setTeamInfo(oneInfo);
return playerTeamInfo.build();