Merge branch 'master_test_gn' of http://60.1.1.230/backend/jieling_server into master_test_gn

back_recharge
xuexinpeng 2021-06-10 18:19:28 +08:00
commit d2bac109f6
3 changed files with 11 additions and 11 deletions

View File

@ -1185,7 +1185,7 @@ public class GuildLogic {
if(redPacket.getRuleType() != 1){
map.put(redId,-1);
if(redPacket.getRuleType() == 3){
openNext(map,redPacket.getGroupId(),redId);
openNext(map,redPacket.getRuleId()[0],redId);
}
}else{
map.put(redId,old-1);
@ -1247,7 +1247,7 @@ public class GuildLogic {
}
break;
case 3:
List<SGuildRedPackConfig> serise = SGuildRedPackConfig.welfareRedPackBySerise.get(config.getGroupId());
List<SGuildRedPackConfig> serise = SGuildRedPackConfig.welfareRedPackBySerise.get(config.getRuleId()[0]);
serise.stream().sorted((v1,v2)->{
if(v1.getId()>v2.getId()){
return -1;
@ -1281,9 +1281,7 @@ public class GuildLogic {
public static void sendWelfareRedPacketInfo(User user){
Map<Integer,Integer> redPacketsMap = user.getPlayerInfoManager().getWelfareRedPackets();
if(redPacketsMap.size() == 0){//初始化
initWelfareRedPacketInfo(user);
}
initWelfareRedPacketInfo(user);
PlayerInfoProto.WelfareRedPacketPush.Builder build = PlayerInfoProto.WelfareRedPacketPush.newBuilder();
for(Map.Entry<Integer,Integer> entry : redPacketsMap.entrySet()){
if(entry.getValue() >= 0){
@ -1312,10 +1310,12 @@ public class GuildLogic {
public static void initWelfareRedPacketInfo(User user){
Map<Integer,Integer> redPacketsMap = user.getPlayerInfoManager().getWelfareRedPackets();
for(SGuildRedPackConfig config : SGuildRedPackConfig.sWelfareRedPackByRule.values()){
if(redPacketsMap.containsKey(config.getId()))
continue;
if(config.getRuleType() == 3){
if(config.getGroupId() == 2){
int num = user.getMapManager().getLastMonsterAttack();
for(SGuildRedPackConfig config1 : SGuildRedPackConfig.welfareRedPackBySerise.get(config.getGroupId())){
for(SGuildRedPackConfig config1 : SGuildRedPackConfig.welfareRedPackBySerise.get(config.getRuleId()[0])){
if(num >= config1.getRuleId()[1]){
redPacketsMap.put(config.getId(),1);
}else{
@ -1324,7 +1324,7 @@ public class GuildLogic {
}
}
}else{
if(config.getId()==SGuildRedPackConfig.welfareRedPackBySerise.get(config.getGroupId()).get(0).getId())
if(config.getId()==SGuildRedPackConfig.welfareRedPackBySerise.get(config.getRuleId()[0]).get(0).getId())
redPacketsMap.put(config.getId(),0);
}
}else{

View File

@ -23,7 +23,7 @@ public class WelfareRedPackSendHandler implements IEventHandler {
SGuildRedPackConfig sGuildRedPackConfig = SGuildRedPackConfig.sWelfareRedPackByRule.get(directEvent.getType());
if(sGuildRedPackConfig.getRuleType() == 3){
boolean f = false;
for(SGuildRedPackConfig config : SGuildRedPackConfig.welfareRedPackBySerise.get(sGuildRedPackConfig.getGroupId())){
for(SGuildRedPackConfig config : SGuildRedPackConfig.welfareRedPackBySerise.get(sGuildRedPackConfig.getRuleId()[0])){
if(config.getRuleId()[1] == directEvent.getNum()){
sGuildRedPackConfig = config;
f=true;

View File

@ -70,12 +70,12 @@ public class SGuildRedPackConfig implements BaseConfig {
sWelfareRedPackByRule.put(entry.getValue().getRuleId()[0],entry.getValue());
}
if(entry.getValue().getRuleType() == 3){
if(welfareRedPackBySerise.containsKey(entry.getValue().getGroupId())){
welfareRedPackBySerise.get(entry.getValue().getGroupId()).add(entry.getValue());
if(welfareRedPackBySerise.containsKey(entry.getValue().getRuleId()[0])){
welfareRedPackBySerise.get(entry.getValue().getRuleId()[0]).add(entry.getValue());
}else{
List<SGuildRedPackConfig> list = new ArrayList<>();
list.add(entry.getValue());
welfareRedPackBySerise.put(entry.getValue().getGroupId(),list);
welfareRedPackBySerise.put(entry.getValue().getRuleId()[0],list);
}
}
}