mirror of
				https://github.com/VCMP-SqMod/SqMod.git
				synced 2025-11-04 08:17:19 +01:00 
			
		
		
		
	Add extra validation when assigning a player name.
This commit is contained in:
		@@ -344,10 +344,20 @@ void CPlayer::SetName(CSStr name) const
 | 
			
		||||
    // Validate the managed identifier
 | 
			
		||||
    Validate();
 | 
			
		||||
    // Perform the requested operation
 | 
			
		||||
    if (_Func->SetPlayerName(m_ID, name) == vcmpErrorInvalidName)
 | 
			
		||||
    const vcmpError ret = _Func->SetPlayerName(m_ID, name);
 | 
			
		||||
    // Validate the resulted status
 | 
			
		||||
    if (ret == vcmpErrorNullArgument)
 | 
			
		||||
    {
 | 
			
		||||
        STHROWF("Cannot assign a null name to a player");
 | 
			
		||||
    }
 | 
			
		||||
    else if (ret == vcmpErrorInvalidName)
 | 
			
		||||
    {
 | 
			
		||||
        STHROWF("The specified name is invalid");
 | 
			
		||||
    }
 | 
			
		||||
    else if (ret == vcmpErrorTooLargeInput)
 | 
			
		||||
    {
 | 
			
		||||
        STHROWF("The specified name is too large");
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ------------------------------------------------------------------------------------------------
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user