feat 自定义拦截器

This commit is contained in:
2026-01-16 23:51:47 +08:00
parent e4e08b7366
commit 074a6aa5b3
3 changed files with 8 additions and 3 deletions

2
go.mod
View File

@@ -3,7 +3,7 @@ module git.hlsq.asia/mmorpg/service-scene
go 1.24.0
require (
git.hlsq.asia/mmorpg/service-common v0.0.0-20260116143417-d944729ad0e5
git.hlsq.asia/mmorpg/service-common v0.0.0-20260116155014-3de703eb83c5
github.com/judwhite/go-svc v1.2.1
go.uber.org/zap v1.27.0
google.golang.org/grpc v1.77.0

4
go.sum
View File

@@ -1,7 +1,7 @@
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
git.hlsq.asia/mmorpg/service-common v0.0.0-20260116143417-d944729ad0e5 h1:gkPNZ/OiXQhtiqRMdLrL5Zw580zgb9082jkZQqP71Fk=
git.hlsq.asia/mmorpg/service-common v0.0.0-20260116143417-d944729ad0e5/go.mod h1:Dazg+4woCv9Jk7jgT2qUSGWhZOXx/0WYfJO+FCUDyhw=
git.hlsq.asia/mmorpg/service-common v0.0.0-20260116155014-3de703eb83c5 h1:b7pTgEyYUKpHtAAt4ea/3EYfX0Y0lYwhjrgf3kTyn0w=
git.hlsq.asia/mmorpg/service-common v0.0.0-20260116155014-3de703eb83c5/go.mod h1:Dazg+4woCv9Jk7jgT2qUSGWhZOXx/0WYfJO+FCUDyhw=
github.com/BurntSushi/toml v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0=
github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=

View File

@@ -20,11 +20,16 @@ func NewServer(ttl int64) *Server {
EtcdTTL: ttl,
},
}
s.Base.OnCustomGrpcServerOption = s.OnCustomGrpcServerOption
s.Base.OnInit = s.OnInit
s.Base.OnClose = s.OnClose
return s
}
func (s *Server) OnCustomGrpcServerOption() []grpc.ServerOption {
return nil
}
func (s *Server) OnInit(serve *grpc.Server) {
grpc_pb.RegisterSceneServer(serve, s)
}