Merge branch 'master_online_hw' into master_test_hw
commit
47d40eae84
|
@ -82,6 +82,10 @@ public enum ReportEventEnum {
|
|||
LEAVE_PANOPTIC_MIRROR(55,"leave_panoptic_mirror",new CommonEventHandler(),new String[]{"Panoptic_Mirror_id"}),
|
||||
TIME_SUMMON(56,"Time_summon",new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
||||
FATALITY_SUMMON(57,"fatality_summon",new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
||||
GET_BEAST(58,"get_beast",new CommonEventHandler(),new String[]{"beast_id","quality","get_type"}),
|
||||
BEAST_LEVEL(59,"beast_level",new CommonEventHandler(),new String[]{"beast_id","old_level","new_level","cost_item_list"}),
|
||||
BEAST_STAR(60,"beast_star",new CommonEventHandler(),new String[]{"beast_id","old_star","new_star","cost_item_list","cost_beast_list"}),
|
||||
BEAST_SUMMON(61,"beast_summon",new CommonEventHandler(),new String[]{"beast_id","summon_type","new_star","cost_item_id","reward_nums_list"}),
|
||||
|
||||
VIP_LEVEL_UP(100,"", new VipLevelUpEventHandler(),new String[]{""});
|
||||
|
||||
|
|
|
@ -26,15 +26,13 @@ class RechargeSumDayActivity extends AbstractActivity {
|
|||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (activityMission.getV() >= SActivityRewardConfig.getsActivityRewardConfigByActivityId(id).size()-1) {
|
||||
ActivityLogic.getInstance().initMissionInfo(activityMission,id);
|
||||
return;
|
||||
}
|
||||
int missionId = STableManager.getFigureConfig(ActivityStaticConfig.class).getRechargeDaySum().get(activityMission.getV() + 1);
|
||||
if (user.getPlayerInfoManager().getRechargedaily() > 0 ) {//充值0.99不触发修改
|
||||
// SActivityRewardConfig.getsActivityRewardConfigByMissionId(missionId).getValues()[0][0]
|
||||
activityMission.setV(activityMission.getV() + 1);
|
||||
}
|
||||
if (activityMission.getV() >= SActivityRewardConfig.getsActivityRewardConfigByActivityId(id).size()) {
|
||||
ActivityLogic.getInstance().initMissionInfo(activityMission,id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -397,7 +397,7 @@ public class PlayerManager extends MongoBase {
|
|||
}else {
|
||||
maxTime = TimeUtils.now()/1000+config.getContinueTime()[0];
|
||||
}
|
||||
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000,5,0,true)/1000);
|
||||
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000,0,0,true)/1000);
|
||||
newVipInfo.setEffectTime((int)maxTime);
|
||||
}
|
||||
this.vipInfo.put(privilageId,newVipInfo);
|
||||
|
|
|
@ -694,8 +694,28 @@ public class GuildLogic {
|
|||
if(guildId == 0){
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_NO);
|
||||
}
|
||||
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||
User targetUser = UserManager.getUser(targetUid);
|
||||
int targetUserGuildId = targetUser.getPlayerInfoManager().getGuildId();
|
||||
if(targetUserGuildId == 0){
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_NO);
|
||||
}
|
||||
|
||||
if(guildId!=targetUserGuildId){
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_NO_ACCESS);
|
||||
}
|
||||
|
||||
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(targetUserGuildId);
|
||||
int uidType = getMemberType(uid, guildInfo.getMembers());
|
||||
boolean isIn=false;
|
||||
for(Set<Integer> memberEntry : guildInfo.getMembers().values()){
|
||||
if(memberEntry.contains(targetUid)){
|
||||
isIn =true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!isIn){
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_NO_ACCESS);
|
||||
}
|
||||
int targetType = getMemberType(targetUid, guildInfo.getMembers());
|
||||
if(uidType>1 || uidType>targetType){
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_NO_ACCESS);
|
||||
|
@ -715,7 +735,7 @@ public class GuildLogic {
|
|||
// RedisUtil.getInstence().putMapEntry(RedisKey.PLAYER_INFO_CACHE,"",String.valueOf(uid),cache);
|
||||
PlayerLogic.getInstance().playerInfoUpdate(UserManager.getUser(targetUid));
|
||||
sendPositionChange(targetUid,position);
|
||||
User targetUser = UserManager.getUser(targetUid);
|
||||
|
||||
if(position == GlobalsDef.CHAIRMAN){
|
||||
guildInfo.removeMember(GlobalsDef.CHAIRMAN,uid);
|
||||
PlayerLogic.getInstance().playerInfoUpdate(user);
|
||||
|
|
|
@ -352,7 +352,7 @@ public class HeroLogic{
|
|||
CommonProto.Drop.Builder drop = ItemUtil.dropPer(user, resultRandom,BIReason.HERO_RANDOM);
|
||||
builder.setDrop(drop);
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.HERO_RAND_RESPONSE_VALUE, builder.build(), true);
|
||||
System.out.println(System.currentTimeMillis()-time);
|
||||
// System.out.println(System.currentTimeMillis()-time);
|
||||
}
|
||||
|
||||
|
||||
|
@ -411,6 +411,10 @@ public class HeroLogic{
|
|||
break;
|
||||
case 2:
|
||||
eventEnum = ReportEventEnum.SUMMON_HERO;
|
||||
break;
|
||||
case 9:
|
||||
eventEnum = ReportEventEnum.BEAST_SUMMON;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
|
@ -3098,6 +3102,7 @@ public class HeroLogic{
|
|||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
Pokemon pokemon = pokemonManager.getPokemonMap().get(pokemonId);
|
||||
int oldLevel = pokemon.getLevel();
|
||||
if(level<=pokemon.getLevel()){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
|
@ -3154,6 +3159,16 @@ public class HeroLogic{
|
|||
HeroInfoProto.PokenmonUpLevelResponse response = HeroInfoProto.PokenmonUpLevelResponse.newBuilder().setLevel(finalLevel).build();
|
||||
//发送成功消息
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for(Map.Entry<Integer,Integer> entry:costMap.entrySet()){
|
||||
if(builder.length()>0){
|
||||
builder.append("|");
|
||||
}
|
||||
builder.append(entry.getKey()).append("#").append(entry.getValue());
|
||||
|
||||
}
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.BEAST_LEVEL.getType(),pokemon.getTmpId(),oldLevel,finalLevel,builder.toString());
|
||||
|
||||
// user.getUserMissionManager().onGameEvent(user,GameEvent.POKEMON_UPLEVEL,pokemonId);
|
||||
|
||||
}
|
||||
|
@ -3173,6 +3188,7 @@ public class HeroLogic{
|
|||
if(pokemon == null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
int oldStar = pokemon.getStar();
|
||||
SSpiritAnimal animal = STableManager.getConfig(SSpiritAnimal.class).get(pokemon.getTmpId());
|
||||
if(animal==null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
|
@ -3189,6 +3205,8 @@ public class HeroLogic{
|
|||
if(config.getConsumeItemNum()!=consumePokemonIdsList.size()){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
StringBuilder consumeBuilder = new StringBuilder();
|
||||
|
||||
for(String consume:consumePokemonIdsList){
|
||||
Pokemon consumePokemon = pokemonManager.getPokemonMap().get(consume);
|
||||
if(consumePokemon==null){
|
||||
|
@ -3203,6 +3221,11 @@ public class HeroLogic{
|
|||
if(pokemonManager.getPokemonTeamMap().containsValue(consume)){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_DECOMPOSE_HERO_TEAM);
|
||||
}
|
||||
if(consumeBuilder.length()>0){
|
||||
consumeBuilder.append("|");
|
||||
}
|
||||
consumeBuilder.append(pokemon.getTmpId()).append("-").append(pokemon.getLevel());
|
||||
|
||||
}
|
||||
int[][] consumeRes = config.getConsumeRes();
|
||||
boolean itemCost = ItemUtil.itemCost(user, consumeRes, BIReason.SPECIAL_STAR_UP_CONSUME, 1);
|
||||
|
@ -3223,6 +3246,15 @@ public class HeroLogic{
|
|||
}
|
||||
}
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.POKEMON_ADVANCED_RESPONSE_VALUE,null,true);
|
||||
for(int[] consume:consumeRes){
|
||||
if(consumeBuilder.length()>0){
|
||||
consumeBuilder.append("|");
|
||||
}
|
||||
consumeBuilder.append(consume[0]).append("#").append(consume[1]);
|
||||
}
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.BEAST_STAR.getType(),pokemon.getTmpId(),oldStar,pokemon.getStar(),consumeBuilder.toString());
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -402,12 +402,13 @@ public class PlayerLogic {
|
|||
public void flushUserdataEvery(User user, PlayerInfoProto.FivePlayerUpdateIndication.Builder fBuilder) throws Exception {
|
||||
|
||||
//跟新签到天数
|
||||
if (!TimeUtils.isSameMonthFiveWithNow(user.getPlayerInfoManager().getOffLineTime())) {
|
||||
user.getPlayerInfoManager().getPhoneBindInfo().setState(0);
|
||||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||
if (!TimeUtils.isSameMonthFiveWithNow(playerInfoManager.getOffLineTime())) {
|
||||
playerInfoManager.getPhoneBindInfo().setState(0);
|
||||
}
|
||||
user.getPlayerInfoManager().setMonthCardDailyTake(new HashSet<>());//刷新月卡信息
|
||||
playerInfoManager.setMonthCardDailyTake(new HashSet<>());//刷新月卡信息
|
||||
if(null!=fBuilder){
|
||||
PhoneBindInfo phoneBindInfo = user.getPlayerInfoManager().getPhoneBindInfo();
|
||||
PhoneBindInfo phoneBindInfo =playerInfoManager.getPhoneBindInfo();
|
||||
fBuilder.setPlayerBindPhone(CommonProto.PlayerBindPhone.newBuilder().setPhoneNum(phoneBindInfo.getPhoneNum()).setState(phoneBindInfo.getState()).build());
|
||||
}
|
||||
|
||||
|
@ -419,6 +420,19 @@ public class PlayerLogic {
|
|||
ItemUtil.itemCost(user, dailyScore, BIReason.DAILY_SCORE_CONSUME, 1);
|
||||
}
|
||||
|
||||
//退出公会 隔天清空援助信息
|
||||
if(playerInfoManager.getGuildId()==0){
|
||||
GuildMyInfo guildMyInfo = user.getGuildMyInfo();
|
||||
if(guildMyInfo.getGuidHelpInfo().size()!=0||guildMyInfo.getGuidHelpHadTakeInfo().size()!=0){
|
||||
guildMyInfo.setGuidHelpInfo(new HashMap<>());
|
||||
guildMyInfo.setGuidHelpHadTakeInfo(new HashMap<>());
|
||||
guildMyInfo.setGuildHelpSendTime(0);
|
||||
guildMyInfo.setGuildHelpReward(false);
|
||||
guildMyInfo.setGuildHelpTime(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void modifyDecoration(ISession session, int type,int decorationId,MessageTypeProto.MessageType messageType) throws Exception {
|
||||
|
|
|
@ -17,7 +17,7 @@ public class CarDealyGuildRank extends AbstractRank{
|
|||
|
||||
@Override
|
||||
public long[] getDataByScore(Double score) {
|
||||
return new long[]{(int) (score.longValue()/1000),(int) (score.longValue()%1000)};
|
||||
return new long[]{ score.longValue()/1000,score.longValue()%1000};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -437,7 +437,8 @@ public class BuyGoodsLogic {
|
|||
ExpeditionLogic.sendTreasureRewardUpdate(OnlineUserManager.getSessionByUid(user.getId()),user.getExpeditionManager().getWorldTreasureReward().getScore(),rewardStatusMap,user.getExpeditionManager().getWorldTreasureReward().getCreateTime(),1);
|
||||
}
|
||||
if(sRechargeCommodityConfig.getTime() ==5){
|
||||
rechargeInfo.updateRefreshMapByKey(sRechargeCommodityConfig.getId(),TimeUtils.now()+sRechargeCommodityConfig.getDailyUpdate()*TimeUtils.DAY);
|
||||
long nextTime = TimeUtils.getLastOrUnderHour(TimeUtils.now() + sRechargeCommodityConfig.getDailyUpdate() * TimeUtils.DAY, 0, 0, true);
|
||||
rechargeInfo.updateRefreshMapByKey(sRechargeCommodityConfig.getId(),nextTime);
|
||||
}
|
||||
resultRes.setResultCode(1);
|
||||
// KtEventUtils.onKtEvent(user, ParamEventBean.UserPayEvent,goodsId,orderId,resultRes.getResultCode(),price);
|
||||
|
|
|
@ -1585,7 +1585,7 @@ public class ItemUtil {
|
|||
return new int[0];
|
||||
}
|
||||
|
||||
private static void addSpecialMonster(User user,ItemMap itemObj,CommonProto.Drop.Builder dropBuilder,int reason){
|
||||
private static void addSpecialMonster(User user,ItemMap itemObj,CommonProto.Drop.Builder dropBuilder,int reason) throws Exception {
|
||||
if(itemObj.getSpecialMonsterMap().isEmpty()){
|
||||
return;
|
||||
}
|
||||
|
@ -1598,6 +1598,7 @@ public class ItemUtil {
|
|||
}
|
||||
dropBuilder.addPokemon(CBean2Proto.getPokemon(pokemon));
|
||||
SSpiritAnimal animal = STableManager.getConfig(SSpiritAnimal.class).get(entry.getKey());
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.GET_BEAST.getType(),entry.getKey(),animal.getQuality(),reason);
|
||||
if (animal.getQuality() >= SSpecialConfig.getIntegerValue(SSpecialConfig.ANIMAL_BROADCAST_QUALITY)&&reason!=BIReason.COMPOS_HERO_REWARD) { //策划资质改成星级
|
||||
String message = SErrorCodeEerverConfig.getI18NMessage("animal_get_broadcast_content", new Object[]{user.getPlayerInfoManager().getNickName(), animal.getName()});
|
||||
if (!message.isEmpty()){
|
||||
|
|
Loading…
Reference in New Issue