This commit is contained in:
meixiongfeng 2023-06-29 15:39:33 +08:00
commit 4d51bf7305
11 changed files with 113 additions and 43 deletions

View File

@ -17756,15 +17756,15 @@
"type_sp": 1, "type_sp": 1,
"tasktxt": { "tasktxt": {
"key": "buried_buried_condi_tasktxt_759", "key": "buried_buried_condi_tasktxt_759",
"text": "装备副本boss2难度2" "text": "火焰泰坦难度3"
}, },
"type": 73, "type": 73,
"valid": 0, "valid": 0,
"NPC": 10344, "NPC": 10344,
"value": 1, "value": 1,
"filter": [ "filter": [
2, 1,
2 3
], ],
"filter2": [ "filter2": [
"boss类型", "boss类型",
@ -17923,7 +17923,7 @@
"type_sp": 1, "type_sp": 1,
"tasktxt": { "tasktxt": {
"key": "buried_buried_condi_tasktxt_766", "key": "buried_buried_condi_tasktxt_766",
"text": "维京远征火焰泰坦难度3" "text": "火焰泰坦难度4"
}, },
"type": 73, "type": 73,
"valid": 0, "valid": 0,
@ -17931,7 +17931,7 @@
"value": 1, "value": 1,
"filter": [ "filter": [
1, 1,
3 4
], ],
"filter2": [ "filter2": [
"boss类型", "boss类型",

View File

@ -411,7 +411,7 @@
}, },
{ {
"a": "item", "a": "item",
"t": "10000008", "t": "10000004",
"n": 3 "n": 3
} }
], ],
@ -980,7 +980,7 @@
}, },
{ {
"a": "item", "a": "item",
"t": "10000008", "t": "10000004",
"n": 3 "n": 3
} }
], ],
@ -1269,7 +1269,7 @@
}, },
{ {
"a": "item", "a": "item",
"t": "10000008", "t": "10000004",
"n": 3 "n": 3
} }
], ],
@ -1542,7 +1542,7 @@
}, },
{ {
"a": "item", "a": "item",
"t": "10000008", "t": "10000004",
"n": 3 "n": 3
} }
], ],
@ -2133,7 +2133,7 @@
}, },
{ {
"a": "item", "a": "item",
"t": "10000009", "t": "10000005",
"n": 2 "n": 2
} }
], ],
@ -2647,7 +2647,7 @@
}, },
{ {
"a": "item", "a": "item",
"t": "10000009", "t": "10000005",
"n": 4 "n": 4
} }
], ],
@ -3279,7 +3279,7 @@
}, },
{ {
"a": "item", "a": "item",
"t": "10000010", "t": "10000006",
"n": 2 "n": 2
} }
], ],

View File

@ -20,7 +20,7 @@ type (
} }
//功能开启通知 //功能开启通知
IOpenCmdNotice interface { IOpenCmdNotice interface {
OpenCmdNotice(session IUserSession, key string) OpenCmdNotice(session IUserSession, keys ...string)
} }
) )
@ -392,6 +392,7 @@ type (
} }
// 世界任务 // 世界任务
IWorldtask interface { IWorldtask interface {
IOpenCmdNotice
// bingo任务 // bingo任务
BingoJumpTask(session IUserSession, groupId, rtaskId int32) error BingoJumpTask(session IUserSession, groupId, rtaskId int32) error
// 通过任务ID bingo // 通过任务ID bingo
@ -515,6 +516,8 @@ type (
ActiveCondition(uid string, condiIds ...int32) (err error) ActiveCondition(uid string, condiIds ...int32) (err error)
//完成任务并校验接口 //完成任务并校验接口
FinishConditionAndCheck(uid string, finishcondiIds []int32, condiIds ...int32) (condis []*pb.ConIProgress, err error) FinishConditionAndCheck(uid string, finishcondiIds []int32, condiIds ...int32) (condis []*pb.ConIProgress, err error)
//重置埋点 按类型
ResetBuriedByType(uid string, types ...TaskType) (err error)
} }
//红点模块接口 //红点模块接口
IReddot interface { IReddot interface {

View File

@ -416,11 +416,6 @@ func (this *modelArena) recoverTicket(session comm.IUserSession, info *pb.DBAren
) )
if ticketitem = this.module.ModuleTools.GetGlobalConf().ArenaTicketCos; ticketitem == nil { 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"}) this.module.Error("竞技场配置未找到!", log.Field{Key: "key", Value: "ArenaTicketCos"})
return return
} }
@ -438,10 +433,6 @@ func (this *modelArena) recoverTicket(session comm.IUserSession, info *pb.DBAren
ticketNum = global.ArenaTicketMax - ticket ticketNum = global.ArenaTicketMax - ticket
} }
this.module.DispenseRes(session, []*cfg.Gameatn{{A: ticketitem.A, T: ticketitem.T, N: ticketNum}}, true) 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() info.Lastrtickettime = time.Unix(info.Lastrtickettime, 0).Add(time.Duration(ticketNum) * time.Minute).Unix()
} }
} }

View File

@ -148,3 +148,20 @@ func (this *configureComp) getCondiDatas(tt int32) (result []*cfg.GameBuriedCond
this.lock.RUnlock() this.lock.RUnlock()
return 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
}

View File

@ -143,6 +143,48 @@ func (this *Buried) ActiveCondition(uid string, condiIds ...int32) (err error) {
return 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) { func (this *Buried) CheckCondition(uid string, condiIds ...int32) (condis []*pb.ConIProgress, err error) {
var ( var (

View File

@ -44,12 +44,12 @@ type Practice struct {
modelQiecuo *modelQiecuo modelQiecuo *modelQiecuo
} }
//模块名 // 模块名
func (this *Practice) GetType() core.M_Modules { func (this *Practice) GetType() core.M_Modules {
return comm.ModulePractice return comm.ModulePractice
} }
//模块初始化接口 注册用户创建角色事件 // 模块初始化接口 注册用户创建角色事件
func (this *Practice) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { func (this *Practice) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options) err = this.ModuleBase.Init(service, module, options)
this.service = service.(base.IRPCXService) this.service = service.(base.IRPCXService)
@ -89,7 +89,7 @@ func (this *Practice) Start() (err error) {
return return
} }
//装备组件 // 装备组件
func (this *Practice) OnInstallComp() { func (this *Practice) OnInstallComp() {
this.ModuleBase.OnInstallComp() this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp) this.api = this.RegisterComp(new(apiComp)).(*apiComp)
@ -98,7 +98,7 @@ func (this *Practice) OnInstallComp() {
this.modelQiecuo = this.RegisterComp(new(modelQiecuo)).(*modelQiecuo) this.modelQiecuo = this.RegisterComp(new(modelQiecuo)).(*modelQiecuo)
} }
//添加武馆资源 // 添加武馆资源
func (this *Practice) AddItems(session comm.IUserSession, items map[string]int32, bPush bool) (errdata *pb.ErrorData) { func (this *Practice) AddItems(session comm.IUserSession, items map[string]int32, bPush bool) (errdata *pb.ErrorData) {
var ( var (
err error err error
@ -182,7 +182,7 @@ func (this *Practice) AddItems(session comm.IUserSession, items map[string]int32
return return
} }
//完成世界任务 // 完成世界任务
func (this *Practice) TaskComplete(session comm.IUserSession, taskid int32) { func (this *Practice) TaskComplete(session comm.IUserSession, taskid int32) {
this.Debug("TaskComplete", this.Debug("TaskComplete",
log.Field{Key: "session", Value: session.GetUserId()}, 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", this.Debug("OpenCmdNotice",
log.Field{Key: "session", Value: session.GetUserId()}, log.Field{Key: "session", Value: session.GetUserId()},
log.Field{Key: "key", Value: key}, log.Field{Key: "key", Value: keys},
) )
if !this.IsCross() { if !this.IsCross() {
err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), for _, v := range keys {
comm.Service_Worker, string(comm.RPC_ModulePracticeUnLockPillar), err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(),
&pb.RPCGeneralReqA2{Param1: session.GetUserId(), Param2: key}, &pb.EmptyResp{}) comm.Service_Worker, string(comm.RPC_ModulePracticeUnLockPillar),
if err != nil { &pb.RPCGeneralReqA2{Param1: session.GetUserId(), Param2: v}, &pb.EmptyResp{})
this.Errorln(err) if err != nil {
return this.Errorln(err)
return
}
} }
} else { } 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) { func (this *Practice) RPC_ModulePracticeUnLockPillar(ctx context.Context, args *pb.RPCGeneralReqA2, reply *pb.EmptyResp) (err error) {
this.Debug("RPC_ModulePracticeUnLockPillar", this.Debug("RPC_ModulePracticeUnLockPillar",
log.Field{Key: "uid", Value: args.Param1}, log.Field{Key: "uid", Value: args.Param1},

View File

@ -105,6 +105,13 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (err
return 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 { if !isNewUser {
lastLoginTime = user.Logintime lastLoginTime = user.Logintime
@ -129,13 +136,14 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (err
if this.module.modelUser.isLoginFirst(lastLoginTime) { if this.module.modelUser.isLoginFirst(lastLoginTime) {
this.module.ModuleHero.NoLoginDay(user.Uid, int32(utils.DiffDays(lastLoginTime, configure.Now().Unix()))) 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.Rtype8, 1))
go this.module.ModuleBuried.TriggerBuried(session.GetUserId(), comm.GetBuriedParam(comm.Rtype9, 1))
this.module.modelExpand.updateLoginDay(user.Uid, lastLoginTime) this.module.modelExpand.updateLoginDay(user.Uid, lastLoginTime)
// 清理点赞 // 清理点赞
this.module.ModuleFriend.ResetFriend(user.Uid) this.module.ModuleFriend.ResetFriend(user.Uid)
this.module.modelSign.UserSign(session) this.module.modelSign.UserSign(session)
} }
// 判断昨日是否登录
rsp.Data = user rsp.Data = user
// 查询玩家扩展数据 // 查询玩家扩展数据

View File

@ -7,8 +7,8 @@ import (
) )
/* /*
模块名:web 模块名:资源版本管理记录
描述:提供管理员相关的http接口 描述:提供客户端查询版本接口 内部使用
开发:李伟 开发:李伟
*/ */
func NewModule() core.IModule { func NewModule() core.IModule {

View File

@ -8,9 +8,8 @@ import (
type ( type (
Options struct { Options struct {
modules.Options modules.Options
WebDir string Port int
Port int Key string
Key string
} }
) )

View File

@ -61,6 +61,11 @@ func (this *Worldtask) Start() (err error) {
return return
} }
// 功能开启
func (this *Worldtask) OpenCmdNotice(session comm.IUserSession, keys ...string) {
}
var errs []string var errs []string
// 配置文件校验 // 配置文件校验