diff --git a/Facepunch.Steamworks/Client.ServerList.cs b/Facepunch.Steamworks/Client.ServerList.cs new file mode 100644 index 0000000..f014820 --- /dev/null +++ b/Facepunch.Steamworks/Client.ServerList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Facepunch.Steamworks +{ + public partial class Client : IDisposable + { + private ServerList _serverlist; + + public ServerList ServerList + { + get + { + if ( _serverlist == null ) + _serverlist = new ServerList { client = this }; + + return _serverlist; + } + } + } + + public class ServerList + { + internal Client client; + + } +} diff --git a/Facepunch.Steamworks/Client.cs b/Facepunch.Steamworks/Client.cs index 58b66ba..c85940f 100644 --- a/Facepunch.Steamworks/Client.cs +++ b/Facepunch.Steamworks/Client.cs @@ -13,6 +13,7 @@ namespace Facepunch.Steamworks internal Valve.Steamworks.ISteamClient _client; internal Valve.Steamworks.ISteamUser _user; internal Valve.Steamworks.ISteamFriends _friends; + internal Valve.Steamworks.ISteamMatchmakingServers _servers; /// /// Current running program's AppId @@ -58,6 +59,7 @@ namespace Facepunch.Steamworks // _friends = _client.GetISteamFriends( _huser, _hpipe, "SteamFriends015" ); _user = _client.GetISteamUser( _huser, _hpipe, "SteamUser019" ); + _servers = _client.GetISteamMatchmakingServers( _huser, _hpipe, "SteamMatchMakingServers002" ); AppId = appId; Username = _friends.GetPersonaName(); diff --git a/Facepunch.Steamworks/Facepunch.Steamworks.csproj b/Facepunch.Steamworks/Facepunch.Steamworks.csproj index 0e2fd48..ac414a1 100644 --- a/Facepunch.Steamworks/Facepunch.Steamworks.csproj +++ b/Facepunch.Steamworks/Facepunch.Steamworks.csproj @@ -44,6 +44,7 @@ + diff --git a/Facepunch.Steamworks/steam_api_interop.cs b/Facepunch.Steamworks/steam_api_interop.cs index 42c3f53..0344964 100644 --- a/Facepunch.Steamworks/steam_api_interop.cs +++ b/Facepunch.Steamworks/steam_api_interop.cs @@ -2445,7 +2445,7 @@ namespace Valve.Steamworks { CheckIfUsable(); IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamMatchmakingServers(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); - return (ISteamMatchmakingServers)Marshal.PtrToStructure( result, typeof( ISteamMatchmakingServers ) ); + return new CSteamMatchmakingServers( result ); } internal override IntPtr GetISteamGenericInterface( uint hSteamUser, uint hSteamPipe, string pchVersion ) {