礼包和活动关联修改
parent
59c22520f3
commit
0a6bc7deb2
|
@ -7,11 +7,16 @@ import com.ljsd.jieling.logic.mission.GameEvent;
|
|||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.InnerMessageUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.LongStream;
|
||||
|
||||
@Component
|
||||
public class ServerZeroHandler extends BaseHandler {
|
||||
@Override
|
||||
|
@ -22,7 +27,9 @@ public class ServerZeroHandler extends BaseHandler {
|
|||
@Override
|
||||
public void process(ISession session, PacketNetData netData) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
GlobalDataManaager.flushGoodsTimes(user);
|
||||
List<Integer> array = new ArrayList<>();
|
||||
array.add(session.getUid());
|
||||
InnerMessageUtil.broadcastWithRandom(user1 -> GlobalDataManaager.flushGoodsTimes(user1),array,3,5);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.LOGIN_GAME,0);
|
||||
GlobalDataManaager.checkNeedReFlush(session, UserManager.getUser(session.getUid()), PlayerInfoProto.FivePlayerUpdateIndication.newBuilder());
|
||||
|
||||
|
|
|
@ -342,7 +342,6 @@ public class GlobalDataManaager implements IManager {
|
|||
PlayerLogic.getInstance().vipflushEveryDay(user,fBuilder);
|
||||
PlayerLogic.getInstance().flushUserdataEvery(user,fBuilder);
|
||||
GuildLogic.getInstance().flushEveryDay(user,fBuilder);
|
||||
BuyGoodsNewLogic.refreshWelfareState(user);
|
||||
ExpeditionLogic.getInstance().flushUserdataEveryDay(user);
|
||||
MapLogic.getInstance().flushEndlessTreasure(user);
|
||||
|
||||
|
@ -379,7 +378,6 @@ public class GlobalDataManaager implements IManager {
|
|||
user.getPlayerInfoManager().setProudInfo(new HashSet<>());
|
||||
|
||||
// 道具刷新
|
||||
flushGoodsTimes(user);
|
||||
BuyGoodsNewLogic.refreshWelfareState(user);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.LOGIN_GAME,0);
|
||||
}
|
||||
|
|
|
@ -221,7 +221,7 @@ public class ActivityLogic implements IEventHandler{
|
|||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.ACTIVITY_UPDATE_INDICATION_VALUE, builder.build(), true);
|
||||
}
|
||||
MissionEventDistributor.requestEnd(session,true);
|
||||
}, new LinkedList<>(OnlineUserManager.sessionMap.keySet()),5);
|
||||
}, new LinkedList<>(OnlineUserManager.sessionMap.keySet()),2);
|
||||
|
||||
}
|
||||
public void newPlayerOpenActivityMission(User user) throws Exception {
|
||||
|
|
|
@ -23,7 +23,7 @@ public class InnerMessageUtil {
|
|||
* @param timeBound 时间区间内随机执行点 针对cpu密集型的业务缓解服务器压力
|
||||
* tofix zsx 2020.04.28
|
||||
*/
|
||||
public static void broadcastWithRandom(AyncWorkerRunnable ayncWorkerRunnable, List<Integer> sendId, int timeBound) {
|
||||
public static void broadcastWithRandom(AyncWorkerRunnable ayncWorkerRunnable, List<Integer> sendId,int minBound, int timeBound) {
|
||||
|
||||
for (Integer id : sendId) {
|
||||
ThreadManager.getScheduledExecutor().schedule(new InnerTask(id){
|
||||
|
@ -38,10 +38,11 @@ public class InnerMessageUtil {
|
|||
handlerThread.addAyyncWorker(ayyncWorker);
|
||||
}
|
||||
}
|
||||
, MathUtils.randomInt(timeBound), TimeUnit.SECONDS);
|
||||
, MathUtils.random(minBound,timeBound), TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public static void broadcastWithRandom(AyncWorkerRunnable ayncWorkerRunnable, List<Integer> sendId, int timeBound) {
|
||||
broadcastWithRandom(ayncWorkerRunnable,sendId,0,timeBound);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue