[raknet] Implement RakPeer::GetIncomingPassword

This commit is contained in:
RD42 2024-01-15 23:49:21 +08:00
parent 670d61547d
commit 0ae5fb134b
3 changed files with 23 additions and 4 deletions

View File

@ -73,9 +73,20 @@ void RakPeer::SetIncomingPassword( const char* passwordData, int passwordDataLen
incomingPasswordLength=(unsigned char)passwordDataLength;
}
void RakPeer::vftable_1C()
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void RakPeer::GetIncomingPassword( char* passwordData, int *passwordDataLength )
{
// TODO: RakPeer::vftable_1C() (saco W: 10038480) (server W: 44FF80 L: 806D1C0) (bot W: 403F20 L: 8073014)
if (passwordData==0)
{
*passwordDataLength=incomingPasswordLength;
return;
}
if (*passwordDataLength > incomingPasswordLength)
*passwordDataLength=incomingPasswordLength;
if (*passwordDataLength>0)
memcpy(passwordData, incomingPassword, *passwordDataLength);
}
void RakPeer::vftable_20()

View File

@ -16,7 +16,6 @@ public:
void vftable_4();
void vftable_8();
void vftable_C();
void vftable_1C();
void vftable_20();
void vftable_24();
void vftable_28();
@ -37,6 +36,11 @@ public:
/// \param[in] passwordDataLength The length in bytes of passwordData
void SetIncomingPassword( const char* passwordData, int passwordDataLength );
/// Gets the password passed to SetIncomingPassword
/// \param[out] passwordData Should point to a block large enough to hold the password data you passed to SetIncomingPassword()
/// \param[in,out] passwordDataLength Maximum size of the array passwordData. Modified to hold the number of bytes actually written
void GetIncomingPassword( char* passwordData, int *passwordDataLength );
/// Returns if the network thread is running
/// \return true if the network thread is running, false otherwise
bool IsActive( void ) const;

View File

@ -13,7 +13,6 @@ public:
virtual void vftable_4()=0;
virtual void vftable_8()=0;
virtual void vftable_C()=0;
virtual void vftable_1C()=0;
virtual void vftable_20()=0;
virtual void vftable_24()=0;
virtual void vftable_28()=0;
@ -34,6 +33,11 @@ public:
/// \param[in] passwordDataLength The length in bytes of passwordData
virtual void SetIncomingPassword( const char* passwordData, int passwordDataLength )=0;
/// Gets the password passed to SetIncomingPassword
/// \param[out] passwordData Should point to a block large enough to hold the password data you passed to SetIncomingPassword()
/// \param[in,out] passwordDataLength Maximum size of the array passwordData. Modified to hold the number of bytes actually written
virtual void GetIncomingPassword( char* passwordData, int *passwordDataLength )=0;
/// Returns if the network thread is running
/// \return true if the network thread is running, false otherwise
virtual bool IsActive( void ) const=0;