More string handling updates

Fixed an issue where 'get command attempts to retrieve incorrect property when isonline parameter is provided
	Fixed an issue where 'set weightmax # would fail because script used an incorrect property name
	Fixed an issue with check for allowed/banned equipment for races; if a list of allowed equipment existed, it would never check the banned list
	Additional string handling modernization in cHTMLSystem.cpp, cRaces.cpp, gumps.cpp, townregion.cpp and uox3.cpp (punt)p

Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
This commit is contained in:
Xoduz 2021-04-26 00:42:07 +08:00
parent 4729cb8fe5
commit 80d2420024
7 changed files with 485 additions and 234 deletions

View file

@ -28,7 +28,7 @@ cHTMLTemplate::~cHTMLTemplate()
}
UString GetUptime( void )
std::string GetUptime( void )
{
UI32 total = (cwmWorldState->GetUICurrentTime() - cwmWorldState->GetStartTime() ) / 1000;
UI32 ho = total / 3600;
@ -37,15 +37,21 @@ UString GetUptime( void )
total -= mi * 60;
UI32 se = total;
total = 0;
UString builtString = "";
std::string builtString = "";
if( ho < 10 )
{
builtString += std::string("0");
}
builtString += str_number( ho ) + ":";
if( mi < 10 )
{
builtString += std::string("0");
}
builtString += str_number( mi ) + std::string(":");
if( se < 10 )
{
builtString += std::string("0");
}
builtString += str_number( se );
return builtString;
}
@ -523,7 +529,7 @@ void cHTMLTemplate::Process( void )
Pos = ParsedContent.find( "%uptime" );
while( Pos != std::string::npos )
{
UString builtString = GetUptime();
std::string builtString = GetUptime();
ParsedContent.replace( Pos, 7, builtString );
Pos = ParsedContent.find( "%uptime" );
}