助战RPC
This commit is contained in:
parent
f7679c2ab5
commit
48119603bf
@ -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) {
|
||||
//指定好友
|
||||
|
Loading…
Reference in New Issue
Block a user