更新配置

This commit is contained in:
wh_zcy 2022-08-18 10:00:43 +08:00
parent 98f149b3ee
commit bad7c44903
7 changed files with 11 additions and 41 deletions

View File

@ -70,7 +70,7 @@ func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendBlackAddR
} }
// 判断是否黑名单人数已满 // 判断是否黑名单人数已满
if len(self.BlackIds) >= this.moduleFriend.getBlackMax() { if len(self.BlackIds) >= int(this.moduleFriend.configure.GetGlobalConf().FriendBlack) {
code = pb.ErrorCode_FriendBlackMax code = pb.ErrorCode_FriendBlackMax
return return
} }

View File

@ -63,13 +63,13 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
} }
//判断是否超过最大好友数量 //判断是否超过最大好友数量
if len(self.FriendIds) >= this.moduleFriend.getFriendMax() { if len(self.FriendIds) >= int(this.moduleFriend.configure.GetGlobalConf().FriendMaxnum) {
code = pb.ErrorCode_FriendSelfMax code = pb.ErrorCode_FriendSelfMax
return return
} }
//判断对方是否也超过最大好友数量 //判断对方是否也超过最大好友数量
if len(target.FriendIds) >= this.moduleFriend.getFriendMax() { if len(target.FriendIds) >= int(this.moduleFriend.configure.GetGlobalConf().FriendMaxnum) {
code = pb.ErrorCode_FriendTargetMax code = pb.ErrorCode_FriendTargetMax
return return
} }

View File

@ -56,7 +56,7 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (code
} }
// 今日送出的友情点是否达到上限 // 今日送出的友情点是否达到上限
if ue.FriendPointOD >= int32(this.moduleFriend.getOutFriendPointMax()) { if ue.FriendPointOD >= this.moduleFriend.configure.GetGlobalConf().FriendMaxsendnum {
code = pb.ErrorCode_FriendPointLimit code = pb.ErrorCode_FriendPointLimit
return return
} }

View File

@ -56,7 +56,7 @@ func (this *apiComp) Zanreceive(session comm.IUserSession, req *pb.FriendZanrece
} }
// 今日获赠的友情点是否达到上限 // 今日获赠的友情点是否达到上限
if ue.FriendPointID >= int32(this.moduleFriend.getInFriendPointMax()) { if ue.FriendPointID >= int32(this.moduleFriend.configure.GetGlobalConf().FriendMaxgetnum) {
code = pb.ErrorCode_FriendPointLimit code = pb.ErrorCode_FriendPointLimit
return return
} }

View File

@ -36,38 +36,6 @@ func (this *Friend) OnInstallComp() {
this.modelFriend = this.RegisterComp(new(ModelFriend)).(*ModelFriend) this.modelFriend = this.RegisterComp(new(ModelFriend)).(*ModelFriend)
} }
//获取最大好友数
func (this *Friend) getFriendMax() int {
// if maxHy := this.configure.GetGlobalConf("friend_maxnum"); maxHy != "" {
// return cast.ToInt(maxHy)
// }
return 0
}
//获取最大黑名单数
func (this *Friend) getBlackMax() int {
// if maxHy := this.configure.GetGlobalConf("friend_black"); maxHy != "" {
// return cast.ToInt(maxHy)
// }
return 0
}
// 每日最大送出友情点
func (this *Friend) getOutFriendPointMax() int {
// if max := this.configure.GetGlobalConf("friend_maxsendnum"); max != "" {
// return cast.ToInt(max)
// }
return 0
}
// 每日最大获赠友情点
func (this *Friend) getInFriendPointMax() int {
// if max := this.configure.GetGlobalConf("friend_maxsendnum"); max != "" {
// return cast.ToInt(max)
// }
return 0
}
func (this *Friend) ResetFriend(uid string) { func (this *Friend) ResetFriend(uid string) {
// 重置点赞列表 // 重置点赞列表
zanUpdate := map[string]interface{}{ zanUpdate := map[string]interface{}{

View File

@ -9,8 +9,8 @@ import (
const ( const (
gameRtask = "game_rdtaskall.json" gameRtask = "game_rdtaskall.json"
gameRtaskChoose = "rdtaskchoose.json" gameRtaskChoose = "game_rdtaskchoose.json"
gameRtaskType = "rdtasktype.json" gameRtaskType = "game_rdtasktype.json"
) )
type configureComp struct { type configureComp struct {

View File

@ -52,7 +52,9 @@ func (this *ModuleRtask) Init(service core.IService, module core.IModule, option
func (this *ModuleRtask) OnInstallComp() { func (this *ModuleRtask) OnInstallComp() {
this.ModuleBase.OnInstallComp() this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.modelRtask = this.RegisterComp(new(ModelRtask)).(*ModelRtask)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
} }
func (this *ModuleRtask) register(rtaskId int32, rtask *rtask) { func (this *ModuleRtask) register(rtaskId int32, rtask *rtask) {