@@ -65,16 +65,16 @@ func (o *Outbound) Name() string {
6565 return ""
6666}
6767
68- func (o * Outbound ) PostInitialize (router adapter.Router ) error {
68+ func (o * Outbound ) PostInitialize (router adapter.Router , provider adapter. RouteResourceProvider ) error {
6969 var err error
7070 if o .config .Minecraft .HostnameAccess .Mode != access .DefaultMode {
71- o .hostnameAccessLists , err = router .FindListsByTag (o .config .Minecraft .HostnameAccess .ListTags )
71+ o .hostnameAccessLists , err = provider .FindListsByTag (o .config .Minecraft .HostnameAccess .ListTags )
7272 if err != nil {
7373 return common .Cause ("load access control lists: " , err )
7474 }
7575 }
7676 if o .config .Minecraft .NameAccess .Mode != access .DefaultMode {
77- o .nameAccessLists , err = router .FindListsByTag (o .config .Minecraft .NameAccess .ListTags )
77+ o .nameAccessLists , err = provider .FindListsByTag (o .config .Minecraft .NameAccess .ListTags )
7878 if err != nil {
7979 return common .Cause ("load access control lists: " , err )
8080 }
@@ -148,7 +148,7 @@ func (o *Outbound) PostInitialize(router adapter.Router) error {
148148 if o .config .SocketOptions != nil {
149149 return errors .New ("socket options are not available when dialer is specified" )
150150 }
151- o .dialer , err = router .FindOutboundByName (o .config .Dialer )
151+ o .dialer , err = provider .FindOutboundByName (o .config .Dialer )
152152 if err != nil {
153153 return err
154154 }
@@ -175,11 +175,11 @@ func (o *Outbound) PostInitialize(router adapter.Router) error {
175175 return nil
176176}
177177
178- func (o * Outbound ) Reload (newConfig * config. Outbound ) error {
179- o .config = newConfig
178+ func (o * Outbound ) Reload (options adapter. OutboundReloadOptions ) error {
179+ o .config = options . Config
180180 o .hostnameAccessLists = nil
181181 o .nameAccessLists = nil
182- return o .PostInitialize (o .router )
182+ return o .PostInitialize (o .router , & options )
183183}
184184
185185func (o * Outbound ) connectServer (ctx context.Context , metadata * adapter.Metadata ) (net.Conn , error ) {
@@ -311,8 +311,8 @@ func (o *Outbound) InjectConnection(ctx context.Context, conn *bufio.CachedConn,
311311 case pingModeDisconnect :
312312 // do nothing and disconnect
313313 case pingMode0ms :
314- buffer .WriteByte (1 ) // Client bound : Ping Response
315- buffer .Extend (8 ) // size of int64 timestamp
314+ buffer .WriteByte (1 ) // Client bound : Ping Response
315+ buffer .WriteZeroN (8 ) // size of int64 timestamp
316316 err = clientMC .WritePacket (buffer )
317317 buffer .Release ()
318318 if err != nil {
0 commit comments