mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-05 06:50:04 +00:00
dd54668697
* 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
72 lines
2.9 KiB
C++
72 lines
2.9 KiB
C++
#include <iostream>
|
|
#include "settings.hpp"
|
|
#include "contrib/INIReader.hpp"
|
|
|
|
// defaults :)
|
|
int settings::VERBOSITY = 1;
|
|
|
|
int settings::LOGINPORT = 8001;
|
|
bool settings::APPROVEALLNAMES = true;
|
|
int settings::DBSAVEINTERVAL = 240;
|
|
|
|
int settings::SHARDPORT = 8002;
|
|
std::string settings::SHARDSERVERIP = "127.0.0.1";
|
|
time_t settings::TIMEOUT = 60000;
|
|
int settings::VIEWDISTANCE = 40000;
|
|
bool settings::SIMULATEMOBS = true;
|
|
|
|
// 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;
|
|
std::string settings::NPCJSON = "tdata/NPCs.json";
|
|
std::string settings::XDTJSON = "tdata/xdt.json";
|
|
std::string settings::MOBJSON = "tdata/mobs.json";
|
|
std::string settings::PATHJSON = "tdata/paths.json";
|
|
std::string settings::DROPSJSON = "tdata/drops.json";
|
|
std::string settings::GRUNTWORKJSON = "tdata/gruntwork.json";
|
|
std::string settings::MOTDSTRING = "Welcome to OpenFusion!";
|
|
int settings::ACCLEVEL = 1;
|
|
|
|
// event mode settings
|
|
int settings::EVENTMODE = 0;
|
|
int settings::EVENTCRATECHANCE = 10;
|
|
|
|
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;
|
|
else
|
|
std::cerr << "[WARN] Settings: invalid config.ini syntax at line " << reader.ParseError() << std::endl;
|
|
|
|
return;
|
|
}
|
|
|
|
APPROVEALLNAMES = reader.GetBoolean("", "acceptallcustomnames", APPROVEALLNAMES);
|
|
VERBOSITY = reader.GetInteger("", "verbosity", VERBOSITY);
|
|
LOGINPORT = reader.GetInteger("login", "port", LOGINPORT);
|
|
SHARDPORT = reader.GetInteger("shard", "port", SHARDPORT);
|
|
SHARDSERVERIP = reader.Get("shard", "ip", "127.0.0.1");
|
|
DBSAVEINTERVAL = reader.GetInteger("shard", "dbsaveinterval", DBSAVEINTERVAL);
|
|
TIMEOUT = reader.GetInteger("shard", "timeout", TIMEOUT);
|
|
VIEWDISTANCE = reader.GetInteger("shard", "viewdistance", VIEWDISTANCE);
|
|
SIMULATEMOBS = reader.GetBoolean("shard", "simulatemobs", SIMULATEMOBS);
|
|
SPAWN_X = reader.GetInteger("shard", "spawnx", SPAWN_X);
|
|
SPAWN_Y = reader.GetInteger("shard", "spawny", SPAWN_Y);
|
|
SPAWN_Z = reader.GetInteger("shard", "spawnz", SPAWN_Z);
|
|
SPAWN_ANGLE = reader.GetInteger("shard", "spawnangle", SPAWN_ANGLE);
|
|
NPCJSON = reader.Get("shard", "npcdata", NPCJSON);
|
|
XDTJSON = reader.Get("shard", "xdtdata", XDTJSON);
|
|
MOBJSON = reader.Get("shard", "mobdata", MOBJSON);
|
|
DROPSJSON = reader.Get("shard", "dropdata", DROPSJSON);
|
|
PATHJSON = reader.Get("shard", "pathdata", PATHJSON);
|
|
GRUNTWORKJSON = reader.Get("shard", "gruntwork", GRUNTWORKJSON);
|
|
MOTDSTRING = reader.Get("shard", "motd", MOTDSTRING);
|
|
ACCLEVEL = reader.GetInteger("shard", "accountlevel", ACCLEVEL);
|
|
EVENTMODE = reader.GetInteger("shard", "eventmode", EVENTMODE);
|
|
EVENTCRATECHANCE = reader.GetInteger("shard", "eventcratechance", EVENTCRATECHANCE);
|
|
}
|