From a9ff3764224518e42609d4e5b8d167ed8e6a521d Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Wed, 6 Mar 2024 17:56:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=AE=9E=E6=97=B6=E7=AB=9E?= =?UTF-8?q?=E6=8A=80=E5=9C=BA=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 3 + comm/imodule.go | 5 + modules/pvp/module.go | 97 ++---------------- modules/realarena/api_danreceive.go | 2 +- modules/realarena/api_matchcancel.go | 2 +- modules/realarena/model.go | 31 +++++- modules/realarena/module.go | 85 ++++++++++++++-- modules/realarena/romm.go | 21 ++-- pb/realarena_db.pb.go | 75 ++++++++------ pb/realarena_msg.pb.go | 144 +++++++++++++++++++++++++-- 10 files changed, 320 insertions(+), 145 deletions(-) diff --git a/comm/const.go b/comm/const.go index 20715528a..1ea9d6f03 100644 --- a/comm/const.go +++ b/comm/const.go @@ -132,6 +132,7 @@ const ( ModuleExpedition core.M_Modules = "expedition" //工会战 ModuleExclusive core.M_Modules = "exclusive" //专武装备 ModuleBattleTest core.M_Modules = "battletset" //战斗服测试模块 + ModuleRealarena core.M_Modules = "realarena" //实时竞技场 ) // 数据表名定义处 @@ -557,6 +558,8 @@ const ( //Rpc Rpc_ModuleVikingFigthEnd core.Rpc_Key = "Rpc_ModuleVikingFigthEnd" //维京远征结算 Rpc_ModuleXXlSettlement core.Rpc_Key = "Rpc_ModuleXXlSettlement" //三消比赛结算信息 + + RPC_RealarenaTrusteeship core.Rpc_Key = "RPC_RealarenaTrusteeship" //实时竞技场离线委托 ) // 事件类型定义处 diff --git a/comm/imodule.go b/comm/imodule.go index e82873146..667542854 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -762,4 +762,9 @@ type ( AddNewExclusive(session IUserSession, cIds map[string]int32, bPush bool) (change []*pb.DB_Exclusive, errdata *pb.ErrorData) DelNewExclusive(session IUserSession, cIds []string, bPush bool) (change []*pb.DB_Exclusive, errdata *pb.ErrorData) } + //实时竞技场 + IRealarena interface { + //pvp切磋结果通知 + ChallengeResults(bid, red, bule string, winSide int32) + } ) diff --git a/modules/pvp/module.go b/modules/pvp/module.go index abe0a2d4e..d7efb606e 100644 --- a/modules/pvp/module.go +++ b/modules/pvp/module.go @@ -33,6 +33,7 @@ type Pvp struct { battle comm.IBattle gameInvite comm.IGameInvite practice comm.IPractice + realarena comm.IRealarena apicomp *apiComp modelPvpComp *modelPvpComp lock sync.RWMutex @@ -71,6 +72,10 @@ func (this *Pvp) Start() (err error) { return } this.practice = module.(comm.IPractice) + if module, err = this.service.GetModule(comm.ModuleRealarena); err != nil { + return + } + this.realarena = module.(comm.IRealarena) // event.RegisterGO(comm.EventUserLogin, this.userlogin) // event.RegisterGO(comm.EventUserOffline, this.useroffline) // this.service.RegisterFunctionName(string(comm.RPC_PVPTrusteeship), this.trusteeship) @@ -269,6 +274,11 @@ func (this *Pvp) PvpFinishPush(out *pb.BattleFinishPush) { this.practice.ChallengeResults(out.Battleid, battle.Red.Uid, battle.Blue.Uid, out.WinSide) }() break + case pb.PvpType_realarena: + go func() { + this.realarena.ChallengeResults(out.Battleid, battle.Red.Uid, battle.Blue.Uid, out.WinSide) + }() + break } this.modelPvpComp.delpvp(out.Battleid) this.PutUserSession(battle.RedSession) @@ -428,47 +438,6 @@ func (this *Pvp) startBattle(battle *BattleItem) { } } -// // 用户离线处理 -// func (this *Pvp) useroffline(uid, sessionid string) { -// var ( -// result []*pb.DBPvpBattle -// lockpath string = fmt.Sprintf("%s/%s", this.service.GetType(), this.service.GetId()) -// service map[string][]string = make(map[string][]string) -// err error -// ) -// if result, err = this.modelPvpComp.querypvps(); err != nil { -// this.Errorln(err) -// return -// } -// for _, v := range result { -// if v.Red.Uid == uid || v.Blue.Uid == uid { -// if service[v.ServicePath] == nil { -// service[v.ServicePath] = make([]string, 0) -// } -// service[v.ServicePath] = append(service[v.ServicePath], v.Id) -// } -// } - -// for k, v := range service { -// if k == lockpath { //在当前服务器上 -// this.trusteeship(context.Background(), &pb.RPC_PVPTrusteeshipReq{Battleid: v, Uid: uid}, nil) -// } else { //在别的服务器上 -// ctx, _ := context.WithTimeout(context.Background(), time.Second*5) -// _, err = this.service.RpcGo( -// ctx, -// k, -// string(comm.RPC_PVPTrusteeship), -// &pb.RPC_PVPTrusteeshipReq{Battleid: v, Uid: uid}, -// nil) -// if err != nil { -// this.Errorln(err) -// return -// } -// } -// } - -// } - func (this *Pvp) UserOffline(roomid string, uid string) (err error) { var ( battle *BattleItem @@ -511,49 +480,3 @@ func (this *Pvp) UserOffline(roomid string, uid string) (err error) { } return } - -// // 托管 -// func (this *Pvp) trusteeship(ctx context.Context, req *pb.RPC_PVPTrusteeshipReq, resp *pb.RPC_PVPTrusteeshipResp) (err error) { -// var ( -// battle *BattleItem -// ok bool -// side int32 -// data []byte -// errdata *pb.ErrorData -// ) -// for _, bid := range req.Battleid { -// this.lock.RLock() -// battle, ok = this.battles[bid] -// this.lock.RUnlock() -// if ok { -// if battle.Red.Uid == req.Uid || battle.Blue.Uid == req.Uid { -// if req.Uid == battle.Red.Uid { -// side = 1 -// battle.RedOffline = true -// } else { -// side = 2 -// battle.BlueOffline = true -// } - -// if battle.curroperate.Side == side { -// if battle.operatetimer != nil { -// timewheel.Remove(battle.operatetimer) -// } -// battle.curroperate.Auto = true -// data, _ = proto.Marshal(battle.curroperate) -// if errdata = this.battle.InCmdBattle(&pb.BattleInCmdReq{ -// Battleid: battle.Id, -// Side: battle.curroperate.Side, -// In: &pb.BattleCmd{ -// Cmdtype: "ComWaitInputSkill", -// Value: data, -// }, -// }); errdata != nil { -// return -// } -// } -// } -// } -// } -// return -// } diff --git a/modules/realarena/api_danreceive.go b/modules/realarena/api_danreceive.go index fc2030d8a..d36eda097 100644 --- a/modules/realarena/api_danreceive.go +++ b/modules/realarena/api_danreceive.go @@ -62,7 +62,7 @@ func (this *apiComp) DanReceive(session comm.IUserSession, req *pb.ArenaDanRecei } return } - if err = this.module.model.change(session, map[string]interface{}{ + if err = this.module.model.change(session.GetUserId(), map[string]interface{}{ "danaward": info.Danaward, }); err != nil { errdata = &pb.ErrorData{ diff --git a/modules/realarena/api_matchcancel.go b/modules/realarena/api_matchcancel.go index 1e2e97067..b053b0902 100644 --- a/modules/realarena/api_matchcancel.go +++ b/modules/realarena/api_matchcancel.go @@ -37,7 +37,7 @@ func (this *apiComp) MatchCancel(session comm.IUserSession, req *pb.RealArenaMat return } - if err = this.module.model.change(session, map[string]interface{}{ + if err = this.module.model.change(session.GetUserId(), map[string]interface{}{ "state": 0, }); err != nil { errdata = &pb.ErrorData{ diff --git a/modules/realarena/model.go b/modules/realarena/model.go index eae85ba9d..6886f8373 100644 --- a/modules/realarena/model.go +++ b/modules/realarena/model.go @@ -58,14 +58,26 @@ func (this *modelComp) getinfo(session comm.IUserSession) (info *pb.DBRealArena, } // /查询用户的武器背包 -func (this *modelComp) change(session comm.IUserSession, update map[string]interface{}) (err error) { +func (this *modelComp) getinfobyuid(uid string) (info *pb.DBRealArena, err error) { var ( model *realArenaModel ) - if model, err = this.getmodel(session.GetUserId()); err != nil { + if model, err = this.getmodel(uid); err != nil { return } - err = model.change(session, update) + info, err = model.getinfobyuid(uid) + return +} + +// /查询用户的武器背包 +func (this *modelComp) change(uid string, update map[string]interface{}) (err error) { + var ( + model *realArenaModel + ) + if model, err = this.getmodel(uid); err != nil { + return + } + err = model.change(uid, update) return } @@ -106,8 +118,17 @@ func (this *realArenaModel) getinfo(session comm.IUserSession) (info *pb.DBRealA } // /查询用户的武器背包 -func (this *realArenaModel) change(session comm.IUserSession, update map[string]interface{}) (err error) { - if err = this.model.Change(session.GetUserId(), update); err != nil { +func (this *realArenaModel) getinfobyuid(uid string) (info *pb.DBRealArena, err error) { + info = &pb.DBRealArena{} + if err = this.model.Get(uid, info); err != nil { + this.module.Errorf("err:%v", err) + } + return +} + +// /查询用户的武器背包 +func (this *realArenaModel) change(uid string, update map[string]interface{}) (err error) { + if err = this.model.Change(uid, update); err != nil { this.module.Errorf("err:%v", err) } return diff --git a/modules/realarena/module.go b/modules/realarena/module.go index e4ceb4d52..1448d5116 100644 --- a/modules/realarena/module.go +++ b/modules/realarena/module.go @@ -1,10 +1,12 @@ package realarena import ( + "context" "fmt" "go_dreamfactory/comm" "go_dreamfactory/lego/base" "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/log" "go_dreamfactory/modules" "go_dreamfactory/pb" "sync" @@ -13,8 +15,8 @@ import ( ) /* -模块名:红点系统 -描述:统一获取红点信息 +模块名:实时竞技场 +描述:实时竞技场 开发:李伟 */ func NewModule() core.IModule { @@ -36,7 +38,7 @@ type RealArena struct { // 模块名 func (this *RealArena) GetType() core.M_Modules { - return comm.ModuleReddot + return comm.ModuleRealarena } // 模块初始化接口 注册用户创建角色事件 @@ -57,6 +59,7 @@ func (this *RealArena) Start() (err error) { return } this.pvp = module.(comm.IPvp) + this.service.RegisterFunctionName(string(comm.RPC_RealarenaTrusteeship), this.endgame) return } @@ -76,9 +79,10 @@ func (this *RealArena) createroom(red, bule *pb.DBRealArenaMember) (room *Room, ok bool ) room = &Room{ - Id: primitive.NewObjectID().Hex(), - sessions: make([]comm.IUserSession, 0), - members: make([]*pb.DBRealArenaMember, 0), + Id: primitive.NewObjectID().Hex(), + ServicePath: fmt.Sprintf("%s", this.service.GetId()), + sessions: make([]comm.IUserSession, 0), + members: make([]*pb.DBRealArenaMember, 0), } room.members = append(room.members, red, bule) if session, ok = this.GetUserSession(red.User.Uid); ok { @@ -93,6 +97,22 @@ func (this *RealArena) createroom(red, bule *pb.DBRealArenaMember) (room *Room, err = fmt.Errorf("player:%s is Offline", bule.User.Uid) return } + if err = this.model.change(red.User.Uid, map[string]interface{}{ + "state": 2, + "roomid": room.Id, + "roompath": room.ServicePath, + }); err != nil { + this.Errorln(err) + return + } + if err = this.model.change(bule.User.Uid, map[string]interface{}{ + "state": 2, + "roomid": room.Id, + "roompath": room.ServicePath, + }); err != nil { + this.Errorln(err) + return + } this.lock.Lock() this.rooms[room.Id] = room this.lock.Unlock() @@ -101,5 +121,56 @@ func (this *RealArena) createroom(red, bule *pb.DBRealArenaMember) (room *Room, // 用户离线处理 func (this *RealArena) useroffline(uid, sessionid string) { - + var ( + info *pb.DBRealArena + err error + ) + if info, err = this.model.getinfobyuid(uid); err != nil { + this.Error("用户离线!", log.Field{Key: "err", Value: err.Error()}) + return + } + if info.State == 1 { + if err = this.match.CancelMatch(uid); err != nil { + this.Error("用户离线! 处理数据", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err.Error()}) + return + } + if err = this.model.change(uid, map[string]interface{}{ + "state": 0, + }); err != nil { + this.Error("用户离线! 处理数据", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err.Error()}) + return + } + } else if info.State == 2 { + var ( + lockpath string = fmt.Sprintf("%s/%s", this.service.GetType(), this.service.GetId()) + ) + if lockpath != info.Roompath { //在当前房间下 + _, err = this.service.RpcGo( + context.Background(), + info.Roompath, + string(comm.RPC_RealarenaTrusteeship), + &pb.RPC_RealArenaTrusteeshipReq{RoomId: info.Roomid, OffUid: info.Uid}, + nil) + if err != nil { + this.Errorln(err) + return + } + } else { + this.endgame(context.Background(), &pb.RPC_RealArenaTrusteeshipReq{RoomId: info.Roomid, OffUid: info.Uid}, &pb.RPC_RealArenaTrusteeshipResp{}) + } + } +} + +func (this *RealArena) endgame(ctx context.Context, req *pb.RPC_RealArenaTrusteeshipReq, resp *pb.RPC_RealArenaTrusteeshipResp) (err error) { + var ( + room *Room + ok bool + ) + this.lock.RLock() + room, ok = this.rooms[req.RoomId] + this.lock.RUnlock() + if ok { + room.UserOffline(req.OffUid) + } + return } diff --git a/modules/realarena/romm.go b/modules/realarena/romm.go index 96880eea9..e98dac637 100644 --- a/modules/realarena/romm.go +++ b/modules/realarena/romm.go @@ -10,20 +10,21 @@ import ( // /装备 数据组件 type Room struct { - Id string - module *RealArena - sessions []comm.IUserSession - members []*pb.DBRealArenaMember - state int //0 无状态 1选择英雄阶段 2禁用英雄阶段 3选择队长阶段 4战斗中 - step int //阶段 - handle string // 操作玩家 + Id string + ServicePath string + module *RealArena + sessions []comm.IUserSession + members []*pb.DBRealArenaMember + state int //0 无状态 1选择英雄阶段 2禁用英雄阶段 3选择队长阶段 4战斗中 + step int //阶段 + handle string // 操作玩家 } func (this *Room) init() (err error) { this.PushMessage("matchsucc", &pb.RealArenaMatchSuccPush{ Race: &pb.DBRealArenaRace{ Id: this.Id, - ServicePath: fmt.Sprintf("%s", this.module.service.GetId()), + ServicePath: this.ServicePath, Red: this.members[0], Bule: this.members[1], }, @@ -138,6 +139,10 @@ func (this *Room) selectleader(uid string, index int32) (err error) { return } +func (this *Room) UserOffline(uid string) { + +} + func (this *Room) PushMessage(stype string, msg proto.Message) { this.module.SendMsgToSession(string(this.module.GetType()), stype, msg, this.sessions...) } diff --git a/pb/realarena_db.pb.go b/pb/realarena_db.pb.go index 9e7d12f15..cea23f14d 100644 --- a/pb/realarena_db.pb.go +++ b/pb/realarena_db.pb.go @@ -33,6 +33,8 @@ type DBRealArena struct { Integral int32 `protobuf:"varint,5,opt,name=integral,proto3" json:"integral"` //积分 Danaward map[int32]int32 `protobuf:"bytes,6,rep,name=danaward,proto3" json:"danaward" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //段位奖励 State int32 `protobuf:"varint,7,opt,name=state,proto3" json:"state"` //队伍状态 0 空闲 1匹配中 2游戏中 + Roompath string `protobuf:"bytes,8,opt,name=roompath,proto3" json:"roompath"` //房间地址 + Roomid string `protobuf:"bytes,9,opt,name=roomid,proto3" json:"roomid"` //房间id } func (x *DBRealArena) Reset() { @@ -116,6 +118,20 @@ func (x *DBRealArena) GetState() int32 { return 0 } +func (x *DBRealArena) GetRoompath() string { + if x != nil { + return x.Roompath + } + return "" +} + +func (x *DBRealArena) GetRoomid() string { + if x != nil { + return x.Roomid + } + return "" +} + //队员信息 type DBRealArenaMember struct { state protoimpl.MessageState @@ -289,7 +305,7 @@ var File_realarena_realarena_db_proto protoreflect.FileDescriptor var file_realarena_realarena_db_proto_rawDesc = []byte{ 0x0a, 0x1c, 0x72, 0x65, 0x61, 0x6c, 0x61, 0x72, 0x65, 0x6e, 0x61, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x61, 0x72, 0x65, 0x6e, 0x61, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, - 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x02, 0x0a, 0x0b, 0x44, + 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc1, 0x02, 0x0a, 0x0b, 0x44, 0x42, 0x52, 0x65, 0x61, 0x6c, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x05, @@ -302,34 +318,37 @@ var file_realarena_realarena_db_proto_rawDesc = []byte{ 0x0b, 0x32, 0x1a, 0x2e, 0x44, 0x42, 0x52, 0x65, 0x61, 0x6c, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x2e, 0x44, 0x61, 0x6e, 0x61, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x64, 0x61, 0x6e, 0x61, 0x77, 0x61, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x3b, 0x0a, - 0x0d, 0x44, 0x61, 0x6e, 0x61, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc8, 0x01, 0x0a, 0x11, 0x44, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x72, 0x6f, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x72, 0x6f, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x6f, + 0x6d, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x69, + 0x64, 0x1a, 0x3b, 0x0a, 0x0d, 0x44, 0x61, 0x6e, 0x61, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc8, + 0x01, 0x0a, 0x11, 0x44, 0x42, 0x52, 0x65, 0x61, 0x6c, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64, 0x61, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, + 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, 0x6e, 0x74, + 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x68, + 0x65, 0x72, 0x6f, 0x73, 0x63, 0x69, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x68, + 0x65, 0x72, 0x6f, 0x73, 0x63, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x91, 0x01, 0x0a, 0x0f, 0x44, 0x42, + 0x52, 0x65, 0x61, 0x6c, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x52, 0x61, 0x63, 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, + 0x24, 0x0a, 0x03, 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x44, 0x42, 0x52, 0x65, 0x61, 0x6c, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x12, 0x21, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x42, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x03, 0x64, 0x61, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, - 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, - 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x05, 0x68, 0x65, 0x72, 0x6f, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x73, - 0x63, 0x69, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x68, 0x65, 0x72, 0x6f, 0x73, - 0x63, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6c, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x91, 0x01, 0x0a, 0x0f, 0x44, 0x42, 0x52, 0x65, 0x61, 0x6c, - 0x41, 0x72, 0x65, 0x6e, 0x61, 0x52, 0x61, 0x63, 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, 0x24, 0x0a, 0x03, 0x72, - 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x44, 0x42, 0x52, 0x65, 0x61, - 0x6c, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x03, 0x72, 0x65, - 0x64, 0x12, 0x26, 0x0a, 0x04, 0x62, 0x75, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x44, 0x42, 0x52, 0x65, 0x61, 0x6c, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x52, 0x04, 0x62, 0x75, 0x6c, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x03, 0x72, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x04, 0x62, 0x75, 0x6c, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x44, 0x42, 0x52, 0x65, 0x61, 0x6c, 0x41, 0x72, 0x65, 0x6e, + 0x61, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x04, 0x62, 0x75, 0x6c, 0x65, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/realarena_msg.pb.go b/pb/realarena_msg.pb.go index c45e843ba..fe1485f2e 100644 --- a/pb/realarena_msg.pb.go +++ b/pb/realarena_msg.pb.go @@ -943,6 +943,101 @@ func (x *RealArenaSelectLeaderPush) GetIndex() int32 { return 0 } +//服务内部协议------------------------------------------------------------- +//实时竞技场离线委托通知 +type RPC_RealArenaTrusteeshipReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RoomId string `protobuf:"bytes,1,opt,name=RoomId,proto3" json:"RoomId"` + OffUid string `protobuf:"bytes,2,opt,name=OffUid,proto3" json:"OffUid"` +} + +func (x *RPC_RealArenaTrusteeshipReq) Reset() { + *x = RPC_RealArenaTrusteeshipReq{} + if protoimpl.UnsafeEnabled { + mi := &file_realarena_realarena_msg_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RPC_RealArenaTrusteeshipReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RPC_RealArenaTrusteeshipReq) ProtoMessage() {} + +func (x *RPC_RealArenaTrusteeshipReq) ProtoReflect() protoreflect.Message { + mi := &file_realarena_realarena_msg_proto_msgTypes[19] + 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 RPC_RealArenaTrusteeshipReq.ProtoReflect.Descriptor instead. +func (*RPC_RealArenaTrusteeshipReq) Descriptor() ([]byte, []int) { + return file_realarena_realarena_msg_proto_rawDescGZIP(), []int{19} +} + +func (x *RPC_RealArenaTrusteeshipReq) GetRoomId() string { + if x != nil { + return x.RoomId + } + return "" +} + +func (x *RPC_RealArenaTrusteeshipReq) GetOffUid() string { + if x != nil { + return x.OffUid + } + return "" +} + +type RPC_RealArenaTrusteeshipResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RPC_RealArenaTrusteeshipResp) Reset() { + *x = RPC_RealArenaTrusteeshipResp{} + if protoimpl.UnsafeEnabled { + mi := &file_realarena_realarena_msg_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RPC_RealArenaTrusteeshipResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RPC_RealArenaTrusteeshipResp) ProtoMessage() {} + +func (x *RPC_RealArenaTrusteeshipResp) ProtoReflect() protoreflect.Message { + mi := &file_realarena_realarena_msg_proto_msgTypes[20] + 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 RPC_RealArenaTrusteeshipResp.ProtoReflect.Descriptor instead. +func (*RPC_RealArenaTrusteeshipResp) Descriptor() ([]byte, []int) { + return file_realarena_realarena_msg_proto_rawDescGZIP(), []int{20} +} + var File_realarena_realarena_msg_proto protoreflect.FileDescriptor var file_realarena_realarena_msg_proto_rawDesc = []byte{ @@ -1016,8 +1111,15 @@ var file_realarena_realarena_msg_proto_rawDesc = []byte{ 0x6c, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x06, - 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x4d, + 0x0a, 0x1b, 0x52, 0x50, 0x43, 0x5f, 0x52, 0x65, 0x61, 0x6c, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x65, 0x65, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, + 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x52, + 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x66, 0x66, 0x55, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x4f, 0x66, 0x66, 0x55, 0x69, 0x64, 0x22, 0x1e, 0x0a, + 0x1c, 0x52, 0x50, 0x43, 0x5f, 0x52, 0x65, 0x61, 0x6c, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x54, 0x72, + 0x75, 0x73, 0x74, 0x65, 0x65, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1032,7 +1134,7 @@ func file_realarena_realarena_msg_proto_rawDescGZIP() []byte { return file_realarena_realarena_msg_proto_rawDescData } -var file_realarena_realarena_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_realarena_realarena_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_realarena_realarena_msg_proto_goTypes = []interface{}{ (*RealArenaInfoReq)(nil), // 0: RealArenaInfoReq (*RealArenaInfoResp)(nil), // 1: RealArenaInfoResp @@ -1053,12 +1155,14 @@ var file_realarena_realarena_msg_proto_goTypes = []interface{}{ (*RealArenaSelectTeamLeaderReq)(nil), // 16: RealArenaSelectTeamLeaderReq (*RealArenaSelectTeamLeaderResp)(nil), // 17: RealArenaSelectTeamLeaderResp (*RealArenaSelectLeaderPush)(nil), // 18: RealArenaSelectLeaderPush - (*DBRealArena)(nil), // 19: DBRealArena - (*DBRealArenaRace)(nil), // 20: DBRealArenaRace + (*RPC_RealArenaTrusteeshipReq)(nil), // 19: RPC_RealArenaTrusteeshipReq + (*RPC_RealArenaTrusteeshipResp)(nil), // 20: RPC_RealArenaTrusteeshipResp + (*DBRealArena)(nil), // 21: DBRealArena + (*DBRealArenaRace)(nil), // 22: DBRealArenaRace } var file_realarena_realarena_msg_proto_depIdxs = []int32{ - 19, // 0: RealArenaInfoResp.info:type_name -> DBRealArena - 20, // 1: RealArenaMatchSuccPush.race:type_name -> DBRealArenaRace + 21, // 0: RealArenaInfoResp.info:type_name -> DBRealArena + 22, // 1: RealArenaMatchSuccPush.race:type_name -> DBRealArenaRace 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name @@ -1301,6 +1405,30 @@ func file_realarena_realarena_msg_proto_init() { return nil } } + file_realarena_realarena_msg_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RPC_RealArenaTrusteeshipReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_realarena_realarena_msg_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RPC_RealArenaTrusteeshipResp); 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{ @@ -1308,7 +1436,7 @@ func file_realarena_realarena_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_realarena_realarena_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 19, + NumMessages: 21, NumExtensions: 0, NumServices: 0, },