Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
171e4798ca
@ -61,7 +61,7 @@ func (this *GM) OnInstallComp() {
|
|||||||
|
|
||||||
//bingo:Iamyoudad
|
//bingo:Iamyoudad
|
||||||
func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorCode) {
|
func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorCode) {
|
||||||
code = pb.ErrorCode_ReqParameterError
|
|
||||||
cmd = strings.Replace(cmd, " ", "", -1) // 去空格
|
cmd = strings.Replace(cmd, " ", "", -1) // 去空格
|
||||||
keys := strings.Split(cmd, ":")
|
keys := strings.Split(cmd, ":")
|
||||||
if len(keys) == 2 {
|
if len(keys) == 2 {
|
||||||
|
@ -30,6 +30,11 @@ func (this *apiComp) CompleteCondi(session comm.IUserSession, req *pb.WorldtaskC
|
|||||||
code = pb.ErrorCode_ConfigNoFound
|
code = pb.ErrorCode_ConfigNoFound
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (len(curTaskConf.Completetask) == 1 && curTaskConf.Completetask[0] == 0 ||
|
||||||
|
len(curTaskConf.Completetask) == 0) && curTaskConf.DeliverNpc == 0 {
|
||||||
|
code = pb.ErrorCode_WorldtaskNoProcess
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
myWorldtask, err := this.module.modelWorldtask.getWorldtask(uid)
|
myWorldtask, err := this.module.modelWorldtask.getWorldtask(uid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -74,6 +79,5 @@ func (this *apiComp) CompleteCondi(session comm.IUserSession, req *pb.WorldtaskC
|
|||||||
|
|
||||||
session.SendMsg(string(this.module.GetType()), "completecondi", rsp)
|
session.SendMsg(string(this.module.GetType()), "completecondi", rsp)
|
||||||
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,11 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if curTaskConf.DeliverNpc == 0 {
|
||||||
|
code = pb.ErrorCode_WorldtaskNoProcess
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 判断玩家等级要求
|
// 判断玩家等级要求
|
||||||
if user.Lv < curTaskConf.Lock {
|
if user.Lv < curTaskConf.Lock {
|
||||||
code = pb.ErrorCode_WorldtaskLvNotEnough
|
code = pb.ErrorCode_WorldtaskLvNotEnough
|
||||||
@ -171,6 +176,7 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
|
|||||||
// 任务完成推送
|
// 任务完成推送
|
||||||
if err := session.SendMsg(string(this.module.GetType()), WorldtaskNexttaskPush, &pb.WorldtaskNexttaskPush{
|
if err := session.SendMsg(string(this.module.GetType()), WorldtaskNexttaskPush, &pb.WorldtaskNexttaskPush{
|
||||||
NextTask: nextTask,
|
NextTask: nextTask,
|
||||||
|
FinishedTaskIds: []int32{curTaskConf.Key},
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
code = pb.ErrorCode_SystemError
|
code = pb.ErrorCode_SystemError
|
||||||
return
|
return
|
||||||
|
@ -100,7 +100,7 @@ func (this *ModelWorldtask) finishTask(groupId, taskId int32, task *pb.DBWorldta
|
|||||||
task.CurrentTask = make(map[int32]*pb.Worldtask)
|
task.CurrentTask = make(map[int32]*pb.Worldtask)
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断是否有下个任务
|
//有下个任务
|
||||||
if taskConf.IdAfter != 0 {
|
if taskConf.IdAfter != 0 {
|
||||||
wt.NpcStatus = 0
|
wt.NpcStatus = 0
|
||||||
wt.DeliverNpc = 0
|
wt.DeliverNpc = 0
|
||||||
@ -230,7 +230,7 @@ func (this *ModelWorldtask) taskFinishPush(session comm.IUserSession, groupId in
|
|||||||
// 章节完成
|
// 章节完成
|
||||||
if _, ok := userTask.Chapters[groupId]; !ok {
|
if _, ok := userTask.Chapters[groupId]; !ok {
|
||||||
if userTask.Chapters == nil {
|
if userTask.Chapters == nil {
|
||||||
delete(userTask.CurrentTask,groupId)
|
delete(userTask.CurrentTask, groupId)
|
||||||
userTask.Chapters = make(map[int32]int32)
|
userTask.Chapters = make(map[int32]int32)
|
||||||
userTask.Chapters[groupId] = 1 //已解锁待领取
|
userTask.Chapters[groupId] = 1 //已解锁待领取
|
||||||
update := map[string]interface{}{
|
update := map[string]interface{}{
|
||||||
@ -245,6 +245,7 @@ func (this *ModelWorldtask) taskFinishPush(session comm.IUserSession, groupId in
|
|||||||
// 任务完成推送
|
// 任务完成推送
|
||||||
session.SendMsg(string(this.moduleWorldtask.GetType()), WorldtaskNexttaskPush, &pb.WorldtaskNexttaskPush{
|
session.SendMsg(string(this.moduleWorldtask.GetType()), WorldtaskNexttaskPush, &pb.WorldtaskNexttaskPush{
|
||||||
NextTask: nextTask,
|
NextTask: nextTask,
|
||||||
|
FinishedTaskIds: []int32{curTaskConf.Key},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ const (
|
|||||||
ErrorCode_WorldtaskGroupIdNosame ErrorCode = 3807 //组ID不一致
|
ErrorCode_WorldtaskGroupIdNosame ErrorCode = 3807 //组ID不一致
|
||||||
ErrorCode_WorldtaskChapterUnFinished ErrorCode = 3808 //章节任务未完成
|
ErrorCode_WorldtaskChapterUnFinished ErrorCode = 3808 //章节任务未完成
|
||||||
ErrorCode_WorldtaskChapterReceived ErrorCode = 3809 //章节奖励已领取
|
ErrorCode_WorldtaskChapterReceived ErrorCode = 3809 //章节奖励已领取
|
||||||
ErrorCode_WorldtaskNoDeliver ErrorCode = 3810 //无需交付
|
ErrorCode_WorldtaskNoProcess ErrorCode = 3810 //无需处理
|
||||||
// academy
|
// academy
|
||||||
ErrorCode_AcademyTaskNoCompleteTask ErrorCode = 3901 //未完成任务
|
ErrorCode_AcademyTaskNoCompleteTask ErrorCode = 3901 //未完成任务
|
||||||
// AutoBattle
|
// AutoBattle
|
||||||
@ -634,7 +634,7 @@ var (
|
|||||||
3807: "WorldtaskGroupIdNosame",
|
3807: "WorldtaskGroupIdNosame",
|
||||||
3808: "WorldtaskChapterUnFinished",
|
3808: "WorldtaskChapterUnFinished",
|
||||||
3809: "WorldtaskChapterReceived",
|
3809: "WorldtaskChapterReceived",
|
||||||
3810: "WorldtaskNoDeliver",
|
3810: "WorldtaskNoProcess",
|
||||||
3901: "AcademyTaskNoCompleteTask",
|
3901: "AcademyTaskNoCompleteTask",
|
||||||
4001: "AutoBattleNoData",
|
4001: "AutoBattleNoData",
|
||||||
4002: "AutoBattleStatesErr",
|
4002: "AutoBattleStatesErr",
|
||||||
@ -938,7 +938,7 @@ var (
|
|||||||
"WorldtaskGroupIdNosame": 3807,
|
"WorldtaskGroupIdNosame": 3807,
|
||||||
"WorldtaskChapterUnFinished": 3808,
|
"WorldtaskChapterUnFinished": 3808,
|
||||||
"WorldtaskChapterReceived": 3809,
|
"WorldtaskChapterReceived": 3809,
|
||||||
"WorldtaskNoDeliver": 3810,
|
"WorldtaskNoProcess": 3810,
|
||||||
"AcademyTaskNoCompleteTask": 3901,
|
"AcademyTaskNoCompleteTask": 3901,
|
||||||
"AutoBattleNoData": 4001,
|
"AutoBattleNoData": 4001,
|
||||||
"AutoBattleStatesErr": 4002,
|
"AutoBattleStatesErr": 4002,
|
||||||
@ -1394,7 +1394,7 @@ var file_errorcode_proto_rawDesc = []byte{
|
|||||||
0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xe0, 0x1d, 0x12, 0x1d, 0x0a, 0x18, 0x57, 0x6f, 0x72, 0x6c,
|
0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xe0, 0x1d, 0x12, 0x1d, 0x0a, 0x18, 0x57, 0x6f, 0x72, 0x6c,
|
||||||
0x64, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x65,
|
0x64, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x65,
|
||||||
0x69, 0x76, 0x65, 0x64, 0x10, 0xe1, 0x1d, 0x12, 0x17, 0x0a, 0x12, 0x57, 0x6f, 0x72, 0x6c, 0x64,
|
0x69, 0x76, 0x65, 0x64, 0x10, 0xe1, 0x1d, 0x12, 0x17, 0x0a, 0x12, 0x57, 0x6f, 0x72, 0x6c, 0x64,
|
||||||
0x74, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x10, 0xe2, 0x1d,
|
0x74, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x10, 0xe2, 0x1d,
|
||||||
0x12, 0x1e, 0x0a, 0x19, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x4e,
|
0x12, 0x1e, 0x0a, 0x19, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x4e,
|
||||||
0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x10, 0xbd, 0x1e,
|
0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x10, 0xbd, 0x1e,
|
||||||
0x12, 0x15, 0x0a, 0x10, 0x41, 0x75, 0x74, 0x6f, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x4e, 0x6f,
|
0x12, 0x15, 0x0a, 0x10, 0x41, 0x75, 0x74, 0x6f, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x4e, 0x6f,
|
||||||
|
Loading…
Reference in New Issue
Block a user