diff --git a/config.ini b/config.ini index de43a05..8e622f1 100644 --- a/config.ini +++ b/config.ini @@ -20,8 +20,7 @@ dbsaveinterval=240 port=8002 ip=127.0.0.1 # distance at which other players and NPCs become visible -playerdistance=20000 -npcdistance=16000 +chunksize=40000 # time, in milliseconds, to wait before kicking a non-responsive client # default is 1 minute timeout=60000 diff --git a/src/ChunkManager.cpp b/src/ChunkManager.cpp index bfd0883..f695571 100644 --- a/src/ChunkManager.cpp +++ b/src/ChunkManager.cpp @@ -61,7 +61,7 @@ bool ChunkManager::checkChunk(std::pair chunk) { } std::pair ChunkManager::grabChunk(int posX, int posY) { - return std::make_pair(posX / (settings::PLAYERDISTANCE / 3), posY / (settings::PLAYERDISTANCE / 3)); + return std::make_pair(posX / (settings::CHUNKSIZE / 3), posY / (settings::CHUNKSIZE / 3)); } std::vector ChunkManager::grabChunks(std::pair chunk) { @@ -103,4 +103,4 @@ std::vector ChunkManager::getDeltaChunks(std::vector from, std:: } return delta; -} \ No newline at end of file +} diff --git a/src/PlayerManager.cpp b/src/PlayerManager.cpp index 4052995..58d6c20 100644 --- a/src/PlayerManager.cpp +++ b/src/PlayerManager.cpp @@ -252,7 +252,7 @@ void PlayerManager::enterPlayer(CNSocket* sock, CNPacketData* data) { * it gets Count from Quest Inventory * * KillNPCCount sets RemainEnemyNum in the client - * Yes, this is extraordinary stupid, even for Grigon + * Yes, this is extraordinary stupid. */ } } diff --git a/src/settings.cpp b/src/settings.cpp index 9beadf6..c087ac4 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -12,8 +12,7 @@ int settings::DBSAVEINTERVAL = 240; int settings::SHARDPORT = 8002; std::string settings::SHARDSERVERIP = "127.0.0.1"; time_t settings::TIMEOUT = 60000; -int settings::PLAYERDISTANCE = 20000; -int settings::NPCDISTANCE = 16000; +int settings::CHUNKSIZE = 40000; // default spawn point is Sector V (future) int settings::SPAWN_X = 632032; @@ -45,8 +44,7 @@ void settings::init() { SHARDSERVERIP = reader.Get("shard", "ip", "127.0.0.1"); DBSAVEINTERVAL = reader.GetInteger("shard", "dbsaveinterval", DBSAVEINTERVAL); TIMEOUT = reader.GetInteger("shard", "timeout", TIMEOUT); - PLAYERDISTANCE = reader.GetInteger("shard", "playerdistance", PLAYERDISTANCE); - NPCDISTANCE = reader.GetInteger("shard", "npcdistance", NPCDISTANCE); + CHUNKSIZE = reader.GetInteger("shard", "chunksize", CHUNKSIZE); SPAWN_X = reader.GetInteger("shard", "spawnx", SPAWN_X); SPAWN_Y = reader.GetInteger("shard", "spawny", SPAWN_Y); SPAWN_Z = reader.GetInteger("shard", "spawnz", SPAWN_Z); diff --git a/src/settings.hpp b/src/settings.hpp index 6700ab6..7089cab 100644 --- a/src/settings.hpp +++ b/src/settings.hpp @@ -8,8 +8,7 @@ namespace settings { extern int SHARDPORT; extern std::string SHARDSERVERIP; extern time_t TIMEOUT; - extern int PLAYERDISTANCE; - extern int NPCDISTANCE; + extern int CHUNKSIZE; extern int SPAWN_X; extern int SPAWN_Y; extern int SPAWN_Z;