2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 10:37:41 -04:00

Convert custom HeadSpin integer types to standard types from stdint.h

This commit is contained in:
2012-01-19 21:19:26 -05:00
parent a0d54e2644
commit 5027b5a4ac
1301 changed files with 14497 additions and 14532 deletions

View File

@ -65,7 +65,7 @@ public:
{
Py_XDECREF( fPyObject );
}
void OperationStarted( UInt32 context )
void OperationStarted( uint32_t context )
{
if ( fPyObject )
{
@ -81,7 +81,7 @@ public:
}
}
}
void OperationComplete( UInt32 context, int resultCode )
void OperationComplete( uint32_t context, int resultCode )
{
if ( fPyObject )
{
@ -90,11 +90,11 @@ public:
if ( pyArgs )
{
PyObject* pyDict = PyDict_New();
std::map<UInt16,plCreatable*> args;
std::map<uint16_t,plCreatable*> args;
fCbArgs.GetItems( args );
for ( std::map<UInt16,plCreatable*>::iterator ii=args.begin(); ii!=args.end(); ++ii )
for ( std::map<uint16_t,plCreatable*>::iterator ii=args.begin(); ii!=args.end(); ++ii )
{
UInt16 key = ii->first;
uint16_t key = ii->first;
PyObject* keyObj = PyInt_FromLong(key);
char* strTemp = NULL;
plCreatable* arg = ii->second;
@ -106,12 +106,12 @@ public:
switch ( value.GetType() )
{
case plGenericType::kInt:
valueObj = PyLong_FromLong((Int32)value);
valueObj = PyLong_FromLong((int32_t)value);
PyDict_SetItem(pyDict, keyObj, valueObj);
Py_DECREF(valueObj);
break;
case plGenericType::kUInt:
valueObj = PyLong_FromUnsignedLong((UInt32)value);
valueObj = PyLong_FromUnsignedLong((uint32_t)value);
PyDict_SetItem(pyDict, keyObj, valueObj);
Py_DECREF(valueObj);
break;
@ -209,55 +209,55 @@ pyNetClientComm::~pyNetClientComm()
}
// NetAuthenticate ----------------------------------------------
int pyNetClientComm::NetAuthenticate( double maxAuthSecs, PyObject* cbClass/*=nil*/, UInt32 cbContext/*=0 */)
int pyNetClientComm::NetAuthenticate( double maxAuthSecs, PyObject* cbClass/*=nil*/, uint32_t cbContext/*=0 */)
{
return fNetClient.NetAuthenticate( maxAuthSecs, new pyNetClientCommCallback( cbClass ), cbContext );
}
// NetLeave ----------------------------------------------
int pyNetClientComm::NetLeave( UInt8 reason, PyObject* cbClass/*=nil*/, UInt32 cbContext/*=0 */)
int pyNetClientComm::NetLeave( uint8_t reason, PyObject* cbClass/*=nil*/, uint32_t cbContext/*=0 */)
{
return fNetClient.NetLeave( reason, new pyNetClientCommCallback( cbClass ), cbContext );
}
// NetPing ----------------------------------------------
int pyNetClientComm::NetPing( int serverType, int timeoutSecs/*=0*/, PyObject* cbClass/*=nil*/, UInt32 cbContext/*=0 */)
int pyNetClientComm::NetPing( int serverType, int timeoutSecs/*=0*/, PyObject* cbClass/*=nil*/, uint32_t cbContext/*=0 */)
{
return fNetClient.NetPing( serverType, timeoutSecs, new pyNetClientCommCallback( cbClass ), cbContext );
}
// NetFindAge ----------------------------------------------
int pyNetClientComm::NetFindAge( const pyAgeLinkStruct* linkInfo, PyObject* cbClass/*=nil*/, UInt32 cbContext/*=0 */)
int pyNetClientComm::NetFindAge( const pyAgeLinkStruct* linkInfo, PyObject* cbClass/*=nil*/, uint32_t cbContext/*=0 */)
{
return fNetClient.NetFindAge( linkInfo->GetAgeLink(), new pyNetClientCommCallback( cbClass ), cbContext );
}
// NetGetPlayerList ----------------------------------------------
int pyNetClientComm::NetGetPlayerList( PyObject* cbClass/*=nil*/, UInt32 cbContext/*=0 */)
int pyNetClientComm::NetGetPlayerList( PyObject* cbClass/*=nil*/, uint32_t cbContext/*=0 */)
{
return fNetClient.NetGetPlayerList( new pyNetClientCommCallback( cbClass ), cbContext );
}
// NetSetActivePlayer ----------------------------------------------
int pyNetClientComm::NetSetActivePlayer( UInt32 playerID, const char* playerName, PyObject* cbClass/*=nil*/, UInt32 cbContext/*=0 */)
int pyNetClientComm::NetSetActivePlayer( uint32_t playerID, const char* playerName, PyObject* cbClass/*=nil*/, uint32_t cbContext/*=0 */)
{
return fNetClient.NetSetActivePlayer( playerID, playerName, 0 /*ccrLevel*/, new pyNetClientCommCallback( cbClass ), cbContext );
}
// NetCreatePlayer ----------------------------------------------
int pyNetClientComm::NetCreatePlayer( const char* playerName, const char* avatarShape, UInt32 createFlags, PyObject* cbClass/*=nil*/, UInt32 cbContext/*=0 */)
int pyNetClientComm::NetCreatePlayer( const char* playerName, const char* avatarShape, uint32_t createFlags, PyObject* cbClass/*=nil*/, uint32_t cbContext/*=0 */)
{
return fNetClient.NetCreatePlayer( playerName, avatarShape, createFlags, nil, nil, nil, new pyNetClientCommCallback( cbClass ), cbContext );
}
// NetJoinAge ----------------------------------------------
int pyNetClientComm::NetJoinAge( PyObject* cbClass/*=nil*/, UInt32 cbContext/*=0 */)
int pyNetClientComm::NetJoinAge( PyObject* cbClass/*=nil*/, uint32_t cbContext/*=0 */)
{
return fNetClient.NetJoinAge( true /*tryP2P*/, true /*allowTimeout*/, new pyNetClientCommCallback( cbClass ), cbContext );
}
// NetSetTimeout ----------------------------------------------
int pyNetClientComm::NetSetTimeout( float timeoutSecs, PyObject* cbClass/*=nil*/, UInt32 cbContext/*=0 */)
int pyNetClientComm::NetSetTimeout( float timeoutSecs, PyObject* cbClass/*=nil*/, uint32_t cbContext/*=0 */)
{
return fNetClient.NetSetTimeout( timeoutSecs, new pyNetClientCommCallback( cbClass ), cbContext );
}
@ -309,7 +309,7 @@ int pyNetClientComm::SetAuthInfo( const char* acctName, const char* password )
}
// SetLogByName ----------------------------------------------
void pyNetClientComm::SetLogByName( const char * name, UInt32 flags )
void pyNetClientComm::SetLogByName( const char * name, uint32_t flags )
{
plStatusLog * log = plStatusLogMgr::GetInstance().CreateStatusLog( 80, name,
flags | plStatusLog::kTimestamp | plStatusLog::kDeleteForMe );

View File

@ -111,23 +111,23 @@ public:
// Auth with active server using auth info set earlier.
// Will timeout after maxAuthSecs elapsed.
int NetAuthenticate( double maxAuthSecs, PyObject* cbClass=nil, UInt32 cbContext=0 );
int NetAuthenticate( double maxAuthSecs, PyObject* cbClass=nil, uint32_t cbContext=0 );
// Leave the active server.
int NetLeave( UInt8 reason, PyObject* cbClass=nil, UInt32 cbContext=0 );
int NetLeave( uint8_t reason, PyObject* cbClass=nil, uint32_t cbContext=0 );
// Ping the specified server.
int NetPing( int serverType, int timeoutSecs=0, PyObject* cbClass=nil, UInt32 cbContext=0 );
int NetPing( int serverType, int timeoutSecs=0, PyObject* cbClass=nil, uint32_t cbContext=0 );
// Spawn a game for us.
int NetFindAge( const pyAgeLinkStruct* linkInfo, PyObject* cbClass=nil, UInt32 cbContext=0 );
int NetFindAge( const pyAgeLinkStruct* linkInfo, PyObject* cbClass=nil, uint32_t cbContext=0 );
// Get player list.
int NetGetPlayerList( PyObject* cbClass=nil, UInt32 cbContext=0 );
int NetGetPlayerList( PyObject* cbClass=nil, uint32_t cbContext=0 );
// Set the active player.
int NetSetActivePlayer( UInt32 playerID, const char* playerName, PyObject* cbClass=nil, UInt32 cbContext=0 );
int NetSetActivePlayer( uint32_t playerID, const char* playerName, PyObject* cbClass=nil, uint32_t cbContext=0 );
// Create a player
int NetCreatePlayer( const char* playerName, const char* avatarShape, UInt32 createFlags, PyObject* cbClass=nil, UInt32 cbContext=0 );
int NetCreatePlayer( const char* playerName, const char* avatarShape, uint32_t createFlags, PyObject* cbClass=nil, uint32_t cbContext=0 );
// Join age
int NetJoinAge( PyObject* cbClass=nil, UInt32 cbContext=0 );
int NetJoinAge( PyObject* cbClass=nil, uint32_t cbContext=0 );
// Set server-side timeout
int NetSetTimeout( float timeoutSecs, PyObject* cbClass=nil, UInt32 cbContext=0 );
int NetSetTimeout( float timeoutSecs, PyObject* cbClass=nil, uint32_t cbContext=0 );
////////////////////////////////////////////////////////////////
@ -139,7 +139,7 @@ public:
// Get/Set Log object
void SetLog( pyStatusLog* log );
void SetLogByName( const char * name, UInt32 flags=0 );
void SetLogByName( const char * name, uint32_t flags=0 );
PyObject* GetLog() const; // return pyStatusLog
// NetCore log level
@ -168,13 +168,13 @@ public:
const pyNetServerSessionInfo* GetActiveServer() const;
// Sets/clears receipt tracking for given message class.
void SetReceiptTrackingForType( UInt16 msgClassIdx, bool on );
void SetReceiptTrackingForType( uint16_t msgClassIdx, bool on );
// Adds a msg handler for a msg that is convertable to specified type.
void AddMsgHandlerForType( UInt16 msgClassIdx, pyNetClientCommMsgHandler* handler );
void AddMsgHandlerForType( uint16_t msgClassIdx, pyNetClientCommMsgHandler* handler );
// Adds a msg handler for a specific msg type.
void AddMsgHandlerForExactType( UInt16 msgClassIdx, pyNetClientCommMsgHandler* handler );
void AddMsgHandlerForExactType( uint16_t msgClassIdx, pyNetClientCommMsgHandler* handler );
void RemoveMsgHandler( pyNetClientCommMsgHandler* handler );
@ -187,9 +187,9 @@ public:
void SetMsgReceiptHandler( pyNetClientCommRcptHandler* rcptHandler );
// Send a message to the server.
int SendMsg( plNetMessage* msg, UInt32 sendFlags=0 );
int SendMsg( plNetMessage* msg, uint32_t sendFlags=0 );
// Send a message to specified peer
int SendMsg( plNetMessage* msg, plNetCore::PeerID peerID, UInt32 sendFlags=0 );
int SendMsg( plNetMessage* msg, plNetCore::PeerID peerID, uint32_t sendFlags=0 );
// Set the alive message send frequency. 0 means don't send periodic alive msgs.
void SetAliveFreq( float secs );

View File

@ -63,7 +63,7 @@ public:
{
Py_XDECREF( fPyObject );
}
void VaultOperationStarted( UInt32 context )
void VaultOperationStarted( uint32_t context )
{
if ( fPyObject )
{
@ -79,7 +79,7 @@ public:
}
}
}
void VaultOperationComplete( UInt32 context, int resultCode )
void VaultOperationComplete( uint32_t context, int resultCode )
{
if ( fPyObject )
{
@ -88,11 +88,11 @@ public:
// if ( pyArgs )
// {
// dict pyDict = dict();
// std::map<UInt16,plCreatable*> args;
// std::map<uint16_t,plCreatable*> args;
// fCbArgs.GetItems( args );
// for ( std::map<UInt16,plCreatable*>::iterator ii=args.begin(); ii!=args.end(); ++ii )
// for ( std::map<uint16_t,plCreatable*>::iterator ii=args.begin(); ii!=args.end(); ++ii )
// {
// UInt16 key = ii->first;
// uint16_t key = ii->first;
// plCreatable* arg = ii->second;
// plCreatableGenericValue * genValue = plCreatableGenericValue::ConvertNoRef( arg );
// if ( genValue )
@ -244,13 +244,13 @@ bool pyVNodeMgr::IIsThisMe( plVaultPlayerNode * node ) const
}
// ISendNetMsg ----------------------------------------------
int pyVNodeMgr::ISendNetMsg( plNetMsgVault* msg, UInt32 sendFlags/*=0 */)
int pyVNodeMgr::ISendNetMsg( plNetMsgVault* msg, uint32_t sendFlags/*=0 */)
{
return fMyComm->GetNetClientComm()->SendMsg( msg, sendFlags );
}
// IGetPlayerID ----------------------------------------------
UInt32 pyVNodeMgr::IGetPlayerID() const
uint32_t pyVNodeMgr::IGetPlayerID() const
{
return fMyComm->GetNetClientComm()->GetPlayerID();
}
@ -281,7 +281,7 @@ bool pyVNodeMgr::IsConnected()
}
// Disconnect ----------------------------------------------
void pyVNodeMgr::Disconnect( PyObject* cb/*=nil*/, UInt32 cbContext/*=0 */)
void pyVNodeMgr::Disconnect( PyObject* cb/*=nil*/, uint32_t cbContext/*=0 */)
{
// disconnect from allplayers and globalsdl folders
plVaultNodeRef * out;
@ -301,16 +301,16 @@ void pyVNodeMgr::Disconnect( PyObject* cb/*=nil*/, UInt32 cbContext/*=0 */)
}
// Connect ----------------------------------------------
void pyVNodeMgr::Connect( int childFetchLevel/*=plVault::kFetchAllChildren*/, PyObject* cb/*=nil*/, UInt32 cbContext/*=0 */)
void pyVNodeMgr::Connect( int childFetchLevel/*=plVault::kFetchAllChildren*/, PyObject* cb/*=nil*/, uint32_t cbContext/*=0 */)
{
plVNodeMgr::Connect( childFetchLevel, new pyVaultOperationCallback( cb ), cbContext );
}
// FetchNode ----------------------------------------------
bool pyVNodeMgr::FetchNode( UInt32 nodeID,
bool pyVNodeMgr::FetchNode( uint32_t nodeID,
int childFetchLevel/*=plVault::kFetchAllChildren*/,
PyObject* cb/*=nil*/,
UInt32 cbContext/*=0 */)
uint32_t cbContext/*=0 */)
{
return plVNodeMgr::FetchNode( nodeID, childFetchLevel, new pyVaultOperationCallback( cb ), cbContext );
}
@ -322,13 +322,13 @@ PyObject* pyVNodeMgr::GetRootNode() const
}
// GetClientID ----------------------------------------------
UInt32 pyVNodeMgr::GetClientID() const
uint32_t pyVNodeMgr::GetClientID() const
{
return plVNodeMgr::GetClientID();
}
// GetNode ----------------------------------------------
PyObject* pyVNodeMgr::GetNode( UInt32 id ) const
PyObject* pyVNodeMgr::GetNode( uint32_t id ) const
{
plVaultNode * tmp;
if ( plVNodeMgr::GetNode( id, tmp ) )

View File

@ -86,8 +86,8 @@ protected:
bool IAmOnline() const;
bool IIsThisMe( plVaultPlayerInfoNode* node ) const;
bool IIsThisMe( plVaultPlayerNode * node ) const;
int ISendNetMsg( plNetMsgVault* msg, UInt32 sendFlags=0 );
UInt32 IGetPlayerID() const;
int ISendNetMsg( plNetMsgVault* msg, uint32_t sendFlags=0 );
uint32_t IGetPlayerID() const;
pyVNodeMgr(): fMyComm(nil) {fMsgHandler.setMgr(this);} // for python glue only, do NOT call
pyVNodeMgr( PyObject* thaComm );
@ -120,11 +120,11 @@ public:
bool IsConnected();
void Disconnect(
PyObject* cb=nil,
UInt32 cbContext=0 );
uint32_t cbContext=0 );
void Connect(
int childFetchLevel=plVault::kFetchAllChildren,
PyObject* cb=nil,
UInt32 cbContext=0 );
uint32_t cbContext=0 );
// TODO: Glue this.
// Fetch matching node from server and hold onto it.
// Note: You won't receive notifications about the fetched node or
@ -135,19 +135,19 @@ public:
// int childFetchLevel=plVault::kFetchAllChildren,
// bool allowCreate = false,
// PyObject* cb=nil,
// UInt32 cbContext=0 );
bool FetchNode( UInt32 nodeID,
// uint32_t cbContext=0 );
bool FetchNode( uint32_t nodeID,
int childFetchLevel=plVault::kFetchAllChildren,
PyObject* cb=nil,
UInt32 cbContext=0 );
uint32_t cbContext=0 );
// get our root node
PyObject* GetRootNode() const; // returns pyVaultNode
// get the client node ID returned to us by the server ( if we didn't
// fetch when we connected then we have to use this to identify ourselves ).
UInt32 GetClientID() const;
uint32_t GetClientID() const;
// search all nodes in client locally
PyObject* GetNode( UInt32 id ) const; // returns pyVaultNode
PyObject* GetNode( uint32_t id ) const; // returns pyVaultNode
// TODO: Glue these.
PyObject* FindNode( pyVaultNode* templateNode ) const; // returns pyVaultNode
// bool FindNodes( const pyVaultNode* templateNode, PyObject * out ) const;