修复随机道具数量为0
parent
dbb8413947
commit
39404df90d
|
@ -1,11 +1,14 @@
|
||||||
package com.ljsd.jieling.handler.map;
|
package com.ljsd.jieling.handler.map;
|
||||||
|
|
||||||
import com.ljsd.jieling.handler.BaseHandler;
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
import com.ljsd.jieling.protocols.FightInfoProto;
|
import com.ljsd.jieling.protocols.FightInfoProto;
|
||||||
import com.ljsd.jieling.protocols.MapInfoProto;
|
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
|
import com.ljsd.jieling.util.MessageUtil;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
|
@ -23,7 +26,15 @@ public class StartFightRequestHandler extends BaseHandler{
|
||||||
int type = fightStartRequest.getType();
|
int type = fightStartRequest.getType();
|
||||||
int fightId = fightStartRequest.getFightId();
|
int fightId = fightStartRequest.getFightId();
|
||||||
int teamId = fightStartRequest.getTeamId();
|
int teamId = fightStartRequest.getTeamId();
|
||||||
|
|
||||||
|
|
||||||
if (type ==1){
|
if (type ==1){
|
||||||
|
User user = UserManager.getUser(iSession.getUid());
|
||||||
|
int curMapId = user.getMapManager().getCurMapId();
|
||||||
|
if(curMapId>0){
|
||||||
|
MessageUtil.sendErrorResponse(iSession, 0, MessageTypeProto.MessageType.FIGHT_START_RESPONSE.getNumber(),"在地图探索中,不可以操作");
|
||||||
|
return;
|
||||||
|
}
|
||||||
MapLogic.getInstance().startLevelDifficultyFight(iSession,fightId,teamId,type,MessageTypeProto.MessageType.FIGHT_START_RESPONSE);
|
MapLogic.getInstance().startLevelDifficultyFight(iSession,fightId,teamId,type,MessageTypeProto.MessageType.FIGHT_START_RESPONSE);
|
||||||
}else{
|
}else{
|
||||||
MapLogic.getInstance().startFight(iSession, MessageTypeProto.MessageType.FIGHT_START_RESPONSE);
|
MapLogic.getInstance().startFight(iSession, MessageTypeProto.MessageType.FIGHT_START_RESPONSE);
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class CombatLogic {
|
||||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.GET_ADVENTURE_INFO_RESPONSE_VALUE,response,true);
|
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.GET_ADVENTURE_INFO_RESPONSE_VALUE,response,true);
|
||||||
List<CommonProto.Item> itemlistList = dropBuilder.getItemlistList();
|
List<CommonProto.Item> itemlistList = dropBuilder.getItemlistList();
|
||||||
for(CommonProto.Item item: itemlistList){
|
for(CommonProto.Item item: itemlistList){
|
||||||
LOGGER.info("the uid={},itemID={}",uid,item.getItemId());
|
LOGGER.info("the uid={},itemID={},itemNum={}",uid,item.getItemId(),item.getItemNum());
|
||||||
}
|
}
|
||||||
LOGGER.info("the uid={},offlineTimeLong={}",uid,offLineTime);
|
LOGGER.info("the uid={},offlineTimeLong={}",uid,offLineTime);
|
||||||
|
|
||||||
|
|
|
@ -251,6 +251,9 @@ public class ItemUtil {
|
||||||
if (sItem == null){
|
if (sItem == null){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if(entry.getValue() == 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Item item = itemManager.getItem(entry.getKey());
|
Item item = itemManager.getItem(entry.getKey());
|
||||||
if (item == null) {
|
if (item == null) {
|
||||||
item = itemManager.newItem(entry.getKey(), entry.getValue());
|
item = itemManager.newItem(entry.getKey(), entry.getValue());
|
||||||
|
|
Loading…
Reference in New Issue