diff --git a/modules/user/module.go b/modules/user/module.go index 460ed9f72..99d21e272 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -1013,6 +1013,7 @@ func (this *User) AddPer(session comm.IUserSession, pers map[string]int32, bPush CurSkin: user.CurSkin, CurAction: user.CurAction, CurBg: user.CurBg, + Avatar: user.Avatar, }) } return diff --git a/modules/worldtask/api_accept.go b/modules/worldtask/api_accept.go index 45b645847..da3d302d0 100644 --- a/modules/worldtask/api_accept.go +++ b/modules/worldtask/api_accept.go @@ -84,13 +84,14 @@ func (a *apiComp) Accept(session comm.IUserSession, req *pb.WorldtaskAcceptReq) //判断是否要结束任务 if ((len(curTaskConf.Completetask) == 1 && curTaskConf.Completetask[0] == 0) || len(curTaskConf.Completetask) == 0) && curTaskConf.DeliverNpc == 0 { + a.sendMsg(session, WorldtaskSubtypeAccept, rsp) //结束任务 a.module.modelWorldtask.taskFinish(session, req.GroupId, req.TaskId, myWorldtask, curTaskConf) a.module.modelWorldtask.taskFinishPush(session, req.GroupId, myWorldtask, curTaskConf) } else if curTaskConf.DeliverNpc == 0 && len(curTaskConf.Completetask) > 0 { + var flag bool conds, err := a.module.ModuleBuried.CheckCondition(uid, curTaskConf.Completetask...) if err == nil { - var flag bool for _, cond := range conds { if cond.State == pb.BuriedItemFinishState_buried_finish { flag = true @@ -100,11 +101,15 @@ func (a *apiComp) Accept(session comm.IUserSession, req *pb.WorldtaskAcceptReq) break } } - if flag { - a.module.modelWorldtask.taskFinish(session, req.GroupId, req.TaskId, myWorldtask, curTaskConf) - a.module.modelWorldtask.taskFinishPush(session, req.GroupId, myWorldtask, curTaskConf) - } } + + if flag { + a.sendMsg(session, WorldtaskSubtypeAccept, rsp) + a.module.modelWorldtask.taskFinish(session, req.GroupId, req.TaskId, myWorldtask, curTaskConf) + a.module.modelWorldtask.taskFinishPush(session, req.GroupId, myWorldtask, curTaskConf) + return + } + a.sendMsg(session, WorldtaskSubtypeAccept, rsp) } else { // 已完成的任务条件 conds, err := a.module.ModuleBuried.CheckCondition(uid, curTaskConf.Completetask...) @@ -119,9 +124,8 @@ func (a *apiComp) Accept(session comm.IUserSession, req *pb.WorldtaskAcceptReq) } a.module.ModuleBuried.ActiveCondition(uid, unfinishCondIds...) } + a.sendMsg(session, WorldtaskSubtypeAccept, rsp) } - a.sendMsg(session, WorldtaskSubtypeAccept, rsp) - return } diff --git a/modules/worldtask/api_finish.go b/modules/worldtask/api_finish.go index 0c03cd279..3c37cbf45 100644 --- a/modules/worldtask/api_finish.go +++ b/modules/worldtask/api_finish.go @@ -93,8 +93,8 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe log.Field{Key: "uid", Value: uid}, log.Field{Key: "taskId", Value: req.TaskId}, ) - this.module.modelWorldtask.taskFinishPush(session, req.GroupId, userTask, curTaskConf) this.sendMsg(session, WorldtaskSubtypeFinish, rsp) + this.module.modelWorldtask.taskFinishPush(session, req.GroupId, userTask, curTaskConf) return } } @@ -160,9 +160,8 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe ic.TaskComplete(session, req.TaskId) } } - - this.module.modelWorldtask.taskFinishPush(session, req.GroupId, userTask, curTaskConf) this.sendMsg(session, WorldtaskSubtypeFinish, rsp) + this.module.modelWorldtask.taskFinishPush(session, req.GroupId, userTask, curTaskConf) return } diff --git a/pb/user_msg.pb.go b/pb/user_msg.pb.go index e39b0e302..cd97b254a 100644 --- a/pb/user_msg.pb.go +++ b/pb/user_msg.pb.go @@ -2971,6 +2971,7 @@ type UserSkinlistPush struct { CurSkin string `protobuf:"bytes,2,opt,name=curSkin,proto3" json:"curSkin"` CurAction string `protobuf:"bytes,3,opt,name=curAction,proto3" json:"curAction"` CurBg string `protobuf:"bytes,4,opt,name=curBg,proto3" json:"curBg"` + Avatar string `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar"` } func (x *UserSkinlistPush) Reset() { @@ -3033,6 +3034,13 @@ func (x *UserSkinlistPush) GetCurBg() string { return "" } +func (x *UserSkinlistPush) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + var File_user_user_msg_proto protoreflect.FileDescriptor var file_user_user_msg_proto_rawDesc = []byte{ @@ -3268,15 +3276,17 @@ var file_user_user_msg_proto_rawDesc = []byte{ 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x75, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x75, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x42, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x63, 0x75, 0x72, 0x42, 0x67, 0x22, 0x76, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x53, 0x6b, 0x69, - 0x6e, 0x6c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x6b, 0x69, - 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x6b, 0x69, 0x6e, 0x73, 0x12, - 0x18, 0x0a, 0x07, 0x63, 0x75, 0x72, 0x53, 0x6b, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x63, 0x75, 0x72, 0x53, 0x6b, 0x69, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x75, 0x72, - 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x75, - 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x42, 0x67, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x75, 0x72, 0x42, 0x67, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x75, 0x72, 0x42, 0x67, 0x22, 0x8e, 0x01, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x53, 0x6b, + 0x69, 0x6e, 0x6c, 0x69, 0x73, 0x74, 0x50, 0x75, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x6b, + 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x6b, 0x69, 0x6e, 0x73, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75, 0x72, 0x53, 0x6b, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x75, 0x72, 0x53, 0x6b, 0x69, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x75, + 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, + 0x75, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x42, + 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x75, 0x72, 0x42, 0x67, 0x12, 0x16, + 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (