增加道具异常登录检测
parent
1eba9fd9ba
commit
f45cb1507d
|
@ -188,6 +188,7 @@ public enum ErrorCode implements IErrorCode {
|
|||
GUILD_NOT_AUTHORITY(300,"账号因错误发言导致相关功能封禁中,操作失败"),
|
||||
RECHARGE_NUM_NOT(157,"充值金额不足"),
|
||||
BEFORE_CONDITION_NOT(158,"前置条件不足"),
|
||||
ACCOUNT_ERROR(-104,"帐号异常,被封号"),
|
||||
|
||||
;
|
||||
private static final Set<Integer> CodeSet = new HashSet<>();
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.explorerMap.ExplorerMapLogic;
|
||||
import com.ljsd.jieling.logic.home.event.HomeEvent;
|
||||
import com.ljsd.jieling.logic.item.ItemLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
|
@ -249,6 +250,8 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//道具异常检查
|
||||
ItemLogic.getInstance().checkItem(user);
|
||||
MessageUtil.sendIndicationMessage(iSession, 1, MessageTypeProto.MessageType.WorldLevelIndication_VALUE, PlayerInfoProto.WorldLevelIndication.newBuilder().setWorldLeve(GlobleSystemLogic.getGlobalWorldLevelCache()).build(), true);
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_PLAYERINFO_RESPONSE_VALUE, getPlayerInfoResponse, true);
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ import rpc.protocols.PlayerInfoProto;
|
|||
import util.StringUtil;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -1034,4 +1035,64 @@ public class ItemLogic {
|
|||
}*/
|
||||
// }
|
||||
|
||||
/**
|
||||
* 检查道具是否异常
|
||||
*/
|
||||
public void checkItem(User user) throws ErrorCodeException {
|
||||
//检查白金魂印是否异常
|
||||
Item item1 = user.getItemManager().getItem(81147);
|
||||
if(item1 != null){
|
||||
if(item1.getItemNum() >=10000){
|
||||
String format = MessageFormat.format("道具异常,uid:{0},itemId:{1},itemNum:{2}", user.getId(), item1.getItemId(),item1.getItemNum());
|
||||
LOGGER.error(format);
|
||||
throw new ErrorCodeException(ErrorCode.ACCOUNT_ERROR);
|
||||
}
|
||||
}
|
||||
//检查神装升星碎片是否异常
|
||||
Item item2 = user.getItemManager().getItem(81247);
|
||||
if(item2 != null){
|
||||
if(item2.getItemNum() >=100000){
|
||||
String format = MessageFormat.format("道具异常,uid:{0},itemId:{1},itemNum:{2}", user.getId(), item2.getItemId(),item2.getItemNum());
|
||||
LOGGER.error(format);
|
||||
throw new ErrorCodeException(ErrorCode.ACCOUNT_ERROR);
|
||||
}
|
||||
}
|
||||
//检查神1自选箱是否异常
|
||||
Item item3 = user.getItemManager().getItem(33003);
|
||||
if(item3 != null){
|
||||
if(item3.getItemNum() >=10000){
|
||||
String format = MessageFormat.format("道具异常,uid:{0},itemId:{1},itemNum:{2}", user.getId(), item3.getItemId(),item3.getItemNum());
|
||||
LOGGER.error(format);
|
||||
throw new ErrorCodeException(ErrorCode.ACCOUNT_ERROR);
|
||||
}
|
||||
}
|
||||
//检查神2自选箱是否异常
|
||||
Item item4 = user.getItemManager().getItem(33004);
|
||||
if(item4 != null){
|
||||
if(item4.getItemNum() >=10000){
|
||||
String format = MessageFormat.format("道具异常,uid:{0},itemId:{1},itemNum:{2}", user.getId(), item4.getItemId(),item4.getItemNum());
|
||||
LOGGER.error(format);
|
||||
throw new ErrorCodeException(ErrorCode.ACCOUNT_ERROR);
|
||||
}
|
||||
}
|
||||
//检查极品传说自选箱是否异常
|
||||
Item item5 = user.getItemManager().getItem(81182);
|
||||
if(item5 != null){
|
||||
if(item5.getItemNum() >=10000){
|
||||
String format = MessageFormat.format("道具异常,uid:{0},itemId:{1},itemNum:{2}", user.getId(), item5.getItemId(),item5.getItemNum());
|
||||
LOGGER.error(format);
|
||||
throw new ErrorCodeException(ErrorCode.ACCOUNT_ERROR);
|
||||
}
|
||||
}
|
||||
//检查红色魂印自选箱是否异常
|
||||
Item item6 = user.getItemManager().getItem(81129);
|
||||
if(item6 != null){
|
||||
if(item6.getItemNum() >=10000){
|
||||
String format = MessageFormat.format("道具异常,uid:{0},itemId:{1},itemNum:{2}", user.getId(), item6.getItemId(),item6.getItemNum());
|
||||
LOGGER.error(format);
|
||||
throw new ErrorCodeException(ErrorCode.ACCOUNT_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue