1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Review apply.

This commit is contained in:
SFENCE 2025-06-23 07:39:00 +02:00
parent 0fec74cbed
commit 77f05b5f73
3 changed files with 4 additions and 6 deletions

View file

@ -183,6 +183,7 @@ private:
std::string generateUpdatePhysicsOverrideCommand() const; std::string generateUpdatePhysicsOverrideCommand() const;
RemotePlayer *m_player = nullptr; RemotePlayer *m_player = nullptr;
// Replace with m_player->getName method from m_player cause SIGSEG
std::string m_player_name; ///< used as GUID std::string m_player_name; ///< used as GUID
session_t m_peer_id_initial = 0; ///< only used to initialize RemotePlayer session_t m_peer_id_initial = 0; ///< only used to initialize RemotePlayer

View file

@ -29,11 +29,8 @@ void MyGUID::deSerialize(std::istream &is)
GUIDGenerator::GUIDGenerator() : GUIDGenerator::GUIDGenerator() :
m_uniform(0, UINT64_MAX) m_uniform(0, UINT64_MAX)
{ {
if (m_rand.entropy() <= 0.01) std::random_device rd;
warningstream << m_rand.seed(rd());
"The system's provided random generator reports low entropy."
"GUID generator can be affected. Suggest a system upgrade."
<< std::endl;
} }
MyGUID GUIDGenerator::next() MyGUID GUIDGenerator::next()

View file

@ -42,6 +42,6 @@ public:
private: private:
std::random_device m_rand; std::mt19937_64 m_rand;
std::uniform_int_distribution<u64> m_uniform; std::uniform_int_distribution<u64> m_uniform;
}; };