上传战斗系统相关接口
This commit is contained in:
parent
583a482a3f
commit
0a229ceb56
@ -133,6 +133,9 @@ type (
|
|||||||
|
|
||||||
//战斗系统
|
//战斗系统
|
||||||
IBattle interface {
|
IBattle interface {
|
||||||
|
///查询战斗记录接口
|
||||||
|
QueryBattleRecord(oid string) (code pb.ErrorCode, record *pb.DBBattleRecord)
|
||||||
|
///创建pve战斗
|
||||||
CreatePveBattle(session IUserSession, req *pb.BattlePVEReq) (code pb.ErrorCode, record *pb.DBBattleRecord)
|
CreatePveBattle(session IUserSession, req *pb.BattlePVEReq) (code pb.ErrorCode, record *pb.DBBattleRecord)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
30
modules/battle/api_result.go
Normal file
30
modules/battle/api_result.go
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package battle
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go_dreamfactory/comm"
|
||||||
|
"go_dreamfactory/pb"
|
||||||
|
|
||||||
|
"google.golang.org/protobuf/proto"
|
||||||
|
)
|
||||||
|
|
||||||
|
//参数校验
|
||||||
|
func (this *apiComp) ResultCheck(session comm.IUserSession, req *pb.BattleResultReq) (code pb.ErrorCode) {
|
||||||
|
if req.Id == "" {
|
||||||
|
code = pb.ErrorCode_ReqParameterError
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
///获取本服聊天消息记录
|
||||||
|
func (this *apiComp) Result(session comm.IUserSession, req *pb.BattleResultReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
|
var ()
|
||||||
|
if code = this.ResultCheck(session, req); code != pb.ErrorCode_Success {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.module.modelBattle.Change(req.Id, map[string]interface{}{
|
||||||
|
"state": pb.BBattleState_end,
|
||||||
|
"result": pb.DBBattleComp_red,
|
||||||
|
})
|
||||||
|
session.SendMsg(string(this.module.GetType()), "result", &pb.BattleResultResp{Id: req.Id, Issucc: true})
|
||||||
|
return
|
||||||
|
}
|
@ -30,6 +30,15 @@ func (this *modelBattleComp) Init(service core.IService, module core.IModule, co
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//查询战斗记录
|
||||||
|
func (this *modelBattleComp) queryrecord(oid string) (record *pb.DBBattleRecord, err error) {
|
||||||
|
record = &pb.DBBattleRecord{}
|
||||||
|
if err = this.Get(oid, record); err != nil {
|
||||||
|
this.module.Errorln(err)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
//创建pve 战斗记录
|
//创建pve 战斗记录
|
||||||
func (this *modelBattleComp) createpve(session comm.IUserSession, req *pb.BattlePVEReq) (record *pb.DBBattleRecord, code pb.ErrorCode) {
|
func (this *modelBattleComp) createpve(session comm.IUserSession, req *pb.BattlePVEReq) (record *pb.DBBattleRecord, code pb.ErrorCode) {
|
||||||
record = &pb.DBBattleRecord{
|
record = &pb.DBBattleRecord{
|
||||||
|
@ -43,6 +43,16 @@ func (this *Battle) OnInstallComp() {
|
|||||||
this.modelBattle = this.RegisterComp(new(modelBattleComp)).(*modelBattleComp)
|
this.modelBattle = this.RegisterComp(new(modelBattleComp)).(*modelBattleComp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//查询战斗记录
|
||||||
|
func (this *Battle) QueryBattleRecord(oid string) (code pb.ErrorCode, record *pb.DBBattleRecord) {
|
||||||
|
var err error
|
||||||
|
if record, err = this.modelBattle.queryrecord(oid); err != nil {
|
||||||
|
code = pb.ErrorCode_BattleNoFoundRecord
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
//创建pve战斗
|
//创建pve战斗
|
||||||
func (this *Battle) CreatePveBattle(session comm.IUserSession, req *pb.BattlePVEReq) (code pb.ErrorCode, record *pb.DBBattleRecord) {
|
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, req); code != pb.ErrorCode_Success {
|
||||||
|
@ -170,19 +170,22 @@ func (BBattleState) EnumDescriptor() ([]byte, []int) {
|
|||||||
type DBBattleComp int32
|
type DBBattleComp int32
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DBBattleComp_red DBBattleComp = 0 //红方
|
DBBattleComp_draw DBBattleComp = 0 //平局
|
||||||
DBBattleComp_bule DBBattleComp = 1 //蓝方
|
DBBattleComp_red DBBattleComp = 1 //红方
|
||||||
|
DBBattleComp_bule DBBattleComp = 2 //蓝方
|
||||||
)
|
)
|
||||||
|
|
||||||
// Enum value maps for DBBattleComp.
|
// Enum value maps for DBBattleComp.
|
||||||
var (
|
var (
|
||||||
DBBattleComp_name = map[int32]string{
|
DBBattleComp_name = map[int32]string{
|
||||||
0: "red",
|
0: "draw",
|
||||||
1: "bule",
|
1: "red",
|
||||||
|
2: "bule",
|
||||||
}
|
}
|
||||||
DBBattleComp_value = map[string]int32{
|
DBBattleComp_value = map[string]int32{
|
||||||
"red": 0,
|
"draw": 0,
|
||||||
"bule": 1,
|
"red": 1,
|
||||||
|
"bule": 2,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -285,6 +288,7 @@ type DBBattleRecord struct {
|
|||||||
BlueCompId string `protobuf:"bytes,8,opt,name=blueCompId,proto3" json:"blueCompId"` //蓝方阵营id
|
BlueCompId string `protobuf:"bytes,8,opt,name=blueCompId,proto3" json:"blueCompId"` //蓝方阵营id
|
||||||
Buleflist []*DBBattleFormt `protobuf:"bytes,9,rep,name=buleflist,proto3" json:"buleflist"` //红方阵型列表
|
Buleflist []*DBBattleFormt `protobuf:"bytes,9,rep,name=buleflist,proto3" json:"buleflist"` //红方阵型列表
|
||||||
Roundresult []DBBattleComp `protobuf:"varint,10,rep,packed,name=roundresult,proto3,enum=DBBattleComp" json:"roundresult"` //战斗场次结果
|
Roundresult []DBBattleComp `protobuf:"varint,10,rep,packed,name=roundresult,proto3,enum=DBBattleComp" json:"roundresult"` //战斗场次结果
|
||||||
|
Result DBBattleComp `protobuf:"varint,11,opt,name=result,proto3,enum=DBBattleComp" json:"result"` //最终结果
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DBBattleRecord) Reset() {
|
func (x *DBBattleRecord) Reset() {
|
||||||
@ -389,6 +393,13 @@ func (x *DBBattleRecord) GetRoundresult() []DBBattleComp {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *DBBattleRecord) GetResult() DBBattleComp {
|
||||||
|
if x != nil {
|
||||||
|
return x.Result
|
||||||
|
}
|
||||||
|
return DBBattleComp_draw
|
||||||
|
}
|
||||||
|
|
||||||
var File_battle_battle_db_proto protoreflect.FileDescriptor
|
var File_battle_battle_db_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_battle_battle_db_proto_rawDesc = []byte{
|
var file_battle_battle_db_proto_rawDesc = []byte{
|
||||||
@ -399,7 +410,7 @@ var file_battle_battle_db_proto_rawDesc = []byte{
|
|||||||
0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07,
|
0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07,
|
||||||
0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x12, 0x1b, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18,
|
0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x12, 0x1b, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18,
|
||||||
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04,
|
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x04,
|
||||||
0x74, 0x65, 0x61, 0x6d, 0x22, 0xea, 0x02, 0x0a, 0x0e, 0x44, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c,
|
0x74, 0x65, 0x61, 0x6d, 0x22, 0x91, 0x03, 0x0a, 0x0e, 0x44, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c,
|
||||||
0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
|
0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 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,
|
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,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x54,
|
||||||
@ -422,17 +433,20 @@ var file_battle_battle_db_proto_rawDesc = []byte{
|
|||||||
0x12, 0x2f, 0x0a, 0x0b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18,
|
0x12, 0x2f, 0x0a, 0x0b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18,
|
||||||
0x0a, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65,
|
0x0a, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65,
|
||||||
0x43, 0x6f, 0x6d, 0x70, 0x52, 0x0b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x72, 0x65, 0x73, 0x75, 0x6c,
|
0x43, 0x6f, 0x6d, 0x70, 0x52, 0x0b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x72, 0x65, 0x73, 0x75, 0x6c,
|
||||||
0x74, 0x2a, 0x30, 0x0a, 0x0a, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12,
|
0x74, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28,
|
||||||
0x07, 0x0a, 0x03, 0x6e, 0x69, 0x6c, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x70, 0x76, 0x65, 0x10,
|
0x0e, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6d, 0x70,
|
||||||
0x01, 0x12, 0x07, 0x0a, 0x03, 0x70, 0x76, 0x70, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x70, 0x76,
|
0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2a, 0x30, 0x0a, 0x0a, 0x42, 0x61, 0x74, 0x74,
|
||||||
0x62, 0x10, 0x03, 0x2a, 0x24, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12,
|
0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x6e, 0x69, 0x6c, 0x10, 0x00, 0x12,
|
||||||
0x0c, 0x0a, 0x08, 0x6d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x0a, 0x0a,
|
0x07, 0x0a, 0x03, 0x70, 0x76, 0x65, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x70, 0x76, 0x70, 0x10,
|
||||||
0x06, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x10, 0x01, 0x2a, 0x1f, 0x0a, 0x0c, 0x42, 0x42, 0x61,
|
0x02, 0x12, 0x07, 0x0a, 0x03, 0x70, 0x76, 0x62, 0x10, 0x03, 0x2a, 0x24, 0x0a, 0x08, 0x50, 0x6c,
|
||||||
0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x69, 0x6e, 0x10,
|
0x61, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x6d, 0x61, 0x69, 0x6e, 0x6c, 0x69,
|
||||||
0x00, 0x12, 0x07, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x10, 0x02, 0x2a, 0x21, 0x0a, 0x0c, 0x44, 0x42,
|
0x6e, 0x65, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x10, 0x01,
|
||||||
0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x12, 0x07, 0x0a, 0x03, 0x72, 0x65,
|
0x2a, 0x1f, 0x0a, 0x0c, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65,
|
||||||
0x64, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x62, 0x75, 0x6c, 0x65, 0x10, 0x01, 0x42, 0x06, 0x5a,
|
0x12, 0x06, 0x0a, 0x02, 0x69, 0x6e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x10,
|
||||||
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
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 (
|
var (
|
||||||
@ -466,11 +480,12 @@ var file_battle_battle_db_proto_depIdxs = []int32{
|
|||||||
4, // 4: DBBattleRecord.redflist:type_name -> DBBattleFormt
|
4, // 4: DBBattleRecord.redflist:type_name -> DBBattleFormt
|
||||||
4, // 5: DBBattleRecord.buleflist:type_name -> DBBattleFormt
|
4, // 5: DBBattleRecord.buleflist:type_name -> DBBattleFormt
|
||||||
3, // 6: DBBattleRecord.roundresult:type_name -> DBBattleComp
|
3, // 6: DBBattleRecord.roundresult:type_name -> DBBattleComp
|
||||||
7, // [7:7] is the sub-list for method output_type
|
3, // 7: DBBattleRecord.result:type_name -> DBBattleComp
|
||||||
7, // [7:7] is the sub-list for method input_type
|
8, // [8:8] is the sub-list for method output_type
|
||||||
7, // [7:7] is the sub-list for extension type_name
|
8, // [8:8] is the sub-list for method input_type
|
||||||
7, // [7:7] is the sub-list for extension extendee
|
8, // [8:8] is the sub-list for extension type_name
|
||||||
0, // [0:7] is the sub-list for field type_name
|
8, // [8:8] is the sub-list for extension extendee
|
||||||
|
0, // [0:8] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_battle_battle_db_proto_init() }
|
func init() { file_battle_battle_db_proto_init() }
|
||||||
|
@ -196,6 +196,118 @@ func (x *BattleStartPush) GetBuleflist() []*DBBattleFormt {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//战斗结果请求
|
||||||
|
type BattleResultReq struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` //战斗id
|
||||||
|
Iswin bool `protobuf:"varint,2,opt,name=iswin,proto3" json:"iswin"` //是否胜利
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *BattleResultReq) Reset() {
|
||||||
|
*x = BattleResultReq{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_battle_battle_msg_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *BattleResultReq) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*BattleResultReq) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *BattleResultReq) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_battle_battle_msg_proto_msgTypes[2]
|
||||||
|
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 BattleResultReq.ProtoReflect.Descriptor instead.
|
||||||
|
func (*BattleResultReq) Descriptor() ([]byte, []int) {
|
||||||
|
return file_battle_battle_msg_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *BattleResultReq) GetId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *BattleResultReq) GetIswin() bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.Iswin
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
//战斗结果请求
|
||||||
|
type BattleResultResp struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` //战斗id
|
||||||
|
Issucc bool `protobuf:"varint,2,opt,name=issucc,proto3" json:"issucc"` //是否生效
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *BattleResultResp) Reset() {
|
||||||
|
*x = BattleResultResp{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_battle_battle_msg_proto_msgTypes[3]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *BattleResultResp) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*BattleResultResp) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *BattleResultResp) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_battle_battle_msg_proto_msgTypes[3]
|
||||||
|
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 BattleResultResp.ProtoReflect.Descriptor instead.
|
||||||
|
func (*BattleResultResp) Descriptor() ([]byte, []int) {
|
||||||
|
return file_battle_battle_msg_proto_rawDescGZIP(), []int{3}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *BattleResultResp) GetId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *BattleResultResp) GetIssucc() bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.Issucc
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
var File_battle_battle_msg_proto protoreflect.FileDescriptor
|
var File_battle_battle_msg_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_battle_battle_msg_proto_rawDesc = []byte{
|
var file_battle_battle_msg_proto_rawDesc = []byte{
|
||||||
@ -227,8 +339,15 @@ var file_battle_battle_msg_proto_rawDesc = []byte{
|
|||||||
0x09, 0x52, 0x0a, 0x62, 0x6c, 0x75, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x49, 0x64, 0x12, 0x2c, 0x0a,
|
0x09, 0x52, 0x0a, 0x62, 0x6c, 0x75, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x49, 0x64, 0x12, 0x2c, 0x0a,
|
||||||
0x09, 0x62, 0x75, 0x6c, 0x65, 0x66, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b,
|
0x09, 0x62, 0x75, 0x6c, 0x65, 0x66, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b,
|
||||||
0x32, 0x0e, 0x2e, 0x44, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x74,
|
0x32, 0x0e, 0x2e, 0x44, 0x42, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x74,
|
||||||
0x52, 0x09, 0x62, 0x75, 0x6c, 0x65, 0x66, 0x6c, 0x69, 0x73, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e,
|
0x52, 0x09, 0x62, 0x75, 0x6c, 0x65, 0x66, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x37, 0x0a, 0x0f, 0x42,
|
||||||
0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x71, 0x12, 0x0e,
|
||||||
|
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14,
|
||||||
|
0x0a, 0x05, 0x69, 0x73, 0x77, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69,
|
||||||
|
0x73, 0x77, 0x69, 0x6e, 0x22, 0x3a, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65,
|
||||||
|
0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
|
||||||
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75,
|
||||||
|
0x63, 0x63, 0x18, 0x02, 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 (
|
var (
|
||||||
@ -243,20 +362,22 @@ func file_battle_battle_msg_proto_rawDescGZIP() []byte {
|
|||||||
return file_battle_battle_msg_proto_rawDescData
|
return file_battle_battle_msg_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_battle_battle_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
var file_battle_battle_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||||
var file_battle_battle_msg_proto_goTypes = []interface{}{
|
var file_battle_battle_msg_proto_goTypes = []interface{}{
|
||||||
(*BattlePVEReq)(nil), // 0: BattlePVEReq
|
(*BattlePVEReq)(nil), // 0: BattlePVEReq
|
||||||
(*BattleStartPush)(nil), // 1: BattleStartPush
|
(*BattleStartPush)(nil), // 1: BattleStartPush
|
||||||
(PlayType)(0), // 2: PlayType
|
(*BattleResultReq)(nil), // 2: BattleResultReq
|
||||||
(BattleType)(0), // 3: BattleType
|
(*BattleResultResp)(nil), // 3: BattleResultResp
|
||||||
(*DBBattleFormt)(nil), // 4: DBBattleFormt
|
(PlayType)(0), // 4: PlayType
|
||||||
|
(BattleType)(0), // 5: BattleType
|
||||||
|
(*DBBattleFormt)(nil), // 6: DBBattleFormt
|
||||||
}
|
}
|
||||||
var file_battle_battle_msg_proto_depIdxs = []int32{
|
var file_battle_battle_msg_proto_depIdxs = []int32{
|
||||||
2, // 0: BattlePVEReq.ptype:type_name -> PlayType
|
4, // 0: BattlePVEReq.ptype:type_name -> PlayType
|
||||||
3, // 1: BattleStartPush.btype:type_name -> BattleType
|
5, // 1: BattleStartPush.btype:type_name -> BattleType
|
||||||
2, // 2: BattleStartPush.ptype:type_name -> PlayType
|
4, // 2: BattleStartPush.ptype:type_name -> PlayType
|
||||||
4, // 3: BattleStartPush.redflist:type_name -> DBBattleFormt
|
6, // 3: BattleStartPush.redflist:type_name -> DBBattleFormt
|
||||||
4, // 4: BattleStartPush.buleflist:type_name -> DBBattleFormt
|
6, // 4: BattleStartPush.buleflist:type_name -> DBBattleFormt
|
||||||
5, // [5:5] is the sub-list for method output_type
|
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 method input_type
|
||||||
5, // [5:5] is the sub-list for extension type_name
|
5, // [5:5] is the sub-list for extension type_name
|
||||||
@ -295,6 +416,30 @@ func file_battle_battle_msg_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
file_battle_battle_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*BattleResultReq); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_battle_battle_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*BattleResultResp); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
@ -302,7 +447,7 @@ func file_battle_battle_msg_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_battle_battle_msg_proto_rawDesc,
|
RawDescriptor: file_battle_battle_msg_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 2,
|
NumMessages: 4,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
},
|
},
|
||||||
|
@ -168,6 +168,7 @@ const (
|
|||||||
ErrorCode_MoonfantasyHasExpired ErrorCode = 2401 // boos 连接已失效
|
ErrorCode_MoonfantasyHasExpired ErrorCode = 2401 // boos 连接已失效
|
||||||
ErrorCode_MoonfantasyJoinUp ErrorCode = 2402 // boos 参与人数已达上限
|
ErrorCode_MoonfantasyJoinUp ErrorCode = 2402 // boos 参与人数已达上限
|
||||||
ErrorCode_MoonfantasyDareUp ErrorCode = 2403 // boos 挑战次数已达上限
|
ErrorCode_MoonfantasyDareUp ErrorCode = 2403 // boos 挑战次数已达上限
|
||||||
|
ErrorCode_BattleNoFoundRecord ErrorCode = 2501 // 未找到记录
|
||||||
)
|
)
|
||||||
|
|
||||||
// Enum value maps for ErrorCode.
|
// Enum value maps for ErrorCode.
|
||||||
@ -303,6 +304,7 @@ var (
|
|||||||
2401: "MoonfantasyHasExpired",
|
2401: "MoonfantasyHasExpired",
|
||||||
2402: "MoonfantasyJoinUp",
|
2402: "MoonfantasyJoinUp",
|
||||||
2403: "MoonfantasyDareUp",
|
2403: "MoonfantasyDareUp",
|
||||||
|
2501: "BattleNoFoundRecord",
|
||||||
}
|
}
|
||||||
ErrorCode_value = map[string]int32{
|
ErrorCode_value = map[string]int32{
|
||||||
"Success": 0,
|
"Success": 0,
|
||||||
@ -435,6 +437,7 @@ var (
|
|||||||
"MoonfantasyHasExpired": 2401,
|
"MoonfantasyHasExpired": 2401,
|
||||||
"MoonfantasyJoinUp": 2402,
|
"MoonfantasyJoinUp": 2402,
|
||||||
"MoonfantasyDareUp": 2403,
|
"MoonfantasyDareUp": 2403,
|
||||||
|
"BattleNoFoundRecord": 2501,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -469,7 +472,7 @@ var File_errorcode_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
var file_errorcode_proto_rawDesc = []byte{
|
var file_errorcode_proto_rawDesc = []byte{
|
||||||
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||||
0x6f, 0x2a, 0xff, 0x15, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
|
0x6f, 0x2a, 0x99, 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,
|
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,
|
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,
|
0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||||
@ -645,8 +648,9 @@ var file_errorcode_proto_rawDesc = []byte{
|
|||||||
0x10, 0xe1, 0x12, 0x12, 0x16, 0x0a, 0x11, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61,
|
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,
|
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,
|
0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x44, 0x61, 0x72, 0x65, 0x55, 0x70,
|
||||||
0x10, 0xe3, 0x12, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
0x10, 0xe3, 0x12, 0x12, 0x18, 0x0a, 0x13, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x4e, 0x6f, 0x46,
|
||||||
0x74, 0x6f, 0x33,
|
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 (
|
var (
|
||||||
|
@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"go_dreamfactory/modules/battle"
|
||||||
"go_dreamfactory/modules/chat"
|
"go_dreamfactory/modules/chat"
|
||||||
"go_dreamfactory/modules/equipment"
|
"go_dreamfactory/modules/equipment"
|
||||||
"go_dreamfactory/modules/forum"
|
"go_dreamfactory/modules/forum"
|
||||||
@ -74,6 +75,7 @@ func main() {
|
|||||||
smithy.NewModule(),
|
smithy.NewModule(),
|
||||||
moonfantasy.NewModule(),
|
moonfantasy.NewModule(),
|
||||||
hunting.NewModule(),
|
hunting.NewModule(),
|
||||||
|
battle.NewModule(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user