store
parent
1b7fd4fb56
commit
2ed3864e16
|
@ -9,6 +9,7 @@ import com.ljsd.jieling.battle.match.MatchServerice;
|
||||||
import com.ljsd.jieling.battle.room.BeanToProto;
|
import com.ljsd.jieling.battle.room.BeanToProto;
|
||||||
import com.ljsd.jieling.battle.room.Command;
|
import com.ljsd.jieling.battle.room.Command;
|
||||||
import com.ljsd.jieling.battle.room.SceneManager;
|
import com.ljsd.jieling.battle.room.SceneManager;
|
||||||
|
import com.ljsd.jieling.battle.statics.AnalysisData;
|
||||||
import com.ljsd.jieling.config.SBloodyBattleSetting;
|
import com.ljsd.jieling.config.SBloodyBattleSetting;
|
||||||
import com.ljsd.jieling.db.mongo.MongoUtil;
|
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
|
@ -48,6 +49,8 @@ public class Scene implements Runnable{
|
||||||
return minealForPosMap.remove(pos);
|
return minealForPosMap.remove(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Map<Integer, AnalysisData> analysisDataMap = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
public void randomMineralOfUserDeath(Creature creature,int totalMineal){
|
public void randomMineralOfUserDeath(Creature creature,int totalMineal){
|
||||||
if(totalMineal <=0){
|
if(totalMineal <=0){
|
||||||
|
@ -391,4 +394,8 @@ public class Scene implements Runnable{
|
||||||
public void setStartTime(long startTime) {
|
public void setStartTime(long startTime) {
|
||||||
this.startTime = startTime;
|
this.startTime = startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<Integer, AnalysisData> getAnalysisDataMap() {
|
||||||
|
return analysisDataMap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.ljsd.jieling.battle.statics;
|
||||||
|
|
||||||
|
public class AnalysisData {
|
||||||
|
private int id;
|
||||||
|
private int killNums; // 杀敌次数
|
||||||
|
private int deadNums; //死亡次数
|
||||||
|
private int diggerTimes; // 连续挖矿次数
|
||||||
|
private int continuousKillNums;//连续杀敌次数
|
||||||
|
private int continuousDeadNums;//连续死亡次数
|
||||||
|
|
||||||
|
public AnalysisData(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void win(){
|
||||||
|
killNums++;
|
||||||
|
continuousKillNums++;
|
||||||
|
continuousDeadNums=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fail(){
|
||||||
|
deadNums++;
|
||||||
|
continuousKillNums=0;
|
||||||
|
continuousDeadNums=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void digger(){
|
||||||
|
diggerTimes++;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.ljsd.jieling.battle.statics;
|
||||||
|
|
||||||
|
public enum AnalysisEventType {
|
||||||
|
BATTLE,
|
||||||
|
DIGGER,
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.ljsd.jieling.battle.statics;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.battle.actor.Scene;
|
||||||
|
|
||||||
|
public interface AnalysisProcessor {
|
||||||
|
|
||||||
|
void process(Scene scene,AnalysisSourceData analysisSourceData);
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.ljsd.jieling.battle.statics;
|
||||||
|
|
||||||
|
public class AnalysisSourceData {
|
||||||
|
|
||||||
|
private int targetId;
|
||||||
|
private int caster;
|
||||||
|
|
||||||
|
private int value; //参数
|
||||||
|
|
||||||
|
public AnalysisSourceData(int targetId, int caster, int value) {
|
||||||
|
this.targetId = targetId;
|
||||||
|
this.caster = caster;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTargetId() {
|
||||||
|
return targetId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCaster() {
|
||||||
|
return caster;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.ljsd.jieling.battle.statics;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.battle.actor.Scene;
|
||||||
|
|
||||||
|
public class BattleAnalysisProcessor implements AnalysisProcessor{
|
||||||
|
@Override
|
||||||
|
public void process(Scene scene, AnalysisSourceData analysisSourceData){
|
||||||
|
AnalysisData analysisData = scene.getAnalysisDataMap().get(analysisSourceData.getTargetId());
|
||||||
|
if(analysisSourceData.getValue() == 1){
|
||||||
|
analysisData.win();
|
||||||
|
}else{
|
||||||
|
analysisData.fail();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.ljsd.jieling.battle.statics;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.battle.actor.Scene;
|
||||||
|
|
||||||
|
public class DiggerAnalysisProcessor implements AnalysisProcessor{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void process(Scene scene, AnalysisSourceData analysisSourceData) {
|
||||||
|
AnalysisData analysisData = scene.getAnalysisDataMap().get(analysisSourceData.getTargetId());
|
||||||
|
analysisData.digger();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.ljsd.jieling.battle.statics;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class MessageBoxUtils {
|
||||||
|
private static Map<AnalysisEventType,AnalysisProcessor> analysisEventTypeIntegerMap = new HashMap<>();
|
||||||
|
static {
|
||||||
|
//更新统计数据 数据汇总聚合
|
||||||
|
analysisEventTypeIntegerMap.put(AnalysisEventType.BATTLE,new BattleAnalysisProcessor());
|
||||||
|
analysisEventTypeIntegerMap.put(AnalysisEventType.DIGGER,new DiggerAnalysisProcessor());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void onGameEvent(AnalysisEventType type){
|
||||||
|
AnalysisProcessor analysisProcessor = analysisEventTypeIntegerMap.get(type);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.ljsd.jieling.config;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.logic.STableManager;
|
||||||
|
import com.ljsd.jieling.logic.Table;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Table(name ="BloodyMessagesConfig")
|
||||||
|
public class SBloodyMessagesConfig implements BaseConfig {
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private int type;
|
||||||
|
|
||||||
|
private int count;
|
||||||
|
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCount() {
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -87,9 +87,7 @@ public class StoreLogic {
|
||||||
int uid = iSession.getUid();
|
int uid = iSession.getUid();
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
StoreManager storeManager = user.getStoreManager();
|
StoreManager storeManager = user.getStoreManager();
|
||||||
if (storeManager.getStoreInfoMap().size() == 0){
|
initStoreInfo(user,storeManager);
|
||||||
initStoreInfo(user,storeManager);
|
|
||||||
}
|
|
||||||
PlayerInfoProto.GetStoreInfosResponse.Builder builder = PlayerInfoProto.GetStoreInfosResponse.newBuilder();
|
PlayerInfoProto.GetStoreInfosResponse.Builder builder = PlayerInfoProto.GetStoreInfosResponse.newBuilder();
|
||||||
Map<Integer, StoreInfo> storeInfoMap = storeManager.getStoreInfoMap();
|
Map<Integer, StoreInfo> storeInfoMap = storeManager.getStoreInfoMap();
|
||||||
checkStoreRefresh(user,storeInfoMap);
|
checkStoreRefresh(user,storeInfoMap);
|
||||||
|
@ -223,6 +221,9 @@ public class StoreLogic {
|
||||||
Map<Integer, SStoreTypeConfig> sstoreTypeConfigMap = SStoreTypeConfig.getsStoreTypeConfigMap();
|
Map<Integer, SStoreTypeConfig> sstoreTypeConfigMap = SStoreTypeConfig.getsStoreTypeConfigMap();
|
||||||
for ( Map.Entry<Integer, SStoreTypeConfig> entry :sstoreTypeConfigMap.entrySet()){
|
for ( Map.Entry<Integer, SStoreTypeConfig> entry :sstoreTypeConfigMap.entrySet()){
|
||||||
SStoreTypeConfig sStoreTypeConfig = entry.getValue();
|
SStoreTypeConfig sStoreTypeConfig = entry.getValue();
|
||||||
|
if(storeManager.getStoreInfoMap().containsKey(sStoreTypeConfig.getId())){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (sStoreTypeConfig.getStoreOpenRule() == 1 && sStoreTypeConfig.getId() !=8){ //固定商店
|
if (sStoreTypeConfig.getStoreOpenRule() == 1 && sStoreTypeConfig.getId() !=8){ //固定商店
|
||||||
Map<Integer, Integer> itemNumMap = getStoreItem(sStoreTypeConfig.getId(),sStoreTypeConfig,user);
|
Map<Integer, Integer> itemNumMap = getStoreItem(sStoreTypeConfig.getId(),sStoreTypeConfig,user);
|
||||||
long startTime = 0;
|
long startTime = 0;
|
||||||
|
|
Loading…
Reference in New Issue