From 12d46dfacd13f38b50c6306c60bc094bbb1cc59c Mon Sep 17 00:00:00 2001 From: grimm <1769111741@qq.com> Date: Mon, 15 Jan 2024 16:24:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9C=AA=E6=89=BE=E5=88=B0=E8=8B=B1?= =?UTF-8?q?=E9=9B=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jieling/exception/ErrorTableException.java | 6 +++--- .../com/ljsd/jieling/logic/player/PlayerLogic.java | 3 ++- .../src/main/java/config/SErrorCodeHint.java | 14 +++++++++++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/exception/ErrorTableException.java b/serverlogic/src/main/java/com/ljsd/jieling/exception/ErrorTableException.java index ee3a8d793..7f91e8558 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/exception/ErrorTableException.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/exception/ErrorTableException.java @@ -1,6 +1,6 @@ package com.ljsd.jieling.exception; -import config.SErrorCodeEerverConfig; +import config.SErrorCodeHint; import util.StringUtil; import java.util.ArrayList; @@ -28,10 +28,10 @@ public class ErrorTableException extends Exception { } public ErrorTableException(int id) { - String message = SErrorCodeEerverConfig.errorTableMap.get(id); + String message = SErrorCodeHint.errorMap.get(id); if (StringUtil.isEmpty(message)){ this.id = -1; - this.msg = "操作失败,并未找到错误码:{"+id+"},请联系管理员"; + this.msg = "发现异常,并未找到错误码:{"+id+"},请联系管理员"; }else { this.id = id; this.msg = message; diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java index 528a27412..0fada4a69 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.java @@ -12,6 +12,7 @@ import com.ljsd.jieling.db.redis.RedisKey; import com.ljsd.jieling.db.redis.RedisUtil; import com.ljsd.jieling.exception.ErrorCode; import com.ljsd.jieling.exception.ErrorCodeException; +import com.ljsd.jieling.exception.ErrorTableException; import com.ljsd.jieling.globals.BIReason; import com.ljsd.jieling.globals.Global; import com.ljsd.jieling.handler.GetPlayerInfoHandler; @@ -939,7 +940,7 @@ public class PlayerLogic { } Hero hero = userInMem.getHeroManager().getHero(heroId); if(hero == null){ - throw new ErrorCodeException(ErrorCode.newDefineCode("hero no")); + throw new ErrorTableException(159,"未找到英雄"); } PlayerInfoProto.ViewHeroInfoResponse.Builder builder = PlayerInfoProto.ViewHeroInfoResponse.newBuilder(); Map heroNotBufferAttribute = HeroLogic.getInstance().calHeroNotBufferAttribute(userInMem, hero, true, teamId); diff --git a/tablemanager/src/main/java/config/SErrorCodeHint.java b/tablemanager/src/main/java/config/SErrorCodeHint.java index 00401cc66..f481972ee 100644 --- a/tablemanager/src/main/java/config/SErrorCodeHint.java +++ b/tablemanager/src/main/java/config/SErrorCodeHint.java @@ -3,6 +3,7 @@ package config; import manager.STableManager; import manager.Table; +import java.util.HashMap; import java.util.Map; @Table(name ="ErrorCodeHint") @@ -11,11 +12,16 @@ public class SErrorCodeHint implements BaseConfig { private int id; private int showType; + private String desc; + public static Map errorMap = new HashMap<>(); @Override public void init() throws Exception { - + Map config = STableManager.getConfig(SErrorCodeHint.class); + for (SErrorCodeHint value : config.values()) { + errorMap.put(value.getId(),value.getDesc()); + } } @@ -27,5 +33,11 @@ public class SErrorCodeHint implements BaseConfig { return showType; } + public String getDesc() { + return desc; + } + public void setDesc(String desc) { + this.desc = desc; + } } \ No newline at end of file From 5fb5901b47be7a754cdb0f88a075656d3c7f3439 Mon Sep 17 00:00:00 2001 From: grimm <1769111741@qq.com> Date: Tue, 16 Jan 2024 14:37:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=BF=9E=E7=BB=AD=E8=B4=AD=E4=B9=B0?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ljsd/jieling/logic/activity/ContinuousGiftActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ContinuousGiftActivity.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ContinuousGiftActivity.java index e1e3446ec..234b897b6 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ContinuousGiftActivity.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ContinuousGiftActivity.java @@ -87,6 +87,7 @@ public class ContinuousGiftActivity extends AbstractActivity { Collection themeShops = SThemeActivityShop.themeMap.getOrDefault(id, new HashMap<>(0)).values(); for (SThemeActivityShop theme : themeShops) { + LOGGER.info("连续礼包活动日志,acid:{},uid:{},giftid:{},num:{}, themeid:{},themegiftid:{},themetype:{}",id,user.getId(),giftId,giftNum,theme.getId(),theme.getGoodId(),theme.getGoodType()); if (theme.getGoodId() == giftId && theme.getGoodType() == type){ // 记录礼包购买次数 ActivityProgressInfo current = missionMap.getOrDefault(theme.getId(),new ActivityProgressInfo()); @@ -94,8 +95,8 @@ public class ContinuousGiftActivity extends AbstractActivity { // 当前礼包状态处理 if (checkBuyGiftLimit(user,theme.getId(),current.getProgrss())){ current.setState(8); - missionMap.put(theme.getId(),current); } + missionMap.put(theme.getId(),current); break; } }