From 80688110a50349fe5ca43f96094773dc8d5c2eb6 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 14 Feb 2023 17:03:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E6=97=B6pvp=E6=96=AD=E7=BA=BF?= =?UTF-8?q?=E9=87=8D=E8=BF=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/autoBattle/model_auto.go | 2 +- modules/battle/battleclientmgr.go | 6 +- modules/battle/module.go | 2 +- modules/comp_model.go | 4 +- modules/equipment/modelEquipment.go | 4 +- modules/gateway/agentmgr_comp.go | 20 ++ modules/gateway/configure_comp.go | 2 + modules/hero/model_hero.go | 4 +- modules/items/modelitems.go | 6 +- modules/mline/model_mainline.go | 2 +- modules/modulebase.go | 9 +- modules/moonfantasy/modelDream.go | 2 +- modules/pvp/api_incmd.go | 18 +- modules/pvp/api_into.go | 4 + modules/pvp/api_list.go | 57 +++++ modules/pvp/modelPvp.go | 4 +- modules/pvp/module.go | 70 +++--- modules/sociaty/model_sociaty.go | 4 +- modules/sociaty/model_sociatytask.go | 2 +- modules/user/module.go | 13 +- pb/battle_struct.pb.go | 82 ++++++- pb/pvp_msg.pb.go | 339 ++++++++++++++++----------- sys/db/dbmodel.go | 7 +- 23 files changed, 448 insertions(+), 215 deletions(-) create mode 100644 modules/pvp/api_list.go diff --git a/modules/autoBattle/model_auto.go b/modules/autoBattle/model_auto.go index cd52ea16b..b7e329fb8 100644 --- a/modules/autoBattle/model_auto.go +++ b/modules/autoBattle/model_auto.go @@ -35,7 +35,7 @@ func (this *modelAutoBattle) ChangeListByObjId(uid string, id string, data map[s // 删除自动战斗信息 func (this *modelAutoBattle) DelListByObjId(uid string, id string) error { - err := this.DelListlds(uid, id) + err := this.DelListlds(uid, []string{id}) return err } diff --git a/modules/battle/battleclientmgr.go b/modules/battle/battleclientmgr.go index 43f2d2fec..dd37984ec 100644 --- a/modules/battle/battleclientmgr.go +++ b/modules/battle/battleclientmgr.go @@ -71,10 +71,10 @@ func (this *battleClientMgrComp) CheckBattle(ctx context.Context, req *pb.Battle } //实时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}) +func (this *battleClientMgrComp) GetInfo(ctx context.Context, req *pb.BattleGetInfoReq) (reply *pb.BattleGetInfoResp, err error) { + this.module.Debug("GetInfo", log.Field{Key: "req", Value: req}) - reply = &pb.BattleGetInfoReq{} + reply = &pb.BattleGetInfoResp{} if err = this.clinet.callBattle(ctx, "GetInfo", req, reply); err != nil { this.module.Errorln(err) } diff --git a/modules/battle/module.go b/modules/battle/module.go index f65948e22..aa17d976a 100644 --- a/modules/battle/module.go +++ b/modules/battle/module.go @@ -221,7 +221,7 @@ func (this *Battle) CreateRtPvpBattle(req *pb.BattleRTPVPReq) (code pb.ErrorCode } ///获取战斗详情 -func (this *Battle) GetBattleInfo(req *pb.BattleGetInfoReq) (code pb.ErrorCode, resp *pb.BattleGetInfoReq) { +func (this *Battle) GetBattleInfo(req *pb.BattleGetInfoReq) (code pb.ErrorCode, resp *pb.BattleGetInfoResp) { this.Debug("GetBattleInfo", log.Field{Key: "req", Value: req}) var ( ctx context.Context diff --git a/modules/comp_model.go b/modules/comp_model.go index cadaeb6ea..ef50507b0 100644 --- a/modules/comp_model.go +++ b/modules/comp_model.go @@ -149,8 +149,8 @@ func (this *MCompModel) DelByUId(uid string, opt ...db.DBOption) (err error) { } //删除多条数据 -func (this *MCompModel) DelListlds(uid string, ids ...string) (err error) { - return this.DBModel.DelListlds(uid, ids...) +func (this *MCompModel) DelListlds(uid string, ids []string, opt ...db.DBOption) (err error) { + return this.DBModel.DelListlds(uid, ids, opt...) } //批量删除数据 diff --git a/modules/equipment/modelEquipment.go b/modules/equipment/modelEquipment.go index 14146da05..00183cf3f 100644 --- a/modules/equipment/modelEquipment.go +++ b/modules/equipment/modelEquipment.go @@ -188,13 +188,13 @@ func (this *modelEquipmentComp) DelEquipments(uId string, eIds []string) (change if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil { this.module.Errorln(err) } else { - if err = model.DelListlds(uId, eIds...); err != nil { + if err = model.DelListlds(uId, eIds); err != nil { this.module.Errorln(err) return } } } else { - if err = this.DelListlds(uId, eIds...); err != nil { + if err = this.DelListlds(uId, eIds); err != nil { this.module.Errorln(err) return } diff --git a/modules/gateway/agentmgr_comp.go b/modules/gateway/agentmgr_comp.go index 0b811f83f..1cbc4847a 100644 --- a/modules/gateway/agentmgr_comp.go +++ b/modules/gateway/agentmgr_comp.go @@ -37,6 +37,11 @@ func (this *AgentMgrComp) Init(service core.IService, module core.IModule, comp return } +func (this *AgentMgrComp) Start() (err error) { + err = this.ModuleCompBase.Start() + return +} + // Connect 加入新的用户 func (this *AgentMgrComp) Connect(a IAgent) { this.agents.Store(a.SessionId(), a) @@ -191,3 +196,18 @@ func (this *AgentMgrComp) CloseAgent(ctx context.Context, args *pb.AgentCloseeRe } return nil } + +// 用户代理心跳 维护session表对象 +func (this *AgentMgrComp) agentsHeartbeat() { + // var ( + // loadpipe *pipe.RedisPipe + // loadpipe *pipe.RedisPipe + // ) + // this.agents.Range(func(key, value any) bool { + // agent := value.(IAgent) + // if agent.UserId() != "" { //只发送登录用户 + + // } + // return true + // }) +} diff --git a/modules/gateway/configure_comp.go b/modules/gateway/configure_comp.go index 76da9ccbb..7503a3010 100644 --- a/modules/gateway/configure_comp.go +++ b/modules/gateway/configure_comp.go @@ -25,6 +25,8 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp return } + + // GetMsgDistribute 获取消息分发规则读取配置表 func (this *configureComp) GetMsgDistribute(msgmid, msguid string) (rule string, ok bool) { var ( diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index 330b416dc..677dd2c47 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -185,7 +185,7 @@ func (this *ModelHero) consumeHeroCard(uid string, hero *pb.DBHero, count int32) } hero.SameCount -= count // 数量-1 if hero.SameCount == 0 { - if err := this.DelListlds(uid, hero.Id); err != nil { + if err := this.DelListlds(uid, []string{hero.Id}); err != nil { this.moduleHero.Errorf("%v", err) } } else { @@ -482,7 +482,7 @@ func (this *ModelHero) ChangeHeroProperty(session comm.IUserSession, hero *pb.DB func (this *ModelHero) cleanData(uid string) { userList := this.moduleHero.GetHeroList(uid) for _, v := range userList { - if err := this.DelListlds(uid, v.Id); err != nil { + if err := this.DelListlds(uid, []string{v.Id}); err != nil { this.moduleHero.Errorf("cleanData err:%v", err) } } diff --git a/modules/items/modelitems.go b/modules/items/modelitems.go index 742874cfa..d7e795f26 100644 --- a/modules/items/modelitems.go +++ b/modules/items/modelitems.go @@ -175,13 +175,13 @@ func (this *ModelItemsComp) DeleteUserPack(uid string, itmes ...*pb.DB_UserItemD if model, err = this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil { this.module.Errorln(err) } else { - if err = model.DelListlds(uid, gridIds...); err != nil { + if err = model.DelListlds(uid, gridIds); err != nil { this.module.Errorf("err:%v", err) return } } } else { - if err = this.DelListlds(uid, gridIds...); err != nil { + if err = this.DelListlds(uid, gridIds); err != nil { this.module.Errorf("err:%v", err) return } @@ -195,7 +195,7 @@ func (this *ModelItemsComp) QueryUserPackItemsAmount(uId string, itemid ...strin itmes []*pb.DB_UserItemData err error ) - + if itmes, err = this.QueryUserPack(uId); err != nil { this.module.Errorf("err:%v", err) return diff --git a/modules/mline/model_mainline.go b/modules/mline/model_mainline.go index 9563316ac..0493ea022 100644 --- a/modules/mline/model_mainline.go +++ b/modules/mline/model_mainline.go @@ -72,7 +72,7 @@ func (this *ModelMline) cleanChapter(uId string) (err error) { // 清除数据 func (this *ModelMline) cleanChapterDataById(uId string, ids ...string) (err error) { - if err = this.DelListlds(uId, ids...); err != nil { + if err = this.DelListlds(uId, ids); err != nil { this.module.Errorf("err:%v", err) return } diff --git a/modules/modulebase.go b/modules/modulebase.go index cf574d9cc..7990fe405 100644 --- a/modules/modulebase.go +++ b/modules/modulebase.go @@ -188,7 +188,8 @@ func (this *ModuleBase) SendMsgToUsers(mainType, subType string, msg proto.Messa data, _ := anypb.New(msg) for k, v := range gateways { for k1, v1 := range v { - if _, err = this.service.AcrossClusterRpcGo(context.Background(), k, fmt.Sprintf("%s/%s", comm.Service_Gateway, k1), string(comm.Rpc_GatewaySendBatchMsg), &pb.BatchMessageReq{ + ctx, _ := context.WithTimeout(context.Background(), time.Second*5) + if _, err = this.service.AcrossClusterRpcGo(ctx, k, fmt.Sprintf("%s/%s", comm.Service_Gateway, k1), string(comm.Rpc_GatewaySendBatchMsg), &pb.BatchMessageReq{ UserSessionIds: v1, MainType: mainType, SubType: subType, @@ -223,7 +224,8 @@ func (this *ModuleBase) SendMsgToCUsers(mainType, subType string, msg proto.Mess data, _ := anypb.New(msg) for k, v := range gateways { for k1, v1 := range v { - if _, err = this.service.AcrossClusterRpcGo(context.Background(), k, fmt.Sprintf("%s/%s", comm.Service_Gateway, k1), string(comm.Rpc_GatewaySendBatchMsg), &pb.BatchMessageReq{ + ctx, _ := context.WithTimeout(context.Background(), time.Second*5) + if _, err = this.service.AcrossClusterRpcGo(ctx, k, fmt.Sprintf("%s/%s", comm.Service_Gateway, k1), string(comm.Rpc_GatewaySendBatchMsg), &pb.BatchMessageReq{ UserSessionIds: v1, MainType: mainType, SubType: subType, @@ -258,7 +260,8 @@ func (this *ModuleBase) SendMsgToSession(mainType, subType string, msg proto.Mes data, _ := anypb.New(msg) for k, v := range gateways { for k1, v1 := range v { - if _, err = this.service.AcrossClusterRpcGo(context.Background(), k, fmt.Sprintf("%s/%s", comm.Service_Gateway, k1), string(comm.Rpc_GatewaySendBatchMsg), &pb.BatchMessageReq{ + ctx, _ := context.WithTimeout(context.Background(), time.Second*5) + if _, err = this.service.AcrossClusterRpcGo(ctx, k, fmt.Sprintf("%s/%s", comm.Service_Gateway, k1), string(comm.Rpc_GatewaySendBatchMsg), &pb.BatchMessageReq{ UserSessionIds: v1, MainType: mainType, SubType: subType, diff --git a/modules/moonfantasy/modelDream.go b/modules/moonfantasy/modelDream.go index a49016a1f..e2e6dbcc0 100644 --- a/modules/moonfantasy/modelDream.go +++ b/modules/moonfantasy/modelDream.go @@ -242,7 +242,7 @@ func (this *modelDreamComp) delaynoticeWorld(mid string, chat *pb.DBChat) { func (this *modelDreamComp) checkMFantasyExpiration(mf *pb.DBMoonFantasy) bool { if configure.Now().After(time.Unix(mf.Expir, 0)) { //已过期 - this.DelListlds("", mf.Id) + this.DelListlds("", []string{mf.Id}) return true } return false diff --git a/modules/pvp/api_incmd.go b/modules/pvp/api_incmd.go index cf97c1558..f93d5cbd1 100644 --- a/modules/pvp/api_incmd.go +++ b/modules/pvp/api_incmd.go @@ -4,6 +4,7 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/lego/sys/timewheel" "go_dreamfactory/pb" + "time" "google.golang.org/protobuf/proto" ) @@ -32,6 +33,19 @@ func (this *apiComp) InCmd(session comm.IUserSession, req *pb.PvpInCmdReq) (code } else { side = 2 } + //不该自己出手 + if battle.curroperate.Side != side { + session.SendMsg(string(this.module.GetType()), "incmd", &pb.PvpInCmdResp{Code: pb.ErrorCode_BattleInCmdFailed, Battleid: req.Battleid, Cmd: req.Cmd}) + return + } + + //请求倒计时开始 + if req.Cmd.Cmdtype == "ComEmitCountdown" { + battle.operatetimer = timewheel.Add(time.Second*30, this.module.operateTimeOut, battle.Id) + session.SendMsg(string(this.module.GetType()), "incmd", &pb.PvpInCmdResp{Battleid: req.Battleid, Cmd: req.Cmd}) + return + } + //技能释放指令 if code = this.module.battle.InCmdBattle(&pb.BattleInCmdReq{ Battleid: req.Battleid, Side: side, @@ -39,7 +53,9 @@ func (this *apiComp) InCmd(session comm.IUserSession, req *pb.PvpInCmdReq) (code }); code != pb.ErrorCode_Success { return } else { - timewheel.Remove(battle.operatetimer) + if battle.operatetimer != nil { + timewheel.Remove(battle.operatetimer) + } } } else { code = pb.ErrorCode_BattleInCmdFailed diff --git a/modules/pvp/api_into.go b/modules/pvp/api_into.go index 9dd1e0eec..a81c57f5e 100644 --- a/modules/pvp/api_into.go +++ b/modules/pvp/api_into.go @@ -30,11 +30,15 @@ func (this *apiComp) Into(session comm.IUserSession, req *pb.PvpIntoReq) (code p if cd, resp = this.module.battle.GetBattleInfo(&pb.BattleGetInfoReq{ Battleid: req.Battleid, }); cd == pb.ErrorCode_Success { + battle.lock.Lock() if session.GetUserId() == battle.Red.Uid { battle.RedOffline = false + battle.RedSession.SetSession(session.GetIP(), session.GetSessionId(), session.GetServiecTag(), session.GetGatewayServiceId(), session.GetUserId()) } else { battle.BlueOffline = false + battle.RedSession.SetSession(session.GetIP(), session.GetSessionId(), session.GetServiecTag(), session.GetGatewayServiceId(), session.GetUserId()) } + battle.lock.Unlock() } } else { cd = pb.ErrorCode_BattleInCmdFailed diff --git a/modules/pvp/api_list.go b/modules/pvp/api_list.go new file mode 100644 index 000000000..687bf39b6 --- /dev/null +++ b/modules/pvp/api_list.go @@ -0,0 +1,57 @@ +package pvp + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.PvpListReq) (code pb.ErrorCode) { + return +} + +///设置战斗阵型 +func (this *apiComp) List(session comm.IUserSession, req *pb.PvpListReq) (code pb.ErrorCode, data proto.Message) { + var ( + result []*pb.DBPvpBattle + userpvp []*pb.DBPvpBattle + list []*pb.DBPvpBattle + + err error + ) + if code = this.ListCheck(session, req); code != pb.ErrorCode_Success { + return + } + + defer func() { + session.SendMsg(string(this.module.GetType()), "list", &pb.PvpListResp{List: list}) + }() + + if result, err = this.module.modelPvpComp.querypvps(); err != nil { + this.module.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) + } + } + if len(userpvp) <= 0 { + return + } + for _, v := range result { + list = append(list, &pb.DBPvpBattle{ + Id: v.Id, + ServicePath: v.ServicePath, + Ptype: v.Ptype, + State: v.State, + Red: v.Red, + Blue: v.Blue, + }) + } + return +} diff --git a/modules/pvp/modelPvp.go b/modules/pvp/modelPvp.go index 8e35b9388..547093d41 100644 --- a/modules/pvp/modelPvp.go +++ b/modules/pvp/modelPvp.go @@ -30,7 +30,7 @@ func (this *modelPvpComp) Init(service core.IService, module core.IModule, comp //查询用户重置数据 func (this *modelPvpComp) querypvps() (result []*pb.DBPvpBattle, err error) { result = make([]*pb.DBPvpBattle, 0) - if err = this.GetList("", result); err != nil && err != mgo.MongodbNil { + if err = this.GetList("", &result); err != nil && err != mgo.MongodbNil { this.module.Errorf("err:%v", err) } if err == mgo.MongodbNil { @@ -49,7 +49,7 @@ func (this *modelPvpComp) addpvp(battle *pb.DBPvpBattle) (err error) { //删除pvp记录 func (this *modelPvpComp) delpvp(battleid string) (err error) { - if err = this.Del(battleid, db.SetDBMgoLog(false)); err != nil { + if err = this.DelListlds("", []string{battleid}, db.SetDBMgoLog(false)); err != nil { this.module.Errorln(err) } return diff --git a/modules/pvp/module.go b/modules/pvp/module.go index 424a3b5a9..7356e1274 100644 --- a/modules/pvp/module.go +++ b/modules/pvp/module.go @@ -63,7 +63,7 @@ func (this *Pvp) Start() (err error) { return } this.friend = module.(comm.IFriend) - event.RegisterGO(comm.EventUserLogin, this.userlogin) + // event.RegisterGO(comm.EventUserLogin, this.userlogin) event.RegisterGO(comm.EventUserOffline, this.useroffline) return } @@ -132,12 +132,14 @@ func (this *Pvp) PvpOutCmdPush(out *pb.PvpOutCmdPush) { battle, ok = this.battles[out.Battleid] this.lock.RUnlock() if ok { + battle.lock.Lock() if err = this.SendMsgToSession(string(comm.ModulePvp), "outcmd", &pb.PvpOutCmdPush{ Battleid: battle.Id, Cmd: out.Cmd, }, battle.RedSession, battle.BlueSession); err != nil { this.Errorln(err) } + battle.lock.Unlock() for _, v := range out.Cmd { if v.Cmdtype == "ComWaitInputSkill" { if err = proto.Unmarshal(v.Value, battle.curroperate); err != nil { @@ -173,7 +175,6 @@ func (this *Pvp) PvpOutCmdPush(out *pb.PvpOutCmdPush) { } return } - battle.operatetimer = timewheel.Add(time.Second*60, this.operateTimeOut, battle.Id) } } @@ -330,38 +331,43 @@ func (this *Pvp) startBattle(battle *BattleItem) { } } -//用户离线处理 +//用户离线处理 弃用 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, - }) - } + // var ( + // result []*pb.DBPvpBattle + // userpvp []*pb.DBPvpBattle + // push *pb.PvpListPush + // err error + // ) + // if result, err = this.modelPvpComp.querypvps(); err != nil { + // this.Errorln(err) + // return + // } - session.SendMsg(string(comm.ModulePvp), "list", push) - session.Push() + // 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) + // } + // } + // if len(userpvp) <= 0 { + // return + // } + // 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() + // this.Debug("GetPvpInfo", log.Field{Key: "uid", Value: session.GetSessionId()}, log.Field{Key: "list", Value: push.String()}) } //用户离线处理 diff --git a/modules/sociaty/model_sociaty.go b/modules/sociaty/model_sociaty.go index 4c39a9244..c47212f3b 100644 --- a/modules/sociaty/model_sociaty.go +++ b/modules/sociaty/model_sociaty.go @@ -373,7 +373,7 @@ func (this *ModelSociaty) dismiss(sociaty *pb.DBSociaty) error { if err := this.memberClear(sociaty); err != nil { return err } - if err := this.DelListlds("", sociaty.Id); err != nil { + if err := this.DelListlds("", []string{sociaty.Id}); err != nil { return err } //推送 @@ -832,7 +832,7 @@ func (this *ModelSociaty) rankDataChanged(event interface{}, next func(event int for _, v := range lastData { delIds = append(delIds, v.SociatyId) } - this.DelListlds("", delIds...) + this.DelListlds("", delIds) } } diff --git a/modules/sociaty/model_sociatytask.go b/modules/sociaty/model_sociatytask.go index 5bb6e8f0f..e292caa66 100644 --- a/modules/sociaty/model_sociatytask.go +++ b/modules/sociaty/model_sociatytask.go @@ -68,7 +68,7 @@ func (this *ModelSociatyTask) getUserTask(uid, sociatyId string) (task *pb.DBSoc // 删除公会任务 func (this *ModelSociatyTask) deleTask(sociatyId, uid string) error { - return this.DelListlds(sociatyId, uid) + return this.DelListlds(sociatyId, []string{uid}) } // 任务奖励领取 diff --git a/modules/user/module.go b/modules/user/module.go index 4b23a682f..c398423fa 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -146,7 +146,7 @@ func (this *User) ResetSession() { } for _, v := range us { - this.modelSession.DelListlds(comm.RDS_EMPTY, v.Uid) + this.modelSession.DelListlds(comm.RDS_EMPTY, []string{v.Uid}) } } @@ -155,10 +155,15 @@ func (this *User) CleanSession(session comm.IUserSession) { this.stopTicker(session.GetUserId()) if !this.IsCross() { this.modelUser.updateOfflineTime(session.GetUserId()) + + } + // sId := fmt.Sprintf("%s-%s", comm.RDS_EMPTY, session.GetUserId()) + // this.modelSession.Del(sId, db.SetDBMgoLog(false)) + // this.modelSession.DelListlds(comm.RDS_EMPTY, session.GetUserId()) + //确保删除的会话是目标会话 不是就不要删除了 + if user := this.modelSession.getUserSession(session.GetUserId()); user != nil && user.SessionId == session.GetSessionId() { + this.modelSession.Del(session.GetUserId(), db.SetDBMgoLog(false)) } - sId := fmt.Sprintf("%s-%s", comm.RDS_EMPTY, session.GetUserId()) - this.modelSession.Del(sId, db.SetDBMgoLog(false)) - this.modelSession.DelListlds(comm.RDS_EMPTY, session.GetUserId()) this.modelUser.DelByUId(session.GetUserId(), db.SetDBMgoLog(false)) this.modelExpand.DelByUId(session.GetUserId(), db.SetDBMgoLog(false)) this.modelSetting.DelByUId(session.GetUserId(), db.SetDBMgoLog(false)) diff --git a/pb/battle_struct.pb.go b/pb/battle_struct.pb.go index e60573068..abcea88e0 100644 --- a/pb/battle_struct.pb.go +++ b/pb/battle_struct.pb.go @@ -1380,6 +1380,54 @@ func (x *ComPlayEffect) GetSide() int32 { return 0 } +//出手倒计时 +type ComEmitCountdown struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Reserve int32 `protobuf:"varint,1,opt,name=reserve,proto3" json:"reserve"` +} + +func (x *ComEmitCountdown) Reset() { + *x = ComEmitCountdown{} + if protoimpl.UnsafeEnabled { + mi := &file_battle_battle_struct_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ComEmitCountdown) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ComEmitCountdown) ProtoMessage() {} + +func (x *ComEmitCountdown) ProtoReflect() protoreflect.Message { + mi := &file_battle_battle_struct_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 ComEmitCountdown.ProtoReflect.Descriptor instead. +func (*ComEmitCountdown) Descriptor() ([]byte, []int) { + return file_battle_battle_struct_proto_rawDescGZIP(), []int{20} +} + +func (x *ComEmitCountdown) GetReserve() int32 { + if x != nil { + return x.Reserve + } + return 0 +} + var File_battle_battle_struct_proto protoreflect.FileDescriptor var file_battle_battle_struct_proto_rawDesc = []byte{ @@ -1517,8 +1565,11 @@ var file_battle_battle_struct_proto_rawDesc = []byte{ 0x1e, 0x0a, 0x0a, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, - 0x69, 0x64, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x69, 0x64, 0x65, 0x22, 0x2c, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x45, 0x6d, 0x69, 0x74, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -1533,7 +1584,7 @@ func file_battle_battle_struct_proto_rawDescGZIP() []byte { return file_battle_battle_struct_proto_rawDescData } -var file_battle_battle_struct_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_battle_battle_struct_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_battle_battle_struct_proto_goTypes = []interface{}{ (*ComModifyOperate)(nil), // 0: ComModifyOperate (*ComStartFight)(nil), // 1: ComStartFight @@ -1555,16 +1606,17 @@ var file_battle_battle_struct_proto_goTypes = []interface{}{ (*ComGuide)(nil), // 17: ComGuide (*ComCreateRoles)(nil), // 18: ComCreateRoles (*ComPlayEffect)(nil), // 19: ComPlayEffect - (*BattleRole)(nil), // 20: BattleRole - (*BattleCmd)(nil), // 21: BattleCmd + (*ComEmitCountdown)(nil), // 20: ComEmitCountdown + (*BattleRole)(nil), // 21: BattleRole + (*BattleCmd)(nil), // 22: BattleCmd } var file_battle_battle_struct_proto_depIdxs = []int32{ - 20, // 0: ComInitFight.roles:type_name -> BattleRole + 21, // 0: ComInitFight.roles:type_name -> BattleRole 5, // 1: ComStartAction.skillInfo:type_name -> ComSkillInfo 5, // 2: ComSkillCDAction.skillInfo:type_name -> ComSkillInfo 11, // 3: ComSkillAtk.comList:type_name -> ComSkillAfterAtk - 21, // 4: ComSkillAfterAtk.comList:type_name -> BattleCmd - 20, // 5: ComCreateRoles.roles:type_name -> BattleRole + 22, // 4: ComSkillAfterAtk.comList:type_name -> BattleCmd + 21, // 5: ComCreateRoles.roles:type_name -> BattleRole 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 @@ -1820,6 +1872,18 @@ func file_battle_battle_struct_proto_init() { return nil } } + file_battle_battle_struct_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ComEmitCountdown); 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{ @@ -1827,7 +1891,7 @@ func file_battle_battle_struct_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_battle_battle_struct_proto_rawDesc, NumEnums: 0, - NumMessages: 20, + NumMessages: 21, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/pvp_msg.pb.go b/pb/pvp_msg.pb.go index e21838266..baf8bb24a 100644 --- a/pb/pvp_msg.pb.go +++ b/pb/pvp_msg.pb.go @@ -20,17 +20,15 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -//战斗列表推送 -type PvpListPush struct { +//战斗列表 请求 +type PvpListReq 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{} +func (x *PvpListReq) Reset() { + *x = PvpListReq{} if protoimpl.UnsafeEnabled { mi := &file_pvp_pvp_msg_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -38,13 +36,13 @@ func (x *PvpListPush) Reset() { } } -func (x *PvpListPush) String() string { +func (x *PvpListReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PvpListPush) ProtoMessage() {} +func (*PvpListReq) ProtoMessage() {} -func (x *PvpListPush) ProtoReflect() protoreflect.Message { +func (x *PvpListReq) ProtoReflect() protoreflect.Message { mi := &file_pvp_pvp_msg_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -56,12 +54,53 @@ func (x *PvpListPush) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PvpListPush.ProtoReflect.Descriptor instead. -func (*PvpListPush) Descriptor() ([]byte, []int) { +// Deprecated: Use PvpListReq.ProtoReflect.Descriptor instead. +func (*PvpListReq) Descriptor() ([]byte, []int) { return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{0} } -func (x *PvpListPush) GetList() []*DBPvpBattle { +//战斗列表 请求回应 +type PvpListResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*DBPvpBattle `protobuf:"bytes,1,rep,name=list,proto3" json:"list"` +} + +func (x *PvpListResp) Reset() { + *x = PvpListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_pvp_pvp_msg_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PvpListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PvpListResp) ProtoMessage() {} + +func (x *PvpListResp) 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 PvpListResp.ProtoReflect.Descriptor instead. +func (*PvpListResp) Descriptor() ([]byte, []int) { + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{1} +} + +func (x *PvpListResp) GetList() []*DBPvpBattle { if x != nil { return x.List } @@ -80,7 +119,7 @@ type PvpIntoReq struct { func (x *PvpIntoReq) Reset() { *x = PvpIntoReq{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[1] + mi := &file_pvp_pvp_msg_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -93,7 +132,7 @@ func (x *PvpIntoReq) String() string { func (*PvpIntoReq) ProtoMessage() {} func (x *PvpIntoReq) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[1] + mi := &file_pvp_pvp_msg_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -106,7 +145,7 @@ func (x *PvpIntoReq) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpIntoReq.ProtoReflect.Descriptor instead. func (*PvpIntoReq) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{1} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{2} } func (x *PvpIntoReq) GetBattleid() string { @@ -130,7 +169,7 @@ type PvpIntoResp struct { func (x *PvpIntoResp) Reset() { *x = PvpIntoResp{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[2] + mi := &file_pvp_pvp_msg_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -143,7 +182,7 @@ func (x *PvpIntoResp) String() string { func (*PvpIntoResp) ProtoMessage() {} func (x *PvpIntoResp) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[2] + mi := &file_pvp_pvp_msg_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -156,7 +195,7 @@ func (x *PvpIntoResp) ProtoReflect() protoreflect.Message { // Deprecated: Use PvpIntoResp.ProtoReflect.Descriptor instead. func (*PvpIntoResp) Descriptor() ([]byte, []int) { - return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{2} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{3} } func (x *PvpIntoResp) GetCode() ErrorCode { @@ -196,7 +235,7 @@ type PvpReadyPush struct { func (x *PvpReadyPush) Reset() { *x = PvpReadyPush{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[3] + mi := &file_pvp_pvp_msg_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -209,7 +248,7 @@ func (x *PvpReadyPush) String() string { func (*PvpReadyPush) ProtoMessage() {} func (x *PvpReadyPush) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[3] + mi := &file_pvp_pvp_msg_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -222,7 +261,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{3} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{4} } func (x *PvpReadyPush) GetServicePath() string { @@ -273,7 +312,7 @@ type PvpCancelPush struct { func (x *PvpCancelPush) Reset() { *x = PvpCancelPush{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[4] + mi := &file_pvp_pvp_msg_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -286,7 +325,7 @@ func (x *PvpCancelPush) String() string { func (*PvpCancelPush) ProtoMessage() {} func (x *PvpCancelPush) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[4] + mi := &file_pvp_pvp_msg_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -299,7 +338,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{4} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{5} } func (x *PvpCancelPush) GetServicePath() string { @@ -329,7 +368,7 @@ type PvpFormationReq struct { func (x *PvpFormationReq) Reset() { *x = PvpFormationReq{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[5] + mi := &file_pvp_pvp_msg_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -342,7 +381,7 @@ func (x *PvpFormationReq) String() string { func (*PvpFormationReq) ProtoMessage() {} func (x *PvpFormationReq) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[5] + mi := &file_pvp_pvp_msg_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -355,7 +394,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{5} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{6} } func (x *PvpFormationReq) GetBattleid() string { @@ -384,7 +423,7 @@ type PvpFormationResp struct { func (x *PvpFormationResp) Reset() { *x = PvpFormationResp{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[6] + mi := &file_pvp_pvp_msg_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -397,7 +436,7 @@ func (x *PvpFormationResp) String() string { func (*PvpFormationResp) ProtoMessage() {} func (x *PvpFormationResp) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[6] + mi := &file_pvp_pvp_msg_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -410,7 +449,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{6} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{7} } func (x *PvpFormationResp) GetIssucc() bool { @@ -433,7 +472,7 @@ type PvpStartPush struct { func (x *PvpStartPush) Reset() { *x = PvpStartPush{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[7] + mi := &file_pvp_pvp_msg_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -446,7 +485,7 @@ func (x *PvpStartPush) String() string { func (*PvpStartPush) ProtoMessage() {} func (x *PvpStartPush) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[7] + mi := &file_pvp_pvp_msg_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -459,7 +498,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{7} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{8} } func (x *PvpStartPush) GetCode() ErrorCode { @@ -489,7 +528,7 @@ type PvpOutCmdPush struct { func (x *PvpOutCmdPush) Reset() { *x = PvpOutCmdPush{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[8] + mi := &file_pvp_pvp_msg_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -502,7 +541,7 @@ func (x *PvpOutCmdPush) String() string { func (*PvpOutCmdPush) ProtoMessage() {} func (x *PvpOutCmdPush) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[8] + mi := &file_pvp_pvp_msg_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -515,7 +554,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{8} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{9} } func (x *PvpOutCmdPush) GetBattleid() string { @@ -545,7 +584,7 @@ type PvpInCmdReq struct { func (x *PvpInCmdReq) Reset() { *x = PvpInCmdReq{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[9] + mi := &file_pvp_pvp_msg_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -558,7 +597,7 @@ func (x *PvpInCmdReq) String() string { func (*PvpInCmdReq) ProtoMessage() {} func (x *PvpInCmdReq) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[9] + mi := &file_pvp_pvp_msg_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -571,7 +610,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{9} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{10} } func (x *PvpInCmdReq) GetBattleid() string { @@ -602,7 +641,7 @@ type PvpInCmdResp struct { func (x *PvpInCmdResp) Reset() { *x = PvpInCmdResp{} if protoimpl.UnsafeEnabled { - mi := &file_pvp_pvp_msg_proto_msgTypes[10] + mi := &file_pvp_pvp_msg_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -615,7 +654,7 @@ func (x *PvpInCmdResp) String() string { func (*PvpInCmdResp) ProtoMessage() {} func (x *PvpInCmdResp) ProtoReflect() protoreflect.Message { - mi := &file_pvp_pvp_msg_proto_msgTypes[10] + mi := &file_pvp_pvp_msg_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -628,7 +667,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{10} + return file_pvp_pvp_msg_proto_rawDescGZIP(), []int{11} } func (x *PvpInCmdResp) GetCode() ErrorCode { @@ -660,66 +699,67 @@ 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, - 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, 0x22, 0x5d, 0x0a, 0x0f, 0x50, 0x76, 0x70, - 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, + 0x0c, 0x0a, 0x0a, 0x50, 0x76, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x2f, 0x0a, + 0x0b, 0x50, 0x76, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 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, 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, + 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, 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 ( @@ -734,40 +774,41 @@ 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, 11) +var file_pvp_pvp_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_pvp_pvp_msg_proto_goTypes = []interface{}{ - (*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 + (*PvpListReq)(nil), // 0: PvpListReq + (*PvpListResp)(nil), // 1: PvpListResp + (*PvpIntoReq)(nil), // 2: PvpIntoReq + (*PvpIntoResp)(nil), // 3: PvpIntoResp + (*PvpReadyPush)(nil), // 4: PvpReadyPush + (*PvpCancelPush)(nil), // 5: PvpCancelPush + (*PvpFormationReq)(nil), // 6: PvpFormationReq + (*PvpFormationResp)(nil), // 7: PvpFormationResp + (*PvpStartPush)(nil), // 8: PvpStartPush + (*PvpOutCmdPush)(nil), // 9: PvpOutCmdPush + (*PvpInCmdReq)(nil), // 10: PvpInCmdReq + (*PvpInCmdResp)(nil), // 11: PvpInCmdResp + (*DBPvpBattle)(nil), // 12: DBPvpBattle + (ErrorCode)(0), // 13: ErrorCode + (*BattleStateInfo)(nil), // 14: BattleStateInfo + (*PvpUserInfo)(nil), // 15: PvpUserInfo + (*BattleFormation)(nil), // 16: BattleFormation + (*BattleInfo)(nil), // 17: BattleInfo + (*BattleCmd)(nil), // 18: BattleCmd } var file_pvp_pvp_msg_proto_depIdxs = []int32{ - 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, // 0: PvpListResp.list:type_name -> DBPvpBattle + 13, // 1: PvpIntoResp.code:type_name -> ErrorCode + 14, // 2: PvpIntoResp.info:type_name -> BattleStateInfo + 15, // 3: PvpReadyPush.red:type_name -> PvpUserInfo + 15, // 4: PvpReadyPush.blue:type_name -> PvpUserInfo + 16, // 5: PvpFormationReq.formation:type_name -> BattleFormation + 13, // 6: PvpStartPush.code:type_name -> ErrorCode + 17, // 7: PvpStartPush.info:type_name -> BattleInfo + 18, // 8: PvpOutCmdPush.cmd:type_name -> BattleCmd + 18, // 9: PvpInCmdReq.cmd:type_name -> BattleCmd + 13, // 10: PvpInCmdResp.code:type_name -> ErrorCode + 18, // 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 @@ -785,7 +826,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.(*PvpListPush); i { + switch v := v.(*PvpListReq); i { case 0: return &v.state case 1: @@ -797,7 +838,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.(*PvpIntoReq); i { + switch v := v.(*PvpListResp); i { case 0: return &v.state case 1: @@ -809,7 +850,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.(*PvpIntoResp); i { + switch v := v.(*PvpIntoReq); i { case 0: return &v.state case 1: @@ -821,7 +862,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.(*PvpReadyPush); i { + switch v := v.(*PvpIntoResp); i { case 0: return &v.state case 1: @@ -833,7 +874,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.(*PvpCancelPush); i { + switch v := v.(*PvpReadyPush); i { case 0: return &v.state case 1: @@ -845,7 +886,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.(*PvpFormationReq); i { + switch v := v.(*PvpCancelPush); i { case 0: return &v.state case 1: @@ -857,7 +898,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.(*PvpFormationResp); i { + switch v := v.(*PvpFormationReq); i { case 0: return &v.state case 1: @@ -869,7 +910,7 @@ 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 { + switch v := v.(*PvpFormationResp); i { case 0: return &v.state case 1: @@ -881,7 +922,7 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PvpOutCmdPush); i { + switch v := v.(*PvpStartPush); i { case 0: return &v.state case 1: @@ -893,7 +934,7 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PvpInCmdReq); i { + switch v := v.(*PvpOutCmdPush); i { case 0: return &v.state case 1: @@ -905,6 +946,18 @@ func file_pvp_pvp_msg_proto_init() { } } file_pvp_pvp_msg_proto_msgTypes[10].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[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PvpInCmdResp); i { case 0: return &v.state @@ -923,7 +976,7 @@ func file_pvp_pvp_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pvp_pvp_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 11, + NumMessages: 12, NumExtensions: 0, NumServices: 0, }, diff --git a/sys/db/dbmodel.go b/sys/db/dbmodel.go index 9b6ebf045..8d76c449c 100644 --- a/sys/db/dbmodel.go +++ b/sys/db/dbmodel.go @@ -882,7 +882,7 @@ func (this *DBModel) DelByUId(uid string, opt ...DBOption) (err error) { } //删除多条数据 -func (this *DBModel) DelListlds(uid string, ids ...string) (err error) { +func (this *DBModel) DelListlds(uid string, ids []string, opt ...DBOption) (err error) { //defer log.Debug("DBModel DelListlds", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "ids", Value: ids}) listkey := this.ukey(uid) pipe := this.Redis.RedisPipe(context.TODO()) @@ -892,7 +892,10 @@ func (this *DBModel) DelListlds(uid string, ids ...string) (err error) { } pipe.HDel(listkey, ids...) if _, err = pipe.Exec(); err == nil { - err = this.DeleteModelLogs(this.TableName, uid, bson.M{"_id": bson.M{"$in": ids}}) + option := newDBOption(opt...) + if option.IsMgoLog { + err = this.DeleteModelLogs(this.TableName, uid, bson.M{"_id": bson.M{"$in": ids}}) + } } return }