diff --git a/modules/friend/module.go b/modules/friend/module.go index 33df6d14c..a1a761cf2 100644 --- a/modules/friend/module.go +++ b/modules/friend/module.go @@ -1,6 +1,7 @@ package friend import ( + "context" "go_dreamfactory/comm" "go_dreamfactory/modules" "go_dreamfactory/pb" @@ -46,7 +47,7 @@ func (this *Friend) OnInstallComp() { func (this *Friend) Start() (err error) { err = this.ModuleBase.Start() - this.service.RegisterFunctionName(string(comm.Rpc_ModuleFriendUseAssitHero), this.UseAssistHero) + this.service.RegisterFunctionName(string(comm.Rpc_ModuleFriendUseAssitHero), this.RpcUseAssisHero) return } @@ -86,6 +87,15 @@ func (this *Friend) GetFriendList(uid string) (uids []string) { return } +func (this *Friend) RpcUseAssisHero(ctx context.Context, req *pb.RPCGeneralReqA2, reply *pb.DBHero) error { + hero, err := this.UseAssistHero(req.Param1, req.Param2) + if err != nil { + return err + } + reply = hero + return nil +} + // 使用好友助战英雄 func (this *Friend) UseAssistHero(uid, friendId string) (*pb.DBHero, error) { //指定好友