From b5653233b382bb631d0ad3a9f88835f929f9781d Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 30 Jul 2021 04:51:55 +1000 Subject: Clean up the simData structure. --- src/sledjchisl/sledjchisl.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/sledjchisl/sledjchisl.c') diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index cfa1246..978bf33 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -719,11 +719,10 @@ struct dirtree *dirtree_handle_callback(struct dirtree *new, int (*callback)(str typedef struct _simData simData; struct _simData { - // portH is the HTTP port for the sim, portI is the UDP port for the sim. - int num, locX, locY, sizeX, sizeY, sizeZ, portH, portI, maxPrims; + // portH is the HTTP port for the sim, portU is the UDP port for the sim. + int locX, locY, sizeX, sizeY, sizeZ, portH, portU, maxPrims; char *name, *tab, *UUID, *regionType, *estate, *owner; int window, pane; -// char *nmbr; }; typedef struct _simList simList; @@ -867,7 +866,6 @@ ini->putstr(ini, "INI FILE", name); [Network] http_listener_port = 9007 */ - simd->num = getIntFromIni(ini, "Const.mysim"); simd->name = qstrunchar(ini->getstr(ini, "Region.RegionName", false), '"', '"'); simd->UUID = qstrunchar(ini->getstr(ini, "Region.RegionUUID", false), '"', '"'); simd->regionType = qstrunchar(ini->getstr(ini, "Region.RegionType", false), '"', '"'); @@ -875,7 +873,6 @@ ini->putstr(ini, "INI FILE", name); simd->sizeY = getIntFromIni(ini, "Region.SizeY"); simd->sizeZ = getIntFromIni(ini, "Region.SizeZ"); simd->tab = name; -// simd->nmbr = sim; ini->put(ini, "SIM DATA", simd, sizeof(simData)); ourSims->tbl->put(ourSims->tbl, sim, ini, sizeof(qlisttbl_t)); ourSims->byTab->put(ourSims->byTab, name, ini, sizeof(qlisttbl_t)); @@ -7769,7 +7766,6 @@ sims = -- Note these are .shini / tmux tab short names. if ( (strcmp(target, sim) == 0) || -// (strcmp(target, simd->nmbr) == 0) || (strcmp(target, name) == 0) || (strcmp(target, nm) == 0) || (strcmp(target, toybuf) == 0) @@ -7844,6 +7840,8 @@ Is there a "switch to pane 1" command? Nope I("%s is starting up in tab [%d:%s] pane .%d, from %s/sim%d.", name, window, type, pane, scTemp, count); char *cmd = xmprintf("rm -fr %s/sim%d; mkdir -p %s/sim%d; sed -E" + simd->portH = 8004 + count * 2; + simd->portU = 8005 + count * 2; " -e 's@\\[Region\\]@" "\\[Startup\\]\\n" " PIDFile = \"\\$\\{Paths\\|CachePath\\}\\/\\$\\{Const\\|mysim\\}\\.pid\"\\n" @@ -7858,10 +7856,10 @@ Is there a "switch to pane 1" command? Nope " %s >%s", scTemp, count, scTemp, count, - 8004 + count * 2, - 8004 + count * 2, - 8005 + count * 2, - 8005 + count * 2, + simd->portU, + simd->portU, + simd->portH, + simd->portH, path, newPath); int j; -- cgit v1.1