lonng / nano

Lightweight, facility, high performance golang based game server framework
MIT License
2.88k stars 445 forks source link

rpc没有返回 #95

Open rezonegames opened 1 year ago

rezonegames commented 1 year ago

rpc的实现相当于notify

func (a *agent) RPC(route string, v interface{}) error { if a.status() == statusClosed { return ErrBrokenPipe } data, err := message.Serialize(v) if err != nil { return err } msg := &message.Message{ Type: message.Notify, Route: route, Data: data, } a.rpcHandler(a.session, msg, true) return nil }

希望返回interface, err := a.rpcHandler(a.session, msg, true), 这个interface可以转成需要的类型,不知道大家怎么处理的??

cute-angelia commented 1 year ago

+1

RockyF commented 1 year ago

讨论无果,好像故意做成这样的

rezonegames commented 1 year ago

我实现了一个版本,不过改的地方比较多,服务加载,remote和local都要处理

ouyangzhongmin commented 5 days ago

image 作者没处理返回,确实需要rpc能直接返回数据,不然就得定义多很多的rpc回调了