上传战斗回放代码

This commit is contained in:
liwei1dao 2023-08-25 11:01:48 +08:00
parent d10ae5d48a
commit d756c4d933
13 changed files with 684 additions and 37 deletions

View File

@ -104,6 +104,7 @@ const (
ModulePushgiftbag core.M_Modules = "pushgiftbag" //推送礼包
ModulePuzzle core.M_Modules = "uigame" //小游戏
ModuleRobot core.M_Modules = "robot" //压测机器人
ModuleBattleRecord core.M_Modules = "battlerecord" //战斗记录
)
// 数据表名定义处
@ -356,6 +357,8 @@ const (
TableMainlineShop = "mainlineshop"
TableMainlinetask = "mlinetask"
//战斗记录
TableBattlerecord = "battlerecord"
)
// RPC服务接口定义处

View File

@ -640,4 +640,8 @@ type (
IStonehenge interface {
GmAddStoneEvent(uid string, eventid int32)
}
//战斗记录模块
IBattleRecord interface {
WrietBattleRecord(uid string, report *pb.BattleReport)
}
)

View File

@ -0,0 +1,29 @@
package battlerecord
import (
"go_dreamfactory/modules"
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core"
)
/*
API
*/
type apiComp struct {
modules.MCompGate
service base.IRPCXService
module *BattleRecord
}
//组件初始化接口
func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
this.MCompGate.Init(service, module, comp, options)
this.module = module.(*BattleRecord)
return
}
func (this *apiComp) Start() (err error) {
err = this.MCompGate.Start()
return
}

View File

@ -0,0 +1,39 @@
package battlerecord
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
//参数校验
func (this *apiComp) InquireCheck(session comm.IUserSession, req *pb.BattleRecordInquireReq) (errdata *pb.ErrorData) {
if len(req.Bid) == 0 {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
}
}
return
}
///查询任务进度接口
func (this *apiComp) Inquire(session comm.IUserSession, req *pb.BattleRecordInquireReq) (errdata *pb.ErrorData) {
var (
record *pb.DBBattlePlayRecord
err error
)
if errdata = this.InquireCheck(session, req); errdata != nil {
return
}
if record, err = this.module.model.inquire(req.Bid); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.String(),
Message: err.Error(),
}
return
}
session.SendMsg(string(this.module.GetType()), "inquire", &pb.BattleRecordInquireResp{Record: record})
return
}

View File

@ -0,0 +1,106 @@
package battlerecord
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/mgo"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"go_dreamfactory/sys/db"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/x/bsonx"
)
type modelComp struct {
modules.MCompModel
module *BattleRecord
}
func (this *modelComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
this.TableName = string(comm.TableBattlerecord)
err = this.MCompModel.Init(service, module, comp, options)
this.module = module.(*BattleRecord)
// uid 创建索引
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
})
return
}
func (this *modelComp) inquire(bid string) (result *pb.DBBattlePlayRecord, err error) {
result = &pb.DBBattlePlayRecord{}
if err = this.DBModel.DB.FindOne(core.SqlTable(this.TableName), bson.M{"_id": bid}).Decode(result); err != nil {
this.module.Errorln(err)
return
}
return
}
//插入记录
func (this *modelComp) addRecord(result *pb.DBBattlePlayRecord) (err error) {
if _, err = this.DBModel.DB.InsertOne(core.SqlTable(this.TableName), result); err != nil {
this.module.Errorln(err)
return
}
return
}
//获取记录模型对象
func (this *modelComp) getrecordModel(uid string) (model *recordModel, err error) {
var m *db.DBModel
if db.IsCross() {
if m, err = this.module.GetDBModelByUid(uid, this.TableName); err != nil {
return
}
model = &recordModel{module: this.module, model: m}
} else {
model = &recordModel{module: this.module, model: this.DBModel}
}
return
}
// 埋点专属模型 会封装特殊的数据转换接口
type recordModel struct {
module *BattleRecord
model *db.DBModel
}
// 获取用户全部的埋点数据
func (this *recordModel) getUserBurieds(uid string) (results *pb.DBBuried, err error) {
results = &pb.DBBuried{}
if err = this.model.Get(uid, results); err != nil && err != mgo.MongodbNil {
this.module.Errorln(err)
return
}
if err == mgo.MongodbNil {
err = nil
results = &pb.DBBuried{
Id: primitive.NewObjectID().Hex(),
Uid: uid,
Items: make(map[int32]*pb.DBBuriedItem),
}
err = this.model.Add(uid, results)
}
return
}
func (this *recordModel) inquire(bid string) (result *pb.DBBattlePlayRecord, err error) {
result = &pb.DBBattlePlayRecord{}
if err = this.model.DB.FindOne(core.SqlTable(this.model.TableName), bson.M{"_id": bid}).Decode(result); err != nil {
this.module.Errorln(err)
return
}
return
}
//插入记录
func (this *recordModel) addRecord(result *pb.DBBattlePlayRecord) (err error) {
if _, err = this.model.DB.InsertOne(core.SqlTable(this.model.TableName), result); err != nil {
this.module.Errorln(err)
return
}
return
}

View File

@ -0,0 +1,77 @@
package battlerecord
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
/*
模块名:用户埋点完成条件触发系统
模块描述:用户埋点数据中心管理模块
开发人员:李伟
*/
const moduleName = "埋点统计中心"
type BattleRecord struct {
modules.ModuleBase
api *apiComp
model *modelComp
}
func NewModule() core.IModule {
return &BattleRecord{}
}
func (this *BattleRecord) GetType() core.M_Modules {
return comm.ModuleBattleRecord
}
func (this *BattleRecord) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
return
}
// 装备组件
func (this *BattleRecord) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.model = this.RegisterComp(new(modelComp)).(*modelComp)
}
func (this *BattleRecord) Start() (err error) {
err = this.ModuleBase.Start()
return
}
//写入战斗记录
func (this *BattleRecord) WrietBattleRecord(uid string, report *pb.BattleReport) {
var (
result *pb.DBBattlePlayRecord
model *recordModel
data []byte
err error
)
if data, err = proto.Marshal(report); err == nil {
this.Errorln(err)
return
}
result = &pb.DBBattlePlayRecord{
Id: report.Info.Id,
Record: data,
}
if model, err = this.model.getrecordModel(uid); err != nil {
this.Errorln(err)
return
}
if err = model.addRecord(result); err != nil {
this.Errorln(err)
return
}
return
}

View File

@ -113,6 +113,7 @@ func (this *apiComp) ChallengeFinish(session comm.IUserSession, req *pb.GuildGve
},
Formation: make([]*pb.DBSimpleHero, 0),
Time: configure.Now().Unix(),
FightId: req.Report.Info.Id,
FightTime: req.Report.Costtime,
Rating: score.Id,
Harm: req.Report.Harm,
@ -182,7 +183,8 @@ func (this *apiComp) ChallengeFinish(session comm.IUserSession, req *pb.GuildGve
return
}
}
//写入战斗记录
go this.module.battlerecord.WrietBattleRecord(session.GetUserId(), req.Report)
session.SendMsg(string(this.module.GetType()), "challengefinish", &pb.GuildGveChallengeFinishResp{
Guildid: req.Guildid,
Boosid: req.Boosid,

View File

@ -19,6 +19,7 @@ type GuildGve struct {
sociaty comm.ISociaty
mail comm.Imail
battle comm.IBattle
battlerecord comm.IBattleRecord
api *apiComp
modelGuildGve *ModelUniongve
modelUnionroulette *ModelUnionroulette
@ -54,6 +55,10 @@ func (this *GuildGve) Start() (err error) {
return
}
this.battle = module.(comm.IBattle)
if module, err = this.service.GetModule(comm.ModuleBattleRecord); err != nil {
return
}
this.battlerecord = module.(comm.IBattleRecord)
this.service.RegisterFunctionName(string(comm.Rpc_ModuleGuildBossSettlement), this.Rpc_ModuleGuildBossSettlement)
return
}

View File

@ -32,6 +32,7 @@ const (
HdType_XSFundExp HdType = 6 //现时活动 经验基金
HdType_HdLevel HdType = 7 //开服等级活动
HdType_HdTypeSign HdType = 8 //七日签到
HdType_HdTypeDraw HdType = 9 //圣桃招募
HdType_AddUpRecharge HdType = 10 //累计充值
HdType_ShopCenterPayPakcge HdType = 11 //活动中心限时礼包
HdType_SupplyWarOrder HdType = 12 //补给战令
@ -56,6 +57,7 @@ var (
6: "XSFundExp",
7: "HdLevel",
8: "HdTypeSign",
9: "HdTypeDraw",
10: "AddUpRecharge",
11: "ShopCenterPayPakcge",
12: "SupplyWarOrder",
@ -76,6 +78,7 @@ var (
"XSFundExp": 6,
"HdLevel": 7,
"HdTypeSign": 8,
"HdTypeDraw": 9,
"AddUpRecharge": 10,
"ShopCenterPayPakcge": 11,
"SupplyWarOrder": 12,
@ -223,12 +226,12 @@ type DBHuodong struct {
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
Rtime int64 `protobuf:"varint,3,opt,name=rtime,proto3" json:"rtime"` // 活动修改时间
Itype HdType `protobuf:"varint,4,opt,name=itype,proto3,enum=HdType" json:"itype"`
Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name"`
Etime int64 `protobuf:"varint,6,opt,name=etime,proto3" json:"etime"` // 1680105599,
Stime int64 `protobuf:"varint,7,opt,name=stime,proto3" json:"stime"` // 1679414400,
Data *ActivityInfo `protobuf:"bytes,8,opt,name=data,proto3" json:"data"` // 活动详细数据
Rtime int64 `protobuf:"varint,2,opt,name=rtime,proto3" json:"rtime"` // 活动修改时间
Itype HdType `protobuf:"varint,3,opt,name=itype,proto3,enum=HdType" json:"itype"`
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name"`
Etime int64 `protobuf:"varint,5,opt,name=etime,proto3" json:"etime"` // 1680105599,
Stime int64 `protobuf:"varint,6,opt,name=stime,proto3" json:"stime"` // 1679414400,
Data *ActivityInfo `protobuf:"bytes,7,opt,name=data,proto3" json:"data"` // 活动详细数据
}
func (x *DBHuodong) Reset() {
@ -414,14 +417,14 @@ var file_activity_activity_db_proto_rawDesc = []byte{
0x03, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x41, 0x72, 0x72, 0x52, 0x05, 0x70, 0x72, 0x69, 0x7a, 0x65,
0x22, 0xb3, 0x01, 0x0a, 0x09, 0x44, 0x42, 0x48, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14,
0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72,
0x74, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20,
0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72,
0x74, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x05, 0x69, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x07, 0x2e, 0x48, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x69, 0x74,
0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65,
0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a,
0x05, 0x73, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74,
0x69, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28,
0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a,
0x05, 0x73, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74,
0x69, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x66, 0x6f,
0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xe6, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x41, 0x63, 0x74,
0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
@ -438,7 +441,7 @@ var file_activity_activity_db_proto_rawDesc = []byte{
0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a,
0xcd, 0x02, 0x0a, 0x06, 0x48, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x48, 0x64,
0xdd, 0x02, 0x0a, 0x06, 0x48, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x48, 0x64,
0x54, 0x79, 0x70, 0x65, 0x4e, 0x75, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x48, 0x64,
0x54, 0x79, 0x70, 0x65, 0x57, 0x61, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x10, 0x01, 0x12, 0x0d,
0x0a, 0x09, 0x48, 0x64, 0x54, 0x79, 0x70, 0x65, 0x50, 0x61, 0x79, 0x10, 0x02, 0x12, 0x0f, 0x0a,
@ -448,7 +451,8 @@ var file_activity_activity_db_proto_rawDesc = []byte{
0x75, 0x69, 0x74, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x58, 0x53, 0x46, 0x75, 0x6e, 0x64, 0x45,
0x78, 0x70, 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x48, 0x64, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x10,
0x07, 0x12, 0x0e, 0x0a, 0x0a, 0x48, 0x64, 0x54, 0x79, 0x70, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x10,
0x08, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x55, 0x70, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72,
0x08, 0x12, 0x0e, 0x0a, 0x0a, 0x48, 0x64, 0x54, 0x79, 0x70, 0x65, 0x44, 0x72, 0x61, 0x77, 0x10,
0x09, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x55, 0x70, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72,
0x67, 0x65, 0x10, 0x0a, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x68, 0x6f, 0x70, 0x43, 0x65, 0x6e, 0x74,
0x65, 0x72, 0x50, 0x61, 0x79, 0x50, 0x61, 0x6b, 0x63, 0x67, 0x65, 0x10, 0x0b, 0x12, 0x12, 0x0a,
0x0e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x57, 0x61, 0x72, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x10,

View File

@ -33,6 +33,8 @@ const (
EffectTipsType_Purification EffectTipsType = 7 //净化
EffectTipsType_Disperse EffectTipsType = 8 //驱散
EffectTipsType_Gain_round EffectTipsType = 9 //获得回合
EffectTipsType_Add_Operate EffectTipsType = 10 //增加行动值
EffectTipsType_Sub_Operate EffectTipsType = 11 //减少行动值
)
// Enum value maps for EffectTipsType.
@ -48,6 +50,8 @@ var (
7: "Purification",
8: "Disperse",
9: "Gain_round",
10: "Add_Operate",
11: "Sub_Operate",
}
EffectTipsType_value = map[string]int32{
"Eff_Success": 0,
@ -60,6 +64,8 @@ var (
"Purification": 7,
"Disperse": 8,
"Gain_round": 9,
"Add_Operate": 10,
"Sub_Operate": 11,
}
)
@ -1856,7 +1862,7 @@ var file_battle_battle_struct_proto_rawDesc = []byte{
0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x56, 0x61, 0x6c, 0x75,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x75, 0x72, 0x56, 0x61, 0x6c, 0x75,
0x65, 0x2a, 0xab, 0x01, 0x0a, 0x0e, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x54, 0x69, 0x70, 0x73,
0x65, 0x2a, 0xcd, 0x01, 0x0a, 0x0e, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x54, 0x69, 0x70, 0x73,
0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x66, 0x66, 0x5f, 0x53, 0x75, 0x63, 0x63,
0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x6f, 0x74, 0x5f, 0x53, 0x75, 0x63,
0x63, 0x65, 0x73, 0x73, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x6d, 0x6d, 0x75, 0x6e, 0x69,
@ -1866,8 +1872,11 @@ var file_battle_battle_struct_proto_rawDesc = []byte{
0x0e, 0x0a, 0x0a, 0x4e, 0x6f, 0x74, 0x5f, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x06, 0x12,
0x10, 0x0a, 0x0c, 0x50, 0x75, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10,
0x07, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x10, 0x08, 0x12,
0x0e, 0x0a, 0x0a, 0x47, 0x61, 0x69, 0x6e, 0x5f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x09, 0x42,
0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x0e, 0x0a, 0x0a, 0x47, 0x61, 0x69, 0x6e, 0x5f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x09, 0x12,
0x0f, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x5f, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x10, 0x0a,
0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x75, 0x62, 0x5f, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x10,
0x0b, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (

153
pb/battlerecord_db.pb.go Normal file
View File

@ -0,0 +1,153 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.20.0
// source: battlerecord/battlerecord_db.proto
package pb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
//战斗记录
type DBBattlePlayRecord struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` //@go_tags(`bson:"_id"`)战斗id
Record []byte `protobuf:"bytes,5,opt,name=record,proto3" json:"record"` //BattleReport 的序列化数据
}
func (x *DBBattlePlayRecord) Reset() {
*x = DBBattlePlayRecord{}
if protoimpl.UnsafeEnabled {
mi := &file_battlerecord_battlerecord_db_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBBattlePlayRecord) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBBattlePlayRecord) ProtoMessage() {}
func (x *DBBattlePlayRecord) ProtoReflect() protoreflect.Message {
mi := &file_battlerecord_battlerecord_db_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DBBattlePlayRecord.ProtoReflect.Descriptor instead.
func (*DBBattlePlayRecord) Descriptor() ([]byte, []int) {
return file_battlerecord_battlerecord_db_proto_rawDescGZIP(), []int{0}
}
func (x *DBBattlePlayRecord) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *DBBattlePlayRecord) GetRecord() []byte {
if x != nil {
return x.Record
}
return nil
}
var File_battlerecord_battlerecord_db_proto protoreflect.FileDescriptor
var file_battlerecord_battlerecord_db_proto_rawDesc = []byte{
0x0a, 0x22, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2f, 0x62,
0x61, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x64, 0x62, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3c, 0x0a, 0x12, 0x44, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65,
0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65,
0x63, 0x6f, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f,
0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var (
file_battlerecord_battlerecord_db_proto_rawDescOnce sync.Once
file_battlerecord_battlerecord_db_proto_rawDescData = file_battlerecord_battlerecord_db_proto_rawDesc
)
func file_battlerecord_battlerecord_db_proto_rawDescGZIP() []byte {
file_battlerecord_battlerecord_db_proto_rawDescOnce.Do(func() {
file_battlerecord_battlerecord_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_battlerecord_battlerecord_db_proto_rawDescData)
})
return file_battlerecord_battlerecord_db_proto_rawDescData
}
var file_battlerecord_battlerecord_db_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_battlerecord_battlerecord_db_proto_goTypes = []interface{}{
(*DBBattlePlayRecord)(nil), // 0: DBBattlePlayRecord
}
var file_battlerecord_battlerecord_db_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
}
func init() { file_battlerecord_battlerecord_db_proto_init() }
func file_battlerecord_battlerecord_db_proto_init() {
if File_battlerecord_battlerecord_db_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_battlerecord_battlerecord_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBBattlePlayRecord); 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{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_battlerecord_battlerecord_db_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_battlerecord_battlerecord_db_proto_goTypes,
DependencyIndexes: file_battlerecord_battlerecord_db_proto_depIdxs,
MessageInfos: file_battlerecord_battlerecord_db_proto_msgTypes,
}.Build()
File_battlerecord_battlerecord_db_proto = out.File
file_battlerecord_battlerecord_db_proto_rawDesc = nil
file_battlerecord_battlerecord_db_proto_goTypes = nil
file_battlerecord_battlerecord_db_proto_depIdxs = nil
}

214
pb/battlerecord_msg.pb.go Normal file
View File

@ -0,0 +1,214 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.20.0
// source: battlerecord/battlerecord_msg.proto
package pb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
//战斗记录查询请求
type BattleRecordInquireReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Bid string `protobuf:"bytes,1,opt,name=bid,proto3" json:"bid"`
}
func (x *BattleRecordInquireReq) Reset() {
*x = BattleRecordInquireReq{}
if protoimpl.UnsafeEnabled {
mi := &file_battlerecord_battlerecord_msg_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BattleRecordInquireReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BattleRecordInquireReq) ProtoMessage() {}
func (x *BattleRecordInquireReq) ProtoReflect() protoreflect.Message {
mi := &file_battlerecord_battlerecord_msg_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BattleRecordInquireReq.ProtoReflect.Descriptor instead.
func (*BattleRecordInquireReq) Descriptor() ([]byte, []int) {
return file_battlerecord_battlerecord_msg_proto_rawDescGZIP(), []int{0}
}
func (x *BattleRecordInquireReq) GetBid() string {
if x != nil {
return x.Bid
}
return ""
}
//战斗记录查询请求
type BattleRecordInquireResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Record *DBBattlePlayRecord `protobuf:"bytes,1,opt,name=record,proto3" json:"record"`
}
func (x *BattleRecordInquireResp) Reset() {
*x = BattleRecordInquireResp{}
if protoimpl.UnsafeEnabled {
mi := &file_battlerecord_battlerecord_msg_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BattleRecordInquireResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BattleRecordInquireResp) ProtoMessage() {}
func (x *BattleRecordInquireResp) ProtoReflect() protoreflect.Message {
mi := &file_battlerecord_battlerecord_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 BattleRecordInquireResp.ProtoReflect.Descriptor instead.
func (*BattleRecordInquireResp) Descriptor() ([]byte, []int) {
return file_battlerecord_battlerecord_msg_proto_rawDescGZIP(), []int{1}
}
func (x *BattleRecordInquireResp) GetRecord() *DBBattlePlayRecord {
if x != nil {
return x.Record
}
return nil
}
var File_battlerecord_battlerecord_msg_proto protoreflect.FileDescriptor
var file_battlerecord_battlerecord_msg_proto_rawDesc = []byte{
0x0a, 0x23, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2f, 0x62,
0x61, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x6d, 0x73, 0x67, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x65, 0x63,
0x6f, 0x72, 0x64, 0x2f, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64,
0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2a, 0x0a, 0x16, 0x42, 0x61, 0x74,
0x74, 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x6e, 0x71, 0x75, 0x69, 0x72, 0x65,
0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x62, 0x69, 0x64, 0x22, 0x46, 0x0a, 0x17, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52,
0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x6e, 0x71, 0x75, 0x69, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70,
0x12, 0x2b, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x13, 0x2e, 0x44, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x50, 0x6c, 0x61, 0x79, 0x52,
0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_battlerecord_battlerecord_msg_proto_rawDescOnce sync.Once
file_battlerecord_battlerecord_msg_proto_rawDescData = file_battlerecord_battlerecord_msg_proto_rawDesc
)
func file_battlerecord_battlerecord_msg_proto_rawDescGZIP() []byte {
file_battlerecord_battlerecord_msg_proto_rawDescOnce.Do(func() {
file_battlerecord_battlerecord_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_battlerecord_battlerecord_msg_proto_rawDescData)
})
return file_battlerecord_battlerecord_msg_proto_rawDescData
}
var file_battlerecord_battlerecord_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_battlerecord_battlerecord_msg_proto_goTypes = []interface{}{
(*BattleRecordInquireReq)(nil), // 0: BattleRecordInquireReq
(*BattleRecordInquireResp)(nil), // 1: BattleRecordInquireResp
(*DBBattlePlayRecord)(nil), // 2: DBBattlePlayRecord
}
var file_battlerecord_battlerecord_msg_proto_depIdxs = []int32{
2, // 0: BattleRecordInquireResp.record:type_name -> DBBattlePlayRecord
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_battlerecord_battlerecord_msg_proto_init() }
func file_battlerecord_battlerecord_msg_proto_init() {
if File_battlerecord_battlerecord_msg_proto != nil {
return
}
file_battlerecord_battlerecord_db_proto_init()
if !protoimpl.UnsafeEnabled {
file_battlerecord_battlerecord_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BattleRecordInquireReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_battlerecord_battlerecord_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BattleRecordInquireResp); 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{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_battlerecord_battlerecord_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_battlerecord_battlerecord_msg_proto_goTypes,
DependencyIndexes: file_battlerecord_battlerecord_msg_proto_depIdxs,
MessageInfos: file_battlerecord_battlerecord_msg_proto_msgTypes,
}.Build()
File_battlerecord_battlerecord_msg_proto = out.File
file_battlerecord_battlerecord_msg_proto_rawDesc = nil
file_battlerecord_battlerecord_msg_proto_goTypes = nil
file_battlerecord_battlerecord_msg_proto_depIdxs = nil
}

View File

@ -9,6 +9,7 @@ import (
"go_dreamfactory/modules/arena"
"go_dreamfactory/modules/atlas"
"go_dreamfactory/modules/battle"
"go_dreamfactory/modules/battlerecord"
"go_dreamfactory/modules/buried"
"go_dreamfactory/modules/caravan"
"go_dreamfactory/modules/chat"
@ -154,6 +155,7 @@ func main() {
storyline.NewModule(),
pushgiftbag.NewModule(),
uigame.NewModule(),
battlerecord.NewModule(),
)
}