修复玩家活动数据
parent
334083029e
commit
10470c3dc8
|
@ -9,6 +9,7 @@ import com.ljsd.jieling.logic.GlobalDataManaager;
|
||||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||||
import com.ljsd.jieling.logic.dao.*;
|
import com.ljsd.jieling.logic.dao.*;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
import com.ljsd.jieling.logic.hotfix.DoFix;
|
||||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||||
import com.ljsd.jieling.logic.store.BuyGoodsLogic;
|
import com.ljsd.jieling.logic.store.BuyGoodsLogic;
|
||||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||||
|
@ -126,6 +127,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
try {
|
try {
|
||||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_PLAYERINFO_RESPONSE_VALUE, getPlayerInfoResponse, true);
|
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_PLAYERINFO_RESPONSE_VALUE, getPlayerInfoResponse, true);
|
||||||
ActivityLogic.getInstance().flushForLogin(user);
|
ActivityLogic.getInstance().flushForLogin(user);
|
||||||
|
DoFix.getInstance().loginFix(user);
|
||||||
RedisUtil.getInstence().set(RedisKey.USER_LOGIN_URL + userId, RPCServerTask.userCallBackUrl);
|
RedisUtil.getInstence().set(RedisKey.USER_LOGIN_URL + userId, RPCServerTask.userCallBackUrl);
|
||||||
LOGGER.info("back to client!");
|
LOGGER.info("back to client!");
|
||||||
if(user.getPlayerInfoManager().getGuidePoints().get(1)!=-1){
|
if(user.getPlayerInfoManager().getGuidePoints().get(1)!=-1){
|
||||||
|
|
|
@ -74,6 +74,8 @@ public class PlayerManager extends MongoBase {
|
||||||
|
|
||||||
private int rechargedaily;
|
private int rechargedaily;
|
||||||
|
|
||||||
|
private Set<Integer> fixIds = new CopyOnWriteArraySet<>();
|
||||||
|
|
||||||
public PlayerManager(){
|
public PlayerManager(){
|
||||||
this.setRootCollection(User._COLLECTION_NAME);
|
this.setRootCollection(User._COLLECTION_NAME);
|
||||||
}
|
}
|
||||||
|
@ -409,4 +411,15 @@ public class PlayerManager extends MongoBase {
|
||||||
public void addRechargedaily(int rechargedaily) {
|
public void addRechargedaily(int rechargedaily) {
|
||||||
this.rechargedaily += rechargedaily;
|
this.rechargedaily += rechargedaily;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Set<Integer> getFixIds() {
|
||||||
|
return fixIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFixIds(Set<Integer> fixIds) {
|
||||||
|
updateString("fixIds", fixIds);
|
||||||
|
this.fixIds = fixIds;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.ljsd.jieling.logic.hotfix;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.logic.dao.ActivityManager;
|
||||||
|
import com.ljsd.jieling.logic.dao.ActivityMission;
|
||||||
|
import com.ljsd.jieling.logic.dao.ActivityProgressInfo;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class DoFix {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储被热修复的记录
|
||||||
|
* fix id 10000 修复活动记录值缺失
|
||||||
|
*/
|
||||||
|
public static class Holder {
|
||||||
|
public final static DoFix instance = new DoFix();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DoFix getInstance() {
|
||||||
|
return DoFix.Holder.instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int fixIndex = 10002;
|
||||||
|
|
||||||
|
public void loginFix(User user) throws Exception {
|
||||||
|
|
||||||
|
Set<Integer> fixIds = user.getPlayerInfoManager().getFixIds();
|
||||||
|
if (fixIds.contains(10004)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fixIds.add(fixIndex);
|
||||||
|
user.getPlayerInfoManager().setFixIds(fixIds);
|
||||||
|
|
||||||
|
fixActivityValue(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fixActivityValue(User user) throws Exception {
|
||||||
|
int activityId = 14;
|
||||||
|
ActivityManager activityManager = user.getActivityManager();
|
||||||
|
ActivityMission activityMission = activityManager.getActivityMissionMap().get(activityId);
|
||||||
|
if(activityMission.getValue()!=0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int sum = 0;
|
||||||
|
for (Map.Entry<Integer, ActivityProgressInfo> entry : activityMission.getActivityProgressInfoMap().entrySet()) {
|
||||||
|
if (entry.getValue().getProgrss() == 1) {
|
||||||
|
sum++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(sum==0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
activityMission.setValue(sum);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue