上传队长技校验接口
This commit is contained in:
parent
9c2eb0b4e6
commit
8e38fa0b62
@ -79,6 +79,7 @@ const (
|
|||||||
ModuleAutoBattle core.M_Modules = "autobattle" //自动战斗
|
ModuleAutoBattle core.M_Modules = "autobattle" //自动战斗
|
||||||
ModuleMline core.M_Modules = "mline" //主线模块
|
ModuleMline core.M_Modules = "mline" //主线模块
|
||||||
ModulePvp core.M_Modules = "pvp" //实时pvp
|
ModulePvp core.M_Modules = "pvp" //实时pvp
|
||||||
|
ModulePandaTakekan core.M_Modules = "pandatakekan" //熊猫武馆
|
||||||
)
|
)
|
||||||
|
|
||||||
// 数据表名定义处
|
// 数据表名定义处
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
@ -15,7 +16,10 @@ import (
|
|||||||
func newClient(addr string, mgr IClientMgr, log log.ILogger) (c *client, err error) {
|
func newClient(addr string, mgr IClientMgr, log log.ILogger) (c *client, err error) {
|
||||||
c = &client{addr: addr, mgr: mgr, log: log, seq: 1, state: 1, pending: make(map[uint64]*MessageCall)}
|
c = &client{addr: addr, mgr: mgr, log: log, seq: 1, state: 1, pending: make(map[uint64]*MessageCall)}
|
||||||
dialer := websocket.Dialer{}
|
dialer := websocket.Dialer{}
|
||||||
c.conn, _, err = dialer.Dial(addr, nil)
|
ctx, _ := context.WithTimeout(context.Background(), time.Second*5)
|
||||||
|
if c.conn, _, err = dialer.DialContext(ctx, addr, nil); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
go c.run()
|
go c.run()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -247,7 +247,7 @@ func (this *modelBattleComp) createpve(session comm.IUserSession, conn *db.DBCon
|
|||||||
record.Redflist[0].Team[i].Ishelp = true
|
record.Redflist[0].Team[i].Ishelp = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ok := this.checkBattlereadyCapskill(req.Format.Leadpos, heros); ok {
|
if ok := this.checkBattlereadyCapskill(req.Format.Leadpos, heros); !ok {
|
||||||
code = pb.ErrorCode_BattleCapskillCheckFailed
|
code = pb.ErrorCode_BattleCapskillCheckFailed
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -335,7 +335,7 @@ func (this *modelBattleComp) createpvb(session comm.IUserSession, conn *db.DBCon
|
|||||||
record.Redflist[ii].Team[i].Ishelp = true
|
record.Redflist[ii].Team[i].Ishelp = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ok := this.checkBattlereadyCapskill(v.Leadpos, heros); ok {
|
if ok := this.checkBattlereadyCapskill(v.Leadpos, heros); !ok {
|
||||||
code = pb.ErrorCode_BattleCapskillCheckFailed
|
code = pb.ErrorCode_BattleCapskillCheckFailed
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -385,7 +385,7 @@ func (this *modelBattleComp) createpvp(session comm.IUserSession, conn *db.DBCon
|
|||||||
record.Redflist[0].Team[i] = nil
|
record.Redflist[0].Team[i] = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ok := this.checkBattlereadyCapskill(req.Redformat.Leadpos, req.Redformat.Format); ok {
|
if ok := this.checkBattlereadyCapskill(req.Redformat.Leadpos, req.Redformat.Format); !ok {
|
||||||
code = pb.ErrorCode_BattleCapskillCheckFailed
|
code = pb.ErrorCode_BattleCapskillCheckFailed
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -405,7 +405,7 @@ func (this *modelBattleComp) createpvp(session comm.IUserSession, conn *db.DBCon
|
|||||||
record.Buleflist[0].Team[i] = nil
|
record.Buleflist[0].Team[i] = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ok := this.checkBattlereadyCapskill(req.Buleformat.Leadpos, req.Buleformat.Format); ok {
|
if ok := this.checkBattlereadyCapskill(req.Buleformat.Leadpos, req.Buleformat.Format); !ok {
|
||||||
code = pb.ErrorCode_BattleCapskillCheckFailed
|
code = pb.ErrorCode_BattleCapskillCheckFailed
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -446,7 +446,7 @@ func (this *modelBattleComp) creatertpvp(redmodel, bluemodel *db.DBModel, btype
|
|||||||
record.Redflist[ii].Team[i] = nil
|
record.Redflist[ii].Team[i] = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ok := this.checkBattlereadyCapskill(v.Leadpos, heros); ok {
|
if ok := this.checkBattlereadyCapskill(v.Leadpos, heros); !ok {
|
||||||
code = pb.ErrorCode_BattleCapskillCheckFailed
|
code = pb.ErrorCode_BattleCapskillCheckFailed
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -472,7 +472,7 @@ func (this *modelBattleComp) creatertpvp(redmodel, bluemodel *db.DBModel, btype
|
|||||||
record.Buleflist[ii].Team[i] = nil
|
record.Buleflist[ii].Team[i] = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ok := this.checkBattlereadyCapskill(v.Leadpos, heros); ok {
|
if ok := this.checkBattlereadyCapskill(v.Leadpos, heros); !ok {
|
||||||
code = pb.ErrorCode_BattleCapskillCheckFailed
|
code = pb.ErrorCode_BattleCapskillCheckFailed
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,9 @@ func (this *Battle) Init(service core.IService, module core.IModule, options cor
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
func (this *Battle) Start() (err error) {
|
func (this *Battle) Start() (err error) {
|
||||||
err = this.ModuleBase.Start()
|
if err = this.ModuleBase.Start(); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
var module core.IModule
|
var module core.IModule
|
||||||
if module, err = this.service.GetModule(comm.ModuleFriend); err != nil {
|
if module, err = this.service.GetModule(comm.ModuleFriend); err != nil {
|
||||||
return
|
return
|
||||||
|
@ -57,7 +57,9 @@ func (this *ModuleBase) Init(service core.IService, module core.IModule, options
|
|||||||
|
|
||||||
//模块启动接口
|
//模块启动接口
|
||||||
func (this *ModuleBase) Start() (err error) {
|
func (this *ModuleBase) Start() (err error) {
|
||||||
err = this.ModuleBase.Start()
|
if err = this.ModuleBase.Start(); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
var comp core.IServiceComp
|
var comp core.IServiceComp
|
||||||
//注册远程路由
|
//注册远程路由
|
||||||
if comp, err = this.service.GetComp(comm.SC_ServiceGateRouteComp); err != nil {
|
if comp, err = this.service.GetComp(comm.SC_ServiceGateRouteComp); err != nil {
|
||||||
|
29
modules/pandatakekan/api.go
Normal file
29
modules/pandatakekan/api.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package pandatakekan
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go_dreamfactory/modules"
|
||||||
|
|
||||||
|
"go_dreamfactory/lego/core"
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
API
|
||||||
|
*/
|
||||||
|
type apiComp struct {
|
||||||
|
modules.MCompGate
|
||||||
|
service core.IService
|
||||||
|
module *PandaTakekan
|
||||||
|
}
|
||||||
|
|
||||||
|
//组件初始化接口
|
||||||
|
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.(*PandaTakekan)
|
||||||
|
this.service = service
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *apiComp) Start() (err error) {
|
||||||
|
err = this.MCompGate.Start()
|
||||||
|
return
|
||||||
|
}
|
49
modules/pandatakekan/module.go
Normal file
49
modules/pandatakekan/module.go
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
package pandatakekan
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go_dreamfactory/comm"
|
||||||
|
"go_dreamfactory/lego/base"
|
||||||
|
"go_dreamfactory/lego/core"
|
||||||
|
"go_dreamfactory/modules"
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
模块名:熊猫武馆
|
||||||
|
描述:熊猫武馆 主系统 打桩 以及武馆相关数据管理
|
||||||
|
开发:李伟
|
||||||
|
*/
|
||||||
|
func NewModule() core.IModule {
|
||||||
|
m := new(PandaTakekan)
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
|
||||||
|
type PandaTakekan struct {
|
||||||
|
modules.ModuleBase
|
||||||
|
service base.IRPCXService
|
||||||
|
api *apiComp
|
||||||
|
}
|
||||||
|
|
||||||
|
//模块名
|
||||||
|
func (this *PandaTakekan) GetType() core.M_Modules {
|
||||||
|
return comm.ModulePandaTakekan
|
||||||
|
}
|
||||||
|
|
||||||
|
//模块初始化接口 注册用户创建角色事件
|
||||||
|
func (this *PandaTakekan) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||||
|
err = this.ModuleBase.Init(service, module, options)
|
||||||
|
this.service = service.(base.IRPCXService)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
func (this *PandaTakekan) Start() (err error) {
|
||||||
|
err = this.ModuleBase.Start()
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//装备组件
|
||||||
|
func (this *PandaTakekan) OnInstallComp() {
|
||||||
|
this.ModuleBase.OnInstallComp()
|
||||||
|
|
||||||
|
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||||
|
|
||||||
|
}
|
@ -57,6 +57,7 @@ type DBUserExpand struct {
|
|||||||
SociatyTicket int32 `protobuf:"varint,33,opt,name=sociatyTicket,proto3" json:"sociatyTicket" bson:"sociatyTicket"` //公会boss挑战券数量
|
SociatyTicket int32 `protobuf:"varint,33,opt,name=sociatyTicket,proto3" json:"sociatyTicket" bson:"sociatyTicket"` //公会boss挑战券数量
|
||||||
Mline map[int32]int32 `protobuf:"bytes,34,rep,name=mline,proto3" json:"mline" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"mline"` //主线关卡最大进度 key难度val是关卡ID
|
Mline map[int32]int32 `protobuf:"bytes,34,rep,name=mline,proto3" json:"mline" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"mline"` //主线关卡最大进度 key难度val是关卡ID
|
||||||
SuiteId []int32 `protobuf:"varint,35,rep,packed,name=suiteId,proto3" json:"suiteId" bson:"suiteId"` // 套装Id
|
SuiteId []int32 `protobuf:"varint,35,rep,packed,name=suiteId,proto3" json:"suiteId" bson:"suiteId"` // 套装Id
|
||||||
|
KungfuTickt int32 `protobuf:"varint,36,opt,name=kungfuTickt,proto3" json:"kungfuTickt" bson:"kungfuTickt"` //武馆挑战券
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DBUserExpand) Reset() {
|
func (x *DBUserExpand) Reset() {
|
||||||
@ -308,11 +309,18 @@ func (x *DBUserExpand) GetSuiteId() []int32 {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *DBUserExpand) GetKungfuTickt() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.KungfuTickt
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
var File_userexpand_proto protoreflect.FileDescriptor
|
var File_userexpand_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_userexpand_proto_rawDesc = []byte{
|
var file_userexpand_proto_rawDesc = []byte{
|
||||||
0x0a, 0x10, 0x75, 0x73, 0x65, 0x72, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f,
|
0x0a, 0x10, 0x75, 0x73, 0x65, 0x72, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
0x74, 0x6f, 0x22, 0x8c, 0x0a, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70,
|
0x74, 0x6f, 0x22, 0xae, 0x0a, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70,
|
||||||
0x61, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x61, 0x6e, 0x64, 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,
|
0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||||
0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61,
|
0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61,
|
||||||
@ -385,16 +393,18 @@ var file_userexpand_proto_rawDesc = []byte{
|
|||||||
0x32, 0x18, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x2e,
|
0x32, 0x18, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x2e,
|
||||||
0x4d, 0x6c, 0x69, 0x6e, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x6d, 0x6c, 0x69, 0x6e,
|
0x4d, 0x6c, 0x69, 0x6e, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x6d, 0x6c, 0x69, 0x6e,
|
||||||
0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x69, 0x74, 0x65, 0x49, 0x64, 0x18, 0x23, 0x20, 0x03,
|
0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x69, 0x74, 0x65, 0x49, 0x64, 0x18, 0x23, 0x20, 0x03,
|
||||||
0x28, 0x05, 0x52, 0x07, 0x73, 0x75, 0x69, 0x74, 0x65, 0x49, 0x64, 0x1a, 0x3a, 0x0a, 0x0c, 0x45,
|
0x28, 0x05, 0x52, 0x07, 0x73, 0x75, 0x69, 0x74, 0x65, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6b,
|
||||||
0x78, 0x70, 0x69, 0x74, 0x65, 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
|
0x75, 0x6e, 0x67, 0x66, 0x75, 0x54, 0x69, 0x63, 0x6b, 0x74, 0x18, 0x24, 0x20, 0x01, 0x28, 0x05,
|
||||||
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a,
|
0x52, 0x0b, 0x6b, 0x75, 0x6e, 0x67, 0x66, 0x75, 0x54, 0x69, 0x63, 0x6b, 0x74, 0x1a, 0x3a, 0x0a,
|
||||||
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61,
|
0x0c, 0x45, 0x78, 0x70, 0x69, 0x74, 0x65, 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,
|
||||||
0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x4d, 0x6c, 0x69, 0x6e, 0x65,
|
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
|
||||||
0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
|
0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
|
||||||
0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
|
0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x4d, 0x6c, 0x69,
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,
|
0x6e, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
|
||||||
0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
||||||
0x33,
|
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
|
||||||
|
0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||||
|
0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
Loading…
Reference in New Issue
Block a user