任务完成批处理
This commit is contained in:
parent
ae2747e484
commit
bc0c9f55c7
@ -16,7 +16,7 @@ type (
|
|||||||
}
|
}
|
||||||
//任务完成
|
//任务完成
|
||||||
ITaskComplete interface {
|
ITaskComplete interface {
|
||||||
TaskComplete(session IUserSession, taskid int32)
|
TaskComplete(session IUserSession, taskid ...int32)
|
||||||
}
|
}
|
||||||
//功能开启通知
|
//功能开启通知
|
||||||
IOpenCmdNotice interface {
|
IOpenCmdNotice interface {
|
||||||
|
@ -307,7 +307,7 @@ func (this *Caravan) CleanCaravanTask(uid string, data *pb.DBCaravan) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Caravan) TaskComplete(session comm.IUserSession, taskid int32) {
|
func (this *Caravan) TaskComplete(session comm.IUserSession, taskid ...int32) {
|
||||||
this.Debug("Caravan TaskComplete",
|
this.Debug("Caravan TaskComplete",
|
||||||
log.Field{Key: "session", Value: session.GetUserId()},
|
log.Field{Key: "session", Value: session.GetUserId()},
|
||||||
log.Field{Key: "taskid", Value: taskid},
|
log.Field{Key: "taskid", Value: taskid},
|
||||||
@ -316,27 +316,29 @@ func (this *Caravan) TaskComplete(session comm.IUserSession, taskid int32) {
|
|||||||
resp *pb.CaravanTaskCompletePush
|
resp *pb.CaravanTaskCompletePush
|
||||||
)
|
)
|
||||||
if !this.IsCross() {
|
if !this.IsCross() {
|
||||||
|
for _, t := range taskid {
|
||||||
list, _ := this.modelCaravan.getCaravanList(session.GetUserId())
|
list, _ := this.modelCaravan.getCaravanList(session.GetUserId())
|
||||||
if list.Taskid == taskid {
|
if list.Taskid == t {
|
||||||
if conf, err := this.configure.GetCaravanEventById(list.Eventid); err == nil {
|
if conf, err := this.configure.GetCaravanEventById(list.Eventid); err == nil {
|
||||||
this.CleanCaravanTask(session.GetUserId(), list) //任务完成 清理任务数据
|
this.CleanCaravanTask(session.GetUserId(), list) //任务完成 清理任务数据
|
||||||
resp = &pb.CaravanTaskCompletePush{}
|
resp = &pb.CaravanTaskCompletePush{}
|
||||||
resp.Data = list
|
resp.Data = list
|
||||||
resp.BSuccess = true
|
resp.BSuccess = true
|
||||||
for _, v := range conf.Reword {
|
for _, v := range conf.Reword {
|
||||||
resp.Reward = append(resp.Reward, &pb.UserAssets{
|
resp.Reward = append(resp.Reward, &pb.UserAssets{
|
||||||
A: v.A,
|
A: v.A,
|
||||||
T: v.T,
|
T: v.T,
|
||||||
N: v.N,
|
N: v.N,
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
if errdata := this.ModuleBase.DispenseRes(session, conf.Reword, true); errdata != nil {
|
||||||
|
this.Errorf("Caravan DispenseRes err:%v", conf.Reword)
|
||||||
|
}
|
||||||
|
session.SendMsg(string(this.GetType()), "taskcomplete", resp)
|
||||||
}
|
}
|
||||||
if errdata := this.ModuleBase.DispenseRes(session, conf.Reword, true); errdata != nil {
|
|
||||||
this.Errorf("Caravan DispenseRes err:%v", conf.Reword)
|
|
||||||
}
|
|
||||||
session.SendMsg(string(this.GetType()), "taskcomplete", resp)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ func (this *Practice) AddItems(session comm.IUserSession, items map[string]int32
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 完成世界任务
|
// 完成世界任务
|
||||||
func (this *Practice) TaskComplete(session comm.IUserSession, taskid int32) {
|
func (this *Practice) TaskComplete(session comm.IUserSession, taskid ...int32) {
|
||||||
this.Debug("TaskComplete",
|
this.Debug("TaskComplete",
|
||||||
log.Field{Key: "session", Value: session.GetUserId()},
|
log.Field{Key: "session", Value: session.GetUserId()},
|
||||||
log.Field{Key: "taskid", Value: taskid},
|
log.Field{Key: "taskid", Value: taskid},
|
||||||
|
Loading…
Reference in New Issue
Block a user