This commit is contained in:
meixiongfeng 2023-08-09 20:56:53 +08:00
commit 378525c2ef
4 changed files with 24 additions and 5 deletions

View File

@ -132,7 +132,13 @@ func (this *apiComp) CompleteTask(session comm.IUserSession, req *pb.WarorderCom
}
}
dwarorder.Completetasks = append(dwarorder.Completetasks, conf.Id)
dwarorder.Exp += conf.Score
if conf.Page == 3 || dwarorder.Weekexp < this.module.ModuleTools.GetGlobalConf().Passcheck4WeekMaxExp {
dwarorder.Exp += conf.Score
dwarorder.Weekexp += conf.Score
} else {
dwarorder.Exp += this.module.ModuleTools.GetGlobalConf().Passcheck4WeekMaxExp - dwarorder.Weekexp
dwarorder.Weekexp = this.module.ModuleTools.GetGlobalConf().Passcheck4WeekMaxExp
}
if expconf, err = this.module.configure.getWarorderLvByExp(dwarorder.Exp, req.Rtype); err != nil {
errdata = &pb.ErrorData{

View File

@ -4,6 +4,7 @@ import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
)
@ -84,11 +85,13 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.WarorderInfoReq) (e
if !utils.IsToday(dwarorder.Daytime) {
daynum := this.module.ModuleTools.GetGlobalConf().Passcheck4DayNum
this.module.model.refreshDayTask(dwarorder, confs, daynum)
dwarorder.Daytime = configure.Now().Unix()
}
if !utils.IsSameWeek(dwarorder.Weektime) {
weeknum := this.module.ModuleTools.GetGlobalConf().Passcheck4WeekNum
this.module.model.refreshDayTask(dwarorder, confs, weeknum)
dwarorder.Weektime = configure.Now().Unix()
}
condiIds = make([]int32, 0)

View File

@ -120,7 +120,7 @@ func (this *modelWarorder) refreshWeekTask(info *pb.DreamWarorder, confs []*cfg.
indexs = comm.GetRandWs(weight, num)
for _, i := range indexs {
info.Weektasks = append(info.Daytasks, tasks[i].Id)
info.Weektasks = append(info.Weektasks, tasks[i].Id)
}
info.Weektime = configure.Now().Unix()
}

View File

@ -190,6 +190,7 @@ type DreamWarorder struct {
Completetasks []int32 `protobuf:"varint,10,rep,packed,name=completetasks,proto3" json:"completetasks"`
Freeprogress int32 `protobuf:"varint,11,opt,name=freeprogress,proto3" json:"freeprogress"` //已领取天数
Payprogress int32 `protobuf:"varint,12,opt,name=payprogress,proto3" json:"payprogress"`
Weekexp int32 `protobuf:"varint,13,opt,name=weekexp,proto3" json:"weekexp"` //本周以获取经验
}
func (x *DreamWarorder) Reset() {
@ -308,6 +309,13 @@ func (x *DreamWarorder) GetPayprogress() int32 {
return 0
}
func (x *DreamWarorder) GetWeekexp() int32 {
if x != nil {
return x.Weekexp
}
return 0
}
var File_warorder_warorder_db_proto protoreflect.FileDescriptor
var file_warorder_warorder_db_proto_rawDesc = []byte{
@ -343,7 +351,7 @@ var file_warorder_warorder_db_proto_rawDesc = []byte{
0x0a, 0x0b, 0x70, 0x61, 0x79, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20,
0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x61, 0x79, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73,
0x12, 0x10, 0x0a, 0x03, 0x76, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x76,
0x69, 0x70, 0x22, 0xd5, 0x02, 0x0a, 0x0d, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x57, 0x61, 0x72, 0x6f,
0x69, 0x70, 0x22, 0xef, 0x02, 0x0a, 0x0d, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x57, 0x61, 0x72, 0x6f,
0x72, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x69, 0x6d, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x69, 0x6d, 0x65,
0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
@ -364,8 +372,10 @@ var file_warorder_warorder_db_proto_rawDesc = []byte{
0x72, 0x65, 0x73, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x66, 0x72, 0x65, 0x65,
0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x79, 0x70,
0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70,
0x61, 0x79, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x61, 0x79, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65,
0x65, 0x6b, 0x65, 0x78, 0x70, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x65, 0x65,
0x6b, 0x65, 0x78, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (