From 7e0f6ea21a5b3e3ad3f4208c1333d0b4f8835bf8 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 14 Feb 2023 11:29:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0pvp=E9=87=8D=E8=BF=9E?= =?UTF-8?q?=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 5 +- comm/imodule.go | 2 + modules/battle/battleclientmgr.go | 11 + modules/battle/module.go | 15 ++ modules/comp_model.go | 4 +- modules/gateway/agent.go | 10 +- modules/pvp/api_into.go | 45 ++++ modules/pvp/modelPvp.go | 43 +++ modules/pvp/module.go | 62 ++++- pb/battle_msg.pb.go | 430 +++++++++++++++++++++++------- pb/pvp_db.pb.go | 116 ++++---- pb/pvp_msg.pb.go | 429 +++++++++++++++++++++-------- services/comp_gateroute.go | 3 + 13 files changed, 885 insertions(+), 290 deletions(-) create mode 100644 modules/pvp/api_into.go diff --git a/comm/const.go b/comm/const.go index 34108cc63..55ea51491 100644 --- a/comm/const.go +++ b/comm/const.go @@ -216,8 +216,11 @@ const ( // 自动战斗 TableAuto = "autoBattle" - ///新主线数据表 + // 新主线数据表 TableMline = "mline" + + // pvp + TablePvp = "pvp" ) // RPC服务接口定义处 diff --git a/comm/imodule.go b/comm/imodule.go index 454396160..adbefbab6 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -236,6 +236,8 @@ type ( CreatePvpBattle(session IUserSession, req *pb.BattlePVPReq) (code pb.ErrorCode, record *pb.DBBattleRecord) ///同步pvp战斗 CreateRtPvpBattle(req *pb.BattleRTPVPReq) (code pb.ErrorCode, record *pb.DBBattleRecord) + ///获取战斗详情 + GetBattleInfo(req *pb.BattleGetInfoReq) (code pb.ErrorCode, resp *pb.BattleGetInfoResp) ///创建战斗服务 CreateBattleServer(req *pb.BattleInfo) (code pb.ErrorCode) ///战斗指令输入 diff --git a/modules/battle/battleclientmgr.go b/modules/battle/battleclientmgr.go index 5091cfa36..43f2d2fec 100644 --- a/modules/battle/battleclientmgr.go +++ b/modules/battle/battleclientmgr.go @@ -70,6 +70,17 @@ func (this *battleClientMgrComp) CheckBattle(ctx context.Context, req *pb.Battle return } +//实时pvp战斗创建 +func (this *battleClientMgrComp) GetInfo(ctx context.Context, req *pb.BattleGetInfoReq) (reply *pb.BattleGetInfoReq, err error) { + this.module.Debug("CreateBattle", log.Field{Key: "req", Value: req}) + + reply = &pb.BattleGetInfoReq{} + if err = this.clinet.callBattle(ctx, "GetInfo", req, reply); err != nil { + this.module.Errorln(err) + } + return +} + //实时pvp战斗创建 func (this *battleClientMgrComp) CreateBattle(ctx context.Context, req *pb.BattleCreateServerReq) (reply *pb.BattleCreateServerResp, err error) { this.module.Debug("CreateBattle", log.Field{Key: "req", Value: req}) diff --git a/modules/battle/module.go b/modules/battle/module.go index fe6d35579..f65948e22 100644 --- a/modules/battle/module.go +++ b/modules/battle/module.go @@ -220,6 +220,21 @@ func (this *Battle) CreateRtPvpBattle(req *pb.BattleRTPVPReq) (code pb.ErrorCode return } +///获取战斗详情 +func (this *Battle) GetBattleInfo(req *pb.BattleGetInfoReq) (code pb.ErrorCode, resp *pb.BattleGetInfoReq) { + this.Debug("GetBattleInfo", log.Field{Key: "req", Value: req}) + var ( + ctx context.Context + err error + ) + ctx, _ = context.WithTimeout(context.Background(), time.Second*5) + if resp, err = this.clientmgr.GetInfo(ctx, req); err != nil { + this.Errorln(err) + code = pb.ErrorCode_RpcFuncExecutionError + } + return +} + //创建战斗服务 func (this *Battle) CreateBattleServer(req *pb.BattleInfo) (code pb.ErrorCode) { this.Debug("CreateBattleServer", log.Field{Key: "req", Value: req}) diff --git a/modules/comp_model.go b/modules/comp_model.go index 4f0c36f2e..cadaeb6ea 100644 --- a/modules/comp_model.go +++ b/modules/comp_model.go @@ -139,8 +139,8 @@ func (this *MCompModel) GetListObjs(uid string, ids []string, data interface{}) } //删除目标数据 -func (this *MCompModel) Del(uid string, opt ...db.DBOption) (err error) { - return this.DBModel.Del(uid, opt...) +func (this *MCompModel) Del(id string, opt ...db.DBOption) (err error) { + return this.DBModel.Del(id, opt...) } //删除用户数据 diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index 741075115..ff7d3ff49 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -77,7 +77,7 @@ locp: go this.Close() break locp } else { - this.gateway.Debugf("----------1 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) + // this.gateway.Debugf("----------1 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) var code pb.ErrorCode code, err = this.secAuth(msg) if err == nil { @@ -93,7 +93,7 @@ locp: //this.wsConn.SetReadDeadline(time.Now().Add(time.Second * 30)) continue } - this.gateway.Debugf("----------2 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) + // this.gateway.Debugf("----------2 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) if err := this.messageDistribution(msg); err != nil { this.gateway.Errorf("messageDistribution err:%v", err) go this.Close() @@ -303,10 +303,10 @@ func (this *Agent) messageDistribution(msg *pb.UserMessage) (err error) { } } stime := time.Now() - this.gateway.Debugf("----------3 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) + // this.gateway.Debugf("----------3 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) ctx, _ := context.WithTimeout(context.Background(), time.Second*5) if len(serviceTag) == 0 { - this.gateway.Debugf("----------4 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) + // this.gateway.Debugf("----------4 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) if err = this.gateway.Service().RpcCall(ctx, servicePath, string(comm.Rpc_GatewayRoute), req, reply); err != nil { this.gateway.Error("[UserResponse]", log.Field{Key: "uid", Value: this.uId}, @@ -319,7 +319,7 @@ func (this *Agent) messageDistribution(msg *pb.UserMessage) (err error) { return } } else { //跨集群调用 - this.gateway.Debugf("----------5 agent:%s uId:%s servicePath:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.ServicePath, msg.MainType, msg.SubType) + // this.gateway.Debugf("----------5 agent:%s uId:%s servicePath:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.ServicePath, msg.MainType, msg.SubType) if msg.ServicePath != "" { //客户端是否制定目标服务器 /wroker/woker0 servicePath = msg.ServicePath } diff --git a/modules/pvp/api_into.go b/modules/pvp/api_into.go new file mode 100644 index 000000000..9dd1e0eec --- /dev/null +++ b/modules/pvp/api_into.go @@ -0,0 +1,45 @@ +package pvp + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) IntoCheck(session comm.IUserSession, req *pb.PvpIntoReq) (code pb.ErrorCode) { + return +} + +///设置战斗阵型 +func (this *apiComp) Into(session comm.IUserSession, req *pb.PvpIntoReq) (code pb.ErrorCode, data proto.Message) { + var ( + battle *BattleItem + resp *pb.BattleGetInfoResp = &pb.BattleGetInfoResp{} + cd pb.ErrorCode + ok bool + ) + if code = this.IntoCheck(session, req); code != pb.ErrorCode_Success { + return + } + this.module.lock.RLock() + battle, ok = this.module.battles[req.Battleid] + this.module.lock.RUnlock() + if ok { + if cd, resp = this.module.battle.GetBattleInfo(&pb.BattleGetInfoReq{ + Battleid: req.Battleid, + }); cd == pb.ErrorCode_Success { + if session.GetUserId() == battle.Red.Uid { + battle.RedOffline = false + } else { + battle.BlueOffline = false + } + } + } else { + cd = pb.ErrorCode_BattleInCmdFailed + return + } + session.SendMsg(string(this.module.GetType()), "into", &pb.PvpIntoResp{Code: cd, Battleid: req.Battleid, Info: resp.Info}) + return +} diff --git a/modules/pvp/modelPvp.go b/modules/pvp/modelPvp.go index 00f326378..8e35b9388 100644 --- a/modules/pvp/modelPvp.go +++ b/modules/pvp/modelPvp.go @@ -1,7 +1,12 @@ package pvp import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/mgo" "go_dreamfactory/modules" + "go_dreamfactory/pb" + "go_dreamfactory/sys/db" ) ///Pvp 数据组件 @@ -10,4 +15,42 @@ type modelPvpComp struct { module *Pvp } +//组件初始化接口 此表不写入到数据库中 +func (this *modelPvpComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, opt core.IModuleOptions) (err error) { + this.MCompModel.Init(service, module, comp, opt) + this.module = module.(*Pvp) + this.TableName = comm.TablePvp + //创建uid索引 + // this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ + // Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, + // }) + return +} +//查询用户重置数据 +func (this *modelPvpComp) querypvps() (result []*pb.DBPvpBattle, err error) { + result = make([]*pb.DBPvpBattle, 0) + if err = this.GetList("", result); err != nil && err != mgo.MongodbNil { + this.module.Errorf("err:%v", err) + } + if err == mgo.MongodbNil { + err = nil + } + return +} + +//记录战斗信息 +func (this *modelPvpComp) addpvp(battle *pb.DBPvpBattle) (err error) { + if err = this.AddList("", battle.Id, battle, db.SetDBMgoLog(false)); err != nil { + this.module.Errorln(err) + } + return +} + +//删除pvp记录 +func (this *modelPvpComp) delpvp(battleid string) (err error) { + if err = this.Del(battleid, db.SetDBMgoLog(false)); err != nil { + this.module.Errorln(err) + } + return +} diff --git a/modules/pvp/module.go b/modules/pvp/module.go index 55cd75756..424a3b5a9 100644 --- a/modules/pvp/module.go +++ b/modules/pvp/module.go @@ -29,12 +29,13 @@ func NewModule() core.IModule { type Pvp struct { modules.ModuleBase - service base.IRPCXService - battle comm.IBattle - friend comm.IFriend - api_comp *apiComp - lock sync.RWMutex - battles map[string]*BattleItem + service base.IRPCXService + battle comm.IBattle + friend comm.IFriend + apicomp *apiComp + modelPvpComp *modelPvpComp + lock sync.RWMutex + battles map[string]*BattleItem } //模块名 @@ -62,7 +63,7 @@ func (this *Pvp) Start() (err error) { return } this.friend = module.(comm.IFriend) - + event.RegisterGO(comm.EventUserLogin, this.userlogin) event.RegisterGO(comm.EventUserOffline, this.useroffline) return } @@ -70,7 +71,8 @@ func (this *Pvp) Start() (err error) { //装备组件 func (this *Pvp) OnInstallComp() { this.ModuleBase.OnInstallComp() - this.api_comp = this.RegisterComp(new(apiComp)).(*apiComp) + this.apicomp = this.RegisterComp(new(apiComp)).(*apiComp) + this.modelPvpComp = this.RegisterComp(new(modelPvpComp)).(*modelPvpComp) } //创建Pvp @@ -196,6 +198,7 @@ func (this *Pvp) PvpFinishPush(battleId string) { go this.friend.QiecuoFinishNotify(battle.Red.Uid, battleId) break } + this.modelPvpComp.delpvp(battleId) } } @@ -314,10 +317,53 @@ func (this *Pvp) startBattle(battle *BattleItem) { }, battle.RedSession, battle.BlueSession); err != nil { this.Errorln(err) } + + this.modelPvpComp.addpvp(&pb.DBPvpBattle{ + Id: info.Id, + ServicePath: fmt.Sprintf("%s/%s", this.service.GetType(), this.service.GetId()), + Ptype: battle.Ptype, + State: battle.State, + Red: battle.Red, + Blue: battle.Blue, + }) } } } +//用户离线处理 +func (this *Pvp) userlogin(session comm.IUserSession) { + var ( + result []*pb.DBPvpBattle + userpvp []*pb.DBPvpBattle + push *pb.PvpListPush + err error + ) + if result, err = this.modelPvpComp.querypvps(); err != nil { + this.Errorln(err) + return + } + userpvp = make([]*pb.DBPvpBattle, 0, len(userpvp)) + for _, v := range result { + if v.Red.Uid == session.GetUserId() || v.Blue.Uid == session.GetUserId() { + userpvp = append(userpvp, v) + } + } + push = &pb.PvpListPush{} + for _, v := range result { + push.List = append(push.List, &pb.DBPvpBattle{ + Id: v.Id, + ServicePath: v.ServicePath, + Ptype: v.Ptype, + State: v.State, + Red: v.Red, + Blue: v.Blue, + }) + } + + session.SendMsg(string(comm.ModulePvp), "list", push) + session.Push() +} + //用户离线处理 func (this *Pvp) useroffline(session comm.IUserSession) { var ( diff --git a/pb/battle_msg.pb.go b/pb/battle_msg.pb.go index 2c38e78ba..c3f436510 100644 --- a/pb/battle_msg.pb.go +++ b/pb/battle_msg.pb.go @@ -1003,6 +1003,110 @@ func (x *BattleCheckResults) GetIscheck() bool { return false } +//创建战斗服务 请求 +type BattleGetInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Battleid string `protobuf:"bytes,1,opt,name=battleid,proto3" json:"battleid"` +} + +func (x *BattleGetInfoReq) Reset() { + *x = BattleGetInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_battle_battle_msg_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BattleGetInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BattleGetInfoReq) ProtoMessage() {} + +func (x *BattleGetInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_battle_battle_msg_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BattleGetInfoReq.ProtoReflect.Descriptor instead. +func (*BattleGetInfoReq) Descriptor() ([]byte, []int) { + return file_battle_battle_msg_proto_rawDescGZIP(), []int{13} +} + +func (x *BattleGetInfoReq) GetBattleid() string { + if x != nil { + return x.Battleid + } + return "" +} + +//创建战斗服务 请求回应 +type BattleGetInfoResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Battleid string `protobuf:"bytes,1,opt,name=battleid,proto3" json:"battleid"` + Info *BattleStateInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info"` +} + +func (x *BattleGetInfoResp) Reset() { + *x = BattleGetInfoResp{} + if protoimpl.UnsafeEnabled { + mi := &file_battle_battle_msg_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BattleGetInfoResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BattleGetInfoResp) ProtoMessage() {} + +func (x *BattleGetInfoResp) ProtoReflect() protoreflect.Message { + mi := &file_battle_battle_msg_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BattleGetInfoResp.ProtoReflect.Descriptor instead. +func (*BattleGetInfoResp) Descriptor() ([]byte, []int) { + return file_battle_battle_msg_proto_rawDescGZIP(), []int{14} +} + +func (x *BattleGetInfoResp) GetBattleid() string { + if x != nil { + return x.Battleid + } + return "" +} + +func (x *BattleGetInfoResp) GetInfo() *BattleStateInfo { + if x != nil { + return x.Info + } + return nil +} + //创建战斗服务 请求 type BattleCreateServerReq struct { state protoimpl.MessageState @@ -1015,7 +1119,7 @@ type BattleCreateServerReq struct { func (x *BattleCreateServerReq) Reset() { *x = BattleCreateServerReq{} if protoimpl.UnsafeEnabled { - mi := &file_battle_battle_msg_proto_msgTypes[13] + mi := &file_battle_battle_msg_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1028,7 +1132,7 @@ func (x *BattleCreateServerReq) String() string { func (*BattleCreateServerReq) ProtoMessage() {} func (x *BattleCreateServerReq) ProtoReflect() protoreflect.Message { - mi := &file_battle_battle_msg_proto_msgTypes[13] + mi := &file_battle_battle_msg_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1041,7 +1145,7 @@ func (x *BattleCreateServerReq) ProtoReflect() protoreflect.Message { // Deprecated: Use BattleCreateServerReq.ProtoReflect.Descriptor instead. func (*BattleCreateServerReq) Descriptor() ([]byte, []int) { - return file_battle_battle_msg_proto_rawDescGZIP(), []int{13} + return file_battle_battle_msg_proto_rawDescGZIP(), []int{15} } func (x *BattleCreateServerReq) GetInfo() *BattleInfo { @@ -1063,7 +1167,7 @@ type BattleCreateServerResp struct { func (x *BattleCreateServerResp) Reset() { *x = BattleCreateServerResp{} if protoimpl.UnsafeEnabled { - mi := &file_battle_battle_msg_proto_msgTypes[14] + mi := &file_battle_battle_msg_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1076,7 +1180,7 @@ func (x *BattleCreateServerResp) String() string { func (*BattleCreateServerResp) ProtoMessage() {} func (x *BattleCreateServerResp) ProtoReflect() protoreflect.Message { - mi := &file_battle_battle_msg_proto_msgTypes[14] + mi := &file_battle_battle_msg_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1089,7 +1193,7 @@ func (x *BattleCreateServerResp) ProtoReflect() protoreflect.Message { // Deprecated: Use BattleCreateServerResp.ProtoReflect.Descriptor instead. func (*BattleCreateServerResp) Descriptor() ([]byte, []int) { - return file_battle_battle_msg_proto_rawDescGZIP(), []int{14} + return file_battle_battle_msg_proto_rawDescGZIP(), []int{16} } func (x *BattleCreateServerResp) GetIssucc() bool { @@ -1113,7 +1217,7 @@ type BattleInCmdReq struct { func (x *BattleInCmdReq) Reset() { *x = BattleInCmdReq{} if protoimpl.UnsafeEnabled { - mi := &file_battle_battle_msg_proto_msgTypes[15] + mi := &file_battle_battle_msg_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1126,7 +1230,7 @@ func (x *BattleInCmdReq) String() string { func (*BattleInCmdReq) ProtoMessage() {} func (x *BattleInCmdReq) ProtoReflect() protoreflect.Message { - mi := &file_battle_battle_msg_proto_msgTypes[15] + mi := &file_battle_battle_msg_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1139,7 +1243,7 @@ func (x *BattleInCmdReq) ProtoReflect() protoreflect.Message { // Deprecated: Use BattleInCmdReq.ProtoReflect.Descriptor instead. func (*BattleInCmdReq) Descriptor() ([]byte, []int) { - return file_battle_battle_msg_proto_rawDescGZIP(), []int{15} + return file_battle_battle_msg_proto_rawDescGZIP(), []int{17} } func (x *BattleInCmdReq) GetBattleid() string { @@ -1177,7 +1281,7 @@ type BattleInCmdResp struct { func (x *BattleInCmdResp) Reset() { *x = BattleInCmdResp{} if protoimpl.UnsafeEnabled { - mi := &file_battle_battle_msg_proto_msgTypes[16] + mi := &file_battle_battle_msg_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1190,7 +1294,7 @@ func (x *BattleInCmdResp) String() string { func (*BattleInCmdResp) ProtoMessage() {} func (x *BattleInCmdResp) ProtoReflect() protoreflect.Message { - mi := &file_battle_battle_msg_proto_msgTypes[16] + mi := &file_battle_battle_msg_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1203,7 +1307,7 @@ func (x *BattleInCmdResp) ProtoReflect() protoreflect.Message { // Deprecated: Use BattleInCmdResp.ProtoReflect.Descriptor instead. func (*BattleInCmdResp) Descriptor() ([]byte, []int) { - return file_battle_battle_msg_proto_rawDescGZIP(), []int{16} + return file_battle_battle_msg_proto_rawDescGZIP(), []int{18} } func (x *BattleInCmdResp) GetBattleid() string { @@ -1240,7 +1344,7 @@ type BattleOutCmdPush struct { func (x *BattleOutCmdPush) Reset() { *x = BattleOutCmdPush{} if protoimpl.UnsafeEnabled { - mi := &file_battle_battle_msg_proto_msgTypes[17] + mi := &file_battle_battle_msg_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1253,7 +1357,7 @@ func (x *BattleOutCmdPush) String() string { func (*BattleOutCmdPush) ProtoMessage() {} func (x *BattleOutCmdPush) ProtoReflect() protoreflect.Message { - mi := &file_battle_battle_msg_proto_msgTypes[17] + mi := &file_battle_battle_msg_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1266,7 +1370,7 @@ func (x *BattleOutCmdPush) ProtoReflect() protoreflect.Message { // Deprecated: Use BattleOutCmdPush.ProtoReflect.Descriptor instead. func (*BattleOutCmdPush) Descriptor() ([]byte, []int) { - return file_battle_battle_msg_proto_rawDescGZIP(), []int{17} + return file_battle_battle_msg_proto_rawDescGZIP(), []int{19} } func (x *BattleOutCmdPush) GetBattleid() string { @@ -1295,7 +1399,7 @@ type BattleFinishPush struct { func (x *BattleFinishPush) Reset() { *x = BattleFinishPush{} if protoimpl.UnsafeEnabled { - mi := &file_battle_battle_msg_proto_msgTypes[18] + mi := &file_battle_battle_msg_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1308,7 +1412,7 @@ func (x *BattleFinishPush) String() string { func (*BattleFinishPush) ProtoMessage() {} func (x *BattleFinishPush) ProtoReflect() protoreflect.Message { - mi := &file_battle_battle_msg_proto_msgTypes[18] + mi := &file_battle_battle_msg_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1321,7 +1425,7 @@ func (x *BattleFinishPush) ProtoReflect() protoreflect.Message { // Deprecated: Use BattleFinishPush.ProtoReflect.Descriptor instead. func (*BattleFinishPush) Descriptor() ([]byte, []int) { - return file_battle_battle_msg_proto_rawDescGZIP(), []int{18} + return file_battle_battle_msg_proto_rawDescGZIP(), []int{20} } func (x *BattleFinishPush) GetBattleid() string { @@ -1344,7 +1448,7 @@ type BattleConcedeReq struct { func (x *BattleConcedeReq) Reset() { *x = BattleConcedeReq{} if protoimpl.UnsafeEnabled { - mi := &file_battle_battle_msg_proto_msgTypes[19] + mi := &file_battle_battle_msg_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1357,7 +1461,7 @@ func (x *BattleConcedeReq) String() string { func (*BattleConcedeReq) ProtoMessage() {} func (x *BattleConcedeReq) ProtoReflect() protoreflect.Message { - mi := &file_battle_battle_msg_proto_msgTypes[19] + mi := &file_battle_battle_msg_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1370,7 +1474,7 @@ func (x *BattleConcedeReq) ProtoReflect() protoreflect.Message { // Deprecated: Use BattleConcedeReq.ProtoReflect.Descriptor instead. func (*BattleConcedeReq) Descriptor() ([]byte, []int) { - return file_battle_battle_msg_proto_rawDescGZIP(), []int{19} + return file_battle_battle_msg_proto_rawDescGZIP(), []int{21} } func (x *BattleConcedeReq) GetBattleid() string { @@ -1399,7 +1503,7 @@ type BattleConcedeResp struct { func (x *BattleConcedeResp) Reset() { *x = BattleConcedeResp{} if protoimpl.UnsafeEnabled { - mi := &file_battle_battle_msg_proto_msgTypes[20] + mi := &file_battle_battle_msg_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1412,7 +1516,7 @@ func (x *BattleConcedeResp) String() string { func (*BattleConcedeResp) ProtoMessage() {} func (x *BattleConcedeResp) ProtoReflect() protoreflect.Message { - mi := &file_battle_battle_msg_proto_msgTypes[20] + mi := &file_battle_battle_msg_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1425,7 +1529,7 @@ func (x *BattleConcedeResp) ProtoReflect() protoreflect.Message { // Deprecated: Use BattleConcedeResp.ProtoReflect.Descriptor instead. func (*BattleConcedeResp) Descriptor() ([]byte, []int) { - return file_battle_battle_msg_proto_rawDescGZIP(), []int{20} + return file_battle_battle_msg_proto_rawDescGZIP(), []int{22} } func (x *BattleConcedeResp) GetIssucc() bool { @@ -1435,6 +1539,70 @@ func (x *BattleConcedeResp) GetIssucc() bool { return false } +//战斗状态数据 +type BattleStateInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` + OutCmds []*BattleCmd `protobuf:"bytes,2,rep,name=outCmds,proto3" json:"outCmds"` + InputCmds []*BattleCmd `protobuf:"bytes,3,rep,name=inputCmds,proto3" json:"inputCmds"` +} + +func (x *BattleStateInfo) Reset() { + *x = BattleStateInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_battle_battle_msg_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BattleStateInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BattleStateInfo) ProtoMessage() {} + +func (x *BattleStateInfo) ProtoReflect() protoreflect.Message { + mi := &file_battle_battle_msg_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BattleStateInfo.ProtoReflect.Descriptor instead. +func (*BattleStateInfo) Descriptor() ([]byte, []int) { + return file_battle_battle_msg_proto_rawDescGZIP(), []int{23} +} + +func (x *BattleStateInfo) GetInfo() *BattleInfo { + if x != nil { + return x.Info + } + return nil +} + +func (x *BattleStateInfo) GetOutCmds() []*BattleCmd { + if x != nil { + return x.OutCmds + } + return nil +} + +func (x *BattleStateInfo) GetInputCmds() []*BattleCmd { + if x != nil { + return x.InputCmds + } + return nil +} + var File_battle_battle_msg_proto protoreflect.FileDescriptor var file_battle_battle_msg_proto_rawDesc = []byte{ @@ -1566,41 +1734,58 @@ var file_battle_battle_msg_proto_rawDesc = []byte{ 0x74, 0x61, 0x22, 0x2e, 0x0a, 0x12, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x22, 0x38, 0x0a, 0x15, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x04, 0x69, - 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, - 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x30, 0x0a, 0x16, - 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x22, 0x5c, - 0x0a, 0x0e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x71, - 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x73, 0x69, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x69, 0x64, 0x65, - 0x12, 0x1a, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x42, - 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6d, 0x64, 0x52, 0x02, 0x69, 0x6e, 0x22, 0x61, 0x0a, 0x0f, - 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x02, 0x69, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, - 0x43, 0x6d, 0x64, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, - 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x22, - 0x4c, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x43, 0x6d, 0x64, 0x50, - 0x75, 0x73, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, - 0x1c, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x42, - 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6d, 0x64, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x22, 0x2e, 0x0a, - 0x10, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x50, 0x75, 0x73, - 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x22, 0x42, 0x0a, - 0x10, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x63, 0x65, 0x64, 0x65, 0x52, 0x65, - 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x73, 0x69, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x69, 0x64, - 0x65, 0x22, 0x2b, 0x0a, 0x11, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x63, 0x65, - 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x42, 0x06, - 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6b, 0x22, 0x2e, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x47, 0x65, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x69, 0x64, 0x22, 0x55, 0x0a, 0x11, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x47, 0x65, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x38, 0x0a, 0x15, 0x42, 0x61, 0x74, + 0x74, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, + 0x6e, 0x66, 0x6f, 0x22, 0x30, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, + 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, + 0x73, 0x73, 0x75, 0x63, 0x63, 0x22, 0x5c, 0x0a, 0x0e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, + 0x6e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x73, 0x69, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6d, 0x64, 0x52, + 0x02, 0x69, 0x6e, 0x22, 0x61, 0x0a, 0x0f, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x43, + 0x6d, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, + 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6d, 0x64, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x16, + 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x22, 0x4c, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x4f, 0x75, 0x74, 0x43, 0x6d, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, + 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, + 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6d, 0x64, 0x52, + 0x03, 0x63, 0x6d, 0x64, 0x22, 0x2e, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, + 0x6e, 0x69, 0x73, 0x68, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, + 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, + 0x6c, 0x65, 0x69, 0x64, 0x22, 0x42, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, + 0x6e, 0x63, 0x65, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, + 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, + 0x6c, 0x65, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x73, 0x69, 0x64, 0x65, 0x22, 0x2b, 0x0a, 0x11, 0x42, 0x61, 0x74, 0x74, + 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x63, 0x65, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, + 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, + 0x73, 0x73, 0x75, 0x63, 0x63, 0x22, 0x82, 0x01, 0x0a, 0x0f, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, + 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x0a, 0x07, 0x6f, 0x75, + 0x74, 0x43, 0x6d, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x42, 0x61, + 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6d, 0x64, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x43, 0x6d, 0x64, 0x73, + 0x12, 0x28, 0x0a, 0x09, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x43, 0x6d, 0x64, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6d, 0x64, 0x52, + 0x09, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x43, 0x6d, 0x64, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1615,7 +1800,7 @@ func file_battle_battle_msg_proto_rawDescGZIP() []byte { return file_battle_battle_msg_proto_rawDescData } -var file_battle_battle_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_battle_battle_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 24) var file_battle_battle_msg_proto_goTypes = []interface{}{ (*LineUp)(nil), // 0: LineUp (*BattleFormation)(nil), // 1: BattleFormation @@ -1630,51 +1815,58 @@ var file_battle_battle_msg_proto_goTypes = []interface{}{ (*BattleReport)(nil), // 10: BattleReport (*BattleRpcMessage)(nil), // 11: BattleRpcMessage (*BattleCheckResults)(nil), // 12: BattleCheckResults - (*BattleCreateServerReq)(nil), // 13: BattleCreateServerReq - (*BattleCreateServerResp)(nil), // 14: BattleCreateServerResp - (*BattleInCmdReq)(nil), // 15: BattleInCmdReq - (*BattleInCmdResp)(nil), // 16: BattleInCmdResp - (*BattleOutCmdPush)(nil), // 17: BattleOutCmdPush - (*BattleFinishPush)(nil), // 18: BattleFinishPush - (*BattleConcedeReq)(nil), // 19: BattleConcedeReq - (*BattleConcedeResp)(nil), // 20: BattleConcedeResp - (PlayType)(0), // 21: PlayType - (*DBHero)(nil), // 22: DBHero - (BattleType)(0), // 23: BattleType - (*DBBattleFormt)(nil), // 24: DBBattleFormt - (*anypb.Any)(nil), // 25: google.protobuf.Any + (*BattleGetInfoReq)(nil), // 13: BattleGetInfoReq + (*BattleGetInfoResp)(nil), // 14: BattleGetInfoResp + (*BattleCreateServerReq)(nil), // 15: BattleCreateServerReq + (*BattleCreateServerResp)(nil), // 16: BattleCreateServerResp + (*BattleInCmdReq)(nil), // 17: BattleInCmdReq + (*BattleInCmdResp)(nil), // 18: BattleInCmdResp + (*BattleOutCmdPush)(nil), // 19: BattleOutCmdPush + (*BattleFinishPush)(nil), // 20: BattleFinishPush + (*BattleConcedeReq)(nil), // 21: BattleConcedeReq + (*BattleConcedeResp)(nil), // 22: BattleConcedeResp + (*BattleStateInfo)(nil), // 23: BattleStateInfo + (PlayType)(0), // 24: PlayType + (*DBHero)(nil), // 25: DBHero + (BattleType)(0), // 26: BattleType + (*DBBattleFormt)(nil), // 27: DBBattleFormt + (*anypb.Any)(nil), // 28: google.protobuf.Any } var file_battle_battle_msg_proto_depIdxs = []int32{ - 21, // 0: BattleEVEReq.ptype:type_name -> PlayType + 24, // 0: BattleEVEReq.ptype:type_name -> PlayType 1, // 1: BattleEVEReq.format:type_name -> BattleFormation - 21, // 2: BattlePVEReq.ptype:type_name -> PlayType + 24, // 2: BattlePVEReq.ptype:type_name -> PlayType 1, // 3: BattlePVEReq.format:type_name -> BattleFormation - 22, // 4: PVPFormation.format:type_name -> DBHero - 21, // 5: BattlePVPReq.ptype:type_name -> PlayType + 25, // 4: PVPFormation.format:type_name -> DBHero + 24, // 5: BattlePVPReq.ptype:type_name -> PlayType 4, // 6: BattlePVPReq.redformat:type_name -> PVPFormation 4, // 7: BattlePVPReq.buleformat:type_name -> PVPFormation - 21, // 8: BattleRTPVPReq.ptype:type_name -> PlayType + 24, // 8: BattleRTPVPReq.ptype:type_name -> PlayType 1, // 9: BattleRTPVPReq.redformat:type_name -> BattleFormation 1, // 10: BattleRTPVPReq.bulefformat:type_name -> BattleFormation - 21, // 11: BattlePVBReq.ptype:type_name -> PlayType + 24, // 11: BattlePVBReq.ptype:type_name -> PlayType 1, // 12: BattlePVBReq.format:type_name -> BattleFormation - 23, // 13: BattleInfo.btype:type_name -> BattleType - 21, // 14: BattleInfo.ptype:type_name -> PlayType - 24, // 15: BattleInfo.redflist:type_name -> DBBattleFormt - 24, // 16: BattleInfo.buleflist:type_name -> DBBattleFormt + 26, // 13: BattleInfo.btype:type_name -> BattleType + 24, // 14: BattleInfo.ptype:type_name -> PlayType + 27, // 15: BattleInfo.redflist:type_name -> DBBattleFormt + 27, // 16: BattleInfo.buleflist:type_name -> DBBattleFormt 8, // 17: BattleReport.info:type_name -> BattleInfo 9, // 18: BattleReport.incmd:type_name -> BattleCmd 9, // 19: BattleReport.outcmd:type_name -> BattleCmd - 25, // 20: BattleRpcMessage.data:type_name -> google.protobuf.Any - 8, // 21: BattleCreateServerReq.info:type_name -> BattleInfo - 9, // 22: BattleInCmdReq.in:type_name -> BattleCmd - 9, // 23: BattleInCmdResp.in:type_name -> BattleCmd - 9, // 24: BattleOutCmdPush.cmd:type_name -> BattleCmd - 25, // [25:25] is the sub-list for method output_type - 25, // [25:25] is the sub-list for method input_type - 25, // [25:25] is the sub-list for extension type_name - 25, // [25:25] is the sub-list for extension extendee - 0, // [0:25] is the sub-list for field type_name + 28, // 20: BattleRpcMessage.data:type_name -> google.protobuf.Any + 23, // 21: BattleGetInfoResp.info:type_name -> BattleStateInfo + 8, // 22: BattleCreateServerReq.info:type_name -> BattleInfo + 9, // 23: BattleInCmdReq.in:type_name -> BattleCmd + 9, // 24: BattleInCmdResp.in:type_name -> BattleCmd + 9, // 25: BattleOutCmdPush.cmd:type_name -> BattleCmd + 8, // 26: BattleStateInfo.info:type_name -> BattleInfo + 9, // 27: BattleStateInfo.outCmds:type_name -> BattleCmd + 9, // 28: BattleStateInfo.inputCmds:type_name -> BattleCmd + 29, // [29:29] is the sub-list for method output_type + 29, // [29:29] is the sub-list for method input_type + 29, // [29:29] is the sub-list for extension type_name + 29, // [29:29] is the sub-list for extension extendee + 0, // [0:29] is the sub-list for field type_name } func init() { file_battle_battle_msg_proto_init() } @@ -1842,7 +2034,7 @@ func file_battle_battle_msg_proto_init() { } } file_battle_battle_msg_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BattleCreateServerReq); i { + switch v := v.(*BattleGetInfoReq); i { case 0: return &v.state case 1: @@ -1854,7 +2046,7 @@ func file_battle_battle_msg_proto_init() { } } file_battle_battle_msg_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BattleCreateServerResp); i { + switch v := v.(*BattleGetInfoResp); i { case 0: return &v.state case 1: @@ -1866,7 +2058,7 @@ func file_battle_battle_msg_proto_init() { } } file_battle_battle_msg_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BattleInCmdReq); i { + switch v := v.(*BattleCreateServerReq); i { case 0: return &v.state case 1: @@ -1878,7 +2070,7 @@ func file_battle_battle_msg_proto_init() { } } file_battle_battle_msg_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BattleInCmdResp); i { + switch v := v.(*BattleCreateServerResp); i { case 0: return &v.state case 1: @@ -1890,7 +2082,7 @@ func file_battle_battle_msg_proto_init() { } } file_battle_battle_msg_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BattleOutCmdPush); i { + switch v := v.(*BattleInCmdReq); i { case 0: return &v.state case 1: @@ -1902,7 +2094,7 @@ func file_battle_battle_msg_proto_init() { } } file_battle_battle_msg_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BattleFinishPush); i { + switch v := v.(*BattleInCmdResp); i { case 0: return &v.state case 1: @@ -1914,7 +2106,7 @@ func file_battle_battle_msg_proto_init() { } } file_battle_battle_msg_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BattleConcedeReq); i { + switch v := v.(*BattleOutCmdPush); i { case 0: return &v.state case 1: @@ -1926,6 +2118,30 @@ func file_battle_battle_msg_proto_init() { } } file_battle_battle_msg_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BattleFinishPush); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_battle_battle_msg_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BattleConcedeReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_battle_battle_msg_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BattleConcedeResp); i { case 0: return &v.state @@ -1937,6 +2153,18 @@ func file_battle_battle_msg_proto_init() { return nil } } + file_battle_battle_msg_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BattleStateInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1944,7 +2172,7 @@ func file_battle_battle_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_battle_battle_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 21, + NumMessages: 24, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/pvp_db.pb.go b/pb/pvp_db.pb.go index 810f588e5..8b7a61d87 100644 --- a/pb/pvp_db.pb.go +++ b/pb/pvp_db.pb.go @@ -195,13 +195,12 @@ type DBPvpBattle struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` //战斗id - Ptype PvpType `protobuf:"varint,2,opt,name=ptype,proto3,enum=PvpType" json:"ptype"` //pvp类型 - State PvpState `protobuf:"varint,3,opt,name=state,proto3,enum=PvpState" json:"state"` //战斗状态 - Red *PvpUserInfo `protobuf:"bytes,4,opt,name=red,proto3" json:"red"` //红方id - Redformation *BattleFormation `protobuf:"bytes,5,opt,name=redformation,proto3" json:"redformation"` //红方阵型列表 - Blue *PvpUserInfo `protobuf:"bytes,6,opt,name=blue,proto3" json:"blue"` //红方id - Blueformation *BattleFormation `protobuf:"bytes,7,opt,name=blueformation,proto3" json:"blueformation"` //红方阵型列表 + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` //战斗id + ServicePath string `protobuf:"bytes,2,opt,name=servicePath,proto3" json:"servicePath"` //战斗区服地址 + Ptype PvpType `protobuf:"varint,3,opt,name=ptype,proto3,enum=PvpType" json:"ptype"` //pvp类型 + State PvpState `protobuf:"varint,4,opt,name=state,proto3,enum=PvpState" json:"state"` //战斗状态 + Red *PvpUserInfo `protobuf:"bytes,5,opt,name=red,proto3" json:"red"` //红方id + Blue *PvpUserInfo `protobuf:"bytes,6,opt,name=blue,proto3" json:"blue"` //红方id } func (x *DBPvpBattle) Reset() { @@ -243,6 +242,13 @@ func (x *DBPvpBattle) GetId() string { return "" } +func (x *DBPvpBattle) GetServicePath() string { + if x != nil { + return x.ServicePath + } + return "" +} + func (x *DBPvpBattle) GetPtype() PvpType { if x != nil { return x.Ptype @@ -264,13 +270,6 @@ func (x *DBPvpBattle) GetRed() *PvpUserInfo { return nil } -func (x *DBPvpBattle) GetRedformation() *BattleFormation { - if x != nil { - return x.Redformation - } - return nil -} - func (x *DBPvpBattle) GetBlue() *PvpUserInfo { if x != nil { return x.Blue @@ -278,49 +277,36 @@ func (x *DBPvpBattle) GetBlue() *PvpUserInfo { return nil } -func (x *DBPvpBattle) GetBlueformation() *BattleFormation { - if x != nil { - return x.Blueformation - } - return nil -} - var File_pvp_pvp_db_proto protoreflect.FileDescriptor var file_pvp_pvp_db_proto_rawDesc = []byte{ 0x0a, 0x10, 0x70, 0x76, 0x70, 0x2f, 0x70, 0x76, 0x70, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x17, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x2f, 0x62, 0x61, 0x74, 0x74, 0x6c, - 0x65, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5b, 0x0a, 0x0b, 0x50, - 0x76, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, 0x8e, 0x02, 0x0a, 0x0b, 0x44, 0x42, 0x50, - 0x76, 0x70, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x05, 0x70, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x08, 0x2e, 0x50, 0x76, 0x70, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x05, 0x70, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x50, 0x76, 0x70, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x03, 0x72, 0x65, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x50, 0x76, 0x70, 0x55, 0x73, 0x65, 0x72, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x03, 0x72, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x0c, 0x72, 0x65, 0x64, - 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x0c, 0x72, 0x65, 0x64, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x20, 0x0a, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, - 0x50, 0x76, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x62, 0x6c, 0x75, - 0x65, 0x12, 0x36, 0x0a, 0x0d, 0x62, 0x6c, 0x75, 0x65, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, - 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x62, 0x6c, 0x75, 0x65, - 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x16, 0x0a, 0x07, 0x50, 0x76, 0x70, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x10, - 0x00, 0x2a, 0x43, 0x0a, 0x08, 0x50, 0x76, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x08, 0x0a, - 0x04, 0x76, 0x6f, 0x69, 0x64, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, - 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x10, 0x02, 0x12, 0x0a, - 0x0a, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x66, 0x69, - 0x6e, 0x69, 0x73, 0x68, 0x10, 0x04, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x6f, 0x22, 0x5b, 0x0a, 0x0b, 0x50, 0x76, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, + 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, + 0xc2, 0x01, 0x0a, 0x0b, 0x44, 0x42, 0x50, 0x76, 0x70, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x74, + 0x68, 0x12, 0x1e, 0x0a, 0x05, 0x70, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x08, 0x2e, 0x50, 0x76, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x70, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x1f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x09, 0x2e, 0x50, 0x76, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x03, 0x72, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0c, 0x2e, 0x50, 0x76, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x03, 0x72, + 0x65, 0x64, 0x12, 0x20, 0x0a, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0c, 0x2e, 0x50, 0x76, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, + 0x62, 0x6c, 0x75, 0x65, 0x2a, 0x16, 0x0a, 0x07, 0x50, 0x76, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x0b, 0x0a, 0x07, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x10, 0x00, 0x2a, 0x43, 0x0a, 0x08, + 0x50, 0x76, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x76, 0x6f, 0x69, 0x64, + 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x10, 0x01, 0x12, 0x0a, 0x0a, + 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x63, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x10, + 0x04, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -338,24 +324,21 @@ func file_pvp_pvp_db_proto_rawDescGZIP() []byte { var file_pvp_pvp_db_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_pvp_pvp_db_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_pvp_pvp_db_proto_goTypes = []interface{}{ - (PvpType)(0), // 0: PvpType - (PvpState)(0), // 1: PvpState - (*PvpUserInfo)(nil), // 2: PvpUserInfo - (*DBPvpBattle)(nil), // 3: DBPvpBattle - (*BattleFormation)(nil), // 4: BattleFormation + (PvpType)(0), // 0: PvpType + (PvpState)(0), // 1: PvpState + (*PvpUserInfo)(nil), // 2: PvpUserInfo + (*DBPvpBattle)(nil), // 3: DBPvpBattle } var file_pvp_pvp_db_proto_depIdxs = []int32{ 0, // 0: DBPvpBattle.ptype:type_name -> PvpType 1, // 1: DBPvpBattle.state:type_name -> PvpState 2, // 2: DBPvpBattle.red:type_name -> PvpUserInfo - 4, // 3: DBPvpBattle.redformation:type_name -> BattleFormation - 2, // 4: DBPvpBattle.blue:type_name -> PvpUserInfo - 4, // 5: DBPvpBattle.blueformation:type_name -> BattleFormation - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 2, // 3: DBPvpBattle.blue:type_name -> PvpUserInfo + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_pvp_pvp_db_proto_init() } @@ -363,7 +346,6 @@ func file_pvp_pvp_db_proto_init() { if File_pvp_pvp_db_proto != nil { return } - file_battle_battle_msg_proto_init() if !protoimpl.UnsafeEnabled { file_pvp_pvp_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PvpUserInfo); i { diff --git a/pb/pvp_msg.pb.go b/pb/pvp_msg.pb.go index ae21070c7..e21838266 100644 --- a/pb/pvp_msg.pb.go +++ b/pb/pvp_msg.pb.go @@ -20,6 +20,166 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +//战斗列表推送 +type PvpListPush struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*DBPvpBattle `protobuf:"bytes,1,rep,name=list,proto3" json:"list"` +} + +func (x *PvpListPush) Reset() { + *x = PvpListPush{} + if protoimpl.UnsafeEnabled { + mi := &file_pvp_pvp_msg_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PvpListPush) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PvpListPush) ProtoMessage() {} + +func (x *PvpListPush) ProtoReflect() protoreflect.Message { + mi := &file_pvp_pvp_msg_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PvpListPush.ProtoReflect.Descriptor instead. +func (*PvpListPush) Descriptor() ([]byte, []int) { + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{0} +} + +func (x *PvpListPush) GetList() []*DBPvpBattle { + if x != nil { + return x.List + } + return nil +} + +//战斗列表推送 +type PvpIntoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Battleid string `protobuf:"bytes,1,opt,name=battleid,proto3" json:"battleid"` //战斗id +} + +func (x *PvpIntoReq) Reset() { + *x = PvpIntoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_pvp_pvp_msg_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PvpIntoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PvpIntoReq) ProtoMessage() {} + +func (x *PvpIntoReq) ProtoReflect() protoreflect.Message { + mi := &file_pvp_pvp_msg_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PvpIntoReq.ProtoReflect.Descriptor instead. +func (*PvpIntoReq) Descriptor() ([]byte, []int) { + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{1} +} + +func (x *PvpIntoReq) GetBattleid() string { + if x != nil { + return x.Battleid + } + return "" +} + +//战斗列表推送 +type PvpIntoResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=ErrorCode" json:"code"` //是否成功 + Battleid string `protobuf:"bytes,2,opt,name=battleid,proto3" json:"battleid"` //战斗id + Info *BattleStateInfo `protobuf:"bytes,3,opt,name=info,proto3" json:"info"` //战斗状态数据 +} + +func (x *PvpIntoResp) Reset() { + *x = PvpIntoResp{} + if protoimpl.UnsafeEnabled { + mi := &file_pvp_pvp_msg_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PvpIntoResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PvpIntoResp) ProtoMessage() {} + +func (x *PvpIntoResp) ProtoReflect() protoreflect.Message { + mi := &file_pvp_pvp_msg_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PvpIntoResp.ProtoReflect.Descriptor instead. +func (*PvpIntoResp) Descriptor() ([]byte, []int) { + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{2} +} + +func (x *PvpIntoResp) GetCode() ErrorCode { + if x != nil { + return x.Code + } + return ErrorCode_Success +} + +func (x *PvpIntoResp) GetBattleid() string { + if x != nil { + return x.Battleid + } + return "" +} + +func (x *PvpIntoResp) GetInfo() *BattleStateInfo { + if x != nil { + return x.Info + } + return nil +} + //Pvp 战斗准备推送 type PvpReadyPush struct { state protoimpl.MessageState @@ -36,7 +196,7 @@ type PvpReadyPush struct { func (x *PvpReadyPush) Reset() { *x = PvpReadyPush{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[0] + mi := &file_pvp_pvp_msg_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -49,7 +209,7 @@ func (x *PvpReadyPush) String() string { func (*PvpReadyPush) ProtoMessage() {} func (x *PvpReadyPush) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[0] + mi := &file_pvp_pvp_msg_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -62,7 +222,7 @@ func (x *PvpReadyPush) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpReadyPush.ProtoReflect.Descriptor instead. func (*PvpReadyPush) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{0} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{3} } func (x *PvpReadyPush) GetServicePath() string { @@ -113,7 +273,7 @@ type PvpCancelPush struct { func (x *PvpCancelPush) Reset() { *x = PvpCancelPush{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[1] + mi := &file_pvp_pvp_msg_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -126,7 +286,7 @@ func (x *PvpCancelPush) String() string { func (*PvpCancelPush) ProtoMessage() {} func (x *PvpCancelPush) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[1] + mi := &file_pvp_pvp_msg_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -139,7 +299,7 @@ func (x *PvpCancelPush) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpCancelPush.ProtoReflect.Descriptor instead. func (*PvpCancelPush) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{1} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{4} } func (x *PvpCancelPush) GetServicePath() string { @@ -169,7 +329,7 @@ type PvpFormationReq struct { func (x *PvpFormationReq) Reset() { *x = PvpFormationReq{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[2] + mi := &file_pvp_pvp_msg_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -182,7 +342,7 @@ func (x *PvpFormationReq) String() string { func (*PvpFormationReq) ProtoMessage() {} func (x *PvpFormationReq) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[2] + mi := &file_pvp_pvp_msg_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -195,7 +355,7 @@ func (x *PvpFormationReq) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpFormationReq.ProtoReflect.Descriptor instead. func (*PvpFormationReq) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{2} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{5} } func (x *PvpFormationReq) GetBattleid() string { @@ -224,7 +384,7 @@ type PvpFormationResp struct { func (x *PvpFormationResp) Reset() { *x = PvpFormationResp{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[3] + mi := &file_pvp_pvp_msg_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -237,7 +397,7 @@ func (x *PvpFormationResp) String() string { func (*PvpFormationResp) ProtoMessage() {} func (x *PvpFormationResp) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[3] + mi := &file_pvp_pvp_msg_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -250,7 +410,7 @@ func (x *PvpFormationResp) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpFormationResp.ProtoReflect.Descriptor instead. func (*PvpFormationResp) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{3} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{6} } func (x *PvpFormationResp) GetIssucc() bool { @@ -273,7 +433,7 @@ type PvpStartPush struct { func (x *PvpStartPush) Reset() { *x = PvpStartPush{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[4] + mi := &file_pvp_pvp_msg_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -286,7 +446,7 @@ func (x *PvpStartPush) String() string { func (*PvpStartPush) ProtoMessage() {} func (x *PvpStartPush) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[4] + mi := &file_pvp_pvp_msg_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -299,7 +459,7 @@ func (x *PvpStartPush) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpStartPush.ProtoReflect.Descriptor instead. func (*PvpStartPush) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{4} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{7} } func (x *PvpStartPush) GetCode() ErrorCode { @@ -329,7 +489,7 @@ type PvpOutCmdPush struct { func (x *PvpOutCmdPush) Reset() { *x = PvpOutCmdPush{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[5] + mi := &file_pvp_pvp_msg_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -342,7 +502,7 @@ func (x *PvpOutCmdPush) String() string { func (*PvpOutCmdPush) ProtoMessage() {} func (x *PvpOutCmdPush) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[5] + mi := &file_pvp_pvp_msg_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -355,7 +515,7 @@ func (x *PvpOutCmdPush) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpOutCmdPush.ProtoReflect.Descriptor instead. func (*PvpOutCmdPush) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{5} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{8} } func (x *PvpOutCmdPush) GetBattleid() string { @@ -385,7 +545,7 @@ type PvpInCmdReq struct { func (x *PvpInCmdReq) Reset() { *x = PvpInCmdReq{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[6] + mi := &file_pvp_pvp_msg_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -398,7 +558,7 @@ func (x *PvpInCmdReq) String() string { func (*PvpInCmdReq) ProtoMessage() {} func (x *PvpInCmdReq) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[6] + mi := &file_pvp_pvp_msg_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -411,7 +571,7 @@ func (x *PvpInCmdReq) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpInCmdReq.ProtoReflect.Descriptor instead. func (*PvpInCmdReq) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{6} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{9} } func (x *PvpInCmdReq) GetBattleid() string { @@ -442,7 +602,7 @@ type PvpInCmdResp struct { func (x *PvpInCmdResp) Reset() { *x = PvpInCmdResp{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[7] + mi := &file_pvp_pvp_msg_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -455,7 +615,7 @@ func (x *PvpInCmdResp) String() string { func (*PvpInCmdResp) ProtoMessage() {} func (x *PvpInCmdResp) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[7] + mi := &file_pvp_pvp_msg_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -468,7 +628,7 @@ func (x *PvpInCmdResp) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpInCmdResp.ProtoReflect.Descriptor instead. func (*PvpInCmdResp) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{7} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{10} } func (x *PvpInCmdResp) GetCode() ErrorCode { @@ -500,53 +660,66 @@ var file_pvp_pvp_msg_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x2f, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xac, 0x01, 0x0a, 0x0c, 0x50, 0x76, 0x70, 0x52, 0x65, 0x61, 0x64, 0x79, 0x50, 0x75, 0x73, 0x68, - 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, - 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x1e, - 0x0a, 0x03, 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x50, 0x76, - 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x03, 0x72, 0x65, 0x64, 0x12, 0x20, - 0x0a, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x50, - 0x76, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x62, 0x6c, 0x75, 0x65, - 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x22, 0x4d, - 0x0a, 0x0d, 0x50, 0x76, 0x70, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x75, 0x73, 0x68, 0x12, - 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x74, - 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x22, 0x5d, 0x0a, - 0x0f, 0x50, 0x76, 0x70, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x09, - 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2a, 0x0a, 0x10, - 0x50, 0x76, 0x70, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x22, 0x4f, 0x0a, 0x0c, 0x50, 0x76, 0x70, 0x53, - 0x74, 0x61, 0x72, 0x74, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, - 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x49, 0x0a, 0x0d, 0x50, 0x76, 0x70, - 0x4f, 0x75, 0x74, 0x43, 0x6d, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, - 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, - 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6d, 0x64, 0x52, - 0x03, 0x63, 0x6d, 0x64, 0x22, 0x47, 0x0a, 0x0b, 0x50, 0x76, 0x70, 0x49, 0x6e, 0x43, 0x6d, 0x64, - 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, - 0x1c, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x42, - 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6d, 0x64, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x22, 0x68, 0x0a, - 0x0c, 0x50, 0x76, 0x70, 0x49, 0x6e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, - 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, + 0x2f, 0x0a, 0x0b, 0x50, 0x76, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x73, 0x68, 0x12, 0x20, + 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x44, + 0x42, 0x50, 0x76, 0x70, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, + 0x22, 0x28, 0x0a, 0x0a, 0x50, 0x76, 0x70, 0x49, 0x6e, 0x74, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x1a, + 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x22, 0x6f, 0x0a, 0x0b, 0x50, 0x76, + 0x70, 0x49, 0x6e, 0x74, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, + 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, + 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0xac, 0x01, 0x0a, 0x0c, + 0x50, 0x76, 0x70, 0x52, 0x65, 0x61, 0x64, 0x79, 0x50, 0x75, 0x73, 0x68, 0x12, 0x20, 0x0a, 0x0b, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1a, + 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x03, 0x72, 0x65, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x50, 0x76, 0x70, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x03, 0x72, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x04, 0x62, 0x6c, + 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x50, 0x76, 0x70, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x22, 0x4d, 0x0a, 0x0d, 0x50, 0x76, + 0x70, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x75, 0x73, 0x68, 0x12, 0x20, 0x0a, 0x0b, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x03, 0x63, 0x6d, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, - 0x6d, 0x64, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x22, 0x5d, 0x0a, 0x0f, 0x50, 0x76, 0x70, + 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, + 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, + 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2a, 0x0a, 0x10, 0x50, 0x76, 0x70, 0x46, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, + 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, + 0x73, 0x75, 0x63, 0x63, 0x22, 0x4f, 0x0a, 0x0c, 0x50, 0x76, 0x70, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x50, 0x75, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x49, 0x0a, 0x0d, 0x50, 0x76, 0x70, 0x4f, 0x75, 0x74, 0x43, + 0x6d, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0a, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6d, 0x64, 0x52, 0x03, 0x63, 0x6d, 0x64, + 0x22, 0x47, 0x0a, 0x0b, 0x50, 0x76, 0x70, 0x49, 0x6e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x71, 0x12, + 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x03, 0x63, + 0x6d, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x43, 0x6d, 0x64, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x22, 0x68, 0x0a, 0x0c, 0x50, 0x76, 0x70, + 0x49, 0x6e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, + 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, + 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6d, 0x64, 0x52, 0x03, + 0x63, 0x6d, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -561,37 +734,45 @@ func file_pvp_pvp_msg_proto_rawDescGZIP() []byte { return file_pvp_pvp_msg_proto_rawDescData } -var file_pvp_pvp_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_pvp_pvp_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_pvp_pvp_msg_proto_goTypes = []interface{}{ - (*PvpReadyPush)(nil), // 0: PvpReadyPush - (*PvpCancelPush)(nil), // 1: PvpCancelPush - (*PvpFormationReq)(nil), // 2: PvpFormationReq - (*PvpFormationResp)(nil), // 3: PvpFormationResp - (*PvpStartPush)(nil), // 4: PvpStartPush - (*PvpOutCmdPush)(nil), // 5: PvpOutCmdPush - (*PvpInCmdReq)(nil), // 6: PvpInCmdReq - (*PvpInCmdResp)(nil), // 7: PvpInCmdResp - (*PvpUserInfo)(nil), // 8: PvpUserInfo - (*BattleFormation)(nil), // 9: BattleFormation - (ErrorCode)(0), // 10: ErrorCode - (*BattleInfo)(nil), // 11: BattleInfo - (*BattleCmd)(nil), // 12: BattleCmd + (*PvpListPush)(nil), // 0: PvpListPush + (*PvpIntoReq)(nil), // 1: PvpIntoReq + (*PvpIntoResp)(nil), // 2: PvpIntoResp + (*PvpReadyPush)(nil), // 3: PvpReadyPush + (*PvpCancelPush)(nil), // 4: PvpCancelPush + (*PvpFormationReq)(nil), // 5: PvpFormationReq + (*PvpFormationResp)(nil), // 6: PvpFormationResp + (*PvpStartPush)(nil), // 7: PvpStartPush + (*PvpOutCmdPush)(nil), // 8: PvpOutCmdPush + (*PvpInCmdReq)(nil), // 9: PvpInCmdReq + (*PvpInCmdResp)(nil), // 10: PvpInCmdResp + (*DBPvpBattle)(nil), // 11: DBPvpBattle + (ErrorCode)(0), // 12: ErrorCode + (*BattleStateInfo)(nil), // 13: BattleStateInfo + (*PvpUserInfo)(nil), // 14: PvpUserInfo + (*BattleFormation)(nil), // 15: BattleFormation + (*BattleInfo)(nil), // 16: BattleInfo + (*BattleCmd)(nil), // 17: BattleCmd } var file_pvp_pvp_msg_proto_depIdxs = []int32{ - 8, // 0: PvpReadyPush.red:type_name -> PvpUserInfo - 8, // 1: PvpReadyPush.blue:type_name -> PvpUserInfo - 9, // 2: PvpFormationReq.formation:type_name -> BattleFormation - 10, // 3: PvpStartPush.code:type_name -> ErrorCode - 11, // 4: PvpStartPush.info:type_name -> BattleInfo - 12, // 5: PvpOutCmdPush.cmd:type_name -> BattleCmd - 12, // 6: PvpInCmdReq.cmd:type_name -> BattleCmd - 10, // 7: PvpInCmdResp.code:type_name -> ErrorCode - 12, // 8: PvpInCmdResp.cmd:type_name -> BattleCmd - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 11, // 0: PvpListPush.list:type_name -> DBPvpBattle + 12, // 1: PvpIntoResp.code:type_name -> ErrorCode + 13, // 2: PvpIntoResp.info:type_name -> BattleStateInfo + 14, // 3: PvpReadyPush.red:type_name -> PvpUserInfo + 14, // 4: PvpReadyPush.blue:type_name -> PvpUserInfo + 15, // 5: PvpFormationReq.formation:type_name -> BattleFormation + 12, // 6: PvpStartPush.code:type_name -> ErrorCode + 16, // 7: PvpStartPush.info:type_name -> BattleInfo + 17, // 8: PvpOutCmdPush.cmd:type_name -> BattleCmd + 17, // 9: PvpInCmdReq.cmd:type_name -> BattleCmd + 12, // 10: PvpInCmdResp.code:type_name -> ErrorCode + 17, // 11: PvpInCmdResp.cmd:type_name -> BattleCmd + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name } func init() { file_pvp_pvp_msg_proto_init() } @@ -604,7 +785,7 @@ func file_pvp_pvp_msg_proto_init() { file_errorcode_proto_init() if !protoimpl.UnsafeEnabled { file_pvp_pvp_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PvpReadyPush); i { + switch v := v.(*PvpListPush); i { case 0: return &v.state case 1: @@ -616,7 +797,7 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PvpCancelPush); i { + switch v := v.(*PvpIntoReq); i { case 0: return &v.state case 1: @@ -628,7 +809,7 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PvpFormationReq); i { + switch v := v.(*PvpIntoResp); i { case 0: return &v.state case 1: @@ -640,7 +821,7 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PvpFormationResp); i { + switch v := v.(*PvpReadyPush); i { case 0: return &v.state case 1: @@ -652,7 +833,7 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PvpStartPush); i { + switch v := v.(*PvpCancelPush); i { case 0: return &v.state case 1: @@ -664,7 +845,7 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PvpOutCmdPush); i { + switch v := v.(*PvpFormationReq); i { case 0: return &v.state case 1: @@ -676,7 +857,7 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PvpInCmdReq); i { + switch v := v.(*PvpFormationResp); i { case 0: return &v.state case 1: @@ -688,6 +869,42 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PvpStartPush); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pvp_pvp_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PvpOutCmdPush); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pvp_pvp_msg_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PvpInCmdReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pvp_pvp_msg_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PvpInCmdResp); i { case 0: return &v.state @@ -706,7 +923,7 @@ func file_pvp_pvp_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pvp_pvp_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 11, NumExtensions: 0, NumServices: 0, }, diff --git a/services/comp_gateroute.go b/services/comp_gateroute.go index 63b3d6e10..7c951c095 100644 --- a/services/comp_gateroute.go +++ b/services/comp_gateroute.go @@ -200,6 +200,9 @@ func (this *SCompGateRoute) NoticeUserLogin(ctx context.Context, args *pb.Notice "gatewayServiceId": args.GatewayServiceId, "ip": args.Ip, }, db.SetDBMgoLog(false)) + session := this.pools.Get().(comm.IUserSession) + session.SetSession(args.Ip, args.UserSessionId, args.ServiceTag, args.GatewayServiceId, args.UserId) + event.TriggerEvent(comm.EventUserLogin, session) return nil } From 4936f3be4096c303e6cd2b38234c655b6560b9d8 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Tue, 14 Feb 2023 11:35:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=94=B9=E5=8C=85=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/smithyv2/api.go | 2 +- modules/smithyv2/api_createorder.go | 2 +- modules/smithyv2/api_deskskilllv.go | 2 +- modules/smithyv2/api_getReward.go | 2 +- modules/smithyv2/api_getlist.go | 2 +- modules/smithyv2/api_getranduser.go | 2 +- modules/smithyv2/api_stoveskilllv.go | 2 +- modules/smithyv2/api_trade.go | 12 ++ modules/smithyv2/comp_configure.go | 2 +- modules/smithyv2/model_smithy.go | 2 +- modules/smithyv2/module.go | 2 +- pb/smithy_msg.pb.go | 174 +++++++++++++++++++++++---- 12 files changed, 172 insertions(+), 34 deletions(-) create mode 100644 modules/smithyv2/api_trade.go diff --git a/modules/smithyv2/api.go b/modules/smithyv2/api.go index ac92b2ac9..3b3a5f157 100644 --- a/modules/smithyv2/api.go +++ b/modules/smithyv2/api.go @@ -1,4 +1,4 @@ -package smithy +package smithyv2 import ( "go_dreamfactory/lego/core" diff --git a/modules/smithyv2/api_createorder.go b/modules/smithyv2/api_createorder.go index 652e9ba70..dd6d5bcc0 100644 --- a/modules/smithyv2/api_createorder.go +++ b/modules/smithyv2/api_createorder.go @@ -1,4 +1,4 @@ -package smithy +package smithyv2 import ( "go_dreamfactory/comm" diff --git a/modules/smithyv2/api_deskskilllv.go b/modules/smithyv2/api_deskskilllv.go index 2942405f3..41034512d 100644 --- a/modules/smithyv2/api_deskskilllv.go +++ b/modules/smithyv2/api_deskskilllv.go @@ -1,4 +1,4 @@ -package smithy +package smithyv2 import ( "crypto/rand" diff --git a/modules/smithyv2/api_getReward.go b/modules/smithyv2/api_getReward.go index 8981ae4ed..4123200d9 100644 --- a/modules/smithyv2/api_getReward.go +++ b/modules/smithyv2/api_getReward.go @@ -1,4 +1,4 @@ -package smithy +package smithyv2 import ( "go_dreamfactory/comm" diff --git a/modules/smithyv2/api_getlist.go b/modules/smithyv2/api_getlist.go index 177223f8f..814f16995 100644 --- a/modules/smithyv2/api_getlist.go +++ b/modules/smithyv2/api_getlist.go @@ -1,4 +1,4 @@ -package smithy +package smithyv2 import ( "go_dreamfactory/comm" diff --git a/modules/smithyv2/api_getranduser.go b/modules/smithyv2/api_getranduser.go index 8389d55d7..668c39b9a 100644 --- a/modules/smithyv2/api_getranduser.go +++ b/modules/smithyv2/api_getranduser.go @@ -1,4 +1,4 @@ -package smithy +package smithyv2 import ( "context" diff --git a/modules/smithyv2/api_stoveskilllv.go b/modules/smithyv2/api_stoveskilllv.go index 285b3693d..b10801d2e 100644 --- a/modules/smithyv2/api_stoveskilllv.go +++ b/modules/smithyv2/api_stoveskilllv.go @@ -1,4 +1,4 @@ -package smithy +package smithyv2 import ( "crypto/rand" diff --git a/modules/smithyv2/api_trade.go b/modules/smithyv2/api_trade.go new file mode 100644 index 000000000..081b0728e --- /dev/null +++ b/modules/smithyv2/api_trade.go @@ -0,0 +1,12 @@ +package smithyv2 + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" +) + +// 贸易 + +func (this *apiComp) TradeCheck(session comm.IUserSession, req *pb.SmithyTradeReq) (code pb.ErrorCode) { + return +} diff --git a/modules/smithyv2/comp_configure.go b/modules/smithyv2/comp_configure.go index 3487bcfb7..16a30fb6e 100644 --- a/modules/smithyv2/comp_configure.go +++ b/modules/smithyv2/comp_configure.go @@ -1,4 +1,4 @@ -package smithy +package smithyv2 import ( "go_dreamfactory/lego/core" diff --git a/modules/smithyv2/model_smithy.go b/modules/smithyv2/model_smithy.go index 4328c3be4..5ca39f653 100644 --- a/modules/smithyv2/model_smithy.go +++ b/modules/smithyv2/model_smithy.go @@ -1,4 +1,4 @@ -package smithy +package smithyv2 import ( "go_dreamfactory/comm" diff --git a/modules/smithyv2/module.go b/modules/smithyv2/module.go index c6cc7c76b..cadf12620 100644 --- a/modules/smithyv2/module.go +++ b/modules/smithyv2/module.go @@ -3,7 +3,7 @@ 描述:铁匠铺模块 开发:梅雄风 */ -package smithy +package smithyv2 import ( "go_dreamfactory/comm" diff --git a/pb/smithy_msg.pb.go b/pb/smithy_msg.pb.go index 0fbe0ff3e..262330c1a 100644 --- a/pb/smithy_msg.pb.go +++ b/pb/smithy_msg.pb.go @@ -1368,6 +1368,101 @@ func (x *SmithyGetListResp) GetData() *DBSmithy { return nil } +// 贸易 +type SmithyTradeReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ItemId []string `protobuf:"bytes,1,rep,name=itemId,proto3" json:"itemId"` //物品ID +} + +func (x *SmithyTradeReq) Reset() { + *x = SmithyTradeReq{} + if protoimpl.UnsafeEnabled { + mi := &file_smithy_smithy_msg_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SmithyTradeReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SmithyTradeReq) ProtoMessage() {} + +func (x *SmithyTradeReq) ProtoReflect() protoreflect.Message { + mi := &file_smithy_smithy_msg_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SmithyTradeReq.ProtoReflect.Descriptor instead. +func (*SmithyTradeReq) Descriptor() ([]byte, []int) { + return file_smithy_smithy_msg_proto_rawDescGZIP(), []int{28} +} + +func (x *SmithyTradeReq) GetItemId() []string { + if x != nil { + return x.ItemId + } + return nil +} + +type SmithyTradeResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsSucc bool `protobuf:"varint,1,opt,name=isSucc,proto3" json:"isSucc"` +} + +func (x *SmithyTradeResp) Reset() { + *x = SmithyTradeResp{} + if protoimpl.UnsafeEnabled { + mi := &file_smithy_smithy_msg_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SmithyTradeResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SmithyTradeResp) ProtoMessage() {} + +func (x *SmithyTradeResp) ProtoReflect() protoreflect.Message { + mi := &file_smithy_smithy_msg_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SmithyTradeResp.ProtoReflect.Descriptor instead. +func (*SmithyTradeResp) Descriptor() ([]byte, []int) { + return file_smithy_smithy_msg_proto_rawDescGZIP(), []int{29} +} + +func (x *SmithyTradeResp) GetIsSucc() bool { + if x != nil { + return x.IsSucc + } + return false +} + var File_smithy_smithy_msg_proto protoreflect.FileDescriptor var file_smithy_smithy_msg_proto_rawDesc = []byte{ @@ -1467,8 +1562,13 @@ var file_smithy_smithy_msg_proto_rawDesc = []byte{ 0x74, 0x52, 0x65, 0x71, 0x22, 0x32, 0x0a, 0x11, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x53, 0x6d, 0x69, 0x74, - 0x68, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x68, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x28, 0x0a, 0x0e, 0x53, 0x6d, 0x69, 0x74, + 0x68, 0x79, 0x54, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x74, + 0x65, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x69, 0x74, 0x65, 0x6d, + 0x49, 0x64, 0x22, 0x29, 0x0a, 0x0f, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x54, 0x72, 0x61, 0x64, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1483,7 +1583,7 @@ func file_smithy_smithy_msg_proto_rawDescGZIP() []byte { return file_smithy_smithy_msg_proto_rawDescData } -var file_smithy_smithy_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 28) +var file_smithy_smithy_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 30) var file_smithy_smithy_msg_proto_goTypes = []interface{}{ (*SmithyGetStoveInfoReq)(nil), // 0: SmithyGetStoveInfoReq (*SmithyGetStoveInfoResp)(nil), // 1: SmithyGetStoveInfoResp @@ -1513,28 +1613,30 @@ var file_smithy_smithy_msg_proto_goTypes = []interface{}{ (*SmithyGetRandUserResp)(nil), // 25: SmithyGetRandUserResp (*SmithyGetListReq)(nil), // 26: SmithyGetListReq (*SmithyGetListResp)(nil), // 27: SmithyGetListResp - (*DBStove)(nil), // 28: DBStove - (*DBBusiness)(nil), // 29: DBBusiness - (*OrderClang)(nil), // 30: OrderClang - (*DBSmithy)(nil), // 31: DBSmithy - (*DBUser)(nil), // 32: DBUser + (*SmithyTradeReq)(nil), // 28: SmithyTradeReq + (*SmithyTradeResp)(nil), // 29: SmithyTradeResp + (*DBStove)(nil), // 30: DBStove + (*DBBusiness)(nil), // 31: DBBusiness + (*OrderClang)(nil), // 32: OrderClang + (*DBSmithy)(nil), // 33: DBSmithy + (*DBUser)(nil), // 34: DBUser } var file_smithy_smithy_msg_proto_depIdxs = []int32{ - 28, // 0: SmithyGetStoveInfoResp.data:type_name -> DBStove - 28, // 1: SmithyForgeEquipResp.data:type_name -> DBStove - 28, // 2: SmithyOrderEquipResp.data:type_name -> DBStove - 28, // 3: SmithyStoveUpResp.data:type_name -> DBStove - 28, // 4: SmithyRiseResp.data:type_name -> DBStove - 28, // 5: SmithyToolsUpResp.data:type_name -> DBStove - 29, // 6: SmithyRefreshShopResp.data:type_name -> DBBusiness - 29, // 7: SmithySellItemResp.data:type_name -> DBBusiness - 30, // 8: SmithyCreateOrderReq.order:type_name -> OrderClang - 31, // 9: SmithyCreateOrderResp.data:type_name -> DBSmithy - 31, // 10: SmithyGetRewardResp.data:type_name -> DBSmithy - 31, // 11: SmithyDeskSkillLvResp.data:type_name -> DBSmithy - 31, // 12: SmithyStoveSkillLvResp.data:type_name -> DBSmithy - 32, // 13: SmithyGetRandUserResp.user:type_name -> DBUser - 31, // 14: SmithyGetListResp.data:type_name -> DBSmithy + 30, // 0: SmithyGetStoveInfoResp.data:type_name -> DBStove + 30, // 1: SmithyForgeEquipResp.data:type_name -> DBStove + 30, // 2: SmithyOrderEquipResp.data:type_name -> DBStove + 30, // 3: SmithyStoveUpResp.data:type_name -> DBStove + 30, // 4: SmithyRiseResp.data:type_name -> DBStove + 30, // 5: SmithyToolsUpResp.data:type_name -> DBStove + 31, // 6: SmithyRefreshShopResp.data:type_name -> DBBusiness + 31, // 7: SmithySellItemResp.data:type_name -> DBBusiness + 32, // 8: SmithyCreateOrderReq.order:type_name -> OrderClang + 33, // 9: SmithyCreateOrderResp.data:type_name -> DBSmithy + 33, // 10: SmithyGetRewardResp.data:type_name -> DBSmithy + 33, // 11: SmithyDeskSkillLvResp.data:type_name -> DBSmithy + 33, // 12: SmithyStoveSkillLvResp.data:type_name -> DBSmithy + 34, // 13: SmithyGetRandUserResp.user:type_name -> DBUser + 33, // 14: SmithyGetListResp.data:type_name -> DBSmithy 15, // [15:15] is the sub-list for method output_type 15, // [15:15] is the sub-list for method input_type 15, // [15:15] is the sub-list for extension type_name @@ -1886,6 +1988,30 @@ func file_smithy_smithy_msg_proto_init() { return nil } } + file_smithy_smithy_msg_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SmithyTradeReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_smithy_smithy_msg_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SmithyTradeResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1893,7 +2019,7 @@ func file_smithy_smithy_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_smithy_smithy_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 28, + NumMessages: 30, NumExtensions: 0, NumServices: 0, },