@@ -4,10 +4,11 @@ const { Server } = require('socket.io');
44const path = require ( 'path' ) ;
55const app = express ( ) ;
66const os = require ( 'os' ) ;
7+ const netplay = require ( "./functions.js" ) ;
78let interfaces = os . networkInterfaces ( ) ;
89let mainserver = true ;
910let addresses = [ ] ;
10- let nofusers = 0 ;
11+ let nofusers = { num : 3 } ;
1112let port ;
1213let password ;
1314let dev ;
@@ -50,7 +51,7 @@ function startserver() {
5051 if ( ! checkAuth ( req . headers . authorization , password ) ) {
5152 return reject ( ) ;
5253 }
53- res . end ( '{ "port": ' + port + ', "password": "' + password + '", "nofusers": ' + nofusers + ' }' ) ;
54+ res . end ( '{ "port": ' + port + ', "password": "' + password + '", "nofusers": ' + nofusers . num + ' }' ) ;
5455 } ) ;
5556 app . post ( '/interface' , ( req , res ) => {
5657 const reject = ( ) => {
@@ -89,7 +90,7 @@ function startserver() {
8990 if ( ! checkAuth ( req . headers . authorization , password ) ) {
9091 return reject ( ) ;
9192 }
92- res . end ( '{ "users": ' + nofusers + " }" ) ;
93+ res . end ( '{ "users": ' + nofusers . num + " }" ) ;
9394 } ) ;
9495 app . post ( '/startstop' , ( req , res ) => {
9596 const reject = ( ) => {
@@ -128,6 +129,7 @@ function startnetplay(){
128129 credentials : true
129130 }
130131 } ) ;
132+ netplay . start ( io , dev , nofusers ) ;
131133}
132134
133135function stopnetplay ( ) {
0 commit comments