mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Merge remote-tracking branch 'upstream/master' into Visuals-Vol-2
This commit is contained in:
commit
e7c7441429
285 changed files with 8894 additions and 4654 deletions
|
@ -21,6 +21,7 @@
|
|||
#include "filesys.h"
|
||||
#include "mapblock.h"
|
||||
#include "server/serveractiveobject.h"
|
||||
#include "serialization.h" // SER_FMT_VER_INVALID
|
||||
#include "settings.h"
|
||||
#include "profiler.h"
|
||||
#include "log.h"
|
||||
|
@ -43,7 +44,7 @@
|
|||
#include "defaultsettings.h"
|
||||
#include "server/mods.h"
|
||||
#include "util/base64.h"
|
||||
#include "util/sha1.h"
|
||||
#include "util/hashing.h"
|
||||
#include "util/hex.h"
|
||||
#include "database/database.h"
|
||||
#include "chatmessage.h"
|
||||
|
@ -2557,14 +2558,11 @@ bool Server::addMediaFile(const std::string &filename,
|
|||
return false;
|
||||
}
|
||||
|
||||
SHA1 sha1;
|
||||
sha1.addBytes(filedata);
|
||||
|
||||
std::string digest = sha1.getDigest();
|
||||
std::string sha1_base64 = base64_encode(digest);
|
||||
std::string sha1_hex = hex_encode(digest);
|
||||
std::string sha1 = hashing::sha1(filedata);
|
||||
std::string sha1_base64 = base64_encode(sha1);
|
||||
std::string sha1_hex = hex_encode(sha1);
|
||||
if (digest_to)
|
||||
*digest_to = digest;
|
||||
*digest_to = sha1;
|
||||
|
||||
// Put in list
|
||||
m_media[filename] = MediaInfo(filepath, sha1_base64);
|
||||
|
@ -3872,9 +3870,14 @@ void Server::addShutdownError(const ModError &e)
|
|||
v3f Server::findSpawnPos()
|
||||
{
|
||||
ServerMap &map = m_env->getServerMap();
|
||||
v3f nodeposf;
|
||||
if (g_settings->getV3FNoEx("static_spawnpoint", nodeposf))
|
||||
return nodeposf * BS;
|
||||
|
||||
std::optional<v3f> staticSpawnPoint;
|
||||
if (g_settings->getV3FNoEx("static_spawnpoint", staticSpawnPoint) && staticSpawnPoint.has_value())
|
||||
{
|
||||
return *staticSpawnPoint * BS;
|
||||
}
|
||||
|
||||
v3f nodeposf;
|
||||
|
||||
bool is_good = false;
|
||||
// Limit spawn range to mapgen edges (determined by 'mapgen_limit')
|
||||
|
@ -4201,7 +4204,7 @@ ModStorageDatabase *Server::openModStorageDatabase(const std::string &world_path
|
|||
warningstream << "/!\\ You are using the old mod storage files backend. "
|
||||
<< "This backend is deprecated and may be removed in a future release /!\\"
|
||||
<< std::endl << "Switching to SQLite3 is advised, "
|
||||
<< "please read http://wiki.minetest.net/Database_backends." << std::endl;
|
||||
<< "please read https://wiki.luanti.org/Database_backends." << std::endl;
|
||||
|
||||
return openModStorageDatabase(backend, world_path, world_mt);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue