File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 1717TEAM_ID=" $1 "
1818TEAM_SECRET=" $2 "
1919PORT=" $3 "
20- RELAY_ADDRESS=" $4 "
20+ PERSISTENT=" $4 "
21+ RELAY_ADDRESS=" $5 "
2122
22- if [[ " TEAM_ID" == " " || " $TEAM_SECRET " == " " || " $PORT " == " " ]] ; then
23- echo ' usage: <TEAM ID> <TEAM SECRET> <PORT> [RELAY ADDRESS]'
23+ if [[ " TEAM_ID" == " " || " $TEAM_SECRET " == " " || " $PORT " == " " || " $PERSISTENT " == " " ]] ; then
24+ echo ' usage: <TEAM ID> <TEAM SECRET> <PORT> <PERSISENT> [RELAY ADDRESS]'
2425 exit 1
2526fi
2627
@@ -29,11 +30,13 @@ if [ "$RELAY_ADDRESS" == "" ] ; then
2930 java codeu.chat.ServerMain \
3031 " $TEAM_ID " \
3132 " $TEAM_SECRET " \
32- " $PORT "
33+ " $PORT " \
34+ " $PERSISTENT "
3335else
3436 java codeu.chat.ServerMain \
3537 " $TEAM_ID " \
3638 " $TEAM_SECRET " \
3739 " $PORT " \
40+ " $PERSISTENT " \
3841 " $RELAY_ADDRESS "
3942fi
Original file line number Diff line number Diff line change @@ -51,8 +51,12 @@ public static void main(String[] args) {
5151
5252 final int myPort = Integer .parseInt (args [2 ]);
5353
54- final RemoteAddress relayAddress = args .length > 3 ?
55- RemoteAddress .parse (args [3 ]) :
54+ // This is the directory where it is safe to store data accross runs
55+ // of the server.
56+ final String persistentPath = args [3 ];
57+
58+ final RemoteAddress relayAddress = args .length > 4 ?
59+ RemoteAddress .parse (args [4 ]) :
5660 null ;
5761
5862 try (
You can’t perform that action at this time.
0 commit comments