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

Merge remote-tracking branch 'origin/master' into plString

Conflicts:
	Sources/Plasma/CoreLib/hsStream.h
	Sources/Plasma/FeatureLib/pfAudio/plListener.cpp
	Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
	Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp
	Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp
	Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
	Sources/Plasma/FeatureLib/pfPython/cyMisc.h
	Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp
	Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp
	Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h
	Sources/Plasma/FeatureLib/pfPython/pyImage.cpp
	Sources/Plasma/FeatureLib/pfPython/pyJournalBook.cpp
	Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h
	Sources/Plasma/NucleusLib/pnKeyedObject/plFixedKey.cpp
	Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.cpp
	Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp
	Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.h
	Sources/Plasma/NucleusLib/pnMessage/plMessage.h
	Sources/Plasma/NucleusLib/pnNetCommon/plNetApp.h
	Sources/Plasma/PubUtilLib/plAvatar/plCoopCoordinator.cpp
	Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpansExport.cpp
	Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp
	Sources/Plasma/PubUtilLib/plDrawable/plWaveSet7.cpp
	Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.h
	Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.h
	Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.h
	Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp
	Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.h
	Sources/Plasma/PubUtilLib/plNetTransport/plNetTransportMember.h
	Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp
	Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp
	Sources/Plasma/PubUtilLib/plPipeline/plPlates.cpp
	Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp
	Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.h
	Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp
	Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.h
	Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.cpp
	Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.h
	Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp
This commit is contained in:
2012-01-28 17:20:01 -08:00
1722 changed files with 24149 additions and 27599 deletions

View File

@ -72,13 +72,13 @@ void plClientGuid::SetAccountUUID(const plUUID & v )
SetAccountUUID( &v );
}
void plClientGuid::SetBuildType(UInt8 type)
void plClientGuid::SetBuildType(uint8_t type)
{
fBuildType=type;
fFlags|=kBuildType;
}
void plClientGuid::SetPlayerID(UInt32 id)
void plClientGuid::SetPlayerID(uint32_t id)
{
fPlayerID=id;
if ( fPlayerID )
@ -90,7 +90,7 @@ void plClientGuid::SetPlayerID(UInt32 id)
fFlags&=~kPlayerID;
}
void plClientGuid::SetTempPlayerID(UInt32 id)
void plClientGuid::SetTempPlayerID(uint32_t id)
{
fPlayerID=id;
if ( fPlayerID )
@ -113,7 +113,7 @@ void plClientGuid::SetPlayerName( const plString & v )
fFlags&=~kPlayerName;
}
void plClientGuid::SetCCRLevel(UInt8 v)
void plClientGuid::SetCCRLevel(uint8_t v)
{
fCCRLevel=v;
fFlags|=kCCRLevel;
@ -125,7 +125,7 @@ void plClientGuid::SetProtectedLogin(bool b)
fFlags |= kProtectedLogin;
}
void plClientGuid::SetSrcAddr( UInt32 v )
void plClientGuid::SetSrcAddr( uint32_t v )
{
fSrcAddr = v;
if ( fSrcAddr )
@ -139,7 +139,7 @@ void plClientGuid::SetSrcAddrFromStr( const char * s )
hsAssert(false, "eric, port me");
}
void plClientGuid::SetSrcPort( UInt16 v )
void plClientGuid::SetSrcPort( uint16_t v )
{
fSrcPort = v;
if ( fSrcPort )

View File

@ -42,24 +42,24 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plClientGuid_h_inc
#define plClientGuid_h_inc
#include "hsConfig.h"
#include "HeadSpin.h"
#include "hsStlUtils.h"
#include "pnFactory/plCreatable.h"
#include "pnUUID/pnUUID.h"
class plClientGuid : public plCreatable
{
UInt16 fFlags;
plUUID fAccountUUID;
UInt32 fPlayerID;
UInt8 fCCRLevel;
bool fProtectedLogin;
UInt8 fBuildType; // see plNetCommon.h
plString fPlayerName;
UInt32 fSrcAddr;
UInt16 fSrcPort;
bool fReserved;
plString fClientKey;
uint16_t fFlags;
plUUID fAccountUUID;
uint32_t fPlayerID;
uint8_t fCCRLevel;
bool fProtectedLogin;
uint8_t fBuildType; // see plNetCommon.h
plString fPlayerName;
uint32_t fSrcAddr;
uint16_t fSrcPort;
bool fReserved;
plString fClientKey;
public:
enum Flags // 16 bits.
@ -86,7 +86,7 @@ public:
void CopyFrom(const plClientGuid * other);
void UpdateFrom(const plClientGuid * other);
bool IsEqualTo(const plClientGuid * other) const;
bool IsFlagSet( UInt16 flag ) const { return (fFlags&flag)!=0; }
bool IsFlagSet( uint16_t flag ) const { return (fFlags&flag)!=0; }
bool IsFullyQualified() const { return HasAccountUUID()&&HasPlayerID();}
void Read(hsStream * s, hsResMgr* =nil);
@ -104,35 +104,35 @@ public:
bool HasClientKey() const { return (fFlags&kClientKey)!=0;}
const plUUID * GetAccountUUID() const { return &fAccountUUID;}
UInt32 GetPlayerID() const { return fPlayerID;}
uint32_t GetPlayerID() const { return fPlayerID;}
const plString & GetPlayerName() const { return fPlayerName; }
UInt8 GetCCRLevel() const { return fCCRLevel; }
uint8_t GetCCRLevel() const { return fCCRLevel; }
bool GetProtectedLogin() const { return ( fProtectedLogin!=0 ); }
UInt8 GetFlags() const { return (UInt8)fFlags;}
UInt8 GetBuildType() const { return fBuildType;}
UInt32 GetSrcAddr() const { return fSrcAddr; }
uint8_t GetFlags() const { return (uint8_t)fFlags;}
uint8_t GetBuildType() const { return fBuildType;}
uint32_t GetSrcAddr() const { return fSrcAddr; }
const char * GetSrcAddrStr() const;
UInt16 GetSrcPort() const { return fSrcPort; }
uint16_t GetSrcPort() const { return fSrcPort; }
bool IsReserved() const { return fReserved!=0; }
const plString& GetClientKey() const { return fClientKey; }
void SetAccountUUID(const plUUID * v);
void SetAccountUUID(const plUUID & v);
void SetPlayerID(UInt32 v);
void SetPlayerID(uint32_t v);
void SetPlayerName( const plString & v );
void SetCCRLevel(UInt8 v);
void SetCCRLevel(uint8_t v);
void SetProtectedLogin(bool v);
void SetBuildType(UInt8 v);
void SetSrcAddr( UInt32 v );
void SetBuildType(uint8_t v);
void SetSrcAddr( uint32_t v );
void SetSrcAddrFromStr( const char * s );
void SetSrcPort( UInt16 v );
void SetSrcPort( uint16_t v );
void SetReserved( bool v );
void SetClientKey( const plString& key );
// When a client hasn't selected a player yet,
// we need to uniquely identify them in the lobby server.
// We do this by stuffing a temp value into the fPlayerID
// while keeping the kPlayerID flag cleared.
void SetTempPlayerID(UInt32 id);
void SetTempPlayerID(uint32_t id);
friend bool operator==(const plClientGuid & X, const plClientGuid & Y);
friend bool operator!=(const plClientGuid & X, const plClientGuid & Y);

View File

@ -40,7 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "hsTypes.h"
#include "HeadSpin.h"
#include "hsStream.h"
#include "hsStlUtils.h"
#include "plNetCommonHelpers.h"
@ -52,7 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
////////////////////////////////////////////////////////////////////
#ifndef SERVER
const UInt8 plNetCoreStatsSummary::StreamVersion = 1;
const uint8_t plNetCoreStatsSummary::StreamVersion = 1;
plNetCoreStatsSummary::plNetCoreStatsSummary()
:fULBitsPS(0),
@ -67,7 +67,7 @@ fDLDroppedPackets(0)
void plNetCoreStatsSummary::Read(hsStream* s, hsResMgr*)
{
UInt8 streamVer;
uint8_t streamVer;
s->ReadLE(&streamVer);
hsAssert(streamVer==StreamVersion,"plNetCoreStatsSummary invalid stream version.");
s->ReadLE(&fULBitsPS);
@ -122,7 +122,7 @@ void plCreatableListHelper::CopyFrom( const plCreatableListHelper * other, bool
}
void plCreatableListHelper::AddItem( UInt16 id, plCreatable * item, bool manageItem )
void plCreatableListHelper::AddItem( uint16_t id, plCreatable * item, bool manageItem )
{
RemoveItem( id );
fItems[id] = item;
@ -130,12 +130,12 @@ void plCreatableListHelper::AddItem( UInt16 id, plCreatable * item, bool manageI
fManagedItems.push_back( item );
}
void plCreatableListHelper::AddItem( UInt16 id, const plCreatable * item, bool manageItem )
void plCreatableListHelper::AddItem( uint16_t id, const plCreatable * item, bool manageItem )
{
AddItem( id, const_cast<plCreatable*>( item ), manageItem );
}
void plCreatableListHelper::RemoveItem( UInt16 id, bool unManageItem )
void plCreatableListHelper::RemoveItem( uint16_t id, bool unManageItem )
{
plCreatable * item = GetItem( id );
if ( !item )
@ -150,9 +150,9 @@ void plCreatableListHelper::RemoveItem( UInt16 id, bool unManageItem )
fItems.erase( id );
}
plCreatable * plCreatableListHelper::GetItem( UInt16 id, bool unManageItem/*=false */) const
plCreatable * plCreatableListHelper::GetItem( uint16_t id, bool unManageItem/*=false */) const
{
std::map<UInt16,plCreatable*>::const_iterator it=fItems.find( id );
std::map<uint16_t,plCreatable*>::const_iterator it=fItems.find( id );
if ( it!=fItems.end() )
{
if ( unManageItem )
@ -166,52 +166,52 @@ plCreatable * plCreatableListHelper::GetItem( UInt16 id, bool unManageItem/*=fal
return nil;
}
bool plCreatableListHelper::ItemExists( UInt16 id ) const
bool plCreatableListHelper::ItemExists( uint16_t id ) const
{
return ( fItems.find( id )!=fItems.end() );
}
void plCreatableListHelper::AddString(UInt16 id, const char * value)
void plCreatableListHelper::AddString(uint16_t id, const char * value)
{
plCreatableGenericValue * V = TRACKED_NEW plCreatableGenericValue();
plCreatableGenericValue * V = new plCreatableGenericValue();
V->Value().SetString( (char*)value );
AddItem( id, V, true );
}
void plCreatableListHelper::AddString( UInt16 id, std::string & value )
void plCreatableListHelper::AddString( uint16_t id, std::string & value )
{
AddString( id, value.c_str() );
}
void plCreatableListHelper::AddInt( UInt16 id, Int32 value )
void plCreatableListHelper::AddInt( uint16_t id, int32_t value )
{
plCreatableGenericValue * V = TRACKED_NEW plCreatableGenericValue();
plCreatableGenericValue * V = new plCreatableGenericValue();
V->Value().SetInt(value);
AddItem( id, V, true );
}
void plCreatableListHelper::AddDouble( UInt16 id, double value )
void plCreatableListHelper::AddDouble( uint16_t id, double value )
{
plCreatableGenericValue * V = TRACKED_NEW plCreatableGenericValue();
plCreatableGenericValue * V = new plCreatableGenericValue();
V->Value().SetDouble(value);
AddItem( id, V, true );
}
const char * plCreatableListHelper::GetString( UInt16 id )
const char * plCreatableListHelper::GetString( uint16_t id )
{
plCreatableGenericValue * V = plCreatableGenericValue::ConvertNoRef( GetItem( id ) );
if ( !V ) return nil;
return (const char *)V->Value();
}
Int32 plCreatableListHelper::GetInt( UInt16 id )
int32_t plCreatableListHelper::GetInt( uint16_t id )
{
plCreatableGenericValue * V = plCreatableGenericValue::ConvertNoRef( GetItem( id ) );
if ( !V ) return 0;
return (Int32)V->Value();
return (int32_t)V->Value();
}
double plCreatableListHelper::GetDouble( UInt16 id )
double plCreatableListHelper::GetDouble( uint16_t id )
{
plCreatableGenericValue * V = plCreatableGenericValue::ConvertNoRef( GetItem( id ) );
if ( !V ) return 0;
@ -228,22 +228,22 @@ void plCreatableListHelper::Read( hsStream* s, hsResMgr* mgr )
fFlags &= ~kWritten;
UInt32 bufSz;
uint32_t bufSz;
s->LogReadLE( &bufSz, "BufSz" );
std::string buf;
buf.resize( bufSz );
if ( fFlags&kCompressed )
{
UInt32 zBufSz;
uint32_t zBufSz;
s->LogReadLE( &zBufSz, "Compressed BufSz" );
std::string zBuf;
zBuf.resize( zBufSz );
s->LogSubStreamPushDesc("Compressed Data");
s->Read( zBufSz, (void*)zBuf.data() );
plZlibCompress compressor;
UInt32 tmp;
hsBool ans = compressor.Uncompress( (UInt8*)buf.data(), &tmp, (UInt8*)zBuf.data(), zBufSz );
uint32_t tmp;
hsBool ans = compressor.Uncompress( (uint8_t*)buf.data(), &tmp, (uint8_t*)zBuf.data(), zBufSz );
hsAssert( ans!=0, "plCreatableListHelper: Failed to uncompress buffer." );
hsAssert( tmp==bufSz, "compression size mismatch" );
fFlags&=~kCompressed;
@ -257,12 +257,12 @@ void plCreatableListHelper::Read( hsStream* s, hsResMgr* mgr )
hsReadOnlyStream ram( bufSz, (void*)buf.data() );
UInt16 nItems;
uint16_t nItems;
ram.ReadLE( &nItems );
for ( int i=0; i<nItems; i++ )
{
UInt16 id;
UInt16 classIdx;
uint16_t id;
uint16_t classIdx;
ram.ReadLE( &id );
ram.ReadLE( &classIdx );
plCreatable * object = plFactory::Create( classIdx );
@ -282,20 +282,20 @@ void plCreatableListHelper::Write( hsStream* s, hsResMgr* mgr )
{
// write items to ram stream
hsRAMStream ram;
UInt16 nItems = fItems.size();
uint16_t nItems = fItems.size();
ram.WriteLE( nItems );
for ( std::map<UInt16,plCreatable*>::iterator ii=fItems.begin(); ii!=fItems.end(); ++ii )
for ( std::map<uint16_t,plCreatable*>::iterator ii=fItems.begin(); ii!=fItems.end(); ++ii )
{
UInt16 id = ii->first;
uint16_t id = ii->first;
plCreatable * item = ii->second;
UInt16 classIdx = item->ClassIndex();
uint16_t classIdx = item->ClassIndex();
ram.WriteLE( id );
ram.WriteLE( classIdx );
item->Write( &ram, mgr );
}
// read ram stream into a buffer
UInt32 bufSz = ram.GetPosition();
uint32_t bufSz = ram.GetPosition();
ram.Rewind();
std::string buf;
buf.resize( bufSz );
@ -305,10 +305,10 @@ void plCreatableListHelper::Write( hsStream* s, hsResMgr* mgr )
if ( fFlags&kWantCompression && bufSz>fCompressionThreshold )
{
plZlibCompress compressor;
UInt32 zBufSz;
uint32_t zBufSz;
std::string zBuf;
zBuf.resize( bufSz );
hsBool ans = compressor.Compress( (UInt8*)zBuf.data(), &zBufSz, (const UInt8*)buf.data(), bufSz );
hsBool ans = compressor.Compress( (uint8_t*)zBuf.data(), &zBufSz, (const uint8_t*)buf.data(), bufSz );
bool compressed = ( ans && zBufSz );
hsAssert( compressed, "plCreatableListHelper: Failed to compress buffer." );
if ( compressed )
@ -327,12 +327,12 @@ void plCreatableListHelper::Write( hsStream* s, hsResMgr* mgr )
if ( fFlags&kCompressed )
{
UInt32 zBufSz = buf.size();
uint32_t zBufSz = buf.size();
ram.WriteLE( zBufSz );
}
ram.Write( buf.size(), buf.data() );
UInt32 sz = ram.GetPosition();
uint32_t sz = ram.GetPosition();
ram.Rewind();
fWritten.resize( sz );
@ -346,15 +346,15 @@ void plCreatableListHelper::Write( hsStream* s, hsResMgr* mgr )
void plCreatableListHelper::GetItemsAsVec( std::vector<plCreatable*>& out )
{
for ( std::map<UInt16,plCreatable*>::iterator ii=fItems.begin(); ii!=fItems.end(); ++ii )
for ( std::map<uint16_t,plCreatable*>::iterator ii=fItems.begin(); ii!=fItems.end(); ++ii )
{
out.push_back( ii->second );
}
}
void plCreatableListHelper::GetItems( std::map<UInt16,plCreatable*>& out )
void plCreatableListHelper::GetItems( std::map<uint16_t,plCreatable*>& out )
{
for ( std::map<UInt16,plCreatable*>::iterator ii=fItems.begin(); ii!=fItems.end(); ++ii )
for ( std::map<uint16_t,plCreatable*>::iterator ii=fItems.begin(); ii!=fItems.end(); ++ii )
{
out[ii->first] = ii->second;
}

View File

@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plNetCommonHelpers_h_inc
#define plNetCommonHelpers_h_inc
#include "hsTypes.h"
#include "HeadSpin.h"
#include "hsStlUtils.h"
#include "hsTimer.h"
#include "pnNetCommon/pnNetCommon.h"
@ -54,14 +54,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef SERVER
class plNetCoreStatsSummary : public plCreatable
{
static const UInt8 StreamVersion;
static const uint8_t StreamVersion;
float fULBitsPS;
float fDLBitsPS;
float fULPeakBitsPS;
float fDLPeakBitsPS;
float fULPeakPktsPS;
float fDLPeakPktsPS;
UInt32 fDLDroppedPackets;
uint32_t fDLDroppedPackets;
public:
plNetCoreStatsSummary();
CLASSNAME_REGISTER( plNetCoreStatsSummary );
@ -74,7 +74,7 @@ public:
float GetDLPeakBitsPS() const { return fDLPeakBitsPS; }
float GetULPeakPktsPS() const { return fULPeakPktsPS; }
float GetDLPeakPktsPS() const { return fDLPeakPktsPS; }
UInt32 GetDLDroppedPackets() const { return fDLDroppedPackets; }
uint32_t GetDLDroppedPackets() const { return fDLDroppedPackets; }
};
#endif // SERVER
@ -90,10 +90,10 @@ class plCreatableListHelper : public plCreatable
kCompressed = 1<<1,
kWritten = 1<<2,
};
UInt8 fFlags;
std::map<UInt16,plCreatable*> fItems;
uint8_t fFlags;
std::map<uint16_t,plCreatable*> fItems;
mutable std::vector<plCreatable*> fManagedItems;
UInt32 fCompressionThreshold; // NOT WRITTEN
uint32_t fCompressionThreshold; // NOT WRITTEN
std::string fWritten;
void IClearItems();
@ -111,26 +111,26 @@ public:
void SetWantCompression( bool v ) { if ( v ) fFlags|=kWantCompression; else fFlags&=~kWantCompression; }
bool WantCompression() const { return ( fFlags&kWantCompression )!=0; }
UInt32 GetCompressionThreshold() const { return fCompressionThreshold; }
void SetCompressionThreshold( UInt32 v ) { fCompressionThreshold=v; }
uint32_t GetCompressionThreshold() const { return fCompressionThreshold; }
void SetCompressionThreshold( uint32_t v ) { fCompressionThreshold=v; }
// support for generic arguments
void AddItem( UInt16 id, plCreatable * item, bool manageItem=false );
void AddItem( UInt16 id, const plCreatable * item, bool manageItem=false );
plCreatable* GetItem( UInt16 id, bool unManageItem=false ) const;
void RemoveItem( UInt16 id, bool unManageItem=false );
bool ItemExists( UInt16 id ) const;
void AddItem( uint16_t id, plCreatable * item, bool manageItem=false );
void AddItem( uint16_t id, const plCreatable * item, bool manageItem=false );
plCreatable* GetItem( uint16_t id, bool unManageItem=false ) const;
void RemoveItem( uint16_t id, bool unManageItem=false );
bool ItemExists( uint16_t id ) const;
int GetNumItems() const { return fItems.size();}
// helpers for typed arguments
void AddString( UInt16 id, const char * value );
void AddString( UInt16 id, std::string & value );
const char * GetString( UInt16 id );
void AddInt( UInt16 id, Int32 value );
Int32 GetInt( UInt16 id );
void AddDouble( UInt16 id, double value );
double GetDouble( UInt16 id );
void AddString( uint16_t id, const char * value );
void AddString( uint16_t id, std::string & value );
const char * GetString( uint16_t id );
void AddInt( uint16_t id, int32_t value );
int32_t GetInt( uint16_t id );
void AddDouble( uint16_t id, double value );
double GetDouble( uint16_t id );
void GetItemsAsVec( std::vector<plCreatable*>& out );
void GetItems( std::map<UInt16,plCreatable*>& out );
void GetItems( std::map<uint16_t,plCreatable*>& out );
};
/////////////////////////////////////////////////////////////////////

View File

@ -42,8 +42,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef PLNETMEMBER_inc
#define PLNETMEMBER_inc
#include "hsConfig.h"
#include "hsUtils.h"
#include "HeadSpin.h"
#include "hsStlUtils.h"
#include "pnFactory/plCreatable.h"
@ -72,8 +72,8 @@ protected:
friend class plNetClientMsgHandler;
friend class plNetClientGamePlayMsgHandler;
Int32 fPeerID; // low-level netPlayer object for msg send/recv
UInt32 fFlags;
int32_t fPeerID; // low-level netPlayer object for msg send/recv
uint32_t fFlags;
plNetApp* fNetApp;
// these calls should be made by the client/server app only,
@ -91,15 +91,15 @@ public:
virtual bool IsEqualTo(const plNetMember * other) const = 0;
// getters
Int32 GetPeerID() const { return fPeerID; }
UInt32 GetFlags() const { return fFlags; }
int32_t GetPeerID() const { return fPeerID; }
uint32_t GetFlags() const { return fFlags; }
plNetApp* GetNetApp() { return fNetApp; }
virtual plString AsString() const = 0;
// setters
void SetFlags(UInt32 f) { fFlags=f; }
void SetFlags(uint32_t f) { fFlags=f; }
void SetNetApp(plNetApp* n) { fNetApp=n; }
void SetPeerID(Int32 p) { fPeerID=p; }
void SetPeerID(int32_t p) { fPeerID=p; }
};
#endif // PLNETMEMBER_inc

View File

@ -42,8 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plNetMsgHandler_inc
#define plNetMsgHandler_inc
#include "hsConfig.h"
#include "hsTypes.h" // for nil
#include "HeadSpin.h"
class plNetMessage;
class plNetApp;

View File

@ -39,7 +39,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021
*==LICENSE==*/
#include "hsTypes.h"
#include "HeadSpin.h"
#include "plNetMsgScreener.h"
#include "plCreatableIndex.h"
@ -65,7 +65,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//
// say why the msg got rejected
//
void plNetMsgScreener::IRejectLogMsg(Int16 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",
plFactory::GetNameOfClass(classIndex), desc, IGetAgeName(), IGetSenderName(gm));
@ -88,7 +88,7 @@ void plNetMsgScreener::IRejectLogMsg(const plMessage* msg, const char* desc, con
// Try to accept/reject quickly
// the netMsg arg has been peeked except for the stream
//
plNetMsgScreener::Answer plNetMsgScreener::IAllowMessageType(Int16 classIndex, const plNetGameMember* gm) const
plNetMsgScreener::Answer plNetMsgScreener::IAllowMessageType(int16_t classIndex, const plNetGameMember* gm) const
{
// Check based on baseclass
if (plFactory::DerivesFrom(plCCRMessage::Index(), classIndex))

View File

@ -69,11 +69,11 @@ protected:
virtual bool IIsLocalArmatureModKey(plKey key, const plNetGameMember* gm) const { return true; }
virtual void ILogChatMessage(const plMessage* msg_, const plNetGameMember* gm) const {}
virtual void ILogCCRMessage(Int16 classIndex, const plNetGameMember* gm) const {}
virtual void ILogCCRMessage(int16_t classIndex, const plNetGameMember* gm) const {}
Answer IAllowMessageType(Int16 classIndex, const plNetGameMember* gm=nil) const;
Answer IAllowMessageType(int16_t classIndex, const plNetGameMember* gm=nil) const;
bool IValidateMessage(const plMessage* msg, const plNetGameMember* gm=nil) const;
void IRejectLogMsg(Int16 classIndex, const char* desc, const plNetGameMember* gm) const;
void IRejectLogMsg(int16_t classIndex, const char* desc, const plNetGameMember* gm) const;
void IRejectLogMsg(const plMessage* msg, const char* desc, const plNetGameMember* gm) const;
virtual bool IAmClient() const = 0;
};

View File

@ -39,7 +39,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021
*==LICENSE==*/
#include "hsTypes.h"
#include "HeadSpin.h"
#include "hsStream.h"
#include "pnMessage/plMessage.h"
#include "plNetServerSessionInfo.h"
@ -291,7 +291,7 @@ void plAgeInfoStruct::SetAgeUserDefinedName( const char * v )
}
}
void plAgeInfoStruct::SetAgeSequenceNumber( UInt32 v )
void plAgeInfoStruct::SetAgeSequenceNumber( uint32_t v )
{
if ( v )
{
@ -317,7 +317,7 @@ void plAgeInfoStruct::SetAgeDescription( const char * v )
}
}
void plAgeInfoStruct::SetAgeLanguage( UInt32 v )
void plAgeInfoStruct::SetAgeLanguage( uint32_t v )
{
if ( v >= 0 )
{
@ -731,7 +731,7 @@ void plNetServerSessionInfo::SetServerName(const char * val)
}
}
void plNetServerSessionInfo::SetServerType(UInt8 val)
void plNetServerSessionInfo::SetServerType(uint8_t val)
{
if (val>0)
{
@ -759,7 +759,7 @@ void plNetServerSessionInfo::SetServerAddr(const char * val)
}
}
void plNetServerSessionInfo::SetServerPort(UInt16 val)
void plNetServerSessionInfo::SetServerPort(uint16_t val)
{
if (val>0)
{

View File

@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plNetServerSessionInfo_h_inc
#define plNetServerSessionInfo_h_inc
#include "hsTypes.h"
#include "HeadSpin.h"
#include "hsStlUtils.h"
#include "pnFactory/plCreatable.h"
#include "pnNetCommon/plNetServers.h"
@ -60,7 +60,7 @@ class plVaultAgeLinkNode;
class plAgeInfoStruct : public plCreatable
{
mutable UInt8 fFlags;
mutable uint8_t fFlags;
// Age dataset name "Neighborhood"
std::string fAgeFilename;
@ -79,10 +79,10 @@ class plAgeInfoStruct : public plCreatable
// A modifier to user-defined name to make it unique in gui lists.
// Assigned by vault server.
Int32 fAgeSequenceNumber;
int32_t fAgeSequenceNumber;
// The language of the client that created this age
Int32 fAgeLanguage;
int32_t fAgeLanguage;
mutable std::string fDisplayName;
@ -97,9 +97,9 @@ class plAgeInfoStruct : public plCreatable
kHasAgeLanguage = 1<<6,
};
void SetFlag( UInt8 bit, bool on=true ) const { (on)?fFlags|=bit:fFlags&=~bit;}
void ClearFlag( UInt8 bit ) { fFlags&=~bit;}
bool IsFlagSet( UInt8 bit ) const { return (fFlags&bit)!=0;}
void SetFlag( uint8_t bit, bool on=true ) const { (on)?fFlags|=bit:fFlags&=~bit;}
void ClearFlag( uint8_t bit ) { fFlags&=~bit;}
bool IsFlagSet( uint8_t bit ) const { return (fFlags&bit)!=0;}
public:
plAgeInfoStruct()
@ -123,16 +123,16 @@ public:
const plUUID * GetAgeInstanceGuid() const { return &fAgeInstanceGuid; }
const char * GetAgeUserDefinedName() const { return fAgeUserDefinedName.c_str(); }
const char * GetAgeDescription() const { return fAgeDescription.c_str(); }
UInt32 GetAgeSequenceNumber() const { return fAgeSequenceNumber; }
UInt32 GetAgeLanguage() const { return fAgeLanguage; }
uint32_t GetAgeSequenceNumber() const { return fAgeSequenceNumber; }
uint32_t GetAgeLanguage() const { return fAgeLanguage; }
void SetAgeFilename( const char * v );
void SetAgeInstanceName( const char * v );
void SetAgeInstanceGuid( const plUUID * v );
void SetAgeUserDefinedName( const char * v );
void SetAgeDescription( const char * v );
void SetAgeSequenceNumber( UInt32 v );
void SetAgeLanguage( UInt32 v );
void SetAgeSequenceNumber( uint32_t v );
void SetAgeLanguage( uint32_t v );
bool HasAgeFilename() const { return IsFlagSet( kHasAgeFilename ); }
bool HasAgeInstanceName() const { return IsFlagSet( kHasAgeInstanceName ); }
@ -154,19 +154,19 @@ public:
class plAgeLinkStruct : public plCreatable
{
UInt16 fFlags;
uint16_t fFlags;
// Where we want to link.
plAgeInfoStruct fAgeInfo;
// The linking rule to use. See plNetCommon::LinkingRules
Int8 fLinkingRules;
int8_t fLinkingRules;
// Where to spawn avatar when we load the age specified in fAgeInfo
plSpawnPointInfo fSpawnPoint;
// Override PLS/MCP load balancing rules for CCRs.
UInt8 fAmCCR;
uint8_t fAmCCR;
// If this is a child age link, who is the parent
// ...Age dataset name like "Neighborhood"
@ -183,9 +183,9 @@ class plAgeLinkStruct : public plCreatable
kHasParentAgeFilename = 1<<6,
};
void SetFlag( UInt16 bit, bool on=true ) { (on)?fFlags|=bit:fFlags&=~bit;}
void ClearFlag( UInt16 bit ) { fFlags&=~bit;}
bool IsFlagSet( UInt16 bit ) const { return (fFlags&bit)!=0;}
void SetFlag( uint16_t bit, bool on=true ) { (on)?fFlags|=bit:fFlags&=~bit;}
void ClearFlag( uint16_t bit ) { fFlags&=~bit;}
bool IsFlagSet( uint16_t bit ) const { return (fFlags&bit)!=0;}
public:
plAgeLinkStruct();
@ -230,11 +230,11 @@ public:
class plNetServerSessionInfo : public plCreatable
{
UInt8 fFlags;
uint8_t fFlags;
std::string fServerName;
UInt8 fServerType;
uint8_t fServerType;
std::string fServerAddr;
UInt16 fServerPort;
uint16_t fServerPort;
plUUID fServerGuid;
enum
@ -246,9 +246,9 @@ class plNetServerSessionInfo : public plCreatable
kHasServerGuid = 1<<4,
};
void SetFlag( UInt8 bit ) { fFlags|=bit;}
void ClearFlag( UInt8 bit ) { fFlags&=~bit;}
bool IsFlagSet( UInt8 bit ) const { return (fFlags&bit)!=0;}
void SetFlag( uint8_t bit ) { fFlags|=bit;}
void ClearFlag( uint8_t bit ) { fFlags&=~bit;}
bool IsFlagSet( uint8_t bit ) const { return (fFlags&bit)!=0;}
public:
plNetServerSessionInfo()
@ -260,16 +260,16 @@ public:
GETINTERFACE_ANY( plNetServerSessionInfo, plCreatable );
void SetServerName(const char * val);
void SetServerType(UInt8 val);
void SetServerType(uint8_t val);
void SetServerAddr(const char * val);
void SetServerPort(UInt16 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 GetServerType() const { return fServerType;}
uint8_t GetServerType() const { return fServerType;}
const char * GetServerAddr() const { return fServerAddr.c_str(); }
UInt16 GetServerPort() const { return fServerPort; }
uint16_t GetServerPort() const { return fServerPort; }
const plUUID *GetServerGuid() const { return &fServerGuid; }
plUUID * GetServerGuid() { return &fServerGuid; }
@ -309,7 +309,7 @@ public:
//class plAgeLinkingInfo : public plCreatable
//{
// int fLinkingRules;
// UInt32 fPlayerID;
// uint32_t fPlayerID;
// hsBool8 fSuperUser;
// mutable plAgeInfoStruct fAgeInfo;
// mutable plNetServerSessionInfo fServerInfo;
@ -322,8 +322,8 @@ public:
//
// int GetLinkingRules( void ) const { return fLinkingRules;}
// void SetLinkingRules( int v ) { fLinkingRules=v;}
// UInt32 GetPlayerID( void ) const { return fPlayerID;}
// void SetPlayerID( UInt32 v ) { fPlayerID=v;}
// uint32_t GetPlayerID( void ) const { return fPlayerID;}
// void SetPlayerID( uint32_t v ) { fPlayerID=v;}
// void SetSuperUser(bool b) { fSuperUser=b; }
// bool GetSuperUser() const { return fSuperUser ? true : false; }
//

View File

@ -57,19 +57,19 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// Taken from plUnifiedTime, in turn taken from python source.
// TODO: Move this down to CoreLib someday (and rename it maybe).
#define MAGICWINDOWSOFFSET ((__int64)11644473600)
static UInt32 SecsSinceUNIXEpoch()
static uint32_t SecsSinceUNIXEpoch()
{
FILETIME ft;
GetSystemTimeAsFileTime(&ft); /* 100 ns blocks since 01-Jan-1641 */
__int64 ff,ffsecs;
ff = *(__int64*)(&ft);
ffsecs = ff/(__int64)10000000;
return (UInt32)(ffsecs-MAGICWINDOWSOFFSET);
return (uint32_t)(ffsecs-MAGICWINDOWSOFFSET);
}
#else
static UInt32 SecsSinceUNIXEpoch()
static uint32_t SecsSinceUNIXEpoch()
{
struct timeval tv;
gettimeofday(&tv, nil);
@ -81,7 +81,7 @@ static UInt32 SecsSinceUNIXEpoch()
////////////////////////////////////////////////////////////////////
UInt32 plServerGuid::fGuidSeed = 0;
uint32_t plServerGuid::fGuidSeed = 0;
plServerGuid::plServerGuid()
{
@ -244,7 +244,7 @@ void plServerGuid::Clear()
memset(N,0,kGuidBytes);
}
void plServerGuid::SetGuidSeed(UInt32 seed)
void plServerGuid::SetGuidSeed(uint32_t seed)
{
fGuidSeed = seed;
}
@ -261,7 +261,7 @@ plServerGuid plServerGuid::GenerateGuid()
// Current Time: 24 bits (seconds. ~8.5 year cycle)
// Counter: 16 bits (always increasing per process)
static UInt16 StaticCounter = 0;
static uint16_t StaticCounter = 0;
if (!fGuidSeed)
{
hsStatusMessage( "fGuidSeed not set yet. Cannot generate a reliable guid! Setting fGuidSeed=getpid()." );
@ -269,15 +269,15 @@ plServerGuid plServerGuid::GenerateGuid()
fGuidSeed = getpid();
}
UInt32 currTime = SecsSinceUNIXEpoch();
uint32_t currTime = SecsSinceUNIXEpoch();
plServerGuid guid;
guid.N[0] = (UInt8)((fGuidSeed & 0x00FF0000)>>16);
guid.N[1] = (UInt8)((fGuidSeed & 0x0000FF00)>> 8);
guid.N[2] = (UInt8)(fGuidSeed & 0x000000FF);
guid.N[3] = (UInt8)((currTime & 0x00FF0000)>>16);
guid.N[4] = (UInt8)((currTime & 0x0000FF00)>> 8);
guid.N[5] = (UInt8)(currTime & 0x000000FF);
guid.N[0] = (uint8_t)((fGuidSeed & 0x00FF0000)>>16);
guid.N[1] = (uint8_t)((fGuidSeed & 0x0000FF00)>> 8);
guid.N[2] = (uint8_t)(fGuidSeed & 0x000000FF);
guid.N[3] = (uint8_t)((currTime & 0x00FF0000)>>16);
guid.N[4] = (uint8_t)((currTime & 0x0000FF00)>> 8);
guid.N[5] = (uint8_t)(currTime & 0x000000FF);
guid.N[6] = (StaticCounter & 0xFF00)>> 8;
guid.N[7] = (StaticCounter & 0x00FF);

View File

@ -63,7 +63,7 @@ public:
union
{
UInt8 N[kGuidBytes];
uint8_t N[kGuidBytes];
hsWide fWide;
};
plServerGuid();
@ -94,7 +94,7 @@ public:
void CopyFrom( const plServerGuid * other );
void Clear();
static void SetGuidSeed( UInt32 seed );
static void SetGuidSeed( uint32_t seed );
static bool GuidSeedIsSet( void ) { return fGuidSeed!=0;}
static plServerGuid GenerateGuid( void );
@ -102,7 +102,7 @@ public:
GETINTERFACE_ANY( plServerGuid, plCreatable );
private:
static UInt32 fGuidSeed; // only low 24 bits are used
static uint32_t fGuidSeed; // only low 24 bits are used
};

View File

@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plSpawnPointInfo_h_inc
#define plSpawnPointInfo_h_inc
#include "hsConfig.h"
#include "hsStlUtils.h"
///////////////////////////////////////////////////////////////////