充值商店刷新次数

back_recharge
gaojie 2019-05-13 15:26:38 +08:00
parent be46197ed2
commit 9870d36663
2 changed files with 18 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import com.ljsd.jieling.logic.activity.ActivityLogic;
import com.ljsd.jieling.logic.activity.ActivityType;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.store.StoreLogic;
import com.ljsd.jieling.netty.cocdex.PacketNetData;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.CommonProto;
@ -50,6 +51,8 @@ public class GetPlayerInfoHandler extends BaseHandler{
MapLogic.getInstance().resetDayInfo(user);
//活动刷新
ActivityLogic.getInstance().flushEveryDay(user);
//商店刷新次数重置
StoreLogic.resetStoreRefreshNum(userId);
}
user.getPlayerInfoManager().setLoginTime(TimeUtils.now());
Map<Integer, Integer> guidePoints = user.getPlayerInfoManager().getGuidePoints();

View File

@ -281,5 +281,20 @@ public class StoreLogic {
PlayerInfoProto.StoreGoodsRefreshResponse builder = PlayerInfoProto.StoreGoodsRefreshResponse.newBuilder().setStoreInfo(storeBuilder).build();
MessageUtil.sendMessage(iSession, 1,msgId, builder, true);
}
/**
*
* @param uid
* @throws Exception
*/
public static void resetStoreRefreshNum(int uid) throws Exception {
User user = UserManager.getUser(uid);
StoreManager storeManager = user.getStoreManager();
Map<Integer, StoreInfo> storeInfoMap = storeManager.getStoreInfoMap();
for (Map.Entry<Integer, StoreInfo> entry: storeInfoMap.entrySet()){
StoreInfo storeInfo = entry.getValue();
storeInfo.setRefreshNum(0);
}
}
}