1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 19:29:09 +00:00

Convert plUoid's object name to a plString

This commit is contained in:
2012-01-28 16:24:20 -08:00
parent 442a733fbb
commit e34414889f
122 changed files with 810 additions and 842 deletions

View File

@ -99,7 +99,7 @@ namespace plSDL
kDisallowTimeStamping = 0x1,
};
extern const char* kAgeSDLObjectName;
extern const plString kAgeSDLObjectName;
void VariableLengthRead(hsStream* s, int size, int* val);
void VariableLengthWrite(hsStream* s, int size, int val);
};
@ -304,7 +304,7 @@ public:
const plUnifiedTime& GetTimeStamp() const { return fTimeStamp; }
// Special backdoor so the KI Manager can get the key name without having a ResMgr
const char* GetKeyName(int idx=0) const;
plString GetKeyName(int idx=0) const;
int GetCount() const { return fVar.GetCount(); } // helper
plVarDescriptor* GetVarDescriptor() { return &fVar; }

View File

@ -49,7 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plNetMessage/plNetMessage.h"
#include "pnNetCommon/plNetApp.h"
const char* plSDL::kAgeSDLObjectName = {"AgeSDLHook"};
const plString plSDL::kAgeSDLObjectName = _TEMP_CONVERT_FROM_LITERAL("AgeSDLHook");
// static
const UInt8 plStateDataRecord::kIOVersion=6;
@ -734,19 +734,19 @@ void plStateDataRecord::DumpToObjectDebugger(const char* msg, bool dirtyOnly, in
if (!dbg)
return;
std::string pad;
plString pad;
int i;
for(i=0;i<level; i++)
pad += " ";
pad += _TEMP_CONVERT_FROM_LITERAL(" ");
int numVars = dirtyOnly ? GetNumDirtyVars() : GetNumUsedVars();
int numSDVars = dirtyOnly ? GetNumDirtySDVars() : GetNumUsedSDVars();
dbg->LogMsg(xtl::format("%s", fAssocObject.IsValid() ? fAssocObject.GetObjectName() : " ").c_str());
dbg->LogMsg(plString::Format("%s", fAssocObject.IsValid() ? fAssocObject.GetObjectName().c_str() : " ").c_str());
if (msg)
dbg->LogMsg(xtl::format("%s%s", pad.c_str(),msg).c_str());
dbg->LogMsg(plString::Format("%s%s", pad.c_str(),msg).c_str());
dbg->LogMsg(xtl::format("%sSDR(%p), desc=%s, showDirty=%d, numVars=%d, vol=%d",
dbg->LogMsg(plString::Format("%sSDR(%p), desc=%s, showDirty=%d, numVars=%d, vol=%d",
pad.c_str(), this, fDescriptor->GetName(), dirtyOnly, numVars+numSDVars, fFlags&kVolatile).c_str());
// dump simple vars
@ -778,17 +778,17 @@ void plStateDataRecord::DumpToStream(hsStream* stream, const char* msg, bool dir
int numVars = dirtyOnly ? GetNumDirtyVars() : GetNumUsedVars();
int numSDVars = dirtyOnly ? GetNumDirtySDVars() : GetNumUsedSDVars();
std::string logStr = xtl::format("%s", fAssocObject.IsValid() ? fAssocObject.GetObjectName() : " ");
plString logStr = plString::Format("%s", fAssocObject.IsValid() ? fAssocObject.GetObjectName().c_str() : " ");
stream->Write(logStr.length(), logStr.c_str());
stream->Write(logStr.GetSize(), logStr.c_str());
if (msg)
{
logStr = xtl::format("%s%s", pad.c_str(),msg);
stream->Write(logStr.length(), logStr.c_str());
logStr = plString::Format("%s%s", pad.c_str(),msg);
stream->Write(logStr.GetSize(), logStr.c_str());
}
logStr = xtl::format("%sSDR(%p), desc=%s, showDirty=%d, numVars=%d, vol=%d", pad.c_str(), this, fDescriptor->GetName(), dirtyOnly, numVars+numSDVars, fFlags&kVolatile);
stream->Write(logStr.length(), logStr.c_str());
logStr = plString::Format("%sSDR(%p), desc=%s, showDirty=%d, numVars=%d, vol=%d", pad.c_str(), this, fDescriptor->GetName(), dirtyOnly, numVars+numSDVars, fFlags&kVolatile);
stream->Write(logStr.GetSize(), logStr.c_str());
// dump simple vars
for(i=0;i<fVarsList.size(); i++)
@ -808,8 +808,8 @@ void plStateDataRecord::DumpToStream(hsStream* stream, const char* msg, bool dir
}
}
logStr = '\n';
stream->Write(logStr.length(), logStr.c_str());
logStr = _TEMP_CONVERT_FROM_LITERAL("\n");
stream->Write(logStr.GetSize(), logStr.c_str());
}
void plStateDataRecord::SetFromDefaults(bool timeStampNow)

View File

@ -1719,7 +1719,7 @@ bool plSimpleStateVariable::Get(plKey* value, int idx) const
if (*value)
{
const plUoid& newUoid = (*value)->GetUoid();
if (stricmp(newUoid.GetObjectName(), fU[idx].GetObjectName()) != 0)
if (newUoid.GetObjectName().Compare(fU[idx].GetObjectName(), plString::kCaseInsensitive) != 0)
{
// uoid names don't match... chances are the key changed in the local data after the key was written to the sdl
// do a search by name, which takes longer, to get the correct key
@ -1780,7 +1780,7 @@ bool plSimpleStateVariable::Get(plCreatable** value, int idx) const
/////////////////////////////////////////////////////////////
const char* plSimpleStateVariable::GetKeyName(int idx) const
plString plSimpleStateVariable::GetKeyName(int idx) const
{
if (fVar.GetAtomicType()==plVarDescriptor::kKey)
{
@ -1790,7 +1790,7 @@ const char* plSimpleStateVariable::GetKeyName(int idx) const
}
}
hsAssert(false, "passing wrong value type to SDL variable");
return "(nil)";
return _TEMP_CONVERT_FROM_LITERAL("(nil)");
}
#pragma optimize( "g", off ) // disable float optimizations