Merge branch 'online1.0'
commit
4dfc832ca2
|
@ -101,6 +101,7 @@ public class UserManager {
|
||||||
PlayerLogic.getInstance().vipflushEveryDay(user,null);
|
PlayerLogic.getInstance().vipflushEveryDay(user,null);
|
||||||
ActivityLogic.getInstance().newPlayerOpenActivityMission(user);
|
ActivityLogic.getInstance().newPlayerOpenActivityMission(user);
|
||||||
user.getUserMissionManager().onGameEvent(user, GameEvent.USER_LEVELUP,0,1);
|
user.getUserMissionManager().onGameEvent(user, GameEvent.USER_LEVELUP,0,1);
|
||||||
|
user.getUserMissionManager().onGameEvent(user, GameEvent.DAILY_REFRESH,0);
|
||||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserRegister);
|
KtEventUtils.onKtEvent(user, ParamEventBean.UserRegister);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,21 +45,6 @@ public class UserMissionManager extends MongoBase {
|
||||||
dailyCumulationData.reset();
|
dailyCumulationData.reset();
|
||||||
dailyMissionIdsType.getDoingMissionIds().addAll(missionIds);
|
dailyMissionIdsType.getDoingMissionIds().addAll(missionIds);
|
||||||
updateString("dailyCumulationData",dailyCumulationData);
|
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);
|
updateString("dailyMissionIdsType",dailyMissionIdsType);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -105,7 +105,7 @@ public class FriendLogic {
|
||||||
}
|
}
|
||||||
List<CommonProto.Friend> friendList = new CopyOnWriteArrayList<>();
|
List<CommonProto.Friend> friendList = new CopyOnWriteArrayList<>();
|
||||||
for (Integer commondUid : recommondIds){
|
for (Integer commondUid : recommondIds){
|
||||||
CommonProto.Friend friend = CBean2Proto.getFriendInfo(commondUid,null);
|
CommonProto.Friend friend = CBean2Proto.getFriendInfo(commondUid,friendManager);
|
||||||
friendList.add(friend);
|
friendList.add(friend);
|
||||||
}
|
}
|
||||||
PlayerInfoProto.GetFriendInfoResponse getFriendInfoResponse = PlayerInfoProto.GetFriendInfoResponse
|
PlayerInfoProto.GetFriendInfoResponse getFriendInfoResponse = PlayerInfoProto.GetFriendInfoResponse
|
||||||
|
@ -141,7 +141,7 @@ public class FriendLogic {
|
||||||
List<Integer> applyFriends = friendManager.getApplyFriends();
|
List<Integer> applyFriends = friendManager.getApplyFriends();
|
||||||
List<CommonProto.Friend> friendList = new CopyOnWriteArrayList<>();
|
List<CommonProto.Friend> friendList = new CopyOnWriteArrayList<>();
|
||||||
for (Integer applyFriendId :applyFriends){
|
for (Integer applyFriendId :applyFriends){
|
||||||
CommonProto.Friend friend = CBean2Proto.getFriendInfo(applyFriendId,null);
|
CommonProto.Friend friend = CBean2Proto.getFriendInfo(applyFriendId,friendManager);
|
||||||
friendList.add(friend);
|
friendList.add(friend);
|
||||||
}
|
}
|
||||||
PlayerInfoProto.GetFriendInfoResponse getFriendInfoResponse = PlayerInfoProto.GetFriendInfoResponse
|
PlayerInfoProto.GetFriendInfoResponse getFriendInfoResponse = PlayerInfoProto.GetFriendInfoResponse
|
||||||
|
@ -208,9 +208,10 @@ public class FriendLogic {
|
||||||
boolean isOnline = OnlineUserManager.checkUidOnline(inviteUid);
|
boolean isOnline = OnlineUserManager.checkUidOnline(inviteUid);
|
||||||
if (isOnline) {
|
if (isOnline) {
|
||||||
ISession session = OnlineUserManager.getSessionByUid(inviteUid);
|
ISession session = OnlineUserManager.getSessionByUid(inviteUid);
|
||||||
|
User user = UserManager.getUser(inviteUid);
|
||||||
PlayerInfoProto.sendFriendInfoIndication.Builder sendFriendInfoIndication = PlayerInfoProto.sendFriendInfoIndication.newBuilder();
|
PlayerInfoProto.sendFriendInfoIndication.Builder sendFriendInfoIndication = PlayerInfoProto.sendFriendInfoIndication.newBuilder();
|
||||||
sendFriendInfoIndication.setType(type);
|
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);
|
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) {
|
private void initFriendGriveAndRreward(int friendId, int uid, FriendManager friendManager, FriendManager friendfriendManager) {
|
||||||
|
Map<Integer, Integer> friendGiveMap = friendfriendManager.getGiveMap();
|
||||||
friendfriendManager.updateGiveMap(uid,0);
|
Map<Integer, Integer> friendHaveRewardMap = friendfriendManager.getHaveRewardMap();
|
||||||
friendfriendManager.updateHaveRewardMap(uid,0);
|
if (!friendGiveMap.containsKey(uid)){
|
||||||
friendManager.updateGiveMap(friendId,0);
|
friendfriendManager.updateGiveMap(uid,0);
|
||||||
friendManager.updateHaveRewardMap(friendId,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) {
|
private void delFriendInfo(int friendId, int uid, FriendManager friendManager, FriendManager friendManager1) {
|
||||||
friendManager1.delFriends(uid);
|
friendManager1.delFriends(uid);
|
||||||
friendManager1.delGiveMap(uid);
|
// friendManager1.delGiveMap(uid);
|
||||||
friendManager1.delHaveReward(uid);
|
// friendManager1.delHaveReward(uid);
|
||||||
friendManager.delFriends(friendId);
|
friendManager.delFriends(friendId);
|
||||||
friendManager.delGiveMap(friendId);
|
// friendManager.delGiveMap(friendId);
|
||||||
friendManager.delHaveReward(friendId);
|
// friendManager.delHaveReward(friendId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class MissionEventDistributor {
|
||||||
public static void init(){
|
public static void init(){
|
||||||
|
|
||||||
eventProcessor.put(GameEvent.VIP_LEVLUP,new VipLevelUpEventProcessor());
|
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<>();
|
List<MissionType> typeList = new ArrayList<>();
|
||||||
typeList.add(MissionType.RECRUITMENT_RANDOM_HEROES);
|
typeList.add(MissionType.RECRUITMENT_RANDOM_HEROES);
|
||||||
|
|
|
@ -14,21 +14,10 @@ import java.util.Map;
|
||||||
public class UserLevelEventProcessor implements BaseGameEventProcessor{
|
public class UserLevelEventProcessor implements BaseGameEventProcessor{
|
||||||
@Override
|
@Override
|
||||||
public void onGameEvent(User user, Map<GameMisionType, List<MissionStateChangeInfo>> misionTypeListMap, GameEvent event, Object... parm) throws Exception {
|
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);
|
List<MissionType> typeList = MissionEventDistributor.eventEnumListMap.get(event);
|
||||||
for (MissionType type : typeList) {
|
for (MissionType type : typeList) {
|
||||||
user.getUserMissionManager().calCumulationDataResult(user,type,misionTypeListMap,parm);
|
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