data upload
parent
80bf7abc1a
commit
96bcf70018
|
|
@ -32,7 +32,7 @@ public class CoreService implements RPCRequestIFace.Iface {
|
|||
LOGGER.info("the uid={} not found",uid );
|
||||
}
|
||||
result.setResultMsg("server exce");
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserLogin,goodsId,orderId,result.getResultCode(),amount);
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserPayEvent,goodsId,orderId,result.getResultCode(),amount);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ public class LoginRequestHandler extends BaseHandler {
|
|||
}
|
||||
ParamDataBean paramDataBean = new ParamDataBean();
|
||||
paramDataBean.setChannel_s(loginRequest.getChannelS());
|
||||
paramDataBean.setServer_s(String.valueOf(GameApplication.serverId));
|
||||
KTDataUtil.addUserDataInfo(userId,paramDataBean);
|
||||
|
||||
// KTEnvironmentUtil.addUserEnviromentInfo(userId,paramEnvironmentBean);
|
||||
|
|
@ -74,7 +73,7 @@ public class LoginRequestHandler extends BaseHandler {
|
|||
|
||||
|
||||
//登陆注册入内存
|
||||
User user = UserManager.userLogin(userId);
|
||||
User user = UserManager.userLogin(userId,loginRequest.getOpenId());
|
||||
user.getPlayerInfoManager().setOpenId(loginRequest.getOpenId());
|
||||
|
||||
String newToken = UserManager.getNewToken(userId);
|
||||
|
|
@ -88,7 +87,8 @@ public class LoginRequestHandler extends BaseHandler {
|
|||
try {
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.LOGIN_RESPONSE_VALUE, loginResponse, true);
|
||||
MapLogic.getInstance().whenLogin(user);
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserLoginOutEvent,1);
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserLoginOutEvent,0);
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserLogin,0);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public class ParamBuilder {
|
|||
ktRoleActivity.setParam_user(KtEventUtils.userBuild(user));
|
||||
ktRoleActivity.setParam_role(KtEventUtils.roleBuild(user));
|
||||
ktRoleActivity.setParam_event(paramEventBean);
|
||||
ktRoleActivity.getParam_data().setCategory_s(LoginParamType.DATA_CATEGORY_APP);
|
||||
ktRoleActivity.getParam_data().setCategory_s(LoginParamType.DATA_CATEGORY_ROLE);
|
||||
return ktRoleActivity;
|
||||
|
||||
case ParamEventBean
|
||||
|
|
@ -29,6 +29,7 @@ public class ParamBuilder {
|
|||
ktRoleItem.setParam_user(KtEventUtils.userBuild(user));
|
||||
ktRoleItem.setParam_role(KtEventUtils.roleBuild(user));
|
||||
ktRoleItem.setParam_event(paramEventBean);
|
||||
ktRoleItem.getParam_data().setCategory_s(LoginParamType.DATA_CATEGORY_ROLE);
|
||||
return ktRoleItem;
|
||||
|
||||
case ParamEventBean
|
||||
|
|
@ -39,6 +40,7 @@ public class ParamBuilder {
|
|||
ktRoleCurrency.setParam_user(KtEventUtils.userBuild(user));
|
||||
ktRoleCurrency.setParam_role(KtEventUtils.roleBuild(user));
|
||||
ktRoleCurrency.setParam_event(paramEventBean);
|
||||
ktRoleCurrency.getParam_data().setCategory_s(LoginParamType.DATA_CATEGORY_ROLE);
|
||||
return ktRoleCurrency;
|
||||
|
||||
case ParamEventBean
|
||||
|
|
@ -49,6 +51,7 @@ public class ParamBuilder {
|
|||
ktRoleLogin.setParam_user(KtEventUtils.userBuild(user));
|
||||
ktRoleLogin.setParam_role(KtEventUtils.roleBuild(user));
|
||||
ktRoleLogin.setParam_event(paramEventBean);
|
||||
ktRoleLogin.getParam_data().setCategory_s(LoginParamType.DATA_CATEGORY_ROLE);
|
||||
return ktRoleLogin;
|
||||
|
||||
|
||||
|
|
@ -60,6 +63,7 @@ public class ParamBuilder {
|
|||
ktRoleMall.setParam_user(KtEventUtils.userBuild(user));
|
||||
ktRoleMall.setParam_role(KtEventUtils.roleBuild(user));
|
||||
ktRoleMall.setParam_event(paramEventBean);
|
||||
ktRoleMall.getParam_data().setCategory_s(LoginParamType.DATA_CATEGORY_ROLE);
|
||||
return ktRoleMall;
|
||||
|
||||
case ParamEventBean
|
||||
|
|
@ -70,6 +74,7 @@ public class ParamBuilder {
|
|||
ktRolePay.setParam_user(KtEventUtils.userBuild(user));
|
||||
ktRolePay.setParam_role(KtEventUtils.roleBuild(user));
|
||||
ktRolePay.setParam_event(paramEventBean);
|
||||
ktRolePay.getParam_data().setCategory_s(LoginParamType.DATA_CATEGORY_ROLE);
|
||||
return ktRolePay;
|
||||
|
||||
case ParamEventBean
|
||||
|
|
@ -80,6 +85,7 @@ public class ParamBuilder {
|
|||
ktRoleRegister.setParam_user(KtEventUtils.userBuild(user));
|
||||
ktRoleRegister.setParam_role(KtEventUtils.roleBuild(user));
|
||||
ktRoleRegister.setParam_event(paramEventBean);
|
||||
ktRoleRegister.getParam_data().setCategory_s(LoginParamType.DATA_CATEGORY_ROLE);
|
||||
return ktRoleRegister;
|
||||
|
||||
case ParamEventBean
|
||||
|
|
@ -90,6 +96,7 @@ public class ParamBuilder {
|
|||
ktRoleTask.setParam_user(KtEventUtils.userBuild(user));
|
||||
ktRoleTask.setParam_role(KtEventUtils.roleBuild(user));
|
||||
ktRoleTask.setParam_event(paramEventBean);
|
||||
ktRoleTask.getParam_data().setCategory_s(LoginParamType.DATA_CATEGORY_ROLE);
|
||||
return ktRoleTask;
|
||||
case ParamEventBean
|
||||
.UserLogin:
|
||||
|
|
@ -97,8 +104,8 @@ public class ParamBuilder {
|
|||
ktUserLogin.setParam_data(KtEventUtils.dataBuild(uid));
|
||||
ktUserLogin.setParam_environment(KtEventUtils.simpleEnviromentBuild(uid));
|
||||
ktUserLogin.setParam_user(KtEventUtils.userSimpleBuild(user));
|
||||
ktUserLogin.setParam_role(KtEventUtils.roleBuild(user));
|
||||
ktUserLogin.setParam_event(paramEventBean);
|
||||
ktUserLogin.getParam_data().setCategory_s(LoginParamType.DATA_CATEGORY_USER);
|
||||
return ktUserLogin;
|
||||
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -14,5 +14,6 @@ public class LoginParamType {
|
|||
public static final String DATA_CATEGORY_APP = "event_app";
|
||||
|
||||
public static final String DATA_CATEGORY_ROLE = "event_role";
|
||||
public static final String DATA_CATEGORY_USER = "event_user";
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public class KtEventUtils {
|
|||
|
||||
KTParam ktParam = ParamBuilder.paramBuild(user, eventType, paramEventBean);
|
||||
DataMessageUtils.addLogQueue(ktParam);
|
||||
// LOGGER.info("ktparm -- > {}",gson.toJson(ktParam));
|
||||
LOGGER.info("ktparm -- > {}",gson.toJson(ktParam));
|
||||
}
|
||||
public static ParamEnvironmentBean enviromentBuild(int uid){
|
||||
return KTEnvironmentUtil.getUserEnviromentInfoById(uid);
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class ParamDataBean {
|
|||
this.app_id_s= KTSDKConstans.appid;
|
||||
this.category_s=LoginParamType.DATA_CATEGORY_ROLE;
|
||||
this.platform_s= LoginParamType.PLATFORM_ANDRIOD;
|
||||
this.region_s="1";
|
||||
this.region_s=String.valueOf(GameApplication.serverId);
|
||||
this.server_s= String.valueOf(GameApplication.serverId);
|
||||
this.channel_s="pc";
|
||||
this.data_unix=(int)(System.currentTimeMillis()/1000L);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ public class KtUserLogin extends KTParam {
|
|||
private ParamDataBean param_data;
|
||||
private ParamEnvironmentBean param_environment;
|
||||
private ParamUserBean param_user;
|
||||
private ParamRoleBean param_role;
|
||||
private ParamEventBean param_event;
|
||||
|
||||
public ParamDataBean getParam_data() {
|
||||
|
|
@ -23,9 +22,6 @@ public class KtUserLogin extends KTParam {
|
|||
return param_user;
|
||||
}
|
||||
|
||||
public ParamRoleBean getParam_role() {
|
||||
return param_role;
|
||||
}
|
||||
|
||||
public ParamEventBean getParam_event() {
|
||||
return param_event;
|
||||
|
|
@ -43,9 +39,6 @@ public class KtUserLogin extends KTParam {
|
|||
this.param_user = param_user;
|
||||
}
|
||||
|
||||
public void setParam_role(ParamRoleBean param_role) {
|
||||
this.param_role = param_role;
|
||||
}
|
||||
|
||||
public void setParam_event(ParamEventBean param_event) {
|
||||
this.param_event = param_event;
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ public class PlayerManager extends MongoBase {
|
|||
}
|
||||
|
||||
public void setOpenId(String openId) {
|
||||
updateString("openId", openId);
|
||||
this.openId = openId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,12 +48,12 @@ public class UserManager {
|
|||
// //TODO
|
||||
// }
|
||||
|
||||
public static User userLogin(int uid) throws Exception {
|
||||
public static User userLogin(int uid,String openId) 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);
|
||||
user = registerUser(uid,openId);
|
||||
}
|
||||
UserManager.addUser(user);
|
||||
}else{
|
||||
|
|
@ -63,19 +63,20 @@ public class UserManager {
|
|||
}
|
||||
|
||||
|
||||
private static User registerUser(int uid) throws Exception {
|
||||
private static User registerUser(int uid,String openId) throws Exception {
|
||||
User user = new User(uid);
|
||||
initPlayer(user);
|
||||
initPlayer(user,openId);
|
||||
UserManager.addUser(user);
|
||||
MongoUtil.getInstence().getMyMongoTemplate().save(user);
|
||||
return user;
|
||||
}
|
||||
|
||||
private static void initPlayer(User user) throws Exception {
|
||||
private static void initPlayer(User user,String openId) throws Exception {
|
||||
SGameSetting gameSetting = SGameSetting.getGameSetting();
|
||||
PlayerManager playerManager = user.getPlayerInfoManager();
|
||||
long now = TimeUtils.now();
|
||||
playerManager.setNickName(Integer.toString(user.getId()));
|
||||
playerManager.setOpenId(openId);
|
||||
playerManager.setLevel(1);
|
||||
playerManager.setExp(0);
|
||||
playerManager.setFamilyId("12345");
|
||||
|
|
|
|||
|
|
@ -639,7 +639,6 @@ public class CombatLogic {
|
|||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
SGameSetting sGameSetting = SGameSetting.getGameSetting();
|
||||
int invasionBossPrivilege = sGameSetting.getInvasionBossPrivilege();
|
||||
if(fightTimes<=0 || StringUtil.isEmpty(bossId)){
|
||||
MessageUtil.sendErrorResponse(session,0, MessageTypeProto.MessageType.ADVENTURE_BOSS_CHALLENGE_RESPONSE_VALUE,"");
|
||||
return;
|
||||
|
|
@ -652,12 +651,6 @@ public class CombatLogic {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
boolean check = playerInfoManager.check(invasionBossPrivilege, fightTimes);
|
||||
if(!check){
|
||||
MessageUtil.sendErrorResponse(session,0, MessageTypeProto.MessageType.ADVENTURE_BOSS_CHALLENGE_RESPONSE_VALUE,"over limit");
|
||||
return;
|
||||
}
|
||||
boolean isSuccess = RedisUtil.getInstence().tryGetDistributedLock(RedisKey.ADVENTRUEN_BOSS_CHALLENGE_LOCK_KEY, bossId, Integer.toString(uid), 500);
|
||||
if(!isSuccess){
|
||||
MessageUtil.sendErrorResponse(session,0, MessageTypeProto.MessageType.ADVENTURE_BOSS_CHALLENGE_RESPONSE_VALUE,"激烈战斗中,请稍候重试");
|
||||
|
|
@ -671,7 +664,7 @@ public class CombatLogic {
|
|||
}
|
||||
int[][] costs = new int[1][];
|
||||
costs[0] =new int[]{SGameSetting.getGameSetting().getInvasionBossItem(),fightTimes};
|
||||
boolean enough = ItemUtil.itemCost(user, costs, BIReason.CHALLENGE_INVASIONBOSS_CONSUME, fightTimes);
|
||||
boolean enough = ItemUtil.fightItemCost(user,costs);
|
||||
if(!enough){
|
||||
MessageUtil.sendErrorResponse(session,0, MessageTypeProto.MessageType.ADVENTURE_BOSS_CHALLENGE_RESPONSE_VALUE,"道具不足");
|
||||
return;
|
||||
|
|
@ -733,7 +726,8 @@ public class CombatLogic {
|
|||
}
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.ADVENTRUEN_BOSS_INFO,"",bossId,adventureBoss);
|
||||
}
|
||||
playerInfoManager.updateVipPrivilage(invasionBossPrivilege,i);
|
||||
costs[0] =new int[]{SGameSetting.getGameSetting().getInvasionBossItem(),i};
|
||||
ItemUtil.itemCost(user, costs, BIReason.CHALLENGE_INVASIONBOSS_CONSUME, i);
|
||||
RedisUtil.getInstence().incrementZsetScore(RedisKey.ADVENTRUEN_BOSS_RANK,"",Integer.toString(uid),totalHurt);
|
||||
FightInfoProto.AdventurenBossChallengeResponse build = builder.setHurtNums(totalHurt)
|
||||
.setFightResult(fightResult)
|
||||
|
|
|
|||
|
|
@ -316,6 +316,7 @@ public class ProtocolsManager implements ProtocolsAbstract {
|
|||
return;
|
||||
}
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserLoginOutEvent,1);
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserLogin,1);
|
||||
int roomId = user.getRoomInfo().getRoomId();
|
||||
if(roomId!=-1){
|
||||
Room room = RoomManager.getRoomById(roomId);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.ljsd.jieling.core.GlobalsDef;
|
|||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.hotfix.HotfixUtil;
|
||||
import com.ljsd.jieling.ktbeans.BeanBuilder.KtBeanBuilderUtils;
|
||||
import com.ljsd.jieling.ktbeans.KTRequestBeans.LoginParamType;
|
||||
import com.ljsd.jieling.ktbeans.sendbeans.KTAppOnline;
|
||||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||
import com.ljsd.jieling.logic.GlobalDataManaager;
|
||||
|
|
@ -59,6 +60,7 @@ public class MinuteTask extends Thread {
|
|||
paramEventBean.add(String.valueOf(onlineNum));
|
||||
ktAppOnline.setParam_event(paramEventBean);
|
||||
ktAppOnline.setParam_data(KtBeanBuilderUtils.paramDataBuildForSystem());
|
||||
ktAppOnline.getParam_data().setCategory_s(LoginParamType.DATA_CATEGORY_APP);
|
||||
DataMessageUtils.addLogQueue(ktAppOnline);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue