Serverlist

This commit is contained in:
Garry Newman 2016-07-07 15:03:37 +01:00
parent 5b24c8ca01
commit 99a804c14b
4 changed files with 33 additions and 1 deletions

View File

@ -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;
}
}

View File

@ -13,6 +13,7 @@ public partial class Client : IDisposable
internal Valve.Steamworks.ISteamClient _client; internal Valve.Steamworks.ISteamClient _client;
internal Valve.Steamworks.ISteamUser _user; internal Valve.Steamworks.ISteamUser _user;
internal Valve.Steamworks.ISteamFriends _friends; internal Valve.Steamworks.ISteamFriends _friends;
internal Valve.Steamworks.ISteamMatchmakingServers _servers;
/// <summary> /// <summary>
/// Current running program's AppId /// Current running program's AppId
@ -58,6 +59,7 @@ public Client( int appId )
// //
_friends = _client.GetISteamFriends( _huser, _hpipe, "SteamFriends015" ); _friends = _client.GetISteamFriends( _huser, _hpipe, "SteamFriends015" );
_user = _client.GetISteamUser( _huser, _hpipe, "SteamUser019" ); _user = _client.GetISteamUser( _huser, _hpipe, "SteamUser019" );
_servers = _client.GetISteamMatchmakingServers( _huser, _hpipe, "SteamMatchMakingServers002" );
AppId = appId; AppId = appId;
Username = _friends.GetPersonaName(); Username = _friends.GetPersonaName();

View File

@ -44,6 +44,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Client.Overlay.cs" /> <Compile Include="Client.Overlay.cs" />
<Compile Include="Client.ServerList.cs" />
<Compile Include="Client.Voice.cs" /> <Compile Include="Client.Voice.cs" />
<Compile Include="Client.Auth.cs" /> <Compile Include="Client.Auth.cs" />
<Compile Include="Client.cs" /> <Compile Include="Client.cs" />

View File

@ -2445,7 +2445,7 @@ internal override ISteamMatchmakingServers GetISteamMatchmakingServers( uint hSt
{ {
CheckIfUsable(); CheckIfUsable();
IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamMatchmakingServers(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); 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 ) internal override IntPtr GetISteamGenericInterface( uint hSteamUser, uint hSteamPipe, string pchVersion )
{ {