Merge branch 'online1.0'
commit
4dfc832ca2
|
@ -101,6 +101,7 @@ public class UserManager {
|
|||
PlayerLogic.getInstance().vipflushEveryDay(user,null);
|
||||
ActivityLogic.getInstance().newPlayerOpenActivityMission(user);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.USER_LEVELUP,0,1);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.DAILY_REFRESH,0);
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserRegister);
|
||||
}
|
||||
|
||||
|
|
|
@ -45,21 +45,6 @@ public class UserMissionManager extends MongoBase {
|
|||
dailyCumulationData.reset();
|
||||
dailyMissionIdsType.getDoingMissionIds().addAll(missionIds);
|
||||
updateString("dailyCumulationData",dailyCumulationData);
|
||||
}else{
|
||||
dailyMissionIdsType.getDoingMissionIds().addAll(missionIds);
|
||||
for(Integer missionId : missionIds){
|
||||
SDailyTasksConfig sDailyTasksConfigById = SDailyTasksConfig.getSDailyTasksConfigById(missionId);
|
||||
boolean isFinish = MissionLoigc.getDoingProgress(user, cumulationData, sDailyTasksConfigById.getType(), sDailyTasksConfigById.getValues()[0]) >= sDailyTasksConfigById.getValues()[1][0];
|
||||
MissionStateChangeInfo stateChangeInfo = new MissionStateChangeInfo(missionId,
|
||||
MissionState.DOING, null);
|
||||
if(isFinish){
|
||||
stateChangeInfo = new MissionStateChangeInfo(missionId,
|
||||
MissionState.FINISH, null);
|
||||
dailyMissionIdsType.getDoingMissionIds().remove(missionId);
|
||||
dailyMissionIdsType.getFinishMissionIds().add(missionId);
|
||||
}
|
||||
missionTypeEnumListMap.get(GameMisionType.DAILYMISSION).add(stateChangeInfo);
|
||||
}
|
||||
}
|
||||
updateString("dailyMissionIdsType",dailyMissionIdsType);
|
||||
break;
|
||||
|
|
|
@ -105,7 +105,7 @@ public class FriendLogic {
|
|||
}
|
||||
List<CommonProto.Friend> friendList = new CopyOnWriteArrayList<>();
|
||||
for (Integer commondUid : recommondIds){
|
||||
CommonProto.Friend friend = CBean2Proto.getFriendInfo(commondUid,null);
|
||||
CommonProto.Friend friend = CBean2Proto.getFriendInfo(commondUid,friendManager);
|
||||
friendList.add(friend);
|
||||
}
|
||||
PlayerInfoProto.GetFriendInfoResponse getFriendInfoResponse = PlayerInfoProto.GetFriendInfoResponse
|
||||
|
@ -141,7 +141,7 @@ public class FriendLogic {
|
|||
List<Integer> applyFriends = friendManager.getApplyFriends();
|
||||
List<CommonProto.Friend> friendList = new CopyOnWriteArrayList<>();
|
||||
for (Integer applyFriendId :applyFriends){
|
||||
CommonProto.Friend friend = CBean2Proto.getFriendInfo(applyFriendId,null);
|
||||
CommonProto.Friend friend = CBean2Proto.getFriendInfo(applyFriendId,friendManager);
|
||||
friendList.add(friend);
|
||||
}
|
||||
PlayerInfoProto.GetFriendInfoResponse getFriendInfoResponse = PlayerInfoProto.GetFriendInfoResponse
|
||||
|
@ -208,9 +208,10 @@ public class FriendLogic {
|
|||
boolean isOnline = OnlineUserManager.checkUidOnline(inviteUid);
|
||||
if (isOnline) {
|
||||
ISession session = OnlineUserManager.getSessionByUid(inviteUid);
|
||||
User user = UserManager.getUser(inviteUid);
|
||||
PlayerInfoProto.sendFriendInfoIndication.Builder sendFriendInfoIndication = PlayerInfoProto.sendFriendInfoIndication.newBuilder();
|
||||
sendFriendInfoIndication.setType(type);
|
||||
sendFriendInfoIndication.setFriends(CBean2Proto.getFriendInfo(uid, null));
|
||||
sendFriendInfoIndication.setFriends(CBean2Proto.getFriendInfo(uid, user.getFriendManager()));
|
||||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.SEND_FRIEND_INFO_INDICATION_VALUE, sendFriendInfoIndication.build(), true);
|
||||
}
|
||||
}
|
||||
|
@ -313,11 +314,22 @@ public class FriendLogic {
|
|||
}
|
||||
|
||||
private void initFriendGriveAndRreward(int friendId, int uid, FriendManager friendManager, FriendManager friendfriendManager) {
|
||||
|
||||
friendfriendManager.updateGiveMap(uid,0);
|
||||
friendfriendManager.updateHaveRewardMap(uid,0);
|
||||
friendManager.updateGiveMap(friendId,0);
|
||||
friendManager.updateHaveRewardMap(friendId,0);
|
||||
Map<Integer, Integer> friendGiveMap = friendfriendManager.getGiveMap();
|
||||
Map<Integer, Integer> friendHaveRewardMap = friendfriendManager.getHaveRewardMap();
|
||||
if (!friendGiveMap.containsKey(uid)){
|
||||
friendfriendManager.updateGiveMap(uid,0);
|
||||
}
|
||||
if (!friendHaveRewardMap.containsKey(uid)){
|
||||
friendfriendManager.updateHaveRewardMap(uid,0);
|
||||
}
|
||||
Map<Integer, Integer> giveMap = friendManager.getGiveMap();
|
||||
Map<Integer, Integer> haveRewardMap = friendManager.getHaveRewardMap();
|
||||
if (!giveMap.containsKey(friendId)){
|
||||
friendManager.updateGiveMap(friendId,0);
|
||||
}
|
||||
if (!haveRewardMap.containsKey(friendId)){
|
||||
friendManager.updateHaveRewardMap(friendId,0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -344,11 +356,11 @@ public class FriendLogic {
|
|||
//删除好友清除赠送领取体力信息
|
||||
private void delFriendInfo(int friendId, int uid, FriendManager friendManager, FriendManager friendManager1) {
|
||||
friendManager1.delFriends(uid);
|
||||
friendManager1.delGiveMap(uid);
|
||||
friendManager1.delHaveReward(uid);
|
||||
// friendManager1.delGiveMap(uid);
|
||||
// friendManager1.delHaveReward(uid);
|
||||
friendManager.delFriends(friendId);
|
||||
friendManager.delGiveMap(friendId);
|
||||
friendManager.delHaveReward(friendId);
|
||||
// friendManager.delGiveMap(friendId);
|
||||
// friendManager.delHaveReward(friendId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,7 +30,7 @@ public class MissionEventDistributor {
|
|||
public static void init(){
|
||||
|
||||
eventProcessor.put(GameEvent.VIP_LEVLUP,new VipLevelUpEventProcessor());
|
||||
eventProcessor.put(GameEvent.DAILY_REFRESH,new VipLevelUpEventProcessor());
|
||||
eventProcessor.put(GameEvent.DAILY_REFRESH,new DailyRefreshEventProcess());
|
||||
|
||||
List<MissionType> typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.RECRUITMENT_RANDOM_HEROES);
|
||||
|
|
|
@ -14,21 +14,10 @@ import java.util.Map;
|
|||
public class UserLevelEventProcessor implements BaseGameEventProcessor{
|
||||
@Override
|
||||
public void onGameEvent(User user, Map<GameMisionType, List<MissionStateChangeInfo>> misionTypeListMap, GameEvent event, Object... parm) throws Exception {
|
||||
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){
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_REFRESH,1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue