isteamremoteplay.cs 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // This file is provided under The MIT License as part of Steamworks.NET.
  2. // Copyright (c) 2013-2019 Riley Labrecque
  3. // Please see the included LICENSE.txt for additional information.
  4. // This file is automatically generated.
  5. // Changes to this file will be reverted when you update Steamworks.NET
  6. #if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
  7. #define DISABLESTEAMWORKS
  8. #endif
  9. #if !DISABLESTEAMWORKS
  10. using System.Runtime.InteropServices;
  11. using IntPtr = System.IntPtr;
  12. namespace Steamworks {
  13. public static class SteamRemotePlay {
  14. /// <summary>
  15. /// <para> Get the number of currently connected Steam Remote Play sessions</para>
  16. /// </summary>
  17. public static uint GetSessionCount() {
  18. InteropHelp.TestIfAvailableClient();
  19. return NativeMethods.ISteamRemotePlay_GetSessionCount(CSteamAPIContext.GetSteamRemotePlay());
  20. }
  21. /// <summary>
  22. /// <para> Get the currently connected Steam Remote Play session ID at the specified index. Returns zero if index is out of bounds.</para>
  23. /// </summary>
  24. public static uint GetSessionID(int iSessionIndex) {
  25. InteropHelp.TestIfAvailableClient();
  26. return NativeMethods.ISteamRemotePlay_GetSessionID(CSteamAPIContext.GetSteamRemotePlay(), iSessionIndex);
  27. }
  28. /// <summary>
  29. /// <para> Get the SteamID of the connected user</para>
  30. /// </summary>
  31. public static CSteamID GetSessionSteamID(uint unSessionID) {
  32. InteropHelp.TestIfAvailableClient();
  33. return (CSteamID)NativeMethods.ISteamRemotePlay_GetSessionSteamID(CSteamAPIContext.GetSteamRemotePlay(), unSessionID);
  34. }
  35. /// <summary>
  36. /// <para> Get the name of the session client device</para>
  37. /// <para> This returns NULL if the sessionID is not valid</para>
  38. /// </summary>
  39. public static string GetSessionClientName(uint unSessionID) {
  40. InteropHelp.TestIfAvailableClient();
  41. return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamRemotePlay_GetSessionClientName(CSteamAPIContext.GetSteamRemotePlay(), unSessionID));
  42. }
  43. /// <summary>
  44. /// <para> Get the form factor of the session client device</para>
  45. /// </summary>
  46. public static ESteamDeviceFormFactor GetSessionClientFormFactor(uint unSessionID) {
  47. InteropHelp.TestIfAvailableClient();
  48. return NativeMethods.ISteamRemotePlay_GetSessionClientFormFactor(CSteamAPIContext.GetSteamRemotePlay(), unSessionID);
  49. }
  50. /// <summary>
  51. /// <para> Get the resolution, in pixels, of the session client device</para>
  52. /// <para> This is set to 0x0 if the resolution is not available</para>
  53. /// </summary>
  54. public static bool BGetSessionClientResolution(uint unSessionID, out int pnResolutionX, out int pnResolutionY) {
  55. InteropHelp.TestIfAvailableClient();
  56. return NativeMethods.ISteamRemotePlay_BGetSessionClientResolution(CSteamAPIContext.GetSteamRemotePlay(), unSessionID, out pnResolutionX, out pnResolutionY);
  57. }
  58. }
  59. }
  60. #endif // !DISABLESTEAMWORKS