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,
"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类型",

View File

@ -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
}
],

View File

@ -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 {

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 {
// 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()
}
}

View File

@ -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
}

View File

@ -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 (

View File

@ -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() {
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: key}, &pb.EmptyResp{})
&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{})
}
}
}

View File

@ -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
// 查询玩家扩展数据

View File

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

View File

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

View File

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