red & fix vip mission
parent
628ff1a05c
commit
71e36e025d
|
@ -79,7 +79,7 @@ public class MongoUpdateCache {
|
|||
updateMongoData(ljsdMongoTemplate, requestMap);
|
||||
requestMap.clear();
|
||||
if (updateDataMap.size() !=0){
|
||||
ConcurrentDataMessage.addLogQueue(updateDataMap);
|
||||
ConcurrentDataMessage.addLogQueue(new HashMap<>(updateDataMap));
|
||||
updateDataMap.clear();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ljsd.common.mogodb.util;
|
|||
import com.ljsd.common.mogodb.LjsdMongoTemplate;
|
||||
import com.ljsd.common.mogodb.MongoUpdateCache;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
|
||||
|
@ -18,4 +19,15 @@ public class ConcurrentDataMessage {
|
|||
Map<String, Map<String, MongoUpdateCache.UpdateRequest>> take = ConcurrentDataMessage.dataQueue.take();
|
||||
myMongoTemplate.concurrentDataUpdate(take);
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
BlockingQueue<Map<String, String>> dataQueueTest = new BlockingUniqueQueue<>();
|
||||
Map<String,String> test = new HashMap<>();
|
||||
test.put("1","2");
|
||||
dataQueueTest.add(new HashMap<>(test));
|
||||
test.clear();
|
||||
Map<String, String> take = dataQueueTest.take();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,5 +9,6 @@ public class MongoKeys {
|
|||
|
||||
public static void initmongoKey() {
|
||||
mongoKeyMap.put("friendManager",1);
|
||||
mongoKeyMap.put("playerManager.reds",1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import java.util.HashMap;
|
|||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
|
||||
public class PlayerManager extends MongoBase {
|
||||
|
@ -61,7 +62,7 @@ public class PlayerManager extends MongoBase {
|
|||
|
||||
private Map<Integer,Integer> vipInfo = new HashMap<>();
|
||||
|
||||
private Set<Integer> reds = new HashSet<>(2);
|
||||
private Set<Integer> reds = new CopyOnWriteArraySet<>();
|
||||
|
||||
private RechargeInfo rechargeInfo;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.ljsd.jieling.logic.mission.MissionType;
|
|||
public class SecretboxRandomManager implements BaseDataManager{
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
data.setSecretRandomCount(data.getSecretRandomCount() + (int)parm[0]);
|
||||
data.setSecretRandomCount(data.getSecretRandomCount() + (int)parm[1]);
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.ljsd.jieling.core.FunctionIdEnum;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.GameMisionType;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
import com.ljsd.jieling.logic.mission.main.MissionStateChangeInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -16,6 +17,10 @@ public class UserLevelEventProcessor implements BaseGameEventProcessor{
|
|||
int openRule = SGlobalSystemConfig.getsGlobalSystemConfigByFunctionId(FunctionIdEnum.DailyTasks).getOpenRules()[1];
|
||||
int level= (int)parm[0];
|
||||
int upToLevel= (int)parm[1];
|
||||
List<MissionType> typeList = MissionEventDistributor.eventEnumListMap.get(event);
|
||||
for (MissionType type : typeList) {
|
||||
user.getUserMissionManager().calCumulationDataResult(user,type,misionTypeListMap,parm);
|
||||
}
|
||||
if(upToLevel>=openRule ){
|
||||
for(;level<=upToLevel;level++){
|
||||
if(level==openRule){
|
||||
|
|
|
@ -91,12 +91,6 @@ public class MessageUtil {
|
|||
|
||||
public static void sendMessage(ISession session, int result, int msgId, GeneratedMessage generatedMessage, boolean flush) {
|
||||
byte[] byteBuf = wrappedBuffer(session.getUid(), session.getToken(), session.getIndex(), result, msgId, generatedMessage);
|
||||
try {
|
||||
MongoUtil.getInstence().lastUpdate();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// System.out.println("-----> msgId : "+ msgId+"; length : "+byteBuf.length+"; content : "+byteBuf);
|
||||
if (flush) {
|
||||
session.writeAndFlush(byteBuf);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue