创角打点修改,等级提升打点修改
parent
25f6ba0796
commit
abadfaece8
|
@ -123,9 +123,9 @@ public class LoginRequestHandler extends BaseHandler<PlayerInfoProto.LoginReques
|
|||
if(split.length>=2){
|
||||
String openId = split[0];
|
||||
String chanel = split[1];
|
||||
user = UserManager.userLogin(userId,openId,chanel,pid,gid);
|
||||
user = UserManager.userLogin(userId,openId,chanel,pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS());
|
||||
}else{
|
||||
user = UserManager.userLogin(userId,openIdFront,"",pid,gid);
|
||||
user = UserManager.userLogin(userId,openIdFront,"",pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS());
|
||||
}
|
||||
|
||||
// String newToken = UserManager.getNewToken(userId);
|
||||
|
|
|
@ -14,9 +14,9 @@ public enum ReportEventEnum {
|
|||
|
||||
CREATE_ACCOUNT(1,"create_account", new CreateRoleEventHandler(),new String[]{""}),
|
||||
APP_LOGIN(2,"app_login", new LoginEventHandler(),new String[]{""}),
|
||||
CREATE_ROLE(3,"create_role ", new CreateRoleEventHandler(),new String[]{"role_name"}),
|
||||
CREATE_ROLE(3,"create_role", new CreateRoleEventHandler(),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 UserLevelUpEventHandler(),new String[]{"promotion_level","improved_level"}),
|
||||
LEVEL_UP(5,"level_up", new UserLevelUpEventHandler(),new String[]{"level","promotion_level","improved_level"}),
|
||||
MISSION_START(6,"mission_start", new CommonEventHandler(),new String[]{"mission_id","mission_name"}),
|
||||
MISSION_COMPLETE(7,"mission_complete", new CommonEventHandler(),new String[]{"mission_id","mission_name","reward_list","mission_start_time"}),
|
||||
JOIN_ACTIVITY(8,"join_activity", new CommonEventHandler(),new String[]{"activity_id","activity_name"}),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ljsd.jieling.ktbeans.reportEvent;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
||||
import java.util.Date;
|
||||
|
@ -20,6 +21,11 @@ public class CreateRoleEventHandler extends CommonEventHandler{
|
|||
|
||||
setProperties.put("role_name",user.getPlayerInfoManager().getNickName());
|
||||
setOnceProperties.put("role_create_time",new Date());
|
||||
setOnceProperties.put("server_id",String.valueOf(GameApplication.serverId));
|
||||
setOnceProperties.put("channel_id",user.getPlayerInfoManager().getChannel());
|
||||
setOnceProperties.put("platform_id",user.getPlayerInfoManager().getPlatform());
|
||||
setOnceProperties.put("reg_ip",user.getPlayerInfoManager().getIp());
|
||||
|
||||
userProperties.put(1,setProperties);
|
||||
userProperties.put(2,setOnceProperties);
|
||||
return userProperties;
|
||||
|
|
|
@ -108,6 +108,11 @@ public class PlayerManager extends MongoBase {
|
|||
private int luckWheelLimitTime;
|
||||
private int luckAdvanceWheelLimitTime;
|
||||
|
||||
private String platform;
|
||||
|
||||
private String ip;
|
||||
|
||||
|
||||
public PlayerManager(){
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
}
|
||||
|
@ -727,4 +732,23 @@ public class PlayerManager extends MongoBase {
|
|||
updateString("luckAdvanceWheelLimitTime",luckAdvanceWheelLimitTime);
|
||||
this.luckAdvanceWheelLimitTime = luckAdvanceWheelLimitTime;
|
||||
}
|
||||
|
||||
public String getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
public void setPlatform(String platform) {
|
||||
this.platform = platform;
|
||||
updateString("platform",platform);
|
||||
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
updateString("ip",ip);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,12 +41,12 @@ public class UserManager {
|
|||
return userMap.containsKey(uid);
|
||||
}
|
||||
|
||||
public static User userLogin(int uid,String openId,String channel,int pid,int gid) throws Exception {
|
||||
public static User userLogin(int uid,String openId,String channel,int pid,int gid,String platform,String ip) 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);
|
||||
user = registerUser(uid,openId,channel,pid,gid,platform,ip);
|
||||
}
|
||||
UserManager.addUser(user);
|
||||
}else{
|
||||
|
@ -58,17 +58,17 @@ public class UserManager {
|
|||
}
|
||||
|
||||
|
||||
private static User registerUser(int uid,String openId,String channel,int pid,int gid) throws Exception {
|
||||
private static User registerUser(int uid,String openId,String channel,int pid,int gid,String platform,String ip) throws Exception {
|
||||
User user = new User(uid);
|
||||
UserManager.addUser(user);
|
||||
initPlayer(user,openId,channel,pid,gid);
|
||||
initPlayer(user,openId,channel,pid,gid,platform,ip);
|
||||
MongoUtil.getInstence().getMyMongoTemplate().save(user);
|
||||
PlayerLogic.getInstance().sendTestWelfareMail(user,1,1);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.CREATE_ROLE.getType());
|
||||
return user;
|
||||
}
|
||||
|
||||
private static void initPlayer(User user,String openId,String channel,int pid,int gid) throws Exception {
|
||||
private static void initPlayer(User user,String openId,String channel,int pid,int gid,String platform,String ip) throws Exception {
|
||||
SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting();
|
||||
PlayerManager playerManager = user.getPlayerInfoManager();
|
||||
long now = TimeUtils.now();
|
||||
|
@ -89,6 +89,8 @@ public class UserManager {
|
|||
playerManager.setChannel(channel);
|
||||
playerManager.setPid(pid);
|
||||
playerManager.setGid(gid);
|
||||
playerManager.setPlatform(platform);
|
||||
playerManager.setIp(ip);
|
||||
playerManager.setHeadFrame(STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getDefaultPicture());
|
||||
SPlayerLevelConfig sPlayerLevelConfig = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(1);
|
||||
playerManager.setMaxStamina(sPlayerLevelConfig.getMaxEnergy());
|
||||
|
|
Loading…
Reference in New Issue