暂存,功能没写完
parent
1c3102157d
commit
249580edf7
|
|
@ -48,4 +48,6 @@ public interface VipPrivilegeType {
|
|||
|
||||
int DRAGON_TREASURE_SUPPLY = 1007;//青龙宝藏每周补给
|
||||
|
||||
int NEW_GENERAL_ATTACK_NUM = 3005;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
package com.ljsd.jieling.handler.activity;
|
||||
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.VipInfo;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.protocols.ActivityProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import config.SPrivilegeTypeConfig;
|
||||
|
||||
public class NewGeneralAttackHandler extends BaseHandler<ActivityProto.NewGeneralAttackRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.NewGeneralAttackRequest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeneratedMessage processWithProto(int uid, ActivityProto.NewGeneralAttackRequest proto) throws Exception {
|
||||
|
||||
User user = UserManager.getUser(uid);
|
||||
if (user == null) {
|
||||
throw new ErrorCodeException(ErrorCode.UNKNOWN);
|
||||
}
|
||||
|
||||
VipInfo vipInfo = user.getPlayerInfoManager().getVipInfo().get(proto.getActivityId());
|
||||
SPrivilegeTypeConfig sPrivilegeTypeConfig = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(proto.getCountId());
|
||||
if (sPrivilegeTypeConfig == null || vipInfo == null){
|
||||
throw new ErrorCodeException(ErrorCode.UNKNOWN);
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -82,5 +82,6 @@ public interface ActivityType {
|
|||
int SKIN_RECHARGE_ACTIVITY = 71;
|
||||
int SPECIAL_MONSTER_RANDOM_ACTIVITY = 100;//灵兽限时抽卡
|
||||
int SPECIAL_MONSTER_GIFT_ACTIVITY = 101;//灵兽礼包
|
||||
|
||||
int NEW_GENERAL_RECRUITING = 102;//新将招募
|
||||
int NEW_GENERAL_ATTACK = 103;//新将来袭
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ public enum ActivityTypeEnum {
|
|||
SKIN_RECHARGE_ACTIVITY(ActivityType.SKIN_RECHARGE_ACTIVITY, DefaultEmptyActivity::new),
|
||||
SPECIAL_MONSTER_RANDOM_ACTIVITY(ActivityType.SPECIAL_MONSTER_RANDOM_ACTIVITY,LimitRandomSpecialMonsterActivity::new),
|
||||
SPECIAL_MONSTER_GIFT_ACTIVITY(ActivityType.SPECIAL_MONSTER_GIFT_ACTIVITY,DefaultEmptyActivity::new),
|
||||
NEW_GENERAL_RECRUITING(ActivityType.NEW_GENERAL_RECRUITING,LimitRandomCardActivity::new),
|
||||
NEW_GENERAL_ATTACK(ActivityType.NEW_GENERAL_ATTACK,DefaultEmptyActivity::new),
|
||||
;
|
||||
private int type;
|
||||
private Function<Integer, AbstractActivity> toActivityFunction;
|
||||
|
|
|
|||
Loading…
Reference in New Issue