From 2a75beaf8e711915956ed103fcbce6f5ba852959 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Mon, 30 Oct 2017 17:41:48 -0700 Subject: [PATCH] -L -> -N, allow remote networking in -F mode --- include/vere/vere.h | 2 +- vere/ames.c | 3 ++- vere/main.c | 23 +++++++++++++---------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/include/vere/vere.h b/include/vere/vere.h index f1ad36103..fc954b3fd 100644 --- a/include/vere/vere.h +++ b/include/vere/vere.h @@ -547,8 +547,8 @@ c3_o fog; // -X, skip last event c3_o gab; // -g, run with garbage collector c3_o git; // -s, pill url from arvo git hash - c3_o loh; // -L, local-only networking c3_o mem; // -M, memory madness + c3_o net; // -N, remote networking in -F mode c3_o nuu; // -c, new pier c3_o pro; // -P, profile c3_o qui; // -q, quiet diff --git a/vere/ames.c b/vere/ames.c index b8db287a8..814926100 100644 --- a/vere/ames.c +++ b/vere/ames.c @@ -50,8 +50,9 @@ _ames_czar(c3_y imp_y, c3_s* por_s) { u3_ames* sam_u = &u3_Host.sam_u; - if ( c3y == u3_Host.ops_u.loh ) { + if ( c3n == u3_Host.ops_u.net ) { *por_s = 31337 + imp_y; + uL(fprintf(uH, "ames: czar: localhost-only mode\n")); return 0x7f000001; } else { diff --git a/vere/main.c b/vere/main.c index 10562b938..9c0f2bab7 100644 --- a/vere/main.c +++ b/vere/main.c @@ -73,7 +73,7 @@ _main_getopt(c3_i argc, c3_c** argv) u3_Host.ops_u.fog = c3n; u3_Host.ops_u.gab = c3n; u3_Host.ops_u.git = c3n; - u3_Host.ops_u.loh = c3n; + u3_Host.ops_u.net = c3n; u3_Host.ops_u.mem = c3n; u3_Host.ops_u.nuu = c3n; u3_Host.ops_u.pro = c3n; @@ -83,7 +83,7 @@ _main_getopt(c3_i argc, c3_c** argv) u3_Host.ops_u.veb = c3n; u3_Host.ops_u.kno_w = DefaultKernel; - while ( (ch_i=getopt(argc, argv,"G:B:A:I:w:u:t:f:k:l:n:p:r:LabcdgqsvxFMPDXR")) != -1 ) { + while ( (ch_i=getopt(argc, argv,"G:B:A:I:w:u:t:f:k:l:n:p:r:NabcdgqsvxFMPDXR")) != -1 ) { switch ( ch_i ) { case 'M': { u3_Host.ops_u.mem = c3y; @@ -162,12 +162,8 @@ _main_getopt(c3_i argc, c3_c** argv) u3_Host.ops_u.rep = c3y; return c3y; } - case 'L': { u3_Host.ops_u.loh = c3y; break; } - case 'F': { - u3_Host.ops_u.loh = c3y; - u3_Host.ops_u.fak = c3y; - break; - } + case 'N': { u3_Host.ops_u.net = c3y; break; } + case 'F': { u3_Host.ops_u.fak = c3y; break; } case 'a': { u3_Host.ops_u.abo = c3y; break; } case 'b': { u3_Host.ops_u.bat = c3y; break; } case 'c': { u3_Host.ops_u.nuu = c3y; break; } @@ -184,6 +180,13 @@ _main_getopt(c3_i argc, c3_c** argv) } } + if ( u3_Host.ops_u.fak == c3n && u3_Host.ops_u.net == c3y ) { + fprintf(stderr, "-N only makes sense with -F\n"); + return c3n; + } else if ( u3_Host.ops_u.fak == c3n && u3_Host.ops_u.net == c3n ) { + u3_Host.ops_u.net = c3y; /* remote networking is always on in real mode. */ + } + if ( u3_Host.ops_u.arv_c != 0 && ( u3_Host.ops_u.imp_c == 0 || u3_Host.ops_u.nuu == c3n ) ) { fprintf(stderr, "-A only makes sense when creating a new galaxy\n"); @@ -197,13 +200,13 @@ _main_getopt(c3_i argc, c3_c** argv) "the initial sync path with -A\n"); return c3n; } - + if ( u3_Host.ops_u.gen_c != 0 && ( u3_Host.ops_u.imp_c == 0 || u3_Host.ops_u.nuu == c3n ) ) { fprintf(stderr, "-G only makes sense when creating a new galaxy\n"); return c3n; } - + if ( u3_Host.ops_u.tic_c != 0 && ( u3_Host.ops_u.imp_c != 0 || u3_Host.ops_u.nuu == c3n ) ) { fprintf(stderr, "-t only makes sense when creating a new non-galaxy\n");