跨服,玩家信息和排行初版
parent
870f5eea52
commit
7f7223ee10
|
@ -320,6 +320,7 @@ public class RedisKey {
|
||||||
|
|
||||||
public static final String SERVER_SPLIT_INFO = "SERVER_SPLIT_INFO";
|
public static final String SERVER_SPLIT_INFO = "SERVER_SPLIT_INFO";
|
||||||
|
|
||||||
|
public static final String CROSS_SERVICE_ARENA = "CROSS_SERVICE_ARENA";
|
||||||
|
|
||||||
public static Set<String> familyKey = new HashSet<>();
|
public static Set<String> familyKey = new HashSet<>();
|
||||||
|
|
||||||
|
|
|
@ -1246,7 +1246,8 @@ public class RedisUtil {
|
||||||
// return GameApplication.serverProperties.getAreaId()+ RedisKey.Delimiter_colon+type + RedisKey.Delimiter_colon+key;
|
// return GameApplication.serverProperties.getAreaId()+ RedisKey.Delimiter_colon+type + RedisKey.Delimiter_colon+key;
|
||||||
// }
|
// }
|
||||||
if(RedisKey.TOKEN.equals(type)||RedisKey.USER_SERVER_INFO.equals(type)||
|
if(RedisKey.TOKEN.equals(type)||RedisKey.USER_SERVER_INFO.equals(type)||
|
||||||
RedisKey.CDKEY.equals(type)||RedisKey.ServerArenaJob.equals(type)){
|
RedisKey.CDKEY.equals(type)||RedisKey.ServerArenaJob.equals(type)||
|
||||||
|
RedisKey.CROSS_SERVICE_ARENA.equals(type)){
|
||||||
return type + RedisKey.Delimiter_colon + key;
|
return type + RedisKey.Delimiter_colon + key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,107 @@
|
||||||
|
package com.ljsd.jieling.logic.activity.crossService;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.core.GlobalsDef;
|
||||||
|
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||||
|
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
||||||
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
|
import com.ljsd.jieling.logic.dao.gm.ArenaOfUser;
|
||||||
|
import com.ljsd.jieling.logic.dao.gm.CoreOfServerInfo;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||||
|
import org.springframework.data.mongodb.core.query.Criteria;
|
||||||
|
import org.springframework.data.mongodb.core.query.Query;
|
||||||
|
import org.springframework.data.mongodb.core.query.Update;
|
||||||
|
|
||||||
|
import java.net.UnknownHostException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author hj
|
||||||
|
* @Date 2021/6/17 18:17
|
||||||
|
* @Description: 跨服功能类
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class CrossServiceLogic {
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(ArenaLogic.class);
|
||||||
|
|
||||||
|
private CrossServiceLogic(){}
|
||||||
|
|
||||||
|
public static class Instance {
|
||||||
|
public final static CrossServiceLogic instance = new CrossServiceLogic();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CrossServiceLogic getInstance() {
|
||||||
|
return CrossServiceLogic.Instance.instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String findServerName(int serverId) throws UnknownHostException {
|
||||||
|
MongoTemplate core = MongoUtil.getCoreMongoTemplate();
|
||||||
|
Query query = new Query();
|
||||||
|
query.addCriteria(Criteria.where("server_id").is(String.valueOf(serverId)));
|
||||||
|
return core.findOne(query, CoreOfServerInfo.class).getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insert(User user) throws UnknownHostException {
|
||||||
|
ArenaOfUser arenaOfUser = new ArenaOfUser(user);
|
||||||
|
MongoTemplate core = MongoUtil.getCoreMongoTemplate();
|
||||||
|
core.insert(arenaOfUser,"arenaOfUser");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void update(ArenaOfUser arenaOfUser) throws Exception {
|
||||||
|
MongoTemplate core = MongoUtil.getCoreMongoTemplate();
|
||||||
|
// 根据id查询
|
||||||
|
Query query = new Query(Criteria.where("_id").is(arenaOfUser.getId()));
|
||||||
|
// 修改的参数
|
||||||
|
Update update = new Update();
|
||||||
|
update.set("arenaOfPlayerManager",arenaOfUser.getPlayerManager());
|
||||||
|
update.set("arenaOfHeroManager",arenaOfUser.getHeroManager());
|
||||||
|
update.set("arenaOfPokemons",arenaOfUser.getPokemons());
|
||||||
|
update.set("arenaOfSeals",arenaOfUser.getSeals());
|
||||||
|
update.set("arenaOfGuildSkill",arenaOfUser.getGuildSkill());
|
||||||
|
core.updateMulti(query, update, ArenaOfUser.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArenaOfUser query(int uid) throws UnknownHostException {
|
||||||
|
MongoTemplate core = MongoUtil.getCoreMongoTemplate();
|
||||||
|
Query query = new Query();
|
||||||
|
query.addCriteria(Criteria.where("_id").is(uid));
|
||||||
|
return core.findOne(query, ArenaOfUser.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算战力
|
||||||
|
* @param arenaOfUser
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
private void countForce(ArenaOfUser arenaOfUser) throws Exception {
|
||||||
|
User user = UserManager.getUser(arenaOfUser.getId());
|
||||||
|
int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.WORLD_TEAM_ARENA_DEFENSE, false);
|
||||||
|
arenaOfUser.getHeroManager().setTotalForce(totalForce);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理跨服数据
|
||||||
|
* @param user
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void dispose(User user) throws Exception{
|
||||||
|
|
||||||
|
ArenaOfUser query = query(user.getId());
|
||||||
|
// 添加
|
||||||
|
if (query == null){
|
||||||
|
insert(user);
|
||||||
|
}
|
||||||
|
// 更新
|
||||||
|
else {
|
||||||
|
// 获取新的跨服用户信息
|
||||||
|
ArenaOfUser arenaOfUser = new ArenaOfUser(user);
|
||||||
|
// 计算战力
|
||||||
|
countForce(arenaOfUser);
|
||||||
|
// 更新数据
|
||||||
|
update(arenaOfUser);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -14,7 +14,7 @@ import org.slf4j.LoggerFactory;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public class Equip extends PropertyItem implements Cloneable{
|
public class Equip extends PropertyItem{
|
||||||
private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(Equip.class);
|
private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(Equip.class);
|
||||||
|
|
||||||
private int rebuildLevel;
|
private int rebuildLevel;
|
||||||
|
@ -320,9 +320,4 @@ public class Equip extends PropertyItem implements Cloneable{
|
||||||
updateString("rebuildLevel",rebuildLevel);
|
updateString("rebuildLevel",rebuildLevel);
|
||||||
this.rebuildLevel = rebuildLevel;
|
this.rebuildLevel = rebuildLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object clone() throws CloneNotSupportedException {
|
|
||||||
return (Equip) super.clone();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class Hero extends MongoBase implements Comparable<Hero> {
|
public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(Hero.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(Hero.class);
|
||||||
private String id;
|
private String id;
|
||||||
|
@ -31,9 +31,9 @@ public class Hero extends MongoBase implements Comparable<Hero> {
|
||||||
|
|
||||||
private int star;
|
private int star;
|
||||||
|
|
||||||
private Map<Integer,Integer> equipByPositionMap;
|
private Map<Integer,Integer> equipByPositionMap = new HashMap<>();
|
||||||
|
|
||||||
private Map<Integer,Integer> soulEquipByPositionMap;
|
private Map<Integer,Integer> soulEquipByPositionMap = new HashMap<>();
|
||||||
|
|
||||||
private int breakId;
|
private int breakId;
|
||||||
|
|
||||||
|
@ -463,4 +463,20 @@ public class Hero extends MongoBase implements Comparable<Hero> {
|
||||||
}
|
}
|
||||||
return Integer.compare(o.getStar(), this.getStar());
|
return Integer.compare(o.getStar(), this.getStar());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone(){
|
||||||
|
Hero clone = null;
|
||||||
|
try {
|
||||||
|
clone = (Hero) super.clone();
|
||||||
|
|
||||||
|
clone.equipByPositionMap = new HashMap<>(clone.equipByPositionMap);
|
||||||
|
clone.soulEquipByPositionMap = new HashMap<>(clone.soulEquipByPositionMap);
|
||||||
|
clone.jewelInfo = new HashSet<>(clone.jewelInfo);
|
||||||
|
} catch (CloneNotSupportedException e) {
|
||||||
|
LOGGER.error("英雄克隆失败........");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class Pokemon extends MongoBase {
|
public class Pokemon extends MongoBase implements Cloneable {
|
||||||
|
|
||||||
private int tmpId;
|
private int tmpId;
|
||||||
|
|
||||||
|
@ -94,5 +94,15 @@ public class Pokemon extends MongoBase {
|
||||||
// updateString("comonpentsLevelMap",new HashMap<>());
|
// updateString("comonpentsLevelMap",new HashMap<>());
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone(){
|
||||||
|
Pokemon clone = null;
|
||||||
|
try {
|
||||||
|
clone = (Pokemon) super.clone();
|
||||||
|
} catch (CloneNotSupportedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,11 @@ package com.ljsd.jieling.logic.dao;
|
||||||
|
|
||||||
import com.ljsd.common.mogodb.MongoBase;
|
import com.ljsd.common.mogodb.MongoBase;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class PropertyItem extends MongoBase {
|
public class PropertyItem extends MongoBase implements Cloneable {
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
private int equipId;
|
private int equipId;
|
||||||
|
@ -120,4 +122,18 @@ public class PropertyItem extends MongoBase {
|
||||||
updateString("isLocked", isLocked);
|
updateString("isLocked", isLocked);
|
||||||
this.isLocked = isLocked;
|
this.isLocked = isLocked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
PropertyItem clone = null;
|
||||||
|
try {
|
||||||
|
clone = (PropertyItem) super.clone();
|
||||||
|
|
||||||
|
clone.propertyValueByIdMap = new HashMap<>(clone.propertyValueByIdMap);
|
||||||
|
clone.secondValueByIdMap = new HashMap<>(clone.secondValueByIdMap);
|
||||||
|
} catch (CloneNotSupportedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,180 @@
|
||||||
|
package com.ljsd.jieling.logic.dao.gm;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.logic.dao.Hero;
|
||||||
|
import com.ljsd.jieling.logic.dao.HeroManager;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author hj
|
||||||
|
* @Date 2021/6/17 16:49
|
||||||
|
* @Description:
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class ArenaOfHero {
|
||||||
|
private String id;
|
||||||
|
private int templateId; //模板ID
|
||||||
|
private int level;//等级
|
||||||
|
private int star;
|
||||||
|
private Map<Integer,Integer> equipByPositionMap = new HashMap<>();
|
||||||
|
private Map<Integer,Integer> soulEquipByPositionMap = new HashMap<>();
|
||||||
|
private int breakId;
|
||||||
|
private int starBreakId;
|
||||||
|
private int createTime;
|
||||||
|
private int lastUpdateEnergyTime;
|
||||||
|
private int speed;
|
||||||
|
private int especialEquipLevel;
|
||||||
|
private int isLock;
|
||||||
|
private int createType;
|
||||||
|
private int changeId;
|
||||||
|
private Set<String> jewelInfo = new HashSet<>();
|
||||||
|
|
||||||
|
public ArenaOfHero(User user, Hero hero) {
|
||||||
|
HeroManager heroManager = user.getHeroManager();
|
||||||
|
this.id = hero.getId();
|
||||||
|
this.templateId = hero.getTemplateId();
|
||||||
|
this.level = hero.getLevel(heroManager);
|
||||||
|
this.star = hero.getStar();
|
||||||
|
this.equipByPositionMap = new HashMap<>(hero.getEquipByHongmengPositionMap(heroManager));
|
||||||
|
this.soulEquipByPositionMap = new HashMap<>(hero.getSoulEquipByPositionMap());
|
||||||
|
this.breakId = hero.getBreakIdByHongMeng(heroManager);
|
||||||
|
this.starBreakId = hero.getStarBreakId();
|
||||||
|
this.createTime = hero.getCreateTime();
|
||||||
|
this.lastUpdateEnergyTime = hero.getLastUpdateEnergyTime();
|
||||||
|
this.speed = hero.getSpeed();
|
||||||
|
this.especialEquipLevel = hero.getEspecialEquipLevelByHongmeng(heroManager,hero.getId());
|
||||||
|
this.isLock = hero.getIsLock();
|
||||||
|
this.createType = hero.getCreateType();
|
||||||
|
this.changeId = hero.getChangeId();
|
||||||
|
this.jewelInfo = new HashSet<>(hero.getJewelInfo());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTemplateId() {
|
||||||
|
return templateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTemplateId(int templateId) {
|
||||||
|
this.templateId = templateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLevel() {
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLevel(int level) {
|
||||||
|
this.level = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStar() {
|
||||||
|
return star;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStar(int star) {
|
||||||
|
this.star = star;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<Integer, Integer> getEquipByPositionMap() {
|
||||||
|
return equipByPositionMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEquipByPositionMap(Map<Integer, Integer> equipByPositionMap) {
|
||||||
|
this.equipByPositionMap = equipByPositionMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<Integer, Integer> getSoulEquipByPositionMap() {
|
||||||
|
return soulEquipByPositionMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSoulEquipByPositionMap(Map<Integer, Integer> soulEquipByPositionMap) {
|
||||||
|
this.soulEquipByPositionMap = soulEquipByPositionMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBreakId() {
|
||||||
|
return breakId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBreakId(int breakId) {
|
||||||
|
this.breakId = breakId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStarBreakId() {
|
||||||
|
return starBreakId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStarBreakId(int starBreakId) {
|
||||||
|
this.starBreakId = starBreakId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(int createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLastUpdateEnergyTime() {
|
||||||
|
return lastUpdateEnergyTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastUpdateEnergyTime(int lastUpdateEnergyTime) {
|
||||||
|
this.lastUpdateEnergyTime = lastUpdateEnergyTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSpeed() {
|
||||||
|
return speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpeed(int speed) {
|
||||||
|
this.speed = speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getEspecialEquipLevel() {
|
||||||
|
return especialEquipLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEspecialEquipLevel(int especialEquipLevel) {
|
||||||
|
this.especialEquipLevel = especialEquipLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIsLock() {
|
||||||
|
return isLock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsLock(int isLock) {
|
||||||
|
this.isLock = isLock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCreateType() {
|
||||||
|
return createType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateType(int createType) {
|
||||||
|
this.createType = createType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getChangeId() {
|
||||||
|
return changeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChangeId(int changeId) {
|
||||||
|
this.changeId = changeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<String> getJewelInfo() {
|
||||||
|
return jewelInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJewelInfo(Set<String> jewelInfo) {
|
||||||
|
this.jewelInfo = jewelInfo;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,87 @@
|
||||||
|
package com.ljsd.jieling.logic.dao.gm;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.core.GlobalsDef;
|
||||||
|
import com.ljsd.jieling.logic.dao.Hero;
|
||||||
|
import com.ljsd.jieling.logic.dao.PropertyItem;
|
||||||
|
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
|
import org.springframework.data.mongodb.core.mapping.Field;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author hj
|
||||||
|
* @Date 2021/6/18 14:51
|
||||||
|
* @Description:
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class ArenaOfHeroManager {
|
||||||
|
|
||||||
|
private Map<Integer, List<TeamPosHeroInfo>> teams = new HashMap<>();
|
||||||
|
|
||||||
|
private Map<String,ArenaOfHero> heros = new HashMap<>();
|
||||||
|
|
||||||
|
private Map<String, PropertyItem> jewels = new HashMap<>();
|
||||||
|
|
||||||
|
private int totalForce;
|
||||||
|
|
||||||
|
public ArenaOfHeroManager(User user) {
|
||||||
|
// 阵容信息
|
||||||
|
teams = new HashMap<>();
|
||||||
|
List<TeamPosHeroInfo> infos =
|
||||||
|
user.getTeamPosManager().getTeamPosForHero().getOrDefault(GlobalsDef.WORLD_TEAM_ARENA_DEFENSE,new ArrayList<>());
|
||||||
|
teams.put(GlobalsDef.WORLD_TEAM_ARENA_DEFENSE,infos);
|
||||||
|
// 英雄
|
||||||
|
heros = new HashMap<>();
|
||||||
|
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||||
|
infos.forEach(v->{
|
||||||
|
Hero hero = heroMap.get(v.getHeroId());
|
||||||
|
heros.put(v.getHeroId(),new ArenaOfHero(user,hero));
|
||||||
|
});
|
||||||
|
// 魂宝灵宝
|
||||||
|
jewels = new HashMap<>();
|
||||||
|
Map<String, PropertyItem> equipMap = user.getEquipManager().getEquipMap();
|
||||||
|
heroMap.values().forEach(v-> v.getJewelInfo().forEach(v2->{
|
||||||
|
PropertyItem item = (PropertyItem)equipMap.get(v2).clone();
|
||||||
|
jewels.put(v2,item);
|
||||||
|
}));
|
||||||
|
// 总战力
|
||||||
|
totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.WORLD_TEAM_ARENA_DEFENSE,false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<Integer, List<TeamPosHeroInfo>> getTeams() {
|
||||||
|
return teams;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTeams(Map<Integer, List<TeamPosHeroInfo>> teams) {
|
||||||
|
this.teams = teams;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, ArenaOfHero> getHeros() {
|
||||||
|
return heros;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeros(Map<String, ArenaOfHero> heros) {
|
||||||
|
this.heros = heros;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, PropertyItem> getJewels() {
|
||||||
|
return jewels;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJewels(Map<String, PropertyItem> jewels) {
|
||||||
|
this.jewels = jewels;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotalForce() {
|
||||||
|
return totalForce;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalForce(int totalForce) {
|
||||||
|
this.totalForce = totalForce;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,83 +0,0 @@
|
||||||
package com.ljsd.jieling.logic.dao.gm;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author hj
|
|
||||||
* @Date 2021/6/17 15:16
|
|
||||||
* @Description: gm用玩家信息
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
public class ArenaOfPlayer {
|
|
||||||
|
|
||||||
private int uId;
|
|
||||||
private int level;
|
|
||||||
private String name;
|
|
||||||
private int head;
|
|
||||||
private int headFrame;
|
|
||||||
private String guildName;
|
|
||||||
private int userTitle;
|
|
||||||
private int practiceLevel;
|
|
||||||
|
|
||||||
public int getuId() {
|
|
||||||
return uId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setuId(int uId) {
|
|
||||||
this.uId = uId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getLevel() {
|
|
||||||
return level;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLevel(int level) {
|
|
||||||
this.level = level;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getHead() {
|
|
||||||
return head;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHead(int head) {
|
|
||||||
this.head = head;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getHeadFrame() {
|
|
||||||
return headFrame;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHeadFrame(int headFrame) {
|
|
||||||
this.headFrame = headFrame;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGuildName() {
|
|
||||||
return guildName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGuildName(String guildName) {
|
|
||||||
this.guildName = guildName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getUserTitle() {
|
|
||||||
return userTitle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserTitle(int userTitle) {
|
|
||||||
this.userTitle = userTitle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getPracticeLevel() {
|
|
||||||
return practiceLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPracticeLevel(int practiceLevel) {
|
|
||||||
this.practiceLevel = practiceLevel;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,135 @@
|
||||||
|
package com.ljsd.jieling.logic.dao.gm;
|
||||||
|
|
||||||
|
import com.ljsd.GameApplication;
|
||||||
|
import com.ljsd.jieling.core.GlobalsDef;
|
||||||
|
import com.ljsd.jieling.db.redis.RedisKey;
|
||||||
|
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||||
|
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||||
|
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||||
|
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
|
|
||||||
|
import java.net.UnknownHostException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author hj
|
||||||
|
* @Date 2021/6/17 15:16
|
||||||
|
* @Description: gm用玩家信息
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class ArenaOfPlayerManager {
|
||||||
|
|
||||||
|
private int uId;
|
||||||
|
private int level;
|
||||||
|
private String name;
|
||||||
|
private int head;
|
||||||
|
private int headFrame;
|
||||||
|
private String guildName;
|
||||||
|
private int userTitle;
|
||||||
|
private int practiceLevel;
|
||||||
|
private int serverId;
|
||||||
|
private String serverName;
|
||||||
|
|
||||||
|
public ArenaOfPlayerManager(User user) throws UnknownHostException {
|
||||||
|
PlayerManager player = user.getPlayerInfoManager();
|
||||||
|
int guildId = player.getGuildId();
|
||||||
|
|
||||||
|
this.uId = user.getId();
|
||||||
|
this.level = player.getLevel();
|
||||||
|
this.name = player.getNickName();
|
||||||
|
this.head = player.getHead();
|
||||||
|
this.headFrame = player.getHeadFrame();
|
||||||
|
if (guildId == 0){
|
||||||
|
this.guildName = "";
|
||||||
|
}else {
|
||||||
|
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||||
|
this.guildName = guildInfo.getName();
|
||||||
|
}
|
||||||
|
this.userTitle = player.getUserTitle();
|
||||||
|
this.practiceLevel = user.getHeroManager().getPracticeLevel();
|
||||||
|
this.serverId = GameApplication.serverId;
|
||||||
|
this.serverName = CrossServiceLogic.getInstance().findServerName(serverId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getuId() {
|
||||||
|
return uId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setuId(int uId) {
|
||||||
|
this.uId = uId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLevel() {
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLevel(int level) {
|
||||||
|
this.level = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getHead() {
|
||||||
|
return head;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHead(int head) {
|
||||||
|
this.head = head;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getHeadFrame() {
|
||||||
|
return headFrame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeadFrame(int headFrame) {
|
||||||
|
this.headFrame = headFrame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGuildName() {
|
||||||
|
return guildName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGuildName(String guildName) {
|
||||||
|
this.guildName = guildName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUserTitle() {
|
||||||
|
return userTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserTitle(int userTitle) {
|
||||||
|
this.userTitle = userTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPracticeLevel() {
|
||||||
|
return practiceLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPracticeLevel(int practiceLevel) {
|
||||||
|
this.practiceLevel = practiceLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getServerId() {
|
||||||
|
return serverId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setServerId(int serverId) {
|
||||||
|
this.serverId = serverId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getServerName() {
|
||||||
|
return serverName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setServerName(String serverName) {
|
||||||
|
this.serverName = serverName;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,24 +1,110 @@
|
||||||
package com.ljsd.jieling.logic.dao.gm;
|
package com.ljsd.jieling.logic.dao.gm;
|
||||||
|
|
||||||
import com.ljsd.jieling.logic.dao.Hero;
|
import com.ljsd.jieling.logic.dao.*;
|
||||||
import com.ljsd.jieling.logic.dao.Jewel;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.dao.Pokemon;
|
import org.springframework.data.annotation.Id;
|
||||||
|
import org.springframework.data.mongodb.core.mapping.Document;
|
||||||
|
import org.springframework.data.mongodb.core.mapping.Field;
|
||||||
|
|
||||||
import java.util.List;
|
import java.net.UnknownHostException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author hj
|
* @Author hj
|
||||||
* @Date 2021/6/17 13:43
|
* @Date 2021/6/17 13:43
|
||||||
* @Description:
|
* @Description: 跨服排行用户信息
|
||||||
* @Version 1.0
|
* @Version 1.0
|
||||||
*/
|
*/
|
||||||
|
@Document(collection = "arenaOfUser")
|
||||||
public class ArenaOfUser {
|
public class ArenaOfUser {
|
||||||
|
|
||||||
private ArenaOfPlayer player;
|
@Id
|
||||||
|
private int id;
|
||||||
|
|
||||||
private List<Hero> heroes;
|
@Field(value = "arenaOfPlayerManager")
|
||||||
|
private ArenaOfPlayerManager playerManager;
|
||||||
|
|
||||||
private List<Jewel> jewels;
|
@Field(value = "arenaOfHeroManager")
|
||||||
|
private ArenaOfHeroManager heroManager;
|
||||||
|
|
||||||
private List<Pokemon> pokemons;
|
@Field(value = "arenaOfPokemons")
|
||||||
|
private Map<String,Pokemon> pokemons = new HashMap<>();
|
||||||
|
|
||||||
|
@Field(value = "arenaOfSeals")
|
||||||
|
private Map<Integer,PurpleMansionSeal> seals = new HashMap<>();
|
||||||
|
|
||||||
|
@Field(value = "arenaOfGuildSkill")
|
||||||
|
private Map<Integer,Integer> guildSkill = new HashMap<>(4);
|
||||||
|
|
||||||
|
public ArenaOfUser(User user) throws UnknownHostException {
|
||||||
|
this.id = user.getId();
|
||||||
|
|
||||||
|
HeroManager heroManager = user.getHeroManager();
|
||||||
|
// 玩家基本信息
|
||||||
|
this.playerManager = new ArenaOfPlayerManager(user);
|
||||||
|
// 英雄
|
||||||
|
this.heroManager = new ArenaOfHeroManager(user);
|
||||||
|
// 灵兽
|
||||||
|
pokemons = new HashMap<>();
|
||||||
|
Map<String, Pokemon> pokemonMap = user.getPokemonManager().getPokemonMap();
|
||||||
|
Map<Integer, String> teamMap = user.getPokemonManager().getPokemonTeamMap();
|
||||||
|
teamMap.values().forEach(v->{
|
||||||
|
// clone 深度复制
|
||||||
|
Pokemon pokemon = (Pokemon)pokemonMap.get(v).clone();
|
||||||
|
pokemons.put(v,pokemon);
|
||||||
|
});
|
||||||
|
// 紫府神印
|
||||||
|
seals = new HashMap<>(heroManager.getPurpleMansionSeal());
|
||||||
|
// 公会技能
|
||||||
|
guildSkill = new HashMap<>(user.getGuildMyInfo().getGuildSkill());
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArenaOfPlayerManager getPlayerManager() {
|
||||||
|
return playerManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlayerManager(ArenaOfPlayerManager playerManager) {
|
||||||
|
this.playerManager = playerManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArenaOfHeroManager getHeroManager() {
|
||||||
|
return heroManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeroManager(ArenaOfHeroManager heroManager) {
|
||||||
|
this.heroManager = heroManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Pokemon> getPokemons() {
|
||||||
|
return pokemons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPokemons(Map<String, Pokemon> pokemons) {
|
||||||
|
this.pokemons = pokemons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<Integer, Integer> getGuildSkill() {
|
||||||
|
return guildSkill;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGuildSkill(Map<Integer, Integer> guildSkill) {
|
||||||
|
this.guildSkill = guildSkill;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<Integer, PurpleMansionSeal> getSeals() {
|
||||||
|
return seals;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeals(Map<Integer, PurpleMansionSeal> seals) {
|
||||||
|
this.seals = seals;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,203 @@
|
||||||
|
package com.ljsd.jieling.logic.dao.gm;
|
||||||
|
|
||||||
|
import org.springframework.data.annotation.Id;
|
||||||
|
import org.springframework.data.mongodb.core.index.Indexed;
|
||||||
|
import org.springframework.data.mongodb.core.mapping.Document;
|
||||||
|
import org.springframework.data.mongodb.core.mapping.Field;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Administrator
|
||||||
|
* @date 2015/8/13
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Document(collection = "server_info")
|
||||||
|
public class CoreOfServerInfo {
|
||||||
|
@Id
|
||||||
|
private int _id;
|
||||||
|
|
||||||
|
@Field(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Field(value = "ip")
|
||||||
|
private String IP;
|
||||||
|
|
||||||
|
@Field(value = "port")
|
||||||
|
private String port;
|
||||||
|
|
||||||
|
@Indexed
|
||||||
|
@Field(value = "server_id")
|
||||||
|
private String server_id;
|
||||||
|
|
||||||
|
@Field(value = "channel")
|
||||||
|
private String channel;
|
||||||
|
|
||||||
|
@Field(value = "sub_channel")
|
||||||
|
private String sub_channel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* -1 服务器准备中
|
||||||
|
* -2 未运营
|
||||||
|
* 0 已关闭
|
||||||
|
* 1 维护
|
||||||
|
* 2 流畅
|
||||||
|
* 3 拥挤
|
||||||
|
* 4 爆满
|
||||||
|
* 5 自动
|
||||||
|
*/
|
||||||
|
@Field(value = "state")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Field(value = "plat")
|
||||||
|
private String plat;
|
||||||
|
|
||||||
|
@Field(value = "open_time")
|
||||||
|
private String open_time;
|
||||||
|
|
||||||
|
@Field(value = "is_new")
|
||||||
|
private String is_new;
|
||||||
|
|
||||||
|
/* 服务器启动类型 0手动开启 1 按时 2 按量*/
|
||||||
|
@Field(value = "open_type")
|
||||||
|
private String open_type;
|
||||||
|
|
||||||
|
@Field(value = "register_state")
|
||||||
|
private String register_state;
|
||||||
|
|
||||||
|
@Field(value = "coreName")
|
||||||
|
private String coreName;
|
||||||
|
|
||||||
|
public CoreOfServerInfo(int _id, String name) {
|
||||||
|
this._id = _id;
|
||||||
|
this.server_id = String.valueOf(_id);
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int get_id() {
|
||||||
|
return _id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set_id(int _id) {
|
||||||
|
this._id = _id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIP() {
|
||||||
|
return IP;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIP(String IP) {
|
||||||
|
this.IP = IP;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPort() {
|
||||||
|
return port;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPort(String port) {
|
||||||
|
this.port = port;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getServer_id() {
|
||||||
|
return server_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setServer_id(String server_id) {
|
||||||
|
this.server_id = server_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getChannel() {
|
||||||
|
return channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChannel(String channel) {
|
||||||
|
this.channel = channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSub_channel() {
|
||||||
|
return sub_channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSub_channel(String sub_channel) {
|
||||||
|
this.sub_channel = sub_channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPlat() {
|
||||||
|
return plat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlat(String plat) {
|
||||||
|
this.plat = plat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpen_time() {
|
||||||
|
return open_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpen_time(String open_time) {
|
||||||
|
this.open_time = open_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIs_new() {
|
||||||
|
return is_new==null?"0":is_new;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIs_new(String is_new) {
|
||||||
|
this.is_new = is_new;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpen_type() {
|
||||||
|
return open_type==null?"0":open_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpen_type(String open_type) {
|
||||||
|
this.open_type = open_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegister_state() { return register_state==null?"1":register_state; }
|
||||||
|
|
||||||
|
public void setRegister_state(String register_state) { this.register_state = register_state; }
|
||||||
|
|
||||||
|
public String getCoreName() {
|
||||||
|
return coreName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCoreName(String coreName) {
|
||||||
|
this.coreName = coreName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ServerInfo{" +
|
||||||
|
"_id=" + _id +
|
||||||
|
", name='" + name + '\'' +
|
||||||
|
", IP='" + IP + '\'' +
|
||||||
|
", port='" + port + '\'' +
|
||||||
|
", server_id='" + server_id + '\'' +
|
||||||
|
", channel='" + channel + '\'' +
|
||||||
|
", sub_channel='" + sub_channel + '\'' +
|
||||||
|
", status='" + status + '\'' +
|
||||||
|
", plat='" + plat + '\'' +
|
||||||
|
", open_time='" + open_time + '\'' +
|
||||||
|
", is_new='" + is_new + '\'' +
|
||||||
|
", open_type='" + open_type + '\'' +
|
||||||
|
", register_state='" + register_state + '\'' +
|
||||||
|
", coreName='" + coreName + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,6 +20,7 @@ import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
import com.ljsd.jieling.logic.activity.ActivityType;
|
import com.ljsd.jieling.logic.activity.ActivityType;
|
||||||
|
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||||
import com.ljsd.jieling.logic.activity.event.*;
|
import com.ljsd.jieling.logic.activity.event.*;
|
||||||
import com.ljsd.jieling.logic.activity.eventhandler.HeroFiveStarGetEventHandler;
|
import com.ljsd.jieling.logic.activity.eventhandler.HeroFiveStarGetEventHandler;
|
||||||
import com.ljsd.jieling.logic.activity.eventhandler.PokemonFiveStarGetEventHandler;
|
import com.ljsd.jieling.logic.activity.eventhandler.PokemonFiveStarGetEventHandler;
|
||||||
|
@ -34,7 +35,6 @@ import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||||
import com.ljsd.jieling.logic.redpacket.WelfareRedPackEvent;
|
import com.ljsd.jieling.logic.redpacket.WelfareRedPackEvent;
|
||||||
import com.ljsd.jieling.logic.redpacket.WelfareRedPacketType;
|
import com.ljsd.jieling.logic.redpacket.WelfareRedPacketType;
|
||||||
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
||||||
import com.ljsd.jieling.network.server.ProtocolsManager;
|
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
import com.ljsd.jieling.util.*;
|
import com.ljsd.jieling.util.*;
|
||||||
import config.*;
|
import config.*;
|
||||||
|
@ -778,63 +778,66 @@ public class HeroLogic{
|
||||||
}
|
}
|
||||||
user.getTeamPosManager().changeTeamInfo(teamId,heroIds);
|
user.getTeamPosManager().changeTeamInfo(teamId,heroIds);
|
||||||
//401图内可以更改编队
|
//401图内可以更改编队
|
||||||
if(teamId == GlobalsDef.ENDLESS_TEAM){
|
if (teamId == GlobalsDef.ENDLESS_TEAM) {
|
||||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||||
if(teamPosHeroInfos!=null){
|
if (teamPosHeroInfos != null) {
|
||||||
List<String> heroes = new ArrayList<>(teamPosHeroInfos.size());
|
List<String> heroes = new ArrayList<>(teamPosHeroInfos.size());
|
||||||
Map<String, Map<Integer, Long>> heroAllAttributeMap = new HashMap<>(teamPosHeroInfos.size());
|
Map<String, Map<Integer, Long>> heroAllAttributeMap = new HashMap<>(teamPosHeroInfos.size());
|
||||||
List<MapInfoProto.HeroInfo> indiHeros = new ArrayList<>();
|
List<MapInfoProto.HeroInfo> indiHeros = new ArrayList<>();
|
||||||
for (TeamPosHeroInfo heroInfo : teamPosHeroInfos) {
|
for (TeamPosHeroInfo heroInfo : teamPosHeroInfos) {
|
||||||
Hero hero = heroManager.getEndlessHeroInfo().get(heroInfo.getHeroId());
|
Hero hero = heroManager.getEndlessHeroInfo().get(heroInfo.getHeroId());
|
||||||
if (hero == null) {
|
if (hero == null) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(heroAllAttributeMap.get(heroInfo.getHeroId())!=null){
|
if (heroAllAttributeMap.get(heroInfo.getHeroId()) != null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
Map<Integer, SEndlessHeroProp> config = STableManager.getConfig(SEndlessHeroProp.class);
|
|
||||||
SEndlessHeroProp sEndlessHeroProp = config.get(hero.getTemplateId());
|
|
||||||
Map<Integer, Long> heroAllAttribute = new HashMap<>();
|
|
||||||
for(int[] prop:sEndlessHeroProp.getProps()){
|
|
||||||
heroAllAttribute.put(prop[0],(long)prop[1]);
|
|
||||||
}
|
|
||||||
Map<String, Integer> endlessHeroInfo = user.getMapManager().getEndlessMapInfo().getEndlessHeroInfo();
|
|
||||||
if(endlessHeroInfo!=null&& endlessHeroInfo.containsKey(heroInfo.getHeroId())){
|
|
||||||
int curHp = (int)(endlessHeroInfo.get(heroInfo.getHeroId()) /10000.00 * heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId()));
|
|
||||||
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(), (long) curHp);
|
|
||||||
}else{
|
|
||||||
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(), 10000L);
|
|
||||||
}
|
|
||||||
heroAllAttributeMap.put(hero.getId(), heroAllAttribute);
|
|
||||||
heroes.add(heroInfo.getHeroId());
|
|
||||||
MapInfoProto.HeroInfo indiInfo = MapInfoProto.HeroInfo.newBuilder().setHeroId(heroInfo.getHeroId())
|
|
||||||
.setHeroHp(heroAllAttribute.get(HeroAttributeEnum.CurHP.getPropertyId()))
|
|
||||||
.setHeroMaxHp(heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId()))
|
|
||||||
.build();
|
|
||||||
indiHeros.add(indiInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
user.getMapManager().setHeroAllAttributeMap(heroAllAttributeMap);
|
Map<Integer, SEndlessHeroProp> config = STableManager.getConfig(SEndlessHeroProp.class);
|
||||||
if(user.getMapManager().getCurMapId()!=0){
|
SEndlessHeroProp sEndlessHeroProp = config.get(hero.getTemplateId());
|
||||||
MapInfoProto.EndlessSetTeamIndication response = MapInfoProto.EndlessSetTeamIndication.newBuilder().addAllInfo(indiHeros).build();
|
Map<Integer, Long> heroAllAttribute = new HashMap<>();
|
||||||
MessageUtil.sendIndicationMessage(iSession,1, MessageTypeProto.MessageType.ENDLESS_MAP_SET_TEAM_INDICATION_VALUE,response,true);
|
for (int[] prop : sEndlessHeroProp.getProps()) {
|
||||||
|
heroAllAttribute.put(prop[0], (long) prop[1]);
|
||||||
}
|
}
|
||||||
}else{
|
Map<String, Integer> endlessHeroInfo = user.getMapManager().getEndlessMapInfo().getEndlessHeroInfo();
|
||||||
user.getTeamPosManager().changeTeamInfo(teamId,heroIds);
|
if (endlessHeroInfo != null && endlessHeroInfo.containsKey(heroInfo.getHeroId())) {
|
||||||
|
int curHp = (int) (endlessHeroInfo.get(heroInfo.getHeroId()) / 10000.00 * heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId()));
|
||||||
|
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(), (long) curHp);
|
||||||
|
} else {
|
||||||
|
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(), 10000L);
|
||||||
|
}
|
||||||
|
heroAllAttributeMap.put(hero.getId(), heroAllAttribute);
|
||||||
|
heroes.add(heroInfo.getHeroId());
|
||||||
|
MapInfoProto.HeroInfo indiInfo = MapInfoProto.HeroInfo.newBuilder().setHeroId(heroInfo.getHeroId())
|
||||||
|
.setHeroHp(heroAllAttribute.get(HeroAttributeEnum.CurHP.getPropertyId()))
|
||||||
|
.setHeroMaxHp(heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId()))
|
||||||
|
.build();
|
||||||
|
indiHeros.add(indiInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
user.getMapManager().setHeroAllAttributeMap(heroAllAttributeMap);
|
||||||
}else if(teamId == GlobalsDef.TEAM_ARENA_DEFENSE){
|
if (user.getMapManager().getCurMapId() != 0) {
|
||||||
int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, teamId, false);
|
MapInfoProto.EndlessSetTeamIndication response = MapInfoProto.EndlessSetTeamIndication.newBuilder().addAllInfo(indiHeros).build();
|
||||||
//更新竞技场防御编队战力
|
MessageUtil.sendIndicationMessage(iSession, 1, MessageTypeProto.MessageType.ENDLESS_MAP_SET_TEAM_INDICATION_VALUE, response, true);
|
||||||
String key = RedisKey.getKey(RedisKey.AREDEF_TEAM_FORCE_RANK, "", false);
|
}
|
||||||
RedisUtil.getInstence().zsetAddOne(key, String.valueOf(user.getId()), teamForce);
|
} else {
|
||||||
|
user.getTeamPosManager().changeTeamInfo(teamId, heroIds);
|
||||||
}
|
|
||||||
if(teamId==GlobalsDef.FORMATION_NORMAL){
|
|
||||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(iSession.getUid()));
|
|
||||||
}
|
}
|
||||||
|
} else if (teamId == GlobalsDef.TEAM_ARENA_DEFENSE) {
|
||||||
|
int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, teamId, false);
|
||||||
|
//更新竞技场防御编队战力
|
||||||
|
String key = RedisKey.getKey(RedisKey.AREDEF_TEAM_FORCE_RANK, "", false);
|
||||||
|
RedisUtil.getInstence().zsetAddOne(key, String.valueOf(user.getId()), teamForce);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (teamId == GlobalsDef.FORMATION_NORMAL) {
|
||||||
|
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(iSession.getUid()));
|
||||||
|
}
|
||||||
|
CrossServiceLogic.getInstance().dispose(user);
|
||||||
|
// 跨服 更新编队信息
|
||||||
|
if (teamId == GlobalsDef.WORLD_TEAM_ARENA_DEFENSE) {
|
||||||
|
CrossServiceLogic.getInstance().dispose(user);
|
||||||
|
}
|
||||||
user.getUserMissionManager().onGameEvent(user,GameEvent.HERO_IN_TEAM,heroIds.size());
|
user.getUserMissionManager().onGameEvent(user,GameEvent.HERO_IN_TEAM,heroIds.size());
|
||||||
MessageUtil.sendMessage(iSession,1,MessageTypeProto.MessageType.TEAM_POS_SAVE_RESPONSE_VALUE,null,true);
|
MessageUtil.sendMessage(iSession,1,MessageTypeProto.MessageType.TEAM_POS_SAVE_RESPONSE_VALUE,null,true);
|
||||||
}
|
}
|
||||||
|
@ -2359,7 +2362,6 @@ public class HeroLogic{
|
||||||
if(isInTeam(user,heroId,1)){
|
if(isInTeam(user,heroId,1)){
|
||||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(uid));
|
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(uid));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 鸿蒙阵,穿装备
|
// 鸿蒙阵,穿装备
|
||||||
addOrUpdateHongmeng(session);
|
addOrUpdateHongmeng(session);
|
||||||
|
|
||||||
|
@ -2458,7 +2460,6 @@ public class HeroLogic{
|
||||||
if(isInTeam(user,heroId,1)){
|
if(isInTeam(user,heroId,1)){
|
||||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(uid));
|
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(uid));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 鸿蒙阵,脱装备
|
// 鸿蒙阵,脱装备
|
||||||
addOrUpdateHongmeng(session);
|
addOrUpdateHongmeng(session);
|
||||||
|
|
||||||
|
@ -2507,7 +2508,8 @@ public class HeroLogic{
|
||||||
if(!drop.getHeroList().isEmpty()){
|
if(!drop.getHeroList().isEmpty()){
|
||||||
user.getUserMissionManager().onGameEvent(user,GameEvent.COMPOS_HERO,drop.getHero(0).getHeroId(),composeNum);
|
user.getUserMissionManager().onGameEvent(user,GameEvent.COMPOS_HERO,drop.getHero(0).getHeroId(),composeNum);
|
||||||
}
|
}
|
||||||
MessageUtil.sendMessage(iSession,1,msgId,heroComposeResponse,true); }
|
MessageUtil.sendMessage(iSession,1,msgId,heroComposeResponse,true);
|
||||||
|
}
|
||||||
|
|
||||||
public String getQuality(int natural) {
|
public String getQuality(int natural) {
|
||||||
String quality = "N";
|
String quality = "N";
|
||||||
|
|
|
@ -43,7 +43,9 @@ public enum RankEnum {
|
||||||
WARLD_DIS_ARENA_RANK(28,RedisKey.WARLD_DIS_ARENA_RANK,ArenaRank::new,true),//世界服排行
|
WARLD_DIS_ARENA_RANK(28,RedisKey.WARLD_DIS_ARENA_RANK,ArenaRank::new,true),//世界服排行
|
||||||
SHAN_HE_SHE_JI_CHAPTER_RANK(29,RedisKey.SHAN_HE_SHE_JI_CHAPTER_RANK,ShanHeSheJiTuChapterRank::new,false),//山河社稷章节排行榜
|
SHAN_HE_SHE_JI_CHAPTER_RANK(29,RedisKey.SHAN_HE_SHE_JI_CHAPTER_RANK,ShanHeSheJiTuChapterRank::new,false),//山河社稷章节排行榜
|
||||||
SHAN_HE_SHE_JI_STAR_RANK(30,RedisKey.SHAN_HE_SHE_JI_STAR_RANK,ShanHeSheJiTuStarRank::new,false),//山河社稷星星排行榜
|
SHAN_HE_SHE_JI_STAR_RANK(30,RedisKey.SHAN_HE_SHE_JI_STAR_RANK,ShanHeSheJiTuStarRank::new,false),//山河社稷星星排行榜
|
||||||
TA_SUI_LING_XIAO_RANK(31,RedisKey.TA_SUI_LING_XIAO_RANK,TaSuiLingXiaoRank::new,false)
|
TA_SUI_LING_XIAO_RANK(31,RedisKey.TA_SUI_LING_XIAO_RANK,TaSuiLingXiaoRank::new,false),
|
||||||
|
|
||||||
|
CROSS_SERVICE_ARENA(32,RedisKey.CROSS_SERVICE_ARENA,ArenaRank::new,false)
|
||||||
;
|
;
|
||||||
|
|
||||||
private int type;
|
private int type;
|
||||||
|
|
Loading…
Reference in New Issue