mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-27 23:25:55 +03:00
Added SteamFriends.GetFriendsWithFlag
Added SteamFriends.GetFriendsWithFlag. Reworked SteamFriends.GetFriends and SteamFriends.GetBlocked to work upon it. I also had to expose the FriendFlags.
This commit is contained in:
parent
06169693d0
commit
83aa37ce4f
@ -585,7 +585,7 @@ public enum FriendState : int
|
|||||||
//
|
//
|
||||||
// EFriendFlags
|
// EFriendFlags
|
||||||
//
|
//
|
||||||
internal enum FriendFlags : int
|
public enum FriendFlags : int
|
||||||
{
|
{
|
||||||
None = 0,
|
None = 0,
|
||||||
Blocked = 1,
|
Blocked = 1,
|
||||||
|
@ -112,20 +112,22 @@ static unsafe void OnFriendChatMessage( GameConnectedFriendChatMsg_t data )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IEnumerable<Friend> GetFriendsWithFlag(FriendFlags flag)
|
||||||
|
{
|
||||||
|
for ( int i=0; i<Internal.GetFriendCount( (int)flag); i++ )
|
||||||
|
{
|
||||||
|
yield return new Friend( Internal.GetFriendByIndex( i, (int)flag ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static IEnumerable<Friend> GetFriends()
|
public static IEnumerable<Friend> GetFriends()
|
||||||
{
|
{
|
||||||
for ( int i=0; i<Internal.GetFriendCount( (int) FriendFlags.Immediate ); i++ )
|
return GetFriendsWithFlag(FriendFlags.Immediate);
|
||||||
{
|
|
||||||
yield return new Friend( Internal.GetFriendByIndex( i, (int)FriendFlags.Immediate ) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IEnumerable<Friend> GetBlocked()
|
public static IEnumerable<Friend> GetBlocked()
|
||||||
{
|
{
|
||||||
for ( int i = 0; i < Internal.GetFriendCount( (int)FriendFlags.Blocked ); i++ )
|
return GetFriendsWithFlag(FriendFlags.Blocked);
|
||||||
{
|
|
||||||
yield return new Friend( Internal.GetFriendByIndex( i, (int)FriendFlags.Blocked) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IEnumerable<Friend> GetPlayedWith()
|
public static IEnumerable<Friend> GetPlayedWith()
|
||||||
|
@ -65,6 +65,7 @@ public static bool ShouldCreate( string type )
|
|||||||
internal static string Expose( string name )
|
internal static string Expose( string name )
|
||||||
{
|
{
|
||||||
if ( name == "FriendState" ) return "public";
|
if ( name == "FriendState" ) return "public";
|
||||||
|
if (name == "FriendFlags") return "public";
|
||||||
if ( name == "MusicStatus" ) return "public";
|
if ( name == "MusicStatus" ) return "public";
|
||||||
if ( name == "ParentalFeature" ) return "public";
|
if ( name == "ParentalFeature" ) return "public";
|
||||||
if ( name == "AuthResponse" ) return "public";
|
if ( name == "AuthResponse" ) return "public";
|
||||||
|
Loading…
Reference in New Issue
Block a user