巅峰赛类型修改,坐骑升级修改
parent
fc7ed5bde3
commit
7cd52a347a
|
@ -39,6 +39,7 @@ public enum FunctionIdEnum {
|
|||
Blood(47),
|
||||
ToBeStronger(48),
|
||||
SoulEquip(52),
|
||||
TopBattle(57),
|
||||
WorkShopTech(101),
|
||||
WorkShopCreateEquip(102),
|
||||
WorkShopCreateProtectEquip(103),
|
||||
|
|
|
@ -24,8 +24,9 @@ public interface GlobalItemType {
|
|||
int SOUL_MARK =13;// 魂印
|
||||
int ESPECIAL_EQUIP = 14;//法宝
|
||||
int HEAD = 15;//法宝
|
||||
|
||||
|
||||
int DESIGNATION = 16;//称号
|
||||
int DECORATION = 17;//皮肤
|
||||
int RIDE = 18;//坐骑
|
||||
//物品使用类型
|
||||
int NO_USE = 0 ; //不使用
|
||||
int RANDOM_USE = 1; // 随机使用
|
||||
|
|
|
@ -20,6 +20,6 @@ public class ModifyDecorationHandler extends BaseHandler<PlayerInfoProto.ModifyD
|
|||
public void processWithProto(ISession iSession, PlayerInfoProto.ModifyDecorationRequest proto) throws Exception {
|
||||
int headFrameId = proto.getDecorationId();
|
||||
int type = proto.getType();
|
||||
PlayerLogic.getInstance().modifyHeadFrame(iSession,type,headFrameId,MessageTypeProto.MessageType.MODIFY_DECORATION_RESPONSE);
|
||||
PlayerLogic.getInstance().modifyDecoration(iSession,type,headFrameId,MessageTypeProto.MessageType.MODIFY_DECORATION_RESPONSE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,6 @@ public class RideLevelUpHandler extends BaseHandler {
|
|||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
PlayerLogic.getInstance().rideLevelUp(iSession, MessageTypeProto.MessageType.RIDE_LEVEL_UP_REQUEST);
|
||||
PlayerLogic.getInstance().rideLevelUp(iSession, MessageTypeProto.MessageType.RIDE_LEVEL_UP_RESPONSE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,10 +48,7 @@ import org.springframework.data.domain.Sort;
|
|||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
public class GlobalDataManaager {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(GlobalDataManaager.class);
|
||||
|
@ -166,7 +163,8 @@ public class GlobalDataManaager {
|
|||
public void openAction(List<Integer> ids) throws Exception {
|
||||
ServerConfig serverConfigTmp = MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class);
|
||||
for(Integer openId : ids){
|
||||
FunctionIdEnum type = FunctionIdEnum.getFunctionIdEnumById(openId);
|
||||
int sameType = STableManager.getConfig(SGlobalSystemConfig.class).get(openId).getIsIDdSame();
|
||||
FunctionIdEnum type = FunctionIdEnum.getFunctionIdEnumById(sameType);
|
||||
if(type == null){
|
||||
continue;
|
||||
}
|
||||
|
@ -187,6 +185,7 @@ public class GlobalDataManaager {
|
|||
for(Map.Entry<Integer, ISession> entry:onlineUserMap.entrySet()){
|
||||
MessageUtil.sendIndicationMessage(entry.getValue(),1, MessageTypeProto.MessageType.ENDLESS_MAP_CHANGE_INDICATION_VALUE,info,true);
|
||||
}
|
||||
case TopBattle:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -197,8 +196,8 @@ public class GlobalDataManaager {
|
|||
|
||||
public void closeAction(List<Integer> ids) throws Exception {
|
||||
for(Integer closeId : ids){
|
||||
FunctionIdEnum type = FunctionIdEnum.getFunctionIdEnumById(closeId);
|
||||
|
||||
int sameType = STableManager.getConfig(SGlobalSystemConfig.class).get(closeId).getIsIDdSame();
|
||||
FunctionIdEnum type = FunctionIdEnum.getFunctionIdEnumById(sameType);
|
||||
switch (type){
|
||||
case Arena:
|
||||
ArenaLogic.getInstance().sendReward(GlobalsDef.ARENA_SEASON_REWARD);
|
||||
|
@ -210,6 +209,8 @@ public class GlobalDataManaager {
|
|||
case Blood:
|
||||
BloodLogic.getInstance().bloodSeasonReward();
|
||||
break;
|
||||
case TopBattle:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -257,6 +258,7 @@ public class GlobalDataManaager {
|
|||
long now = TimeUtils.now();
|
||||
Map<Integer, SGlobalSystemConfig> sGlobalSystemConfigMap = STableManager.getConfig(SGlobalSystemConfig.class);
|
||||
PlayerInfoProto.GetFunctionOfTimeResponse.Builder builder = PlayerInfoProto.GetFunctionOfTimeResponse.newBuilder();
|
||||
Map<Integer,List<CommonProto.FunctionOfTime>> sameActivity = new HashMap<>();
|
||||
for(SGlobalSystemConfig sGlobalSystemConfig : sGlobalSystemConfigMap.values()){
|
||||
int id = sGlobalSystemConfig.getId();
|
||||
long systemOpenLong = sGlobalSystemConfig.getSystemOpenLong();
|
||||
|
@ -285,12 +287,28 @@ public class GlobalDataManaager {
|
|||
}
|
||||
}
|
||||
|
||||
builder.addFunctionOfTime(CommonProto.FunctionOfTime.newBuilder()
|
||||
CommonProto.FunctionOfTime timeInfo = CommonProto.FunctionOfTime.newBuilder()
|
||||
.setFunctionId(id)
|
||||
.setStartTime((int)(timeOpenOfThis/1000))
|
||||
.setEndTime((int)(timeCloseOfThis/1000))
|
||||
.setStartTime((int) (timeOpenOfThis / 1000))
|
||||
.setEndTime((int) (timeCloseOfThis / 1000))
|
||||
.setInterval(seasonInterval)
|
||||
.build());
|
||||
.build();
|
||||
int isIDdSame = sGlobalSystemConfig.getIsIDdSame();
|
||||
List<CommonProto.FunctionOfTime> timeList = sameActivity.get(isIDdSame);
|
||||
if(timeList==null){
|
||||
timeList = new ArrayList<>();
|
||||
}
|
||||
timeList.add(timeInfo);
|
||||
sameActivity.put(isIDdSame,timeList);
|
||||
}
|
||||
if(!sameActivity.isEmpty()){
|
||||
for(Map.Entry<Integer,List<CommonProto.FunctionOfTime>> entry:sameActivity.entrySet()){
|
||||
List<CommonProto.FunctionOfTime> value = entry.getValue();
|
||||
if(value.size()>1){
|
||||
Collections.sort(value, Comparator.comparing(CommonProto.FunctionOfTime::getStartTime));
|
||||
}
|
||||
builder.addFunctionOfTime(value.get(0));
|
||||
}
|
||||
}
|
||||
getFunctionOfTimeResponse=builder.build();
|
||||
}
|
||||
|
|
|
@ -354,11 +354,11 @@ public class PlayerLogic {
|
|||
|
||||
}
|
||||
|
||||
public void modifyHeadFrame(ISession session, int type,int decorationId,MessageTypeProto.MessageType messageType) throws Exception {
|
||||
public void modifyDecoration(ISession session, int type,int decorationId,MessageTypeProto.MessageType messageType) throws Exception {
|
||||
LOGGER.info("外观物品Id{}",decorationId);
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
ItemManager itemManager = user.getItemManager();
|
||||
if(type!=0){
|
||||
if(decorationId!=0){
|
||||
if(itemManager.getItem(decorationId)==null||itemManager.getItem(decorationId).getItemNum()<1){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("无此物品"));
|
||||
}
|
||||
|
@ -714,7 +714,7 @@ public class PlayerLogic {
|
|||
if(!result){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
user.getPlayerInfoManager().setRideLevel(rideLevel++);
|
||||
user.getPlayerInfoManager().setRideLevel(rideLevel+1);
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -472,6 +472,9 @@ public class ItemUtil {
|
|||
case GlobalItemType.SecretBox:
|
||||
case GlobalItemType.CHANGE_NAME_CARD:
|
||||
case GlobalItemType.HEAD:
|
||||
case GlobalItemType.DESIGNATION:
|
||||
case GlobalItemType.DECORATION:
|
||||
case GlobalItemType.RIDE:
|
||||
itemType = GlobalItemType.ITEM;
|
||||
break;
|
||||
case GlobalItemType.RANDOM_ITME:
|
||||
|
|
|
@ -34,7 +34,7 @@ public class SGlobalSystemConfig implements BaseConfig {
|
|||
|
||||
private int[][] openGifts;
|
||||
|
||||
|
||||
private int isIDdSame;
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
|
@ -114,4 +114,8 @@ public class SGlobalSystemConfig implements BaseConfig {
|
|||
public int[][] getOpenGifts() {
|
||||
return openGifts;
|
||||
}
|
||||
|
||||
public int getIsIDdSame() {
|
||||
return isIDdSame;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue