diff --git a/bin/json/game_buriedcondi.json b/bin/json/game_buriedcondi.json index 138ace48a..31ac65711 100644 --- a/bin/json/game_buriedcondi.json +++ b/bin/json/game_buriedcondi.json @@ -17756,15 +17756,15 @@ "type_sp": 1, "tasktxt": { "key": "buried_buried_condi_tasktxt_759", - "text": "装备副本boss2难度2" + "text": "火焰泰坦难度3" }, "type": 73, "valid": 0, "NPC": 10344, "value": 1, "filter": [ - 2, - 2 + 1, + 3 ], "filter2": [ "boss类型", @@ -17923,7 +17923,7 @@ "type_sp": 1, "tasktxt": { "key": "buried_buried_condi_tasktxt_766", - "text": "维京远征火焰泰坦难度3" + "text": "火焰泰坦难度4" }, "type": 73, "valid": 0, @@ -17931,7 +17931,7 @@ "value": 1, "filter": [ 1, - 3 + 4 ], "filter2": [ "boss类型", diff --git a/bin/json/game_worldtask.json b/bin/json/game_worldtask.json index 521ebd61e..500c76b92 100644 --- a/bin/json/game_worldtask.json +++ b/bin/json/game_worldtask.json @@ -411,7 +411,7 @@ }, { "a": "item", - "t": "10000008", + "t": "10000004", "n": 3 } ], @@ -980,7 +980,7 @@ }, { "a": "item", - "t": "10000008", + "t": "10000004", "n": 3 } ], @@ -1269,7 +1269,7 @@ }, { "a": "item", - "t": "10000008", + "t": "10000004", "n": 3 } ], @@ -1542,7 +1542,7 @@ }, { "a": "item", - "t": "10000008", + "t": "10000004", "n": 3 } ], @@ -2133,7 +2133,7 @@ }, { "a": "item", - "t": "10000009", + "t": "10000005", "n": 2 } ], @@ -2647,7 +2647,7 @@ }, { "a": "item", - "t": "10000009", + "t": "10000005", "n": 4 } ], @@ -3279,7 +3279,7 @@ }, { "a": "item", - "t": "10000010", + "t": "10000006", "n": 2 } ], diff --git a/comm/imodule.go b/comm/imodule.go index f0e229051..ad584ab33 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -20,7 +20,7 @@ type ( } //功能开启通知 IOpenCmdNotice interface { - OpenCmdNotice(session IUserSession, key string) + OpenCmdNotice(session IUserSession, keys ...string) } ) @@ -392,6 +392,7 @@ type ( } // 世界任务 IWorldtask interface { + IOpenCmdNotice // bingo任务 BingoJumpTask(session IUserSession, groupId, rtaskId int32) error // 通过任务ID bingo @@ -515,6 +516,8 @@ type ( ActiveCondition(uid string, condiIds ...int32) (err error) //完成任务并校验接口 FinishConditionAndCheck(uid string, finishcondiIds []int32, condiIds ...int32) (condis []*pb.ConIProgress, err error) + //重置埋点 按类型 + ResetBuriedByType(uid string, types ...TaskType) (err error) } //红点模块接口 IReddot interface { diff --git a/modules/arena/modelarena.go b/modules/arena/modelarena.go index e54363a8f..337ac2d36 100644 --- a/modules/arena/modelarena.go +++ b/modules/arena/modelarena.go @@ -416,11 +416,6 @@ func (this *modelArena) recoverTicket(session comm.IUserSession, info *pb.DBAren ) if ticketitem = this.module.ModuleTools.GetGlobalConf().ArenaTicketCos; ticketitem == nil { - // code = pb.ErrorCode_ConfigNoFound - // data = &pb.ErrorData{ - // Title: code.ToString(), - // Message: comm.NewNotFoundConfErr(moduleName, "global.json", "ArenaTicketCos").Error(), - // } this.module.Error("竞技场配置未找到!", log.Field{Key: "key", Value: "ArenaTicketCos"}) return } @@ -438,10 +433,6 @@ func (this *modelArena) recoverTicket(session comm.IUserSession, info *pb.DBAren ticketNum = global.ArenaTicketMax - ticket } this.module.DispenseRes(session, []*cfg.Gameatn{{A: ticketitem.A, T: ticketitem.T, N: ticketNum}}, true) - // info.Ticket += ticketNum - // if info.Ticket > global.ArenaTicketMax { - // info.Ticket = global.ArenaTicketMax - // } info.Lastrtickettime = time.Unix(info.Lastrtickettime, 0).Add(time.Duration(ticketNum) * time.Minute).Unix() } } diff --git a/modules/buried/configure.go b/modules/buried/configure.go index 231e22a39..e1b1bcd1d 100644 --- a/modules/buried/configure.go +++ b/modules/buried/configure.go @@ -148,3 +148,20 @@ func (this *configureComp) getCondiDatas(tt int32) (result []*cfg.GameBuriedCond this.lock.RUnlock() return } + +// 读取埋点条件配置 +func (this *configureComp) getCondiData(id int32) (result *cfg.GameBuriedCondiData, err error) { + var ( + v interface{} + ok bool + ) + if v, err = this.GetConfigure(game_buriedcondi); err != nil { + return + } else { + if result, ok = v.(*cfg.GameBuriedCondi).GetDataMap()[id]; !ok { + err = comm.NewNotFoundConfErr(moduleName, game_buriedcondi, id) + return + } + } + return +} diff --git a/modules/buried/module.go b/modules/buried/module.go index 88592f962..7174fda64 100644 --- a/modules/buried/module.go +++ b/modules/buried/module.go @@ -143,6 +143,48 @@ func (this *Buried) ActiveCondition(uid string, condiIds ...int32) (err error) { return } +// 重置所有对应的子任务 按埋点类型 +func (this *Buried) ResetBuriedByType(uid string, types ...comm.TaskType) (err error) { + var ( + bdatas *pb.DBBuried + model *buriedModel + bdata *pb.DBBuriedItem + ok bool + chanage bool + ) + if model, err = this.modelBuried.getburiedModel(uid); err != nil { + return + } + this.Debug("重置埋点!", log.Field{Key: "types", Value: types}) + lock, _ := this.modelBuried.userlock(uid) + err = lock.Lock() + if err != nil { + this.Error("埋点分布式锁失效 err!", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err.Error()}) + return + } + defer lock.Unlock() + if bdatas, err = model.getUserBurieds(uid); err != nil { + return + } + for _, v := range types { + if bdata, ok = bdatas.Items[int32(v)]; ok { + for _, v1 := range bdata.Condi { + if v1.Value != 0 && v1.Finish != pb.BuriedItemFinishState_buried_finish { + v1.Value = 0 + v1.Statistics = make([]string, 0) + v1.Timestamp = time.Now().Unix() + v1.State = pb.BuriedItemState_Activated + chanage = true + } + } + } + } + if chanage { + err = model.updateUserBurieds(uid, bdatas) + } + return +} + // 激活数据采集点 func (this *Buried) CheckCondition(uid string, condiIds ...int32) (condis []*pb.ConIProgress, err error) { var ( diff --git a/modules/practice/module.go b/modules/practice/module.go index 1153d012d..f58a3b4b0 100644 --- a/modules/practice/module.go +++ b/modules/practice/module.go @@ -44,12 +44,12 @@ type Practice struct { modelQiecuo *modelQiecuo } -//模块名 +// 模块名 func (this *Practice) GetType() core.M_Modules { return comm.ModulePractice } -//模块初始化接口 注册用户创建角色事件 +// 模块初始化接口 注册用户创建角色事件 func (this *Practice) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { err = this.ModuleBase.Init(service, module, options) this.service = service.(base.IRPCXService) @@ -89,7 +89,7 @@ func (this *Practice) Start() (err error) { return } -//装备组件 +// 装备组件 func (this *Practice) OnInstallComp() { this.ModuleBase.OnInstallComp() this.api = this.RegisterComp(new(apiComp)).(*apiComp) @@ -98,7 +98,7 @@ func (this *Practice) OnInstallComp() { this.modelQiecuo = this.RegisterComp(new(modelQiecuo)).(*modelQiecuo) } -//添加武馆资源 +// 添加武馆资源 func (this *Practice) AddItems(session comm.IUserSession, items map[string]int32, bPush bool) (errdata *pb.ErrorData) { var ( err error @@ -182,7 +182,7 @@ func (this *Practice) AddItems(session comm.IUserSession, items map[string]int32 return } -//完成世界任务 +// 完成世界任务 func (this *Practice) TaskComplete(session comm.IUserSession, taskid int32) { this.Debug("TaskComplete", log.Field{Key: "session", Value: session.GetUserId()}, @@ -201,21 +201,26 @@ func (this *Practice) TaskComplete(session comm.IUserSession, taskid int32) { // } } -func (this *Practice) OpenCmdNotice(session comm.IUserSession, key string) { +func (this *Practice) OpenCmdNotice(session comm.IUserSession, keys ...string) { this.Debug("OpenCmdNotice", log.Field{Key: "session", Value: session.GetUserId()}, - log.Field{Key: "key", Value: key}, + log.Field{Key: "key", Value: keys}, ) if !this.IsCross() { - err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), - comm.Service_Worker, string(comm.RPC_ModulePracticeUnLockPillar), - &pb.RPCGeneralReqA2{Param1: session.GetUserId(), Param2: key}, &pb.EmptyResp{}) - if err != nil { - this.Errorln(err) - return + for _, v := range keys { + err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), + comm.Service_Worker, string(comm.RPC_ModulePracticeUnLockPillar), + &pb.RPCGeneralReqA2{Param1: session.GetUserId(), Param2: v}, &pb.EmptyResp{}) + if err != nil { + this.Errorln(err) + return + } } + } else { - this.RPC_ModulePracticeUnLockPillar(context.Background(), &pb.RPCGeneralReqA2{Param1: session.GetUserId(), Param2: key}, &pb.EmptyResp{}) + for _, v := range keys { + this.RPC_ModulePracticeUnLockPillar(context.Background(), &pb.RPCGeneralReqA2{Param1: session.GetUserId(), Param2: v}, &pb.EmptyResp{}) + } } } @@ -323,7 +328,7 @@ func (this *Practice) ChallengeResults(bid, red, bule string, winSide int32) { }) } -//解锁武馆柱子 +// 解锁武馆柱子 func (this *Practice) RPC_ModulePracticeUnLockPillar(ctx context.Context, args *pb.RPCGeneralReqA2, reply *pb.EmptyResp) (err error) { this.Debug("RPC_ModulePracticeUnLockPillar", log.Field{Key: "uid", Value: args.Param1}, diff --git a/modules/user/api_login.go b/modules/user/api_login.go index 52761f14b..061ebe610 100644 --- a/modules/user/api_login.go +++ b/modules/user/api_login.go @@ -105,6 +105,13 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (err return } + // 在logintime更新前判断是否是昨天 + if utils.IsYestoday(user.Logintime) { + go this.module.ModuleBuried.TriggerBuried(session.GetUserId(), comm.GetBuriedParam(comm.Rtype9, 1)) + } else { + this.module.ModuleBuried.ResetBuriedByType(user.Uid, comm.Rtype9) + } + //不是新账号 if !isNewUser { lastLoginTime = user.Logintime @@ -129,13 +136,14 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (err if this.module.modelUser.isLoginFirst(lastLoginTime) { this.module.ModuleHero.NoLoginDay(user.Uid, int32(utils.DiffDays(lastLoginTime, configure.Now().Unix()))) go this.module.ModuleBuried.TriggerBuried(session.GetUserId(), comm.GetBuriedParam(comm.Rtype8, 1)) - go this.module.ModuleBuried.TriggerBuried(session.GetUserId(), comm.GetBuriedParam(comm.Rtype9, 1)) this.module.modelExpand.updateLoginDay(user.Uid, lastLoginTime) // 清理点赞 this.module.ModuleFriend.ResetFriend(user.Uid) this.module.modelSign.UserSign(session) } + // 判断昨日是否登录 + rsp.Data = user // 查询玩家扩展数据 diff --git a/modules/version/module.go b/modules/version/module.go index 8f50fc119..f80e701ae 100644 --- a/modules/version/module.go +++ b/modules/version/module.go @@ -7,8 +7,8 @@ import ( ) /* -模块名:web -描述:提供管理员相关的http接口 +模块名:资源版本管理记录 +描述:提供客户端查询版本接口 内部使用 开发:李伟 */ func NewModule() core.IModule { diff --git a/modules/version/options.go b/modules/version/options.go index 4ae2bdb79..16700e18d 100644 --- a/modules/version/options.go +++ b/modules/version/options.go @@ -8,9 +8,8 @@ import ( type ( Options struct { modules.Options - WebDir string - Port int - Key string + Port int + Key string } ) diff --git a/modules/worldtask/module.go b/modules/worldtask/module.go index bfb07239a..8616fd065 100644 --- a/modules/worldtask/module.go +++ b/modules/worldtask/module.go @@ -61,6 +61,11 @@ func (this *Worldtask) Start() (err error) { return } +// 功能开启 +func (this *Worldtask) OpenCmdNotice(session comm.IUserSession, keys ...string) { + +} + var errs []string // 配置文件校验