parent
e7ea5f645e
commit
66d10040d3
|
@ -115,19 +115,8 @@ public class GmService implements RPCRequestGMIFace.Iface {
|
||||||
} else {
|
} else {
|
||||||
LOGGER.info("gm________________________start:"+cmd);
|
LOGGER.info("gm________________________start:"+cmd);
|
||||||
obj.exec(parameters);
|
obj.exec(parameters);
|
||||||
|
String exec2 = obj.exec2(parameters);
|
||||||
// 获取玩家战报系统
|
result.setResultMsg(exec2);
|
||||||
if (cmd.contains("fightrecord")) {
|
|
||||||
if (cmd.contains("delete")) {
|
|
||||||
FightRecordLogic.getInstance().delete();
|
|
||||||
} else if (cmd.contains("all")){
|
|
||||||
String allValue = FightRecordLogic.getInstance().getAll(Integer.parseInt(parameters[1]));
|
|
||||||
result.setResultMsg(allValue);
|
|
||||||
} else {
|
|
||||||
String oneRecord = FightRecordLogic.getInstance().getOneRecord(parameters[0]);
|
|
||||||
result.setResultMsg(oneRecord);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LOGGER.info("gm________________________end:"+cmd);
|
LOGGER.info("gm________________________end:"+cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class ExchangeCdkHandler extends BaseHandler<PlayerInfoProto.ExchangeCdkR
|
||||||
int uid = session.getUid();
|
int uid = session.getUid();
|
||||||
User user = UserManager.getUser(session.getUid());
|
User user = UserManager.getUser(session.getUid());
|
||||||
Map<Integer, SCdkInfo> sCdkInfosCacheMap = CoreLogic.getInstance().getsCdkInfosCacheMap();
|
Map<Integer, SCdkInfo> sCdkInfosCacheMap = CoreLogic.getInstance().getsCdkInfosCacheMap();
|
||||||
if (cdk.length() != 18 || sCdkInfosCacheMap == null || sCdkInfosCacheMap.isEmpty()) {
|
if (sCdkInfosCacheMap == null || sCdkInfosCacheMap.isEmpty()) {
|
||||||
|
|
||||||
throw new ErrorCodeException(ErrorCode.CDK_FAIL);
|
throw new ErrorCodeException(ErrorCode.CDK_FAIL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,37 @@
|
||||||
package com.ljsd.jieling.kefu;
|
package com.ljsd.jieling.kefu;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.logic.fight.FightRecordLogic;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public class Cmd_fightrecord extends GmAbstract {
|
public class Cmd_fightrecord extends GmAbstract {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean exec(String[] args) throws Exception {
|
public boolean exec(String[] args) throws Exception {
|
||||||
if (args.length < 2) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String exec2(String[] args){
|
||||||
|
if (args.length < 2){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
// 获取玩家战报系统
|
||||||
|
String content = Optional.ofNullable(args[0]).orElse("");
|
||||||
|
String parm = Optional.ofNullable(args[1]).orElse("");
|
||||||
|
String result = "";
|
||||||
|
if (content.equals("delete")){
|
||||||
|
FightRecordLogic.getInstance().delete();
|
||||||
|
}
|
||||||
|
else if (content.equals("all")){
|
||||||
|
result = FightRecordLogic.getInstance().getAll(Integer.parseInt(parm));
|
||||||
|
System.out.printf("战报信息,all:{%s}",result);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result = FightRecordLogic.getInstance().getOneRecord(content);
|
||||||
|
System.out.printf("战报信息,OneRecord:{%s}",result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.ljsd.jieling.kefu;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||||
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
|
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||||
|
import com.ljsd.jieling.logic.family.GuildLogic;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
public class Cmd_updateguild extends GmAbstract {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean exec(String[] args) throws Exception {
|
||||||
|
|
||||||
|
int guildId = Optional.of(Integer.parseInt(args[0])).orElse(0);
|
||||||
|
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||||
|
if (guildInfo == null) {
|
||||||
|
throw new ErrorCodeException("修改公会,公会不存在,公会id:"+guildId);
|
||||||
|
}
|
||||||
|
|
||||||
|
String parm = Optional.ofNullable(args[1]).orElse("");
|
||||||
|
|
||||||
|
String content;
|
||||||
|
switch (parm) {
|
||||||
|
case "name":
|
||||||
|
// 修改公会名字
|
||||||
|
content = Optional.ofNullable(args[2]).orElse("");
|
||||||
|
guildInfo.setName(content);
|
||||||
|
break;
|
||||||
|
case "announce":
|
||||||
|
// 修改公会宣言
|
||||||
|
content = Optional.ofNullable(args[2]).orElse("");
|
||||||
|
guildInfo.setAnnounce(content);
|
||||||
|
break;
|
||||||
|
case "dissolution":
|
||||||
|
guildInfo.setLevelTime(1);
|
||||||
|
GuilidManager.addGuildToRelease(guildInfo);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ErrorCodeException("修改公会,类型错误,公会id:"+guildId+",类型:"+parm);
|
||||||
|
}
|
||||||
|
GuildLogic.sendFamilyBaseUpdateIndication(guildInfo);
|
||||||
|
|
||||||
|
//非用户线程更新玩家数据
|
||||||
|
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,5 +4,10 @@ package com.ljsd.jieling.kefu;
|
||||||
public interface GmInterface
|
public interface GmInterface
|
||||||
{
|
{
|
||||||
boolean exec(String[] args) throws Exception;
|
boolean exec(String[] args) throws Exception;
|
||||||
String usage();
|
|
||||||
|
default String exec2(String[] args) throws Exception {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
String usage();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue