Merge branch 'refs/heads/master_xiyou' into master_zzxx
# Conflicts: # serverlogic/src/main/java/com/ljsd/jieling/handler/LoginRequestHandler.javamaster_zzxx
commit
7393d60955
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"version":"6",
|
"version":"7",
|
||||||
"tables":"GameSetting"
|
"tables":"GameSetting|PackPush"
|
||||||
}
|
}
|
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
"version":"7",
|
"version":"9",
|
||||||
"classes": [
|
"classes": [
|
||||||
{"name":"BuyGoodsNewLogic.class","fullName":"com.ljsd.jieling.logic.store.BuyGoodsNewLogic"},
|
{"name":"BuyGoodsNewLogic.class","fullName":"com.ljsd.jieling.logic.store.BuyGoodsNewLogic"},
|
||||||
{"name":"RetrySendIndicationThread.class","fullName":"com.ljsd.jieling.thread.task.RetrySendIndicationThread"}
|
{"name":"RetrySendIndicationThread.class","fullName":"com.ljsd.jieling.thread.task.RetrySendIndicationThread"},
|
||||||
|
{"name":"EquipLogic.class","fullName":"com.ljsd.jieling.logic.equip.EquipLogic"}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -3,11 +3,12 @@ package com.ljsd.jieling.handler;
|
||||||
import com.ljsd.jieling.db.redis.RedisKey;
|
import com.ljsd.jieling.db.redis.RedisKey;
|
||||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||||
import com.ljsd.jieling.handler.map.MapLogic;
|
import com.ljsd.jieling.handler.map.MapLogic;
|
||||||
import com.ljsd.jieling.ktbeans.KTDataUtil;
|
|
||||||
import com.ljsd.jieling.ktbeans.KTRequestBeans.LoginParamType;
|
import com.ljsd.jieling.ktbeans.KTRequestBeans.LoginParamType;
|
||||||
|
import com.ljsd.jieling.ktbeans.KtEventUtils;
|
||||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||||
import com.ljsd.jieling.ktbeans.parmsBean.ParamDataBean;
|
import com.ljsd.jieling.ktbeans.parmsBean.ParamDataBean;
|
||||||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEnvironmentSimpleBean;
|
import com.ljsd.jieling.ktbeans.parmsBean.ParamEnvironmentSimpleBean;
|
||||||
|
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.UserRecentLoginInfo;
|
import com.ljsd.jieling.logic.dao.UserRecentLoginInfo;
|
||||||
|
@ -37,7 +38,7 @@ public class LoginRequestHandler extends BaseHandler<PlayerInfoProto.LoginReques
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processWithProto(ISession iSession, PlayerInfoProto.LoginRequest loginRequest) throws Exception {
|
public void processWithProto(ISession iSession, PlayerInfoProto.LoginRequest loginRequest) throws Exception {
|
||||||
long now = TimeUtils.now();
|
|
||||||
int userId = iSession.getUid();
|
int userId = iSession.getUid();
|
||||||
if(!Blocker.checkFlow(iSession)){
|
if(!Blocker.checkFlow(iSession)){
|
||||||
return;
|
return;
|
||||||
|
@ -45,9 +46,6 @@ public class LoginRequestHandler extends BaseHandler<PlayerInfoProto.LoginReques
|
||||||
InetSocketAddress remoteAddress = iSession.getChannel().getRemoteAddress();
|
InetSocketAddress remoteAddress = iSession.getChannel().getRemoteAddress();
|
||||||
loginRequest = loginRequest.toBuilder().setIpS(remoteAddress.getAddress().getHostAddress()).build();
|
loginRequest = loginRequest.toBuilder().setIpS(remoteAddress.getAddress().getHostAddress()).build();
|
||||||
ReportUtil.saveBaseInfo(userId,loginRequest);
|
ReportUtil.saveBaseInfo(userId,loginRequest);
|
||||||
// ParamEnvironmentBean paramEnvironmentBean = new ParamEnvironmentBean();
|
|
||||||
// paramEnvironmentBean.setDevice_id_s(loginRequest.getDeviceIdS());
|
|
||||||
// paramEnvironmentBean.setIp_s(loginRequest.getIpS());
|
|
||||||
ParamEnvironmentSimpleBean paramEnvironmentSimpleBean = new ParamEnvironmentSimpleBean("", "",
|
ParamEnvironmentSimpleBean paramEnvironmentSimpleBean = new ParamEnvironmentSimpleBean("", "",
|
||||||
loginRequest.getDeviceIdS(),
|
loginRequest.getDeviceIdS(),
|
||||||
loginRequest.getBrandS(),
|
loginRequest.getBrandS(),
|
||||||
|
@ -69,13 +67,16 @@ public class LoginRequestHandler extends BaseHandler<PlayerInfoProto.LoginReques
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
ParamDataBean paramDataBean = new ParamDataBean();
|
ParamDataBean paramDataBean = new ParamDataBean();
|
||||||
paramDataBean.setChannel_s(loginRequest.getChannelS());
|
paramDataBean.setChannel_s(loginRequest.getChannelS());
|
||||||
KTDataUtil.addUserDataInfo(userId,paramDataBean);
|
|
||||||
|
// KTDataUtil.addUserDataInfo(userId,paramDataBean);
|
||||||
// KTEnvironmentUtil.addUserEnviromentInfo(userId,paramEnvironmentBean);
|
// KTEnvironmentUtil.addUserEnviromentInfo(userId,paramEnvironmentBean);
|
||||||
// KTEnvironmentUtil.addUserSimpleEnviromentInfo(userId,paramEnvironmentSimpleBean);
|
// KTEnvironmentUtil.addUserSimpleEnviromentInfo(userId,paramEnvironmentSimpleBean);
|
||||||
// KTEnvironmentUtil.addUserEnviromentInfo(userId,paramEnvironmentBean);
|
// KTEnvironmentUtil.addUserEnviromentInfo(userId,paramEnvironmentBean);
|
||||||
|
|
||||||
int pid = 0;
|
int pid = 0;
|
||||||
int gid = 0;
|
int gid = 0;
|
||||||
String channle_id = "";
|
String channle_id = "";
|
||||||
|
@ -114,16 +115,16 @@ public class LoginRequestHandler extends BaseHandler<PlayerInfoProto.LoginReques
|
||||||
String chanel = split[1];
|
String chanel = split[1];
|
||||||
UserManager.userLogin(userId,openId,chanel,pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS(),channle_id,bundle_id,ccId,pack_Id);
|
UserManager.userLogin(userId,openId,chanel,pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS(),channle_id,bundle_id,ccId,pack_Id);
|
||||||
}
|
}
|
||||||
now = TimeUtils.now();
|
|
||||||
User user = UserManager.userLogin(userId,openIdFront,"",pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS(),channle_id,bundle_id,ccId,pack_Id);
|
User user = UserManager.userLogin(userId,openIdFront,"",pid,gid,loginRequest.getPlatformS(),loginRequest.getIpS(),channle_id,bundle_id,ccId,pack_Id);
|
||||||
LOGGER.info("登陆耗时10:{}", TimeUtils.now() - now);
|
|
||||||
now = TimeUtils.now();
|
|
||||||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||||
playerInfoManager.setLastDeviceId(loginRequest.getDeviceIdS());
|
playerInfoManager.setLastDeviceId(loginRequest.getDeviceIdS());
|
||||||
playerInfoManager.setServerId(loginRequest.getServerId());
|
playerInfoManager.setServerId(loginRequest.getServerId());
|
||||||
|
|
||||||
UserRecentLoginInfo userRecentLoginInfo = new UserRecentLoginInfo(TimeUtils.nowInt(), playerInfoManager.getLevel(), playerInfoManager.getRootId(), playerInfoManager.getNickName());
|
UserRecentLoginInfo userRecentLoginInfo = new UserRecentLoginInfo(TimeUtils.nowInt(), playerInfoManager.getLevel(), playerInfoManager.getRootId(), playerInfoManager.getNickName());
|
||||||
|
|
||||||
RedisUtil.getInstence().old_putmap(RedisKey.USER_SERVER_INFO,openIdFront,loginRequest.getServerId(),userRecentLoginInfo);
|
RedisUtil.getInstence().old_putmap(RedisKey.USER_SERVER_INFO,openIdFront,loginRequest.getServerId(),userRecentLoginInfo);
|
||||||
|
|
||||||
PlayerInfoProto.LoginResponse loginResponse = PlayerInfoProto.LoginResponse.newBuilder().setResultCode(0).setNewToken(String.valueOf(iSession.getToken())).build();
|
PlayerInfoProto.LoginResponse loginResponse = PlayerInfoProto.LoginResponse.newBuilder().setResultCode(0).setNewToken(String.valueOf(iSession.getToken())).build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -131,8 +132,8 @@ public class LoginRequestHandler extends BaseHandler<PlayerInfoProto.LoginReques
|
||||||
RedisUtil.getInstence().del(key);
|
RedisUtil.getInstence().del(key);
|
||||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.LOGIN_RESPONSE_VALUE, loginResponse, true);
|
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.LOGIN_RESPONSE_VALUE, loginResponse, true);
|
||||||
MapLogic.getInstance().whenLogin(user);
|
MapLogic.getInstance().whenLogin(user);
|
||||||
// KtEventUtils.onKtEvent(user, ParamEventBean.UserLoginOutEvent,0);
|
KtEventUtils.onKtEvent(user, ParamEventBean.UserLoginOutEvent,0);
|
||||||
// KtEventUtils.onKtEvent(user, ParamEventBean.UserLogin,0);
|
KtEventUtils.onKtEvent(user, ParamEventBean.UserLogin,0);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -644,7 +644,7 @@ public class EquipLogic {
|
||||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||||
}
|
}
|
||||||
// 掉落道具
|
// 掉落道具
|
||||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, new int[]{giftId, 1}, 1, BIReason.GIFT_UP_STAR_GET);
|
CommonProto.Drop.Builder drop = ItemUtil.drop(user, new int[][]{{giftId, 1}}, 1, BIReason.GIFT_UP_STAR_GET);
|
||||||
HeroInfoProto.GiftEquipUpStarResponse.Builder builder = HeroInfoProto.GiftEquipUpStarResponse.newBuilder().setDrop(drop);
|
HeroInfoProto.GiftEquipUpStarResponse.Builder builder = HeroInfoProto.GiftEquipUpStarResponse.newBuilder().setDrop(drop);
|
||||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GiftEquipUpStarResponse_VALUE, builder.build(), true);
|
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GiftEquipUpStarResponse_VALUE, builder.build(), true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -312,7 +312,7 @@ public class BuyGoodsNewLogic {
|
||||||
// 全部礼包状态推送
|
// 全部礼包状态推送
|
||||||
sendGiftGoodsWithoutJudge(uid);
|
sendGiftGoodsWithoutJudge(uid);
|
||||||
// 推送礼包
|
// 推送礼包
|
||||||
openPush(session,user, PushRechargeType.point_recharge.getType(),goodsId);
|
openPush(session, user, PushRechargeType.point_recharge.getType(), goodsId);
|
||||||
// 基础掉落
|
// 基础掉落
|
||||||
List<int[][]> list = bag.getDropByBag();
|
List<int[][]> list = bag.getDropByBag();
|
||||||
// 购买礼包额外补助
|
// 购买礼包额外补助
|
||||||
|
@ -928,43 +928,48 @@ public class BuyGoodsNewLogic {
|
||||||
/**
|
/**
|
||||||
* 发送推送礼包
|
* 发送推送礼包
|
||||||
*/
|
*/
|
||||||
public static void openPush(ISession session,User user,int type,int star) throws Exception{
|
public static void openPush(ISession session,User user,int type,int star){
|
||||||
NewRechargeInfo info = user.getPlayerInfoManager().getNewRechargeInfo();
|
try {
|
||||||
List<SPackPushConfig> list = SPackPushConfig.findConfigByCon(type,star);
|
NewRechargeInfo info = user.getPlayerInfoManager().getNewRechargeInfo();
|
||||||
if(list == null){
|
List<SPackPushConfig> list = SPackPushConfig.findConfigByCon(type,star);
|
||||||
return;
|
if(list == null){
|
||||||
}
|
return;
|
||||||
list.sort(Comparator.comparingInt(SPackPushConfig::getPriority));
|
|
||||||
long now = TimeUtils.now();
|
|
||||||
int bagId = 0;
|
|
||||||
boolean push = false;
|
|
||||||
for(SPackPushConfig con : list){
|
|
||||||
bagId = judgePushCondition(user,con);
|
|
||||||
int conditionType=con.getConditionId()[0];
|
|
||||||
int pushId = con.getId();
|
|
||||||
int statistics = con.getStatistics();
|
|
||||||
int count = con.getCount();
|
|
||||||
// todo DayPushNum和AllPuthNum可以放到redis里操作
|
|
||||||
if (statistics >0 && info.getDayPushNum(pushId)>= statistics && count > 0 && info.getAllPuthNum(pushId)>= count){
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
//条件成功
|
list.sort(Comparator.comparingInt(SPackPushConfig::getPriority));
|
||||||
if(bagId > 0 && info.getNextPushTime() < now && info.getTypePushTimeMap(conditionType) < now){
|
long now = TimeUtils.now();
|
||||||
info.setNextPushTime(now + con.getcDTime() * TimeUtils.HOUR);
|
int bagId = 0;
|
||||||
info.setTypePushTimeMap(conditionType, now + con.getPrivateCD() * TimeUtils.HOUR);
|
boolean push = false;
|
||||||
info.setDayPushNum(pushId,1);
|
for(SPackPushConfig con : list){
|
||||||
info.setAllPuthNum(pushId,1);
|
bagId = judgePushCondition(user,con);
|
||||||
push = createPushBag(bagId, user);
|
int conditionType=con.getConditionId()[0];
|
||||||
break;
|
int pushId = con.getId();
|
||||||
|
int statistics = con.getStatistics();
|
||||||
|
int count = con.getCount();
|
||||||
|
// todo DayPushNum和AllPuthNum可以放到redis里操作
|
||||||
|
if (statistics >0 && info.getDayPushNum(pushId)>= statistics && count > 0 && info.getAllPuthNum(pushId)>= count){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//条件成功
|
||||||
|
if(bagId > 0 && info.getNextPushTime() < now && info.getTypePushTimeMap(conditionType) < now){
|
||||||
|
info.setNextPushTime(now + con.getcDTime() * TimeUtils.HOUR);
|
||||||
|
info.setTypePushTimeMap(conditionType, now + con.getPrivateCD() * TimeUtils.HOUR);
|
||||||
|
info.setDayPushNum(pushId,1);
|
||||||
|
info.setAllPuthNum(pushId,1);
|
||||||
|
push = createPushBag(bagId, user);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityNewConfig.configMap.size());
|
||||||
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityNewConfig.configMap.size());
|
getGoodsBagInfo(user.getId(), goodsBagInfo);
|
||||||
getGoodsBagInfo(user.getId(), goodsBagInfo);
|
PlayerInfoProto.AllGiftGoodsIndication goodsBuild = PlayerInfoProto.AllGiftGoodsIndication.newBuilder().addAllGiftGoodsInfo(goodsBagInfo).build();
|
||||||
PlayerInfoProto.AllGiftGoodsIndication goodsBuild = PlayerInfoProto.AllGiftGoodsIndication.newBuilder().addAllGiftGoodsInfo(goodsBagInfo).build();
|
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.ALL_GIFTGOODS_INDICATION_VALUE, goodsBuild, true);
|
||||||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.ALL_GIFTGOODS_INDICATION_VALUE, goodsBuild, true);
|
if(bagId != 0 && push){
|
||||||
if(bagId != 0 && push){
|
PlayerInfoProto.PushWelfareResponse pushWelfareResponse = PlayerInfoProto.PushWelfareResponse.newBuilder().addId(bagId).build();
|
||||||
PlayerInfoProto.PushWelfareResponse pushWelfareResponse = PlayerInfoProto.PushWelfareResponse.newBuilder().addId(bagId).build();
|
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.PUSH_WELFARE_RESPONSE.getNumber(), pushWelfareResponse, true);
|
||||||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.PUSH_WELFARE_RESPONSE.getNumber(), pushWelfareResponse, true);
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
LOGGER.error("创建推送礼包报错,uid:{},触发礼包id:{},type:{}, 异常:{}",user.getId(), star, type, e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue