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

Make hsRefCnt atomic, and merge with hsAtomicRefCnt

This commit is contained in:
2014-06-01 13:29:19 -07:00
parent d283872da6
commit aee2f7f7ca
23 changed files with 90 additions and 98 deletions

View File

@ -132,6 +132,20 @@ bool plAgeInfoStruct::IsEqualTo( const plAgeInfoStruct * other ) const
return match;
}
void plAgeInfoStruct::CopyFrom(const plAgeInfoStruct * other)
{
hsAssert(other, "CopyFrom called with null struct");
fFlags = other->fFlags;
fAgeFilename = other->fAgeFilename;
fAgeInstanceName = other->fAgeInstanceName;
fAgeInstanceGuid = other->fAgeInstanceGuid;
fAgeUserDefinedName = other->fAgeUserDefinedName;
fAgeDescription = other->fAgeDescription;
fAgeSequenceNumber = other->fAgeSequenceNumber;
fAgeLanguage = other->fAgeLanguage;
}
void plAgeInfoStruct::CopyFrom( const plVaultAgeInfoNode * node )
{
hsAssert(false, "eric, port me");
@ -441,7 +455,12 @@ void plAgeLinkStruct::CopyFrom( const plAgeLinkStruct * other )
{
if ( other )
{
*this=*other;
fFlags = other->fFlags;
fAgeInfo.CopyFrom(&other->fAgeInfo);
fLinkingRules = other->fLinkingRules;
fSpawnPoint = other->fSpawnPoint;
fAmCCR = other->fAmCCR;
fParentAgeFilename = other->fParentAgeFilename;
}
else
{

View File

@ -112,7 +112,7 @@ public:
void Clear();
void UpdateFlags() const;
void CopyFrom( const plAgeInfoStruct * other ) { *this=*other; }
void CopyFrom( const plAgeInfoStruct * other );
void CopyFrom( const plVaultAgeInfoNode * node );
void CopyFrom(const struct NetAgeInfo & info);
bool IsEqualTo( const plAgeInfoStruct * other ) const;

View File

@ -287,7 +287,7 @@ enum ENetTransState {
kTransStateComplete,
};
struct NetTrans : hsAtomicRefCnt {
struct NetTrans : hsRefCnt {
LINK(NetTrans) m_link;
ENetTransState m_state;
ENetError m_result;

View File

@ -57,7 +57,7 @@ namespace Ngl { namespace Auth {
*
***/
struct CliAuConn : hsAtomicRefCnt {
struct CliAuConn : hsRefCnt {
CliAuConn ();
~CliAuConn ();
@ -1588,7 +1588,7 @@ static unsigned CliAuConnPingTimerProc (void * param) {
//============================================================================
CliAuConn::CliAuConn ()
: hsAtomicRefCnt(0), reconnectTimer(nil), reconnectStartMs(0)
: hsRefCnt(0), reconnectTimer(nil), reconnectStartMs(0)
, pingTimer(nil), pingSendTimeMs(0), lastHeardTimeMs(0)
, sock(nil), cli(nil), seq(0), serverChallenge(0)
, cancelId(nil), abandoned(false)

View File

@ -60,7 +60,7 @@ namespace Ngl { namespace File {
*
***/
struct CliFileConn : hsAtomicRefCnt {
struct CliFileConn : hsRefCnt {
LINK(CliFileConn) link;
hsReaderWriterLock sockLock; // to protect the socket pointer so we don't nuke it while using it
AsyncSocket sock;
@ -581,7 +581,7 @@ static void AsyncLookupCallback (
//============================================================================
CliFileConn::CliFileConn ()
: hsAtomicRefCnt(0), sock(nil), seq(0), cancelId(nil), abandoned(false)
: hsRefCnt(0), sock(nil), seq(0), cancelId(nil), abandoned(false)
, buildId(0), serverType(0)
, reconnectTimer(nil), reconnectStartMs(0), connectStartMs(0)
, numImmediateDisconnects(0), numFailedConnects(0)

View File

@ -55,7 +55,7 @@ namespace Ngl { namespace Game {
*
***/
struct CliGmConn : hsAtomicRefCnt {
struct CliGmConn : hsRefCnt {
LINK(CliGmConn) link;
CCritSect critsect;
@ -415,7 +415,7 @@ static unsigned CliGmConnPingTimerProc (void * param) {
//============================================================================
CliGmConn::CliGmConn ()
: hsAtomicRefCnt(0), sock(nil), cancelId(nil), cli(nil)
: hsRefCnt(0), sock(nil), cancelId(nil), cli(nil)
, seq(0), abandoned(false)
, pingTimer(nil), pingSendTimeMs(0), lastHeardTimeMs(0)
{

View File

@ -56,7 +56,7 @@ namespace Ngl { namespace GateKeeper {
*
***/
struct CliGkConn : hsAtomicRefCnt {
struct CliGkConn : hsRefCnt {
CliGkConn ();
~CliGkConn ();
@ -525,7 +525,7 @@ static unsigned CliGkConnPingTimerProc (void * param) {
//============================================================================
CliGkConn::CliGkConn ()
: hsAtomicRefCnt(0), reconnectTimer(nil), reconnectStartMs(0)
: hsRefCnt(0), reconnectTimer(nil), reconnectStartMs(0)
, pingTimer(nil), pingSendTimeMs(0), lastHeardTimeMs(0)
, sock(nil), cli(nil), seq(0), serverChallenge(0)
, cancelId(nil), abandoned(false)

View File

@ -117,7 +117,7 @@ static void CancelTrans_CS (NetTrans * trans, ENetError error) {
//============================================================================
NetTrans::NetTrans (ENetProtocol protocol, ETransType transType)
: hsAtomicRefCnt(0)
: hsRefCnt(0)
, m_state(kTransStateWaitServerConnect)
, m_result(kNetPending)
, m_transId(0)

View File

@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//
// refcntable data
//
class plNetCommonMessageData : public hsAtomicRefCnt
class plNetCommonMessageData : public hsRefCnt
{
private:
char *fData; // sent

View File

@ -71,6 +71,16 @@ plFogEnvironment::~plFogEnvironment()
{
}
plFogEnvironment &plFogEnvironment::operator=(const plFogEnvironment &copy)
{
fType = copy.fType;
fStart = copy.fStart;
fEnd = copy.fEnd;
fDensity = copy.fDensity;
fColor = copy.fColor;
return *this;
}
//// Set /////////////////////////////////////////////////////////////////////
void plFogEnvironment::Set( float start, float end, float density, const hsColorRGBA *color )

View File

@ -85,6 +85,9 @@ class plFogEnvironment : public hsKeyedObject
plFogEnvironment( FogType type, float end, float density, hsColorRGBA &color );
~plFogEnvironment();
plFogEnvironment(const plFogEnvironment &copy) { operator=(copy); }
plFogEnvironment &operator=(const plFogEnvironment &copy);
// Sets the parameters for linear fog
void Set( float start, float end, float density, const hsColorRGBA *color = nil );