Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么只有game模块下有chanrpc.go,其他模块下添加了这个文件也不起作用? #4

Open
068089dy opened this issue May 14, 2020 · 0 comments

Comments

@068089dy
Copy link

package internal

import (
	"github.com/name5566/leaf/gate"
	"github.com/name5566/leaf/log"
)

var agents = make(map[gate.Agent]struct{})

func init() {
	skeleton.RegisterChanRPC("NewAgent", rpcNewAgent)
	skeleton.RegisterChanRPC("CloseAgent", rpcCloseAgent)
}

// agent 被创建时
func rpcNewAgent(args []interface{}) {
	a := args[0].(gate.Agent)
	_ = a
	log.Debug("new agent")
}

// agent 被关闭时
func rpcCloseAgent(args []interface{}) {
	a := args[0].(gate.Agent)
	_ = a
	log.Debug("agent quit")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant