File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -525,6 +525,10 @@ <h3>Multiplayer</h3>
525525 const model = await _loadModelUrl ( href ) ;
526526 _setLocalModel ( model ) ;
527527 modelUrl = href ;
528+ _sendAllPeerConnections ( JSON . stringify ( {
529+ method : 'model' ,
530+ url : modelUrl ,
531+ } ) ) ;
528532 } ) ;
529533}
530534
@@ -984,6 +988,11 @@ <h3>Multiplayer</h3>
984988
985989let channelConnection = null ;
986990const peerConnections = [ ] ;
991+ const _sendAllPeerConnections = s => {
992+ for ( let i = 0 ; i < peerConnections . length ; i ++ ) {
993+ peerConnections [ i ] . send ( s ) ;
994+ }
995+ } ;
987996const channelInput = document . getElementById ( 'channel-input' ) ;
988997const connectButton = document . getElementById ( 'connect-button' ) ;
989998connectButton . addEventListener ( 'click' , ( ) => {
@@ -1243,6 +1252,10 @@ <h3>Multiplayer</h3>
12431252 const model = await _loadModelUrl ( url ) ;
12441253 _setLocalModel ( model ) ;
12451254 modelUrl = url ;
1255+ _sendAllPeerConnections ( JSON . stringify ( {
1256+ method : 'model' ,
1257+ url : modelUrl ,
1258+ } ) ) ;
12461259} ) ( ) ;
12471260 </ script >
12481261 </ body >
You can’t perform that action at this time.
0 commit comments