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