mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-08 03:34:10 +00:00
feat: upgrade session keys to use mersenne twister (#1155)
* upgrade session keys to use mersenne twister * arithmetic type static assert and windows min/max macro undef
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "ZoneInstanceManager.h"
|
||||
#include "MD5.h"
|
||||
#include "SHA512.h"
|
||||
#include "GeneralUtils.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <bcrypt/BCrypt.hpp>
|
||||
@@ -211,7 +212,7 @@ void AuthPackets::SendLoginResponse(dServer* server, const SystemAddress& sysAdd
|
||||
packet.Write(static_cast<uint16_t>(64)); // Version Minor
|
||||
|
||||
// Writes the user key
|
||||
uint32_t sessionKey = rand(); // not mt but whatever
|
||||
uint32_t sessionKey = GeneralUtils::GenerateRandomNumber<uint32_t>();
|
||||
std::string userHash = std::to_string(sessionKey);
|
||||
userHash = md5(userHash);
|
||||
PacketUtils::WritePacketWString(userHash, 33, &packet);
|
||||
|
Reference in New Issue
Block a user