This commit is contained in:
liwei 2023-06-29 14:42:57 +08:00
commit cc6feb9dda
6 changed files with 50 additions and 34 deletions

View File

@ -409,6 +409,11 @@ const (
Diamond int32 = 2 //钻石
)
// 排行算虚拟币最低值
const (
CaravanMerchantmoney int32 = 10000
)
// 定时通知类型
type NotifyType int32
@ -848,6 +853,7 @@ const (
PrivilegeType7 //巨怪商队背包容量
PrivilegeType8 //美食馆每日最大制作时间
PrivilegeType9 //武馆每日最大练功时间
PrivilegeType10 //竞技场门票存储上限
)
const (

View File

@ -421,8 +421,11 @@ func (this *modelArena) recoverTicket(session comm.IUserSession, info *pb.DBAren
}
global := this.module.ModuleTools.GetGlobalConf()
maxTick := global.ArenaTicketMax
// 竞技场最大上限
maxTick += this.module.privilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType10) // 特权
ticket = int32(this.module.ModuleItems.QueryItemAmount(info.Uid, ticketitem.T))
if ticket < global.ArenaTicketMax && info.Lastrtickettime > 0 {
if ticket < maxTick && info.Lastrtickettime > 0 {
duration = configure.Now().Sub(time.Unix(info.Lastrtickettime, 0))
ticketNum = int32(math.Floor(duration.Minutes() / float64(global.ArenaTicketRecoveryTime)))
if ticketNum > 0 {

View File

@ -153,8 +153,10 @@ func (this *Battle) CreatePveBattle(session comm.IUserSession, req *pb.BattlePVE
Title: pb.ErrorCode_ReqParameterError.ToString(),
}
}
var flag bool
for _, v := range req.Format.Friendformat {
if v != "" {
flag = true
// this.ModuleBuried.SendToRtask(session, comm.Rtype108, 1)
go this.ModuleBuried.TriggerBuried(session.GetUserId(), comm.GetBuriedParam(comm.Rtype108, 1))
break
@ -164,7 +166,7 @@ func (this *Battle) CreatePveBattle(session comm.IUserSession, req *pb.BattlePVE
if record, errdata = this.modelBattle.createpve(session, conn, pb.BattleType_pve, req); errdata != nil {
return
}
if req.Format.Friendformat != nil {
if flag {
go this.ModuleBuried.TriggerBuried(session.GetUserId(), comm.GetBuriedParam(comm.Rtype12, 1))
}
return
@ -298,8 +300,10 @@ func (this *Battle) CreateLPVEBattle(session comm.IUserSession, req *pb.BattleLP
Title: pb.ErrorCode_ReqParameterError.ToString(),
}
}
var flag bool
for _, v := range req.Format.Friendformat {
if v != "" {
flag = true
// this.ModuleBuried.SendToRtask(session, comm.Rtype108, 1)
go this.ModuleBuried.TriggerBuried(session.GetUserId(), comm.GetBuriedParam(comm.Rtype108, 1))
break
@ -309,7 +313,7 @@ func (this *Battle) CreateLPVEBattle(session comm.IUserSession, req *pb.BattleLP
if record, errdata = this.modelBattle.createlpve(session, conn, pb.BattleType_lpev, req); errdata != nil {
return
}
if req.Format.Friendformat != nil {
if flag {
go this.ModuleBuried.TriggerBuried(session.GetUserId(), comm.GetBuriedParam(comm.Rtype12, 1))
}
return

View File

@ -378,7 +378,7 @@ func (this *Caravan) Rpc_ModuleCaravanSettlement(ctx context.Context, args *pb.E
}
}
// 发送虚拟币奖励
if _data, err := this.modelCaravan.DB.Find(comm.TableUser, bson.M{"merchantmoney": bson.M{"$gt": 0}}); err == nil {
if _data, err := this.modelCaravan.DB.Find(comm.TableUser, bson.M{"merchantmoney": bson.M{"$gt": comm.CaravanMerchantmoney}}); err == nil {
for _data.Next(context.TODO()) {
temp := &pb.DBUser{}

View File

@ -129,6 +129,7 @@ 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)

View File

@ -536,10 +536,12 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha
}
return
}
change.Ps += add
} else {
if change.Ps+add > ggd.PsUl {
change.Ps = ggd.PsUl
} else {
change.Ps += add
if change.Ps > ggd.PsUl {
change.Ps = ggd.PsUl
}
}