| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- package actorRemote
- import (
- cherryApp "f1-game/internal/cherry_app"
- "f1-game/internal/code"
- nameActor "f1-game/internal/name/actor"
- nameRemote "f1-game/internal/name/remote"
- "f1-game/internal/pb"
- "f1-game/internal/types"
- cfacade "github.com/cherry-game/cherry/facade"
- )
- type genPool struct {
- }
- func newGenPool() *genPool {
- return &genPool{}
- }
- func (p *genPool) GenPoolConfirm(genPoolID int32, assets types.Assets) (ret types.Assets, ok bool) {
- var (
- req = &pb.AssetList{
- List: assets.ToProto(),
- }
- rsp = &pb.AssetList{}
- )
- targetPath := cfacade.NewChildPath(cherryApp.NodeID(), nameActor.GenPool, genPoolID)
- errCode := cherryApp.CallWait(targetPath, nameRemote.GenPoolConfrim, req, rsp)
- if code.IsFail(errCode) {
- return
- }
- for _, asset := range rsp.List {
- ret.Add(asset.Id, asset.Num)
- }
- ok = true
- return
- }
|