mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Safety check the map's blocksize (#12895)
This commit is contained in:
parent
88820cd31c
commit
9aaed75eea
2 changed files with 9 additions and 0 deletions
|
@ -420,6 +420,13 @@ void ServerEnvironment::init()
|
|||
|
||||
// If we open world.mt read the backend configurations.
|
||||
if (succeeded) {
|
||||
// Check that the world's blocksize matches the compiled MAP_BLOCKSIZE
|
||||
u16 blocksize = 16;
|
||||
conf.getU16NoEx("blocksize", blocksize);
|
||||
if (blocksize != MAP_BLOCKSIZE) {
|
||||
throw BaseException(std::string("The map's blocksize is not supported."));
|
||||
}
|
||||
|
||||
// Read those values before setting defaults
|
||||
bool player_backend_exists = conf.exists("player_backend");
|
||||
bool auth_backend_exists = conf.exists("auth_backend");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue