Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
c1c3b15fc9
|
@ -23,7 +23,7 @@ public class SRingFireMaterialConfig implements BaseConfig {
|
|||
public void init() throws Exception {
|
||||
Map<Integer, SRingFireMaterialConfig> configTmp = STableManager.getConfig(SRingFireMaterialConfig.class);
|
||||
Map<Integer, SRingFireMaterialConfig> configMap = new HashMap<>();
|
||||
for(SRingFireMaterialConfig sRingFireMaterialConfig : configMap.values()){
|
||||
for(SRingFireMaterialConfig sRingFireMaterialConfig : configTmp.values()){
|
||||
configMap.put(sRingFireMaterialConfig.getFireId(),sRingFireMaterialConfig);
|
||||
}
|
||||
config = configMap;
|
||||
|
|
|
@ -16,6 +16,7 @@ public class FunctionOfTimeHandler extends BaseHandler{
|
|||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
iSession.setFiveReady(1);
|
||||
GlobalDataManaager.getInstance().getTimeOfControl(iSession);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -437,7 +437,8 @@ public class MapLogic {
|
|||
return;
|
||||
}
|
||||
if (mapManager.getStartExporeTime() == 0) {
|
||||
LOGGER.info("mapManager.getStartExporeTime() == 0");
|
||||
LOGGER.info("mapMana" +
|
||||
"ger.getStartExporeTime() == 0");
|
||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "未开始探索");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.ljsd.jieling.handler.room;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.room.RoomManager;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.RoomFightProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class RoomMapUpdateEventHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.ROOM_MAP_UPDATE_EVENT_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
RoomFightProto.RoomMapUpdateEventRequest roomMapUpdateEventRequest = RoomFightProto.RoomMapUpdateEventRequest.parseFrom(netData.parseClientProtoNetData());
|
||||
int triggerXY = roomMapUpdateEventRequest.getTriggerXY();
|
||||
int eventType = roomMapUpdateEventRequest.getEventType();
|
||||
RoomManager.updateRoomMapEvent(iSession,triggerXY,eventType);
|
||||
}
|
||||
}
|
|
@ -239,10 +239,10 @@ public class GlobalDataManaager {
|
|||
fBuilder.addUserMissionInfo(CommonProto.UserMissionInfo.newBuilder().setMissionId(sDailyTasksConfig.getId()).setState(0).setType(dailymissionType).setProgress(0));
|
||||
}
|
||||
if(session.getFiveReady() == 1){ //客户端准备好接受五点刷新请求
|
||||
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.FIVE_PLAYER_REFLUSH_INDICATION_VALUE,null,true);
|
||||
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.FIVE_PLAYER_REFLUSH_INDICATION_VALUE,fBuilder.build(),true);
|
||||
}else{
|
||||
int indicationIndex = session.getIndicationIndex();
|
||||
byte[] byteBuf = MessageUtil.wrappedBuffer(session.getUid(), session.getToken(), indicationIndex,1, MessageTypeProto.MessageType.FIVE_PLAYER_REFLUSH_INDICATION_VALUE, null);
|
||||
byte[] byteBuf = MessageUtil.wrappedBuffer(session.getUid(), session.getToken(), indicationIndex,1, MessageTypeProto.MessageType.FIVE_PLAYER_REFLUSH_INDICATION_VALUE, fBuilder.build());
|
||||
session.setFiveByteBuf(byteBuf);
|
||||
}
|
||||
}
|
||||
|
@ -267,9 +267,7 @@ public class GlobalDataManaager {
|
|||
Tea.intToByte(packetData, 4, session.getToken()); //token
|
||||
Tea.intToByte(packetData, 8,msgNum); //msgId
|
||||
Tea.intToByte(packetData, 12, 0); // msgIndex
|
||||
int[] secretKey = Tea.KEY;
|
||||
byte[] finalData = Tea.encrypt2(packetData, secretKey);
|
||||
return finalData;
|
||||
return packetData;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ public class PokemonManager extends MongoBase {
|
|||
}
|
||||
|
||||
public void addRingFirePokemon(Pokemon pokemon) throws Exception {
|
||||
pokemon.init(this.getRootId(),getMongoKey() + ".pokemonMap." + pokemon.getId());
|
||||
pokemon.init(this.getRootId(),getMongoKey() + ".ringFireMap." + pokemon.getId());
|
||||
updateString("ringFireMap." + pokemon.getId(), pokemon);
|
||||
ringFireMap.put(pokemon.getId(),pokemon);
|
||||
}
|
||||
|
|
|
@ -870,11 +870,14 @@ public class HeroLogic {
|
|||
Pokemon pokemon = item.getValue();
|
||||
int allStage = pokemon.getAllStage();
|
||||
SRingFireConfig sRingFireConfig = SRingFireConfig.getsRingFireByRingIdAndLevel(pokemon.getId(), allStage);
|
||||
int[][] property = sRingFireConfig.getProperty();
|
||||
if(property == null){
|
||||
if(sRingFireConfig == null){
|
||||
continue;
|
||||
}
|
||||
combinedAttribute(property,heroAllAttribute);
|
||||
int[][] property = sRingFireConfig.getProperty();
|
||||
if(property != null){
|
||||
combinedAttribute(property,heroAllAttribute);
|
||||
}
|
||||
|
||||
for(int i=1;i<allStage;i++){
|
||||
SRingFireConfig sRingFireConfigTmp = SRingFireConfig.getsRingFireByRingIdAndLevel(pokemon.getId(), i);
|
||||
int[] fireIds = sRingFireConfigTmp.getFireId();
|
||||
|
|
|
@ -10,12 +10,11 @@ import com.ljsd.jieling.protocols.RoomFightProto;
|
|||
import com.ljsd.jieling.protocols.RoomProto;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
public class Room {
|
||||
private int roomId;
|
||||
private RoomPlayerInfo[] roomPlayerInfos;
|
||||
private Map<Integer,RoomPlayerInfo> roomPlayerInfoMap;
|
||||
private long gameStartTimestamp; //游戏开始时间戳
|
||||
//private static long MAX_GAME_LENGTH = 2*60*1000; //2分钟
|
||||
private static int MAX_GAME_LENGTH = 15*1000; //15秒测试使用
|
||||
|
@ -27,29 +26,25 @@ public class Room {
|
|||
{
|
||||
this.roomId = roomId;
|
||||
this.type = type;
|
||||
roomPlayerInfos = new RoomPlayerInfo[playerArray.length];
|
||||
for(int i=0; i<playerArray.length; i++){
|
||||
roomPlayerInfos[i] = new RoomPlayerInfo(playerArray[i]);
|
||||
roomPlayerInfoMap = new HashMap<>(2);
|
||||
for(int uid:playerArray){
|
||||
roomPlayerInfoMap.put(uid,new RoomPlayerInfo(uid));
|
||||
}
|
||||
}
|
||||
|
||||
private RoomPlayerInfo getPlayer(int uid){
|
||||
for(int i=0; i<roomPlayerInfos.length; i++){
|
||||
if(roomPlayerInfos[i] != null && roomPlayerInfos[i].getUid() == uid){
|
||||
return roomPlayerInfos[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return roomPlayerInfoMap.get(uid);
|
||||
}
|
||||
public boolean removeUserIsEndGame(RoomProto.RoomCancelMatchRequest request, User user)
|
||||
{
|
||||
int curUserNumber = 0;
|
||||
for(int i=0; i<roomPlayerInfos.length; i++){
|
||||
if(user.getId() == roomPlayerInfos[i].getUid()){
|
||||
Iterator<Integer> iterator = roomPlayerInfoMap.keySet().iterator();
|
||||
while (iterator.hasNext()){
|
||||
Integer uid = iterator.next();
|
||||
if(user.getId() == uid){
|
||||
//将该用户从房间中移除
|
||||
roomPlayerInfos[i] = null;
|
||||
}
|
||||
if(roomPlayerInfos[i] != null){
|
||||
iterator.remove();
|
||||
}else{
|
||||
curUserNumber++;
|
||||
}
|
||||
}
|
||||
|
@ -67,14 +62,10 @@ public class Room {
|
|||
if(user != null){
|
||||
MessageUtil.sendRoomGameEndIndication(user.getId(), roomId);
|
||||
}
|
||||
for(int i=0; i<roomPlayerInfos.length; i++){
|
||||
if(roomPlayerInfos[i] == null) {
|
||||
continue;
|
||||
}
|
||||
//发送游戏结束消息
|
||||
user = UserManager.getUserInMem(roomPlayerInfos[i].getUid());
|
||||
Set<Integer> uids = roomPlayerInfoMap.keySet();
|
||||
for(int uid :uids){
|
||||
user = UserManager.getUserInMem(uid);
|
||||
user.getRoomInfo().setRoomId(-1);
|
||||
|
||||
MessageUtil.sendRoomGameEndIndication(user.getId(), roomId);
|
||||
}
|
||||
}
|
||||
|
@ -99,28 +90,22 @@ public class Room {
|
|||
|
||||
public void startGame(){
|
||||
gameStartTimestamp = System.currentTimeMillis();
|
||||
for(int i=0; i<roomPlayerInfos.length; i++){
|
||||
if(roomPlayerInfos[i] == null) {
|
||||
continue;
|
||||
}
|
||||
roomPlayerInfos[i].setState(RoomPlayerInfo.GAMING_STATE);
|
||||
for(RoomPlayerInfo roomPlayerInfo : roomPlayerInfoMap.values()){
|
||||
roomPlayerInfo.setState(RoomPlayerInfo.GAMING_STATE);
|
||||
//发送游戏开始消息
|
||||
MessageUtil.sendRoomStartGameIndication(roomPlayerInfos[i].getUid(), roomId, type);
|
||||
MessageUtil.sendRoomStartGameIndication(roomPlayerInfo.getUid(), roomId, type);
|
||||
}
|
||||
}
|
||||
|
||||
public void ready(int uid){
|
||||
int activeNumber = 0;
|
||||
int readyNumber = 0;
|
||||
for(int i=0; i<roomPlayerInfos.length; i++){
|
||||
if(roomPlayerInfos[i] != null){
|
||||
continue;
|
||||
}
|
||||
for(RoomPlayerInfo roomPlayerInfo : roomPlayerInfoMap.values()){
|
||||
activeNumber++;
|
||||
if(roomPlayerInfos[i].getUid() == uid){
|
||||
roomPlayerInfos[i].setState(RoomPlayerInfo.READYED_STATE);
|
||||
if(roomPlayerInfo.getUid() == uid){
|
||||
roomPlayerInfo.setState(RoomPlayerInfo.READYED_STATE);
|
||||
}
|
||||
if(roomPlayerInfos[i].getState() != RoomPlayerInfo.UNREADY_STATE){
|
||||
if(roomPlayerInfo.getState() == RoomPlayerInfo.READYED_STATE){
|
||||
readyNumber++;
|
||||
}
|
||||
}
|
||||
|
@ -149,21 +134,17 @@ public class Room {
|
|||
if(!result){
|
||||
return;
|
||||
}
|
||||
|
||||
for(int i=0; i<roomPlayerInfos.length; i++){
|
||||
if(roomPlayerInfos[i] == null){
|
||||
continue;
|
||||
}
|
||||
MessageUtil.sendRoomSyncOtherMoveIndiction(roomPlayerInfos[i].getUid(), request.getTartXYsList());
|
||||
Set<Integer> uids = roomPlayerInfoMap.keySet();
|
||||
for(int uid : uids){
|
||||
MessageUtil.sendRoomSyncOtherMoveIndiction(uid,iSession.getUid(),request.getTartXYsList());
|
||||
}
|
||||
}
|
||||
|
||||
//测试使用
|
||||
public RoomPlayerInfo[] getPlayerArray()
|
||||
{
|
||||
return roomPlayerInfos;
|
||||
public Map<Integer,RoomPlayerInfo> getRoomPlayers(){
|
||||
return roomPlayerInfoMap;
|
||||
}
|
||||
|
||||
|
||||
public int getType(){
|
||||
return type;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ljsd.jieling.logic.room;
|
||||
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
|
@ -7,12 +9,16 @@ import com.ljsd.jieling.protocols.CommonProto;
|
|||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.RoomFightProto;
|
||||
import com.ljsd.jieling.protocols.RoomProto;
|
||||
import com.ljsd.jieling.thread.task.MinuteTask;
|
||||
import com.ljsd.jieling.util.CellUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class RoomManager {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MinuteTask.class);
|
||||
//先加入的玩家,在符合规则的情况下,要先匹配上
|
||||
//value uid
|
||||
private static final List<Integer> matchingPlayerList = new ArrayList();
|
||||
|
@ -107,18 +113,22 @@ public class RoomManager {
|
|||
List<CommonProto.Cell> cells = new ArrayList<>();
|
||||
|
||||
List<RoomProto.AgentInfo> agentInfoList = new ArrayList<>();
|
||||
|
||||
Map<Integer, RoomPlayerInfo> roomPlayers = room.getRoomPlayers();
|
||||
for(int i=0; i<playerArray.length; i++)
|
||||
{
|
||||
User user = UserManager.getUserInMem(playerArray[i]);
|
||||
user.getRoomInfo().setMatching(false);
|
||||
user.getRoomInfo().setRoomId(roomId);
|
||||
RoomProto.AgentInfo.Builder agentInfoBuilder = RoomProto.AgentInfo.newBuilder();
|
||||
int curXY = CellUtil.xy2Pos(4 + i, 4 + i);
|
||||
agentInfoBuilder.setPlayerUid(user.getId())
|
||||
.setCurHp(1000)
|
||||
.setMaxHp(1000)
|
||||
.setCamp(i)
|
||||
.setCurXY(CellUtil.xy2Pos(4+i,4+i));
|
||||
.setCurXY(curXY);
|
||||
RoomPlayerInfo roomPlayerInfo = roomPlayers.get(playerArray[i]);
|
||||
roomPlayerInfo.setCurPos(curXY);
|
||||
roomPlayerInfo.setCamp(i);
|
||||
agentInfoList.add(agentInfoBuilder.build());
|
||||
}
|
||||
|
||||
|
@ -141,16 +151,15 @@ public class RoomManager {
|
|||
return;
|
||||
}
|
||||
List<CommonProto.Cell> cells = new ArrayList<>();
|
||||
RoomPlayerInfo[] playerArray = room.getPlayerArray();
|
||||
int i=0;
|
||||
Map<Integer, RoomPlayerInfo> roomPlayers = room.getRoomPlayers();
|
||||
List<RoomProto.AgentInfo> agentInfoList = new ArrayList<>();
|
||||
for(RoomPlayerInfo roomPlayerInfo:playerArray) {
|
||||
for(RoomPlayerInfo roomPlayerInfo:roomPlayers.values()) {
|
||||
RoomProto.AgentInfo.Builder agentInfoBuilder = RoomProto.AgentInfo.newBuilder();
|
||||
agentInfoBuilder.setPlayerUid(roomPlayerInfo.getUid())
|
||||
.setCurHp(1000)
|
||||
.setMaxHp(1000)
|
||||
.setCamp(i++)
|
||||
.setCurXY(CellUtil.xy2Pos(4+i,4+i));
|
||||
.setCamp(roomPlayerInfo.getCamp())
|
||||
.setCurXY(roomPlayerInfo.getCurPos());
|
||||
agentInfoList.add(agentInfoBuilder.build());
|
||||
}
|
||||
MessageUtil.sendRoomInfoToPerson(iSession, room.getType(), roomId, 1, cells, agentInfoList);
|
||||
|
@ -191,11 +200,6 @@ public class RoomManager {
|
|||
MessageUtil.sendRoomStartGameReadyResponse(iSession, responseMsgId, room.getType());
|
||||
room.ready(user.getId());
|
||||
}
|
||||
//测试使用
|
||||
public static List getMatchingPlayerList()
|
||||
{
|
||||
return matchingPlayerList;
|
||||
}
|
||||
|
||||
//客户端发起请求,获取开始游戏时的初始数据
|
||||
public static synchronized void startGameRequset(ISession iSession, RoomFightProto.RoomGameStartRequest request, int responseMsgId) throws Exception {
|
||||
|
@ -243,5 +247,67 @@ public class RoomManager {
|
|||
{
|
||||
return roomMap;
|
||||
}
|
||||
|
||||
public static void updateRoomMapEvent(ISession iSession, int triggerXY, int eventType) throws Exception {
|
||||
User user = UserManager.getUserInMem(iSession.getUid());
|
||||
int roomId = user.getRoomInfo().getRoomId();
|
||||
int responseMsgId = MessageTypeProto.MessageType.ROOM_MAP_UPDATE_EVENT_RESPONSE_VALUE;
|
||||
if(roomId == -1){
|
||||
//没有在房间中
|
||||
MessageUtil.sendErrorResponse(iSession, 0, responseMsgId, "没有在房间中");
|
||||
return;
|
||||
}
|
||||
|
||||
Room room = getRoomById(user.getRoomInfo().getRoomId());
|
||||
if(room == null){
|
||||
//房间已经销毁,如果走到这一步,说明其他地方有错了
|
||||
MessageUtil.sendErrorResponse(iSession, 0, responseMsgId, "房间已经销毁");
|
||||
return;
|
||||
}
|
||||
RoomPlayerInfo mine = room.getRoomPlayers().get(iSession.getUid());
|
||||
mine.move(System.currentTimeMillis());
|
||||
if(mine.getCurPos() != triggerXY){
|
||||
LOGGER.info("the uid={},the server pos={},the client pos ={}",iSession.getUid(),mine.getCurPos(),triggerXY);
|
||||
mine.setCurPos(triggerXY);
|
||||
}
|
||||
|
||||
MessageUtil.sendMessage(iSession, 1, responseMsgId, null,true);
|
||||
int targetUid = -1;
|
||||
for(RoomPlayerInfo roomPlayerInfo : room.getRoomPlayers().values()){
|
||||
int uid = roomPlayerInfo.getUid();
|
||||
int curPos = roomPlayerInfo.getCurPos();
|
||||
if(uid != iSession.getUid() && CellUtil.checkIsNextCell(curPos,triggerXY)){
|
||||
RoomFightProto.RoomMapPointIndication build = RoomFightProto.RoomMapPointIndication.newBuilder().setEventType(eventType).setPlayer(uid).setTriggerXY(triggerXY).build();
|
||||
sendRoomMapPointIndication(room.getRoomPlayers().keySet(),build,MessageTypeProto.MessageType.ROOM_MAP_POINT_INDICATION_VALUE);
|
||||
build = RoomFightProto.RoomMapPointIndication.newBuilder().setEventType(eventType).setPlayer(iSession.getUid()).setTriggerXY(triggerXY).build();
|
||||
sendRoomMapPointIndication(room.getRoomPlayers().keySet(),build,MessageTypeProto.MessageType.ROOM_MAP_POINT_INDICATION_VALUE);
|
||||
targetUid = uid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(targetUid!=-1){
|
||||
//更新血量
|
||||
RoomFightProto.RoomTriggerFightIndication build = RoomFightProto.RoomTriggerFightIndication.newBuilder().setFightResult(1)
|
||||
.setBluecurHp(150)
|
||||
.setBluePlayer(iSession.getUid())
|
||||
.setRedcurHp(100)
|
||||
.setRedPlayer(targetUid)
|
||||
.build();
|
||||
sendRoomMapPointIndication(room.getRoomPlayers().keySet(),build,MessageTypeProto.MessageType.ROOM_PLAY_HP_UPDATE_INDICATION_VALUE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void sendRoomMapPointIndication( Set<Integer> notifyUids,GeneratedMessage generatedMessage,int msgId){
|
||||
for(int uid : notifyUids){
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(uid);
|
||||
if(sessionByUid == null){
|
||||
continue;
|
||||
}
|
||||
MessageUtil.sendIndicationMessage(sessionByUid,1, msgId,generatedMessage,true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.logic.room;
|
||||
|
||||
import com.ljsd.jieling.protocols.RoomFightProto;
|
||||
import com.ljsd.jieling.util.CellUtil;
|
||||
import com.ljsd.jieling.util.MapPoint;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -17,8 +18,8 @@ public class RoomPlayerInfo {
|
|||
private int curPos;
|
||||
private int camp;
|
||||
private long preMoveTimestamp; //上次移动时间
|
||||
private int speed; //移动速度
|
||||
private List<Integer> path; //根据目标点计算出来的移动路径
|
||||
private int speed=500; //移动速度
|
||||
private List<Integer> path=new ArrayList<>(0); //根据目标点计算出来的移动路径
|
||||
|
||||
public RoomPlayerInfo(int uid) {
|
||||
this.uid = uid;
|
||||
|
@ -27,22 +28,14 @@ public class RoomPlayerInfo {
|
|||
|
||||
//用户移动到新位置, 返回下一个点的坐标,用户展示客户端的转向,及模拟移动
|
||||
public boolean move(List<Integer> path){
|
||||
int nextXY = path.get(0); //移动时的下一个点
|
||||
if(MapPoint.getX(curPos) == MapPoint.getX(nextXY)){
|
||||
if(MapPoint.getY(curPos) != MapPoint.getY(nextXY) + 1 || MapPoint.getY(curPos) != MapPoint.getY(nextXY) -1){
|
||||
//下一个点不是相邻的格子,作弊了
|
||||
return false;
|
||||
}
|
||||
if(!this.path.isEmpty()){
|
||||
move(System.currentTimeMillis());
|
||||
}
|
||||
if(MapPoint.getY(curPos) == MapPoint.getY(nextXY)){
|
||||
if(MapPoint.getX(curPos) != MapPoint.getX(nextXY) + 1 || MapPoint.getX(curPos) != MapPoint.getX(nextXY) -1){
|
||||
//下一个点不是相邻的格子,作弊了
|
||||
return false;
|
||||
}
|
||||
boolean continuous = CellUtil.isContinuous(curPos, path);
|
||||
if(continuous){
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
this.path = path;
|
||||
return true;
|
||||
return continuous;
|
||||
}
|
||||
|
||||
//服务器模拟移动,如果前端模拟,则不需要服务气端调用这个函数,服务器端在事件触发的时候做校验即可
|
||||
|
@ -60,6 +53,7 @@ public class RoomPlayerInfo {
|
|||
for(int i=0; i<moveDistance && i<path.size(); i++){
|
||||
curPos = path.remove(0);
|
||||
}
|
||||
preMoveTimestamp = timestamp;
|
||||
return curPos;
|
||||
}
|
||||
public int getUid() {
|
||||
|
|
|
@ -142,6 +142,10 @@ public class ISession extends NettyGameSession {
|
|||
return fiveReady;
|
||||
}
|
||||
|
||||
public void setFiveReady(int fiveReady) {
|
||||
this.fiveReady = fiveReady;
|
||||
}
|
||||
|
||||
public byte[] getFiveByteBuf() {
|
||||
return fiveByteBuf;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.io.IOException;
|
|||
public class PlatConfigureTask implements Runnable {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(PlatConfigureTask.class);
|
||||
public static int SLEEP_INTEVAL_TIME = 60 * 1000; //每1分钟检查一次
|
||||
public static int SLEEP_INTEVAL_TIME = 60; //每1分钟检查一次
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
|
|
@ -279,9 +279,9 @@ public class MessageUtil {
|
|||
builder.setServerTimestamp(System.currentTimeMillis());
|
||||
sendMessage(session, 1, responseMsgId, builder.build(), true);
|
||||
}
|
||||
public static void sendRoomSyncOtherMoveIndiction(int uid, List<Integer> path) {
|
||||
public static void sendRoomSyncOtherMoveIndiction(int uid, int targetUid,List<Integer> path) {
|
||||
RoomFightProto.RoomSyncOtherMoveIndiction.Builder builder = RoomFightProto.RoomSyncOtherMoveIndiction.newBuilder();
|
||||
builder.setUid(uid);
|
||||
builder.setUid(targetUid);
|
||||
builder.addAllTartXYs(path);
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(uid);
|
||||
if(sessionByUid!=null){
|
||||
|
|
Loading…
Reference in New Issue