@@ -196,22 +196,22 @@ class Communication {
196196 delete socket . server . nonce ; // no longer needed
197197
198198 // join the network
199- this . addServer ( socket . server ) ;
199+ this . addServer ( socket . server , function ( ) {
200+ // make sure server has vital data
201+ socket . send ( 'joined' , {
202+ config : Tools . mergeHashes ( { airgap : self . config . get ( 'airgap' ) } , self . config . getPath ( 'satellite.config' ) ) ,
203+ masterData : self . masterData ,
204+ groups : socket . server . groups , // in case it was auto-assigned by hostname
205+ plugins : Tools . findObjects ( self . plugins , { type : 'event' } ) ,
206+ commands : self . getCommandsWithSecrets ( ) ,
207+ numServers : Tools . numKeys ( self . servers )
208+ } ) ;
209+ } ) ;
200210
201211 // socket is auth'ed
202212 this . logComm ( 6 , "Server socket has authenticated successfully: " + socket . id ) ;
203213 socket . auth = true ;
204214 socket . type = 'server' ;
205-
206- // make sure server has vital data
207- socket . send ( 'joined' , {
208- config : Tools . mergeHashes ( { airgap : this . config . get ( 'airgap' ) } , this . config . getPath ( 'satellite.config' ) ) ,
209- masterData : this . masterData ,
210- groups : socket . server . groups , // in case it was auto-assigned by hostname
211- plugins : Tools . findObjects ( this . plugins , { type : 'event' } ) ,
212- commands : this . getCommandsWithSecrets ( ) ,
213- numServers : Tools . numKeys ( this . servers )
214- } ) ;
215215 break ;
216216
217217 case 'authenticate' :
0 commit comments