mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-24 05:35:35 +03:00
Keep friend status up to date via PersonaStateChange_t
This commit is contained in:
parent
80bf89c9e6
commit
476321c026
@ -338,13 +338,24 @@ internal void Cycle()
|
||||
|
||||
private void OnPersonaStateChange( PersonaStateChange_t data )
|
||||
{
|
||||
if ( (data.ChangeFlags & 0x0040) != 0x0040 ) return; // wait for k_EPersonaChangeAvatar
|
||||
// k_EPersonaChangeAvatar
|
||||
if ( (data.ChangeFlags & 0x0040) == 0x0040 )
|
||||
{
|
||||
LoadAvatarForSteamId( data.SteamID );
|
||||
}
|
||||
|
||||
LoadForSteamid( data.SteamID );
|
||||
//
|
||||
// Find and refresh this friend's status
|
||||
//
|
||||
foreach ( var friend in All )
|
||||
{
|
||||
if ( friend.Id != data.SteamID ) continue;
|
||||
|
||||
friend.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void LoadForSteamid( ulong Steamid )
|
||||
void LoadAvatarForSteamId( ulong Steamid )
|
||||
{
|
||||
for ( int i = PersonaCallbacks.Count - 1; i >= 0; i-- )
|
||||
{
|
||||
@ -365,7 +376,7 @@ void LoadForSteamid( ulong Steamid )
|
||||
|
||||
private void OnAvatarImageLoaded( AvatarImageLoaded_t data )
|
||||
{
|
||||
LoadForSteamid( data.SteamID );
|
||||
LoadAvatarForSteamId( data.SteamID );
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user