diff --git a/bin/json/game_dreamlandboos.json b/bin/json/game_dreamlandboos.json index 0b8a1dd2a..1c99505f0 100644 --- a/bin/json/game_dreamlandboos.json +++ b/bin/json/game_dreamlandboos.json @@ -1,38 +1,18 @@ [ { - "bossid": 25001, - "star": 5, + "bossid": "25001", "pro": 30, "fightnum": 5, "challengenum": 40, "prize": 1001, - "monsterid": [ - 250011, - 340061, - 440051, - 240031, - 350021 - ], - "monsterhp": 1, - "monsteratk": 1.2, - "monsterdef": 1.1 + "monsterformatid": 201011 }, { - "bossid": 11003, - "star": 5, + "bossid": "11003", "pro": 30, "fightnum": 5, "challengenum": 30, "prize": 1002, - "monsterid": [ - 250011, - 340061, - 440051, - 240031, - 350021 - ], - "monsterhp": 1, - "monsteratk": 1.2, - "monsterdef": 1.1 + "monsterformatid": 201012 } ] \ No newline at end of file diff --git a/comm/imodule.go b/comm/imodule.go index 720bb8e84..d6a651e6c 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -137,5 +137,7 @@ type ( QueryBattleRecord(oid string) (code pb.ErrorCode, record *pb.DBBattleRecord) ///创建pve战斗 CreatePveBattle(session IUserSession, req *pb.BattlePVEReq) (code pb.ErrorCode, record *pb.DBBattleRecord) + ///创建pvb战斗 + CreatePvbBattle(session IUserSession, req *pb.BattlePVEReq) (code pb.ErrorCode, record *pb.DBBattleRecord) } ) diff --git a/modules/battle/modelBattle.go b/modules/battle/modelBattle.go index 2636f7c07..4b9451dfa 100644 --- a/modules/battle/modelBattle.go +++ b/modules/battle/modelBattle.go @@ -40,12 +40,11 @@ func (this *modelBattleComp) queryrecord(oid string) (record *pb.DBBattleRecord, } //创建pve 战斗记录 -func (this *modelBattleComp) createpve(session comm.IUserSession, req *pb.BattlePVEReq) (record *pb.DBBattleRecord, code pb.ErrorCode) { +func (this *modelBattleComp) createpve(session comm.IUserSession, btype pb.BattleType, req *pb.BattlePVEReq) (record *pb.DBBattleRecord, code pb.ErrorCode) { record = &pb.DBBattleRecord{ Id: primitive.NewObjectID().Hex(), - Btype: pb.BattleType_pve, + Btype: btype, Ptype: req.Ptype, - Plevel: req.Levelid, State: pb.BBattleState_in, RedCompId: session.GetUserId(), Redflist: make([]*pb.DBBattleFormt, 1), diff --git a/modules/battle/module.go b/modules/battle/module.go index 0e3c9e371..69aa0ba9a 100644 --- a/modules/battle/module.go +++ b/modules/battle/module.go @@ -55,22 +55,39 @@ func (this *Battle) QueryBattleRecord(oid string) (code pb.ErrorCode, record *pb //创建pve战斗 func (this *Battle) CreatePveBattle(session comm.IUserSession, req *pb.BattlePVEReq) (code pb.ErrorCode, record *pb.DBBattleRecord) { - if record, code = this.modelBattle.createpve(session, req); code != pb.ErrorCode_Success { + if record, code = this.modelBattle.createpve(session, pb.BattleType_pve, req); code != pb.ErrorCode_Success { return } - this.pushbattle(session, &pb.BattleStartPush{ - Id: record.Id, - Btype: record.Btype, - Ptype: record.Ptype, - RedCompId: record.RedCompId, - Redflist: record.Redflist, - BlueCompId: record.BlueCompId, - Buleflist: record.Buleflist, - }) + // this.pushbattle(session, &pb.BattleStartPush{ + // Id: record.Id, + // Btype: record.Btype, + // Ptype: record.Ptype, + // RedCompId: record.RedCompId, + // Redflist: record.Redflist, + // BlueCompId: record.BlueCompId, + // Buleflist: record.Buleflist, + // }) + return +} + +//创建pve战斗 +func (this *Battle) CreatePvbBattle(session comm.IUserSession, req *pb.BattlePVEReq) (code pb.ErrorCode, record *pb.DBBattleRecord) { + if record, code = this.modelBattle.createpve(session, pb.BattleType_pvb, req); code != pb.ErrorCode_Success { + return + } + // this.pushbattle(session, &pb.BattleStartPush{ + // Id: record.Id, + // Btype: record.Btype, + // Ptype: record.Ptype, + // RedCompId: record.RedCompId, + // Redflist: record.Redflist, + // BlueCompId: record.BlueCompId, + // Buleflist: record.Buleflist, + // }) return } //推送战斗开始数据 -func (this *Battle) pushbattle(session comm.IUserSession, resp *pb.BattleStartPush) { - session.SendMsg(string(this.GetType()), "start", resp) -} +// func (this *Battle) pushbattle(session comm.IUserSession, resp *pb.BattleStartPush) { +// session.SendMsg(string(this.GetType()), "start", resp) +// } diff --git a/modules/battle/module_test.go b/modules/battle/module_test.go index 4212cf16d..3676b8f86 100644 --- a/modules/battle/module_test.go +++ b/modules/battle/module_test.go @@ -73,7 +73,15 @@ func _TestMain(m *testing.M) { } func Test_Module(t *testing.T) { - tmap := map[string]int{"1": 1, "2": 2, "3": 3} - tmap["4"] = tmap["4"] * 100 - fmt.Println(tmap["4"]) + data := []int{} + testdefer(&data) + data = append(data, 2) + fmt.Println(data) +} + +func testdefer(data *[]int) { + defer func() { + *data = append(*data, 1) + }() + *data = append(*data, 0) } diff --git a/modules/moonfantasy/api_ask.go b/modules/moonfantasy/api_ask.go new file mode 100644 index 000000000..a5fdbac8b --- /dev/null +++ b/modules/moonfantasy/api_ask.go @@ -0,0 +1,57 @@ +package moonfantasy + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" + "time" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) AskCheck(session comm.IUserSession, req *pb.MoonfantasyAskReq) (code pb.ErrorCode) { + return +} + +///询问怪物是否可以挑战 +func (this *apiComp) Ask(session comm.IUserSession, req *pb.MoonfantasyAskReq) (code pb.ErrorCode, data proto.Message) { + var ( + globalconf *cfg.GameGlobalData + mdata *pb.DBMoonfantasy + cd pb.ErrorCode + err error + ) + defer func() { + session.SendMsg(string(this.module.GetType()), "dare", &pb.MoonfantasyAskResp{Code: cd}) + }() + if cd = this.AskCheck(session, req); cd != pb.ErrorCode_Success { + return + } + if mdata, err = this.module.modelDream.queryDreamData(req.Uid, req.Mid); err != nil { + cd = pb.ErrorCode_DBError + return + } + if mdata == nil { + cd = pb.ErrorCode_MoonfantasyHasExpired + return + } + if mdata.Joinnum >= mdata.Numup { + cd = pb.ErrorCode_MoonfantasyJoinUp + return + } + + globalconf = this.module.configure.GetGlobalConf() + + if time.Now().Sub(time.Unix(mdata.Ctime, 0)).Seconds() >= float64(globalconf.DreamlandLimit) { + cd = pb.ErrorCode_MoonfantasyHasExpired + return + } + if v, ok := mdata.Record[session.GetUserId()]; ok { + if v >= mdata.Unitmup { + cd = pb.ErrorCode_MoonfantasyDareUp + return + } + } + return +} diff --git a/modules/moonfantasy/api_battle.go b/modules/moonfantasy/api_battle.go new file mode 100644 index 000000000..92cbf5fac --- /dev/null +++ b/modules/moonfantasy/api_battle.go @@ -0,0 +1,94 @@ +package moonfantasy + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" + "time" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) BattleCheck(session comm.IUserSession, req *pb.MoonfantasyBattleReq) (code pb.ErrorCode) { + return +} + +///挑战怪物请求 +func (this *apiComp) Battle(session comm.IUserSession, req *pb.MoonfantasyBattleReq) (code pb.ErrorCode, data proto.Message) { + var ( + globalconf *cfg.GameGlobalData + boss *cfg.GameDreamlandBoosData + mdata *pb.DBMoonfantasy + record *pb.DBBattleRecord + cd pb.ErrorCode + err error + ) + + defer func() { + if cd == pb.ErrorCode_Success { + session.SendMsg(string(this.module.GetType()), "dare", &pb.MoonfantasyBattleResp{ + Code: cd, + Monster: mdata.Monster, + Info: &pb.BattleInfo{ + Id: record.Id, + Btype: record.Btype, + Ptype: record.Ptype, + RedCompId: record.RedCompId, + Redflist: record.Redflist, + BlueCompId: record.BlueCompId, + Buleflist: record.Buleflist, + }, + }) + } else { + session.SendMsg(string(this.module.GetType()), "dare", &pb.MoonfantasyBattleResp{Code: cd}) + } + + }() + + if cd = this.BattleCheck(session, req); cd != pb.ErrorCode_Success { + return + } + if mdata, err = this.module.modelDream.queryDreamData(req.Uid, req.Mid); err != nil { + cd = pb.ErrorCode_DBError + return + } + if mdata == nil { + cd = pb.ErrorCode_MoonfantasyHasExpired + return + } + + if boss, err = this.module.configure.GetMonsterById(mdata.Monster); err != nil { + cd = pb.ErrorCode_ConfigNoFound + return + } + + if mdata.Joinnum >= mdata.Numup { + cd = pb.ErrorCode_MoonfantasyJoinUp + return + } + + globalconf = this.module.configure.GetGlobalConf() + + if time.Now().Sub(time.Unix(mdata.Ctime, 0)).Seconds() >= float64(globalconf.DreamlandLimit) { + cd = pb.ErrorCode_MoonfantasyHasExpired + return + } + if v, ok := mdata.Record[session.GetUserId()]; ok { + if v >= mdata.Unitmup { + cd = pb.ErrorCode_MoonfantasyDareUp + return + } else { + mdata.Record[session.GetUserId()]++ + } + } else { + mdata.Record[session.GetUserId()] = 1 + } + code, record = this.module.battle.CreatePvbBattle(session, &pb.BattlePVEReq{ + Ptype: pb.PlayType_moonfantasy, + Leadpos: req.Leadpos, + Teamids: req.Teamids, + Mformat: []int32{boss.Monsterformatid}, + }) + return +} diff --git a/modules/moonfantasy/api_dare.go b/modules/moonfantasy/api_dare.go deleted file mode 100644 index 8b8588942..000000000 --- a/modules/moonfantasy/api_dare.go +++ /dev/null @@ -1,62 +0,0 @@ -package moonfantasy - -import ( - "go_dreamfactory/comm" - "go_dreamfactory/pb" - cfg "go_dreamfactory/sys/configure/structs" - "time" - - "google.golang.org/protobuf/proto" -) - -//参数校验 -func (this *apiComp) DareCheck(session comm.IUserSession, req *pb.MoonfantasyDareReq) (code pb.ErrorCode) { - return -} - -///获取本服聊天消息记录 -func (this *apiComp) Dare(session comm.IUserSession, req *pb.MoonfantasyDareReq) (code pb.ErrorCode, data proto.Message) { - var ( - globalconf *cfg.GameGlobalData - mdata *pb.DBMoonfantasy - err error - ) - if code = this.DareCheck(session, req); code != pb.ErrorCode_Success { - return - } - if mdata, err = this.module.modelDream.queryDreamData(req.Uid, req.Mid); err != nil { - code = pb.ErrorCode_DBError - return - } - if mdata == nil { - code = pb.ErrorCode_MoonfantasyHasExpired - return - } - if mdata.Joinnum >= mdata.Numup { - code = pb.ErrorCode_MoonfantasyJoinUp - return - } - - globalconf = this.module.configure.GetGlobalConf() - - if time.Now().Sub(time.Unix(mdata.Ctime, 0)).Seconds() >= float64(globalconf.DreamlandLimit) { - code = pb.ErrorCode_MoonfantasyHasExpired - return - } - if v, ok := mdata.Record[session.GetUserId()]; ok { - if v >= mdata.Unitmup { - code = pb.ErrorCode_MoonfantasyDareUp - return - } - mdata.Record[session.GetUserId()]++ - } else { - mdata.Record[session.GetUserId()] = 1 - } - - this.module.modelDream.ChangeList(req.Uid, req.Mid, map[string]interface{}{ - "joinnum": mdata.Joinnum + 1, - "record": mdata.Record, - }) - session.SendMsg(string(this.module.GetType()), "dare", &pb.MoonfantasyDareResp{}) - return -} diff --git a/modules/moonfantasy/api_receive.go b/modules/moonfantasy/api_receive.go new file mode 100644 index 000000000..c4704c858 --- /dev/null +++ b/modules/moonfantasy/api_receive.go @@ -0,0 +1,52 @@ +package moonfantasy + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.MoonfantasyReceiveReq) (code pb.ErrorCode) { + if req.Bid == "" || req.Monster == "" { + code = pb.ErrorCode_ReqParameterError + } + return +} + +///询问怪物是否可以挑战 +func (this *apiComp) Receive(session comm.IUserSession, req *pb.MoonfantasyReceiveReq) (code pb.ErrorCode, data proto.Message) { + var ( + boss *cfg.GameDreamlandBoosData + record *pb.DBBattleRecord + award []*cfg.Gameatn = make([]*cfg.Gameatn, 0) + err error + ) + + if code = this.ReceiveCheck(session, req); code != pb.ErrorCode_Success { + return + } + if boss, err = this.module.configure.GetMonsterById(req.Monster); err != nil { + code = pb.ErrorCode_ConfigNoFound + return + } + if code, record = this.module.battle.QueryBattleRecord(req.Bid); code != pb.ErrorCode_Success { + return + } + + if record.State != pb.BBattleState_end { + code = pb.ErrorCode_MoonfantasyBattleNoEnd + return + } + + if record.Result != pb.DBBattleComp_red { + code = pb.ErrorCode_MoonfantasyBattleNoWin + return + } + this.module.configure.GetDropReward(boss.Prize, award) + this.module.DispenseRes(session, award, true) + session.SendMsg(string(this.module.GetType()), "receive", &pb.MoonfantasyReceiveResp{Issucc: true}) + return +} diff --git a/modules/moonfantasy/api_trigger.go b/modules/moonfantasy/api_trigger.go index 963312764..339b34ad3 100644 --- a/modules/moonfantasy/api_trigger.go +++ b/modules/moonfantasy/api_trigger.go @@ -27,6 +27,8 @@ func (this *apiComp) Trigger(session comm.IUserSession, req *pb.MoonfantasyTrigg issucc bool err error ) + + if code = this.TriggerCheck(session, req); code != pb.ErrorCode_Success { return } @@ -72,7 +74,7 @@ func (this *apiComp) Trigger(session comm.IUserSession, req *pb.MoonfantasyTrigg Uname: req.Uname, Slv: req.Ulv, Stag: session.GetServiecTag(), - AppendInt: int64(mdata.Monster), + Content: mdata.Monster, AppendStr: mdata.Id, } this.module.modelDream.noticeuserfriend(session.GetServiecTag(), session.GetUserId(), chat) diff --git a/modules/moonfantasy/configure.go b/modules/moonfantasy/configure.go index 96ff4939a..2675ef485 100644 --- a/modules/moonfantasy/configure.go +++ b/modules/moonfantasy/configure.go @@ -1,6 +1,7 @@ package moonfantasy import ( + "fmt" "go_dreamfactory/comm" "go_dreamfactory/modules" cfg "go_dreamfactory/sys/configure/structs" @@ -48,3 +49,21 @@ func (this *configureComp) GetMonster() (result *cfg.GameDreamlandBoosData, err return } } + +func (this *configureComp) GetMonsterById(id string) (result *cfg.GameDreamlandBoosData, err error) { + var ( + v interface{} + ok bool + ) + if v, err = this.GetConfigure(game_dreamlandboos); err != nil { + this.module.Errorln(err) + return + } else { + if result, ok = v.(*cfg.GameDreamlandBoos).GetDataMap()[id]; !ok { + err = fmt.Errorf("not found:%d ", id) + this.module.Errorln(err) + return + } + } + return +} diff --git a/modules/moonfantasy/module.go b/modules/moonfantasy/module.go index 2877d3520..f6c4d3b99 100644 --- a/modules/moonfantasy/module.go +++ b/modules/moonfantasy/module.go @@ -21,6 +21,7 @@ type Moonfantasy struct { modules.ModuleBase service base.IRPCXService chat comm.IChat + battle comm.IBattle api_comp *apiComp configure *configureComp modelDream *modelDreamComp @@ -45,6 +46,10 @@ func (this *Moonfantasy) Start() (err error) { return } this.chat = module.(comm.IChat) + if module, err = this.service.GetModule(comm.ModuleBattle); err != nil { + return + } + this.battle = module.(comm.IBattle) return } diff --git a/pb/battle_db.pb.go b/pb/battle_db.pb.go index c957369aa..48b940e8a 100644 --- a/pb/battle_db.pb.go +++ b/pb/battle_db.pb.go @@ -76,8 +76,9 @@ func (BattleType) EnumDescriptor() ([]byte, []int) { type PlayType int32 const ( - PlayType_mainline PlayType = 0 //主线玩法 - PlayType_pagoda PlayType = 1 //爬塔 + PlayType_mainline PlayType = 0 //主线玩法 + PlayType_pagoda PlayType = 1 //爬塔 + PlayType_moonfantasy PlayType = 2 //月之秘境 ) // Enum value maps for PlayType. @@ -85,10 +86,12 @@ var ( PlayType_name = map[int32]string{ 0: "mainline", 1: "pagoda", + 2: "moonfantasy", } PlayType_value = map[string]int32{ - "mainline": 0, - "pagoda": 1, + "mainline": 0, + "pagoda": 1, + "moonfantasy": 2, } ) @@ -281,7 +284,7 @@ type DBBattleRecord struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` //战斗记录id Btype BattleType `protobuf:"varint,2,opt,name=btype,proto3,enum=BattleType" json:"btype"` //战斗类型 Ptype PlayType `protobuf:"varint,3,opt,name=ptype,proto3,enum=PlayType" json:"ptype"` //玩法类型 - Plevel int32 `protobuf:"varint,4,opt,name=plevel,proto3" json:"plevel"` //玩法关卡 + Plevel string `protobuf:"bytes,4,opt,name=plevel,proto3" json:"plevel"` //玩法关卡 State BBattleState `protobuf:"varint,5,opt,name=state,proto3,enum=BBattleState" json:"state"` //战斗状态 RedCompId string `protobuf:"bytes,6,opt,name=redCompId,proto3" json:"redCompId"` //红方阵营id Redflist []*DBBattleFormt `protobuf:"bytes,7,rep,name=redflist,proto3" json:"redflist"` //红方阵型列表 @@ -344,11 +347,11 @@ func (x *DBBattleRecord) GetPtype() PlayType { return PlayType_mainline } -func (x *DBBattleRecord) GetPlevel() int32 { +func (x *DBBattleRecord) GetPlevel() string { if x != nil { return x.Plevel } - return 0 + return "" } func (x *DBBattleRecord) GetState() BBattleState { @@ -417,7 +420,7 @@ var file_battle_battle_db_proto_rawDesc = []byte{ 0x79, 0x70, 0x65, 0x52, 0x05, 0x62, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x05, 0x70, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x70, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, - 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x6c, 0x65, + 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x23, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x64, 0x43, @@ -438,15 +441,16 @@ var file_battle_battle_db_proto_rawDesc = []byte{ 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2a, 0x30, 0x0a, 0x0a, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x6e, 0x69, 0x6c, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x70, 0x76, 0x65, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x70, 0x76, 0x70, 0x10, - 0x02, 0x12, 0x07, 0x0a, 0x03, 0x70, 0x76, 0x62, 0x10, 0x03, 0x2a, 0x24, 0x0a, 0x08, 0x50, 0x6c, + 0x02, 0x12, 0x07, 0x0a, 0x03, 0x70, 0x76, 0x62, 0x10, 0x03, 0x2a, 0x35, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x6d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x10, 0x01, - 0x2a, 0x1f, 0x0a, 0x0c, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x06, 0x0a, 0x02, 0x69, 0x6e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x10, - 0x02, 0x2a, 0x2b, 0x0a, 0x0c, 0x44, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6d, - 0x70, 0x12, 0x08, 0x0a, 0x04, 0x64, 0x72, 0x61, 0x77, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x72, - 0x65, 0x64, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x62, 0x75, 0x6c, 0x65, 0x10, 0x02, 0x42, 0x06, - 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x0f, 0x0a, 0x0b, 0x6d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x10, + 0x02, 0x2a, 0x1f, 0x0a, 0x0c, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x06, 0x0a, 0x02, 0x69, 0x6e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x65, 0x6e, 0x64, + 0x10, 0x02, 0x2a, 0x2b, 0x0a, 0x0c, 0x44, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, + 0x6d, 0x70, 0x12, 0x08, 0x0a, 0x04, 0x64, 0x72, 0x61, 0x77, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, + 0x72, 0x65, 0x64, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x62, 0x75, 0x6c, 0x65, 0x10, 0x02, 0x42, + 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/battle_msg.pb.go b/pb/battle_msg.pb.go index 8326eea8a..e80858456 100644 --- a/pb/battle_msg.pb.go +++ b/pb/battle_msg.pb.go @@ -27,10 +27,9 @@ type BattlePVEReq struct { unknownFields protoimpl.UnknownFields Ptype PlayType `protobuf:"varint,1,opt,name=ptype,proto3,enum=PlayType" json:"ptype"` //玩法类型 - Levelid int32 `protobuf:"varint,2,opt,name=levelid,proto3" json:"levelid"` //关卡id - Leadpos int32 `protobuf:"varint,3,opt,name=leadpos,proto3" json:"leadpos"` //队长位置 - Teamids []string `protobuf:"bytes,4,rep,name=teamids,proto3" json:"teamids"` //阵容信息 - Mformat []int32 `protobuf:"varint,5,rep,packed,name=mformat,proto3" json:"mformat"` //敌方增容信息 + Leadpos int32 `protobuf:"varint,2,opt,name=leadpos,proto3" json:"leadpos"` //队长位置 + Teamids []string `protobuf:"bytes,3,rep,name=teamids,proto3" json:"teamids"` //阵容信息 + Mformat []int32 `protobuf:"varint,4,rep,packed,name=mformat,proto3" json:"mformat"` //敌方增容信息 } func (x *BattlePVEReq) Reset() { @@ -72,13 +71,6 @@ func (x *BattlePVEReq) GetPtype() PlayType { return PlayType_mainline } -func (x *BattlePVEReq) GetLevelid() int32 { - if x != nil { - return x.Levelid - } - return 0 -} - func (x *BattlePVEReq) GetLeadpos() int32 { if x != nil { return x.Leadpos @@ -101,7 +93,7 @@ func (x *BattlePVEReq) GetMformat() []int32 { } //战斗开始推送 -type BattleStartPush struct { +type BattleInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -115,8 +107,8 @@ type BattleStartPush struct { Buleflist []*DBBattleFormt `protobuf:"bytes,7,rep,name=buleflist,proto3" json:"buleflist"` //红方阵型列表 } -func (x *BattleStartPush) Reset() { - *x = BattleStartPush{} +func (x *BattleInfo) Reset() { + *x = BattleInfo{} if protoimpl.UnsafeEnabled { mi := &file_battle_battle_msg_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -124,13 +116,13 @@ func (x *BattleStartPush) Reset() { } } -func (x *BattleStartPush) String() string { +func (x *BattleInfo) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BattleStartPush) ProtoMessage() {} +func (*BattleInfo) ProtoMessage() {} -func (x *BattleStartPush) ProtoReflect() protoreflect.Message { +func (x *BattleInfo) ProtoReflect() protoreflect.Message { mi := &file_battle_battle_msg_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -142,54 +134,54 @@ func (x *BattleStartPush) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BattleStartPush.ProtoReflect.Descriptor instead. -func (*BattleStartPush) Descriptor() ([]byte, []int) { +// Deprecated: Use BattleInfo.ProtoReflect.Descriptor instead. +func (*BattleInfo) Descriptor() ([]byte, []int) { return file_battle_battle_msg_proto_rawDescGZIP(), []int{1} } -func (x *BattleStartPush) GetId() string { +func (x *BattleInfo) GetId() string { if x != nil { return x.Id } return "" } -func (x *BattleStartPush) GetBtype() BattleType { +func (x *BattleInfo) GetBtype() BattleType { if x != nil { return x.Btype } return BattleType_nil } -func (x *BattleStartPush) GetPtype() PlayType { +func (x *BattleInfo) GetPtype() PlayType { if x != nil { return x.Ptype } return PlayType_mainline } -func (x *BattleStartPush) GetRedCompId() string { +func (x *BattleInfo) GetRedCompId() string { if x != nil { return x.RedCompId } return "" } -func (x *BattleStartPush) GetRedflist() []*DBBattleFormt { +func (x *BattleInfo) GetRedflist() []*DBBattleFormt { if x != nil { return x.Redflist } return nil } -func (x *BattleStartPush) GetBlueCompId() string { +func (x *BattleInfo) GetBlueCompId() string { if x != nil { return x.BlueCompId } return "" } -func (x *BattleStartPush) GetBuleflist() []*DBBattleFormt { +func (x *BattleInfo) GetBuleflist() []*DBBattleFormt { if x != nil { return x.Buleflist } @@ -314,17 +306,15 @@ var file_battle_battle_msg_proto_rawDesc = []byte{ 0x0a, 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, 0x16, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x2f, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x97, 0x01, 0x0a, 0x0c, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x50, 0x56, 0x45, 0x52, - 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x05, 0x70, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x09, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x70, 0x74, - 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x69, 0x64, 0x12, 0x18, 0x0a, - 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, - 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, - 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, - 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x05, 0x52, 0x07, 0x6d, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0xfd, 0x01, 0x0a, 0x0f, - 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x50, 0x75, 0x73, 0x68, 0x12, + 0x6f, 0x22, 0x7d, 0x0a, 0x0c, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x50, 0x56, 0x45, 0x52, 0x65, + 0x71, 0x12, 0x1f, 0x0a, 0x05, 0x70, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x09, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x70, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x12, 0x18, 0x0a, 0x07, + 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x74, + 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x66, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x6d, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, + 0x22, 0xf8, 0x01, 0x0a, 0x0a, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x05, 0x62, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x62, 0x74, 0x79, @@ -365,7 +355,7 @@ func file_battle_battle_msg_proto_rawDescGZIP() []byte { var file_battle_battle_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_battle_battle_msg_proto_goTypes = []interface{}{ (*BattlePVEReq)(nil), // 0: BattlePVEReq - (*BattleStartPush)(nil), // 1: BattleStartPush + (*BattleInfo)(nil), // 1: BattleInfo (*BattleResultReq)(nil), // 2: BattleResultReq (*BattleResultResp)(nil), // 3: BattleResultResp (PlayType)(0), // 4: PlayType @@ -374,10 +364,10 @@ var file_battle_battle_msg_proto_goTypes = []interface{}{ } var file_battle_battle_msg_proto_depIdxs = []int32{ 4, // 0: BattlePVEReq.ptype:type_name -> PlayType - 5, // 1: BattleStartPush.btype:type_name -> BattleType - 4, // 2: BattleStartPush.ptype:type_name -> PlayType - 6, // 3: BattleStartPush.redflist:type_name -> DBBattleFormt - 6, // 4: BattleStartPush.buleflist:type_name -> DBBattleFormt + 5, // 1: BattleInfo.btype:type_name -> BattleType + 4, // 2: BattleInfo.ptype:type_name -> PlayType + 6, // 3: BattleInfo.redflist:type_name -> DBBattleFormt + 6, // 4: BattleInfo.buleflist:type_name -> DBBattleFormt 5, // [5:5] is the sub-list for method output_type 5, // [5:5] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name @@ -405,7 +395,7 @@ func file_battle_battle_msg_proto_init() { } } file_battle_battle_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BattleStartPush); i { + switch v := v.(*BattleInfo); i { case 0: return &v.state case 1: diff --git a/pb/errorcode.pb.go b/pb/errorcode.pb.go index e8d48a41d..26a2d28f1 100644 --- a/pb/errorcode.pb.go +++ b/pb/errorcode.pb.go @@ -165,10 +165,12 @@ const ( ErrorCode_VikingBoosType ErrorCode = 2302 // BOSS 类型不对 ErrorCode_VikingBuyMaxCount ErrorCode = 2303 // 购买达到最大次数 // moonfantasy 月之秘境 - ErrorCode_MoonfantasyHasExpired ErrorCode = 2401 // boos 连接已失效 - ErrorCode_MoonfantasyJoinUp ErrorCode = 2402 // boos 参与人数已达上限 - ErrorCode_MoonfantasyDareUp ErrorCode = 2403 // boos 挑战次数已达上限 - ErrorCode_BattleNoFoundRecord ErrorCode = 2501 // 未找到记录 + ErrorCode_MoonfantasyHasExpired ErrorCode = 2401 // boos 连接已失效 + ErrorCode_MoonfantasyJoinUp ErrorCode = 2402 // boos 参与人数已达上限 + ErrorCode_MoonfantasyDareUp ErrorCode = 2403 // boos 挑战次数已达上限 + ErrorCode_MoonfantasyBattleNoEnd ErrorCode = 2404 // boos 战斗未结束 + ErrorCode_MoonfantasyBattleNoWin ErrorCode = 2405 // boos 战斗魏未胜利 + ErrorCode_BattleNoFoundRecord ErrorCode = 2501 // 未找到记录 ) // Enum value maps for ErrorCode. @@ -304,6 +306,8 @@ var ( 2401: "MoonfantasyHasExpired", 2402: "MoonfantasyJoinUp", 2403: "MoonfantasyDareUp", + 2404: "MoonfantasyBattleNoEnd", + 2405: "MoonfantasyBattleNoWin", 2501: "BattleNoFoundRecord", } ErrorCode_value = map[string]int32{ @@ -437,6 +441,8 @@ var ( "MoonfantasyHasExpired": 2401, "MoonfantasyJoinUp": 2402, "MoonfantasyDareUp": 2403, + "MoonfantasyBattleNoEnd": 2404, + "MoonfantasyBattleNoWin": 2405, "BattleNoFoundRecord": 2501, } ) @@ -472,7 +478,7 @@ var File_errorcode_proto protoreflect.FileDescriptor var file_errorcode_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2a, 0x99, 0x16, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x6f, 0x2a, 0xd3, 0x16, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, @@ -648,9 +654,13 @@ var file_errorcode_proto_rawDesc = []byte{ 0x10, 0xe1, 0x12, 0x12, 0x16, 0x0a, 0x11, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x4a, 0x6f, 0x69, 0x6e, 0x55, 0x70, 0x10, 0xe2, 0x12, 0x12, 0x16, 0x0a, 0x11, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x44, 0x61, 0x72, 0x65, 0x55, 0x70, - 0x10, 0xe3, 0x12, 0x12, 0x18, 0x0a, 0x13, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x4e, 0x6f, 0x46, - 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x10, 0xc5, 0x13, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x10, 0xe3, 0x12, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, + 0x73, 0x79, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x4e, 0x6f, 0x45, 0x6e, 0x64, 0x10, 0xe4, 0x12, + 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x42, + 0x61, 0x74, 0x74, 0x6c, 0x65, 0x4e, 0x6f, 0x57, 0x69, 0x6e, 0x10, 0xe5, 0x12, 0x12, 0x18, 0x0a, + 0x13, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x4e, 0x6f, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x10, 0xc5, 0x13, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/moonfantasy_db.pb.go b/pb/moonfantasy_db.pb.go index d84e24d06..a7da27966 100644 --- a/pb/moonfantasy_db.pb.go +++ b/pb/moonfantasy_db.pb.go @@ -27,7 +27,7 @@ type DBMoonfantasy struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"` //用户id - Monster int32 `protobuf:"varint,3,opt,name=monster,proto3" json:"monster"` //怪物id + Monster string `protobuf:"bytes,3,opt,name=monster,proto3" json:"monster"` //英雄id Ctime int64 `protobuf:"varint,4,opt,name=ctime,proto3" json:"ctime"` //创建时间 Joinnum int32 `protobuf:"varint,5,opt,name=joinnum,proto3" json:"joinnum"` //参与人数 Numup int32 `protobuf:"varint,6,opt,name=numup,proto3" json:"numup"` //人数上限 @@ -81,11 +81,11 @@ func (x *DBMoonfantasy) GetUid() string { return "" } -func (x *DBMoonfantasy) GetMonster() int32 { +func (x *DBMoonfantasy) GetMonster() string { if x != nil { return x.Monster } - return 0 + return "" } func (x *DBMoonfantasy) GetCtime() int64 { @@ -132,7 +132,7 @@ var file_moonfantasy_moonfantasy_db_proto_rawDesc = []byte{ 0x74, 0x61, 0x73, 0x79, 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, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x73, 0x74, 0x65, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x73, 0x74, 0x65, 0x72, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6a, 0x6f, 0x69, 0x6e, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6a, 0x6f, 0x69, 0x6e, 0x6e, 0x75, 0x6d, diff --git a/pb/moonfantasy_msg.pb.go b/pb/moonfantasy_msg.pb.go index db85829fd..ae02b8c3e 100644 --- a/pb/moonfantasy_msg.pb.go +++ b/pb/moonfantasy_msg.pb.go @@ -90,9 +90,9 @@ type MoonfantasyTriggerResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Issucc bool `protobuf:"varint,1,opt,name=issucc,proto3" json:"issucc"` //是否成功 - Mid string `protobuf:"bytes,2,opt,name=mid,proto3" json:"mid"` //唯一id //挑战时需要传递的数据 - Monster int32 `protobuf:"varint,3,opt,name=monster,proto3" json:"monster"` //怪物id + Issucc bool `protobuf:"varint,1,opt,name=issucc,proto3" json:"issucc"` //是否成功 + Mid string `protobuf:"bytes,2,opt,name=mid,proto3" json:"mid"` //唯一id //挑战时需要传递的数据 + Monster string `protobuf:"bytes,3,opt,name=monster,proto3" json:"monster"` //怪物id } func (x *MoonfantasyTriggerResp) Reset() { @@ -141,15 +141,15 @@ func (x *MoonfantasyTriggerResp) GetMid() string { return "" } -func (x *MoonfantasyTriggerResp) GetMonster() int32 { +func (x *MoonfantasyTriggerResp) GetMonster() string { if x != nil { return x.Monster } - return 0 + return "" } ///挑战秘境 -type MoonfantasyDareReq struct { +type MoonfantasyAskReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -158,8 +158,8 @@ type MoonfantasyDareReq struct { Mid string `protobuf:"bytes,2,opt,name=mid,proto3" json:"mid"` //唯一id } -func (x *MoonfantasyDareReq) Reset() { - *x = MoonfantasyDareReq{} +func (x *MoonfantasyAskReq) Reset() { + *x = MoonfantasyAskReq{} if protoimpl.UnsafeEnabled { mi := &file_moonfantasy_moonfantasy_msg_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -167,13 +167,13 @@ func (x *MoonfantasyDareReq) Reset() { } } -func (x *MoonfantasyDareReq) String() string { +func (x *MoonfantasyAskReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MoonfantasyDareReq) ProtoMessage() {} +func (*MoonfantasyAskReq) ProtoMessage() {} -func (x *MoonfantasyDareReq) ProtoReflect() protoreflect.Message { +func (x *MoonfantasyAskReq) ProtoReflect() protoreflect.Message { mi := &file_moonfantasy_moonfantasy_msg_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -185,35 +185,35 @@ func (x *MoonfantasyDareReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use MoonfantasyDareReq.ProtoReflect.Descriptor instead. -func (*MoonfantasyDareReq) Descriptor() ([]byte, []int) { +// Deprecated: Use MoonfantasyAskReq.ProtoReflect.Descriptor instead. +func (*MoonfantasyAskReq) Descriptor() ([]byte, []int) { return file_moonfantasy_moonfantasy_msg_proto_rawDescGZIP(), []int{2} } -func (x *MoonfantasyDareReq) GetUid() string { +func (x *MoonfantasyAskReq) GetUid() string { if x != nil { return x.Uid } return "" } -func (x *MoonfantasyDareReq) GetMid() string { +func (x *MoonfantasyAskReq) GetMid() string { if x != nil { return x.Mid } return "" } -type MoonfantasyDareResp struct { +type MoonfantasyAskResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Issucc bool `protobuf:"varint,1,opt,name=issucc,proto3" json:"issucc"` //是否成功 + Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=ErrorCode" json:"code"` //是否成功 } -func (x *MoonfantasyDareResp) Reset() { - *x = MoonfantasyDareResp{} +func (x *MoonfantasyAskResp) Reset() { + *x = MoonfantasyAskResp{} if protoimpl.UnsafeEnabled { mi := &file_moonfantasy_moonfantasy_msg_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -221,13 +221,13 @@ func (x *MoonfantasyDareResp) Reset() { } } -func (x *MoonfantasyDareResp) String() string { +func (x *MoonfantasyAskResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MoonfantasyDareResp) ProtoMessage() {} +func (*MoonfantasyAskResp) ProtoMessage() {} -func (x *MoonfantasyDareResp) ProtoReflect() protoreflect.Message { +func (x *MoonfantasyAskResp) ProtoReflect() protoreflect.Message { mi := &file_moonfantasy_moonfantasy_msg_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -239,12 +239,251 @@ func (x *MoonfantasyDareResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use MoonfantasyDareResp.ProtoReflect.Descriptor instead. -func (*MoonfantasyDareResp) Descriptor() ([]byte, []int) { +// Deprecated: Use MoonfantasyAskResp.ProtoReflect.Descriptor instead. +func (*MoonfantasyAskResp) Descriptor() ([]byte, []int) { return file_moonfantasy_moonfantasy_msg_proto_rawDescGZIP(), []int{3} } -func (x *MoonfantasyDareResp) GetIssucc() bool { +func (x *MoonfantasyAskResp) GetCode() ErrorCode { + if x != nil { + return x.Code + } + return ErrorCode_Success +} + +///挑战秘境 +type MoonfantasyBattleReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` //发布者用户id + Mid string `protobuf:"bytes,2,opt,name=mid,proto3" json:"mid"` //唯一id + Leadpos int32 `protobuf:"varint,3,opt,name=leadpos,proto3" json:"leadpos"` //队长位置 + Teamids []string `protobuf:"bytes,4,rep,name=teamids,proto3" json:"teamids"` //阵容信息 +} + +func (x *MoonfantasyBattleReq) Reset() { + *x = MoonfantasyBattleReq{} + if protoimpl.UnsafeEnabled { + mi := &file_moonfantasy_moonfantasy_msg_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MoonfantasyBattleReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MoonfantasyBattleReq) ProtoMessage() {} + +func (x *MoonfantasyBattleReq) ProtoReflect() protoreflect.Message { + mi := &file_moonfantasy_moonfantasy_msg_proto_msgTypes[4] + 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 MoonfantasyBattleReq.ProtoReflect.Descriptor instead. +func (*MoonfantasyBattleReq) Descriptor() ([]byte, []int) { + return file_moonfantasy_moonfantasy_msg_proto_rawDescGZIP(), []int{4} +} + +func (x *MoonfantasyBattleReq) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *MoonfantasyBattleReq) GetMid() string { + if x != nil { + return x.Mid + } + return "" +} + +func (x *MoonfantasyBattleReq) GetLeadpos() int32 { + if x != nil { + return x.Leadpos + } + return 0 +} + +func (x *MoonfantasyBattleReq) GetTeamids() []string { + if x != nil { + return x.Teamids + } + return nil +} + +type MoonfantasyBattleResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=ErrorCode" json:"code"` //是否成功 + Monster string `protobuf:"bytes,2,opt,name=monster,proto3" json:"monster"` //怪物id + Info *BattleInfo `protobuf:"bytes,3,opt,name=info,proto3" json:"info"` +} + +func (x *MoonfantasyBattleResp) Reset() { + *x = MoonfantasyBattleResp{} + if protoimpl.UnsafeEnabled { + mi := &file_moonfantasy_moonfantasy_msg_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MoonfantasyBattleResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MoonfantasyBattleResp) ProtoMessage() {} + +func (x *MoonfantasyBattleResp) ProtoReflect() protoreflect.Message { + mi := &file_moonfantasy_moonfantasy_msg_proto_msgTypes[5] + 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 MoonfantasyBattleResp.ProtoReflect.Descriptor instead. +func (*MoonfantasyBattleResp) Descriptor() ([]byte, []int) { + return file_moonfantasy_moonfantasy_msg_proto_rawDescGZIP(), []int{5} +} + +func (x *MoonfantasyBattleResp) GetCode() ErrorCode { + if x != nil { + return x.Code + } + return ErrorCode_Success +} + +func (x *MoonfantasyBattleResp) GetMonster() string { + if x != nil { + return x.Monster + } + return "" +} + +func (x *MoonfantasyBattleResp) GetInfo() *BattleInfo { + if x != nil { + return x.Info + } + return nil +} + +///领取战斗奖励 +type MoonfantasyReceiveReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Bid string `protobuf:"bytes,2,opt,name=bid,proto3" json:"bid"` //战斗id 后续需要这个id来领取奖励 + Monster string `protobuf:"bytes,3,opt,name=monster,proto3" json:"monster"` //怪物id +} + +func (x *MoonfantasyReceiveReq) Reset() { + *x = MoonfantasyReceiveReq{} + if protoimpl.UnsafeEnabled { + mi := &file_moonfantasy_moonfantasy_msg_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MoonfantasyReceiveReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MoonfantasyReceiveReq) ProtoMessage() {} + +func (x *MoonfantasyReceiveReq) ProtoReflect() protoreflect.Message { + mi := &file_moonfantasy_moonfantasy_msg_proto_msgTypes[6] + 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 MoonfantasyReceiveReq.ProtoReflect.Descriptor instead. +func (*MoonfantasyReceiveReq) Descriptor() ([]byte, []int) { + return file_moonfantasy_moonfantasy_msg_proto_rawDescGZIP(), []int{6} +} + +func (x *MoonfantasyReceiveReq) GetBid() string { + if x != nil { + return x.Bid + } + return "" +} + +func (x *MoonfantasyReceiveReq) GetMonster() string { + if x != nil { + return x.Monster + } + return "" +} + +///领取战斗奖励 +type MoonfantasyReceiveResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Issucc bool `protobuf:"varint,1,opt,name=issucc,proto3" json:"issucc"` //是否成功 +} + +func (x *MoonfantasyReceiveResp) Reset() { + *x = MoonfantasyReceiveResp{} + if protoimpl.UnsafeEnabled { + mi := &file_moonfantasy_moonfantasy_msg_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MoonfantasyReceiveResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MoonfantasyReceiveResp) ProtoMessage() {} + +func (x *MoonfantasyReceiveResp) ProtoReflect() protoreflect.Message { + mi := &file_moonfantasy_moonfantasy_msg_proto_msgTypes[7] + 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 MoonfantasyReceiveResp.ProtoReflect.Descriptor instead. +func (*MoonfantasyReceiveResp) Descriptor() ([]byte, []int) { + return file_moonfantasy_moonfantasy_msg_proto_rawDescGZIP(), []int{7} +} + +func (x *MoonfantasyReceiveResp) GetIssucc() bool { if x != nil { return x.Issucc } @@ -256,26 +495,50 @@ var File_moonfantasy_moonfantasy_msg_proto protoreflect.FileDescriptor var file_moonfantasy_moonfantasy_msg_proto_rawDesc = []byte{ 0x0a, 0x21, 0x6d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x2f, 0x6d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x57, 0x0a, 0x15, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, - 0x73, 0x79, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, - 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, - 0x61, 0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x6c, - 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x75, 0x6c, 0x76, 0x22, 0x5c, 0x0a, 0x16, - 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x54, 0x72, 0x69, 0x67, 0x67, - 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, 0x12, 0x10, - 0x0a, 0x03, 0x6d, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x69, 0x64, - 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x22, 0x38, 0x0a, 0x12, 0x4d, 0x6f, - 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x44, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, - 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, - 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6d, 0x69, 0x64, 0x22, 0x2d, 0x0a, 0x13, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, - 0x61, 0x73, 0x79, 0x44, 0x61, 0x72, 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, + 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 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, 0x57, 0x0a, + 0x15, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x54, 0x72, 0x69, 0x67, + 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x14, + 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x03, 0x75, 0x6c, 0x76, 0x22, 0x5c, 0x0a, 0x16, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, + 0x6e, 0x74, 0x61, 0x73, 0x79, 0x54, 0x72, 0x69, 0x67, 0x67, 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, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, + 0x6e, 0x73, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x6e, + 0x73, 0x74, 0x65, 0x72, 0x22, 0x37, 0x0a, 0x11, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, + 0x61, 0x73, 0x79, 0x41, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6d, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x69, 0x64, 0x22, 0x34, 0x0a, + 0x12, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x41, 0x73, 0x6b, 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, 0x22, 0x6e, 0x0a, 0x14, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, + 0x73, 0x79, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, + 0x03, 0x6d, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x69, 0x64, 0x12, + 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x65, 0x61, + 0x6d, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x74, 0x65, 0x61, 0x6d, + 0x69, 0x64, 0x73, 0x22, 0x72, 0x0a, 0x15, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, + 0x73, 0x79, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 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, 0x18, 0x0a, 0x07, + 0x6d, 0x6f, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, + 0x6f, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x43, 0x0a, 0x15, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, + 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, + 0x12, 0x10, 0x0a, 0x03, 0x62, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, + 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x73, 0x74, 0x65, 0x72, 0x22, 0x30, 0x0a, 0x16, + 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x52, 0x65, 0x63, 0x65, 0x69, + 0x76, 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, } var ( @@ -290,19 +553,28 @@ func file_moonfantasy_moonfantasy_msg_proto_rawDescGZIP() []byte { return file_moonfantasy_moonfantasy_msg_proto_rawDescData } -var file_moonfantasy_moonfantasy_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_moonfantasy_moonfantasy_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_moonfantasy_moonfantasy_msg_proto_goTypes = []interface{}{ (*MoonfantasyTriggerReq)(nil), // 0: MoonfantasyTriggerReq (*MoonfantasyTriggerResp)(nil), // 1: MoonfantasyTriggerResp - (*MoonfantasyDareReq)(nil), // 2: MoonfantasyDareReq - (*MoonfantasyDareResp)(nil), // 3: MoonfantasyDareResp + (*MoonfantasyAskReq)(nil), // 2: MoonfantasyAskReq + (*MoonfantasyAskResp)(nil), // 3: MoonfantasyAskResp + (*MoonfantasyBattleReq)(nil), // 4: MoonfantasyBattleReq + (*MoonfantasyBattleResp)(nil), // 5: MoonfantasyBattleResp + (*MoonfantasyReceiveReq)(nil), // 6: MoonfantasyReceiveReq + (*MoonfantasyReceiveResp)(nil), // 7: MoonfantasyReceiveResp + (ErrorCode)(0), // 8: ErrorCode + (*BattleInfo)(nil), // 9: BattleInfo } var file_moonfantasy_moonfantasy_msg_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 8, // 0: MoonfantasyAskResp.code:type_name -> ErrorCode + 8, // 1: MoonfantasyBattleResp.code:type_name -> ErrorCode + 9, // 2: MoonfantasyBattleResp.info:type_name -> BattleInfo + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_moonfantasy_moonfantasy_msg_proto_init() } @@ -310,6 +582,8 @@ func file_moonfantasy_moonfantasy_msg_proto_init() { if File_moonfantasy_moonfantasy_msg_proto != nil { return } + file_errorcode_proto_init() + file_battle_battle_msg_proto_init() if !protoimpl.UnsafeEnabled { file_moonfantasy_moonfantasy_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MoonfantasyTriggerReq); i { @@ -336,7 +610,7 @@ func file_moonfantasy_moonfantasy_msg_proto_init() { } } file_moonfantasy_moonfantasy_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MoonfantasyDareReq); i { + switch v := v.(*MoonfantasyAskReq); i { case 0: return &v.state case 1: @@ -348,7 +622,55 @@ func file_moonfantasy_moonfantasy_msg_proto_init() { } } file_moonfantasy_moonfantasy_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MoonfantasyDareResp); i { + switch v := v.(*MoonfantasyAskResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_moonfantasy_moonfantasy_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MoonfantasyBattleReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_moonfantasy_moonfantasy_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MoonfantasyBattleResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_moonfantasy_moonfantasy_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MoonfantasyReceiveReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_moonfantasy_moonfantasy_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MoonfantasyReceiveResp); i { case 0: return &v.state case 1: @@ -366,7 +688,7 @@ func file_moonfantasy_moonfantasy_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_moonfantasy_moonfantasy_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/sys/configure/structs/Game.DreamlandBoos.go b/sys/configure/structs/Game.DreamlandBoos.go index 9a42ec11f..1d99f972d 100644 --- a/sys/configure/structs/Game.DreamlandBoos.go +++ b/sys/configure/structs/Game.DreamlandBoos.go @@ -9,13 +9,13 @@ package cfg type GameDreamlandBoos struct { - _dataMap map[int32]*GameDreamlandBoosData + _dataMap map[string]*GameDreamlandBoosData _dataList []*GameDreamlandBoosData } func NewGameDreamlandBoos(_buf []map[string]interface{}) (*GameDreamlandBoos, error) { _dataList := make([]*GameDreamlandBoosData, 0, len(_buf)) - dataMap := make(map[int32]*GameDreamlandBoosData) + dataMap := make(map[string]*GameDreamlandBoosData) for _, _ele_ := range _buf { if _v, err2 := DeserializeGameDreamlandBoosData(_ele_); err2 != nil { return nil, err2 @@ -27,7 +27,7 @@ func NewGameDreamlandBoos(_buf []map[string]interface{}) (*GameDreamlandBoos, er return &GameDreamlandBoos{_dataList:_dataList, _dataMap:dataMap}, nil } -func (table *GameDreamlandBoos) GetDataMap() map[int32]*GameDreamlandBoosData { +func (table *GameDreamlandBoos) GetDataMap() map[string]*GameDreamlandBoosData { return table._dataMap } @@ -35,7 +35,7 @@ func (table *GameDreamlandBoos) GetDataList() []*GameDreamlandBoosData { return table._dataList } -func (table *GameDreamlandBoos) Get(key int32) *GameDreamlandBoosData { +func (table *GameDreamlandBoos) Get(key string) *GameDreamlandBoosData { return table._dataMap[key] } diff --git a/sys/configure/structs/Game.DreamlandBoosData.go b/sys/configure/structs/Game.DreamlandBoosData.go index 831eed9f7..ba2fdf07e 100644 --- a/sys/configure/structs/Game.DreamlandBoosData.go +++ b/sys/configure/structs/Game.DreamlandBoosData.go @@ -11,16 +11,12 @@ package cfg import "errors" type GameDreamlandBoosData struct { - Bossid int32 - Star int32 + Bossid string Pro int32 Fightnum int32 Challengenum int32 Prize int32 - Monsterid []int32 - Monsterhp float32 - Monsteratk float32 - Monsterdef float32 + Monsterformatid int32 } const TypeId_GameDreamlandBoosData = -1451313715 @@ -30,29 +26,12 @@ func (*GameDreamlandBoosData) GetTypeId() int32 { } func (_v *GameDreamlandBoosData)Deserialize(_buf map[string]interface{}) (err error) { - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["bossid"].(float64); !_ok_ { err = errors.New("bossid error"); return }; _v.Bossid = int32(_tempNum_) } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star"].(float64); !_ok_ { err = errors.New("star error"); return }; _v.Star = int32(_tempNum_) } + { var _ok_ bool; if _v.Bossid, _ok_ = _buf["bossid"].(string); !_ok_ { err = errors.New("bossid error"); return } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["pro"].(float64); !_ok_ { err = errors.New("pro error"); return }; _v.Pro = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["fightnum"].(float64); !_ok_ { err = errors.New("fightnum error"); return }; _v.Fightnum = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["challengenum"].(float64); !_ok_ { err = errors.New("challengenum error"); return }; _v.Challengenum = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["prize"].(float64); !_ok_ { err = errors.New("prize error"); return }; _v.Prize = int32(_tempNum_) } - { - var _arr_ []interface{} - var _ok_ bool - if _arr_, _ok_ = _buf["monsterid"].([]interface{}); !_ok_ { err = errors.New("monsterid error"); return } - - _v.Monsterid = make([]int32, 0, len(_arr_)) - - for _, _e_ := range _arr_ { - var _list_v_ int32 - { var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) } - _v.Monsterid = append(_v.Monsterid, _list_v_) - } - } - - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["monsterhp"].(float64); !_ok_ { err = errors.New("monsterhp error"); return }; _v.Monsterhp = float32(_tempNum_) } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["monsteratk"].(float64); !_ok_ { err = errors.New("monsteratk error"); return }; _v.Monsteratk = float32(_tempNum_) } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["monsterdef"].(float64); !_ok_ { err = errors.New("monsterdef error"); return }; _v.Monsterdef = float32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["monsterformatid"].(float64); !_ok_ { err = errors.New("monsterformatid error"); return }; _v.Monsterformatid = int32(_tempNum_) } return }