mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
move router to module New func
This commit is contained in:
@@ -20,9 +20,9 @@ type PSNClient struct {
|
||||
func init() {
|
||||
RegisterModule(ModuleRegistration{
|
||||
Type: "net.psn.client",
|
||||
New: func(config config.ModuleConfig) (Module, error) {
|
||||
New: func(config config.ModuleConfig, router *Router) (Module, error) {
|
||||
|
||||
return &PSNClient{config: config, decoder: psn.NewDecoder()}, nil
|
||||
return &PSNClient{config: config, decoder: psn.NewDecoder(), router: router}, nil
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -35,10 +35,6 @@ func (pc *PSNClient) Type() string {
|
||||
return pc.config.Type
|
||||
}
|
||||
|
||||
func (pc *PSNClient) RegisterRouter(router *Router) {
|
||||
pc.router = router
|
||||
}
|
||||
|
||||
func (pc *PSNClient) Run() error {
|
||||
|
||||
addr, err := net.ResolveUDPAddr("udp", "236.10.10.10:56565")
|
||||
|
||||
Reference in New Issue
Block a user