mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-01 06:00:15 +02:00
fix salt issue, for future reference
This commit is contained in:
@@ -187,8 +187,8 @@ GameController::GameController():
|
|||||||
|
|
||||||
std::string expectedsalt = SALT;
|
std::string expectedsalt = SALT;
|
||||||
if (Client::Ref().GetAuthUser().UserID)
|
if (Client::Ref().GetAuthUser().UserID)
|
||||||
expectedsalt += "-" + Client::Ref().GetAuthUser().UserID;
|
expectedsalt += "-" + format::NumberToString<int>(Client::Ref().GetAuthUser().UserID);
|
||||||
expectedsalt += "-" + coins;
|
expectedsalt += "-" + format::NumberToString<int>(coins);
|
||||||
|
|
||||||
char saltMd5[33];
|
char saltMd5[33];
|
||||||
md5_ascii(saltMd5, (const unsigned char *)expectedsalt.c_str(), expectedsalt.length());
|
md5_ascii(saltMd5, (const unsigned char *)expectedsalt.c_str(), expectedsalt.length());
|
||||||
@@ -302,8 +302,8 @@ GameController::~GameController()
|
|||||||
Client::Ref().SetPref("Coins.coins", coins);
|
Client::Ref().SetPref("Coins.coins", coins);
|
||||||
std::string salt = SALT;
|
std::string salt = SALT;
|
||||||
if (Client::Ref().GetAuthUser().UserID)
|
if (Client::Ref().GetAuthUser().UserID)
|
||||||
salt += "-" + Client::Ref().GetAuthUser().UserID;
|
salt += "-" + format::NumberToString<int>(Client::Ref().GetAuthUser().UserID);
|
||||||
salt += "-" + coins;
|
salt += "-" + format::NumberToString<int>(coins);
|
||||||
|
|
||||||
char saltMd5[33];
|
char saltMd5[33];
|
||||||
md5_ascii(saltMd5, (const unsigned char *)salt.c_str(), salt.length());
|
md5_ascii(saltMd5, (const unsigned char *)salt.c_str(), salt.length());
|
||||||
|
Reference in New Issue
Block a user