This commit is contained in:
meixiongfeng 2023-08-25 11:09:50 +08:00
commit b42db6f120
12 changed files with 687 additions and 1 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

@ -519,6 +519,7 @@ var file_activity_activity_db_proto_rawDesc = []byte{
0x03, 0x76, 0x61, 0x6c, 0x22, 0x2a, 0x0a, 0x0c, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79,
0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x41, 0x72, 0x72, 0x52, 0x05, 0x70, 0x72, 0x69, 0x7a, 0x65,
<<<<<<< HEAD
0x22, 0xd5, 0x03, 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, 0x12,
0x0a, 0x04, 0x68, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x68, 0x64,
@ -587,6 +588,57 @@ var file_activity_activity_db_proto_rawDesc = []byte{
0x10, 0xec, 0x07, 0x12, 0x0c, 0x0a, 0x07, 0x48, 0x64, 0x4d, 0x69, 0x6e, 0x65, 0x72, 0x10, 0xed,
0x07, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
=======
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, 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, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65,
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,
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, 0x14, 0x0a, 0x05, 0x68,
0x64, 0x6f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x68, 0x64, 0x6f, 0x69,
0x64, 0x12, 0x33, 0x0a, 0x06, 0x67, 0x6f, 0x74, 0x61, 0x72, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x1b, 0x2e, 0x44, 0x42, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x61,
0x74, 0x61, 0x2e, 0x47, 0x6f, 0x74, 0x61, 0x72, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06,
0x67, 0x6f, 0x74, 0x61, 0x72, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x74, 0x69,
0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x74, 0x69,
0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52,
0x03, 0x76, 0x61, 0x6c, 0x1a, 0x39, 0x0a, 0x0b, 0x47, 0x6f, 0x74, 0x61, 0x72, 0x72, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a,
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,
0x0b, 0x4b, 0x46, 0x53, 0x65, 0x76, 0x65, 0x6e, 0x54, 0x61, 0x73, 0x6b, 0x10, 0x03, 0x12, 0x12,
0x0a, 0x0e, 0x58, 0x53, 0x46, 0x75, 0x6e, 0x64, 0x50, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6c,
0x10, 0x04, 0x12, 0x11, 0x0a, 0x0d, 0x58, 0x53, 0x46, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x63, 0x72,
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, 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,
0x0c, 0x12, 0x15, 0x0a, 0x11, 0x4d, 0x6f, 0x6f, 0x6e, 0x64, 0x72, 0x65, 0x61, 0x6d, 0x57, 0x61,
0x72, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x10, 0x0d, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x64, 0x54, 0x79,
0x70, 0x65, 0x54, 0x75, 0x72, 0x6e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x10, 0xe9, 0x07, 0x12, 0x12,
0x0a, 0x0d, 0x48, 0x64, 0x43, 0x65, 0x6c, 0x65, 0x62, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10,
0xea, 0x07, 0x12, 0x0d, 0x0a, 0x08, 0x48, 0x64, 0x50, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x10, 0xeb,
0x07, 0x12, 0x0e, 0x0a, 0x09, 0x48, 0x64, 0x4c, 0x61, 0x74, 0x74, 0x69, 0x63, 0x65, 0x10, 0xec,
0x07, 0x12, 0x0c, 0x0a, 0x07, 0x48, 0x64, 0x4d, 0x69, 0x6e, 0x65, 0x72, 0x10, 0xed, 0x07, 0x42,
0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
>>>>>>> d756c4d933317aa7f21dad44044c4eb277231ab2
}
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(),
)
}