打点添加

back_recharge
lvxinran 2021-07-23 15:50:12 +08:00
parent a4942479a0
commit a54bbe491f
5 changed files with 46 additions and 9 deletions

View File

@ -87,19 +87,30 @@ public class LoginRequestHandler extends BaseHandler<PlayerInfoProto.LoginReques
int gid = 0;
String channle_id = "";
String bundle_id = "";
String pack_Id = "";
String channelS = loginRequest.getChannelS();
String[] splitChannelS = channelS.split("#");
if(splitChannelS.length==1){
// if(!StringUtil.isEmpty(splitChannelS[0])){
// pid = Integer.valueOf(splitChannelS[0]);
// }
}else if (splitChannelS.length>=2){
}else if (splitChannelS.length==2){
if(!StringUtil.isEmpty(splitChannelS[0])){
channle_id = splitChannelS[0];
}
if(!StringUtil.isEmpty(splitChannelS[1])){
bundle_id = splitChannelS[1];
}
}else if(splitChannelS.length==3){
if(!StringUtil.isEmpty(splitChannelS[0])){
channle_id = splitChannelS[0];
}
if(!StringUtil.isEmpty(splitChannelS[1])){
bundle_id = splitChannelS[1];
}
if(!StringUtil.isEmpty(splitChannelS[2])){
pack_Id = splitChannelS[1];
}
}
//临时代码 等前端出新包后删除2019 11 29
@ -126,9 +137,9 @@ public class LoginRequestHandler extends BaseHandler<PlayerInfoProto.LoginReques
if(split.length>=2){
String openId = split[0];
String chanel = split[1];
UserManager.userLogin(userId,openId,chanel,pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS(),channle_id,bundle_id,ccId);
UserManager.userLogin(userId,openId,chanel,pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS(),channle_id,bundle_id,ccId,pack_Id);
}
user = UserManager.userLogin(userId,openIdFront,"",pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS(),channle_id,bundle_id,ccId);
user = UserManager.userLogin(userId,openIdFront,"",pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS(),channle_id,bundle_id,ccId,pack_Id);
user.getPlayerInfoManager().setLastDeviceId(loginRequest.getDeviceIdS());
// String newToken = UserManager.getNewToken(userId);

View File

@ -85,6 +85,16 @@ public class ReportUserEvent {
return this;
}
public ReportUserEvent setPackId(String packId){
baseInfo.put("pack_id",packId);
return this;
}
public ReportUserEvent setChannelId(String channelId){
baseInfo.put("channel_id",channelId);
return this;
}
public Map<String, Object> getBaseInfo() {
return baseInfo;
}

View File

@ -104,7 +104,9 @@ public class ReportUtil {
.setCoins_amount(coin==null?0:coin.getItemNum())
.setDiamond_amount(diamond==null?0:(int)diamond.getItemNum())
.setFighting_capacity(user.getPlayerInfoManager().getMaxForce())
.setLevel(user.getPlayerInfoManager().getLevel());
.setLevel(user.getPlayerInfoManager().getLevel())
.setChannelId(user.getPlayerInfoManager().getChannel_id())
.setPackId(user.getPlayerInfoManager().getPack_id());
}
public static void doReport(ReportUserEvent reportUserEvent){

View File

@ -34,6 +34,8 @@ public class PlayerManager extends MongoBase {
private String bundle_id;
private String pack_id;
private String lastDeviceId;
private String nickName;
@ -1109,4 +1111,14 @@ public class PlayerManager extends MongoBase {
this.isHasRandomLotteryType = hasRandomLotteryType;
updateString("isHasRandomLotteryType",hasRandomLotteryType);
}
public String getPack_id() {
return pack_id;
}
public void setPack_id(String pack_id) {
this.pack_id = pack_id;
updateString("pack_id",pack_id);
}
}

View File

@ -75,13 +75,13 @@ public class UserManager {
}
public static User userLogin(int uid,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id,String ccId) throws Exception {
public static User userLogin(int uid,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id,String ccId,String pack_Id) throws Exception {
User user = null;
if (!UserManager.isUserExist(uid)){
user = MongoUtil.getInstence().getMyMongoTemplate().findById(User.getCollectionName(), uid, User.class);
if (user == null) {
user = registerUser(uid,openId,channel,pid,gid,platform,ip,channle_id,bundle_id,ccId);
user = registerUser(uid,openId,channel,pid,gid,platform,ip,channle_id,bundle_id,ccId,pack_Id);
}
UserManager.addUser(user);
}else{
@ -89,21 +89,22 @@ public class UserManager {
user.getPlayerInfoManager().setGid(gid);
user.getPlayerInfoManager().setPid(pid);
user.getPlayerInfoManager().setCc_id(ccId);
user.getPlayerInfoManager().setPack_id(pack_Id);
}
return user;
}
private static User registerUser(int uid,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id,String ccId) throws Exception {
private static User registerUser(int uid,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id,String ccId,String pack_Id) throws Exception {
User user = new User(uid);
UserManager.addUser(user);
initPlayer(user,openId,channel,pid,gid,platform,ip,channle_id,bundle_id,ccId);
initPlayer(user,openId,channel,pid,gid,platform,ip,channle_id,bundle_id,ccId,pack_Id);
MongoUtil.getInstence().getMyMongoTemplate().save(user.getId(),user);
PlayerLogic.getInstance().sendTestWelfareMail(user,1,1);
return user;
}
private static void initPlayer(User user,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id,String ccId) throws Exception {
private static void initPlayer(User user,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id,String ccId,String pack_Id) throws Exception {
SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting();
PlayerManager playerManager = user.getPlayerInfoManager();
long now = TimeUtils.now();
@ -124,6 +125,7 @@ public class UserManager {
playerManager.setPhoneBindInfo(new PhoneBindInfo(""));
playerManager.setChannel(channel);
playerManager.setCc_id(ccId);
playerManager.setPack_id(pack_Id);
playerManager.setPid(pid);
playerManager.setGid(gid);
playerManager.setPlatform(platform);