删除不用的接口
This commit is contained in:
parent
79024873d5
commit
374d9ce3c9
@ -82,8 +82,6 @@ type (
|
|||||||
InitTaskAll(uid string)
|
InitTaskAll(uid string)
|
||||||
//清空任务
|
//清空任务
|
||||||
ResetTask(uid string, taskTag TaskTag)
|
ResetTask(uid string, taskTag TaskTag)
|
||||||
//监听任务
|
|
||||||
ListenTask()
|
|
||||||
//任务通知
|
//任务通知
|
||||||
SendToTask(session IUserSession, taskType TaskType, param *pb.TaskParam) (code pb.ErrorCode)
|
SendToTask(session IUserSession, taskType TaskType, param *pb.TaskParam) (code pb.ErrorCode)
|
||||||
// 清理玩家任务数据
|
// 清理玩家任务数据
|
||||||
|
@ -18,7 +18,6 @@ const ( //Redis
|
|||||||
type ModelTask struct {
|
type ModelTask struct {
|
||||||
modules.MCompModel
|
modules.MCompModel
|
||||||
moduleTask *ModuleTask
|
moduleTask *ModuleTask
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *ModelTask) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
func (this *ModelTask) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||||
@ -59,14 +58,10 @@ func (this *ModelTask) getTaskTypeList(uid string, taskType comm.TaskType) (newl
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//任务处理器注册
|
|
||||||
|
|
||||||
//初始化任务
|
//初始化任务
|
||||||
func (this *ModelTask) initTask(uid string) error {
|
func (this *ModelTask) initTask(uid string) error {
|
||||||
if data, err := this.moduleTask.configure.getTaskList(); err == nil {
|
if data, err := this.moduleTask.configure.getTaskList(); err == nil {
|
||||||
for _, cnf := range data {
|
for _, cnf := range data {
|
||||||
//注册任务处理器
|
|
||||||
|
|
||||||
//初始玩家任务数据
|
//初始玩家任务数据
|
||||||
objId := primitive.NewObjectID().Hex()
|
objId := primitive.NewObjectID().Hex()
|
||||||
task := &pb.DBTask{
|
task := &pb.DBTask{
|
||||||
@ -245,3 +240,15 @@ func (this *ModelTask) inStrategy(uid string, heroCfgId int32) (taskIds []int32,
|
|||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *ModelTask) UpEquip() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *ModelTask) UpHeroStar() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *ModelTask) UpHeroLevel() {
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -27,6 +27,7 @@ func (this *ModuleTask) GetType() core.M_Modules {
|
|||||||
|
|
||||||
func (this *ModuleTask) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
func (this *ModuleTask) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||||
err = this.ModuleBase.Init(service, module, options)
|
err = this.ModuleBase.Init(service, module, options)
|
||||||
|
// this.initTaskHandle()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,6 +90,7 @@ func (this *ModuleTask) CreateTaskForStrategy(uid string, heroCfgId int32) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 清理任务数据
|
||||||
func (this *ModuleTask) CleanData(uid string) {
|
func (this *ModuleTask) CleanData(uid string) {
|
||||||
this.modelTask.clearTask(uid, comm.TASK_DAILY)
|
this.modelTask.clearTask(uid, comm.TASK_DAILY)
|
||||||
this.modelTask.clearTask(uid, comm.TASK_WEEKLY)
|
this.modelTask.clearTask(uid, comm.TASK_WEEKLY)
|
||||||
@ -97,4 +99,29 @@ func (this *ModuleTask) CleanData(uid string) {
|
|||||||
|
|
||||||
this.modelTaskActive.clearTask(uid, comm.TASK_DAILY)
|
this.modelTaskActive.clearTask(uid, comm.TASK_DAILY)
|
||||||
this.modelTaskActive.clearTask(uid, comm.TASK_WEEKLY)
|
this.modelTaskActive.clearTask(uid, comm.TASK_WEEKLY)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//任务处理器注册
|
||||||
|
type taskHandle func()
|
||||||
|
|
||||||
|
func (this *ModuleTask) register(taskType comm.TaskType, fn taskHandle) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *ModuleTask) initTaskHandle() {
|
||||||
|
if data, err := this.configure.getTaskList(); err == nil {
|
||||||
|
for _, v := range data {
|
||||||
|
switch v.TypeId {
|
||||||
|
case int32(comm.TaskTypeUpEquip):
|
||||||
|
this.register(comm.TaskTypeUpEquip, this.modelTask.UpEquip)
|
||||||
|
case int32(comm.TaskTypeUpHeroStar):
|
||||||
|
this.register(comm.TaskTypeUpEquip, this.modelTask.UpHeroStar)
|
||||||
|
case int32(comm.TaskTypeUpHeroLevel):
|
||||||
|
this.register(comm.TaskTypeUpEquip, this.modelTask.UpHeroLevel)
|
||||||
|
default:
|
||||||
|
log.Error("no ")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user