数据上报 提交
parent
0854536e34
commit
1c5f015c33
|
@ -11,6 +11,8 @@ import com.ljsd.jieling.db.redis.RedisKey;
|
|||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.FriendManager;
|
||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||
|
@ -150,6 +152,7 @@ public class ChatLogic {
|
|||
ChatProto.ChatInfo chatInfo = CBean2Proto.getChatInfoBuilder(user,tmp,nowTime,-1);
|
||||
ChatProto.SendChatInfoResponse response = ChatProto.SendChatInfoResponse.newBuilder().setChatInfo(chatInfo).build();
|
||||
MessageUtil.sendMessage(iSession,1,msgId,response,true);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.SEND_MESSAGE.getType(),String.valueOf(chatType),message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -193,6 +196,7 @@ public class ChatLogic {
|
|||
|
||||
break;
|
||||
}
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.SEND_MESSAGE.getType(),String.valueOf(chatType),message);
|
||||
MessageUtil.sendMessage(iSession, 1, msgId, null, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ljsd.jieling.ktbeans;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -11,4 +13,5 @@ public interface IReportEvent {
|
|||
|
||||
Map<String,Object> getEventProperties(ReportEventEnum eventEnum,Object... param);
|
||||
|
||||
Map<Integer,Map<String,Object>> getUserProperties(User user);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.ktbeans;
|
||||
|
||||
import com.ljsd.jieling.ktbeans.reportEvent.CommonEventHandler;
|
||||
import com.ljsd.jieling.ktbeans.reportEvent.LoginEventHandler;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -13,7 +14,7 @@ import java.util.Map;
|
|||
public enum ReportEventEnum {
|
||||
|
||||
CREATE_ACCOUNT(1,"create_account", new CommonEventHandler(),new String[]{""}),
|
||||
APP_LOGIN(2,"app_login", new CommonEventHandler(),new String[]{""}),
|
||||
APP_LOGIN(2,"app_login", new LoginEventHandler(),new String[]{""}),
|
||||
CREATE_ROLE(3,"create_role ", new CommonEventHandler(),new String[]{"role_name"}),
|
||||
GUILD(4,"guild", new CommonEventHandler(),new String[]{"step_id","step_name","rewards_list","guild_start_time"}),
|
||||
LEVEL_UP(5,"level_up", new CommonEventHandler(),new String[]{"promotion_level","improved_level"}),
|
||||
|
|
|
@ -9,9 +9,10 @@ import java.util.Map;
|
|||
* @discribe
|
||||
*/
|
||||
public class ReportUserEvent {
|
||||
protected Map<String, Object> baseInfo = new HashMap<>();
|
||||
protected Map<String, Object> eventInfo = new HashMap<>();
|
||||
protected String eventName = "";
|
||||
private Map<String, Object> baseInfo = new HashMap<>();
|
||||
private Map<String, Object> eventInfo = new HashMap<>();
|
||||
private String eventName = "";
|
||||
private Map<Integer,Map<String,Object>> userProperties;
|
||||
|
||||
public ReportUserEvent setAccount_id(String accountId){
|
||||
baseInfo.put("#account_id",accountId);
|
||||
|
@ -81,4 +82,16 @@ public class ReportUserEvent {
|
|||
public void setEventName(String eventName) {
|
||||
this.eventName = eventName;
|
||||
}
|
||||
|
||||
public void setBaseInfo(Map<String, Object> baseInfo) {
|
||||
this.baseInfo = baseInfo;
|
||||
}
|
||||
|
||||
public Map<Integer, Map<String, Object>> getUserProperties() {
|
||||
return userProperties;
|
||||
}
|
||||
|
||||
public void setUserProperties(Map<Integer, Map<String, Object>> userProperties) {
|
||||
this.userProperties = userProperties;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,13 +17,15 @@ import java.util.Map;
|
|||
* @discribe
|
||||
*/
|
||||
public class ReportUtil {
|
||||
private static final String LOG_PATH = "";
|
||||
private static final String LOG_PATH = "D:\\jl_logs";
|
||||
|
||||
private static ThinkingDataAnalytics ta = new ThinkingDataAnalytics(new ThinkingDataAnalytics.LoggerConsumer(LOG_PATH));
|
||||
|
||||
private static final int COIN_ID = 14;
|
||||
public static final int COIN_ID = 14;
|
||||
|
||||
private static final int DIAMOND_ID = 16;
|
||||
public static final int DIAMOND_ID = 16;
|
||||
|
||||
public static final int AMULET_ID = 3;
|
||||
|
||||
|
||||
//对外接口只有一个
|
||||
|
@ -34,6 +36,9 @@ public class ReportUtil {
|
|||
if(report==null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
//设置用户属性
|
||||
Map<Integer,Map<String, Object>> userProperties = report.getEventHandler().getUserProperties(user);
|
||||
reportUserEvent.setUserProperties(userProperties);
|
||||
//设置事件属性
|
||||
Map<String, Object> eventProperties = report.getEventHandler().getEventProperties(report,param);
|
||||
reportUserEvent.setEventInfo(eventProperties);
|
||||
|
@ -75,6 +80,13 @@ public class ReportUtil {
|
|||
//todo 访客id
|
||||
ta.setSuperProperties(reportUserEvent.getBaseInfo());
|
||||
ta.track("1000001","1000001",reportUserEvent.getEventName(),reportUserEvent.getEventInfo());
|
||||
// for(int type:reportUserEvent.getUserProperties().keySet()){
|
||||
// if(type==1){
|
||||
// ta.user_set("1000001","1000001",reportUserEvent.getUserProperties().get(type));
|
||||
// }else{
|
||||
// ta.user_setOnce("1000001","1000001",reportUserEvent.getUserProperties().get(type));
|
||||
// }
|
||||
// }
|
||||
ta.flush();
|
||||
} catch (Exception e) {
|
||||
//异常处理
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.ljsd.jieling.ktbeans.reportEvent;
|
|||
|
||||
import com.ljsd.jieling.ktbeans.IReportEvent;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -25,4 +26,9 @@ public class CommonEventHandler implements IReportEvent {
|
|||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Integer, Map<String, Object>> getUserProperties(User user) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
package com.ljsd.jieling.ktbeans.reportEvent;
|
||||
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.dao.Item;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/7/8
|
||||
* @discribe
|
||||
*/
|
||||
public class LoginEventHandler extends CommonEventHandler {
|
||||
@Override
|
||||
public Map<Integer,Map<String, Object>> getUserProperties(User user) {
|
||||
Map<Integer,Map<String, Object>> userProperties = new HashMap<>();
|
||||
Map<String, Object> setProperties = new HashMap<>();
|
||||
Map<Integer, Item> itemMap = user.getItemManager().getItemMap();
|
||||
setProperties.put("role_id",String.valueOf(user.getId()));
|
||||
setProperties.put("account",String.valueOf(user.getPlayerInfoManager().getOpenId()));
|
||||
setProperties.put("fighting_capacity",user.getPlayerInfoManager().getMaxForce());
|
||||
setProperties.put("friends_amount",user.getFriendManager().getFriends()==null?0:user.getFriendManager().getFriends().size());
|
||||
setProperties.put("coins_amount",itemMap.get(ReportUtil.COIN_ID)==null?0:itemMap.get(ReportUtil.COIN_ID).getItemNum());
|
||||
setProperties.put("amulet_amount",itemMap.get(ReportUtil.AMULET_ID)==null?0:itemMap.get(ReportUtil.AMULET_ID).getItemNum());
|
||||
setProperties.put("diamond_amount",itemMap.get(ReportUtil.DIAMOND_ID)==null?0:itemMap.get(ReportUtil.DIAMOND_ID).getItemNum());
|
||||
setProperties.put("items_list_now",itemMap.keySet());
|
||||
// setProperties.put("level",user.getPlayerInfoManager().getLevel());
|
||||
// setProperties.put("vip_level",user.getPlayerInfoManager().getVipLevel());
|
||||
userProperties.put(1,setProperties);
|
||||
return userProperties;
|
||||
}
|
||||
}
|
|
@ -9,7 +9,6 @@ import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
|||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.RandomCardEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.RandomMustCardEvent;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
|
@ -40,7 +39,6 @@ public class LimitRandomCardActivity extends AbstractActivity {
|
|||
public LimitRandomCardActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this,RandomCardEvent.class);
|
||||
Poster.getPoster().listenEvent(this, RandomMustCardEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,29 +56,36 @@ public class LimitRandomCardActivity extends AbstractActivity {
|
|||
if(UserManager.getUser(cardEvent.getUid()).getActivityManager().getActivityMissionMap().get(id)==null){
|
||||
return;
|
||||
}
|
||||
AbstractRank randomRank= RankContext.getRankEnum(RankEnum.RANDOM_CARD_RANK.getType());
|
||||
int scoreById = Double.valueOf(randomRank.getScoreById(((RandomCardEvent) event).getUid(),String.valueOf(id))).intValue();
|
||||
if(scoreById==-1){
|
||||
scoreById=0;
|
||||
}
|
||||
randomRank.addRank(cardEvent.getUid(),String.valueOf(id),scoreById+cardEvent.getScore());
|
||||
Predicate<int[]> pre = a-> (SCHero.getHeroByPieceId(a[0])!=null&&SCHero.getHeroByPieceId(a[0]).getNatural()>=13);
|
||||
|
||||
Consumer<int[]> consumer = a->RankContext.getRankEnum(RankEnum.RANDOM_CARD_PERFECT_RANK.getType()).addRank(cardEvent.getUid(),String.valueOf(id), TimeUtils.now()/1000,a[0],a[1]);
|
||||
Stream.of(cardEvent.getHeros()).filter(pre).forEach(consumer);
|
||||
update(UserManager.getUser(cardEvent.getUid()),cardEvent.getScore());
|
||||
}else if(event instanceof RandomMustCardEvent){
|
||||
RandomMustCardEvent cardEvent =(RandomMustCardEvent) event;
|
||||
Map<Integer, SLotterySetting> config = STableManager.getConfig(SLotterySetting.class);
|
||||
|
||||
SLotterySetting sLotterySetting = config.get(cardEvent.getType());
|
||||
int activityId = sLotterySetting.getActivityId();
|
||||
if(activityId!=id){
|
||||
return;
|
||||
}
|
||||
Map<Integer, ActivityMission> activityMissionMap = UserManager.getUser(cardEvent.getUid()).getActivityManager().getActivityMissionMap();
|
||||
ActivityMission activityMission = activityMissionMap.get(id);
|
||||
activityMission.setV(0);
|
||||
|
||||
// if(sLotterySetting.getActivityId()!=id){
|
||||
// return;
|
||||
// }
|
||||
|
||||
update(UserManager.getUser(cardEvent.getUid()),cardEvent.isMustAppear()?0:1);
|
||||
|
||||
|
||||
// AbstractRank randomRank= RankContext.getRankEnum(RankEnum.RANDOM_CARD_RANK.getType());
|
||||
// int scoreById = Double.valueOf(randomRank.getScoreById(((RandomCardEvent) event).getUid(),String.valueOf(id))).intValue();
|
||||
// if(scoreById==-1){
|
||||
// scoreById=0;
|
||||
// }
|
||||
// randomRank.addRank(cardEvent.getUid(),String.valueOf(id),scoreById+cardEvent.getScore());
|
||||
// Predicate<int[]> pre = a-> (SCHero.getHeroByPieceId(a[0])!=null&&SCHero.getHeroByPieceId(a[0]).getNatural()>=13);
|
||||
|
||||
// Consumer<int[]> consumer = a->RankContext.getRankEnum(RankEnum.RANDOM_CARD_PERFECT_RANK.getType()).addRank(cardEvent.getUid(),String.valueOf(id), TimeUtils.now()/1000,a[0],a[1]);
|
||||
// Stream.of(cardEvent.getHeros()).filter(pre).forEach(consumer);
|
||||
}
|
||||
// else if(event instanceof RandomMustCardEvent){
|
||||
// RandomMustCardEvent cardEvent =(RandomMustCardEvent) event;
|
||||
// int activityId = sLotterySetting.getActivityId();
|
||||
// if(activityId!=id){
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
@ -148,8 +153,12 @@ public class LimitRandomCardActivity extends AbstractActivity {
|
|||
|
||||
@Override
|
||||
void updateProgressWithUser(User user, ActivityMission activityMission, int count) {
|
||||
super.updateProgressWithUser(user, activityMission, count);
|
||||
activityMission.setV(activityMission.getV()+count);
|
||||
if(count==0){
|
||||
activityMission.setV(0);
|
||||
}else{
|
||||
activityMission.setV(activityMission.getV()+count);
|
||||
}
|
||||
super.updateProgressWithUser(user, activityMission, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -8,32 +8,21 @@ package com.ljsd.jieling.logic.activity.event;
|
|||
public class RandomCardEvent implements IEvent {
|
||||
private int uid;
|
||||
private int type;
|
||||
private int score;
|
||||
private int[][] heros;
|
||||
|
||||
public RandomCardEvent(int uid,int type, int score,int[][] heros) {
|
||||
private boolean mustAppear;
|
||||
public RandomCardEvent(int uid,int type,boolean mustAppear) {
|
||||
this.uid = uid;
|
||||
this.type = type;
|
||||
this.score = score;
|
||||
this.heros = heros;
|
||||
this.mustAppear = mustAppear;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getScore() {
|
||||
return score;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public void setScore(int score) {
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
@ -42,11 +31,11 @@ public class RandomCardEvent implements IEvent {
|
|||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int[][] getHeros() {
|
||||
return heros;
|
||||
public boolean isMustAppear() {
|
||||
return mustAppear;
|
||||
}
|
||||
|
||||
public void setHeros(int[][] heros) {
|
||||
this.heros = heros;
|
||||
public void setMustAppear(boolean mustAppear) {
|
||||
this.mustAppear = mustAppear;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/7/8
|
||||
* @discribe
|
||||
*/
|
||||
public class RandomMustCardEvent implements IEvent {
|
||||
private int type;
|
||||
|
||||
private int uid;
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public RandomMustCardEvent(int type, int uid) {
|
||||
this.type = type;
|
||||
this.uid = uid;
|
||||
}
|
||||
}
|
|
@ -13,6 +13,8 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.ActivityType;
|
||||
import com.ljsd.jieling.logic.activity.IEventHandler;
|
||||
|
@ -180,7 +182,7 @@ public class GuildLogic {
|
|||
if(StringUtil.isEmpty(announce)){
|
||||
announce= SGuildSetting.sGuildSetting.getDefaultDeclaration();
|
||||
}
|
||||
if(announce.length()<0||announce.length()>32){
|
||||
if(announce.length()==0||announce.length()>32){
|
||||
throw new ErrorCodeException(ErrorCode.ANNOUNCE_SIZE);
|
||||
}
|
||||
GuildInfo guildInfo = new GuildInfo(user.getId(),familyName,announce);
|
||||
|
@ -198,6 +200,7 @@ public class GuildLogic {
|
|||
.setFamilyWalkIndicaiton(CBean2Proto.getFamilyWalkIndicaiton(user))
|
||||
.build();
|
||||
Poster.getPoster().dispatchEvent(new GuildForceChangeEvent(user.getId(),user.getPlayerInfoManager().getGuildId(),1,user.getPlayerInfoManager().getMaxForce()));
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.CREATE_GUILD.getType(),String.valueOf(guildInfo.getId()),guildInfo.getName(),guildInfo.getLevel(),guildInfo.getTotalMembers());
|
||||
MessageUtil.sendMessage(session,1,msgId,build,true);
|
||||
}
|
||||
|
||||
|
@ -613,8 +616,8 @@ public class GuildLogic {
|
|||
Family.FamilyJoinIndicaion.Builder builder = Family.FamilyJoinIndicaion.newBuilder();
|
||||
Family.FamilyJoinIndicaion build = builder.setFamilyBaseInfo(CBean2Proto.getFamilyBaseInfo(guildInfo)).setFamilyUserInfo(CBean2Proto.getFamilyUserInfo(targetUser, GlobalsDef.MEMBER)).build();
|
||||
sendIndicationToMember(guildInfo, MessageTypeProto.MessageType.FAMILY_JOIN_INDICATION,build);
|
||||
|
||||
}
|
||||
ReportUtil.onReportEvent(targetUser, ReportEventEnum.JOIN_GUILD.getType(),String.valueOf(guildInfo.getId()),guildInfo.getName(),guildInfo.getLevel(),guildInfo.getTotalMembers());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ import com.ljsd.jieling.db.redis.RedisUtil;
|
|||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.FriendManager;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
|
@ -266,7 +268,9 @@ public class FriendLogic {
|
|||
user.getFriendManager().addMyApplyFriend(inviteUid);
|
||||
sendFriendInfoIndication(uid,inviteUid,1);
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.FRIEND_APPLY);
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.ASK_FOR_BEING_FRIENDS.getType(),String.valueOf(inviteUid));
|
||||
}
|
||||
|
||||
MessageUtil.sendMessage(iSession, 1, msgId, null, true);
|
||||
}
|
||||
|
||||
|
@ -412,6 +416,7 @@ public class FriendLogic {
|
|||
sendFriendInfoIndication(uid,applyfriendId,2);
|
||||
updateFriendUserInfo(friendUser);
|
||||
nums++;
|
||||
ReportUtil.onReportEvent(UserManager.getUser(uid),ReportEventEnum.ALLOW_FRIENDS_ASK.getType(),String.valueOf(applyfriendId),friendUser.getPlayerInfoManager().getNickName(),friendUser.getPlayerInfoManager().getLevel());
|
||||
}
|
||||
if(!alreadyFriendList.isEmpty()){
|
||||
for(Integer id:alreadyFriendList){
|
||||
|
|
|
@ -260,7 +260,6 @@ public class HeroLogic{
|
|||
}
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.RANDOM_HERO,sLotterySetting.getLotteryType(),perCount);
|
||||
heroManager.updateRandCount(type,perCount);
|
||||
Poster.getPoster().dispatchEvent(new RandomCardEvent(uid,sLotterySetting.getLotteryType(),sLotterySetting.getPerCount(),resultRandom));
|
||||
CommonProto.Drop.Builder drop = ItemUtil.dropPer(user, resultRandom,BIReason.HERO_RANDOM);
|
||||
builder.setDrop(drop);
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.HERO_RAND_RESPONSE_VALUE, builder.build(), true);
|
||||
|
@ -325,6 +324,7 @@ public class HeroLogic{
|
|||
}
|
||||
}
|
||||
SLotteryRewardConfig sLotteryRewardConfig;
|
||||
boolean isBestCard = false;
|
||||
//是否有必出
|
||||
if(mustSet.isEmpty()){
|
||||
sLotteryRewardConfig = randomHeroByPoolId(getPooId(sLotterySetting), 1, user.getPlayerInfoManager().getLevel());
|
||||
|
@ -332,6 +332,7 @@ public class HeroLogic{
|
|||
if(randomPoolByType.get(mergePool)!=null) {
|
||||
for (int key : randomPoolByType.get(mergePool).keySet()) {
|
||||
if (star == key) {
|
||||
isBestCard = true;
|
||||
randomPoolByType.get(mergePool).put(key, 0);
|
||||
} else {
|
||||
int curValue = randomPoolByType.get(mergePool).getOrDefault(key, 0);
|
||||
|
@ -347,6 +348,7 @@ public class HeroLogic{
|
|||
maxId = mustId>maxId?mustId:maxId;
|
||||
}
|
||||
System.out.println("触发必出"+maxId);
|
||||
isBestCard = true;
|
||||
SLotterySpecialConfig onConfig = null;
|
||||
for(SLotterySpecialConfig everyConfig:specialConfigs){
|
||||
if(everyConfig.getDifferentType()!=maxId){
|
||||
|
@ -362,6 +364,8 @@ public class HeroLogic{
|
|||
}
|
||||
heroManager.updateRandomPoolByType(mergePool,randomPoolByType.get(mergePool));
|
||||
int result = sLotteryRewardConfig.getId();
|
||||
Poster.getPoster().dispatchEvent(new RandomCardEvent(user.getId(),sLotterySetting.getLotteryType(),isBestCard));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@ import com.ljsd.jieling.exception.ErrorCode;
|
|||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.MailingSystem;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
@ -193,6 +195,7 @@ public class MailLogic {
|
|||
mail.setState(Global.MAIL_DRAW_ST_UNGET);
|
||||
}
|
||||
mailManager.addMail(mail);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.OPEN_MAIL.getType());
|
||||
MessageUtil.sendMessage(iSession, 1,msgId, null, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@ import com.ljsd.jieling.exception.ErrorCode;
|
|||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.map.MapManager;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
@ -51,6 +53,7 @@ public class RankLogic {
|
|||
rkey = String.valueOf(activityId);
|
||||
}
|
||||
PlayerInfoProto.RankResponse rankResponse= RankContext.getRankEnum(type).getRank(session.getUid(),rkey,1, -1);
|
||||
ReportUtil.onReportEvent(UserManager.getUser(session.getUid()), ReportEventEnum.CHECK_RANKING.getType(),String.valueOf(type));
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),rankResponse,true);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.ktbeans.KtEventUtils;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||
|
@ -74,7 +76,8 @@ public class BuyGoodsLogic {
|
|||
if(isDiscount!=0){
|
||||
price=(int)(sRechargeCommodityConfig.getPrice() * (10 + isDiscount)/10f);
|
||||
}
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserPayEvent,goodsId,System.currentTimeMillis()+"",result.getResultCode(),price*10);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.ORDER_COMPLETE.getType(),"",price,"","","","",sRechargeCommodityConfig.getBaseReward());
|
||||
// KtEventUtils.onKtEvent(user, ParamEventBean.UserPayEvent,goodsId,System.currentTimeMillis()+"",result.getResultCode(),price*10);
|
||||
}
|
||||
|
||||
public static Result sendGoods(int uid, int goodsId, String openId, String orderId, long orderTime, int amount) throws Exception {
|
||||
|
|
|
@ -560,10 +560,6 @@ public class ItemUtil {
|
|||
for (Map.Entry<Integer, Integer> entry : itemMap.entrySet()) {
|
||||
SItem sItem = SItem.getsItemMap().get (entry.getKey());
|
||||
int itemNumlimit = sItem.getItemNumlimit();
|
||||
if (sItem == null){
|
||||
|
||||
continue;
|
||||
}
|
||||
int itemNum = entry.getValue();
|
||||
if(itemNum <= 0){
|
||||
continue;
|
||||
|
@ -588,9 +584,6 @@ public class ItemUtil {
|
|||
itemNum = itemNumlimit -item.getItemNum();
|
||||
item.setItemNum(itemNumlimit);
|
||||
}
|
||||
// }else{
|
||||
// continue;
|
||||
// }
|
||||
}else{
|
||||
item.setItemNum(item.getItemNum() + entry.getValue());
|
||||
|
||||
|
@ -599,11 +592,14 @@ public class ItemUtil {
|
|||
if(itemNum>=0){
|
||||
itemProtoList.add(CBean2Proto.getItem(item,itemNum));
|
||||
}
|
||||
int eventType = ParamEventBean.UserItemEvent;
|
||||
if(currencyMap.contains(entry.getKey())){
|
||||
eventType = ParamEventBean.UserCurrencyEvent;
|
||||
}
|
||||
KtEventUtils.onKtEvent(user, eventType,reason,GlobalsDef.addReason,entry.getKey(),itemNum,item.getItemNum());
|
||||
// int eventType = ParamEventBean.UserItemEvent;
|
||||
// if(currencyMap.contains(entry.getKey())){
|
||||
// eventType = ParamEventBean.UserCurrencyEvent;
|
||||
// }
|
||||
// KtEventUtils.onKtEvent(user, eventType,reason,GlobalsDef.addReason,entry.getKey(),itemNum,item.getItemNum());
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.GET_ITEM.getType(),itemNum,String.valueOf(reason),item.getItemId());
|
||||
baseItemReport(user,item.getItemId(),itemNum,2,reason);
|
||||
|
||||
if(sItem.getItemType() == GlobalItemType.POKENMON_COMONPENT && sItem.getQuantity()>=SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_differ_content_parm)){
|
||||
SDifferDemonsConfig sDifferDemonsConfig = SDifferDemonsConfig.sDifferDemonsConfigMapByComId.get(sItem.getId());
|
||||
String nickName = user.getPlayerInfoManager().getNickName();
|
||||
|
@ -877,19 +873,24 @@ public class ItemUtil {
|
|||
if (null == myItem) {
|
||||
continue;
|
||||
}
|
||||
int eventType = ParamEventBean.UserItemEvent;
|
||||
if(currencyMap.contains(myItem.getItemId())){
|
||||
eventType = ParamEventBean.UserCurrencyEvent;
|
||||
}
|
||||
// int eventType = ParamEventBean.UserItemEvent;
|
||||
// if(currencyMap.contains(myItem.getItemId())){
|
||||
// eventType = ParamEventBean.UserCurrencyEvent;
|
||||
// }
|
||||
|
||||
if (myItem.getItemNum() <= needCount && !STableManager.getFigureConfig(CommonStaticConfig.class).getNotDelete().contains(userItem.getKey())) {
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.COST_ITEM.getType(),myItem.getItemNum(),String.valueOf(reason),String.valueOf(myItem.getItemId()));
|
||||
baseItemReport(user,myItem.getItemId(),myItem.getItemNum(),2,reason);
|
||||
myItem.setItemNum(0);
|
||||
itemManager.removeItem(userItem.getKey());
|
||||
KtEventUtils.onKtEvent(user, eventType,reason,GlobalsDef.subReason,myItem.getItemId(),needCount,0,subReason);
|
||||
// KtEventUtils.onKtEvent(user, eventType,reason,GlobalsDef.subReason,myItem.getItemId(),needCount,0,subReason);
|
||||
} else {
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.COST_ITEM.getType(),needCount,String.valueOf(reason),String.valueOf(myItem.getItemId()));
|
||||
baseItemReport(user,myItem.getItemId(),needCount,2,reason);
|
||||
myItem.setItemNum(myItem.getItemNum() - needCount);
|
||||
KtEventUtils.onKtEvent(user, eventType,reason,GlobalsDef.subReason,myItem.getItemId(),needCount,myItem.getItemNum(),subReason);
|
||||
// KtEventUtils.onKtEvent(user, eventType,reason,GlobalsDef.subReason,myItem.getItemId(),needCount,myItem.getItemNum(),subReason);
|
||||
}
|
||||
|
||||
sendToFront.add(CBean2Proto.getItem(myItem,-1));
|
||||
}
|
||||
if(!sendToFront.isEmpty()){
|
||||
|
@ -902,7 +903,46 @@ public class ItemUtil {
|
|||
Poster.getPoster().dispatchEvent(new UseItemEvent(user.getId(),useItemMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* type = 1获得 2 消耗
|
||||
* @param user
|
||||
* @param itemId
|
||||
* @param itemNum
|
||||
* @param type
|
||||
* @param reason
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void baseItemReport(User user,int itemId,int itemNum,int type,int reason) throws Exception {
|
||||
ReportEventEnum item;
|
||||
switch (itemId){
|
||||
case ReportUtil.COIN_ID:
|
||||
if(type==1){
|
||||
item =ReportEventEnum.GET_COINS;
|
||||
}else{
|
||||
item = ReportEventEnum.COST_COINS;
|
||||
}
|
||||
break;
|
||||
case ReportUtil.DIAMOND_ID:
|
||||
if(type==1){
|
||||
item =ReportEventEnum.GET_DIAMOND;
|
||||
}else{
|
||||
item = ReportEventEnum.COST_DIAMOND;
|
||||
}
|
||||
break;
|
||||
case ReportUtil.AMULET_ID:
|
||||
if(type==1){
|
||||
item =ReportEventEnum.GET_AMULET;
|
||||
}else{
|
||||
item = ReportEventEnum.COST_AMULET;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
ReportUtil.onReportEvent(user,item.getType(),itemNum,String.valueOf(reason));
|
||||
|
||||
}
|
||||
public static List<CommonProto.Item > getAllItem(User user,boolean isReconnect) throws Exception {
|
||||
List<CommonProto.Item > itemList = new ArrayList<>();
|
||||
ItemManager itemManager = user.getItemManager();
|
||||
|
|
Loading…
Reference in New Issue