Browse Source

Age Link info names => plString

Michael Hansen 11 years ago
parent
commit
ef04cfcf84
  1. 26
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp
  2. 4
      Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
  3. 2
      Sources/Plasma/FeatureLib/pfPython/cyMisc.h
  4. 2
      Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp
  5. 54
      Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp
  6. 28
      Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h
  7. 14
      Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStructGlue.cpp
  8. 16
      Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h
  9. 8
      Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfoGlue.cpp
  10. 8
      Sources/Plasma/FeatureLib/pfPython/pyVault.cpp
  11. 6
      Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h
  12. 11
      Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp
  13. 8
      Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.h
  14. 40
      Sources/Plasma/PubUtilLib/plMessage/plInputIfaceMgrMsg.h
  15. 14
      Sources/Plasma/PubUtilLib/plNetClient/plLinkEffectsMgr.cpp
  16. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp
  17. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.h
  18. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.cpp
  19. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.h
  20. 24
      Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp
  21. 4
      Sources/Plasma/PubUtilLib/plNetCommon/plNetMsgScreener.cpp
  22. 2
      Sources/Plasma/PubUtilLib/plNetCommon/plNetMsgScreener.h
  23. 58
      Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp
  24. 49
      Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h
  25. 3
      Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp

26
Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp

@ -336,7 +336,7 @@ PF_CONSOLE_CMD( Net, // groupName
"Link to an age." ) // helpString "Link to an age." ) // helpString
{ {
plAgeLinkStruct link; plAgeLinkStruct link;
link.GetAgeInfo()->SetAgeFilename( params[0] ); link.GetAgeInfo()->SetAgeFilename( (const char *)params[0] );
link.SetLinkingRules( plNetCommon::LinkingRules::kBasicLink ); link.SetLinkingRules( plNetCommon::LinkingRules::kBasicLink );
plNetLinkingMgr::GetInstance()->LinkToAge( &link ); plNetLinkingMgr::GetInstance()->LinkToAge( &link );
PrintString("Linking to age..."); PrintString("Linking to age...");
@ -350,7 +350,7 @@ PF_CONSOLE_CMD( Net, // groupName
"Link to a specific age by guid." ) // helpString "Link to a specific age by guid." ) // helpString
{ {
plAgeLinkStruct link; plAgeLinkStruct link;
link.GetAgeInfo()->SetAgeFilename( params[0] ); link.GetAgeInfo()->SetAgeFilename( (const char *)params[0] );
//link.GetAgeInfo()->SetAgeInstanceName( params[0] ); //link.GetAgeInfo()->SetAgeInstanceName( params[0] );
//link.GetAgeInfo()->SetAgeUserDefinedName( params[0] ); //link.GetAgeInfo()->SetAgeUserDefinedName( params[0] );
plUUID guid( (const char *)params[1] ); plUUID guid( (const char *)params[1] );
@ -375,7 +375,7 @@ PF_CONSOLE_CMD( Net,
"Link to specified age using Original Age Linking Book rules" ) "Link to specified age using Original Age Linking Book rules" )
{ {
plAgeLinkStruct link; plAgeLinkStruct link;
link.GetAgeInfo()->SetAgeFilename( params[0] ); link.GetAgeInfo()->SetAgeFilename( (const char *)params[0] );
link.SpawnPoint() = plSpawnPointInfo( (const char *)params[1], (const char *)params[1] ); link.SpawnPoint() = plSpawnPointInfo( (const char *)params[1], (const char *)params[1] );
link.SetLinkingRules( plNetCommon::LinkingRules::kOriginalBook ); link.SetLinkingRules( plNetCommon::LinkingRules::kOriginalBook );
plNetLinkingMgr::GetInstance()->LinkToAge( &link ); plNetLinkingMgr::GetInstance()->LinkToAge( &link );
@ -388,7 +388,7 @@ PF_CONSOLE_CMD( Net,
"Link to specified age using Personal Age Linking Book rules" ) "Link to specified age using Personal Age Linking Book rules" )
{ {
plAgeLinkStruct link; plAgeLinkStruct link;
link.GetAgeInfo()->SetAgeFilename( params[0] ); link.GetAgeInfo()->SetAgeFilename( (const char *)params[0] );
link.SetLinkingRules( plNetCommon::LinkingRules::kOwnedBook ); link.SetLinkingRules( plNetCommon::LinkingRules::kOwnedBook );
plNetLinkingMgr::GetInstance()->LinkToAge( &link ); plNetLinkingMgr::GetInstance()->LinkToAge( &link );
PrintString("Linking to age I own..."); PrintString("Linking to age I own...");
@ -400,7 +400,7 @@ PF_CONSOLE_CMD( Net,
"Link to specified age using Personal Age Linking Book rules" ) "Link to specified age using Personal Age Linking Book rules" )
{ {
plAgeLinkStruct link; plAgeLinkStruct link;
link.GetAgeInfo()->SetAgeFilename( params[0] ); link.GetAgeInfo()->SetAgeFilename( (const char *)params[0] );
link.SetLinkingRules( plNetCommon::LinkingRules::kVisitBook ); link.SetLinkingRules( plNetCommon::LinkingRules::kVisitBook );
plNetLinkingMgr::GetInstance()->LinkToAge( &link ); plNetLinkingMgr::GetInstance()->LinkToAge( &link );
PrintString("Linking to age I can visit..."); PrintString("Linking to age I can visit...");
@ -412,7 +412,7 @@ PF_CONSOLE_CMD( Net,
"Link to a sub-age of the current age" ) "Link to a sub-age of the current age" )
{ {
plAgeLinkStruct link; plAgeLinkStruct link;
link.GetAgeInfo()->SetAgeFilename( params[0] ); link.GetAgeInfo()->SetAgeFilename( (const char *)params[0] );
link.SetLinkingRules( plNetCommon::LinkingRules::kSubAgeBook ); link.SetLinkingRules( plNetCommon::LinkingRules::kSubAgeBook );
plNetLinkingMgr::GetInstance()->LinkToAge( &link ); plNetLinkingMgr::GetInstance()->LinkToAge( &link );
PrintString("Linking to a sub-age..."); PrintString("Linking to a sub-age...");
@ -481,7 +481,7 @@ PF_CONSOLE_CMD( Net,
plNetLinkingMgr * lm = plNetLinkingMgr::GetInstance(); plNetLinkingMgr * lm = plNetLinkingMgr::GetInstance();
plAgeInfoStruct info; plAgeInfoStruct info;
info.SetAgeFilename( params[0] ); info.SetAgeFilename( (const char *)params[0] );
plAgeLinkStruct link; plAgeLinkStruct link;
if (!VaultGetOwnedAgeLink(&info, &link)) { if (!VaultGetOwnedAgeLink(&info, &link)) {
@ -806,8 +806,8 @@ PF_CONSOLE_CMD( Net_Vault,
"Add an instance of the specified age to your bookshelf" ) "Add an instance of the specified age to your bookshelf" )
{ {
plAgeLinkStruct link; plAgeLinkStruct link;
link.GetAgeInfo()->SetAgeFilename( params[0] ); link.GetAgeInfo()->SetAgeFilename( (const char *)params[0] );
link.GetAgeInfo()->SetAgeInstanceName( params[0] ); link.GetAgeInfo()->SetAgeInstanceName( (const char *)params[0] );
plUUID guid = plUUID::Generate(); plUUID guid = plUUID::Generate();
link.GetAgeInfo()->SetAgeInstanceGuid( &guid); link.GetAgeInfo()->SetAgeInstanceGuid( &guid);
link.SetSpawnPoint( kDefaultSpawnPoint ); link.SetSpawnPoint( kDefaultSpawnPoint );
@ -822,7 +822,7 @@ PF_CONSOLE_CMD( Net_Vault,
"Remove the specified age from your bookshelf" ) "Remove the specified age from your bookshelf" )
{ {
plAgeInfoStruct info; plAgeInfoStruct info;
info.SetAgeFilename( params[0] ); info.SetAgeFilename( (const char *)params[0] );
bool success = VaultUnregisterOwnedAgeAndWait(&info); bool success = VaultUnregisterOwnedAgeAndWait(&info);
PrintStringF(PrintString, "Operation %s.", success ? "Successful" : "Failed"); PrintStringF(PrintString, "Operation %s.", success ? "Successful" : "Failed");
} }
@ -834,8 +834,8 @@ PF_CONSOLE_CMD( Net_Vault,
"Add an instance of the specified age to your private links" ) "Add an instance of the specified age to your private links" )
{ {
plAgeLinkStruct link; plAgeLinkStruct link;
link.GetAgeInfo()->SetAgeFilename( params[0] ); link.GetAgeInfo()->SetAgeFilename( (const char *)params[0] );
link.GetAgeInfo()->SetAgeInstanceName( params[0] ); link.GetAgeInfo()->SetAgeInstanceName( (const char *)params[0] );
plUUID guid = plUUID::Generate(); plUUID guid = plUUID::Generate();
link.GetAgeInfo()->SetAgeInstanceGuid( &guid); link.GetAgeInfo()->SetAgeInstanceGuid( &guid);
link.SetSpawnPoint( kDefaultSpawnPoint ); link.SetSpawnPoint( kDefaultSpawnPoint );
@ -850,7 +850,7 @@ PF_CONSOLE_CMD( Net_Vault,
"Remove all instances of the specified age from your private links" ) "Remove all instances of the specified age from your private links" )
{ {
plAgeInfoStruct info; plAgeInfoStruct info;
info.SetAgeFilename( params[0] ); info.SetAgeFilename( (const char *)params[0] );
unsigned count = 0; unsigned count = 0;
while (VaultUnregisterVisitAgeAndWait(&info)) while (VaultUnregisterVisitAgeAndWait(&info))

4
Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp

@ -632,7 +632,7 @@ PyObject* cyMisc::GetAgeInfo()
} }
const char* cyMisc::GetPrevAgeName() plString cyMisc::GetPrevAgeName()
{ {
plNetLinkingMgr* nmgr = plNetLinkingMgr::GetInstance(); plNetLinkingMgr* nmgr = plNetLinkingMgr::GetInstance();
if (nmgr) if (nmgr)
@ -641,7 +641,7 @@ const char* cyMisc::GetPrevAgeName()
if (als) if (als)
return als->GetAgeInfo()->GetAgeFilename(); return als->GetAgeInfo()->GetAgeFilename();
} }
return nil; return plString::Null;
} }
PyObject* cyMisc::GetPrevAgeInfo() PyObject* cyMisc::GetPrevAgeInfo()

2
Sources/Plasma/FeatureLib/pfPython/cyMisc.h

@ -300,7 +300,7 @@ public:
// //
static const char* GetAgeName(); static const char* GetAgeName();
static PyObject* GetAgeInfo(); // returns pyAgeInfoStruct static PyObject* GetAgeInfo(); // returns pyAgeInfoStruct
static const char* GetPrevAgeName(); static plString GetPrevAgeName();
static PyObject* GetPrevAgeInfo(); static PyObject* GetPrevAgeInfo();
// current time in current age // current time in current age
static uint32_t GetAgeTime( void ); static uint32_t GetAgeTime( void );

2
Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp

@ -68,7 +68,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION_NOARGS(PtGetAgeTime, "DEPRECIATED - use ptDniInf
PYTHON_GLOBAL_METHOD_DEFINITION_NOARGS(PtGetPrevAgeName, "Returns filename of previous age visited") PYTHON_GLOBAL_METHOD_DEFINITION_NOARGS(PtGetPrevAgeName, "Returns filename of previous age visited")
{ {
return PyString_FromString(cyMisc::GetPrevAgeName()); return PyString_FromPlString(cyMisc::GetPrevAgeName());
} }
PYTHON_GLOBAL_METHOD_DEFINITION_NOARGS(PtGetPrevAgeInfo, "Returns ptAgeInfoStruct of previous age visited") PYTHON_GLOBAL_METHOD_DEFINITION_NOARGS(PtGetPrevAgeInfo, "Returns ptAgeInfoStruct of previous age visited")

54
Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp

@ -81,42 +81,42 @@ void pyAgeInfoStruct::CopyFromRef( const pyAgeInfoStructRef & other )
fAgeInfo.CopyFrom( other.GetAgeInfo() ); fAgeInfo.CopyFrom( other.GetAgeInfo() );
} }
const char * pyAgeInfoStruct::GetAgeFilename() const plString pyAgeInfoStruct::GetAgeFilename() const
{ {
return fAgeInfo.GetAgeFilename(); return fAgeInfo.GetAgeFilename();
} }
void pyAgeInfoStruct::SetAgeFilename( const char * v ) void pyAgeInfoStruct::SetAgeFilename( const plString & v )
{ {
fAgeInfo.SetAgeFilename( v ); fAgeInfo.SetAgeFilename( v );
} }
const char * pyAgeInfoStruct::GetAgeInstanceName() const plString pyAgeInfoStruct::GetAgeInstanceName() const
{ {
return fAgeInfo.GetAgeInstanceName(); return fAgeInfo.GetAgeInstanceName();
} }
void pyAgeInfoStruct::SetAgeInstanceName( const char * v ) void pyAgeInfoStruct::SetAgeInstanceName( const plString & v )
{ {
fAgeInfo.SetAgeInstanceName( v ); fAgeInfo.SetAgeInstanceName( v );
} }
const char * pyAgeInfoStruct::GetAgeUserDefinedName() const plString pyAgeInfoStruct::GetAgeUserDefinedName() const
{ {
return fAgeInfo.GetAgeUserDefinedName(); return fAgeInfo.GetAgeUserDefinedName();
} }
void pyAgeInfoStruct::SetAgeUserDefinedName( const char * v ) void pyAgeInfoStruct::SetAgeUserDefinedName( const plString & v )
{ {
fAgeInfo.SetAgeUserDefinedName( v ); fAgeInfo.SetAgeUserDefinedName( v );
} }
const char * pyAgeInfoStruct::GetAgeDescription() const plString pyAgeInfoStruct::GetAgeDescription() const
{ {
return fAgeInfo.GetAgeDescription(); return fAgeInfo.GetAgeDescription();
} }
void pyAgeInfoStruct::SetAgeDescription( const char * v ) void pyAgeInfoStruct::SetAgeDescription( const plString & v )
{ {
fAgeInfo.SetAgeDescription( v ); fAgeInfo.SetAgeDescription( v );
} }
@ -132,12 +132,12 @@ void pyAgeInfoStruct::SetAgeInstanceGuid( const char * guid )
if ( guid[0] == '@' ) if ( guid[0] == '@' )
{ {
// if it starts with an @ then do a meta kind of GUID // if it starts with an @ then do a meta kind of GUID
std::string curInst = fAgeInfo.GetAgeInstanceName(); plString curInst = fAgeInfo.GetAgeInstanceName();
std::string y = curInst + guid; plString y = curInst + guid;
plMD5Checksum hash; plMD5Checksum hash;
hash.Start(); hash.Start();
hash.AddTo(y.length(), (uint8_t*)y.c_str()); hash.AddTo(y.GetSize(), (uint8_t*)y.c_str());
hash.Finish(); hash.Finish();
const char* md5sum = hash.GetAsHexString(); const char* md5sum = hash.GetAsHexString();
@ -180,9 +180,9 @@ void pyAgeInfoStruct::SetAgeLanguage( int32_t v )
plString pyAgeInfoStruct::GetDisplayName() const plString pyAgeInfoStruct::GetDisplayName() const
{ {
const char* instance = GetAgeInstanceName(); plString instance = GetAgeInstanceName();
const char* user = GetAgeUserDefinedName(); plString user = GetAgeUserDefinedName();
bool namesEqual = (stricmp(user, instance) == 0); // Ae'gura Ae'gura bool namesEqual = (user.CompareI(instance) == 0); // Ae'gura Ae'gura
if (namesEqual) if (namesEqual)
return instance; return instance;
@ -190,9 +190,9 @@ plString pyAgeInfoStruct::GetDisplayName() const
{ {
int32_t seq = GetAgeSequenceNumber(); int32_t seq = GetAgeSequenceNumber();
if (seq > 0) if (seq > 0)
return plString::Format("%s (%d) %s", user, seq, instance); return plString::Format("%s (%d) %s", user.c_str(), seq, instance.c_str());
else else
return plString::Format("%s %s", user, instance); return plString::Format("%s %s", user.c_str(), instance.c_str());
} }
} }
@ -211,32 +211,32 @@ void pyAgeInfoStructRef::CopyFromRef( const pyAgeInfoStructRef & other )
fAgeInfo.CopyFrom( other.GetAgeInfo() ); fAgeInfo.CopyFrom( other.GetAgeInfo() );
} }
const char * pyAgeInfoStructRef::GetAgeFilename() const plString pyAgeInfoStructRef::GetAgeFilename() const
{ {
return fAgeInfo.GetAgeFilename(); return fAgeInfo.GetAgeFilename();
} }
void pyAgeInfoStructRef::SetAgeFilename( const char * v ) void pyAgeInfoStructRef::SetAgeFilename( const plString & v )
{ {
fAgeInfo.SetAgeFilename( v ); fAgeInfo.SetAgeFilename( v );
} }
const char * pyAgeInfoStructRef::GetAgeInstanceName() const plString pyAgeInfoStructRef::GetAgeInstanceName() const
{ {
return fAgeInfo.GetAgeInstanceName(); return fAgeInfo.GetAgeInstanceName();
} }
void pyAgeInfoStructRef::SetAgeInstanceName( const char * v ) void pyAgeInfoStructRef::SetAgeInstanceName( const plString & v )
{ {
fAgeInfo.SetAgeInstanceName( v ); fAgeInfo.SetAgeInstanceName( v );
} }
const char * pyAgeInfoStructRef::GetAgeUserDefinedName() const plString pyAgeInfoStructRef::GetAgeUserDefinedName() const
{ {
return fAgeInfo.GetAgeUserDefinedName(); return fAgeInfo.GetAgeUserDefinedName();
} }
void pyAgeInfoStructRef::SetAgeUserDefinedName( const char * v ) void pyAgeInfoStructRef::SetAgeUserDefinedName( const plString & v )
{ {
fAgeInfo.SetAgeUserDefinedName( v ); fAgeInfo.SetAgeUserDefinedName( v );
} }
@ -265,9 +265,9 @@ void pyAgeInfoStructRef::SetAgeSequenceNumber( int32_t v )
plString pyAgeInfoStructRef::GetDisplayName() const plString pyAgeInfoStructRef::GetDisplayName() const
{ {
const char* instance = GetAgeInstanceName(); plString instance = GetAgeInstanceName();
const char* user = GetAgeUserDefinedName(); plString user = GetAgeUserDefinedName();
bool namesEqual = (stricmp(user, instance) == 0); // Ae'gura Ae'gura bool namesEqual = (user.CompareI(instance) == 0); // Ae'gura Ae'gura
if (namesEqual) if (namesEqual)
return instance; return instance;
@ -275,8 +275,8 @@ plString pyAgeInfoStructRef::GetDisplayName() const
{ {
int32_t seq = GetAgeSequenceNumber(); int32_t seq = GetAgeSequenceNumber();
if (seq > 0) if (seq > 0)
return plString::Format("%s (%d) %s", user, seq, instance); return plString::Format("%s (%d) %s", user.c_str(), seq, instance.c_str());
else else
return plString::Format("%s %s", user, instance); return plString::Format("%s %s", user.c_str(), instance.c_str());
} }
} }

28
Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h

@ -87,14 +87,14 @@ public:
static void PythonModDef(); static void PythonModDef();
void CopyFrom( const pyAgeInfoStruct & other ); void CopyFrom( const pyAgeInfoStruct & other );
void CopyFromRef( const pyAgeInfoStructRef & other ); void CopyFromRef( const pyAgeInfoStructRef & other );
const char * GetAgeFilename() const; plString GetAgeFilename() const;
void SetAgeFilename( const char * v ); void SetAgeFilename( const plString & v );
const char * GetAgeInstanceName() const; plString GetAgeInstanceName() const;
void SetAgeInstanceName( const char * v ); void SetAgeInstanceName( const plString & v );
const char * GetAgeUserDefinedName() const; plString GetAgeUserDefinedName() const;
void SetAgeUserDefinedName( const char * v ); void SetAgeUserDefinedName( const plString & v );
const char * GetAgeDescription() const; plString GetAgeDescription() const;
void SetAgeDescription( const char * v ); void SetAgeDescription( const plString & v );
const char * GetAgeInstanceGuid() const; const char * GetAgeInstanceGuid() const;
void SetAgeInstanceGuid( const char * guid ); void SetAgeInstanceGuid( const char * guid );
int32_t GetAgeSequenceNumber() const; int32_t GetAgeSequenceNumber() const;
@ -132,12 +132,12 @@ public:
const plAgeInfoStruct * GetAgeInfo() const { return &fAgeInfo; } const plAgeInfoStruct * GetAgeInfo() const { return &fAgeInfo; }
void CopyFrom( const pyAgeInfoStruct & other ); void CopyFrom( const pyAgeInfoStruct & other );
void CopyFromRef( const pyAgeInfoStructRef & other ); void CopyFromRef( const pyAgeInfoStructRef & other );
const char * GetAgeFilename() const; plString GetAgeFilename() const;
void SetAgeFilename( const char * v ); void SetAgeFilename( const plString & v );
const char * GetAgeInstanceName() const; plString GetAgeInstanceName() const;
void SetAgeInstanceName( const char * v ); void SetAgeInstanceName( const plString & v );
const char * GetAgeUserDefinedName() const; plString GetAgeUserDefinedName() const;
void SetAgeUserDefinedName( const char * v ); void SetAgeUserDefinedName( const plString & v );
const char * GetAgeInstanceGuid() const; const char * GetAgeInstanceGuid() const;
void SetAgeInstanceGuid( const char * guid ); void SetAgeInstanceGuid( const char * guid );
int32_t GetAgeSequenceNumber() const; int32_t GetAgeSequenceNumber() const;

14
Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStructGlue.cpp

@ -115,7 +115,7 @@ PYTHON_METHOD_DEFINITION(ptAgeInfoStruct, copyFrom, args)
PYTHON_METHOD_DEFINITION_NOARGS(ptAgeInfoStruct, getAgeFilename) PYTHON_METHOD_DEFINITION_NOARGS(ptAgeInfoStruct, getAgeFilename)
{ {
return PyString_FromString(self->fThis->GetAgeFilename()); return PyString_FromPlString(self->fThis->GetAgeFilename());
} }
PYTHON_METHOD_DEFINITION(ptAgeInfoStruct, setAgeFilename, args) PYTHON_METHOD_DEFINITION(ptAgeInfoStruct, setAgeFilename, args)
@ -132,7 +132,7 @@ PYTHON_METHOD_DEFINITION(ptAgeInfoStruct, setAgeFilename, args)
PYTHON_METHOD_DEFINITION_NOARGS(ptAgeInfoStruct, getAgeInstanceName) PYTHON_METHOD_DEFINITION_NOARGS(ptAgeInfoStruct, getAgeInstanceName)
{ {
return PyString_FromString(self->fThis->GetAgeInstanceName()); return PyString_FromPlString(self->fThis->GetAgeInstanceName());
} }
PYTHON_METHOD_DEFINITION(ptAgeInfoStruct, setAgeInstanceName, args) PYTHON_METHOD_DEFINITION(ptAgeInfoStruct, setAgeInstanceName, args)
@ -149,7 +149,7 @@ PYTHON_METHOD_DEFINITION(ptAgeInfoStruct, setAgeInstanceName, args)
PYTHON_METHOD_DEFINITION_NOARGS(ptAgeInfoStruct, getAgeUserDefinedName) PYTHON_METHOD_DEFINITION_NOARGS(ptAgeInfoStruct, getAgeUserDefinedName)
{ {
return PyString_FromString(self->fThis->GetAgeUserDefinedName()); return PyString_FromPlString(self->fThis->GetAgeUserDefinedName());
} }
PYTHON_METHOD_DEFINITION(ptAgeInfoStruct, setAgeUserDefinedName, args) PYTHON_METHOD_DEFINITION(ptAgeInfoStruct, setAgeUserDefinedName, args)
@ -166,7 +166,7 @@ PYTHON_METHOD_DEFINITION(ptAgeInfoStruct, setAgeUserDefinedName, args)
PYTHON_METHOD_DEFINITION_NOARGS(ptAgeInfoStruct, getAgeDescription) PYTHON_METHOD_DEFINITION_NOARGS(ptAgeInfoStruct, getAgeDescription)
{ {
return PyString_FromString(self->fThis->GetAgeDescription()); return PyString_FromPlString(self->fThis->GetAgeDescription());
} }
PYTHON_METHOD_DEFINITION(ptAgeInfoStruct, setAgeDescription, args) PYTHON_METHOD_DEFINITION(ptAgeInfoStruct, setAgeDescription, args)
@ -325,7 +325,7 @@ PYTHON_METHOD_DEFINITION(ptAgeInfoStructRef, copyFrom, args)
PYTHON_METHOD_DEFINITION_NOARGS(ptAgeInfoStructRef, getAgeFilename) PYTHON_METHOD_DEFINITION_NOARGS(ptAgeInfoStructRef, getAgeFilename)
{ {
return PyString_FromString(self->fThis->GetAgeFilename()); return PyString_FromPlString(self->fThis->GetAgeFilename());
} }
PYTHON_METHOD_DEFINITION(ptAgeInfoStructRef, setAgeFilename, args) PYTHON_METHOD_DEFINITION(ptAgeInfoStructRef, setAgeFilename, args)
@ -342,7 +342,7 @@ PYTHON_METHOD_DEFINITION(ptAgeInfoStructRef, setAgeFilename, args)
PYTHON_METHOD_DEFINITION_NOARGS(ptAgeInfoStructRef, getAgeInstanceName) PYTHON_METHOD_DEFINITION_NOARGS(ptAgeInfoStructRef, getAgeInstanceName)
{ {
return PyString_FromString(self->fThis->GetAgeInstanceName()); return PyString_FromPlString(self->fThis->GetAgeInstanceName());
} }
PYTHON_METHOD_DEFINITION(ptAgeInfoStructRef, setAgeInstanceName, args) PYTHON_METHOD_DEFINITION(ptAgeInfoStructRef, setAgeInstanceName, args)
@ -359,7 +359,7 @@ PYTHON_METHOD_DEFINITION(ptAgeInfoStructRef, setAgeInstanceName, args)
PYTHON_METHOD_DEFINITION_NOARGS(ptAgeInfoStructRef, getAgeUserDefinedName) PYTHON_METHOD_DEFINITION_NOARGS(ptAgeInfoStructRef, getAgeUserDefinedName)
{ {
return PyString_FromString(self->fThis->GetAgeUserDefinedName()); return PyString_FromPlString(self->fThis->GetAgeUserDefinedName());
} }
PYTHON_METHOD_DEFINITION(ptAgeInfoStructRef, setAgeUserDefinedName, args) PYTHON_METHOD_DEFINITION(ptAgeInfoStructRef, setAgeUserDefinedName, args)

16
Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h

@ -76,9 +76,9 @@ public:
plNetServerSessionInfo & ServerInfo() { return fInfo; } plNetServerSessionInfo & ServerInfo() { return fInfo; }
void SetServerName(const char * val) { fInfo.SetServerName( val ); } void SetServerName(const plString & val) { fInfo.SetServerName( val ); }
void SetServerType(uint8_t val) { fInfo.SetServerType( val ); } void SetServerType(uint8_t val) { fInfo.SetServerType( val ); }
void SetServerAddr(const char * val) { fInfo.SetServerAddr( val ); } void SetServerAddr(const plString & val) { fInfo.SetServerAddr( val ); }
void SetServerPort(uint16_t val) { fInfo.SetServerPort( val ); } void SetServerPort(uint16_t val) { fInfo.SetServerPort( val ); }
void SetServerGuid(const char * val) { fServerGuid.FromString( val ); fInfo.SetServerGuid( &fServerGuid ); } void SetServerGuid(const char * val) { fServerGuid.FromString( val ); fInfo.SetServerGuid( &fServerGuid ); }
bool HasServerName() const { return fInfo.HasServerName(); } bool HasServerName() const { return fInfo.HasServerName(); }
@ -86,9 +86,9 @@ public:
bool HasServerAddr() const { return fInfo.HasServerAddr(); } bool HasServerAddr() const { return fInfo.HasServerAddr(); }
bool HasServerPort() const { return fInfo.HasServerPort(); } bool HasServerPort() const { return fInfo.HasServerPort(); }
bool HasServerGuid() const { return fInfo.HasServerGuid(); } bool HasServerGuid() const { return fInfo.HasServerGuid(); }
const char * GetServerName() const { return fInfo.GetServerName(); } plString GetServerName() const { return fInfo.GetServerName(); }
uint8_t GetServerType() const { return fInfo.GetServerType(); } uint8_t GetServerType() const { return fInfo.GetServerType(); }
const char * GetServerAddr() const { return fInfo.GetServerAddr(); } plString GetServerAddr() const { return fInfo.GetServerAddr(); }
uint16_t GetServerPort() const { return fInfo.GetServerPort(); } uint16_t GetServerPort() const { return fInfo.GetServerPort(); }
const char * GetServerGuid() const { fServerGuid.CopyFrom( fInfo.GetServerGuid() ); return fServerGuid.AsString().c_str(); } const char * GetServerGuid() const { fServerGuid.CopyFrom( fInfo.GetServerGuid() ); return fServerGuid.AsString().c_str(); }
}; };
@ -116,9 +116,9 @@ public:
static void AddPlasmaClasses(PyObject *m); static void AddPlasmaClasses(PyObject *m);
void SetServerName(const char * val) { fInfo.SetServerName( val ); } void SetServerName(const plString & val) { fInfo.SetServerName( val ); }
void SetServerType(uint8_t val) { fInfo.SetServerType( val ); } void SetServerType(uint8_t val) { fInfo.SetServerType( val ); }
void SetServerAddr(const char * val) { fInfo.SetServerAddr( val ); } void SetServerAddr(const plString & val) { fInfo.SetServerAddr( val ); }
void SetServerPort(uint16_t val) { fInfo.SetServerPort( val ); } void SetServerPort(uint16_t val) { fInfo.SetServerPort( val ); }
void SetServerGuid(const char * val) { fServerGuid.FromString( val ); fInfo.SetServerGuid( &fServerGuid ); } void SetServerGuid(const char * val) { fServerGuid.FromString( val ); fInfo.SetServerGuid( &fServerGuid ); }
bool HasServerName() const { return fInfo.HasServerName(); } bool HasServerName() const { return fInfo.HasServerName(); }
@ -126,9 +126,9 @@ public:
bool HasServerAddr() const { return fInfo.HasServerAddr(); } bool HasServerAddr() const { return fInfo.HasServerAddr(); }
bool HasServerPort() const { return fInfo.HasServerPort(); } bool HasServerPort() const { return fInfo.HasServerPort(); }
bool HasServerGuid() const { return fInfo.HasServerGuid(); } bool HasServerGuid() const { return fInfo.HasServerGuid(); }
const char * GetServerName() const { return fInfo.GetServerName(); } plString GetServerName() const { return fInfo.GetServerName(); }
uint8_t GetServerType() const { return fInfo.GetServerType(); } uint8_t GetServerType() const { return fInfo.GetServerType(); }
const char * GetServerAddr() const { return fInfo.GetServerAddr(); } plString GetServerAddr() const { return fInfo.GetServerAddr(); }
uint16_t GetServerPort() const { return fInfo.GetServerPort(); } uint16_t GetServerPort() const { return fInfo.GetServerPort(); }
const char * GetServerGuid() const { fServerGuid.CopyFrom( fInfo.GetServerGuid() ); return fServerGuid.AsString().c_str(); } const char * GetServerGuid() const { fServerGuid.CopyFrom( fInfo.GetServerGuid() ); return fServerGuid.AsString().c_str(); }
}; };

8
Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfoGlue.cpp

@ -143,7 +143,7 @@ PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, hasServerGuid)
PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, getServerName) PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, getServerName)
{ {
return PyString_FromString(self->fThis->GetServerName()); return PyString_FromPlString(self->fThis->GetServerName());
} }
PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, getServerType) PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, getServerType)
@ -153,7 +153,7 @@ PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, getServerType)
PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, getServerAddr) PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, getServerAddr)
{ {
return PyString_FromString(self->fThis->GetServerAddr()); return PyString_FromPlString(self->fThis->GetServerAddr());
} }
PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, getServerPort) PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfo, getServerPort)
@ -306,7 +306,7 @@ PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, hasServerGuid)
PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, getServerName) PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, getServerName)
{ {
return PyString_FromString(self->fThis->GetServerName()); return PyString_FromPlString(self->fThis->GetServerName());
} }
PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, getServerType) PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, getServerType)
@ -316,7 +316,7 @@ PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, getServerType)
PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, getServerAddr) PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, getServerAddr)
{ {
return PyString_FromString(self->fThis->GetServerAddr()); return PyString_FromPlString(self->fThis->GetServerAddr());
} }
PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, getServerPort) PYTHON_METHOD_DEFINITION_NOARGS(ptNetServerSessionInfoRef, getServerPort)

8
Sources/Plasma/FeatureLib/pfPython/pyVault.cpp

@ -671,18 +671,18 @@ void pyVault::CreateNeighborhood()
if (nc->GetPlayerName().CharAt(nameLen - 1) == 's' || nc->GetPlayerName().CharAt(nameLen - 1) == 'S') if (nc->GetPlayerName().CharAt(nameLen - 1) == 's' || nc->GetPlayerName().CharAt(nameLen - 1) == 'S')
{ {
title = plString::Format( "%s'", nc->GetPlayerName().c_str() ); title = plString::Format( "%s'", nc->GetPlayerName().c_str() );
desc = plString::Format( "%s' %s", nc->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName() ); desc = plString::Format( "%s' %s", nc->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName().c_str() );
} }
else else
{ {
title = plString::Format( "%s's", nc->GetPlayerName().c_str() ); title = plString::Format( "%s's", nc->GetPlayerName().c_str() );
desc = plString::Format( "%s's %s", nc->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName() ); desc = plString::Format( "%s's %s", nc->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName().c_str() );
} }
plUUID guid = plUUID::Generate(); plUUID guid = plUUID::Generate();
link.GetAgeInfo()->SetAgeInstanceGuid(&guid); link.GetAgeInfo()->SetAgeInstanceGuid(&guid);
link.GetAgeInfo()->SetAgeUserDefinedName( title.c_str() ); link.GetAgeInfo()->SetAgeUserDefinedName(title);
link.GetAgeInfo()->SetAgeDescription( desc.c_str() ); link.GetAgeInfo()->SetAgeDescription(desc);
VaultRegisterOwnedAge(&link); VaultRegisterOwnedAge(&link);
} }

6
Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h

@ -118,6 +118,12 @@ unsigned StrToAnsi (char * dest, const wchar_t source[], unsigned destChars, uns
unsigned StrToUnicode (wchar_t * dest, const char source[], unsigned destChars); unsigned StrToUnicode (wchar_t * dest, const char source[], unsigned destChars);
unsigned StrToUnicode (wchar_t * dest, const char source[], unsigned destChars, unsigned codePage); unsigned StrToUnicode (wchar_t * dest, const char source[], unsigned destChars, unsigned codePage);
// FIXME: Get rid of these
inline unsigned StrToUnicode(wchar_t * dest, const plString & source, unsigned destChars)
{ return StrToUnicode(dest, source.c_str(), destChars); }
inline unsigned StrToUnicode(wchar_t * dest, const plString & source, unsigned destChars, unsigned codePage)
{ return StrToUnicode(dest, source.c_str(), destChars, codePage); }
float StrToFloat (const char source[], const char ** endptr); float StrToFloat (const char source[], const char ** endptr);
float StrToFloat (const wchar_t source[], const wchar_t ** endptr); float StrToFloat (const wchar_t source[], const wchar_t ** endptr);

11
Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp

@ -108,7 +108,6 @@ bool plSceneInputInterface::fShowLOS = false;
plSceneInputInterface::plSceneInputInterface() plSceneInputInterface::plSceneInputInterface()
{ {
fPipe = nil; fPipe = nil;
fSpawnPoint = nil;
fAgeInstanceGuid.Clear(); fAgeInstanceGuid.Clear();
fInstance = this; fInstance = this;
SetEnabled( true ); // Always enabled SetEnabled( true ); // Always enabled
@ -840,11 +839,11 @@ void plSceneInputInterface::ILinkOffereeToAge()
unsigned nameLen = plNetClientMgr::GetInstance()->GetPlayerName().GetSize(); unsigned nameLen = plNetClientMgr::GetInstance()->GetPlayerName().GetSize();
if (plNetClientMgr::GetInstance()->GetPlayerName().CharAt(nameLen - 1) == 's' || plNetClientMgr::GetInstance()->GetPlayerName().CharAt(nameLen - 1) == 'S') { if (plNetClientMgr::GetInstance()->GetPlayerName().CharAt(nameLen - 1) == 's' || plNetClientMgr::GetInstance()->GetPlayerName().CharAt(nameLen - 1) == 'S') {
title = plString::Format( "%s'", plNetClientMgr::GetInstance()->GetPlayerName().c_str() ); title = plString::Format( "%s'", plNetClientMgr::GetInstance()->GetPlayerName().c_str() );
desc = plString::Format( "%s' %s", plNetClientMgr::GetInstance()->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName() ); desc = plString::Format( "%s' %s", plNetClientMgr::GetInstance()->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName().c_str() );
} }
else { else {
title = plString::Format( "%s's", plNetClientMgr::GetInstance()->GetPlayerName().c_str() ); title = plString::Format( "%s's", plNetClientMgr::GetInstance()->GetPlayerName().c_str() );
desc = plString::Format( "%s's %s", plNetClientMgr::GetInstance()->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName() ); desc = plString::Format( "%s's %s", plNetClientMgr::GetInstance()->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName().c_str() );
} }
info.SetAgeUserDefinedName( title.c_str() ); info.SetAgeUserDefinedName( title.c_str() );
@ -869,7 +868,7 @@ void plSceneInputInterface::ILinkOffereeToAge()
linkNode->DecRef(); linkNode->DecRef();
} }
if (fSpawnPoint) { if (!fSpawnPoint.IsEmpty()) {
plSpawnPointInfo spawnPoint; plSpawnPointInfo spawnPoint;
spawnPoint.SetName(fSpawnPoint); spawnPoint.SetName(fSpawnPoint);
link.SetSpawnPoint(spawnPoint); link.SetSpawnPoint(spawnPoint);
@ -878,12 +877,12 @@ void plSceneInputInterface::ILinkOffereeToAge()
// We now own the age, offer it // We now own the age, offer it
if (0 == stricmp(fOfferedAgeFile, kPersonalAgeFilename)) if (fOfferedAgeFile.CompareI(kPersonalAgeFilename) == 0)
plNetLinkingMgr::GetInstance()->OfferLinkToPlayer(&link, fOffereeID, fManager->GetKey()); plNetLinkingMgr::GetInstance()->OfferLinkToPlayer(&link, fOffereeID, fManager->GetKey());
else else
plNetLinkingMgr::GetInstance()->LinkPlayerToAge(&link, fOffereeID); plNetLinkingMgr::GetInstance()->LinkPlayerToAge(&link, fOffereeID);
if (!fPendingLink && stricmp(fOfferedAgeFile, kPersonalAgeFilename)) if (!fPendingLink && fOfferedAgeFile.CompareI(kPersonalAgeFilename) != 0)
{ {
// tell our local dialog to pop up again... // tell our local dialog to pop up again...
plKey avKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); plKey avKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey();

8
Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.h

@ -82,10 +82,10 @@ class plSceneInputInterface : public plInputInterface
int fBookMode; // are we in offer book mode? int fBookMode; // are we in offer book mode?
plKey fBookKey; // key for the python file modifier for the book we are offering plKey fBookKey; // key for the python file modifier for the book we are offering
plKey fOffereeKey; plKey fOffereeKey;
uint32_t fOffereeID; // ID for the guy who's accepted our link offer uint32_t fOffereeID; // ID for the guy who's accepted our link offer
const char* fOfferedAgeFile; plString fOfferedAgeFile;
const char* fOfferedAgeInstance; plString fOfferedAgeInstance;
const char* fSpawnPoint; plString fSpawnPoint;
plUUID fAgeInstanceGuid; plUUID fAgeInstanceGuid;
struct clickableTest struct clickableTest
{ {

40
Sources/Plasma/PubUtilLib/plMessage/plInputIfaceMgrMsg.h

@ -62,9 +62,9 @@ class plInputIfaceMgrMsg : public plMessage
uint8_t fCommand; uint8_t fCommand;
plInputInterface *fInterface; plInputInterface *fInterface;
uint32_t fPageID; uint32_t fPageID;
const char* ageName; plString ageName;
const char* ageFileName; plString ageFileName;
const char* spawnPoint; plString spawnPoint;
plUUID ageInstanceGuid; plUUID ageInstanceGuid;
plKey fAvKey; plKey fAvKey;
public: public:
@ -88,10 +88,10 @@ class plInputIfaceMgrMsg : public plMessage
kSetShareAgeInstanceGuid, kSetShareAgeInstanceGuid,
}; };
plInputIfaceMgrMsg() : plMessage( nil, nil, nil ) { SetBCastFlag( kBCastByExactType ); fInterface = nil; ageName = ageFileName = spawnPoint = 0; fAvKey = nil; } plInputIfaceMgrMsg() : plMessage( nil, nil, nil ) { SetBCastFlag( kBCastByExactType ); fInterface = nil; fAvKey = nil; }
plInputIfaceMgrMsg( plKey &receiver, uint8_t command ) : plMessage( nil, nil, nil ) { AddReceiver( receiver ); fCommand = command; fInterface = nil; fAvKey = nil; ageName = ageFileName = spawnPoint = 0;} plInputIfaceMgrMsg( plKey &receiver, uint8_t command ) : plMessage( nil, nil, nil ) { AddReceiver( receiver ); fCommand = command; fInterface = nil; fAvKey = nil; }
plInputIfaceMgrMsg( uint8_t command ) : plMessage( nil, nil, nil ) { SetBCastFlag( kBCastByExactType ); fCommand = command; fInterface = nil; fAvKey = nil; ageName = ageFileName = spawnPoint = 0;} plInputIfaceMgrMsg( uint8_t command ) : plMessage( nil, nil, nil ) { SetBCastFlag( kBCastByExactType ); fCommand = command; fInterface = nil; fAvKey = nil; }
plInputIfaceMgrMsg( uint8_t command, uint32_t pageID ) : plMessage( nil, nil, nil ) { SetBCastFlag( kBCastByExactType ); fCommand = command; fPageID = pageID; fInterface = nil; fAvKey = nil; ageName = ageFileName = spawnPoint = 0;} plInputIfaceMgrMsg( uint8_t command, uint32_t pageID ) : plMessage( nil, nil, nil ) { SetBCastFlag( kBCastByExactType ); fCommand = command; fPageID = pageID; fInterface = nil; fAvKey = nil; }
~plInputIfaceMgrMsg(); ~plInputIfaceMgrMsg();
CLASSNAME_REGISTER( plInputIfaceMgrMsg ); CLASSNAME_REGISTER( plInputIfaceMgrMsg );
@ -102,9 +102,9 @@ class plInputIfaceMgrMsg : public plMessage
plMessage::IMsgRead( s, mgr ); plMessage::IMsgRead( s, mgr );
s->ReadLE( &fCommand ); s->ReadLE( &fCommand );
s->ReadLE( &fPageID ); s->ReadLE( &fPageID );
ageName = s->ReadSafeString(); ageName = s->ReadSafeString_TEMP();
ageFileName = s->ReadSafeString(); ageFileName = s->ReadSafeString_TEMP();
spawnPoint = s->ReadSafeString(); spawnPoint = s->ReadSafeString_TEMP();
fAvKey = mgr->ReadKey(s); fAvKey = mgr->ReadKey(s);
} }
@ -119,18 +119,18 @@ class plInputIfaceMgrMsg : public plMessage
mgr->WriteKey(s,fAvKey); mgr->WriteKey(s,fAvKey);
} }
void SetAgeName(const char* s) { ageName = s; } void SetAgeName(const plString& s) { ageName = s; }
const char* GetAgeName() { return ageName; } plString GetAgeName() const { return ageName; }
void SetAgeFileName(const char* s) { ageFileName = s; } void SetAgeFileName(const plString& s) { ageFileName = s; }
const char* GetAgeFileName() { return ageFileName; } plString GetAgeFileName() const { return ageFileName; }
void SetSpawnPoint(const char* s) { spawnPoint = s; } void SetSpawnPoint(const plString& s) { spawnPoint = s; }
const char* GetSpawnPoint() { return spawnPoint; } plString GetSpawnPoint() const { return spawnPoint; }
void SetAgeInstanceGuid(const plUUID& guid) { ageInstanceGuid = guid; } void SetAgeInstanceGuid(const plUUID& guid) { ageInstanceGuid = guid; }
const plUUID& GetAgeInstanceGuid() { return ageInstanceGuid; } const plUUID& GetAgeInstanceGuid() const { return ageInstanceGuid; }
uint8_t GetCommand( void ) { return fCommand; } uint8_t GetCommand() const { return fCommand; }
uint32_t GetPageID( void ) { return fPageID; } uint32_t GetPageID() const { return fPageID; }
void SetIFace( plInputInterface *iface ); void SetIFace( plInputInterface *iface );
plInputInterface *GetIFace( void ) const { return fInterface; } plInputInterface *GetIFace() const { return fInterface; }
plKey& GetAvKey( void ) { return fAvKey; } plKey& GetAvKey( void ) { return fAvKey; }
const plKey& GetAvKey( void ) const { return fAvKey; } const plKey& GetAvKey( void ) const { return fAvKey; }
void SetAvKey( plKey& k ) { fAvKey = k; } void SetAvKey( plKey& k ) { fAvKey = k; }

14
Sources/Plasma/PubUtilLib/plNetClient/plLinkEffectsMgr.cpp

@ -374,16 +374,16 @@ bool plLinkEffectsMgr::MsgReceive(plMessage *msg)
if (linkKey == nc->GetLocalPlayerKey()) if (linkKey == nc->GetLocalPlayerKey())
{ {
if(lm) { if(lm) {
const char *ageName = lm->GetAgeLink()->GetAgeInfo()->GetAgeFilename(); plString ageName = lm->GetAgeLink()->GetAgeInfo()->GetAgeFilename();
const char *prevAgeName = lm->GetPrevAgeLink()->GetAgeInfo()->GetAgeFilename(); plString prevAgeName = lm->GetPrevAgeLink()->GetAgeInfo()->GetAgeFilename();
bool linkToStartup = ageName && !stricmp(ageName, kStartUpAgeFilename ); // To Startup bool linkToStartup = ageName.CompareI(kStartUpAgeFilename) == 0; // To Startup
bool linkFromStartup = prevAgeName && !stricmp(prevAgeName, kStartUpAgeFilename); // Leaving Startup bool linkFromStartup = prevAgeName.CompareI(kStartUpAgeFilename) == 0; // Leaving Startup
bool cleftSolved = VaultHasChronicleEntry( kCleftSolved ); bool cleftSolved = VaultHasChronicleEntry( kCleftSolved );
bool linkToACA = ageName && !stricmp(ageName, kAvCustomizationFilename); bool linkToACA = ageName.CompareI(kAvCustomizationFilename) == 0;
bool linkFromACA = prevAgeName && !stricmp(prevAgeName, kAvCustomizationFilename); bool linkFromACA = prevAgeName.CompareI(kAvCustomizationFilename) == 0;
bool linkToFissureDrop = lm && bool linkToFissureDrop = lm &&
lm->GetAgeLink()->HasSpawnPt() && lm->GetAgeLink()->HasSpawnPt() &&
@ -606,4 +606,4 @@ void plLinkEffectsMgr::IRemovePseudo(plKey avatarKey)
} }
} }
} }

2
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp

@ -1144,7 +1144,7 @@ bool plNetClientMgr::ObjectInLocalAge(const plSynchedObject* obj) const
// //
// the next age we are going to // the next age we are going to
// //
const char* plNetClientMgr::GetNextAgeFilename() plString plNetClientMgr::GetNextAgeFilename() const
{ {
// set when we start linking to an age. // set when we start linking to an age.
plNetLinkingMgr * lm = plNetLinkingMgr::GetInstance(); plNetLinkingMgr * lm = plNetLinkingMgr::GetInstance();

2
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.h

@ -358,7 +358,7 @@ public:
const plKey& GetAgeSDLObjectKey() const { return fAgeSDLObjectKey; } const plKey& GetAgeSDLObjectKey() const { return fAgeSDLObjectKey; }
plUoid GetAgeSDLObjectUoid(const char* ageName) const; plUoid GetAgeSDLObjectUoid(const char* ageName) const;
plNetClientComm& GetNetClientComm() { return fNetClientComm; } plNetClientComm& GetNetClientComm() { return fNetClientComm; }
const char* GetNextAgeFilename(); plString GetNextAgeFilename() const;
void SetOverrideAgeTimeOfDayPercent(float f) { fOverrideAgeTimeOfDayPercent=f; } void SetOverrideAgeTimeOfDayPercent(float f) { fOverrideAgeTimeOfDayPercent=f; }
void AddPendingPagingRoomMsg( plNetMsgPagingRoom * msg ); void AddPendingPagingRoomMsg( plNetMsgPagingRoom * msg );

2
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.cpp

@ -72,7 +72,7 @@ void plNetClientMsgScreener::ICreateStatusLog() const
// //
// return cur age name // return cur age name
// //
const char* plNetClientMsgScreener::IGetAgeName() const plString plNetClientMsgScreener::IGetAgeName() const
{ {
plNetLinkingMgr *lm = plNetLinkingMgr::GetInstance(); plNetLinkingMgr *lm = plNetLinkingMgr::GetInstance();
return lm && lm->GetAgeLink()->GetAgeInfo() ? lm->GetAgeLink()->GetAgeInfo()->GetAgeFilename() : "?"; return lm && lm->GetAgeLink()->GetAgeInfo() ? lm->GetAgeLink()->GetAgeInfo()->GetAgeFilename() : "?";

2
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.h

@ -52,7 +52,7 @@ class plNetClientMsgScreener : public plNetMsgScreener
protected: protected:
void ICreateStatusLog() const; void ICreateStatusLog() const;
const char* IGetSenderName(const plNetGameMember* gm) const { return "local"; } const char* IGetSenderName(const plNetGameMember* gm) const { return "local"; }
const char* IGetAgeName() const; plString IGetAgeName() const;
bool IIsLocalAvatarKey(plKey key, const plNetGameMember* gm) const; bool IIsLocalAvatarKey(plKey key, const plNetGameMember* gm) const;
bool IIsLocalArmatureModKey(plKey key, const plNetGameMember* gm) const; bool IIsLocalArmatureModKey(plKey key, const plNetGameMember* gm) const;
bool IIsSenderCCR(const plNetGameMember* gm=nil) const; bool IIsSenderCCR(const plNetGameMember* gm=nil) const;

24
Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp

@ -436,7 +436,7 @@ void plNetLinkingMgr::IDoLink(plLinkToAgeMsg* msg)
joinAgeOp->muteSfx = !msg->PlayLinkInSfx(); joinAgeOp->muteSfx = !msg->PlayLinkInSfx();
StrCopy( StrCopy(
joinAgeOp->age.ageDatasetName, joinAgeOp->age.ageDatasetName,
GetAgeLink()->GetAgeInfo()->GetAgeFilename(), GetAgeLink()->GetAgeInfo()->GetAgeFilename().c_str(),
arrsize(joinAgeOp->age.ageDatasetName) arrsize(joinAgeOp->age.ageDatasetName)
); );
StrCopy( StrCopy(
@ -775,9 +775,9 @@ void plNetLinkingMgr::IPostProcessLink( void )
plAgeLinkStruct* link = GetAgeLink(); plAgeLinkStruct* link = GetAgeLink();
plAgeInfoStruct* info = link->GetAgeInfo(); plAgeInfoStruct* info = link->GetAgeInfo();
bool city = (stricmp(info->GetAgeFilename(), kCityAgeFilename) == 0); bool city = (info->GetAgeFilename().CompareI(kCityAgeFilename) == 0);
bool hood = (stricmp(info->GetAgeFilename(), kNeighborhoodAgeFilename) == 0); bool hood = (info->GetAgeFilename().CompareI(kNeighborhoodAgeFilename) == 0);
bool psnl = (stricmp(info->GetAgeFilename(), kPersonalAgeFilename) == 0); bool psnl = (info->GetAgeFilename().CompareI(kPersonalAgeFilename) == 0);
// Update our online status // Update our online status
if (RelVaultNode* rvnInfo = VaultGetPlayerInfoNodeIncRef()) { if (RelVaultNode* rvnInfo = VaultGetPlayerInfoNodeIncRef()) {
@ -913,17 +913,17 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// SPECIAL CASE: StartUp: force basic link // SPECIAL CASE: StartUp: force basic link
if (stricmp(info->GetAgeFilename(), kStartUpAgeFilename) == 0) if (info->GetAgeFilename().CompareI(kStartUpAgeFilename) == 0)
link->SetLinkingRules( plNetCommon::LinkingRules::kBasicLink ); link->SetLinkingRules( plNetCommon::LinkingRules::kBasicLink );
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// SPECIAL CASE: Nexus: force original link // SPECIAL CASE: Nexus: force original link
if (stricmp(info->GetAgeFilename(), kNexusAgeFilename) == 0) if (info->GetAgeFilename().CompareI(kNexusAgeFilename) == 0)
link->SetLinkingRules(plNetCommon::LinkingRules::kOriginalBook); link->SetLinkingRules(plNetCommon::LinkingRules::kOriginalBook);
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// SPECIAL CASE: ACA: force original link // SPECIAL CASE: ACA: force original link
if (stricmp(info->GetAgeFilename(), kAvCustomizationFilename ) == 0) if (info->GetAgeFilename().CompareI(kAvCustomizationFilename) == 0)
link->SetLinkingRules(plNetCommon::LinkingRules::kOriginalBook); link->SetLinkingRules(plNetCommon::LinkingRules::kOriginalBook);
hsLogEntry(nc->DebugMsg("plNetLinkingMgr: Process: Linking with %s rules...", hsLogEntry(nc->DebugMsg("plNetLinkingMgr: Process: Linking with %s rules...",
@ -970,9 +970,9 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
plString desc; plString desc;
unsigned nameLen = nc->GetPlayerName().GetSize(); unsigned nameLen = nc->GetPlayerName().GetSize();
if (nc->GetPlayerName().ToLower().CharAt(nameLen - 1) == 's') if (nc->GetPlayerName().ToLower().CharAt(nameLen - 1) == 's')
desc = plString::Format("%s' %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName()); desc = plString::Format("%s' %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName().c_str());
else else
desc = plString::Format("%s's %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName()); desc = plString::Format("%s's %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName().c_str());
info->SetAgeDescription(desc.c_str()); info->SetAgeDescription(desc.c_str());
} }
if (!info->HasAgeInstanceGuid()) { if (!info->HasAgeInstanceGuid()) {
@ -1010,9 +1010,9 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
plString desc; plString desc;
unsigned nameLen = nc->GetPlayerName().GetSize(); unsigned nameLen = nc->GetPlayerName().GetSize();
if (nc->GetPlayerName().ToLower().CharAt(nameLen - 1) == 's') if (nc->GetPlayerName().ToLower().CharAt(nameLen - 1) == 's')
desc = plString::Format("%s' %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName()); desc = plString::Format("%s' %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName().c_str());
else else
desc = plString::Format("%s's %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName()); desc = plString::Format("%s's %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName().c_str());
info->SetAgeDescription( desc.c_str() ); info->SetAgeDescription( desc.c_str() );
} }
@ -1029,7 +1029,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
} }
} }
else { else {
if (stricmp(info->GetAgeFilename(), kNeighborhoodAgeFilename) == 0) { if (info->GetAgeFilename().CompareI(kNeighborhoodAgeFilename) == 0) {
// if we get here then it's because we're linking to a neighborhood that we don't belong to // if we get here then it's because we're linking to a neighborhood that we don't belong to
// and our own neighborhood book is not volatile, so really we want to basic link // and our own neighborhood book is not volatile, so really we want to basic link
link->SetLinkingRules(plNetCommon::LinkingRules::kBasicLink); link->SetLinkingRules(plNetCommon::LinkingRules::kBasicLink);

4
Sources/Plasma/PubUtilLib/plNetCommon/plNetMsgScreener.cpp

@ -68,7 +68,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
void plNetMsgScreener::IRejectLogMsg(int16_t classIndex, const char* desc, const plNetGameMember* gm) const void plNetMsgScreener::IRejectLogMsg(int16_t classIndex, const char* desc, const plNetGameMember* gm) const
{ {
DebugMsg("Message %s was rejected, reason:%s, age:%s, client:%s", DebugMsg("Message %s was rejected, reason:%s, age:%s, client:%s",
plFactory::GetNameOfClass(classIndex), desc, IGetAgeName(), IGetSenderName(gm)); plFactory::GetNameOfClass(classIndex), desc, IGetAgeName().c_str(), IGetSenderName(gm));
} }
// //
@ -80,7 +80,7 @@ void plNetMsgScreener::IRejectLogMsg(const plMessage* msg, const char* desc, con
const char* rcvrName = msg->GetNumReceivers() && msg->GetReceiver(0) ? msg->GetReceiver(0)->GetUoid().GetObjectName().c_str() : "?"; const char* rcvrName = msg->GetNumReceivers() && msg->GetReceiver(0) ? msg->GetReceiver(0)->GetUoid().GetObjectName().c_str() : "?";
DebugMsg("Message %s was rejected, reason:%s, age:%s, client:%s, msgSndr:%s, msgRcvr:%s", DebugMsg("Message %s was rejected, reason:%s, age:%s, client:%s, msgSndr:%s, msgRcvr:%s",
msg->ClassName(), desc, IGetAgeName(), IGetSenderName(gm), msg->ClassName(), desc, IGetAgeName().c_str(), IGetSenderName(gm),
senderName, rcvrName); senderName, rcvrName);
} }

2
Sources/Plasma/PubUtilLib/plNetCommon/plNetMsgScreener.h

@ -63,7 +63,7 @@ protected:
kYes kYes
}; };
virtual const char* IGetSenderName(const plNetGameMember* gm) const = 0; virtual const char* IGetSenderName(const plNetGameMember* gm) const = 0;
virtual const char* IGetAgeName() const = 0; virtual plString IGetAgeName() const = 0;
virtual bool IIsSenderCCR(const plNetGameMember* gm=nil) const = 0; virtual bool IIsSenderCCR(const plNetGameMember* gm=nil) const = 0;
virtual bool IIsLocalAvatarKey(plKey key, const plNetGameMember* gm) const = 0; virtual bool IIsLocalAvatarKey(plKey key, const plNetGameMember* gm) const = 0;
virtual bool IIsLocalArmatureModKey(plKey key, const plNetGameMember* gm) const { return true; } virtual bool IIsLocalArmatureModKey(plKey key, const plNetGameMember* gm) const { return true; }

58
Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp

@ -46,7 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plNetCommon.h" #include "plNetCommon.h"
#include "plVault/plVault.h" #include "plVault/plVault.h"
#define SAFE(s) ((s)?(s):"(nil)") #define SAFE(s) ((s).IsEmpty() ? "(nil)" : (s))
#define kComma "," #define kComma ","
#define kEmpty "" #define kEmpty ""
#define kSemicolon ";" #define kSemicolon ";"
@ -119,11 +119,11 @@ bool plAgeInfoStruct::IsEqualTo( const plAgeInfoStruct * other ) const
// otherwise compare everything. // otherwise compare everything.
bool match = true; bool match = true;
if (match && HasAgeFilename() && other->HasAgeFilename()) if (match && HasAgeFilename() && other->HasAgeFilename())
match = match && ( stricmp( GetAgeFilename(), other->GetAgeFilename() )==0 ); match = match && ( GetAgeFilename().CompareI( other->GetAgeFilename() )==0 );
if (match && HasAgeInstanceName() && other->HasAgeInstanceName()) if (match && HasAgeInstanceName() && other->HasAgeInstanceName())
match = match && ( stricmp( GetAgeInstanceName(), other->GetAgeInstanceName() )==0 ); match = match && ( GetAgeInstanceName().CompareI( other->GetAgeInstanceName() )==0 );
if (match && HasAgeUserDefinedName() && other->HasAgeUserDefinedName()) if (match && HasAgeUserDefinedName() && other->HasAgeUserDefinedName())
match = match && ( stricmp( GetAgeUserDefinedName(), other->GetAgeUserDefinedName() )==0 ); match = match && ( GetAgeUserDefinedName().CompareI( other->GetAgeUserDefinedName() )==0 );
if (match && HasAgeSequenceNumber() && other->HasAgeSequenceNumber()) if (match && HasAgeSequenceNumber() && other->HasAgeSequenceNumber())
match = match && fAgeSequenceNumber==other->GetAgeSequenceNumber(); match = match && fAgeSequenceNumber==other->GetAgeSequenceNumber();
if (match && HasAgeLanguage() && other->HasAgeLanguage()) if (match && HasAgeLanguage() && other->HasAgeLanguage())
@ -238,9 +238,9 @@ plString plAgeInfoStruct::AsString() const
} }
void plAgeInfoStruct::SetAgeFilename( const char * v ) void plAgeInfoStruct::SetAgeFilename( const plString & v )
{ {
if ( v && v[0]) if (!v.IsEmpty())
{ {
SetFlag( kHasAgeFilename ); SetFlag( kHasAgeFilename );
fAgeFilename=v; fAgeFilename=v;
@ -251,9 +251,9 @@ void plAgeInfoStruct::SetAgeFilename( const char * v )
} }
} }
void plAgeInfoStruct::SetAgeInstanceName( const char * v ) void plAgeInfoStruct::SetAgeInstanceName( const plString & v )
{ {
if ( v && v[0]) if (!v.IsEmpty())
{ {
SetFlag( kHasAgeInstanceName ); SetFlag( kHasAgeInstanceName );
fAgeInstanceName=v; fAgeInstanceName=v;
@ -278,9 +278,9 @@ void plAgeInfoStruct::SetAgeInstanceGuid( const plUUID * v )
} }
} }
void plAgeInfoStruct::SetAgeUserDefinedName( const char * v ) void plAgeInfoStruct::SetAgeUserDefinedName( const plString & v )
{ {
if ( v && v[0]) if (!v.IsEmpty())
{ {
SetFlag( kHasAgeUserDefinedName ); SetFlag( kHasAgeUserDefinedName );
fAgeUserDefinedName=v; fAgeUserDefinedName=v;
@ -304,9 +304,9 @@ void plAgeInfoStruct::SetAgeSequenceNumber( uint32_t v )
} }
} }
void plAgeInfoStruct::SetAgeDescription( const char * v ) void plAgeInfoStruct::SetAgeDescription( const plString & v )
{ {
if ( v && v[0]) if (!v.IsEmpty())
{ {
SetFlag( kHasAgeDescription ); SetFlag( kHasAgeDescription );
fAgeDescription=v; fAgeDescription=v;
@ -332,12 +332,12 @@ void plAgeInfoStruct::SetAgeLanguage( uint32_t v )
void plAgeInfoStruct::UpdateFlags() const void plAgeInfoStruct::UpdateFlags() const
{ {
SetFlag( kHasAgeFilename, fAgeFilename.size()!=0 ); SetFlag( kHasAgeFilename, !fAgeFilename.IsEmpty() );
SetFlag( kHasAgeInstanceName, fAgeInstanceName.size()!=0 ); SetFlag( kHasAgeInstanceName, !fAgeInstanceName.IsEmpty() );
SetFlag( kHasAgeUserDefinedName, fAgeUserDefinedName.size()!=0 ); SetFlag( kHasAgeUserDefinedName, !fAgeUserDefinedName.IsEmpty() );
SetFlag( kHasAgeInstanceGuid, fAgeInstanceGuid.IsSet() ); SetFlag( kHasAgeInstanceGuid, fAgeInstanceGuid.IsSet() );
SetFlag( kHasAgeSequenceNumber, fAgeSequenceNumber!=0 ); SetFlag( kHasAgeSequenceNumber, fAgeSequenceNumber!=0 );
SetFlag( kHasAgeDescription, fAgeDescription.size()!=0 ); SetFlag( kHasAgeDescription, !fAgeDescription.IsEmpty() );
SetFlag( kHasAgeLanguage, fAgeLanguage>=0 ); SetFlag( kHasAgeLanguage, fAgeLanguage>=0 );
} }
@ -622,7 +622,7 @@ plString plNetServerSessionInfo::AsString() const
{ {
ss << spacer ss << spacer
<< "N:" << "N:"
<< SAFE(fServerName.c_str()); << SAFE(fServerName);
spacer = kComma; spacer = kComma;
} }
if (HasServerGuid()) if (HasServerGuid())
@ -636,7 +636,7 @@ plString plNetServerSessionInfo::AsString() const
{ {
ss << spacer ss << spacer
<< "A:[" << "A:["
<< SAFE(fServerAddr.c_str()) << SAFE(fServerAddr)
<< ":" << ":"
<< fServerPort << fServerPort
<< "]"; << "]";
@ -662,14 +662,14 @@ plString plNetServerSessionInfo::AsLogString() const
if (HasServerName()) if (HasServerName())
{ {
ss << typeName << "Name" << "="; ss << typeName << "Name" << "=";
ss << fServerName.c_str(); ss << fServerName;
ss << spacer; ss << spacer;
} }
if (HasServerAddr()) if (HasServerAddr())
{ {
ss << typeName << "Addr" << "="; ss << typeName << "Addr" << "=";
ss << fServerAddr.c_str(); ss << fServerAddr;
ss << spacer; ss << spacer;
} }
@ -696,27 +696,26 @@ bool plNetServerSessionInfo::IsEqualTo(const plNetServerSessionInfo * other) con
if (match && IsFlagSet(kHasServerGuid) && other->IsFlagSet(kHasServerGuid)) if (match && IsFlagSet(kHasServerGuid) && other->IsFlagSet(kHasServerGuid))
match = match && fServerGuid.IsEqualTo(other->GetServerGuid()); match = match && fServerGuid.IsEqualTo(other->GetServerGuid());
if (match && IsFlagSet(kHasServerName) && other->IsFlagSet(kHasServerName)) if (match && IsFlagSet(kHasServerName) && other->IsFlagSet(kHasServerName))
match = match && (stricmp(fServerName.c_str(),other->fServerName.c_str())==0); match = match && (fServerName.CompareI(other->fServerName)==0);
if (match && IsFlagSet(kHasServerType) && other->IsFlagSet(kHasServerType)) if (match && IsFlagSet(kHasServerType) && other->IsFlagSet(kHasServerType))
match = match && fServerType==other->fServerType; match = match && fServerType==other->fServerType;
if (match && IsFlagSet(kHasServerAddr) && other->IsFlagSet(kHasServerAddr)) if (match && IsFlagSet(kHasServerAddr) && other->IsFlagSet(kHasServerAddr))
match = match && (stricmp(fServerAddr.c_str(),other->fServerAddr.c_str())==0); match = match && (fServerAddr.CompareI(other->fServerAddr)==0);
if (match && IsFlagSet(kHasServerPort) && other->IsFlagSet(kHasServerPort)) if (match && IsFlagSet(kHasServerPort) && other->IsFlagSet(kHasServerPort))
match = match && fServerPort==other->fServerPort; match = match && fServerPort==other->fServerPort;
return match; return match;
} }
void plNetServerSessionInfo::SetServerName(const char * val) void plNetServerSessionInfo::SetServerName(const plString & val)
{ {
if (val) fServerName = val;
if (!val.IsEmpty())
{ {
fServerName=val;
SetFlag(kHasServerName); SetFlag(kHasServerName);
} }
else else
{ {
fServerName="";
ClearFlag(kHasServerName); ClearFlag(kHasServerName);
} }
} }
@ -735,16 +734,15 @@ void plNetServerSessionInfo::SetServerType(uint8_t val)
} }
} }
void plNetServerSessionInfo::SetServerAddr(const char * val) void plNetServerSessionInfo::SetServerAddr(const plString & val)
{ {
if (val) fServerAddr = val;
if (!val.IsEmpty())
{ {
fServerAddr = val;
SetFlag(kHasServerAddr); SetFlag(kHasServerAddr);
} }
else else
{ {
fServerAddr = "";
ClearFlag(kHasServerAddr); ClearFlag(kHasServerAddr);
} }
} }

49
Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h

@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define plNetServerSessionInfo_h_inc #define plNetServerSessionInfo_h_inc
#include "HeadSpin.h" #include "HeadSpin.h"
#include <string>
#include "pnFactory/plCreatable.h" #include "pnFactory/plCreatable.h"
#include "pnNetCommon/plNetServers.h" #include "pnNetCommon/plNetServers.h"
@ -64,19 +63,19 @@ class plAgeInfoStruct : public plCreatable
mutable uint8_t fFlags; mutable uint8_t fFlags;
// Age dataset name "Neighborhood" // Age dataset name "Neighborhood"
std::string fAgeFilename; plString fAgeFilename;
// Age string ID "Bevin" // Age string ID "Bevin"
std::string fAgeInstanceName; plString fAgeInstanceName;
// Age guid. Same as game server guid. // Age guid. Same as game server guid.
plUUID fAgeInstanceGuid; plUUID fAgeInstanceGuid;
// User-defined age name: "My Teledahn" // User-defined age name: "My Teledahn"
std::string fAgeUserDefinedName; plString fAgeUserDefinedName;
// User-defined age description "This is Joe's Neighborhood" // User-defined age description "This is Joe's Neighborhood"
std::string fAgeDescription; plString fAgeDescription;
// A modifier to user-defined name to make it unique in gui lists. // A modifier to user-defined name to make it unique in gui lists.
// Assigned by vault server. // Assigned by vault server.
@ -117,19 +116,19 @@ public:
void CopyFrom(const struct NetAgeInfo & info); void CopyFrom(const struct NetAgeInfo & info);
bool IsEqualTo( const plAgeInfoStruct * other ) const; bool IsEqualTo( const plAgeInfoStruct * other ) const;
const char * GetAgeFilename() const { return fAgeFilename.c_str(); } plString GetAgeFilename() const { return fAgeFilename; }
const char * GetAgeInstanceName() const { return fAgeInstanceName.c_str(); } plString GetAgeInstanceName() const { return fAgeInstanceName; }
const plUUID * GetAgeInstanceGuid() const { return &fAgeInstanceGuid; } const plUUID * GetAgeInstanceGuid() const { return &fAgeInstanceGuid; }
const char * GetAgeUserDefinedName() const { return fAgeUserDefinedName.c_str(); } plString GetAgeUserDefinedName() const { return fAgeUserDefinedName; }
const char * GetAgeDescription() const { return fAgeDescription.c_str(); } plString GetAgeDescription() const { return fAgeDescription; }
uint32_t GetAgeSequenceNumber() const { return fAgeSequenceNumber; } uint32_t GetAgeSequenceNumber() const { return fAgeSequenceNumber; }
uint32_t GetAgeLanguage() const { return fAgeLanguage; } uint32_t GetAgeLanguage() const { return fAgeLanguage; }
void SetAgeFilename( const char * v ); void SetAgeFilename( const plString & v );
void SetAgeInstanceName( const char * v ); void SetAgeInstanceName( const plString & v );
void SetAgeInstanceGuid( const plUUID * v ); void SetAgeInstanceGuid( const plUUID * v );
void SetAgeUserDefinedName( const char * v ); void SetAgeUserDefinedName( const plString & v );
void SetAgeDescription( const char * v ); void SetAgeDescription( const plString & v );
void SetAgeSequenceNumber( uint32_t v ); void SetAgeSequenceNumber( uint32_t v );
void SetAgeLanguage( uint32_t v ); void SetAgeLanguage( uint32_t v );
@ -227,12 +226,12 @@ public:
class plNetServerSessionInfo : public plCreatable class plNetServerSessionInfo : public plCreatable
{ {
uint8_t fFlags; uint8_t fFlags;
std::string fServerName; plString fServerName;
uint8_t fServerType; uint8_t fServerType;
std::string fServerAddr; plString fServerAddr;
uint16_t fServerPort; uint16_t fServerPort;
plUUID fServerGuid; plUUID fServerGuid;
enum enum
{ {
@ -256,17 +255,17 @@ public:
CLASSNAME_REGISTER( plNetServerSessionInfo ); CLASSNAME_REGISTER( plNetServerSessionInfo );
GETINTERFACE_ANY( plNetServerSessionInfo, plCreatable ); GETINTERFACE_ANY( plNetServerSessionInfo, plCreatable );
void SetServerName(const char * val); void SetServerName(const plString & val);
void SetServerType(uint8_t val); void SetServerType(uint8_t val);
void SetServerAddr(const char * val); void SetServerAddr(const plString & val);
void SetServerPort(uint16_t val); void SetServerPort(uint16_t val);
void SetServerGuid(const plUUID * val); void SetServerGuid(const plUUID * val);
void CopyServerGuid(const plUUID & val); void CopyServerGuid(const plUUID & val);
const char * GetServerName() const { return fServerName.c_str();} plString GetServerName() const { return fServerName; }
uint8_t GetServerType() const { return fServerType;} uint8_t GetServerType() const { return fServerType; }
const char * GetServerAddr() const { return fServerAddr.c_str(); } plString GetServerAddr() const { return fServerAddr; }
uint16_t GetServerPort() const { return fServerPort; } uint16_t GetServerPort() const { return fServerPort; }
const plUUID *GetServerGuid() const { return &fServerGuid; } const plUUID *GetServerGuid() const { return &fServerGuid; }
plUUID * GetServerGuid() { return &fServerGuid; } plUUID * GetServerGuid() { return &fServerGuid; }

3
Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp

@ -5001,9 +5001,8 @@ uint8_t VaultAgeFindOrCreateChildAgeLink(
// Still here? Try to find the Child Ages folder // Still here? Try to find the Child Ages folder
uint8_t retval = hsFail; uint8_t retval = hsFail;
if (RelVaultNode* rvnChildAges = rvnParentInfo->GetChildAgeInfoListNodeIncRef(plVault::kChildAgesFolder, 1)) { if (RelVaultNode* rvnChildAges = rvnParentInfo->GetChildAgeInfoListNodeIncRef(plVault::kChildAgesFolder, 1)) {
const char* ageName = info->GetAgeFilename();
wchar_t hack[MAX_PATH]; wchar_t hack[MAX_PATH];
StrToUnicode(hack, ageName, arrsize(hack)); StrToUnicode(hack, info->GetAgeFilename(), arrsize(hack));
// Search for our age // Search for our age
NetVaultNode* temp = new NetVaultNode; NetVaultNode* temp = new NetVaultNode;

Loading…
Cancel
Save