修复挂机奖励和地图探索optionId问题
parent
9e5c23315c
commit
0132a2ff2c
|
@ -69,6 +69,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
.build();
|
.build();
|
||||||
try {
|
try {
|
||||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_PLAYERINFO_RESPONSE_VALUE, getPlayerInfoResponse, true);
|
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_PLAYERINFO_RESPONSE_VALUE, getPlayerInfoResponse, true);
|
||||||
|
ActivityLogic.getInstance().flushForLogin(user);
|
||||||
LOGGER.info("back to client!");
|
LOGGER.info("back to client!");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -87,8 +87,9 @@ public class EventType {
|
||||||
public static final int twentyNine = 29;
|
public static final int twentyNine = 29;
|
||||||
public static final int thirty = 30;
|
public static final int thirty = 30;
|
||||||
|
|
||||||
public static final int updateEvent = 1;
|
public static final int updatePonintEvent = 1;
|
||||||
public static final int fightEvent = 2;
|
public static final int fightEvent = 2;
|
||||||
public static final int shopEvent = 3;
|
public static final int shopEvent = 3;
|
||||||
|
public static final int updateOptionalEvent = 4;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -457,7 +457,7 @@ public class MapLogic {
|
||||||
if (baseBehavior != null) {
|
if (baseBehavior != null) {
|
||||||
boolean isSuccess = baseBehavior.process(user, behaviorTypeValues, eventUpdateResponse);
|
boolean isSuccess = baseBehavior.process(user, behaviorTypeValues, eventUpdateResponse);
|
||||||
if (!isSuccess) {
|
if (!isSuccess) {
|
||||||
LOGGER.info("updateEvent() baseBehavior process fail! behaviorType=>{}", behaviorType);
|
LOGGER.info("updatePonintEvent() baseBehavior process fail! behaviorType=>{}", behaviorType);
|
||||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -524,8 +524,8 @@ public class MapLogic {
|
||||||
mapManager.addOrUpdateCell(cell.getCellId(), cell);
|
mapManager.addOrUpdateCell(cell.getCellId(), cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateMapMission(mapManager,EventType.updateEvent, optionId,0);
|
updateMapMission(mapManager,EventType.updateOptionalEvent, optionId,0);
|
||||||
int totalWeight = updateMapMission(mapManager,EventType.updateEvent, pointId,0);
|
int totalWeight = updateMapMission(mapManager,EventType.updatePonintEvent, pointId,0);
|
||||||
if (totalWeight >= 100) {
|
if (totalWeight >= 100) {
|
||||||
CrossInfo crossInfo = mapManager.getCrossInfoMap().get(mapManager.getCurMapId());
|
CrossInfo crossInfo = mapManager.getCrossInfoMap().get(mapManager.getCurMapId());
|
||||||
if (crossInfo == null) {
|
if (crossInfo == null) {
|
||||||
|
@ -558,7 +558,7 @@ public class MapLogic {
|
||||||
if (dropBuilder != null) {
|
if (dropBuilder != null) {
|
||||||
eventUpdateResponse.setDrop(dropBuilder);
|
eventUpdateResponse.setDrop(dropBuilder);
|
||||||
}
|
}
|
||||||
// LOGGER.info("updateEvent =====>success<====== xy=>{}, getPointId=>{} eventId={}, mission=>{}, nextEventId=>{}, eventBehaviorCommon=>{} {} sOptionConfig.getReward()=>{}", mapManager.getCurXY(), cell == null ? 0 : cell.getPointId(),
|
// LOGGER.info("updatePonintEvent =====>success<====== xy=>{}, getPointId=>{} eventId={}, mission=>{}, nextEventId=>{}, eventBehaviorCommon=>{} {} sOptionConfig.getReward()=>{}", mapManager.getCurXY(), cell == null ? 0 : cell.getPointId(),
|
||||||
// cell == null ? 0 : cell.getEventId(), eventUpdateResponse.getMissionList(), nextEventId, eventBehaviorCommon,eventUpdateResponse.getDrop(), sOptionConfig.getReward());
|
// cell == null ? 0 : cell.getEventId(), eventUpdateResponse.getMissionList(), nextEventId, eventBehaviorCommon,eventUpdateResponse.getDrop(), sOptionConfig.getReward());
|
||||||
// LOGGER.info("updatEvent() uid=>{},nextEventId={},eventId={},mission=>{}", uid, nextEventId, cell == null ? 0 : cell.getEventId(), eventUpdateResponse.getMission());
|
// LOGGER.info("updatEvent() uid=>{},nextEventId={},eventId={},mission=>{}", uid, nextEventId, cell == null ? 0 : cell.getEventId(), eventUpdateResponse.getMission());
|
||||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), eventUpdateResponse.build(), true);
|
MessageUtil.sendMessage(session, 1, messageType.getNumber(), eventUpdateResponse.build(), true);
|
||||||
|
@ -909,7 +909,7 @@ public class MapLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// LOGGER.info("endFight() uid=>{},nextEventId=>{}", uid, nextEventId);
|
// LOGGER.info("endFight() uid=>{},nextEventId=>{}", uid, nextEventId);
|
||||||
updateMapMission(mapManager,EventType.fightEvent,0, 1);
|
updateMapMission(mapManager,EventType.fightEvent,0, groupId);
|
||||||
// LOGGER.info("endFight() uid=>{} sMonsterGroup.getRewardgroup()=>{} misson=>{} eventDrop=>{}, missionDrop=>{}", uid, sMonsterGroup.getRewardgroup(), fastFightResponse.getMission(), fastFightResponse.getEnventDrop(), fastFightResponse.getMissionDrop());
|
// LOGGER.info("endFight() uid=>{} sMonsterGroup.getRewardgroup()=>{} misson=>{} eventDrop=>{}, missionDrop=>{}", uid, sMonsterGroup.getRewardgroup(), fastFightResponse.getMission(), fastFightResponse.getEnventDrop(), fastFightResponse.getMissionDrop());
|
||||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fastFightResponse.build(), true);
|
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fastFightResponse.build(), true);
|
||||||
}
|
}
|
||||||
|
@ -1170,7 +1170,7 @@ public class MapLogic {
|
||||||
int[][] values = sAccomplishmentConfig.getValues();
|
int[][] values = sAccomplishmentConfig.getValues();
|
||||||
int targetEventId = values[0][0];
|
int targetEventId = values[0][0];
|
||||||
int targetEventValue = values[1][0];
|
int targetEventValue = values[1][0];
|
||||||
if(logic == MapMissionType.FINISH_EVEVNT.getMissionTypeValue()){
|
if(eventType == EventType.updateOptionalEvent && logic == MapMissionType.FINISH_EVEVNT.getMissionTypeValue()){
|
||||||
for(int targetEventIdTmp : values[0]){
|
for(int targetEventIdTmp : values[0]){
|
||||||
if(targetEventIdTmp == eventId){
|
if(targetEventIdTmp == eventId){
|
||||||
if(missionValue<targetEventValue){
|
if(missionValue<targetEventValue){
|
||||||
|
@ -1183,20 +1183,8 @@ public class MapLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//updateEvent optionalConfig获取
|
//updatePonintEvent optionalConfig获取
|
||||||
if(eventType == EventType.updateEvent){
|
if(eventType == EventType.updatePonintEvent){
|
||||||
if(logic == eventId){
|
|
||||||
if(missionValue<targetEventValue){
|
|
||||||
int source = missionValue + bossIdOrItemId;
|
|
||||||
int result = MathUtils.setBetweenWithMax(source, 0, targetEventValue);
|
|
||||||
allMissionProgress.put(missionId,result);
|
|
||||||
needUpdate = true;
|
|
||||||
if(result== targetEventValue){
|
|
||||||
addScore+=score;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//处理采矿 、宝箱
|
//处理采矿 、宝箱
|
||||||
MapPointConfig mapPointConfig = MapPointConfig.getScMapEventMap().get(eventId);
|
MapPointConfig mapPointConfig = MapPointConfig.getScMapEventMap().get(eventId);
|
||||||
if(mapPointConfig!=null){
|
if(mapPointConfig!=null){
|
||||||
|
|
|
@ -26,6 +26,10 @@ public class ActivityLogic {
|
||||||
|
|
||||||
public void flushEveryDay(User user) {
|
public void flushEveryDay(User user) {
|
||||||
updateActivityMissionProgress(user, ActivityType.SevenLogin,1);
|
updateActivityMissionProgress(user, ActivityType.SevenLogin,1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void flushForLogin(User user){
|
||||||
checkActivityIsFinish(user);
|
checkActivityIsFinish(user);
|
||||||
checkActivityOfUser(user);
|
checkActivityOfUser(user);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,10 +49,12 @@ public class CombatLogic {
|
||||||
result.add(CBean2Proto.getAdventureStateInfo(item,item.getPosition()));
|
result.add(CBean2Proto.getAdventureStateInfo(item,item.getPosition()));
|
||||||
hasAdventure =true;
|
hasAdventure =true;
|
||||||
}
|
}
|
||||||
if(hasAdventure){
|
|
||||||
offLineTime = (int)((System.currentTimeMillis() -playerInfoManager.getOffLineTime())/1000);
|
|
||||||
}
|
|
||||||
FightInfoProto.GetAdventureStateInfoResponse.Builder responseBuilder = FightInfoProto.GetAdventureStateInfoResponse.newBuilder();
|
FightInfoProto.GetAdventureStateInfoResponse.Builder responseBuilder = FightInfoProto.GetAdventureStateInfoResponse.newBuilder();
|
||||||
|
if(hasAdventure){
|
||||||
|
responseBuilder.addAllAdventureStateInfoList(result);
|
||||||
|
offLineTime = (int)((System.currentTimeMillis() -playerInfoManager.getOffLineTime())/1000);
|
||||||
|
responseBuilder.setOutTime(offLineTime);
|
||||||
|
}
|
||||||
if(dropBuildMap.containsKey(1)){
|
if(dropBuildMap.containsKey(1)){
|
||||||
CommonProto.Drop.Builder builder = dropBuildMap.get(1);
|
CommonProto.Drop.Builder builder = dropBuildMap.get(1);
|
||||||
responseBuilder.setNotShowDrop(builder);
|
responseBuilder.setNotShowDrop(builder);
|
||||||
|
|
Loading…
Reference in New Issue