Merge branch 'master_test_gn' into dh_dev_activiyDraw

back_recharge
duhui 2021-05-28 10:10:39 +08:00
commit ce512050b3
7 changed files with 94 additions and 40 deletions

View File

@ -115,19 +115,8 @@ public class GmService implements RPCRequestGMIFace.Iface {
} else {
LOGGER.info("gm________________________start"+cmd);
obj.exec(parameters);
// 获取玩家战报系统
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);
}
}
String exec2 = obj.exec2(parameters);
result.setResultMsg(exec2);
LOGGER.info("gm________________________end"+cmd);
}

View File

@ -44,7 +44,7 @@ public class ExchangeCdkHandler extends BaseHandler<PlayerInfoProto.ExchangeCdkR
int uid = session.getUid();
User user = UserManager.getUser(session.getUid());
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);
}

View File

@ -1,12 +1,37 @@
package com.ljsd.jieling.kefu;
import com.ljsd.jieling.logic.fight.FightRecordLogic;
import java.util.Optional;
public class Cmd_fightrecord extends GmAbstract {
@Override
public boolean exec(String[] args) throws Exception {
if (args.length < 2) {
return false;
}
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;
}
}

View File

@ -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;
}
}

View File

@ -4,5 +4,10 @@ package com.ljsd.jieling.kefu;
public interface GmInterface
{
boolean exec(String[] args) throws Exception;
String usage();
default String exec2(String[] args) throws Exception {
return "";
}
String usage();
}

View File

@ -666,6 +666,7 @@ public class GuildLogic {
guildInfo.removeDefendInfo(targetUid);
}
targetUser.getPlayerInfoManager().setGuildId(0);
targetUser.getPlayerInfoManager().setWelfareRedPackets(new HashMap<Integer,Integer>());
targetUser.getGuildMyInfo().clearOfLevelGuild();
addGuildLog(guildInfo.getId(),GuildDef.Log.KICK,targetUser.getPlayerInfoManager().getNickName());
// Family.FamilyKickIndication build = Family.FamilyKickIndication.newBuilder().setType(1).build();
@ -940,6 +941,7 @@ public class GuildLogic {
RedisUtil.getInstence().putMapEntry(RedisKey.PLAYER_INFO_CACHE,"",String.valueOf(uid),cache);
guildInfo.removeMember(uidType,uid);
user.getPlayerInfoManager().setGuildId(0);
user.getPlayerInfoManager().setWelfareRedPackets(new HashMap<Integer,Integer>());
user.getGuildMyInfo().clearOfLevelGuild();
addGuildLog(guildInfo.getId(),GuildDef.Log.LEVEL,user.getPlayerInfoManager().getNickName());
MessageUtil.sendMessage(session,1,msgId,null,true);

View File

@ -828,28 +828,12 @@ public class CBean2Proto {
values.forEach(v->{
// 使用中的神印
if (v.getState() == 1){
CommonProto.PurpleSealShowInfo builder;
// 通用神印
if (v.getType() == 0){
builder = CommonProto.PurpleSealShowInfo.newBuilder()
.setId(v.getSealId())
.setType(v.getType())
.setHeroTId(0)
.build();
list.add(builder);
}
// 附身神印需要
else if (v.getType() == 1) {
if (heroIds.contains(v.getSubId()) && !"".equals(v.getSubId()) && v.getSubId() != null){
Hero hero = user.getHeroManager().getHero(v.getSubId());
builder = CommonProto.PurpleSealShowInfo.newBuilder()
.setId(v.getSealId())
.setType(v.getType())
.setHeroTId(hero.getTemplateId())
.build();
list.add(builder);
}
}
CommonProto.PurpleSealShowInfo builder = CommonProto.PurpleSealShowInfo.newBuilder()
.setId(v.getSealId())
.setType(v.getType())
.setHeroTId(0)
.build();
list.add(builder);
}
});
return list;