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

Age Link info names => plString

This commit is contained in:
2014-01-12 15:13:04 -08:00
parent ff30c77ddd
commit ef04cfcf84
25 changed files with 195 additions and 194 deletions

View File

@ -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
{
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() : "?";
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);
}

View File

@ -63,7 +63,7 @@ protected:
kYes
};
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 IIsLocalAvatarKey(plKey key, const plNetGameMember* gm) const = 0;
virtual bool IIsLocalArmatureModKey(plKey key, const plNetGameMember* gm) const { return true; }

View File

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

View File

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