Oh
The size of the string is entirely not the issue; you can reliably hash a string that's 1GB in size and get the same result every time
Didn't want to here that.
Both of the string keys are the same I checked with a break point.
the UUID stored on file is in the form of {1C539C5A-BC4B-40B0-A612-21F61BF6BDE6}. The user who defines what app they want to run on the server fills this file out
they will then need the converter.exe that reads each line from the guid file just defined as a text file.
what the converter does is reads line by line each line gets put to boost::uuid::string_generator which accepts a range of string guids the one above is fine
and converts it to a lower case format with out the {} this 1c539c5a-bc4b-40b0-a612-21f61bf6bdE6 then this is now the key for adding and finding.
Saving and loading is done by google protocol buffers and data checks out fine.
Now the code that uses the string guid has a loadallowedapplications and a SupportedAplication which can't find the key
.
//---------------------------------------------------------------------------
//this will load the .ala file that has allowed application guids and names
//-----------------------------------------------------------------------------
bool LoadAllowedHostedApplications(std::string &filename)
{
std::string appguid;
std::string appname;
AllowedApps.Clear();
//load the .ala file
std::fstream input(filename, std::ios::in | std::ios::binary);
if(!AllowedApps.ParseFromIstream(&input))
{
return false;//error
}
input.close();
cSupportedApps sa;
//we need to run the loaded guid through the gen to remove the {}
boost::uuids::string_generator gen;
boost::uuids::uuid u1;// = gen(appguid);
std::stringstream ss;
//testing loading by hand
for(size_t ctr = 0; ctr < AllowedApps.appguid_size(); ++ctr)
{
appguid = AllowedApps.appguid(ctr);
appname = AllowedApps.appname(ctr);
u1 = gen(appguid);//the removes the {}
ss.str("");
ss << u1;
sa.AppGuid = ss.str();
sa.AppName = appname;
sa.AvailableRoomLobby = boost::make_shared<cAvailableRoomLobbyServer>();
//add new allowed app to the set
AvailableApplications[u1] = sa;
}
return true;
}//end LoadAllowedHostedApplications
/////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
..the supported application
.
//------------------------------------------------------------------------------
//this returns true if the passed in guid is supported by the server
//------------------------------------------------------------------------------
bool SupportedAplication(std::string &appguid)
{
if(appguid.empty())
return false;//error
boost::uuids::string_generator gen;
boost::uuids::uuid u1 = gen(appguid);
//all we need to do is find the app guid if its there we can use this app on this server
auto search = AvailableApplications.find(u1);//appguid);
if(search == AvailableApplications.end())
{
return false;//failed
}
return true;//we can use it
}//end SupportedAplication
///////////////////////////////////////////////////////////////////////////////////