mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 03:14:47 +00:00
简单PVP
This commit is contained in:
parent
98b7a52b45
commit
74aabac454
@ -147,7 +147,7 @@
|
||||
},
|
||||
"_depth": 1,
|
||||
"_stencil": 0,
|
||||
"_clearFlags": 7,
|
||||
"_clearFlags": 6,
|
||||
"_rect": {
|
||||
"__type__": "cc.Rect",
|
||||
"x": 0,
|
||||
|
@ -81,7 +81,7 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 720,
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
@ -4387,8 +4387,8 @@
|
||||
},
|
||||
"_alignFlags": 45,
|
||||
"_target": null,
|
||||
"_left": 720,
|
||||
"_right": -720,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 0,
|
||||
"_horizontalCenter": 0,
|
||||
|
File diff suppressed because it is too large
Load Diff
9
JisolGameCocos/assets/resources/prefab/ui/模式.meta
Normal file
9
JisolGameCocos/assets/resources/prefab/ui/模式.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "80f8f41e-26fe-455a-873a-da26dfd9a169",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
9
JisolGameCocos/assets/resources/prefab/ui/模式/PVP.meta
Normal file
9
JisolGameCocos/assets/resources/prefab/ui/模式/PVP.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "394ad8cd-f975-4785-a104-d76c781c17b8",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
1034
JisolGameCocos/assets/resources/prefab/ui/模式/PVP/PVP匹配页面.prefab
Normal file
1034
JisolGameCocos/assets/resources/prefab/ui/模式/PVP/PVP匹配页面.prefab
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,13 @@
|
||||
{
|
||||
"ver": "1.1.49",
|
||||
"importer": "prefab",
|
||||
"imported": true,
|
||||
"uuid": "d1bca093-45af-4ae2-a896-11ed7c6f9bda",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"syncNodeName": "PVP匹配页面"
|
||||
}
|
||||
}
|
@ -2091,10 +2091,6 @@
|
||||
"views": {
|
||||
"__id__": 37
|
||||
},
|
||||
"petIconPrefab": {
|
||||
"__uuid__": "fc8eb7b6-f756-49f4-9102-ac3cca3a20ae",
|
||||
"__expectedType__": "cc.Prefab"
|
||||
},
|
||||
"spine": {
|
||||
"__id__": 8
|
||||
},
|
||||
|
@ -24,11 +24,12 @@ import { GAction } from "./consts/GAction";
|
||||
import { StorageData, StorageEnum } from "./consts/GData";
|
||||
import { JAPI, JAPIConfig } from "../../extensions/ngame/assets/ngame/util/JAPI";
|
||||
import { AppData } from "./AppData";
|
||||
import AppAction from "./AppAction";
|
||||
|
||||
let APIPath = `http://localhost:8080`
|
||||
let WsPath = `ws://localhost:8080/websocket`
|
||||
// let APIPath = `http://192.168.0.123:8080`
|
||||
// let WsPath = `ws://192.168.0.123:8080/websocket`
|
||||
// let APIPath = `http://localhost:8080`
|
||||
// let WsPath = `ws://localhost:8080/websocket`
|
||||
let APIPath = `http://192.168.0.123:8080`
|
||||
let WsPath = `ws://192.168.0.123:8080/websocket`
|
||||
// let APIPath = `https://api.pet.jisol.cn`
|
||||
// let WsPath = `wss://api.pet.jisol.cn/websocket`
|
||||
|
||||
@ -218,12 +219,13 @@ export const app = {
|
||||
config : new JNGConfig(), //配置文件
|
||||
battleRes : new JLoaderBattle("battle"), //battle包
|
||||
data : new AppData(), //游戏基础信息
|
||||
action : new AppAction(), //游戏行为
|
||||
loading : new Loading({
|
||||
[JNGConfig.loading]:{title:"加载配置文件"},
|
||||
[JLoaderBattle.loading]:{title:"加载战斗资源"},
|
||||
[JLoaderBattle.loadingInit]:{title:"初始化战斗资源"},
|
||||
[AppData.loading]:{title:"初始化信息"},
|
||||
}),
|
||||
})
|
||||
}
|
||||
|
||||
app.api.addRequestInterceptors((config:JAPIConfig) => {
|
||||
|
23
JisolGameCocos/assets/script/AppAction.ts
Normal file
23
JisolGameCocos/assets/script/AppAction.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import SystemBase from "../../extensions/ngame/assets/ngame/system/SystemBase";
|
||||
import BaseAction from "./action/BaseAction";
|
||||
import PVPAction from "./action/PVPAction";
|
||||
|
||||
export default class AppAction extends SystemBase{
|
||||
|
||||
loadings:BaseAction[] = [
|
||||
PVPAction.getIns(), //PVP Action
|
||||
];
|
||||
|
||||
async onInit(): Promise<any> {
|
||||
|
||||
//初始化所有数据类
|
||||
for (let index = 0; index < this.loadings.length; index++) {
|
||||
const data = this.loadings[index];
|
||||
await data.onInit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
9
JisolGameCocos/assets/script/AppAction.ts.meta
Normal file
9
JisolGameCocos/assets/script/AppAction.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "b112702e-09c0-40a6-8887-ea797195488e",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
9
JisolGameCocos/assets/script/action.meta
Normal file
9
JisolGameCocos/assets/script/action.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "df61d197-2845-4513-88af-2c4ae6cdc33f",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
8
JisolGameCocos/assets/script/action/BaseAction.ts
Normal file
8
JisolGameCocos/assets/script/action/BaseAction.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import Singleton from "../../../extensions/ngame/assets/ngame/util/Singleton";
|
||||
|
||||
export default abstract class BaseAction extends Singleton {
|
||||
|
||||
//初始化
|
||||
abstract onInit();
|
||||
|
||||
}
|
9
JisolGameCocos/assets/script/action/BaseAction.ts.meta
Normal file
9
JisolGameCocos/assets/script/action/BaseAction.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "60baf66e-7156-4234-847b-ea520c1e0cc1",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
41
JisolGameCocos/assets/script/action/PVPAction.ts
Normal file
41
JisolGameCocos/assets/script/action/PVPAction.ts
Normal file
@ -0,0 +1,41 @@
|
||||
import { app } from "../App";
|
||||
import GBattleModeManager, { BattleMode } from "../battle/GBattleModeManager";
|
||||
import { GAction } from "../consts/GAction";
|
||||
import { GActionType } from "../consts/GActionType";
|
||||
import { GUI } from "../ui/UIConfig";
|
||||
import BaseAction from "./BaseAction";
|
||||
|
||||
export interface GPVPStart{
|
||||
leftTactical:string;
|
||||
rightTactical:string;
|
||||
}
|
||||
|
||||
export default class PVPAction extends BaseAction {
|
||||
|
||||
onInit(){
|
||||
app.socket.on(GAction.C_MODE_PVP_START_WAIT,this.onModePVPStartWait,this);
|
||||
app.socket.on(GAction.C_MODE_PVP_END_WAIT,this.onModePVPEndWait,this);
|
||||
app.socket.on(GAction.C_MODE_PVP_START,this.onModePVPStart,this,GActionType.GPVPStart);
|
||||
}
|
||||
|
||||
//PVP开始等待
|
||||
onModePVPStartWait(){
|
||||
//PVP 匹配页面
|
||||
app.layer.Open(GUI.PVPModeMatchView);
|
||||
}
|
||||
|
||||
//PVP结束等待
|
||||
onModePVPEndWait(){
|
||||
//PVP 匹配页面
|
||||
app.layer.Close(GUI.PVPModeMatchView);
|
||||
}
|
||||
|
||||
//开始PVP
|
||||
onModePVPStart(info:GPVPStart){
|
||||
console.log("开始PVP",info);
|
||||
GBattleModeManager.getIns().Open(BattleMode.PVP,true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
9
JisolGameCocos/assets/script/action/PVPAction.ts.meta
Normal file
9
JisolGameCocos/assets/script/action/PVPAction.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "20d83911-fbc5-40d3-b970-b48ab4a529bf",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@ -64,7 +64,7 @@ export default class GPVPMode extends GBaseMode<{}>{
|
||||
|
||||
//调整相机
|
||||
let camreaPos = this.camera.node.worldPosition;
|
||||
this.camera.node.worldPosition = v3(0,100,camreaPos.z)
|
||||
this.camera.node.worldPosition = v3(0,800,camreaPos.z)
|
||||
|
||||
//初始化战斗
|
||||
console.log("GPVPMode 模式初始化");
|
||||
|
@ -11,6 +11,6 @@ export const GAPI = {
|
||||
//捕捉野怪
|
||||
GOnHookCatchCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onCatchCreeps/${creepId}`)) as PlayerPetOV,
|
||||
//出售野怪
|
||||
GOnHookSellCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onSellCreeps/${creepId}`)),
|
||||
GOnHookSellCreeps : async (creepId) => RData(await app.api.post(`/game/mode/onHook/onSellCreeps/${creepId}`)) as boolean,
|
||||
|
||||
}
|
@ -6,7 +6,14 @@ export enum GAction {
|
||||
CHAT_MESSAGE = 2001, //发送聊天消息
|
||||
CHAT_RECEIVE_MESSAGE = 2002, //接受聊天消息
|
||||
|
||||
|
||||
/*************** 游戏模式 : 无尽模式(OnHook) **************/
|
||||
/*************** 游戏模式 : PVP模式 **************/
|
||||
S_MODE_PVP_JOIN = 3001, //加入PVP
|
||||
S_MODE_PVP_LEAVE = 3002, //离开PVP
|
||||
C_MODE_PVP_WAIT = 3003, //等待PVP开始
|
||||
C_MODE_PVP_START = 3004, //PVP开始
|
||||
C_MODE_PVP_END = 3005, //PVP结束
|
||||
C_MODE_PVP_START_WAIT = 3006, //开始等待PVP开始
|
||||
C_MODE_PVP_END_WAIT = 3007, //结束等待PVP开始
|
||||
|
||||
}
|
@ -11,4 +11,7 @@ export enum GActionType {
|
||||
GOnHookPet = "GOnHookPet", //野怪
|
||||
GOnHookPets = "GOnHookPets", //野怪列表
|
||||
|
||||
/*************** 游戏模式 : PVP **************/
|
||||
GPVPStart = "GPVPStart", //PVP 开始
|
||||
|
||||
}
|
@ -5,6 +5,7 @@ import PlayerData from '../../data/PlayerData';
|
||||
import GBattleModeManager, { BattleMode } from '../../battle/GBattleModeManager';
|
||||
import { JNGLayerBase } from '../../components/JNComponent';
|
||||
import { app } from '../../App';
|
||||
import { GAction } from '../../consts/GAction';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('MainView')
|
||||
@ -47,6 +48,11 @@ export class MainView extends JNGLayerBase {
|
||||
GBattleModeManager.getIns().Open(BattleMode.OnHook,true);
|
||||
}
|
||||
|
||||
//点击PVP模式
|
||||
onOpenPVP(){
|
||||
app.socket.Send(GAction.S_MODE_PVP_JOIN);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
9
JisolGameCocos/assets/script/ui/Mode.meta
Normal file
9
JisolGameCocos/assets/script/ui/Mode.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "7767a760-8e96-4bf8-8289-030e5a8c91c5",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
9
JisolGameCocos/assets/script/ui/Mode/PVP.meta
Normal file
9
JisolGameCocos/assets/script/ui/Mode/PVP.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "37638c81-4459-4c8d-8054-e5789bce2590",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
37
JisolGameCocos/assets/script/ui/Mode/PVP/PVPMatchView.ts
Normal file
37
JisolGameCocos/assets/script/ui/Mode/PVP/PVPMatchView.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { JNGLayerBase } from '../../../components/JNComponent';
|
||||
import { tween } from 'cc';
|
||||
import { v3 } from 'cc';
|
||||
import { app } from '../../../App';
|
||||
import { GAction } from '../../../consts/GAction';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/**
|
||||
* 游戏匹配页面
|
||||
*/
|
||||
@ccclass('PVPMatchView')
|
||||
export class PVPMatchView extends JNGLayerBase {
|
||||
|
||||
@property(Node)
|
||||
content:Node;
|
||||
|
||||
onJNLoad(data?: any): void {
|
||||
super.onJNLoad(data);
|
||||
tween(this.content)
|
||||
.repeatForever(
|
||||
tween()
|
||||
.to(.5,{scale:v3(.8,.8,.8)})
|
||||
.to(.5,{scale:v3(1,1,1)})
|
||||
)
|
||||
.start();
|
||||
|
||||
}
|
||||
|
||||
//取消匹配
|
||||
onClickCancel(){
|
||||
app.socket.Send(GAction.S_MODE_PVP_LEAVE)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "9979d56d-f754-44c3-8e29-c764eaeb0aaf",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@ -23,6 +23,9 @@ export enum GUI{
|
||||
|
||||
IntoBattleView = "IntoBattleView", //上阵页面
|
||||
|
||||
/**游戏模式页面 */
|
||||
PVPModeMatchView = "PVPModeMatchView", //PVP模式匹配页面
|
||||
|
||||
Home = "Home", //主页面
|
||||
Main = "Main", //主页面2
|
||||
}
|
||||
@ -97,6 +100,17 @@ const UINoviceConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
|
||||
}
|
||||
|
||||
//游戏模式页面
|
||||
const UIGModeConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
|
||||
[GUI.PVPModeMatchView]:{
|
||||
layer:GLayer.Popup,
|
||||
uri: "prefab/ui/模式/PVP/PVP匹配页面",
|
||||
anims:BackOutScale
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
export const UIConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
[GUI.Home]:{
|
||||
layer:GLayer.View,
|
||||
@ -121,5 +135,6 @@ export const UIConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
...UISystemConfig, //系统页面
|
||||
...UINoviceConfig, //新手引导页面
|
||||
...UIMainConfig, //主页面
|
||||
...UIGModeConfig, //游戏模式页面
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit be42908eaecd47d952a79d2f1549bd0dd4176765
|
||||
Subproject commit ddba756071599f88801c2001235b59b152117740
|
12
JisolGameCocos/proto/GPVPMessage.proto
Normal file
12
JisolGameCocos/proto/GPVPMessage.proto
Normal file
@ -0,0 +1,12 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option java_package = "cn.jisol.ngame.proto";
|
||||
|
||||
|
||||
//PVP 开始
|
||||
message GPVPStart {
|
||||
string leftTactical = 1; //左边的布阵
|
||||
string rightTactical = 2; //右边的布阵
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit f3c05c98992ccc4c4bc45ca120b3fcaf5ff6af58
|
||||
Subproject commit 9e2487e3e4ab43fe9c1f4e736bc7f75244f2f21b
|
@ -1,5 +1,6 @@
|
||||
package cn.jisol.game;
|
||||
|
||||
import cn.jisol.ngame.util.spring.SpringBeanUtils;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@ -10,6 +11,6 @@ import org.springframework.context.ApplicationContext;
|
||||
@SpringBootApplication
|
||||
public class JGameApplication {
|
||||
public static void main(String[] args) {
|
||||
ApplicationContext applicationContext = SpringApplication.run(JGameApplication.class);
|
||||
SpringBeanUtils.context = SpringApplication.run(JGameApplication.class);
|
||||
}
|
||||
}
|
||||
|
@ -8,4 +8,13 @@ public interface GActionEnum {
|
||||
int CHAT_MESSAGE = 2001; //发送聊天消息
|
||||
int CHAT_RECEIVE_MESSAGE = 2002; //接受聊天消息
|
||||
|
||||
/*************** PVP *********************/
|
||||
int S_MODE_PVP_JOIN = 3001; //加入PVP
|
||||
int S_MODE_PVP_LEAVE = 3002; //离开PVP
|
||||
int C_MODE_PVP_WAIT = 3003; //等待PVP开始
|
||||
int C_MODE_PVP_START = 3004; //PVP开始
|
||||
int C_MODE_PVP_END = 3005; //PVP结束
|
||||
int C_MODE_PVP_START_WAIT = 3006; //开始等待PVP开始
|
||||
int C_MODE_PVP_END_WAIT = 3007; //结束等待PVP开始
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,120 @@
|
||||
package cn.jisol.game.actions.onhook;
|
||||
|
||||
import cn.jisol.game.actions.GActionEnum;
|
||||
import cn.jisol.game.controller.game.GPlayerTacticalController;
|
||||
import cn.jisol.game.entity.game.PlayerTactical;
|
||||
import cn.jisol.game.network.client.GClient;
|
||||
import cn.jisol.game.proto.GPVPMessage;
|
||||
import cn.jisol.game.service.PlayerTacticalService;
|
||||
import cn.jisol.ngame.actions.core.NAction;
|
||||
import cn.jisol.ngame.actions.core.NActionMethod;
|
||||
import cn.jisol.ngame.util.spring.SpringBeanUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
//PVP 模式
|
||||
@NAction
|
||||
public class GPVPAction {
|
||||
|
||||
//当前等待PVP的玩家
|
||||
static LinkedList<GClient> pool = new LinkedList<>();
|
||||
|
||||
//等待通知定时器
|
||||
static Timer timer;
|
||||
|
||||
static {
|
||||
|
||||
timer = new Timer();
|
||||
timer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
GPVPAction.onWaitTimer();
|
||||
}
|
||||
},0,1000);
|
||||
|
||||
}
|
||||
|
||||
//加入PVP
|
||||
@NActionMethod(GActionEnum.S_MODE_PVP_JOIN)
|
||||
public static synchronized void onJoinPVP(GClient client){
|
||||
|
||||
//如果加入过 PVP 则返回
|
||||
if(pool.contains(client)) return;
|
||||
|
||||
for (int i = 0; i < pool.size(); i++) {
|
||||
GClient item = pool.get(i);
|
||||
if (item.player.getPlayerId().equals(client.player.getPlayerId())){
|
||||
//移除玩家
|
||||
pool.remove(item);
|
||||
}
|
||||
}
|
||||
|
||||
//如果没有加入则加入
|
||||
pool.add(client);
|
||||
|
||||
//通知开始等待
|
||||
client.invoke(GActionEnum.C_MODE_PVP_START_WAIT);
|
||||
|
||||
GPVPAction.onUpdateMatchGame();
|
||||
|
||||
}
|
||||
|
||||
//离开PVP
|
||||
@NActionMethod(GActionEnum.S_MODE_PVP_LEAVE)
|
||||
public static void onJoinLeave(GClient client){
|
||||
|
||||
//如果加入过 则 离开
|
||||
if(pool.contains(client)) {
|
||||
pool.remove(client);
|
||||
client.invoke(GActionEnum.C_MODE_PVP_END_WAIT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//刷新匹配
|
||||
public static void onUpdateMatchGame(){
|
||||
|
||||
//判断是否有两人在等待 有 则两人匹配成功
|
||||
while (pool.size() >= 2){
|
||||
//匹配成功
|
||||
GClient client1 = pool.poll();
|
||||
GClient client2 = pool.poll();
|
||||
|
||||
if(Objects.isNull(client1) || Objects.isNull(client2)) continue;
|
||||
//确保玩家都在线
|
||||
if(!(client1.isOpen() && client2.isOpen())){
|
||||
if(client2.isOpen()) pool.addFirst(client2);
|
||||
if(client1.isOpen()) pool.addFirst(client1);
|
||||
continue;
|
||||
}
|
||||
|
||||
//获取双方的阵型
|
||||
GPlayerTacticalController tactical = SpringBeanUtils.getBean(GPlayerTacticalController.class);
|
||||
|
||||
//构建匹配信息
|
||||
GPVPMessage.GPVPStart info = GPVPMessage.GPVPStart.newBuilder()
|
||||
.setLeftTactical(tactical.getInfo(client1.player).data.getTacticalData())
|
||||
.setRightTactical(tactical.getInfo(client2.player).data.getTacticalData())
|
||||
.build();
|
||||
|
||||
//取消等待
|
||||
client1.invoke(GActionEnum.C_MODE_PVP_END_WAIT);
|
||||
client2.invoke(GActionEnum.C_MODE_PVP_END_WAIT);
|
||||
|
||||
//PVP 开始
|
||||
client1.invoke(GActionEnum.C_MODE_PVP_START, info);
|
||||
client2.invoke(GActionEnum.C_MODE_PVP_START, info);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//通知玩家等待定时器
|
||||
public static void onWaitTimer(){
|
||||
//向所有玩家发送等待
|
||||
pool.forEach(client -> {
|
||||
client.invoke(GActionEnum.C_MODE_PVP_WAIT);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -47,6 +47,11 @@ public class GPlayerTacticalController {
|
||||
info = playerTacticalService.getById(player.getPlayerId());
|
||||
}
|
||||
|
||||
//如果没有阵法则默认一个阵法
|
||||
if(Objects.isNull(info.getTacticalData())){
|
||||
info.setTacticalData("[0,0,0,0,0,0,0,0,0]");
|
||||
}
|
||||
|
||||
return NewsContext.onSuccess("获取成功",info);
|
||||
|
||||
}
|
||||
|
@ -43,4 +43,8 @@ public class GClient extends QueueNClient {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpen() {
|
||||
return session.isOpen();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,848 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: GPVPMessage.proto
|
||||
|
||||
package cn.jisol.game.proto;
|
||||
|
||||
public final class GPVPMessage {
|
||||
private GPVPMessage() {}
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||
}
|
||||
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistry registry) {
|
||||
registerAllExtensions(
|
||||
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||
}
|
||||
public interface GPVPStartOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:GPVPStart)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
*左边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string leftTactical = 1;</code>
|
||||
* @return The leftTactical.
|
||||
*/
|
||||
java.lang.String getLeftTactical();
|
||||
/**
|
||||
* <pre>
|
||||
*左边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string leftTactical = 1;</code>
|
||||
* @return The bytes for leftTactical.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getLeftTacticalBytes();
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
*右边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string rightTactical = 2;</code>
|
||||
* @return The rightTactical.
|
||||
*/
|
||||
java.lang.String getRightTactical();
|
||||
/**
|
||||
* <pre>
|
||||
*右边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string rightTactical = 2;</code>
|
||||
* @return The bytes for rightTactical.
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getRightTacticalBytes();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
*PVP 开始
|
||||
* </pre>
|
||||
*
|
||||
* Protobuf type {@code GPVPStart}
|
||||
*/
|
||||
public static final class GPVPStart extends
|
||||
com.google.protobuf.GeneratedMessageV3 implements
|
||||
// @@protoc_insertion_point(message_implements:GPVPStart)
|
||||
GPVPStartOrBuilder {
|
||||
private static final long serialVersionUID = 0L;
|
||||
// Use GPVPStart.newBuilder() to construct.
|
||||
private GPVPStart(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||
super(builder);
|
||||
}
|
||||
private GPVPStart() {
|
||||
leftTactical_ = "";
|
||||
rightTactical_ = "";
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@SuppressWarnings({"unused"})
|
||||
protected java.lang.Object newInstance(
|
||||
UnusedPrivateParameter unused) {
|
||||
return new GPVPStart();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final com.google.protobuf.UnknownFieldSet
|
||||
getUnknownFields() {
|
||||
return this.unknownFields;
|
||||
}
|
||||
private GPVPStart(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
this();
|
||||
if (extensionRegistry == null) {
|
||||
throw new java.lang.NullPointerException();
|
||||
}
|
||||
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||
com.google.protobuf.UnknownFieldSet.newBuilder();
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
int tag = input.readTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
case 10: {
|
||||
java.lang.String s = input.readStringRequireUtf8();
|
||||
|
||||
leftTactical_ = s;
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
java.lang.String s = input.readStringRequireUtf8();
|
||||
|
||||
rightTactical_ = s;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if (!parseUnknownField(
|
||||
input, unknownFields, extensionRegistry, tag)) {
|
||||
done = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (com.google.protobuf.UninitializedMessageException e) {
|
||||
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new com.google.protobuf.InvalidProtocolBufferException(
|
||||
e).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
this.unknownFields = unknownFields.build();
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return GPVPMessage.internal_static_GPVPStart_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return GPVPMessage.internal_static_GPVPStart_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
GPVPMessage.GPVPStart.class, GPVPMessage.GPVPStart.Builder.class);
|
||||
}
|
||||
|
||||
public static final int LEFTTACTICAL_FIELD_NUMBER = 1;
|
||||
private volatile java.lang.Object leftTactical_;
|
||||
/**
|
||||
* <pre>
|
||||
*左边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string leftTactical = 1;</code>
|
||||
* @return The leftTactical.
|
||||
*/
|
||||
@java.lang.Override
|
||||
public java.lang.String getLeftTactical() {
|
||||
java.lang.Object ref = leftTactical_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
return (java.lang.String) ref;
|
||||
} else {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
leftTactical_ = s;
|
||||
return s;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
*左边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string leftTactical = 1;</code>
|
||||
* @return The bytes for leftTactical.
|
||||
*/
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.ByteString
|
||||
getLeftTacticalBytes() {
|
||||
java.lang.Object ref = leftTactical_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
leftTactical_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
|
||||
public static final int RIGHTTACTICAL_FIELD_NUMBER = 2;
|
||||
private volatile java.lang.Object rightTactical_;
|
||||
/**
|
||||
* <pre>
|
||||
*右边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string rightTactical = 2;</code>
|
||||
* @return The rightTactical.
|
||||
*/
|
||||
@java.lang.Override
|
||||
public java.lang.String getRightTactical() {
|
||||
java.lang.Object ref = rightTactical_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
return (java.lang.String) ref;
|
||||
} else {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
rightTactical_ = s;
|
||||
return s;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
*右边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string rightTactical = 2;</code>
|
||||
* @return The bytes for rightTactical.
|
||||
*/
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.ByteString
|
||||
getRightTacticalBytes() {
|
||||
java.lang.Object ref = rightTactical_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
rightTactical_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
|
||||
private byte memoizedIsInitialized = -1;
|
||||
@java.lang.Override
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(leftTactical_)) {
|
||||
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, leftTactical_);
|
||||
}
|
||||
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rightTactical_)) {
|
||||
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, rightTactical_);
|
||||
}
|
||||
unknownFields.writeTo(output);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(leftTactical_)) {
|
||||
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, leftTactical_);
|
||||
}
|
||||
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rightTactical_)) {
|
||||
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, rightTactical_);
|
||||
}
|
||||
size += unknownFields.getSerializedSize();
|
||||
memoizedSize = size;
|
||||
return size;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public boolean equals(final java.lang.Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof GPVPMessage.GPVPStart)) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
GPVPMessage.GPVPStart other = (GPVPMessage.GPVPStart) obj;
|
||||
|
||||
if (!getLeftTactical()
|
||||
.equals(other.getLeftTactical())) return false;
|
||||
if (!getRightTactical()
|
||||
.equals(other.getRightTactical())) return false;
|
||||
if (!unknownFields.equals(other.unknownFields)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public int hashCode() {
|
||||
if (memoizedHashCode != 0) {
|
||||
return memoizedHashCode;
|
||||
}
|
||||
int hash = 41;
|
||||
hash = (19 * hash) + getDescriptor().hashCode();
|
||||
hash = (37 * hash) + LEFTTACTICAL_FIELD_NUMBER;
|
||||
hash = (53 * hash) + getLeftTactical().hashCode();
|
||||
hash = (37 * hash) + RIGHTTACTICAL_FIELD_NUMBER;
|
||||
hash = (53 * hash) + getRightTactical().hashCode();
|
||||
hash = (29 * hash) + unknownFields.hashCode();
|
||||
memoizedHashCode = hash;
|
||||
return hash;
|
||||
}
|
||||
|
||||
public static GPVPMessage.GPVPStart parseFrom(
|
||||
java.nio.ByteBuffer data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static GPVPMessage.GPVPStart parseFrom(
|
||||
java.nio.ByteBuffer data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static GPVPMessage.GPVPStart parseFrom(
|
||||
com.google.protobuf.ByteString data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static GPVPMessage.GPVPStart parseFrom(
|
||||
com.google.protobuf.ByteString data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static GPVPMessage.GPVPStart parseFrom(byte[] data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static GPVPMessage.GPVPStart parseFrom(
|
||||
byte[] data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static GPVPMessage.GPVPStart parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input);
|
||||
}
|
||||
public static GPVPMessage.GPVPStart parseFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
public static GPVPMessage.GPVPStart parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseDelimitedWithIOException(PARSER, input);
|
||||
}
|
||||
public static GPVPMessage.GPVPStart parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
public static GPVPMessage.GPVPStart parseFrom(
|
||||
com.google.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input);
|
||||
}
|
||||
public static GPVPMessage.GPVPStart parseFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder newBuilderForType() { return newBuilder(); }
|
||||
public static Builder newBuilder() {
|
||||
return DEFAULT_INSTANCE.toBuilder();
|
||||
}
|
||||
public static Builder newBuilder(GPVPMessage.GPVPStart prototype) {
|
||||
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder toBuilder() {
|
||||
return this == DEFAULT_INSTANCE
|
||||
? new Builder() : new Builder().mergeFrom(this);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected Builder newBuilderForType(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
Builder builder = new Builder(parent);
|
||||
return builder;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
*PVP 开始
|
||||
* </pre>
|
||||
*
|
||||
* Protobuf type {@code GPVPStart}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
||||
// @@protoc_insertion_point(builder_implements:GPVPStart)
|
||||
GPVPMessage.GPVPStartOrBuilder {
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return GPVPMessage.internal_static_GPVPStart_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return GPVPMessage.internal_static_GPVPStart_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
GPVPMessage.GPVPStart.class, GPVPMessage.GPVPStart.Builder.class);
|
||||
}
|
||||
|
||||
// Construct using cn.jisol.game.proto.GPVPMessage.GPVPStart.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
|
||||
private Builder(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
super(parent);
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
private void maybeForceBuilderInitialization() {
|
||||
if (com.google.protobuf.GeneratedMessageV3
|
||||
.alwaysUseFieldBuilders) {
|
||||
}
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
leftTactical_ = "";
|
||||
|
||||
rightTactical_ = "";
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptorForType() {
|
||||
return GPVPMessage.internal_static_GPVPStart_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public GPVPMessage.GPVPStart getDefaultInstanceForType() {
|
||||
return GPVPMessage.GPVPStart.getDefaultInstance();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public GPVPMessage.GPVPStart build() {
|
||||
GPVPMessage.GPVPStart result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public GPVPMessage.GPVPStart buildPartial() {
|
||||
GPVPMessage.GPVPStart result = new GPVPMessage.GPVPStart(this);
|
||||
result.leftTactical_ = leftTactical_;
|
||||
result.rightTactical_ = rightTactical_;
|
||||
onBuilt();
|
||||
return result;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder clone() {
|
||||
return super.clone();
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.setField(field, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field) {
|
||||
return super.clearField(field);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearOneof(
|
||||
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
|
||||
return super.clearOneof(oneof);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
int index, java.lang.Object value) {
|
||||
return super.setRepeatedField(field, index, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder addRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.addRepeatedField(field, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
if (other instanceof GPVPMessage.GPVPStart) {
|
||||
return mergeFrom((GPVPMessage.GPVPStart)other);
|
||||
} else {
|
||||
super.mergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder mergeFrom(GPVPMessage.GPVPStart other) {
|
||||
if (other == GPVPMessage.GPVPStart.getDefaultInstance()) return this;
|
||||
if (!other.getLeftTactical().isEmpty()) {
|
||||
leftTactical_ = other.leftTactical_;
|
||||
onChanged();
|
||||
}
|
||||
if (!other.getRightTactical().isEmpty()) {
|
||||
rightTactical_ = other.rightTactical_;
|
||||
onChanged();
|
||||
}
|
||||
this.mergeUnknownFields(other.unknownFields);
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final boolean isInitialized() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
GPVPMessage.GPVPStart parsedMessage = null;
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (GPVPMessage.GPVPStart) e.getUnfinishedMessage();
|
||||
throw e.unwrapIOException();
|
||||
} finally {
|
||||
if (parsedMessage != null) {
|
||||
mergeFrom(parsedMessage);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
private java.lang.Object leftTactical_ = "";
|
||||
/**
|
||||
* <pre>
|
||||
*左边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string leftTactical = 1;</code>
|
||||
* @return The leftTactical.
|
||||
*/
|
||||
public java.lang.String getLeftTactical() {
|
||||
java.lang.Object ref = leftTactical_;
|
||||
if (!(ref instanceof java.lang.String)) {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
leftTactical_ = s;
|
||||
return s;
|
||||
} else {
|
||||
return (java.lang.String) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
*左边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string leftTactical = 1;</code>
|
||||
* @return The bytes for leftTactical.
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getLeftTacticalBytes() {
|
||||
java.lang.Object ref = leftTactical_;
|
||||
if (ref instanceof String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
leftTactical_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
*左边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string leftTactical = 1;</code>
|
||||
* @param value The leftTactical to set.
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setLeftTactical(
|
||||
java.lang.String value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
leftTactical_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
*左边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string leftTactical = 1;</code>
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearLeftTactical() {
|
||||
|
||||
leftTactical_ = getDefaultInstance().getLeftTactical();
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
*左边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string leftTactical = 1;</code>
|
||||
* @param value The bytes for leftTactical to set.
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setLeftTacticalBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
checkByteStringIsUtf8(value);
|
||||
|
||||
leftTactical_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
private java.lang.Object rightTactical_ = "";
|
||||
/**
|
||||
* <pre>
|
||||
*右边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string rightTactical = 2;</code>
|
||||
* @return The rightTactical.
|
||||
*/
|
||||
public java.lang.String getRightTactical() {
|
||||
java.lang.Object ref = rightTactical_;
|
||||
if (!(ref instanceof java.lang.String)) {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
rightTactical_ = s;
|
||||
return s;
|
||||
} else {
|
||||
return (java.lang.String) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
*右边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string rightTactical = 2;</code>
|
||||
* @return The bytes for rightTactical.
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getRightTacticalBytes() {
|
||||
java.lang.Object ref = rightTactical_;
|
||||
if (ref instanceof String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
rightTactical_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
*右边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string rightTactical = 2;</code>
|
||||
* @param value The rightTactical to set.
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setRightTactical(
|
||||
java.lang.String value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
rightTactical_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
*右边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string rightTactical = 2;</code>
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearRightTactical() {
|
||||
|
||||
rightTactical_ = getDefaultInstance().getRightTactical();
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
*右边的布阵
|
||||
* </pre>
|
||||
*
|
||||
* <code>string rightTactical = 2;</code>
|
||||
* @param value The bytes for rightTactical to set.
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setRightTacticalBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
checkByteStringIsUtf8(value);
|
||||
|
||||
rightTactical_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@java.lang.Override
|
||||
public final Builder setUnknownFields(
|
||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||
return super.setUnknownFields(unknownFields);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final Builder mergeUnknownFields(
|
||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||
return super.mergeUnknownFields(unknownFields);
|
||||
}
|
||||
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:GPVPStart)
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:GPVPStart)
|
||||
private static final GPVPMessage.GPVPStart DEFAULT_INSTANCE;
|
||||
static {
|
||||
DEFAULT_INSTANCE = new GPVPMessage.GPVPStart();
|
||||
}
|
||||
|
||||
public static GPVPMessage.GPVPStart getDefaultInstance() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
private static final com.google.protobuf.Parser<GPVPStart>
|
||||
PARSER = new com.google.protobuf.AbstractParser<GPVPStart>() {
|
||||
@java.lang.Override
|
||||
public GPVPStart parsePartialFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return new GPVPStart(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
public static com.google.protobuf.Parser<GPVPStart> parser() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Parser<GPVPStart> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public GPVPMessage.GPVPStart getDefaultInstanceForType() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_GPVPStart_descriptor;
|
||||
private static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_GPVPStart_fieldAccessorTable;
|
||||
|
||||
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||
getDescriptor() {
|
||||
return descriptor;
|
||||
}
|
||||
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||
descriptor;
|
||||
static {
|
||||
java.lang.String[] descriptorData = {
|
||||
"\n\021GPVPMessage.proto\"8\n\tGPVPStart\022\024\n\014left" +
|
||||
"Tactical\030\001 \001(\t\022\025\n\rrightTactical\030\002 \001(\tB\026\n" +
|
||||
"\024cn.jisol.ngame.protob\006proto3"
|
||||
};
|
||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(descriptorData,
|
||||
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||
});
|
||||
internal_static_GPVPStart_descriptor =
|
||||
getDescriptor().getMessageTypes().get(0);
|
||||
internal_static_GPVPStart_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_GPVPStart_descriptor,
|
||||
new java.lang.String[] { "LeftTactical", "RightTactical", });
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(outer_class_scope)
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option java_package = "cn.jisol.ngame.proto";
|
||||
|
||||
|
||||
//PVP 开始
|
||||
message GPVPStart {
|
||||
string leftTactical = 1; //左边的布阵
|
||||
string rightTactical = 2; //右边的布阵
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user