ccid
parent
f640e1c690
commit
04f2fef345
|
@ -120,15 +120,15 @@ public class LoginRequestHandler extends BaseHandler<PlayerInfoProto.LoginReques
|
|||
LOGGER.info("LOGIN_REQUEST the uid={},the pid={},the gid={},",userId,pid,gid);
|
||||
//登陆注册入内存
|
||||
String openIdFront = loginRequest.getOpenId();
|
||||
String ccId = loginRequest.getCcId();
|
||||
String[] split = openIdFront.split("\\.");
|
||||
User user = null;
|
||||
if(split.length>=2){
|
||||
String openId = split[0];
|
||||
String chanel = split[1];
|
||||
user = UserManager.userLogin(userId,openId,chanel,pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS(),channle_id,bundle_id);
|
||||
}else{
|
||||
UserManager.userLogin(userId,openId,chanel,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);
|
||||
user = UserManager.userLogin(userId,openIdFront,"",pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS(),channle_id,bundle_id,ccId);
|
||||
|
||||
user.getPlayerInfoManager().setLastDeviceId(loginRequest.getDeviceIdS());
|
||||
// String newToken = UserManager.getNewToken(userId);
|
||||
|
|
|
@ -40,6 +40,8 @@ public class PlayerManager extends MongoBase {
|
|||
|
||||
private String nameColor;
|
||||
|
||||
private String cc_id;
|
||||
|
||||
private int sex;
|
||||
|
||||
private int level;
|
||||
|
@ -194,6 +196,15 @@ public class PlayerManager extends MongoBase {
|
|||
this.openId = openId;
|
||||
}
|
||||
|
||||
public String getCc_id() {
|
||||
return cc_id;
|
||||
}
|
||||
|
||||
public void setCc_id(String cc_id) {
|
||||
updateString("cc_id", cc_id);
|
||||
this.cc_id = cc_id;
|
||||
}
|
||||
|
||||
public String getNickName() {
|
||||
return nickName;
|
||||
}
|
||||
|
|
|
@ -75,34 +75,35 @@ 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) 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) 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);
|
||||
user = registerUser(uid,openId,channel,pid,gid,platform,ip,channle_id,bundle_id,ccId);
|
||||
}
|
||||
UserManager.addUser(user);
|
||||
}else{
|
||||
user = getUser(uid);
|
||||
user.getPlayerInfoManager().setGid(gid);
|
||||
user.getPlayerInfoManager().setPid(pid);
|
||||
user.getPlayerInfoManager().setCc_id(ccId);
|
||||
}
|
||||
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) 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) throws Exception {
|
||||
User user = new User(uid);
|
||||
UserManager.addUser(user);
|
||||
initPlayer(user,openId,channel,pid,gid,platform,ip,channle_id,bundle_id);
|
||||
initPlayer(user,openId,channel,pid,gid,platform,ip,channle_id,bundle_id,ccId);
|
||||
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) 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) throws Exception {
|
||||
SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting();
|
||||
PlayerManager playerManager = user.getPlayerInfoManager();
|
||||
long now = TimeUtils.now();
|
||||
|
@ -122,6 +123,7 @@ public class UserManager {
|
|||
playerManager.setNewRechargeInfo(new NewRechargeInfo());
|
||||
playerManager.setPhoneBindInfo(new PhoneBindInfo(""));
|
||||
playerManager.setChannel(channel);
|
||||
playerManager.setCc_id(ccId);
|
||||
playerManager.setPid(pid);
|
||||
playerManager.setGid(gid);
|
||||
playerManager.setPlatform(platform);
|
||||
|
|
Loading…
Reference in New Issue