公会副本提交,大闹天宫埋点提交
parent
95375eab26
commit
c6a0354f81
|
|
@ -4,6 +4,8 @@ import com.google.protobuf.GeneratedMessage;
|
|||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
|
@ -18,6 +20,7 @@ import config.SExpeditionNodeConfig;
|
|||
import manager.STableManager;
|
||||
import util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
|
@ -115,7 +118,11 @@ public class HeroNodeRequestHandler extends BaseHandler<Expedition.HeroNodeReque
|
|||
builder.addAllNodeInfo(nodeInfos);
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(uid);
|
||||
MessageUtil.sendIndicationMessage(sessionByUid, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
|
||||
|
||||
List<CommonProto.Item> itemlistList = drop.getItemlistList();
|
||||
List<Integer> rewardIds = new ArrayList<>(itemlistList.size());
|
||||
List<Integer> rewardNums = new ArrayList<>(itemlistList.size());
|
||||
itemlistList.forEach(item->{rewardIds.add(item.getItemId());rewardIds.add(item.getItemNum());});
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.START_TIANGONG.getType(),nodeInfo.getType(),rewardIds,rewardNums);
|
||||
return Expedition.HeroNodeResponse.newBuilder().setDrop(drop).build();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ public class StartExpeditionBattleRequest extends BaseHandler<Expedition.StartEx
|
|||
.addMonsterList(deffightTeamInfo)
|
||||
.build());
|
||||
MessageUtil.sendMessage(iSession, 1,MessageTypeProto.MessageType.EXPEDITION_START_BATTLE_RESONSE_VALUE, fightStartResponse.build(), true);
|
||||
// ReportUtil.onReportEvent(user, ReportEventEnum);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.START_TIANGONG.getType(),nodeInfo.getType(),"","");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import com.google.protobuf.GeneratedMessage;
|
|||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.ExpeditionManager;
|
||||
import com.ljsd.jieling.logic.dao.ExpeditionNodeInfo;
|
||||
|
|
@ -63,6 +65,7 @@ public class StoreNodeRequestHandler extends BaseHandler<Expedition.StoreNodeReq
|
|||
builder.addAllNodeInfo(nodeInfos);
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(uid);
|
||||
MessageUtil.sendIndicationMessage(sessionByUid, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.START_TIANGONG.getType(),nodeInfo.getType());
|
||||
|
||||
return Expedition.StoreNodeResponse.newBuilder().build();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ public enum ReportEventEnum {
|
|||
SEND_HERO(51,"send_hero", new CommonEventHandler(),new String[]{"hero_id","hero_level","hero_quality","reward_list","reward_nums_list"}),
|
||||
TREASURE_DECOMPOSITION(52,"treasure_decomposition", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
START_TIANGONG(53,"start_tiangong",new CommonEventHandler(),new String[]{"stage_id","stage_type","rewards_id_list","rewards_num_list"}),
|
||||
VIP_LEVEL_UP(100,"", new VipLevelUpEventHandler(),new String[]{""});
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ public class GuildMyInfo extends MongoBase {
|
|||
private int joinTime;//加入公会时间
|
||||
//公会副本
|
||||
private int guildChallengeDamage;
|
||||
private int lastMonsterId;
|
||||
|
||||
|
||||
|
||||
|
|
@ -305,4 +306,13 @@ public class GuildMyInfo extends MongoBase {
|
|||
updateString("guildChallengeDamage",guildChallengeDamage);
|
||||
|
||||
}
|
||||
|
||||
public int getLastMonsterId() {
|
||||
return lastMonsterId;
|
||||
}
|
||||
|
||||
public void setLastMonsterId(int lastMonsterId) {
|
||||
this.lastMonsterId = lastMonsterId;
|
||||
updateString("lastMonsterId",lastMonsterId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.logic.family;
|
|||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.logic.dao.GuildMyInfo;
|
||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||
|
|
@ -11,6 +12,7 @@ import com.ljsd.jieling.logic.fight.FightDispatcher;
|
|||
import com.ljsd.jieling.logic.fight.GameFightType;
|
||||
import com.ljsd.jieling.logic.fight.PVEFightEvent;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||
|
|
@ -66,10 +68,24 @@ public class GuildChallengeLogic {
|
|||
SGuildCheckpointConfig config = STableManager.getConfig(SGuildCheckpointConfig.class).get(currBossId);
|
||||
|
||||
double bossHpRemain = guildInfo.getBossHpRemain();
|
||||
GuildMyInfo guildMyInfo = user.getGuildMyInfo();
|
||||
|
||||
|
||||
//如果boss不同 则不刷新次数
|
||||
if(currBossId!=0&&currBossId==guildMyInfo.getLastMonsterId()){
|
||||
int[] privilege = config.getPrivilege();
|
||||
for(int clearPrivilege:privilege){
|
||||
user.getPlayerInfoManager().clearVipCount(clearPrivilege);
|
||||
}
|
||||
}
|
||||
int canSweep = 0;
|
||||
if(guildMyInfo.getLastMonsterId()!=0&&currBossId==guildMyInfo.getLastMonsterId()&&guildMyInfo.getGuildChallengeDamage()>0){
|
||||
canSweep = 1;
|
||||
}
|
||||
Family.GetGuildChallengeInfoResponse response = Family.GetGuildChallengeInfoResponse.newBuilder()
|
||||
.setCanSweep(canSweep)
|
||||
.setCurBoss(currBossId)
|
||||
.setBlood(bossHpRemain==0?10000:(int)(bossHpRemain*10000/999999)).build();
|
||||
.setBlood(bossHpRemain==0?10000:(int)(bossHpRemain*10000/config.getMonsterHp())).build();
|
||||
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);
|
||||
|
||||
|
|
@ -98,18 +114,37 @@ public class GuildChallengeLogic {
|
|||
CommonProto.FightData fightData = null;
|
||||
int kill = 0;
|
||||
long damage = 0;
|
||||
GuildInfo guildInfo;
|
||||
SGuildCheckpointConfig config = STableManager.getConfig(SGuildCheckpointConfig.class).get(bossId);
|
||||
int[] privilege = config.getPrivilege();
|
||||
boolean check = PlayerLogic.getInstance().check(user, privilege[0], 1);
|
||||
// if(!check){
|
||||
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
// }
|
||||
//锁住
|
||||
synchronized (lockMap.get(guildId)){
|
||||
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||
guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||
GuildMyInfo guildMyInfo = user.getGuildMyInfo();
|
||||
//先清除特权
|
||||
if(guildInfo.getCurrBossId()!=0&&guildInfo.getCurrBossId()== guildMyInfo.getLastMonsterId()){
|
||||
for(int clearPrivilege:privilege){
|
||||
user.getPlayerInfoManager().clearVipCount(clearPrivilege);
|
||||
}
|
||||
}
|
||||
if(guildInfo.getCurrBossId()!=bossId){
|
||||
error = "已被击杀";
|
||||
}else{
|
||||
SGuildCheckpointConfig config = STableManager.getConfig(SGuildCheckpointConfig.class).get(bossId);
|
||||
|
||||
if(type==0){
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(uid, 1, 10, "", GameFightType.GuildChallenge, config.getMonsterId(), 3);
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(uid, 1501, 5, "", GameFightType.GuildChallenge, config.getMonsterId(), 3);
|
||||
if(guildInfo.getBossHpRemain()!=0){
|
||||
List<Integer> hp = new ArrayList<>();
|
||||
hp.add(guildInfo.getBossHpRemain());
|
||||
for(int i = 0 ; i <6;i++){
|
||||
if(i==1){
|
||||
hp.add(guildInfo.getBossHpRemain());
|
||||
}else{
|
||||
hp.add(0);
|
||||
}
|
||||
}
|
||||
pveFightEvent.setMonsterRemainHp(hp);
|
||||
}
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
|
|
@ -123,24 +158,38 @@ public class GuildChallengeLogic {
|
|||
guildInfo.setCurrBossId(guildInfo.getCurrBossId() + 1);
|
||||
guildInfo.setBossHpRemain(0);
|
||||
}else if(checkResult[0]==0){
|
||||
guildInfo.setBossHpRemain(guildInfo.getBossHpRemain()==0?999999-damageInt:guildInfo.getBossHpRemain()-damageInt);
|
||||
//怪物保持在第四位
|
||||
guildInfo.setBossHpRemain(checkResult[3]==0?10000:checkResult[3]);
|
||||
}else{
|
||||
error = "战斗异常!";
|
||||
}
|
||||
user.getGuildMyInfo().setGuildChallengeDamage(damageInt);
|
||||
guildMyInfo.setGuildChallengeDamage(damageInt);
|
||||
guildMyInfo.setLastMonsterId(bossId);
|
||||
//记录血量
|
||||
damage = damageInt;
|
||||
}else{
|
||||
//扫荡
|
||||
guildInfo.setBossHpRemain(guildInfo.getBossHpRemain()-user.getGuildMyInfo().getGuildChallengeDamage());
|
||||
damage = user.getGuildMyInfo().getGuildChallengeDamage();
|
||||
guildInfo.setBossHpRemain(guildInfo.getBossHpRemain()- guildMyInfo.getGuildChallengeDamage());
|
||||
damage = guildMyInfo.getGuildChallengeDamage();
|
||||
}
|
||||
drop = ItemUtil.drop(user, new int[]{config.getReward()}, 1, 0, 1);
|
||||
|
||||
}
|
||||
}
|
||||
if(kill==1){
|
||||
drop = ItemUtil.drop(user, new int[]{config.getReward(),config.getKillReward()}, 1, 0, 1);
|
||||
}
|
||||
double blood = guildInfo.getBossHpRemain();
|
||||
Family.GuildChallengeIndication.Builder indication = Family.GuildChallengeIndication.newBuilder()
|
||||
.setBlood(guildInfo.getBossHpRemain()==0?10000:(int)(blood*10000/config.getMonsterHp()))
|
||||
.setCurBoss(guildInfo.getCurrBossId());
|
||||
|
||||
GuildLogic.sendIndicationToMemberWithoutUser(guildInfo, MessageTypeProto.MessageType.GUILD_CHALLENGE_INDICATION,indication.build(),uid);
|
||||
indication.setIsKill(kill);
|
||||
MessageUtil.sendIndicationMessage(session,1,MessageTypeProto.MessageType.GUILD_CHALLENGE_INDICATION_VALUE,indication.build(),true);
|
||||
|
||||
//伤害排行
|
||||
|
||||
AbstractRank rank = RankContext.getRankEnum(RankEnum.GUILD_CHALLENGE_RANK.getType());
|
||||
long score = Double.valueOf(rank.getScoreById(user.getId(), guildId+":"+bossId)).longValue();
|
||||
rank.addRank(uid,guildId+":"+bossId,score==-1?damage:score+damage);
|
||||
|
|
@ -154,6 +203,8 @@ public class GuildChallengeLogic {
|
|||
response.setFightData(fightData);
|
||||
}
|
||||
response.setKill(kill);
|
||||
response.setDamage((int)damage);
|
||||
PlayerLogic.getInstance().checkAndUpdate(user,config.getPrivilege()[0],1);
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1070,6 +1070,21 @@ public class GuildLogic {
|
|||
}
|
||||
}
|
||||
}
|
||||
public static void sendIndicationToMemberWithoutUser(GuildInfo guildInfo, MessageTypeProto.MessageType messageType, GeneratedMessage generatedMessage,int withOutUId){
|
||||
Map<Integer, Set<Integer>> members = guildInfo.getMembers();
|
||||
for(Set<Integer> items : members.values()){
|
||||
for(Integer sendUid : items){
|
||||
if(sendUid==withOutUId){
|
||||
continue;
|
||||
}
|
||||
ISession isession = OnlineUserManager.getSessionByUid(sendUid);
|
||||
if(isession!=null){
|
||||
LOGGER.info("向{}发送indication",sendUid);
|
||||
MessageUtil.sendIndicationMessage(isession,1,messageType.getNumber(),generatedMessage,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公会图腾
|
||||
|
|
|
|||
|
|
@ -92,12 +92,13 @@ public class MonsterUtil {
|
|||
List<CommonProto.FightUnitInfo> monsterList = new ArrayList<>();
|
||||
List<Integer> hpInfo = hps.get(i);
|
||||
if(hpInfo!=null && !hpInfo.isEmpty()){
|
||||
int index=0;
|
||||
int position=1;
|
||||
for (int monsterId : monsterIds) {
|
||||
if(monsterId!=0){
|
||||
SMonsterConfig sMonsterConfig = STableManager.getConfig(SMonsterConfig.class).get(monsterId);
|
||||
monsterList.add( CBean2Proto.getMonster(sMonsterConfig, hpInfo.get(index++)).setPosition(position++).build());
|
||||
monsterList.add( CBean2Proto.getMonster(sMonsterConfig, hpInfo.get(position-1)).setPosition(position++).build());
|
||||
}else{
|
||||
position++;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -106,7 +107,10 @@ public class MonsterUtil {
|
|||
for (int monsterId : monsterIds) {
|
||||
if(monsterId!=0){
|
||||
monsterList.add(monsterMap.get(monsterId).setPosition(position++).build());
|
||||
}else{
|
||||
position++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
map.put(i,monsterList);
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ public class SGuildCheckpointConfig implements BaseConfig {
|
|||
|
||||
private int[][] rewardNumber;
|
||||
|
||||
private int monsterHp;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
|
@ -87,5 +89,7 @@ public class SGuildCheckpointConfig implements BaseConfig {
|
|||
return rewardNumber;
|
||||
}
|
||||
|
||||
|
||||
public int getMonsterHp() {
|
||||
return monsterHp;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue