File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- const argv = require ( 'minimist' ) ( process . argv . slice ( 2 ) ) ;
1+ let argv ;
2+ try {
3+ argv = require ( 'minimist' ) ( process . argv . slice ( 2 ) ) ;
4+ } catch ( e ) {
5+ argv = { } ;
6+ }
27const path = require ( 'path' ) ;
38const cp = require ( 'child_process' ) ;
49const config = require ( './config.json' ) ;
@@ -8,25 +13,27 @@ let dev;
813
914if ( process . env . NETPLAY_PASSWORD ) {
1015 password = process . env . NETPLAY_PASSWORD ;
11- } else if ( argv . a ) {
16+ } else if ( argv . a ) {
1217 password = argv . a ;
13- } else {
18+ } else {
1419 password = config . password ;
1520}
1621
1722if ( process . env . NETPLAY_PORT ) {
1823 port = process . env . NETPLAY_PORT ;
19- } else if ( argv . p ) {
24+ } else if ( process . env . PORT ) {
25+ port = process . env . PORT ;
26+ } else if ( argv . p ) {
2027 port = argv . p ;
21- } else {
28+ } else {
2229 port = config . port ;
2330}
2431
2532if ( process . env . NETPLAY_DEV ) {
2633 dev = process . env . NETPLAY_DEV ;
27- } else if ( argv . d ) {
34+ } else if ( argv . d ) {
2835 dev = true ;
29- } else {
36+ } else {
3037 dev = config . dev ;
3138}
3239
Original file line number Diff line number Diff line change @@ -152,7 +152,8 @@ function startnetplay(){
152152 origin : "*" ,
153153 methods : [ "GET" , "POST" ] ,
154154 credentials : true
155- }
155+ } ,
156+ maxHttpBufferSize : 1e8
156157 } ) ;
157158 netplay . start ( io , rooms , nofusers , dev ) ;
158159}
You can’t perform that action at this time.
0 commit comments