命石日志
parent
242799ffe2
commit
83634c822e
|
@ -5,6 +5,10 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.event.GemLotteryNumEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
|
@ -27,6 +31,19 @@ public class GemChestActivity extends AbstractActivity {
|
|||
|
||||
GemChestActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, GemLotteryNumEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
if (!(event instanceof GemLotteryNumEvent)) {
|
||||
return;
|
||||
}
|
||||
GemLotteryNumEvent event1 = (GemLotteryNumEvent) event;
|
||||
User user = UserManager.getUser(event1.getUid());
|
||||
// 客户端推送
|
||||
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||
sendActivityProgress(session, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
public class GemLotteryNumEvent implements IEvent {
|
||||
private int uid;
|
||||
|
||||
public GemLotteryNumEvent(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ import com.ljsd.jieling.exception.ErrorCode;
|
|||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||
import com.ljsd.jieling.logic.activity.event.GemLotteryNumEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SaveHeroForceEvent;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
|
@ -295,9 +296,11 @@ public class EquipLogic {
|
|||
for (int i = 0; i < count; i++) {
|
||||
oneGemLottery(user, libraryId, drop);
|
||||
}
|
||||
sendGemNewIndication(iSession);
|
||||
PlayerInfoProto.GemNewDrawResponse.Builder builder = PlayerInfoProto.GemNewDrawResponse.newBuilder().setDrop(drop);
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GemNewDrawResponse_VALUE, builder.build(), true);
|
||||
|
||||
sendGemNewIndication(iSession);
|
||||
Poster.getPoster().dispatchEvent(new GemLotteryNumEvent(user.getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -375,6 +378,7 @@ public class EquipLogic {
|
|||
indexOfNum = i;
|
||||
}
|
||||
}
|
||||
LOGGER.info("宝石抽奖,每日抽奖次数判断======================:{}",indexOfNum);
|
||||
|
||||
// 品质概率判断
|
||||
int[] quality = config.getQualityProbability()[indexOfNum];
|
||||
|
@ -388,6 +392,8 @@ public class EquipLogic {
|
|||
}
|
||||
int level = config.getGemLevel()[indexOfQuality];
|
||||
|
||||
LOGGER.info("宝石抽奖,品质概率判断======================:{}",level);
|
||||
|
||||
// 类型概率判断
|
||||
int[] typeProbability = config.getGemTypeProbability();
|
||||
int typeTotalWeight = Arrays.stream(typeProbability).sum();
|
||||
|
@ -400,6 +406,8 @@ public class EquipLogic {
|
|||
}
|
||||
int type = config.getGemType()[indexOfType];
|
||||
|
||||
LOGGER.info("宝石抽奖,类型概率判断======================:{}",type);
|
||||
|
||||
// 获取到具体宝石
|
||||
SGemConfigNew gemConfigNew = SGemConfigNew.typeMap.get(type).get(level);
|
||||
|
||||
|
|
Loading…
Reference in New Issue