1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Almost support loading sounds from server

This commit is contained in:
Perttu Ahola 2012-03-25 14:47:51 +03:00
parent 524c78a8d6
commit 1cac1de3b2
9 changed files with 183 additions and 186 deletions

View file

@ -51,6 +51,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "utility_string.h"
#include "sound.h" // dummySoundManager
#include "event_manager.h"
#include "hex.h"
#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
@ -3996,14 +3997,13 @@ void Server::fillMediaCache()
sha1.addBytes(tmp_os.str().c_str(), tmp_os.str().length());
unsigned char *digest = sha1.getDigest();
std::string digest_string = base64_encode(digest, 20);
std::string sha1_base64 = base64_encode(digest, 20);
std::string sha1_hex = hex_encode((char*)digest, 20);
free(digest);
// Put in list
this->m_media[filename] = MediaInfo(filepath, digest_string);
verbosestream<<"Server: sha1 for "<<filename<<"\tis "
<<digest_string<<std::endl;
this->m_media[filename] = MediaInfo(filepath, sha1_base64);
verbosestream<<"Server: "<<sha1_hex<<" is "<<filename<<std::endl;
}
}
}