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

basegate.Gate和app重复注册RPCSerialize问题 #148

Open
Linnkenn opened this issue Sep 12, 2024 · 0 comments
Open

basegate.Gate和app重复注册RPCSerialize问题 #148

Linnkenn opened this issue Sep 12, 2024 · 0 comments

Comments

@Linnkenn
Copy link
Contributor

Linnkenn commented Sep 12, 2024

继承basegate.Gate实现自己的gate模块,发现basegate.Gate在

func (gt *Gate) OnAppConfigurationLoaded(app module.App) {
//添加Session结构体的序列化操作类
gt.BaseModule.OnAppConfigurationLoaded(app) //这是必须的
err := app.AddRPCSerialize("gate", gt)
if err != nil {
log.Warning("Adding session structures failed to serialize interfaces %s", err.Error())

中调用了app.AddRPCSerialize("gate", gt), 而在此之前,app已经注册过了

mqant/app/app.go

Lines 203 to 217 in a530a28

func (app *DefaultApp) Run(mods ...module.Module) error {
var cof conf.Config
fmt.Println("Server configuration path :", app.opts.ConfPath)
conf.LoadConfig(app.opts.ConfPath) //加载配置文件
cof = conf.Conf
app.Configure(cof) //解析配置信息
if app.configurationLoaded != nil {
app.configurationLoaded(app)
}
app.AddRPCSerialize("gate", &basegate.SessionSerialize{
App: app,
})
// log.InitLog(app.opts.Debug, app.opts.ProcessID, app.opts.LogDir, cof.Log)

@Linnkenn Linnkenn changed the title basegate.Gate和app重复注册问题 basegate.Gate和app重复注册RPCSerialize问题 Sep 12, 2024
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