mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-02-24 04:21:15 +03:00
Renaiming top tier to Steam*
This commit is contained in:
parent
353ddc5a8d
commit
50ddedfd6e
@ -17,7 +17,7 @@ namespace Steamworks
|
|||||||
//
|
//
|
||||||
// Init Client
|
// Init Client
|
||||||
//
|
//
|
||||||
Steamworks.Steam.Init( 4000 );
|
Steamworks.SteamClient.Init( 4000 );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Init Server
|
// Init Server
|
||||||
@ -29,9 +29,9 @@ namespace Steamworks
|
|||||||
QueryPort = 28016
|
QueryPort = 28016
|
||||||
};
|
};
|
||||||
|
|
||||||
Steamworks.GameServer.Init( 4000, serverInit );
|
Steamworks.SteamServer.Init( 4000, serverInit );
|
||||||
|
|
||||||
GameServer.LogOnAnonymous();
|
SteamServer.LogOnAnonymous();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ namespace Steamworks
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void GameLangauge()
|
public void GameLangauge()
|
||||||
{
|
{
|
||||||
var gl = Apps.GameLanguage;
|
var gl = SteamApps.GameLanguage;
|
||||||
Assert.IsNotNull( gl );
|
Assert.IsNotNull( gl );
|
||||||
Assert.IsTrue( gl.Length > 3 );
|
Assert.IsTrue( gl.Length > 3 );
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ namespace Steamworks
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void AppInstallDir()
|
public void AppInstallDir()
|
||||||
{
|
{
|
||||||
var str = Apps.AppInstallDir( 4000 );
|
var str = SteamApps.AppInstallDir( 4000 );
|
||||||
Assert.IsNotNull( str );
|
Assert.IsNotNull( str );
|
||||||
Assert.IsTrue( str.Length > 3 );
|
Assert.IsTrue( str.Length > 3 );
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ namespace Steamworks
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void AppOwner()
|
public void AppOwner()
|
||||||
{
|
{
|
||||||
var steamid = Apps.AppOwner;
|
var steamid = SteamApps.AppOwner;
|
||||||
Assert.IsTrue( steamid.Value > 70561197960279927 );
|
Assert.IsTrue( steamid.Value > 70561197960279927 );
|
||||||
Assert.IsTrue( steamid.Value < 80561197960279927 );
|
Assert.IsTrue( steamid.Value < 80561197960279927 );
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ namespace Steamworks
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void InstalledDepots()
|
public void InstalledDepots()
|
||||||
{
|
{
|
||||||
var depots = Apps.InstalledDepots( 4000 ).ToArray();
|
var depots = SteamApps.InstalledDepots( 4000 ).ToArray();
|
||||||
|
|
||||||
Assert.IsNotNull( depots );
|
Assert.IsNotNull( depots );
|
||||||
Assert.IsTrue( depots.Length > 0 );
|
Assert.IsTrue( depots.Length > 0 );
|
||||||
@ -87,7 +87,7 @@ namespace Steamworks
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task GetFileDetails()
|
public async Task GetFileDetails()
|
||||||
{
|
{
|
||||||
var fileinfo = await Apps.GetFileDetailsAsync( "hl2.exe" );
|
var fileinfo = await SteamApps.GetFileDetailsAsync( "hl2.exe" );
|
||||||
|
|
||||||
Console.WriteLine( $"fileinfo.Found: {fileinfo.Found}" );
|
Console.WriteLine( $"fileinfo.Found: {fileinfo.Found}" );
|
||||||
Console.WriteLine( $"fileinfo.SizeInBytes: {fileinfo.SizeInBytes}" );
|
Console.WriteLine( $"fileinfo.SizeInBytes: {fileinfo.SizeInBytes}" );
|
||||||
@ -98,7 +98,7 @@ namespace Steamworks
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void CommandLine()
|
public void CommandLine()
|
||||||
{
|
{
|
||||||
var cl = Apps.CommandLine;
|
var cl = SteamApps.CommandLine;
|
||||||
|
|
||||||
Console.WriteLine( $"CommandLine: {cl}" );
|
Console.WriteLine( $"CommandLine: {cl}" );
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,8 @@ namespace Steamworks
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
GameServer.DedicatedServer = true;
|
SteamServer.DedicatedServer = true;
|
||||||
GameServer.DedicatedServer = false;
|
SteamServer.DedicatedServer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -23,7 +23,7 @@ namespace Steamworks
|
|||||||
{
|
{
|
||||||
while ( true )
|
while ( true )
|
||||||
{
|
{
|
||||||
var ip = GameServer.PublicIp;
|
var ip = SteamServer.PublicIp;
|
||||||
|
|
||||||
if ( ip == null )
|
if ( ip == null )
|
||||||
{
|
{
|
||||||
@ -47,18 +47,18 @@ namespace Steamworks
|
|||||||
//
|
//
|
||||||
// Clientside calls this function, gets ticket
|
// Clientside calls this function, gets ticket
|
||||||
//
|
//
|
||||||
var clientTicket = User.GetAuthSessionTicket();
|
var clientTicket = SteamUser.GetAuthSessionTicket();
|
||||||
|
|
||||||
//
|
//
|
||||||
// The client sends this data to the server along with their steamid
|
// The client sends this data to the server along with their steamid
|
||||||
//
|
//
|
||||||
var ticketData = clientTicket.Data;
|
var ticketData = clientTicket.Data;
|
||||||
var clientSteamId = User.SteamId;
|
var clientSteamId = SteamUser.SteamId;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Server listens to auth responses from Gabe
|
// Server listens to auth responses from Gabe
|
||||||
//
|
//
|
||||||
GameServer.OnValidateAuthTicketResponse += ( steamid, ownerid, rsponse ) =>
|
SteamServer.OnValidateAuthTicketResponse += ( steamid, ownerid, rsponse ) =>
|
||||||
{
|
{
|
||||||
finished = true;
|
finished = true;
|
||||||
response = rsponse;
|
response = rsponse;
|
||||||
@ -74,7 +74,7 @@ namespace Steamworks
|
|||||||
//
|
//
|
||||||
// Server gets the ticket, starts authing
|
// Server gets the ticket, starts authing
|
||||||
//
|
//
|
||||||
if ( !GameServer.BeginAuthSession( ticketData, clientSteamId ) )
|
if ( !SteamServer.BeginAuthSession( ticketData, clientSteamId ) )
|
||||||
{
|
{
|
||||||
Assert.Fail( "BeginAuthSession returned false, called bullshit without even having to check with Gabe" );
|
Assert.Fail( "BeginAuthSession returned false, called bullshit without even having to check with Gabe" );
|
||||||
}
|
}
|
||||||
|
@ -20,14 +20,14 @@ namespace Steamworks
|
|||||||
{
|
{
|
||||||
int compressed = 0;
|
int compressed = 0;
|
||||||
|
|
||||||
User.VoiceRecord = true;
|
SteamUser.VoiceRecord = true;
|
||||||
|
|
||||||
var sw = Stopwatch.StartNew();
|
var sw = Stopwatch.StartNew();
|
||||||
|
|
||||||
while ( sw.Elapsed.TotalSeconds < 3 )
|
while ( sw.Elapsed.TotalSeconds < 3 )
|
||||||
{
|
{
|
||||||
System.Threading.Thread.Sleep( 10 );
|
System.Threading.Thread.Sleep( 10 );
|
||||||
compressed += User.ReadVoiceData( stream );
|
compressed += SteamUser.ReadVoiceData( stream );
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.AreEqual( compressed, stream.Length );
|
Assert.AreEqual( compressed, stream.Length );
|
||||||
@ -38,54 +38,54 @@ namespace Steamworks
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void OptimalSampleRate()
|
public void OptimalSampleRate()
|
||||||
{
|
{
|
||||||
var rate = User.OptimalSampleRate;
|
var rate = SteamUser.OptimalSampleRate;
|
||||||
Assert.AreNotEqual( rate, 0 );
|
Assert.AreNotEqual( rate, 0 );
|
||||||
Console.WriteLine( $"User.OptimalSampleRate: {User.OptimalSampleRate}" );
|
Console.WriteLine( $"User.OptimalSampleRate: {SteamUser.OptimalSampleRate}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void IsLoggedOn()
|
public void IsLoggedOn()
|
||||||
{
|
{
|
||||||
Assert.AreNotEqual( false, User.IsLoggedOn );
|
Assert.AreNotEqual( false, SteamUser.IsLoggedOn );
|
||||||
Console.WriteLine( $"User.IsLoggedOn: {User.IsLoggedOn}" );
|
Console.WriteLine( $"User.IsLoggedOn: {SteamUser.IsLoggedOn}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void SteamID()
|
public void SteamID()
|
||||||
{
|
{
|
||||||
Assert.AreNotEqual( 0, User.SteamId.Value );
|
Assert.AreNotEqual( 0, SteamUser.SteamId.Value );
|
||||||
Console.WriteLine( $"User.SteamID: {User.SteamId.Value}" );
|
Console.WriteLine( $"User.SteamID: {SteamUser.SteamId.Value}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void AuthSession()
|
public void AuthSession()
|
||||||
{
|
{
|
||||||
var ticket = User.GetAuthSessionTicket();
|
var ticket = SteamUser.GetAuthSessionTicket();
|
||||||
|
|
||||||
Assert.AreNotEqual( 0, ticket.Handle );
|
Assert.AreNotEqual( 0, ticket.Handle );
|
||||||
Assert.AreNotEqual( 0, ticket.Data.Length );
|
Assert.AreNotEqual( 0, ticket.Data.Length );
|
||||||
Console.WriteLine( $"ticket.Handle: {ticket.Handle}" );
|
Console.WriteLine( $"ticket.Handle: {ticket.Handle}" );
|
||||||
Console.WriteLine( $"ticket.Data: { string.Join( "", ticket.Data.Select( x => x.ToString( "x" ) ) ) }" );
|
Console.WriteLine( $"ticket.Data: { string.Join( "", ticket.Data.Select( x => x.ToString( "x" ) ) ) }" );
|
||||||
|
|
||||||
var result = User.BeginAuthSession( ticket.Data, User.SteamId );
|
var result = SteamUser.BeginAuthSession( ticket.Data, SteamUser.SteamId );
|
||||||
Console.WriteLine( $"result: { result }" );
|
Console.WriteLine( $"result: { result }" );
|
||||||
Assert.AreEqual( result, BeginAuthResult.OK );
|
Assert.AreEqual( result, BeginAuthResult.OK );
|
||||||
|
|
||||||
User.EndAuthSession( User.SteamId );
|
SteamUser.EndAuthSession( SteamUser.SteamId );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void SteamLevel()
|
public void SteamLevel()
|
||||||
{
|
{
|
||||||
Assert.AreNotEqual( 0, User.SteamLevel );
|
Assert.AreNotEqual( 0, SteamUser.SteamLevel );
|
||||||
Console.WriteLine( $"User.SteamLevel: {User.SteamLevel}" );
|
Console.WriteLine( $"User.SteamLevel: {SteamUser.SteamLevel}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task GetStoreAuthUrlAsync()
|
public async Task GetStoreAuthUrlAsync()
|
||||||
{
|
{
|
||||||
var rustskins = await User.GetStoreAuthUrlAsync( "https://store.steampowered.com/itemstore/252490/" );
|
var rustskins = await SteamUser.GetStoreAuthUrlAsync( "https://store.steampowered.com/itemstore/252490/" );
|
||||||
|
|
||||||
Assert.IsNotNull( rustskins );
|
Assert.IsNotNull( rustskins );
|
||||||
Console.WriteLine( $"rustskins: {rustskins}" );
|
Console.WriteLine( $"rustskins: {rustskins}" );
|
||||||
@ -94,25 +94,25 @@ namespace Steamworks
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void IsPhoneVerified()
|
public void IsPhoneVerified()
|
||||||
{
|
{
|
||||||
Console.WriteLine( $"User.IsPhoneVerified: {User.IsPhoneVerified}" );
|
Console.WriteLine( $"User.IsPhoneVerified: {SteamUser.IsPhoneVerified}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void IsTwoFactorEnabled()
|
public void IsTwoFactorEnabled()
|
||||||
{
|
{
|
||||||
Console.WriteLine( $"User.IsTwoFactorEnabled: {User.IsTwoFactorEnabled}" );
|
Console.WriteLine( $"User.IsTwoFactorEnabled: {SteamUser.IsTwoFactorEnabled}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void IsPhoneIdentifying()
|
public void IsPhoneIdentifying()
|
||||||
{
|
{
|
||||||
Console.WriteLine( $"User.IsPhoneIdentifying: {User.IsPhoneIdentifying}" );
|
Console.WriteLine( $"User.IsPhoneIdentifying: {SteamUser.IsPhoneIdentifying}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void IsPhoneRequiringVerification()
|
public void IsPhoneRequiringVerification()
|
||||||
{
|
{
|
||||||
Console.WriteLine( $"User.IsPhoneRequiringVerification: {User.IsPhoneRequiringVerification}" );
|
Console.WriteLine( $"User.IsPhoneRequiringVerification: {SteamUser.IsPhoneRequiringVerification}" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,56 +14,56 @@ namespace Steamworks
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void SecondsSinceAppActive()
|
public void SecondsSinceAppActive()
|
||||||
{
|
{
|
||||||
var time = Utils.SecondsSinceAppActive;
|
var time = SteamUtils.SecondsSinceAppActive;
|
||||||
Console.WriteLine( $"{time}" );
|
Console.WriteLine( $"{time}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void SecondsSinceComputerActive()
|
public void SecondsSinceComputerActive()
|
||||||
{
|
{
|
||||||
var time = Utils.SecondsSinceComputerActive;
|
var time = SteamUtils.SecondsSinceComputerActive;
|
||||||
Console.WriteLine( $"{time}" );
|
Console.WriteLine( $"{time}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void ConnectedUniverse()
|
public void ConnectedUniverse()
|
||||||
{
|
{
|
||||||
var u = Utils.ConnectedUniverse;
|
var u = SteamUtils.ConnectedUniverse;
|
||||||
Console.WriteLine( $"{u}" );
|
Console.WriteLine( $"{u}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void SteamServerTime()
|
public void SteamServerTime()
|
||||||
{
|
{
|
||||||
var time = Utils.SteamServerTime;
|
var time = SteamUtils.SteamServerTime;
|
||||||
Console.WriteLine( $"{time}" );
|
Console.WriteLine( $"{time}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void IpCountry()
|
public void IpCountry()
|
||||||
{
|
{
|
||||||
var cnt = Utils.IpCountry;
|
var cnt = SteamUtils.IpCountry;
|
||||||
Console.WriteLine( $"{cnt}" );
|
Console.WriteLine( $"{cnt}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void UsingBatteryPower()
|
public void UsingBatteryPower()
|
||||||
{
|
{
|
||||||
var cnt = Utils.UsingBatteryPower;
|
var cnt = SteamUtils.UsingBatteryPower;
|
||||||
Console.WriteLine( $"{cnt}" );
|
Console.WriteLine( $"{cnt}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void CurrentBatteryPower()
|
public void CurrentBatteryPower()
|
||||||
{
|
{
|
||||||
var cnt = Utils.CurrentBatteryPower;
|
var cnt = SteamUtils.CurrentBatteryPower;
|
||||||
Console.WriteLine( $"{cnt}" );
|
Console.WriteLine( $"{cnt}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void AppId()
|
public void AppId()
|
||||||
{
|
{
|
||||||
var cnt = Utils.AppId;
|
var cnt = SteamUtils.AppId;
|
||||||
|
|
||||||
Assert.IsTrue( cnt.Value > 0 );
|
Assert.IsTrue( cnt.Value > 0 );
|
||||||
|
|
||||||
@ -73,42 +73,42 @@ namespace Steamworks
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void IsOverlayEnabled()
|
public void IsOverlayEnabled()
|
||||||
{
|
{
|
||||||
var cnt = Utils.IsOverlayEnabled;
|
var cnt = SteamUtils.IsOverlayEnabled;
|
||||||
Console.WriteLine( $"{cnt}" );
|
Console.WriteLine( $"{cnt}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task CheckFileSignature()
|
public async Task CheckFileSignature()
|
||||||
{
|
{
|
||||||
var sig = await Utils.CheckFileSignature( "hl2.exe" );
|
var sig = await SteamUtils.CheckFileSignature( "hl2.exe" );
|
||||||
Console.WriteLine( $"{sig}" );
|
Console.WriteLine( $"{sig}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void SteamUILanguage()
|
public void SteamUILanguage()
|
||||||
{
|
{
|
||||||
var cnt = Utils.SteamUILanguage;
|
var cnt = SteamUtils.SteamUILanguage;
|
||||||
Console.WriteLine( $"{cnt}" );
|
Console.WriteLine( $"{cnt}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void IsSteamRunningInVR()
|
public void IsSteamRunningInVR()
|
||||||
{
|
{
|
||||||
var cnt = Utils.IsSteamRunningInVR;
|
var cnt = SteamUtils.IsSteamRunningInVR;
|
||||||
Console.WriteLine( $"{cnt}" );
|
Console.WriteLine( $"{cnt}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void IsSteamInBigPictureMode()
|
public void IsSteamInBigPictureMode()
|
||||||
{
|
{
|
||||||
var cnt = Utils.IsSteamInBigPictureMode;
|
var cnt = SteamUtils.IsSteamInBigPictureMode;
|
||||||
Console.WriteLine( $"{cnt}" );
|
Console.WriteLine( $"{cnt}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void VrHeadsetStreaming()
|
public void VrHeadsetStreaming()
|
||||||
{
|
{
|
||||||
var cnt = Utils.VrHeadsetStreaming;
|
var cnt = SteamUtils.VrHeadsetStreaming;
|
||||||
Console.WriteLine( $"{cnt}" );
|
Console.WriteLine( $"{cnt}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ namespace Steamworks
|
|||||||
if ( !PinnedCallback.IsAllocated )
|
if ( !PinnedCallback.IsAllocated )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Steam.UnregisterCallback( PinnedCallback.AddrOfPinnedObject() );
|
SteamClient.UnregisterCallback( PinnedCallback.AddrOfPinnedObject() );
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool IsValid { get { return true; } }
|
public virtual bool IsValid { get { return true; } }
|
||||||
@ -105,7 +105,7 @@ namespace Steamworks
|
|||||||
//
|
//
|
||||||
// Register the callback with Steam
|
// Register the callback with Steam
|
||||||
//
|
//
|
||||||
Steam.RegisterCallback( PinnedCallback.AddrOfPinnedObject(), cb.CallbackId );
|
SteamClient.RegisterCallback( PinnedCallback.AddrOfPinnedObject(), cb.CallbackId );
|
||||||
}
|
}
|
||||||
|
|
||||||
[MonoPInvokeCallback] internal void OnResultThis( IntPtr self, IntPtr param ) => OnResult( param );
|
[MonoPInvokeCallback] internal void OnResultThis( IntPtr self, IntPtr param ) => OnResult( param );
|
||||||
|
@ -20,7 +20,7 @@ namespace Steamworks
|
|||||||
|
|
||||||
public bool IsComplete( out bool failed )
|
public bool IsComplete( out bool failed )
|
||||||
{
|
{
|
||||||
return Utils.IsCallComplete( CallHandle, out failed );
|
return SteamUtils.IsCallComplete( CallHandle, out failed );
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<T?> GetResult()
|
public async Task<T?> GetResult()
|
||||||
@ -35,7 +35,7 @@ namespace Steamworks
|
|||||||
if ( failed )
|
if ( failed )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return Utils.GetResult<T>( CallHandle );
|
return SteamUtils.GetResult<T>( CallHandle );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -15,7 +15,7 @@ namespace Steamworks
|
|||||||
{
|
{
|
||||||
if ( Handle != 0 )
|
if ( Handle != 0 )
|
||||||
{
|
{
|
||||||
User.Internal.CancelAuthTicket( Handle );
|
SteamUser.Internal.CancelAuthTicket( Handle );
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle = 0;
|
Handle = 0;
|
||||||
|
@ -58,7 +58,7 @@ namespace Steamworks
|
|||||||
|
|
||||||
public BaseServerList()
|
public BaseServerList()
|
||||||
{
|
{
|
||||||
AppId = Utils.AppId; // Default AppId is this
|
AppId = SteamUtils.AppId; // Default AppId is this
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -10,7 +10,7 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Exposes a wide range of information and actions for applications and Downloadable Content (DLC).
|
/// Exposes a wide range of information and actions for applications and Downloadable Content (DLC).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Apps
|
public static class SteamApps
|
||||||
{
|
{
|
||||||
static Internal.ISteamApps _internal;
|
static Internal.ISteamApps _internal;
|
||||||
internal static Internal.ISteamApps Internal
|
internal static Internal.ISteamApps Internal
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Steamworks
|
namespace Steamworks
|
||||||
{
|
{
|
||||||
public static class Steam
|
public static class SteamClient
|
||||||
{
|
{
|
||||||
static bool initialized;
|
static bool initialized;
|
||||||
|
|
||||||
@ -27,13 +27,13 @@ namespace Steamworks
|
|||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
|
|
||||||
Apps.InstallEvents();
|
SteamApps.InstallEvents();
|
||||||
Utils.InstallEvents();
|
SteamUtils.InstallEvents();
|
||||||
Parental.InstallEvents();
|
SteamParental.InstallEvents();
|
||||||
Music.InstallEvents();
|
SteamMusic.InstallEvents();
|
||||||
Video.InstallEvents();
|
SteamVideo.InstallEvents();
|
||||||
User.InstallEvents();
|
SteamUser.InstallEvents();
|
||||||
Friends.InstallEvents();
|
SteamFriends.InstallEvents();
|
||||||
|
|
||||||
RunCallbacks();
|
RunCallbacks();
|
||||||
}
|
}
|
@ -9,7 +9,7 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Undocumented Parental Settings
|
/// Undocumented Parental Settings
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Friends
|
public static class SteamFriends
|
||||||
{
|
{
|
||||||
static Internal.ISteamFriends _internal;
|
static Internal.ISteamFriends _internal;
|
||||||
internal static Internal.ISteamFriends Internal
|
internal static Internal.ISteamFriends Internal
|
||||||
@ -207,13 +207,13 @@ namespace Steamworks
|
|||||||
public static async Task<Image?> GetSmallAvatarAsync( SteamId steamid )
|
public static async Task<Image?> GetSmallAvatarAsync( SteamId steamid )
|
||||||
{
|
{
|
||||||
await CacheUserInformationAsync( steamid, false );
|
await CacheUserInformationAsync( steamid, false );
|
||||||
return Utils.GetImage( Internal.GetSmallFriendAvatar( steamid ) );
|
return SteamUtils.GetImage( Internal.GetSmallFriendAvatar( steamid ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<Image?> GetMediumAvatarAsync( SteamId steamid )
|
public static async Task<Image?> GetMediumAvatarAsync( SteamId steamid )
|
||||||
{
|
{
|
||||||
await CacheUserInformationAsync( steamid, false );
|
await CacheUserInformationAsync( steamid, false );
|
||||||
return Utils.GetImage( Internal.GetMediumFriendAvatar( steamid ) );
|
return SteamUtils.GetImage( Internal.GetMediumFriendAvatar( steamid ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<Image?> GetLargeAvatarAsync( SteamId steamid )
|
public static async Task<Image?> GetLargeAvatarAsync( SteamId steamid )
|
||||||
@ -229,7 +229,7 @@ namespace Steamworks
|
|||||||
imageid = Internal.GetLargeFriendAvatar( steamid );
|
imageid = Internal.GetLargeFriendAvatar( steamid );
|
||||||
}
|
}
|
||||||
|
|
||||||
return Utils.GetImage( imageid );
|
return SteamUtils.GetImage( imageid );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
@ -9,7 +9,7 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Undocumented Parental Settings
|
/// Undocumented Parental Settings
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Music
|
public static class SteamMusic
|
||||||
{
|
{
|
||||||
static Internal.ISteamMusic _internal;
|
static Internal.ISteamMusic _internal;
|
||||||
internal static Internal.ISteamMusic Internal
|
internal static Internal.ISteamMusic Internal
|
@ -9,7 +9,7 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Undocumented Parental Settings
|
/// Undocumented Parental Settings
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Parental
|
public static class SteamParental
|
||||||
{
|
{
|
||||||
static Internal.ISteamParentalSettings _internal;
|
static Internal.ISteamParentalSettings _internal;
|
||||||
internal static Internal.ISteamParentalSettings Internal
|
internal static Internal.ISteamParentalSettings Internal
|
@ -9,7 +9,7 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides the core of the Steam Game Servers API
|
/// Provides the core of the Steam Game Servers API
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static partial class GameServer
|
public static partial class SteamServer
|
||||||
{
|
{
|
||||||
static bool initialized;
|
static bool initialized;
|
||||||
|
|
@ -11,7 +11,7 @@ namespace Steamworks
|
|||||||
/// Functions for accessing and manipulating Steam user information.
|
/// Functions for accessing and manipulating Steam user information.
|
||||||
/// This is also where the APIs for Steam Voice are exposed.
|
/// This is also where the APIs for Steam Voice are exposed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class User
|
public static class SteamUser
|
||||||
{
|
{
|
||||||
static Internal.ISteamUser _internal;
|
static Internal.ISteamUser _internal;
|
||||||
internal static Internal.ISteamUser Internal
|
internal static Internal.ISteamUser Internal
|
@ -9,7 +9,7 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interface which provides access to a range of miscellaneous utility functions
|
/// Interface which provides access to a range of miscellaneous utility functions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Utils
|
public static class SteamUtils
|
||||||
{
|
{
|
||||||
static Internal.ISteamUtils _internal;
|
static Internal.ISteamUtils _internal;
|
||||||
internal static Internal.ISteamUtils Internal
|
internal static Internal.ISteamUtils Internal
|
@ -9,7 +9,7 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Undocumented Parental Settings
|
/// Undocumented Parental Settings
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Video
|
public static class SteamVideo
|
||||||
{
|
{
|
||||||
static Internal.ISteamVideo _internal;
|
static Internal.ISteamVideo _internal;
|
||||||
internal static Internal.ISteamVideo Internal
|
internal static Internal.ISteamVideo Internal
|
@ -17,7 +17,7 @@ namespace Steamworks
|
|||||||
|
|
||||||
public bool IsFriend => Relationship == Relationship.Friend;
|
public bool IsFriend => Relationship == Relationship.Friend;
|
||||||
public bool IsBlocked => Relationship == Relationship.Blocked;
|
public bool IsBlocked => Relationship == Relationship.Blocked;
|
||||||
public bool IsPlayingThisGame => GameInfo?.GameID == Utils.AppId;
|
public bool IsPlayingThisGame => GameInfo?.GameID == SteamUtils.AppId;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if this friend is online
|
/// Returns true if this friend is online
|
||||||
@ -41,16 +41,16 @@ namespace Steamworks
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Relationship Relationship => Friends.Internal.GetFriendRelationship( Id );
|
public Relationship Relationship => SteamFriends.Internal.GetFriendRelationship( Id );
|
||||||
public FriendState State => Friends.Internal.GetFriendPersonaState( Id );
|
public FriendState State => SteamFriends.Internal.GetFriendPersonaState( Id );
|
||||||
public string Name => Friends.Internal.GetFriendPersonaName( Id );
|
public string Name => SteamFriends.Internal.GetFriendPersonaName( Id );
|
||||||
public IEnumerable<string> NameHistory
|
public IEnumerable<string> NameHistory
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
for( int i=0; i<32; i++ )
|
for( int i=0; i<32; i++ )
|
||||||
{
|
{
|
||||||
var n = Friends.Internal.GetFriendPersonaNameHistory( Id, i );
|
var n = SteamFriends.Internal.GetFriendPersonaNameHistory( Id, i );
|
||||||
if ( string.IsNullOrEmpty( n ) )
|
if ( string.IsNullOrEmpty( n ) )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ namespace Steamworks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int SteamLevel => Friends.Internal.GetFriendSteamLevel( Id );
|
public int SteamLevel => SteamFriends.Internal.GetFriendSteamLevel( Id );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ namespace Steamworks
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
FriendGameInfo_t gameInfo = default( FriendGameInfo_t );
|
FriendGameInfo_t gameInfo = default( FriendGameInfo_t );
|
||||||
if ( !Friends.Internal.GetFriendGamePlayed( Id, ref gameInfo ) )
|
if ( !SteamFriends.Internal.GetFriendGamePlayed( Id, ref gameInfo ) )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return FriendGameInfo.From( gameInfo );
|
return FriendGameInfo.From( gameInfo );
|
||||||
@ -77,7 +77,7 @@ namespace Steamworks
|
|||||||
|
|
||||||
public bool IsIn( SteamId group_or_room )
|
public bool IsIn( SteamId group_or_room )
|
||||||
{
|
{
|
||||||
return Friends.Internal.IsUserInSource( Id, group_or_room );
|
return SteamFriends.Internal.IsUserInSource( Id, group_or_room );
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct FriendGameInfo
|
public struct FriendGameInfo
|
||||||
@ -103,22 +103,22 @@ namespace Steamworks
|
|||||||
|
|
||||||
public async Task<Image?> GetSmallAvatarAsync()
|
public async Task<Image?> GetSmallAvatarAsync()
|
||||||
{
|
{
|
||||||
return await Friends.GetSmallAvatarAsync( Id );
|
return await SteamFriends.GetSmallAvatarAsync( Id );
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Image?> GetMediumAvatarAsync()
|
public async Task<Image?> GetMediumAvatarAsync()
|
||||||
{
|
{
|
||||||
return await Friends.GetMediumAvatarAsync( Id );
|
return await SteamFriends.GetMediumAvatarAsync( Id );
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Image?> GetLargeAvatarAsync()
|
public async Task<Image?> GetLargeAvatarAsync()
|
||||||
{
|
{
|
||||||
return await Friends.GetLargeAvatarAsync( Id );
|
return await SteamFriends.GetLargeAvatarAsync( Id );
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetRichPresence( string key )
|
public string GetRichPresence( string key )
|
||||||
{
|
{
|
||||||
var val = Friends.Internal.GetFriendRichPresence( Id, key );
|
var val = SteamFriends.Internal.GetFriendRichPresence( Id, key );
|
||||||
if ( string.IsNullOrEmpty( val ) ) return null;
|
if ( string.IsNullOrEmpty( val ) ) return null;
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
@ -128,7 +128,7 @@ namespace Steamworks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool InviteToGame( string Text )
|
public bool InviteToGame( string Text )
|
||||||
{
|
{
|
||||||
return Friends.Internal.InviteUserToGame( Id, Text );
|
return SteamFriends.Internal.InviteUserToGame( Id, Text );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -136,7 +136,7 @@ namespace Steamworks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool SendMessage( string message )
|
public bool SendMessage( string message )
|
||||||
{
|
{
|
||||||
return Friends.Internal.ReplyToFriendMessage( Id, message );
|
return SteamFriends.Internal.ReplyToFriendMessage( Id, message );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user