上传gm优化
This commit is contained in:
parent
394c34a7b4
commit
6b917ba72e
@ -431,11 +431,16 @@ func (this *WTask) ClearCaravanTask(session comm.IUserSession, task int32) {
|
||||
func (this *WTask) BingoJumpTask(session comm.IUserSession, taskId int32) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
wtask *pb.DBWTask
|
||||
accepts []int32 = make([]int32, 0)
|
||||
acceptsMap map[int32]struct{} = make(map[int32]struct{})
|
||||
complete []int32 = make([]int32, 0)
|
||||
completeMap map[int32]struct{} = make(map[int32]struct{})
|
||||
conf *cfg.GameWorldTaskData
|
||||
update map[string]interface{} = make(map[string]interface{})
|
||||
ok bool
|
||||
err error
|
||||
)
|
||||
if _, err = this.configure.gettaskconfconfigure(taskId); err != nil {
|
||||
if conf, err = this.configure.gettaskconfconfigure(taskId); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
@ -452,6 +457,12 @@ func (this *WTask) BingoJumpTask(session comm.IUserSession, taskId int32) (errda
|
||||
}
|
||||
return
|
||||
}
|
||||
for _, v := range wtask.Accepts {
|
||||
acceptsMap[v] = struct{}{}
|
||||
}
|
||||
for _, v := range wtask.Completes {
|
||||
completeMap[v] = struct{}{}
|
||||
}
|
||||
ok = false
|
||||
for _, v := range wtask.Activations {
|
||||
if taskId == v {
|
||||
@ -462,8 +473,41 @@ func (this *WTask) BingoJumpTask(session comm.IUserSession, taskId int32) (errda
|
||||
if ok {
|
||||
return
|
||||
}
|
||||
|
||||
for {
|
||||
if conf.Ontxe != 0 {
|
||||
if _, ok = completeMap[conf.Ontxe]; !ok {
|
||||
completeMap[conf.Ontxe] = struct{}{}
|
||||
if _, ok = acceptsMap[conf.Ontxe]; ok {
|
||||
delete(acceptsMap, conf.Ontxe)
|
||||
}
|
||||
|
||||
if conf, err = this.configure.gettaskconfconfigure(conf.Ontxe); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
for k, _ := range acceptsMap {
|
||||
accepts = append(accepts, k)
|
||||
}
|
||||
for k, _ := range completeMap {
|
||||
complete = append(complete, k)
|
||||
}
|
||||
|
||||
wtask.Activations = append(wtask.Activations, taskId)
|
||||
wtask.Accepts = accepts
|
||||
wtask.Completes = complete
|
||||
update["activations"] = wtask.Activations
|
||||
update["accepts"] = wtask.Accepts
|
||||
update["completes"] = wtask.Completes
|
||||
|
||||
if err = this.modelwtask.Change(session.GetUserId(), update); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
|
Loading…
Reference in New Issue
Block a user