diff --git a/modules/friend/api_addblack.go b/modules/friend/api_addblack.go index 6c74b5461..17d11f5d8 100644 --- a/modules/friend/api_addblack.go +++ b/modules/friend/api_addblack.go @@ -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 return } diff --git a/modules/friend/api_apply.go b/modules/friend/api_apply.go index 067af6ab5..388b3bf84 100644 --- a/modules/friend/api_apply.go +++ b/modules/friend/api_apply.go @@ -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 return } //判断对方是否也超过最大好友数量 - if len(target.FriendIds) >= this.moduleFriend.getFriendMax() { + if len(target.FriendIds) >= int(this.moduleFriend.configure.GetGlobalConf().FriendMaxnum) { code = pb.ErrorCode_FriendTargetMax return } diff --git a/modules/friend/api_zan.go b/modules/friend/api_zan.go index f99295839..886bdbe62 100644 --- a/modules/friend/api_zan.go +++ b/modules/friend/api_zan.go @@ -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 return } diff --git a/modules/friend/api_zanreceive.go b/modules/friend/api_zanreceive.go index 3caf4de1a..21bbb2600 100644 --- a/modules/friend/api_zanreceive.go +++ b/modules/friend/api_zanreceive.go @@ -56,13 +56,13 @@ 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 return } update := map[string]interface{}{ - "friendPoint": ue.FriendPoint + 10, + "friendPoint": ue.FriendPoint + 10, "friendPointID": ue.FriendPointID + 10, } if err := this.moduleFriend.ModuleUser.ChangeUserExpand(session.GetUserId(), update); err != nil { diff --git a/modules/friend/module.go b/modules/friend/module.go index 7c06158a2..2bb91fb83 100644 --- a/modules/friend/module.go +++ b/modules/friend/module.go @@ -36,38 +36,6 @@ func (this *Friend) OnInstallComp() { 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) { // 重置点赞列表 zanUpdate := map[string]interface{}{ diff --git a/modules/rtask/config.go b/modules/rtask/config.go index 3370b26ed..5b6d6a980 100644 --- a/modules/rtask/config.go +++ b/modules/rtask/config.go @@ -9,8 +9,8 @@ import ( const ( gameRtask = "game_rdtaskall.json" - gameRtaskChoose = "rdtaskchoose.json" - gameRtaskType = "rdtasktype.json" + gameRtaskChoose = "game_rdtaskchoose.json" + gameRtaskType = "game_rdtasktype.json" ) type configureComp struct { diff --git a/modules/rtask/module.go b/modules/rtask/module.go index 0991ffe10..48beb246b 100644 --- a/modules/rtask/module.go +++ b/modules/rtask/module.go @@ -52,7 +52,9 @@ func (this *ModuleRtask) Init(service core.IService, module core.IModule, option func (this *ModuleRtask) 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) {