diff --git a/code/nel/include/nel/misc/path.h b/code/nel/include/nel/misc/path.h index de46532b7..5a9c417a2 100644 --- a/code/nel/include/nel/misc/path.h +++ b/code/nel/include/nel/misc/path.h @@ -279,8 +279,8 @@ private: struct CMCFileEntry { char *Name; // Normal case (the search is done by using nlstricmp) - uint32 idPath : 20; // Path (not with file at the end) - look in the SSMpath (1048576 different path allowed) - uint32 idExt : 11; // real extension of the file if remapped - look in the SSMext (2048 different extension allowed) + uint32 idPath : 16; // Path (not with file at the end) - look in the SSMpath (65536 different path allowed) + uint32 idExt : 15; // real extension of the file if remapped - look in the SSMext (32768 different extension allowed) uint32 Remapped : 1; // true if the file is remapped }; diff --git a/code/nel/include/nel/misc/sha1.h b/code/nel/include/nel/misc/sha1.h index 33db14f75..1b773a5c3 100644 --- a/code/nel/include/nel/misc/sha1.h +++ b/code/nel/include/nel/misc/sha1.h @@ -92,6 +92,11 @@ struct CHashKey return HashKeyString == v.HashKeyString; } + bool operator!=(const CHashKey &v) const + { + return !(*this == v); + } + // this string is always 20 bytes long and is the code in binary format (can't print it directly) std::string HashKeyString; }; diff --git a/code/ryzom/server/src/entities_game_service/admin.cpp b/code/ryzom/server/src/entities_game_service/admin.cpp index a969b3c19..d259140ae 100644 --- a/code/ryzom/server/src/entities_game_service/admin.cpp +++ b/code/ryzom/server/src/entities_game_service/admin.cpp @@ -4646,6 +4646,7 @@ NLMISC_COMMAND (setSalt, "Set Salt", " ") return true; } +#ifdef RYZOM_FORGE // !!! Deprecated !!! NLMISC_COMMAND (webAddCommandsIds, "Add ids of commands will be run from webig", " ") { @@ -4688,6 +4689,7 @@ NLMISC_COMMAND (webDelCommandsIds, "Del ids of commands", " sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=deleted", getSalt()); return true; } +#endif CInventoryPtr getInv(CCharacter *c, const string &inv) { @@ -4717,6 +4719,7 @@ CInventoryPtr getInv(CCharacter *c, const string &inv) return inventoryPtr; } +#ifdef RYZOM_FORGE NLMISC_COMMAND (webExecCommand, "Execute a web command", " [] [] []") { @@ -4757,7 +4760,8 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " infos; CGameItemPtr item; @@ -4785,9 +4789,9 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " getLastConnectedDate()) + index + command + toString(c->getEntityRowId().getIndex()); - string realhmacEid = getHMacSHA1((uint8*)&checksumEid[0], checksumEid.size(), (uint8*)&salt[0], salt.size()).toString(); - string realhmacRowId = getHMacSHA1((uint8*)&checksumRowId[0], checksumRowId.size(), (uint8*)&salt[0], salt.size()).toString(); - if (realhmacEid != hmac && realhmacRowId != hmac && command != "is_valid_index") + NLMISC::CHashKey realhmacEid = NLMISC::getHMacSHA1((uint8*)&checksumEid[0], checksumEid.size(), (uint8*)&salt[0], salt.size()); + NLMISC::CHashKey realhmacRowId = NLMISC::getHMacSHA1((uint8*)&checksumRowId[0], checksumRowId.size(), (uint8*)&salt[0], salt.size()); + if (realhmacEid != hmacBin && realhmacRowId != hmacBin && command != "is_valid_index") { if (send_url) c->sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=failed&desc=bad_auth", getSalt()); @@ -6765,6 +6769,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " &selectedPhrases, EGSPD::CPeople::TPeople people = EGSPD::CPeople::Common, bool bypassBrickRequirements = false, bool includeNonRolemasterBricks = true );