2020-08-18 20:42:30 +00:00
|
|
|
#include <iostream>
|
|
|
|
#include "settings.hpp"
|
2020-08-22 02:03:12 +00:00
|
|
|
#include "contrib/INIReader.hpp"
|
2020-08-18 20:42:30 +00:00
|
|
|
|
|
|
|
// defaults :)
|
2020-08-23 21:09:31 +00:00
|
|
|
int settings::VERBOSITY = 1;
|
2020-08-22 17:39:13 +00:00
|
|
|
|
2020-08-18 20:42:30 +00:00
|
|
|
int settings::LOGINPORT = 8001;
|
2020-09-01 22:37:09 +00:00
|
|
|
bool settings::APPROVEALLNAMES = true;
|
2020-09-08 22:23:45 +00:00
|
|
|
int settings::DBSAVEINTERVAL = 240;
|
2020-08-18 20:42:30 +00:00
|
|
|
|
|
|
|
int settings::SHARDPORT = 8002;
|
|
|
|
std::string settings::SHARDSERVERIP = "127.0.0.1";
|
2020-09-16 15:45:53 +00:00
|
|
|
time_t settings::TIMEOUT = 60000;
|
2020-10-20 22:55:58 +00:00
|
|
|
int settings::VIEWDISTANCE = 25600;
|
2020-09-22 18:53:44 +00:00
|
|
|
bool settings::SIMULATEMOBS = true;
|
2020-08-18 20:42:30 +00:00
|
|
|
|
2020-09-08 20:41:02 +00:00
|
|
|
// default spawn point is Sector V (future)
|
|
|
|
int settings::SPAWN_X = 632032;
|
|
|
|
int settings::SPAWN_Y = 187177;
|
|
|
|
int settings::SPAWN_Z = -5500;
|
|
|
|
int settings::SPAWN_ANGLE = 130;
|
2020-09-14 13:20:55 +00:00
|
|
|
std::string settings::NPCJSON = "tdata/NPCs.json";
|
|
|
|
std::string settings::XDTJSON = "tdata/xdt.json";
|
|
|
|
std::string settings::MOBJSON = "tdata/mobs.json";
|
2020-09-17 02:27:21 +00:00
|
|
|
std::string settings::PATHJSON = "tdata/paths.json";
|
functional crates (no more plungers) (#133)
* FM, Taros and Boosts awards from killing mobs should be pretty
accurate now. A temporary formula for adjusting player/mob level gap is
implemented, but it will probably need to be adjusted in the future
* Mobs now drop correct crates
* Crates can be opened and give you correct items This includes
regular mob crates, world boss crates, mission crates, IZ race crates,
E.G.G.E.R.s, golden Eggs, and Event Crates. Keep in mind that neither
IZ races or golden Eggs are implemented, but if you spawn such a crate
it can be opened.
* All data is read from a json file, for which I'm going to release a
tool soon so it's easily adjustable
* There is a new setting for enabling events, which enables dropping
extra event crates These are Knishmas, Halloween and Easter
2020-10-10 17:18:47 +00:00
|
|
|
std::string settings::DROPSJSON = "tdata/drops.json";
|
2020-10-24 19:48:55 +00:00
|
|
|
std::string settings::EGGSJSON = "tdata/eggs.json";
|
2020-10-06 19:53:21 +00:00
|
|
|
std::string settings::GRUNTWORKJSON = "tdata/gruntwork.json";
|
2020-08-20 15:43:37 +00:00
|
|
|
std::string settings::MOTDSTRING = "Welcome to OpenFusion!";
|
2020-09-22 02:26:12 +00:00
|
|
|
int settings::ACCLEVEL = 1;
|
2020-08-18 20:42:30 +00:00
|
|
|
|
2020-12-02 22:42:33 +00:00
|
|
|
// monitor settings
|
2020-12-04 16:30:21 +00:00
|
|
|
bool settings::MONITORENABLED = false;
|
2020-12-02 22:42:33 +00:00
|
|
|
int settings::MONITORPORT = 8003;
|
|
|
|
int settings::MONITORINTERVAL = 5000;
|
|
|
|
|
functional crates (no more plungers) (#133)
* FM, Taros and Boosts awards from killing mobs should be pretty
accurate now. A temporary formula for adjusting player/mob level gap is
implemented, but it will probably need to be adjusted in the future
* Mobs now drop correct crates
* Crates can be opened and give you correct items This includes
regular mob crates, world boss crates, mission crates, IZ race crates,
E.G.G.E.R.s, golden Eggs, and Event Crates. Keep in mind that neither
IZ races or golden Eggs are implemented, but if you spawn such a crate
it can be opened.
* All data is read from a json file, for which I'm going to release a
tool soon so it's easily adjustable
* There is a new setting for enabling events, which enables dropping
extra event crates These are Knishmas, Halloween and Easter
2020-10-10 17:18:47 +00:00
|
|
|
// event mode settings
|
|
|
|
int settings::EVENTMODE = 0;
|
|
|
|
int settings::EVENTCRATECHANCE = 10;
|
|
|
|
|
2020-08-18 20:42:30 +00:00
|
|
|
void settings::init() {
|
|
|
|
INIReader reader("config.ini");
|
|
|
|
|
|
|
|
if (reader.ParseError() != 0) {
|
|
|
|
if (reader.ParseError() == -1)
|
|
|
|
std::cerr << "[WARN] Settings: missing config.ini file!" << std::endl;
|
2020-09-14 13:53:48 +00:00
|
|
|
else
|
2020-08-18 20:42:30 +00:00
|
|
|
std::cerr << "[WARN] Settings: invalid config.ini syntax at line " << reader.ParseError() << std::endl;
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-09-02 15:47:10 +00:00
|
|
|
APPROVEALLNAMES = reader.GetBoolean("", "acceptallcustomnames", APPROVEALLNAMES);
|
2020-09-14 13:53:48 +00:00
|
|
|
VERBOSITY = reader.GetInteger("", "verbosity", VERBOSITY);
|
2020-08-18 20:42:30 +00:00
|
|
|
LOGINPORT = reader.GetInteger("login", "port", LOGINPORT);
|
|
|
|
SHARDPORT = reader.GetInteger("shard", "port", SHARDPORT);
|
|
|
|
SHARDSERVERIP = reader.Get("shard", "ip", "127.0.0.1");
|
2020-09-21 19:43:53 +00:00
|
|
|
DBSAVEINTERVAL = reader.GetInteger("shard", "dbsaveinterval", DBSAVEINTERVAL);
|
2020-09-16 15:45:53 +00:00
|
|
|
TIMEOUT = reader.GetInteger("shard", "timeout", TIMEOUT);
|
2020-10-14 21:15:02 +00:00
|
|
|
VIEWDISTANCE = reader.GetInteger("shard", "viewdistance", VIEWDISTANCE);
|
2020-09-22 18:53:44 +00:00
|
|
|
SIMULATEMOBS = reader.GetBoolean("shard", "simulatemobs", SIMULATEMOBS);
|
2020-08-18 20:42:30 +00:00
|
|
|
SPAWN_X = reader.GetInteger("shard", "spawnx", SPAWN_X);
|
|
|
|
SPAWN_Y = reader.GetInteger("shard", "spawny", SPAWN_Y);
|
|
|
|
SPAWN_Z = reader.GetInteger("shard", "spawnz", SPAWN_Z);
|
2020-09-08 20:41:02 +00:00
|
|
|
SPAWN_ANGLE = reader.GetInteger("shard", "spawnangle", SPAWN_ANGLE);
|
2020-08-21 22:14:11 +00:00
|
|
|
NPCJSON = reader.Get("shard", "npcdata", NPCJSON);
|
2020-09-09 17:06:22 +00:00
|
|
|
XDTJSON = reader.Get("shard", "xdtdata", XDTJSON);
|
2020-09-07 17:54:40 +00:00
|
|
|
MOBJSON = reader.Get("shard", "mobdata", MOBJSON);
|
functional crates (no more plungers) (#133)
* FM, Taros and Boosts awards from killing mobs should be pretty
accurate now. A temporary formula for adjusting player/mob level gap is
implemented, but it will probably need to be adjusted in the future
* Mobs now drop correct crates
* Crates can be opened and give you correct items This includes
regular mob crates, world boss crates, mission crates, IZ race crates,
E.G.G.E.R.s, golden Eggs, and Event Crates. Keep in mind that neither
IZ races or golden Eggs are implemented, but if you spawn such a crate
it can be opened.
* All data is read from a json file, for which I'm going to release a
tool soon so it's easily adjustable
* There is a new setting for enabling events, which enables dropping
extra event crates These are Knishmas, Halloween and Easter
2020-10-10 17:18:47 +00:00
|
|
|
DROPSJSON = reader.Get("shard", "dropdata", DROPSJSON);
|
2020-10-24 19:48:55 +00:00
|
|
|
EGGSJSON = reader.Get("shard", "eggdata", EGGSJSON);
|
2020-09-17 02:27:21 +00:00
|
|
|
PATHJSON = reader.Get("shard", "pathdata", PATHJSON);
|
2020-10-06 19:53:21 +00:00
|
|
|
GRUNTWORKJSON = reader.Get("shard", "gruntwork", GRUNTWORKJSON);
|
2020-08-21 22:14:11 +00:00
|
|
|
MOTDSTRING = reader.Get("shard", "motd", MOTDSTRING);
|
2020-09-22 18:53:44 +00:00
|
|
|
ACCLEVEL = reader.GetInteger("shard", "accountlevel", ACCLEVEL);
|
functional crates (no more plungers) (#133)
* FM, Taros and Boosts awards from killing mobs should be pretty
accurate now. A temporary formula for adjusting player/mob level gap is
implemented, but it will probably need to be adjusted in the future
* Mobs now drop correct crates
* Crates can be opened and give you correct items This includes
regular mob crates, world boss crates, mission crates, IZ race crates,
E.G.G.E.R.s, golden Eggs, and Event Crates. Keep in mind that neither
IZ races or golden Eggs are implemented, but if you spawn such a crate
it can be opened.
* All data is read from a json file, for which I'm going to release a
tool soon so it's easily adjustable
* There is a new setting for enabling events, which enables dropping
extra event crates These are Knishmas, Halloween and Easter
2020-10-10 17:18:47 +00:00
|
|
|
EVENTMODE = reader.GetInteger("shard", "eventmode", EVENTMODE);
|
|
|
|
EVENTCRATECHANCE = reader.GetInteger("shard", "eventcratechance", EVENTCRATECHANCE);
|
2020-12-04 16:30:21 +00:00
|
|
|
MONITORENABLED = reader.GetBoolean("monitor", "enabled", MONITORENABLED);
|
2020-12-02 22:42:33 +00:00
|
|
|
MONITORPORT = reader.GetInteger("monitor", "port", MONITORPORT);
|
|
|
|
MONITORINTERVAL = reader.GetInteger("monitor", "interval", MONITORINTERVAL);
|
2020-08-19 17:22:54 +00:00
|
|
|
}
|