back_recharge
parent
d17f20627c
commit
e2df7ba34f
|
|
@ -2,20 +2,16 @@ package com.ljsd.jieling.handler.GameGM;
|
|||
|
||||
import com.ljsd.jieling.globals.GlobalGm;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.Item;
|
||||
import com.ljsd.jieling.logic.dao.ItemManager;
|
||||
import com.ljsd.jieling.logic.dao.User;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.GMCommandProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
|
|
@ -30,7 +26,7 @@ public class GMRequestHandler extends BaseHandler{
|
|||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
byte[] message = netData.parseClientProtoNetData();
|
||||
GMCommandProto.GMCommand gmCommand = GMCommandProto.GMCommand.parseFrom(message);
|
||||
CommonProto.GMCommand gmCommand = CommonProto.GMCommand.parseFrom(message);
|
||||
String command = gmCommand.getCommand();
|
||||
if (!command.contains("#") || command.split("#").length < 3) {
|
||||
LOGGER.error("wrong command :" + command);
|
||||
|
|
@ -46,7 +42,6 @@ public class GMRequestHandler extends BaseHandler{
|
|||
giveItem(cUser,prarm1,prarm2);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void giveItem(User cUser,int itemId,int itemNum) throws Exception {
|
||||
|
|
|
|||
|
|
@ -200,7 +200,13 @@ public class ItemUtil {
|
|||
heroList.add(CBean2Proto.getHero(hero));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 消耗道具
|
||||
* @param user
|
||||
* @param costItems
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static boolean itemCost(User user,int[][] costItems) throws Exception {
|
||||
|
||||
Map<Integer, Integer> itemMap = new HashMap<>();
|
||||
|
|
|
|||
Loading…
Reference in New Issue