mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-24 13:45:37 +03:00
Serverlist
This commit is contained in:
parent
5b24c8ca01
commit
99a804c14b
29
Facepunch.Steamworks/Client.ServerList.cs
Normal file
29
Facepunch.Steamworks/Client.ServerList.cs
Normal 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;
|
||||
|
||||
}
|
||||
}
|
@ -13,6 +13,7 @@ public partial class Client : IDisposable
|
||||
internal Valve.Steamworks.ISteamClient _client;
|
||||
internal Valve.Steamworks.ISteamUser _user;
|
||||
internal Valve.Steamworks.ISteamFriends _friends;
|
||||
internal Valve.Steamworks.ISteamMatchmakingServers _servers;
|
||||
|
||||
/// <summary>
|
||||
/// Current running program's AppId
|
||||
@ -58,6 +59,7 @@ public Client( int appId )
|
||||
//
|
||||
_friends = _client.GetISteamFriends( _huser, _hpipe, "SteamFriends015" );
|
||||
_user = _client.GetISteamUser( _huser, _hpipe, "SteamUser019" );
|
||||
_servers = _client.GetISteamMatchmakingServers( _huser, _hpipe, "SteamMatchMakingServers002" );
|
||||
|
||||
AppId = appId;
|
||||
Username = _friends.GetPersonaName();
|
||||
|
@ -44,6 +44,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Client.Overlay.cs" />
|
||||
<Compile Include="Client.ServerList.cs" />
|
||||
<Compile Include="Client.Voice.cs" />
|
||||
<Compile Include="Client.Auth.cs" />
|
||||
<Compile Include="Client.cs" />
|
||||
|
@ -2445,7 +2445,7 @@ internal override ISteamMatchmakingServers GetISteamMatchmakingServers( uint hSt
|
||||
{
|
||||
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 )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user