Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
3d76b09eaf
|
@ -40,7 +40,6 @@ public class SDifferDemonsComonpentsConfig implements BaseConfig {
|
||||||
extraAddMapTmp.put(comonpentsId,new HashMap<>());
|
extraAddMapTmp.put(comonpentsId,new HashMap<>());
|
||||||
}
|
}
|
||||||
int[][] extraAdd = sDifferDemonsComonpentsConfig.getExtraAdd();
|
int[][] extraAdd = sDifferDemonsComonpentsConfig.getExtraAdd();
|
||||||
if(extraAdd!=null&&extraAdd.length>0){
|
|
||||||
Map<Integer, Map<Integer, Integer>> extraMapTmpInfo = extraAddMapTmp.get(comonpentsId);
|
Map<Integer, Map<Integer, Integer>> extraMapTmpInfo = extraAddMapTmp.get(comonpentsId);
|
||||||
for(int [] extraItem : extraAdd){
|
for(int [] extraItem : extraAdd){
|
||||||
int profession = extraItem[0];
|
int profession = extraItem[0];
|
||||||
|
@ -52,7 +51,6 @@ public class SDifferDemonsComonpentsConfig implements BaseConfig {
|
||||||
extraMapTmpInfo.get(profession).put(propertyId,propertyValue);
|
extraMapTmpInfo.get(profession).put(propertyId,propertyValue);
|
||||||
}
|
}
|
||||||
sDifferDemonsComonpentsConfig.setExtraAddMap(new HashMap<>(extraMapTmpInfo));
|
sDifferDemonsComonpentsConfig.setExtraAddMap(new HashMap<>(extraMapTmpInfo));
|
||||||
}
|
|
||||||
sDifferDemonsComonpentsConfigTmp.get(comonpentsId).put(stage,sDifferDemonsComonpentsConfig);
|
sDifferDemonsComonpentsConfigTmp.get(comonpentsId).put(stage,sDifferDemonsComonpentsConfig);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,8 @@ public class SPlayerLevelConfig implements BaseConfig {
|
||||||
|
|
||||||
private int addEnergy;
|
private int addEnergy;
|
||||||
|
|
||||||
|
private int extraAdd;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
|
@ -40,6 +42,10 @@ public class SPlayerLevelConfig implements BaseConfig {
|
||||||
return addEnergy;
|
return addEnergy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getExtraAdd() {
|
||||||
|
return extraAdd;
|
||||||
|
}
|
||||||
|
|
||||||
public static Map<Integer, SPlayerLevelConfig> getsPlayerLevelConfigMap() {
|
public static Map<Integer, SPlayerLevelConfig> getsPlayerLevelConfigMap() {
|
||||||
return sPlayerLevelConfigMap;
|
return sPlayerLevelConfigMap;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,8 @@ public class SStoreConfig implements BaseConfig {
|
||||||
|
|
||||||
private int relatedtoVIP;
|
private int relatedtoVIP;
|
||||||
|
|
||||||
|
private int[][] extraAdd;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
|
@ -114,4 +116,8 @@ public class SStoreConfig implements BaseConfig {
|
||||||
public int getRelatedtoVIP() {
|
public int getRelatedtoVIP() {
|
||||||
return relatedtoVIP;
|
return relatedtoVIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int[][] getExtraAdd() {
|
||||||
|
return extraAdd;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -37,4 +37,6 @@ public class MongoKey {
|
||||||
public final static String userMissionManager = "userMissionManager";
|
public final static String userMissionManager = "userMissionManager";
|
||||||
|
|
||||||
public final static String friendManager = "friendManager";
|
public final static String friendManager = "friendManager";
|
||||||
|
|
||||||
|
public final static String guildMyInfo = "guildMyInfo";
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.ljsd.jieling.handler.family;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
|
import com.ljsd.jieling.logic.family.GuildLogic;
|
||||||
|
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||||
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
import com.ljsd.jieling.protocols.Family;
|
||||||
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class FamilyWalkHandler extends BaseHandler {
|
||||||
|
@Override
|
||||||
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
|
return MessageTypeProto.MessageType.FAMILY_WALK_REQUEST;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||||
|
Family.FamilyWalkRequest familyWalkRequest = Family.FamilyWalkRequest.parseFrom(netData.parseClientProtoNetData());
|
||||||
|
GuildLogic.walkInGuildScene(iSession,familyWalkRequest.getPathList());
|
||||||
|
}
|
||||||
|
}
|
|
@ -1319,7 +1319,7 @@ public class MapLogic {
|
||||||
* @param messageType
|
* @param messageType
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public void endFight(ISession session, String frames, MessageTypeProto.MessageType messageType) throws Exception {
|
public void endFight(ISession session, String frames, MessageTypeProto.MessageType messageType,int dropout) throws Exception {
|
||||||
int uid = session.getUid();
|
int uid = session.getUid();
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
String key = RedisKey.getKey(RedisKey.FIGHT, Integer.toString(uid), false);
|
String key = RedisKey.getKey(RedisKey.FIGHT, Integer.toString(uid), false);
|
||||||
|
@ -1338,48 +1338,44 @@ public class MapLogic {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int seed = Integer.parseInt((String) valueMap.get(RedisKey.FIGHT_SEED));
|
|
||||||
int monsterGroupId = Integer.parseInt((String) valueMap.get(RedisKey.FIGHT_GROUPID));
|
|
||||||
CommonProto.FightTeamInfo.Builder builder = CommonProto.FightTeamInfo.newBuilder();
|
|
||||||
JsonFormat.merge((String) valueMap.get(RedisKey.FIGHT_HEROES), builder);
|
|
||||||
CommonProto.FightTeamInfo fightTeamInfo = builder.build();
|
|
||||||
List<CommonProto.FightTeamInfo> monsterTeamList = BehaviorUtil.getFightTeamInfos(valueMap);
|
|
||||||
SMonsterGroup sMonsterGroup = SMonsterGroup.getsMonsterGroupMap().get(monsterGroupId);
|
|
||||||
if (sMonsterGroup == null) {
|
|
||||||
LOGGER.info("endFight() uid=>{} monsterGroupId=>{} sMonsterGroup == null", uid, monsterGroupId);
|
|
||||||
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// frames = "14#1#0|132#2#3|152#2#5|178#3#2|219#2#4|260#3#1|287#2#2|312#3#5|467#1#1";
|
|
||||||
// frames ="";
|
|
||||||
LuaValue getFightData = FightDataUtil.getFinalFightData(fightTeamInfo, monsterTeamList);
|
|
||||||
// LuaValue getFightData = FightDataUtil.getTestFightData();
|
|
||||||
LuaValue getOptionData = FightDataUtil.getOptionData(frames);
|
|
||||||
int mostTime = SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getMostTime();
|
|
||||||
int[] checkResult = CheckFight.getInstance().checkFight(seed, mostTime, getFightData, getOptionData);
|
|
||||||
|
|
||||||
List<Integer> remainHp = new ArrayList<>(5);
|
List<Integer> remainHp = new ArrayList<>(5);
|
||||||
for (int i = 2; i < checkResult.length; i++) {
|
|
||||||
if (checkResult[i] <= 0) {
|
|
||||||
remainHp.add(0);
|
|
||||||
} else {
|
|
||||||
remainHp.add(checkResult[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int triggerXY = mapManager.getTriggerXY();
|
int triggerXY = mapManager.getTriggerXY();
|
||||||
int optionId = Integer.parseInt((String) valueMap.get(RedisKey.NEED_VICTORY_AFTER));
|
int optionId = Integer.parseInt((String) valueMap.get(RedisKey.NEED_VICTORY_AFTER));
|
||||||
int nextEventId = 0;
|
int nextEventId = 0;
|
||||||
SOptionConfig sOptionConfig = SOptionConfig.sOptionConfigMap.get(optionId);
|
SOptionConfig sOptionConfig = SOptionConfig.sOptionConfigMap.get(optionId);
|
||||||
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(user.getMapManager().getCurMapId());
|
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(user.getMapManager().getCurMapId());
|
||||||
//校验结果码 1:胜利
|
//校验结果码 1:胜利
|
||||||
int resultCode = checkResult[0];
|
int resultCode=0;
|
||||||
|
int[] checkResult = new int[0];
|
||||||
|
int monsterGroupId=0;
|
||||||
|
SMonsterGroup sMonsterGroup=null;
|
||||||
|
if(dropout ==0){
|
||||||
|
int seed = Integer.parseInt((String) valueMap.get(RedisKey.FIGHT_SEED));
|
||||||
|
monsterGroupId = Integer.parseInt((String) valueMap.get(RedisKey.FIGHT_GROUPID));
|
||||||
|
CommonProto.FightTeamInfo.Builder builder = CommonProto.FightTeamInfo.newBuilder();
|
||||||
|
JsonFormat.merge((String) valueMap.get(RedisKey.FIGHT_HEROES), builder);
|
||||||
|
CommonProto.FightTeamInfo fightTeamInfo = builder.build();
|
||||||
|
List<CommonProto.FightTeamInfo> monsterTeamList = BehaviorUtil.getFightTeamInfos(valueMap);
|
||||||
|
sMonsterGroup = SMonsterGroup.getsMonsterGroupMap().get(monsterGroupId);
|
||||||
|
if (sMonsterGroup == null) {
|
||||||
|
LOGGER.info("endFight() uid=>{} monsterGroupId=>{} sMonsterGroup == null", uid, monsterGroupId);
|
||||||
|
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
LuaValue getFightData = FightDataUtil.getFinalFightData(fightTeamInfo, monsterTeamList);
|
||||||
|
LuaValue getOptionData = FightDataUtil.getOptionData(frames);
|
||||||
|
int mostTime = SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getMostTime();
|
||||||
|
checkResult = CheckFight.getInstance().checkFight(seed, mostTime, getFightData, getOptionData);
|
||||||
|
resultCode = checkResult[0];
|
||||||
if (resultCode == -1) {
|
if (resultCode == -1) {
|
||||||
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "战斗异常!");
|
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "战斗异常!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mapManager.setLastFightResult(resultCode);
|
mapManager.setLastFightResult(resultCode);
|
||||||
if (resultCode == 0) {
|
if (resultCode == 0 || dropout == 1) {
|
||||||
//无尽副本复活消耗
|
//无尽副本复活消耗
|
||||||
reviveConsumeExecution(user);
|
reviveConsumeExecution(user);
|
||||||
// 失败需要等待n秒后复活所有英雄
|
// 失败需要等待n秒后复活所有英雄
|
||||||
|
@ -1435,6 +1431,13 @@ public class MapLogic {
|
||||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse.build(), true);
|
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse.build(), true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
for (int i = 2; i < checkResult.length; i++) {
|
||||||
|
if (checkResult[i] <= 0) {
|
||||||
|
remainHp.add(0);
|
||||||
|
} else {
|
||||||
|
remainHp.add(checkResult[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
int teamId = mapManager.getTeamId();
|
int teamId = mapManager.getTeamId();
|
||||||
List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||||
for (TeamPosHeroInfo teamPosHeroInfo : team) {
|
for (TeamPosHeroInfo teamPosHeroInfo : team) {
|
||||||
|
|
|
@ -27,7 +27,8 @@ public class FightEndRequestHandler extends BaseHandler {
|
||||||
if (type == 1){
|
if (type == 1){
|
||||||
MapLogic.getInstance().endDifficultyFight(iSession, frames,fightId,MessageTypeProto.MessageType.FIGHT_END_RESPONSE);
|
MapLogic.getInstance().endDifficultyFight(iSession, frames,fightId,MessageTypeProto.MessageType.FIGHT_END_RESPONSE);
|
||||||
}else if(type == 2){
|
}else if(type == 2){
|
||||||
MapLogic.getInstance().endFight(iSession, frames, MessageTypeProto.MessageType.FIGHT_END_RESPONSE);
|
int dropout = fightEndRequest.getDropout();
|
||||||
|
MapLogic.getInstance().endFight(iSession, frames, MessageTypeProto.MessageType.FIGHT_END_RESPONSE,dropout);
|
||||||
}else if(type == 3){
|
}else if(type == 3){
|
||||||
MapLogic.getInstance().endSuddlenlyFight(iSession, frames, MessageTypeProto.MessageType.FIGHT_END_RESPONSE);
|
MapLogic.getInstance().endSuddlenlyFight(iSession, frames, MessageTypeProto.MessageType.FIGHT_END_RESPONSE);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -44,6 +44,11 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 子类重写
|
||||||
|
* @param user
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onResume(User user) throws Exception {
|
public void onResume(User user) throws Exception {
|
||||||
ActivityManager activityManager = user.getActivityManager();
|
ActivityManager activityManager = user.getActivityManager();
|
||||||
|
|
|
@ -273,7 +273,7 @@ public class ActivityLogic {
|
||||||
|
|
||||||
public void updateActivityMissionProgress(User user, int activityType, int count) {
|
public void updateActivityMissionProgress(User user, int activityType, int count) {
|
||||||
|
|
||||||
for (Integer id : getOpenActivityIdsByType(user, activityType)) {
|
for (Integer id : getOpenActivityIdsByType(user, activityType,true)) {
|
||||||
AbstractActivity abstractActivity = ActivityTypeEnum.getActicityType(id);
|
AbstractActivity abstractActivity = ActivityTypeEnum.getActicityType(id);
|
||||||
if (abstractActivity == null) {
|
if (abstractActivity == null) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -284,7 +284,7 @@ public class ActivityLogic {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resumeActivity(User user, int activityType) throws Exception {
|
public void resumeActivity(User user, int activityType) throws Exception {
|
||||||
for (Integer id : getOpenActivityIdsByType(user, activityType)) {
|
for (Integer id : getOpenActivityIdsByType(user, activityType,false)) {
|
||||||
AbstractActivity abstractActivity = ActivityTypeEnum.getActicityType(id);
|
AbstractActivity abstractActivity = ActivityTypeEnum.getActicityType(id);
|
||||||
if (abstractActivity == null) {
|
if (abstractActivity == null) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -293,13 +293,13 @@ public class ActivityLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set<Integer> getOpenActivityIdsByType(User user, int activityType) {
|
private Set<Integer> getOpenActivityIdsByType(User user, int activityType,boolean withState) {
|
||||||
Set<Integer> ids = new HashSet<>();
|
Set<Integer> ids = new HashSet<>();
|
||||||
ActivityManager activityManager = user.getActivityManager();
|
ActivityManager activityManager = user.getActivityManager();
|
||||||
Map<Integer, ActivityMission> activityMissionMap = activityManager.getActivityMissionMap();
|
Map<Integer, ActivityMission> activityMissionMap = activityManager.getActivityMissionMap();
|
||||||
for (Map.Entry<Integer, ActivityMission> item : activityMissionMap.entrySet()) {
|
for (Map.Entry<Integer, ActivityMission> item : activityMissionMap.entrySet()) {
|
||||||
ActivityMission activityMission = item.getValue();
|
ActivityMission activityMission = item.getValue();
|
||||||
if (activityMission.getActivityState() != ActivityType.OPEN_STATE) {
|
if (withState && activityMission.getActivityState() != ActivityType.OPEN_STATE) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Integer activityId = item.getKey();
|
Integer activityId = item.getKey();
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.ljsd.jieling.logic.dao;
|
||||||
|
|
||||||
|
import com.ljsd.common.mogodb.MongoBase;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class GuildMyInfo extends MongoBase {
|
||||||
|
private static int speed = 500;
|
||||||
|
|
||||||
|
|
||||||
|
private List<Integer> path; //行走路线
|
||||||
|
private int curPos=257;//当前位置
|
||||||
|
private long preMoveTimestamp; //上次更新时间
|
||||||
|
|
||||||
|
|
||||||
|
//用户移动到新位置, 返回下一个点的坐标,用户展示客户端的转向,及模拟移动
|
||||||
|
public void move(List<Integer> path){
|
||||||
|
long timestamp = System.currentTimeMillis();
|
||||||
|
if(!this.path.isEmpty()){
|
||||||
|
move(timestamp);
|
||||||
|
}
|
||||||
|
if(path == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.path.clear();
|
||||||
|
this.path.addAll(path);
|
||||||
|
this.path.remove(0);
|
||||||
|
preMoveTimestamp = timestamp;
|
||||||
|
setPreMoveTimestamp(timestamp);
|
||||||
|
}
|
||||||
|
//服务器模拟移动,如果前端模拟,则不需要服务气端调用这个函数,服务器端在事件触发的时候做校验即可
|
||||||
|
//如果位置发生变化,则返回新的当前点
|
||||||
|
public int move(long timestamp){
|
||||||
|
if(path.size() <= 0){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
int moveDistance = (int)((timestamp - preMoveTimestamp)/speed);
|
||||||
|
if(moveDistance < 1){
|
||||||
|
//格子没有发生变化
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
int pathSize = path.size();
|
||||||
|
for(int i=0; i<moveDistance && i<pathSize; i++){
|
||||||
|
curPos = path.remove(0);
|
||||||
|
}
|
||||||
|
setCurPos(curPos);
|
||||||
|
setPreMoveTimestamp(timestamp);
|
||||||
|
return curPos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurPos(int curPos) {
|
||||||
|
updateString("curPos",curPos);
|
||||||
|
this.curPos = curPos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPreMoveTimestamp(long preMoveTimestamp) {
|
||||||
|
updateString("preMoveTimestamp",preMoveTimestamp);
|
||||||
|
this.preMoveTimestamp = preMoveTimestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setPath(List<Integer> path) {
|
||||||
|
updateString("path",path);
|
||||||
|
this.path = path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Integer> getPath() {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCurPos() {
|
||||||
|
return curPos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getPreMoveTimestamp() {
|
||||||
|
return preMoveTimestamp;
|
||||||
|
}
|
||||||
|
}
|
|
@ -45,6 +45,8 @@ public class User {
|
||||||
private UserMissionManager userMissionManager;
|
private UserMissionManager userMissionManager;
|
||||||
private FriendManager friendManager;
|
private FriendManager friendManager;
|
||||||
|
|
||||||
|
private GuildMyInfo guildMyInfo;
|
||||||
|
|
||||||
private RoomInfo roomInfo;
|
private RoomInfo roomInfo;
|
||||||
|
|
||||||
//构造函数必须要声明,否则从mongodb读出来反编译成类不通过
|
//构造函数必须要声明,否则从mongodb读出来反编译成类不通过
|
||||||
|
@ -70,6 +72,7 @@ public class User {
|
||||||
this.storeManager = new StoreManager();
|
this.storeManager = new StoreManager();
|
||||||
this.userMissionManager = new UserMissionManager();
|
this.userMissionManager = new UserMissionManager();
|
||||||
this.friendManager = new FriendManager();
|
this.friendManager = new FriendManager();
|
||||||
|
this.guildMyInfo = new GuildMyInfo();
|
||||||
|
|
||||||
//綁定关系
|
//綁定关系
|
||||||
|
|
||||||
|
@ -90,6 +93,7 @@ public class User {
|
||||||
this.storeManager.init(id,MongoKey.storeManager);
|
this.storeManager.init(id,MongoKey.storeManager);
|
||||||
this.userMissionManager.init(id,MongoKey.userMissionManager);
|
this.userMissionManager.init(id,MongoKey.userMissionManager);
|
||||||
this.friendManager.init(id,MongoKey.friendManager);
|
this.friendManager.init(id,MongoKey.friendManager);
|
||||||
|
this.guildMyInfo.init(id,MongoKey.guildMyInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
|
@ -200,6 +204,10 @@ public class User {
|
||||||
return friendManager;
|
return friendManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GuildMyInfo getGuildMyInfo() {
|
||||||
|
return guildMyInfo;
|
||||||
|
}
|
||||||
|
|
||||||
public RoomInfo getRoomInfo() {
|
public RoomInfo getRoomInfo() {
|
||||||
if(roomInfo == null){
|
if(roomInfo == null){
|
||||||
roomInfo = new RoomInfo();
|
roomInfo = new RoomInfo();
|
||||||
|
|
|
@ -7,9 +7,6 @@ import com.ljsd.jieling.core.GlobalsDef;
|
||||||
import com.ljsd.jieling.db.redis.RedisKey;
|
import com.ljsd.jieling.db.redis.RedisKey;
|
||||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
import com.ljsd.jieling.ktbeans.KTGameType;
|
|
||||||
import com.ljsd.jieling.ktbeans.KtEventUtils;
|
|
||||||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
import com.ljsd.jieling.logic.dao.*;
|
import com.ljsd.jieling.logic.dao.*;
|
||||||
import com.ljsd.jieling.logic.dao.root.GuildApply;
|
import com.ljsd.jieling.logic.dao.root.GuildApply;
|
||||||
|
@ -671,6 +668,27 @@ public class GuildLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void walkInGuildScene(ISession session,List<Integer> path) throws Exception {
|
||||||
|
int msgId = MessageTypeProto.MessageType.FAMILY_WALK_RESPONSE_VALUE;
|
||||||
|
int uid = session.getUid();
|
||||||
|
User user = UserManager.getUser(uid);
|
||||||
|
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||||
|
if(guildId == 0){
|
||||||
|
MessageUtil.sendErrorResponse(session,0,msgId,"未加入公会");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GuildMyInfo guildMyInfo = user.getGuildMyInfo();
|
||||||
|
boolean continuous = CellUtil.isContinuous(guildMyInfo.getCurPos(),path);
|
||||||
|
if(!continuous){
|
||||||
|
MessageUtil.sendErrorResponse(session,0,msgId,"路线有误");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
user.getGuildMyInfo().move(path);
|
||||||
|
Family.FamilyWalkIndicaiton familyWalkIndicaiton = CBean2Proto.getFamilyWalkIndicaiton(user);
|
||||||
|
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||||
|
sendIndicationToMember(guildInfo, MessageTypeProto.MessageType.FAMILY_WALK_INDICATION,familyWalkIndicaiton);
|
||||||
|
}
|
||||||
|
|
||||||
public static void addGuildLog(int guildId, int type,String name) throws Exception {
|
public static void addGuildLog(int guildId, int type,String name) throws Exception {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GuildDef.Log.CREATE: {
|
case GuildDef.Log.CREATE: {
|
||||||
|
@ -718,7 +736,6 @@ public class GuildLogic {
|
||||||
/**
|
/**
|
||||||
* 查看工会布防信息
|
* 查看工会布防信息
|
||||||
* @param session
|
* @param session
|
||||||
* @param buildId
|
|
||||||
* @param messageType
|
* @param messageType
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class MissionLoigc {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(state!=2 && sTreasureTaskConfig.getTaskType() == MissionType.SENVER_HAPPY.getMissionTypeValue()){
|
if(state!=2 && sTreasureTaskConfig.getTaskType() == MissionType.SENVER_HAPPY.getMissionTypeValue()){
|
||||||
if(System.currentTimeMillis()>user.getActivityManager().getSenvenTime()){
|
if(progrss>0 && System.currentTimeMillis()>user.getActivityManager().getSenvenTime()){
|
||||||
state=1;
|
state=1;
|
||||||
}else {
|
}else {
|
||||||
state =0;
|
state =0;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ljsd.jieling.logic.store;
|
package com.ljsd.jieling.logic.store;
|
||||||
|
|
||||||
import com.ljsd.jieling.config.SGameSetting;
|
import com.ljsd.jieling.config.SGameSetting;
|
||||||
|
import com.ljsd.jieling.config.SPlayerLevelConfig;
|
||||||
import com.ljsd.jieling.config.SStoreConfig;
|
import com.ljsd.jieling.config.SStoreConfig;
|
||||||
import com.ljsd.jieling.config.SStoreTypeConfig;
|
import com.ljsd.jieling.config.SStoreTypeConfig;
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
|
@ -272,11 +273,25 @@ public class StoreLogic {
|
||||||
}
|
}
|
||||||
int[][] goods = sStoreConfig.getGoods();
|
int[][] goods = sStoreConfig.getGoods();
|
||||||
int length = goods.length;
|
int length = goods.length;
|
||||||
|
int[][] extraAdd = sStoreConfig.getExtraAdd();
|
||||||
|
int add = 10000;
|
||||||
|
if(extraAdd!=null && extraAdd.length>0){
|
||||||
|
for(int[] extra : extraAdd){
|
||||||
|
int type = extra[0];
|
||||||
|
if(type == 1){
|
||||||
|
SPlayerLevelConfig sPlayerLevelConfig = SPlayerLevelConfig.sPlayerLevelConfigMap.get(user.getPlayerInfoManager().getLevel());
|
||||||
|
add += sPlayerLevelConfig.getExtraAdd();
|
||||||
|
}else if(type == 2){
|
||||||
|
int addPrivageId = extra[0];
|
||||||
|
add += user.getPlayerInfoManager().getVipPrivilageValue(addPrivageId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
int[][] dropItems = new int[length][];
|
int[][] dropItems = new int[length][];
|
||||||
for(int i=0;i<length;i++){
|
for(int i=0;i<length;i++){
|
||||||
dropItems[i] = new int[2];
|
dropItems[i] = new int[2];
|
||||||
dropItems[i][0]= goods[i][0];
|
dropItems[i][0]= goods[i][0];
|
||||||
dropItems[i][1]= goods[i][1]*itemNum;
|
dropItems[i][1]= (int)(goods[i][1]*itemNum * (add /10000f));
|
||||||
}
|
}
|
||||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, dropItems, BIReason.STORE_BUY_ITEM);
|
CommonProto.Drop.Builder drop = ItemUtil.drop(user, dropItems, BIReason.STORE_BUY_ITEM);
|
||||||
if(SStoreTypeConfig.getsStoreTypeConfigMap().get(storeId).getStoreType() != StoreType.GIFT_STORE.getType()){
|
if(SStoreTypeConfig.getsStoreTypeConfigMap().get(storeId).getStoreType() != StoreType.GIFT_STORE.getType()){
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.ljsd.jieling.util;
|
package com.ljsd.jieling.util;
|
||||||
|
|
||||||
import com.ljsd.jieling.config.SGameSetting;
|
import com.ljsd.jieling.config.SGameSetting;
|
||||||
import com.ljsd.jieling.config.SItem;
|
|
||||||
import com.ljsd.jieling.config.SMonsterConfig;
|
import com.ljsd.jieling.config.SMonsterConfig;
|
||||||
import com.ljsd.jieling.globals.Global;
|
import com.ljsd.jieling.globals.Global;
|
||||||
import com.ljsd.jieling.handler.map.Cell;
|
import com.ljsd.jieling.handler.map.Cell;
|
||||||
|
@ -12,7 +11,6 @@ import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
import com.ljsd.jieling.logic.dao.*;
|
import com.ljsd.jieling.logic.dao.*;
|
||||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
|
||||||
import com.ljsd.jieling.protocols.ChatProto;
|
import com.ljsd.jieling.protocols.ChatProto;
|
||||||
import com.ljsd.jieling.protocols.CommonProto;
|
import com.ljsd.jieling.protocols.CommonProto;
|
||||||
import com.ljsd.jieling.protocols.Family;
|
import com.ljsd.jieling.protocols.Family;
|
||||||
|
@ -394,4 +392,13 @@ public class CBean2Proto {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Family.FamilyWalkIndicaiton getFamilyWalkIndicaiton(User user){
|
||||||
|
return Family.FamilyWalkIndicaiton.newBuilder()
|
||||||
|
.setCurPos(user.getGuildMyInfo().getCurPos())
|
||||||
|
.addAllPath(user.getGuildMyInfo().getPath())
|
||||||
|
.setUid(user.getId())
|
||||||
|
.setName(user.getPlayerInfoManager().getNickName())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue