if (access(EP, 0)) {
printf("making directory %s\n", EP);
- if (mkdir(EP, 493)) {
+ if (mkdir(EP, 0755)) {
printf("mkdir failed on %s, exiting.\n", EP);
exit(-1);
}
sprintf(buf, "%s/data", EP);
if (access(buf, 0)) {
printf("making directory %s\n", buf);
- if (mkdir(buf, 493)) {
+ if (mkdir(buf, 0755)) {
printf("mkdir failed on %s, exiting.\n", buf);
exit(-1);
}
fprintf(fp, " */\n\n");
fprintf(fp, "#ifndef _GAMESDEF_H_\n");
fprintf(fp, "#define _GAMESDEF_H_\n\n");
- fprintf(fp, "#if !defined(_WIN32)\n");
- fprintf(fp, "#ifdef __STDC__\n");
- fprintf(fp, "#define EMPPATH(xyz) \"%s/\" #xyz /* ANSI C */\n", EP);
- fprintf(fp, "#else\n");
- fprintf(fp, "#define EMPPATH(xyz) \"%s/xyz\" /* traditional */\n", EP);
- fprintf(fp, "#endif /* __STDC__ */\n");
- fprintf(fp, "#else\n");
- fprintf(fp, "#define EMPPATH(xyz) \"%s\\\\\" #xyz /* ANSI C */\n",
- path);
- fprintf(fp, "#endif /* _WIN32 */\n\n");
+ fprintf(fp, "#define EMPDIR \"%s\"\n", EP);
fprintf(fp, "#define PRVNAM \"%s\"\n", PV);
fprintf(fp, "#define PRVLOG \"%s\"\n", EM);
- fprintf(fp,
- "#define GET_SOURCE \"using:\\n ftp://ftp.wolfpackempire.com/pub/empire/server or \\n http://www.wolfpackempire.com/\"\n");
+ fprintf(fp, "#define GET_SOURCE \"using:\\n ftp://ftp.wolfpackempire.com/pub/empire/server or \\n http://www.wolfpackempire.com/\"\n");
fprintf(fp, "#define EMP_HOST \"%s\"\n", IP);
fprintf(fp, "#define EMP_PORT \"%d\"\n\n", PN);
fprintf(fp, "#define MAXNOC %d\n\n", MC);
#include "gamesdef.h"
#include "commodity.h"
-#if !defined(_WIN32)
-#define FILEPATH(p) EMPPATH(data/p)
-#else
-#define FILEPATH(p) EMPPATH(data\\p)
-#endif
-
struct empfile empfile[] = {
- {"sect", FILEPATH(sector), EFF_COM | EFF_XY | EFF_OWNER,
+ {"sect", EMPDIR "/data/sector", EFF_COM | EFF_XY | EFF_OWNER,
0, sizeof(struct sctstr),
0, 0, 0, {fldoff(sctstr, sct_nv), fldoff(sctstr, sct_vtype[0]),
fldoff(sctstr, sct_vamt[0])}, MAXSCTV,
-1, -1, 0, 0, 0, 0, 0},
- {"ship", FILEPATH(ship), EFF_COM | EFF_XY | EFF_OWNER | EFF_GROUP,
+ {"ship", EMPDIR "/data/ship", EFF_COM | EFF_XY | EFF_OWNER | EFF_GROUP,
0, sizeof(struct shpstr),
0, 0, 0, {fldoff(shpstr, shp_nv), fldoff(shpstr, shp_vtype[0]),
fldoff(shpstr, shp_vamt[0])}, MAXSHPV,
-1, -1, 0, 0, 0, 0, 0},
- {"plane", FILEPATH(plane), EFF_XY | EFF_OWNER | EFF_GROUP,
+ {"plane", EMPDIR "/data/plane", EFF_XY | EFF_OWNER | EFF_GROUP,
0, sizeof(struct plnstr),
0, 0, 0, {0, 0, 0}, 0, -1, -1, 0, 0, 0, 0, 0},
- {"land", FILEPATH(land), EFF_COM | EFF_XY | EFF_OWNER | EFF_GROUP,
+ {"land", EMPDIR "/data/land", EFF_COM | EFF_XY | EFF_OWNER | EFF_GROUP,
0, sizeof(struct lndstr),
0, 0, 0, {fldoff(lndstr, lnd_nv), fldoff(lndstr, lnd_vtype[0]),
fldoff(lndstr, lnd_vamt[0])}, MAXLNDV,
-1, -1, 0, 0, 0, 0, 0},
- {"nuke", FILEPATH(nuke), EFF_XY | EFF_OWNER, 0, sizeof(struct nukstr),
+ {"nuke", EMPDIR "/data/nuke", EFF_XY | EFF_OWNER, 0, sizeof(struct nukstr),
0, 0, 0, {0, 0, 0}, 0, -1, -1, 0, 0, 0, 0, 0},
- {"news", FILEPATH(news), 0,
+ {"news", EMPDIR "/data/news", 0,
0, sizeof(struct nwsstr),
0, 0, 0, {0, 0, 0}, 0, -1, -1, 0, 0, 0, 0, 0},
- {"treaty", FILEPATH(treaty), 0, 0, sizeof(struct trtstr),
+ {"treaty", EMPDIR "/data/treaty", 0, 0, sizeof(struct trtstr),
0, 0, 0, {0, 0, 0}, 0, -1, -1, 0, 0, 0, 0, 0},
- {"trade", FILEPATH(trade), 0, 0, sizeof(struct trdstr),
+ {"trade", EMPDIR "/data/trade", 0, 0, sizeof(struct trdstr),
0, 0, 0, {0, 0, 0}, 0, -1, -1, 0, 0, 0, 0, 0},
- {"pow", FILEPATH(power), 0, 0, sizeof(struct powstr),
+ {"pow", EMPDIR "/data/power", 0, 0, sizeof(struct powstr),
0, 0, 0, {0, 0, 0}, 0, -1, -1, 0, 0, 0, 0, 0},
- {"nat", FILEPATH(nation), 0, 0, sizeof(struct natstr),
+ {"nat", EMPDIR "/data/nation", 0, 0, sizeof(struct natstr),
0, 0, 0, {0, 0, 0}, 0, -1, -1, 0, 0, 0, 0, 0},
- {"loan", FILEPATH(loan), 0,
+ {"loan", EMPDIR "/data/loan", 0,
0, sizeof(struct lonstr),
0, 0, 0, {0, 0, 0}, 0, -1, -1, 0, 0, 0, 0, 0},
- {"map", FILEPATH(map), 0, 0, DEF_WORLD_X * DEF_WORLD_Y / 2,
+ {"map", EMPDIR "/data/map", 0, 0, DEF_WORLD_X * DEF_WORLD_Y / 2,
0, 0, 0, {0, 0, 0}, 0, -1, -1, 0, 0, 0, 0, 0},
- {"bmap", FILEPATH(bmap), 0, 0, DEF_WORLD_X * DEF_WORLD_Y / 2,
+ {"bmap", EMPDIR "/data/bmap", 0, 0, DEF_WORLD_X * DEF_WORLD_Y / 2,
0, 0, 0, {0, 0, 0}, 0, -1, -1, 0, 0, 0, 0, 0},
- {"commodity", FILEPATH(commodity), 0, 0, sizeof(struct comstr),
+ {"commodity", EMPDIR "/data/commodity", 0, 0, sizeof(struct comstr),
0, 0, 0, {0, 0, 0}, 0, -1, -1, 0, 0, 0, 0, 0},
- {"lost", FILEPATH(lostitems), 0, 0, sizeof(struct loststr),
+ {"lost", EMPDIR "/data/lostitems", 0, 0, sizeof(struct loststr),
0, 0, 0, {0, 0, 0}, 0, -1, -1, 0, 0, 0, 0, 0}
};