Update tdata to patch format, change config constants accordingly

This commit is contained in:
gsemaj 2021-05-01 20:49:54 -04:00 committed by Gent Semaj
parent b2a8b86e4c
commit 59303ba30d
5 changed files with 40 additions and 29 deletions

View File

@ -35,22 +35,25 @@ motd=Welcome to OpenFusion!
# requires to run. You can override them by changing their values and # requires to run. You can override them by changing their values and
# uncommenting them (removing the leading # character from that line). # uncommenting them (removing the leading # character from that line).
# xdt json data # location of the tabledata folder
#xdtdata=tdata/xdt.json #tdatadir=tdata/
# NPC json data # location of the patch folder
#npcdata=tdata/NPCs.json #patchdir=tdata/patch/
# mob json
#mobdata=tdata/mobs.json # xdt json filename
# path json #xdtdata=xdt.json
#pathdata=tdata/paths.json # NPC json filename
# drop json #npcdata=NPCs.json
#dropdata=tdata/drops.json # mob json filename
# gruntwork output (this is what you submit) #mobdata=mobs.json
#gruntwork=tdata/gruntwork.json # path json filename
#pathdata=paths.json
# drop json filename
#dropdata=drops.json
# gruntwork output filename (this is what you submit)
#gruntwork=gruntwork.json
# location of the database # location of the database
#dbpath=database.db #dbpath=database.db
# location of the patch folder
#patchpath=tdata/patch
# should tutorial flags be disabled off the bat? # should tutorial flags be disabled off the bat?
disablefirstuseflag=true disablefirstuseflag=true

View File

@ -998,12 +998,12 @@ void TableData::init() {
std::ifstream fstream; std::ifstream fstream;
for (int i = 0; i < 7; i++) { for (int i = 0; i < 7; i++) {
std::pair<json*, std::string>& table = tables[i]; std::pair<json*, std::string>& table = tables[i];
fstream.open(table.second); // open file fstream.open(settings::TDATADIR + table.second); // open file
if (!fstream.fail()) { if (!fstream.fail()) {
fstream >> *table.first; // load file contents into table fstream >> *table.first; // load file contents into table
} else { } else {
if (i != 6) { // gruntwork isn't critical if (i != 6) { // gruntwork isn't critical
std::cerr << "[FATAL] Critical tdata file missing: " << table.second << std::endl; std::cerr << "[FATAL] Critical tdata file missing: " << settings::TDATADIR << table.second << std::endl;
exit(1); exit(1);
} }
} }

View File

@ -30,18 +30,24 @@ int settings::SPAWN_X = 19835;
int settings::SPAWN_Y = 108682; int settings::SPAWN_Y = 108682;
int settings::SPAWN_Z = 8450; int settings::SPAWN_Z = 8450;
#endif #endif
int settings::SPAWN_ANGLE = 130; int settings::SPAWN_ANGLE = 130;
std::string settings::NPCJSON = "tdata/NPCs.json";
std::string settings::MOBJSON = "tdata/mobs.json";
std::string settings::EGGSJSON = "tdata/eggs.json";
std::string settings::GRUNTWORKJSON = "tdata/gruntwork.json";
std::string settings::MOTDSTRING = "Welcome to OpenFusion!";
std::string settings::DBPATH = "database.db"; std::string settings::DBPATH = "database.db";
std::string settings::PATCHPATH = "tdata/patch"; std::string settings::TDATADIR = "tdata/";
std::string settings::DROPSJSON = "tdata/drops.json"; std::string settings::PATCHDIR = "tdata/patch/";
std::string settings::XDTJSON = "tdata/xdt.json";
std::string settings::PATHJSON = "tdata/paths.json"; std::string settings::NPCJSON = "NPCs.json";
std::string settings::MOBJSON = "mobs.json";
std::string settings::EGGSJSON = "eggs.json";
std::string settings::GRUNTWORKJSON = "gruntwork.json";
std::string settings::MOTDSTRING = "Welcome to OpenFusion!";
std::string settings::DROPSJSON = "drops.json";
std::string settings::PATHJSON = "paths.json";
#ifdef ACADEMY
std::string settings::XDTJSON = "xdt1013.json";
#else
std::string settings::XDTJSON = "xdt.json";
#endif // ACADEMY
int settings::ACCLEVEL = 1; int settings::ACCLEVEL = 1;
bool settings::DISABLEFIRSTUSEFLAG = true; bool settings::DISABLEFIRSTUSEFLAG = true;
@ -88,7 +94,8 @@ void settings::init() {
GRUNTWORKJSON = reader.Get("shard", "gruntwork", GRUNTWORKJSON); GRUNTWORKJSON = reader.Get("shard", "gruntwork", GRUNTWORKJSON);
MOTDSTRING = reader.Get("shard", "motd", MOTDSTRING); MOTDSTRING = reader.Get("shard", "motd", MOTDSTRING);
DBPATH = reader.Get("shard", "dbpath", DBPATH); DBPATH = reader.Get("shard", "dbpath", DBPATH);
PATCHPATH = reader.Get("shard", "patchpath", PATCHPATH); TDATADIR = reader.Get("shard", "tdatadir", TDATADIR);
PATCHDIR = reader.Get("shard", "patchdir", PATCHDIR);
ACCLEVEL = reader.GetInteger("shard", "accountlevel", ACCLEVEL); ACCLEVEL = reader.GetInteger("shard", "accountlevel", ACCLEVEL);
EVENTMODE = reader.GetInteger("shard", "eventmode", EVENTMODE); EVENTMODE = reader.GetInteger("shard", "eventmode", EVENTMODE);
DISABLEFIRSTUSEFLAG = reader.GetBoolean("shard", "disablefirstuseflag", DISABLEFIRSTUSEFLAG); DISABLEFIRSTUSEFLAG = reader.GetBoolean("shard", "disablefirstuseflag", DISABLEFIRSTUSEFLAG);

View File

@ -24,7 +24,8 @@ namespace settings {
extern std::string EGGSJSON; extern std::string EGGSJSON;
extern std::string GRUNTWORKJSON; extern std::string GRUNTWORKJSON;
extern std::string DBPATH; extern std::string DBPATH;
extern std::string PATCHPATH; extern std::string PATCHDIR;
extern std::string TDATADIR;
extern int EVENTMODE; extern int EVENTMODE;
extern bool MONITORENABLED; extern bool MONITORENABLED;
extern int MONITORPORT; extern int MONITORPORT;

2
tdata

@ -1 +1 @@
Subproject commit 77e394c7ba8749af4907bdca222484c7595c0d8e Subproject commit 5b54c48bc4b873ef3ff28f0a7f383fd44e698660