测试,gm需求

back_recharge
duhui 2021-10-28 18:10:20 +08:00
parent 39d1c1242f
commit 5410f0ecce
12 changed files with 155 additions and 9 deletions

View File

@ -29,7 +29,7 @@ public class GmService implements RPCRequestGMIFace.Iface {
private static final Logger LOGGER = LoggerFactory.getLogger(GmService.class);
@Override
public Result idipGm(String reserved, String cmd) throws InvalidOperException, TException {
public Result idipGm(String reserved, String cmd){
return exeCmd(cmd);
}
@ -42,11 +42,9 @@ public class GmService implements RPCRequestGMIFace.Iface {
String[] arg = cmd.split(" ");
GmInterface obj;
try {
obj = (GmInterface) Class.forName(
GmInterface.class.getPackage().getName() + ".Cmd_"
+ arg[0].toLowerCase()).newInstance();
} catch (Exception ex) {
result.setResultMsg("Cmd Illegal");
ex.printStackTrace();

View File

@ -193,7 +193,7 @@ public class ComplexJewelEquipRequestHandler extends BaseHandler<HeroInfoProto.C
//生成装备 混合消耗
Jewel equip = new Jewel(user.getId(),sTargetEquipStarsConfig.getId());
user.getEquipManager().addEquip(user,equip);
user.getEquipManager().addEquip(equip);
newids.add(equip.getId());//后面合成可能会被删除
needcount += sEquipStarsConfig.getRankupCount();

View File

@ -0,0 +1,25 @@
package com.ljsd.jieling.kefu;
import com.ljsd.jieling.logic.dao.root.User;
/**
* @Author hj
* @Date 2021/10/28 17:11:17
* @Description: sourspirit id ###
* @Version 1.0
*/
public class Cmd_fourspirit extends GmRoleAbstract {
@Override
public boolean exec(String[] args) throws Exception {
String[] split = args[0].split("#");
if (split.length < 4){
return false;
}
User user = getUser();
for (int i = 0; i < 4; i++) {
// 修改四灵层数
user.getPlayerInfoManager().updateFourChallengeByIndex(i,Integer.parseInt(split[i]));
}
return true;
}
}

View File

@ -0,0 +1,18 @@
package com.ljsd.jieling.kefu;
import com.ljsd.jieling.logic.dao.root.User;
/**
* @Author hj
* @Date 2021/10/28 17:31:38
* @Description: godtree id
* @Version 1.0
*/
public class Cmd_godtree extends GmRoleAbstract {
@Override
public boolean exec(String[] args) throws Exception {
User user = getUser();
user.getPlayerInfoManager().setTreeLevel(Integer.parseInt(args[0]));
return true;
}
}

View File

@ -0,0 +1,25 @@
package com.ljsd.jieling.kefu;
import com.ljsd.jieling.logic.dao.root.User;
/**
* @Author hj
* @Date 2021/10/28 17:19:07
* @Description: guildskilllevel id 1#2#3#4
* @Version 1.0
*/
public class Cmd_guildskilllevel extends GmRoleAbstract {
@Override
public boolean exec(String[] args) throws Exception {
String[] split = args[0].split("#");
if (split.length < 4){
return false;
}
User user = getUser();
for (int i = 0; i < 4; i++) {
// 修改公会技能
user.getGuildMyInfo().setGuildSkillByType(i+1,Integer.parseInt(split[0]));
}
return true;
}
}

View File

@ -0,0 +1,36 @@
package com.ljsd.jieling.kefu;
import com.ljsd.jieling.logic.dao.Jewel;
import com.ljsd.jieling.logic.dao.root.User;
import config.SJewelConfig;
import manager.STableManager;
/**
* @Author hj
* @Date 2021/10/28 17:00:35
* @Description: gm soul id id##
* @Version 1.0
*/
public class Cmd_soul extends GmRoleAbstract {
@Override
public boolean exec(String[] args) throws Exception {
User user = getUser();
String[] split = args[0].split("#");
if (split.length < 3){
return false;
}
SJewelConfig config = STableManager.getConfig(SJewelConfig.class).get(Integer.parseInt(split[0]));
if (config == null){
return false;
}
// 创建魂宝
Jewel jewel = new Jewel(user.getId(), Integer.parseInt(split[0]));
// 强化
jewel.setLevel(Integer.parseInt(split[1]));
// 精炼
jewel.setBuildLevel(Integer.parseInt(split[2]));
// 放入背包
user.getEquipManager().addEquip(jewel);
return true;
}
}

View File

@ -0,0 +1,18 @@
package com.ljsd.jieling.kefu;
import com.ljsd.jieling.logic.dao.root.User;
/**
* @Author hj
* @Date 2021/10/28 17:27:59
* @Description: xiuxing id id
* @Version 1.0
*/
public class Cmd_xiuxing extends GmRoleAbstract {
@Override
public boolean exec(String[] args) throws Exception {
User user = getUser();
user.getHeroManager().setPracticeLevel(Integer.parseInt(args[0]));
return true;
}
}

View File

@ -0,0 +1,26 @@
package com.ljsd.jieling.kefu;
import com.ljsd.jieling.logic.dao.root.User;
import java.util.Map;
/**
* @Author hj
* @Date 2021/10/28 17:35:00
* @Description: xuanyuan id #id
* @Version 1.0
*/
public class Cmd_xuanyuan extends GmRoleAbstract {
@Override
public boolean exec(String[] args) throws Exception {
String[] split = args[0].split("#");
if (split.length < 2){
return false;
}
User user = getUser();
Map<Integer, Integer> pass = user.getPlayerInfoManager().getSituationPass();
pass.put(Integer.parseInt(args[0]),Integer.parseInt(args[1]));
user.getPlayerInfoManager().updateSituationPass(pass);
return true;
}
}

View File

@ -29,7 +29,7 @@ public class EquipManager extends MongoBase {
this.setRootCollection(User._COLLECTION_NAME);
}
public void addEquip(User user,PropertyItem equip) throws Exception {
public void addEquip(PropertyItem equip){
equip.init(this.getRootId(),getMongoKey() + ".equipMap." + equip.getId());
updateString("equipMap." + equip.getId(), equip);
equipMap.put(equip.getId(),equip);

View File

@ -195,7 +195,7 @@ public class HeroLogic {
LOGGER.error("Excepeion 背包入库错误" + integer);
for (int i = 0; i < itemManager.getItemMap().get(integer).getItemNum(); i++) {
Jewel equip = new Jewel(user.getId(), integer);
equipManager.addEquip(user, equip);
equipManager.addEquip(equip);
}
itemManager.removeItem(integer);

View File

@ -30,7 +30,7 @@ public class InnerMessageUtil {
@Override
public void run() {
HandlerLogicThread handlerThread = ProtocolsManager.handlerThreads[getUid() % ProtocolsManager.HANDLER_THREAD_NUM];
User userInMem = UserManager.getUserInMem(getUid());
User userInMem = UserManager.getUserNotCache(getUid());
if(userInMem == null){
return;
}

View File

@ -1018,7 +1018,7 @@ public class ItemUtil {
return;
}
if(equip instanceof Equip){
equipManager.addEquip(user,equip);
equipManager.addEquip(equip);
}
KtEventUtils.onKtEvent(user, ParamEventBean.UserItemEvent,BIReason.TEMPORARY_REWARD,GlobalsDef.addReason,sItem.getId(),1,-1);
@ -1269,7 +1269,7 @@ public class ItemUtil {
String msgTem = "";
if(itemType==GlobalItemType.JEWEL){
Jewel equip = new Jewel(user.getId(),equipId);
equipManager.addEquip(user,equip);
equipManager.addEquip(equip);
jewelList.add(CBean2Proto.getEquipProto(equip));
msgTem="lamp_lottery_equip_content";
if (!jewels.containsKey(item.getQuantity())) {