Added SteamMatchmaking.GetHistoryServers()

This commit is contained in:
Garry Newman 2019-05-24 15:19:04 +01:00
parent 5c973b0092
commit cad7edcec0

View File

@ -167,5 +167,29 @@ public static IEnumerable<ServerInfo> GetFavoriteServers()
}
}
/// <summary>
/// Get a list of servers that you have added to your play history
/// </summary>
public static IEnumerable<ServerInfo> GetHistoryServers()
{
var count = Internal.GetFavoriteGameCount();
for ( int i = 0; i < count; i++ )
{
uint timeplayed = 0;
uint flags = 0;
ushort qport = 0;
ushort cport = 0;
uint ip = 0;
AppId appid = default;
if ( Internal.GetFavoriteGame( i, ref appid, ref ip, ref cport, ref qport, ref flags, ref timeplayed ) )
{
if ( (flags & ServerInfo.k_unFavoriteFlagHistory) == 0 ) continue;
yield return new ServerInfo( ip, cport, qport, timeplayed );
}
}
}
}
}