测试,gm需求
parent
39d1c1242f
commit
5410f0ecce
|
@ -29,7 +29,7 @@ public class GmService implements RPCRequestGMIFace.Iface {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(GmService.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(GmService.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result idipGm(String reserved, String cmd) throws InvalidOperException, TException {
|
public Result idipGm(String reserved, String cmd){
|
||||||
return exeCmd(cmd);
|
return exeCmd(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,11 +42,9 @@ public class GmService implements RPCRequestGMIFace.Iface {
|
||||||
String[] arg = cmd.split(" ");
|
String[] arg = cmd.split(" ");
|
||||||
GmInterface obj;
|
GmInterface obj;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
obj = (GmInterface) Class.forName(
|
obj = (GmInterface) Class.forName(
|
||||||
GmInterface.class.getPackage().getName() + ".Cmd_"
|
GmInterface.class.getPackage().getName() + ".Cmd_"
|
||||||
+ arg[0].toLowerCase()).newInstance();
|
+ arg[0].toLowerCase()).newInstance();
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
result.setResultMsg("Cmd Illegal");
|
result.setResultMsg("Cmd Illegal");
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
|
|
|
@ -193,7 +193,7 @@ public class ComplexJewelEquipRequestHandler extends BaseHandler<HeroInfoProto.C
|
||||||
|
|
||||||
//生成装备 混合消耗
|
//生成装备 混合消耗
|
||||||
Jewel equip = new Jewel(user.getId(),sTargetEquipStarsConfig.getId());
|
Jewel equip = new Jewel(user.getId(),sTargetEquipStarsConfig.getId());
|
||||||
user.getEquipManager().addEquip(user,equip);
|
user.getEquipManager().addEquip(equip);
|
||||||
newids.add(equip.getId());//后面合成可能会被删除
|
newids.add(equip.getId());//后面合成可能会被删除
|
||||||
|
|
||||||
needcount += sEquipStarsConfig.getRankupCount();
|
needcount += sEquipStarsConfig.getRankupCount();
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -29,7 +29,7 @@ public class EquipManager extends MongoBase {
|
||||||
this.setRootCollection(User._COLLECTION_NAME);
|
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());
|
equip.init(this.getRootId(),getMongoKey() + ".equipMap." + equip.getId());
|
||||||
updateString("equipMap." + equip.getId(), equip);
|
updateString("equipMap." + equip.getId(), equip);
|
||||||
equipMap.put(equip.getId(),equip);
|
equipMap.put(equip.getId(),equip);
|
||||||
|
|
|
@ -195,7 +195,7 @@ public class HeroLogic {
|
||||||
LOGGER.error("Excepeion 背包入库错误" + integer);
|
LOGGER.error("Excepeion 背包入库错误" + integer);
|
||||||
for (int i = 0; i < itemManager.getItemMap().get(integer).getItemNum(); i++) {
|
for (int i = 0; i < itemManager.getItemMap().get(integer).getItemNum(); i++) {
|
||||||
Jewel equip = new Jewel(user.getId(), integer);
|
Jewel equip = new Jewel(user.getId(), integer);
|
||||||
equipManager.addEquip(user, equip);
|
equipManager.addEquip(equip);
|
||||||
}
|
}
|
||||||
itemManager.removeItem(integer);
|
itemManager.removeItem(integer);
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class InnerMessageUtil {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
HandlerLogicThread handlerThread = ProtocolsManager.handlerThreads[getUid() % ProtocolsManager.HANDLER_THREAD_NUM];
|
HandlerLogicThread handlerThread = ProtocolsManager.handlerThreads[getUid() % ProtocolsManager.HANDLER_THREAD_NUM];
|
||||||
User userInMem = UserManager.getUserInMem(getUid());
|
User userInMem = UserManager.getUserNotCache(getUid());
|
||||||
if(userInMem == null){
|
if(userInMem == null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1018,7 +1018,7 @@ public class ItemUtil {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(equip instanceof Equip){
|
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);
|
KtEventUtils.onKtEvent(user, ParamEventBean.UserItemEvent,BIReason.TEMPORARY_REWARD,GlobalsDef.addReason,sItem.getId(),1,-1);
|
||||||
|
|
||||||
|
@ -1269,7 +1269,7 @@ public class ItemUtil {
|
||||||
String msgTem = "";
|
String msgTem = "";
|
||||||
if(itemType==GlobalItemType.JEWEL){
|
if(itemType==GlobalItemType.JEWEL){
|
||||||
Jewel equip = new Jewel(user.getId(),equipId);
|
Jewel equip = new Jewel(user.getId(),equipId);
|
||||||
equipManager.addEquip(user,equip);
|
equipManager.addEquip(equip);
|
||||||
jewelList.add(CBean2Proto.getEquipProto(equip));
|
jewelList.add(CBean2Proto.getEquipProto(equip));
|
||||||
msgTem="lamp_lottery_equip_content";
|
msgTem="lamp_lottery_equip_content";
|
||||||
if (!jewels.containsKey(item.getQuantity())) {
|
if (!jewels.containsKey(item.getQuantity())) {
|
||||||
|
|
Loading…
Reference in New Issue