幸运探宝
parent
b98fd6b273
commit
13cb402343
|
@ -132,6 +132,9 @@ public class SimpleTransaction {
|
|||
tasks.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 合并策略后的协议先发
|
||||
*/
|
||||
private void doAddSendCache() {
|
||||
for (Map.Entry<Integer, MessageUtil.CombinePolicy> entry : combineMsgId.entrySet()) {
|
||||
if (sendCacheMap.containsKey(entry.getKey())) {
|
||||
|
|
|
@ -20,6 +20,8 @@ import com.ljsd.jieling.util.ItemUtil;
|
|||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Description: 随机转盘奖励
|
||||
* Author: zsx
|
||||
|
@ -63,6 +65,7 @@ public class GetLuckWheelRandHandler extends BaseHandler<PlayerInfoProto.GetLuck
|
|||
int time = proto.getRepeated() ? sDialRewardSetting.getExtractingTime():1;
|
||||
int luckId;
|
||||
int lastpos=1;
|
||||
Set<Integer> posSet = new HashSet<>();
|
||||
|
||||
int[][] drops = new int[time][];
|
||||
for (int i = 0; i < time; i++) {
|
||||
|
@ -71,16 +74,28 @@ public class GetLuckWheelRandHandler extends BaseHandler<PlayerInfoProto.GetLuck
|
|||
drops[i] = sDialRewardConfig.getReward();
|
||||
//upprocess
|
||||
lastpos = sDialRewardConfig.getPoolId();
|
||||
posSet.add(lastpos);
|
||||
LuckWheelPosInfo luckWheelPosInfo = luckWheelMission.getPosInfoMap().get(lastpos);
|
||||
luckWheelPosInfo.addProgrss();
|
||||
luckWheelMission.upPosInfo(lastpos, luckWheelPosInfo);
|
||||
}
|
||||
int dropReson = sGlobalActivity.getType() == 30 ? BIReason.LUCK_WHEEl_REWARD : BIReason.LUCK_WHEEl_ADVANCE_REWARD;
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, drops, dropReson);
|
||||
|
||||
List<CommonProto.LuckWheelRewardPosInfo> rewardPosInfoList = new LinkedList<>();
|
||||
for (Integer pos : posSet) {
|
||||
LuckWheelPosInfo luckWheelPosInfo = luckWheelMission.getPosInfoMap().get(pos);
|
||||
CommonProto.LuckWheelRewardPosInfo.Builder builder = CommonProto.LuckWheelRewardPosInfo.newBuilder();
|
||||
builder.setLuckId(luckWheelPosInfo.getLuckId());
|
||||
builder.setPos(pos);
|
||||
builder.setLuckTimes(luckWheelPosInfo.getProgrss());
|
||||
rewardPosInfoList.add(builder.build());
|
||||
}
|
||||
|
||||
PlayerInfoProto.GetLuckWheelRandRewardResponse.Builder builder = PlayerInfoProto.GetLuckWheelRandRewardResponse.newBuilder();
|
||||
builder.setActivityId(proto.getActivityId());
|
||||
builder.setDrop(drop);
|
||||
builder.setPos(lastpos);
|
||||
builder.addAllPosInfos(rewardPosInfoList);
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_LUCKWHEEL_RANDREWARD_RESPONSE_VALUE, builder.build(), true);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
package com.ljsd.jieling.logic;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
|
@ -15,8 +11,6 @@ public class OnlineUserManager {
|
|||
|
||||
public static Map<Integer, ISession> sessionMap = new ConcurrentHashMap<>();
|
||||
|
||||
public static Map<Integer, PlayerManager> onlineUserMap = new ConcurrentHashMap<>(10000);
|
||||
|
||||
public static void userOnline(int uid, ISession session) {
|
||||
sessionMap.put(uid, session);
|
||||
}
|
||||
|
@ -35,19 +29,6 @@ public class OnlineUserManager {
|
|||
sessionMap.remove(uid);
|
||||
}
|
||||
|
||||
|
||||
public static void addPlayerToMap(int uid, PlayerManager player) {
|
||||
onlineUserMap.putIfAbsent(uid,player);
|
||||
}
|
||||
|
||||
public static void removePlayerFromMap(int uid) {
|
||||
onlineUserMap.remove(uid);
|
||||
}
|
||||
|
||||
public static PlayerManager getPlayerFromMap(int uid) {
|
||||
return onlineUserMap.get(uid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过uid获取Session
|
||||
* @param uid
|
||||
|
|
|
@ -84,7 +84,7 @@ class ForceRankActivity extends AbstractActivity {
|
|||
if (activityMission == null || activityMission.getActivityState() != ActivityType.OPEN_STATE || activityMission.getOpenType() == 0) {
|
||||
continue;
|
||||
}
|
||||
int missionId = rank2miss.get(rank++);
|
||||
int missionId = rank2miss.get(rank);
|
||||
ActivityProgressInfo activityProgressInfo = activityMission.getActivityProgressInfoMap().get(missionId);
|
||||
if (activityProgressInfo == null || activityProgressInfo.getState() == ActivityType.HAD_TAKED) {
|
||||
continue;
|
||||
|
@ -105,6 +105,7 @@ class ForceRankActivity extends AbstractActivity {
|
|||
String content = SErrorCodeEerverConfig.getI18NMessage("powerrank_activity_txt", new Object[]{rank});
|
||||
String mailReward = ItemUtil.getMailReward(sActivityRewardConfig.getReward());
|
||||
MailLogic.getInstance().sendMail(uid, title, content, mailReward, nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||
rank++;
|
||||
//暂时不删
|
||||
// RedisUtil.getInstence().del(key);
|
||||
}
|
||||
|
|
|
@ -91,12 +91,13 @@ public abstract class LuckWheelActivity extends AbstractActivity {
|
|||
LuckWheelMission luckWheelMission = user.getActivityManager().getLuckWheel(type);
|
||||
for (Map.Entry<Integer, LuckWheelPosInfo> entry : luckWheelMission.getPosInfoMap().entrySet()) {
|
||||
int luckId = entry.getValue().getLuckId();
|
||||
int limitnum = SDialRewardConfig.getsDialRewardConfigMap().get(luckId).getLimitNum();
|
||||
if (limitnum != 0 && entry.getValue().getProgrss() >= SDialRewardConfig.getsDialRewardConfigMap().get(luckId).getLimitNum())
|
||||
continue;
|
||||
// int limitnum = SDialRewardConfig.getsDialRewardConfigMap().get(luckId).getLimitNum();
|
||||
// if (limitnum != 0 && entry.getValue().getProgrss() >= SDialRewardConfig.getsDialRewardConfigMap().get(luckId).getLimitNum())
|
||||
// continue;
|
||||
CommonProto.LuckWheelRewardPosInfo.Builder builder = CommonProto.LuckWheelRewardPosInfo.newBuilder();
|
||||
builder.setLuckId(entry.getValue().getLuckId());
|
||||
builder.setPos(entry.getKey());
|
||||
builder.setLuckTimes(entry.getValue().getProgrss());
|
||||
rewardPosInfoList.add(builder.build());
|
||||
}
|
||||
return rewardPosInfoList;
|
||||
|
|
|
@ -26,7 +26,7 @@ public class LuckWheelPosInfo {
|
|||
}
|
||||
|
||||
public void addProgrss() {
|
||||
this.progrss = +1;
|
||||
this.progrss +=1;
|
||||
}
|
||||
|
||||
public int getLuckId() {
|
||||
|
|
Loading…
Reference in New Issue