新将来袭和降妖夺宝埋点添加
parent
4e6d89c062
commit
5037916fd5
|
@ -7,6 +7,8 @@ import com.ljsd.jieling.exception.ErrorCode;
|
|||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.*;
|
||||
|
@ -24,6 +26,7 @@ import rpc.protocols.MessageTypeProto;
|
|||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/***
|
||||
* @author hj
|
||||
|
@ -99,9 +102,11 @@ public class NewGeneralAttackHandler extends BaseHandler<ActivityProto.NewGenera
|
|||
int[] checkResult = fightResult.getCheckResult();
|
||||
|
||||
double lessBlood = 0.0;
|
||||
int hurtResult = 0;
|
||||
// checkResult第一位输赢,1赢,其他输
|
||||
if (checkResult[0] == 1){
|
||||
lessBlood = bossBlood;
|
||||
hurtResult = checkResult[1];
|
||||
}else {
|
||||
// checkResult第三位开始为血量,下标0开始
|
||||
for (int i = 2; i < checkResult.length; i++) {
|
||||
|
@ -123,17 +128,22 @@ public class NewGeneralAttackHandler extends BaseHandler<ActivityProto.NewGenera
|
|||
|
||||
// 道具逻辑,封装好的
|
||||
CommonProto.Drop.Builder drop = CommonProto.Drop.newBuilder();
|
||||
// 战报返回
|
||||
List<String> dropResult = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < hurtList.length; i++) {
|
||||
// 当前类型奖励次数
|
||||
float v = b / hurtList[i][0];
|
||||
dropList[0] = hurtList[i][1];
|
||||
ItemUtil.drop(user, dropList,drop,v,0, BIReason.NEW_GENERAL_ATTACK);
|
||||
System.out.println();
|
||||
dropResult.add(dropList[0] + "#" + v);
|
||||
}
|
||||
// 消耗道具
|
||||
PlayerLogic.getInstance().checkAndUpdate(user, proto.getPrivilageTypeId(),1);
|
||||
|
||||
// 埋点
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.VANQUISH_BOSS.getType(), monsterGroupId,checkResult[0],hurtResult,dropResult);
|
||||
|
||||
return ActivityProto.NewGeneralAttackResponse.newBuilder().setFightData(fightData).setDrop(drop).build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,6 +94,8 @@ public enum ReportEventEnum {
|
|||
GET_TREASURE(65,"get_treasure",CommonEventHandler.getInstance(),new String[]{"treasure_id","get_entrance"}),
|
||||
ARENA_CHALLENGE(66,"arena_challenge",CommonEventHandler.getInstance(),new String[]{"battle_result","own_integral_num","rewards_num","own_new_integral_num","own_ranking","role_id","enemy_integral_num","new_enemy_integral_num","enemy_ranking","hero1","hero2","hero3","hero4","hero5","hero6","attack_pokemon","defend_hero1","defend_hero2","defend_hero3","defend_hero4","defend_hero5","defend_hero6","defend_pokemon"}),
|
||||
CEREMONY(67,"ceremony",CommonEventHandler.getInstance(),new String[]{"cost_item_id","integral_num","new_integral_num","own_ranking","guild_ranking"}),
|
||||
TREASURE_SUMMON(68,"treasure_summon",CommonEventHandler.getInstance(),new String[]{"beast_id","summon_type","cost_item_id","cost_amount","reward_nums_list"}),// 降妖夺宝
|
||||
VANQUISH_BOSS(69,"vanquish_boss",CommonEventHandler.getInstance(),new String[]{"boss_id","battle_result","damage_num","reward_nums_list"}),// 新将来袭
|
||||
VIP_LEVEL_UP(100,"", new VipLevelUpEventHandler(),new String[]{""});
|
||||
|
||||
|
||||
|
|
|
@ -416,6 +416,9 @@ public class HeroLogic{
|
|||
eventEnum = ReportEventEnum.BEAST_CABINET;
|
||||
activityId = sLotterySetting.getActivityId();
|
||||
break;
|
||||
case 11:
|
||||
eventEnum = ReportEventEnum.TREASURE_SUMMON;
|
||||
activityId = sLotterySetting.getActivityId();
|
||||
default:
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue