商店时间推送修改

back_recharge
lvxinran 2020-05-27 09:00:39 +08:00
parent 58d6738ca0
commit b6760d596a
2 changed files with 26 additions and 19 deletions

View File

@ -82,7 +82,8 @@ public class ExpeditionLogic {
ExpeditionManager manager = user.getExpeditionManager();
TimeControllerOfFunction openTimeOfFuntionCacheByType = GlobalDataManaager.getInstance().getOpenTimeOfFuntionCacheByType(FunctionIdEnum.Expedition);
if(manager.getCurrentTime()==openTimeOfFuntionCacheByType.getTimes()){
if(openTimeOfFuntionCacheByType==null||manager.getCurrentTime()==openTimeOfFuntionCacheByType.getTimes()){
return;
}
takeAllReward(user);

View File

@ -134,9 +134,16 @@ public class StoreLogic implements IEventHandler {
for(int i = 1;i<sStoreTypeConfig.getRefreshType().length;i++){
if(sStoreTypeConfig.getRefreshType()[i]!=calendar.get(Calendar.HOUR_OF_DAY)){
return;
continue;
}
sendRefreshIndication(sStoreTypeConfig,now);
break ;
}
}
}
}
private static void sendRefreshIndication(SStoreTypeConfig sStoreTypeConfig,long lastRefreshTime) throws Exception {
for(ISession session : OnlineUserManager.sessionMap.values()){
if(session.getFiveReady() == 1){
User user = UserManager.getUser(session.getUid());
@ -150,7 +157,7 @@ public class StoreLogic implements IEventHandler {
return;
}
storeInfo.setItemNumMap(storeItem);
storeInfo.setLastRefreshTime(now);
storeInfo.setLastRefreshTime(lastRefreshTime);
MongoUtil.getInstence().lastUpdate();
sendStoreUpdateIndication(user.getId(),storeInfo);
});
@ -158,8 +165,6 @@ public class StoreLogic implements IEventHandler {
}
}
}
}
}
private static void updateUsersStoreAyync(User user, AyncWorkerRunnable ayncWorkerRunnable){
AyyncWorker ayyncWorker = new AyyncWorker(user,true,ayncWorkerRunnable);
@ -250,6 +255,7 @@ public class StoreLogic implements IEventHandler {
public static void sendStoreUpdateIndication(int uid,StoreInfo storeInfo){
CommonProto.StoreInfo.Builder builder = getBuilder(storeInfo);
System.out.println("商店刷新发送推送");
PlayerInfoProto.storeUpdateIndication build = PlayerInfoProto.storeUpdateIndication.newBuilder().addStoreInfo(builder).build();
ISession session = OnlineUserManager.getSessionByUid(uid);
if(session!=null){