Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2621 lines
93 KiB

  1. // This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
  2. using System.Runtime.CompilerServices;
  3. [assembly: InternalsVisibleTo("Assembly-CSharp-Editor")]
  4. namespace Oculus.Platform
  5. {
  6. using UnityEngine;
  7. using System;
  8. using System.Collections;
  9. using System.Collections.Generic;
  10. using System.Runtime.InteropServices;
  11. public sealed class Core {
  12. private static bool IsPlatformInitialized = false;
  13. public static bool IsInitialized()
  14. {
  15. return IsPlatformInitialized;
  16. }
  17. // If LogMessages is true, then the contents of each request response
  18. // will be printed using Debug.Log. This allocates a lot of heap memory,
  19. // and so should not be called outside of testing and debugging.
  20. public static bool LogMessages = false;
  21. internal static void ForceInitialized()
  22. {
  23. IsPlatformInitialized = true;
  24. }
  25. private static string getAppID(string appId = null) {
  26. string configAppID = GetAppIDFromConfig();
  27. if (String.IsNullOrEmpty(appId))
  28. {
  29. if (String.IsNullOrEmpty(configAppID))
  30. {
  31. throw new UnityException("Update your app id by selecting 'Oculus Platform' -> 'Edit Settings'");
  32. }
  33. appId = configAppID;
  34. }
  35. else
  36. {
  37. if (!String.IsNullOrEmpty(configAppID))
  38. {
  39. Debug.LogWarningFormat("The 'Oculus App Id ({0})' field in 'Oculus Platform/Edit Settings' is being overridden by the App Id ({1}) that you passed in to Platform.Core.Initialize. You should only specify this in one place. We recommend the menu location.", configAppID, appId);
  40. }
  41. }
  42. return appId;
  43. }
  44. // Asynchronously Initialize Platform SDK. The result will be put on the message
  45. // queue with the message type: ovrMessage_PlatformInitializeAndroidAsynchronous
  46. //
  47. // While the platform is in an initializing state, it's not fully functional.
  48. // [Requests]: will queue up and run once platform is initialized.
  49. // For example: ovr_User_GetLoggedInUser() can be called immediately after
  50. // asynchronous init and once platform is initialized, this request will run
  51. // [Synchronous Methods]: will return the default value;
  52. // For example: ovr_GetLoggedInUserID() will return 0 until platform is
  53. // fully initialized
  54. public static Request<Models.PlatformInitialize> AsyncInitialize(string appId = null) {
  55. appId = getAppID(appId);
  56. Request<Models.PlatformInitialize> request;
  57. if (UnityEngine.Application.isEditor && PlatformSettings.UseStandalonePlatform) {
  58. var platform = new StandalonePlatform();
  59. request = platform.InitializeInEditor();
  60. }
  61. else if (UnityEngine.Application.platform == RuntimePlatform.WindowsEditor ||
  62. UnityEngine.Application.platform == RuntimePlatform.WindowsPlayer) {
  63. var platform = new WindowsPlatform();
  64. request = platform.AsyncInitialize(appId);
  65. }
  66. else if (UnityEngine.Application.platform == RuntimePlatform.Android) {
  67. var platform = new AndroidPlatform();
  68. request = platform.AsyncInitialize(appId);
  69. }
  70. else {
  71. throw new NotImplementedException("Oculus platform is not implemented on this platform yet.");
  72. }
  73. IsPlatformInitialized = (request != null);
  74. if (!IsPlatformInitialized)
  75. {
  76. throw new UnityException("Oculus Platform failed to initialize.");
  77. }
  78. if (LogMessages) {
  79. Debug.LogWarning("Oculus.Platform.Core.LogMessages is set to true. This will cause extra heap allocations, and should not be used outside of testing and debugging.");
  80. }
  81. // Create the GameObject that will run the callbacks
  82. (new GameObject("Oculus.Platform.CallbackRunner")).AddComponent<CallbackRunner>();
  83. return request;
  84. }
  85. public static void Initialize(string appId = null)
  86. {
  87. appId = getAppID(appId);
  88. if (UnityEngine.Application.isEditor && PlatformSettings.UseStandalonePlatform) {
  89. var platform = new StandalonePlatform();
  90. IsPlatformInitialized = platform.InitializeInEditor() != null;
  91. }
  92. else if (UnityEngine.Application.platform == RuntimePlatform.WindowsEditor ||
  93. UnityEngine.Application.platform == RuntimePlatform.WindowsPlayer) {
  94. var platform = new WindowsPlatform();
  95. IsPlatformInitialized = platform.Initialize(appId);
  96. }
  97. else if (UnityEngine.Application.platform == RuntimePlatform.Android) {
  98. var platform = new AndroidPlatform();
  99. IsPlatformInitialized = platform.Initialize(appId);
  100. }
  101. else {
  102. throw new NotImplementedException("Oculus platform is not implemented on this platform yet.");
  103. }
  104. if (!IsPlatformInitialized)
  105. {
  106. throw new UnityException("Oculus Platform failed to initialize.");
  107. }
  108. if (LogMessages) {
  109. Debug.LogWarning("Oculus.Platform.Core.LogMessages is set to true. This will cause extra heap allocations, and should not be used outside of testing and debugging.");
  110. }
  111. // Create the GameObject that will run the callbacks
  112. (new GameObject("Oculus.Platform.CallbackRunner")).AddComponent<CallbackRunner>();
  113. }
  114. private static string GetAppIDFromConfig()
  115. {
  116. if (UnityEngine.Application.platform == RuntimePlatform.Android)
  117. {
  118. return PlatformSettings.MobileAppID;
  119. }
  120. else
  121. {
  122. return PlatformSettings.AppID;
  123. }
  124. }
  125. }
  126. public static partial class ApplicationLifecycle
  127. {
  128. public static Models.LaunchDetails GetLaunchDetails() {
  129. return new Models.LaunchDetails(CAPI.ovr_ApplicationLifecycle_GetLaunchDetails());
  130. }
  131. }
  132. public static partial class Rooms
  133. {
  134. public static Request<Models.Room> UpdateDataStore(UInt64 roomID, Dictionary<string, string> data)
  135. {
  136. if (Core.IsInitialized())
  137. {
  138. CAPI.ovrKeyValuePair[] kvps = new CAPI.ovrKeyValuePair[data.Count];
  139. int i=0;
  140. foreach(var item in data)
  141. {
  142. kvps[i++] = new CAPI.ovrKeyValuePair(item.Key, item.Value);
  143. }
  144. return new Request<Models.Room>(CAPI.ovr_Room_UpdateDataStore(roomID, kvps));
  145. }
  146. return null;
  147. }
  148. [Obsolete("Deprecated in favor of SetRoomInviteAcceptedNotificationCallback")]
  149. public static void SetRoomInviteNotificationCallback(Message<string>.Callback callback)
  150. {
  151. SetRoomInviteAcceptedNotificationCallback(callback);
  152. }
  153. }
  154. public static partial class Matchmaking
  155. {
  156. public class CustomQuery
  157. {
  158. public Dictionary<string, object> data;
  159. public Criterion[] criteria;
  160. public struct Criterion
  161. {
  162. public Criterion(string key_, MatchmakingCriterionImportance importance_)
  163. {
  164. key = key_;
  165. importance = importance_;
  166. parameters = null;
  167. }
  168. public string key;
  169. public MatchmakingCriterionImportance importance;
  170. public Dictionary<string, object> parameters;
  171. }
  172. public IntPtr ToUnmanaged()
  173. {
  174. var customQueryUnmanaged = new CAPI.ovrMatchmakingCustomQueryData();
  175. if(criteria != null && criteria.Length > 0)
  176. {
  177. customQueryUnmanaged.criterionArrayCount = (uint)criteria.Length;
  178. var temp = new CAPI.ovrMatchmakingCriterion[criteria.Length];
  179. for(int i=0; i<criteria.Length; i++)
  180. {
  181. temp[i].importance_ = criteria[i].importance;
  182. temp[i].key_ = criteria[i].key;
  183. if(criteria[i].parameters != null && criteria[i].parameters.Count > 0)
  184. {
  185. temp[i].parameterArrayCount = (uint)criteria[i].parameters.Count;
  186. temp[i].parameterArray = CAPI.ArrayOfStructsToIntPtr(CAPI.DictionaryToOVRKeyValuePairs(criteria[i].parameters));
  187. }
  188. else
  189. {
  190. temp[i].parameterArrayCount = 0;
  191. temp[i].parameterArray = IntPtr.Zero;
  192. }
  193. }
  194. customQueryUnmanaged.criterionArray = CAPI.ArrayOfStructsToIntPtr(temp);
  195. }
  196. else
  197. {
  198. customQueryUnmanaged.criterionArrayCount = 0;
  199. customQueryUnmanaged.criterionArray = IntPtr.Zero;
  200. }
  201. if(data != null && data.Count > 0)
  202. {
  203. customQueryUnmanaged.dataArrayCount = (uint)data.Count;
  204. customQueryUnmanaged.dataArray = CAPI.ArrayOfStructsToIntPtr(CAPI.DictionaryToOVRKeyValuePairs(data));
  205. }
  206. else
  207. {
  208. customQueryUnmanaged.dataArrayCount = 0;
  209. customQueryUnmanaged.dataArray = IntPtr.Zero;
  210. }
  211. IntPtr res = Marshal.AllocHGlobal(Marshal.SizeOf(customQueryUnmanaged));
  212. Marshal.StructureToPtr(customQueryUnmanaged, res, true);
  213. return res;
  214. }
  215. }
  216. public static Request ReportResultsInsecure(UInt64 roomID, Dictionary<string, int> data)
  217. {
  218. if(Core.IsInitialized())
  219. {
  220. CAPI.ovrKeyValuePair[] kvps = new CAPI.ovrKeyValuePair[data.Count];
  221. int i=0;
  222. foreach(var item in data)
  223. {
  224. kvps[i++] = new CAPI.ovrKeyValuePair(item.Key, item.Value);
  225. }
  226. return new Request(CAPI.ovr_Matchmaking_ReportResultInsecure(roomID, kvps));
  227. }
  228. return null;
  229. }
  230. public static Request<Models.MatchmakingStats> GetStats(string pool, uint maxLevel, MatchmakingStatApproach approach = MatchmakingStatApproach.Trailing)
  231. {
  232. if (Core.IsInitialized())
  233. {
  234. return new Request<Models.MatchmakingStats>(CAPI.ovr_Matchmaking_GetStats(pool, maxLevel, approach));
  235. }
  236. return null;
  237. }
  238. }
  239. public static partial class Net
  240. {
  241. public static Packet ReadPacket()
  242. {
  243. if (!Core.IsInitialized())
  244. {
  245. return null;
  246. }
  247. var packetHandle = CAPI.ovr_Net_ReadPacket();
  248. if(packetHandle == IntPtr.Zero)
  249. {
  250. return null;
  251. }
  252. return new Packet(packetHandle);
  253. }
  254. public static bool SendPacket(UInt64 userID, byte[] bytes, SendPolicy policy)
  255. {
  256. if(Core.IsInitialized())
  257. {
  258. return CAPI.ovr_Net_SendPacket(userID, (UIntPtr)bytes.Length, bytes, policy);
  259. }
  260. return false;
  261. }
  262. public static void Connect(UInt64 userID)
  263. {
  264. if (Core.IsInitialized())
  265. {
  266. CAPI.ovr_Net_Connect(userID);
  267. }
  268. }
  269. public static void Accept(UInt64 userID)
  270. {
  271. if(Core.IsInitialized())
  272. {
  273. CAPI.ovr_Net_Accept(userID);
  274. }
  275. }
  276. public static void Close(UInt64 userID)
  277. {
  278. if(Core.IsInitialized())
  279. {
  280. CAPI.ovr_Net_Close(userID);
  281. }
  282. }
  283. public static bool IsConnected(UInt64 userID)
  284. {
  285. return Core.IsInitialized() && CAPI.ovr_Net_IsConnected(userID);
  286. }
  287. public static bool SendPacketToCurrentRoom(byte[] bytes, SendPolicy policy)
  288. {
  289. if (Core.IsInitialized())
  290. {
  291. return CAPI.ovr_Net_SendPacketToCurrentRoom((UIntPtr)bytes.Length, bytes, policy);
  292. }
  293. return false;
  294. }
  295. public static bool AcceptForCurrentRoom()
  296. {
  297. if (Core.IsInitialized())
  298. {
  299. return CAPI.ovr_Net_AcceptForCurrentRoom();
  300. }
  301. return false;
  302. }
  303. public static void CloseForCurrentRoom()
  304. {
  305. if (Core.IsInitialized())
  306. {
  307. CAPI.ovr_Net_CloseForCurrentRoom();
  308. }
  309. }
  310. public static Request<Models.PingResult> Ping(UInt64 userID)
  311. {
  312. if(Core.IsInitialized())
  313. {
  314. return new Request<Models.PingResult>(CAPI.ovr_Net_Ping(userID));
  315. }
  316. return null;
  317. }
  318. }
  319. public static partial class Leaderboards
  320. {
  321. public static Request<Models.LeaderboardEntryList> GetNextEntries(Models.LeaderboardEntryList list)
  322. {
  323. if (Core.IsInitialized())
  324. {
  325. return new Request<Models.LeaderboardEntryList>(CAPI.ovr_HTTP_GetWithMessageType(list.NextUrl, (int)Message.MessageType.Leaderboard_GetNextEntries));
  326. }
  327. return null;
  328. }
  329. public static Request<Models.LeaderboardEntryList> GetPreviousEntries(Models.LeaderboardEntryList list)
  330. {
  331. if (Core.IsInitialized())
  332. {
  333. return new Request<Models.LeaderboardEntryList>(CAPI.ovr_HTTP_GetWithMessageType(list.PreviousUrl, (int)Message.MessageType.Leaderboard_GetPreviousEntries));
  334. }
  335. return null;
  336. }
  337. }
  338. public static partial class Voip
  339. {
  340. public static void Start(UInt64 userID)
  341. {
  342. if (Core.IsInitialized())
  343. {
  344. CAPI.ovr_Voip_Start(userID);
  345. }
  346. }
  347. public static void Accept(UInt64 userID)
  348. {
  349. if (Core.IsInitialized())
  350. {
  351. CAPI.ovr_Voip_Accept(userID);
  352. }
  353. }
  354. public static void Stop(UInt64 userID)
  355. {
  356. if (Core.IsInitialized())
  357. {
  358. CAPI.ovr_Voip_Stop(userID);
  359. }
  360. }
  361. public static void SetMicrophoneFilterCallback(CAPI.FilterCallback callback)
  362. {
  363. if (Core.IsInitialized())
  364. {
  365. CAPI.ovr_Voip_SetMicrophoneFilterCallbackWithFixedSizeBuffer(callback, (UIntPtr)CAPI.VoipFilterBufferSize);
  366. }
  367. }
  368. public static void SetMicrophoneMuted(VoipMuteState state)
  369. {
  370. if (Core.IsInitialized())
  371. {
  372. CAPI.ovr_Voip_SetMicrophoneMuted(state);
  373. }
  374. }
  375. public static VoipMuteState GetSystemVoipMicrophoneMuted()
  376. {
  377. if (Core.IsInitialized())
  378. {
  379. return CAPI.ovr_Voip_GetSystemVoipMicrophoneMuted();
  380. }
  381. return VoipMuteState.Unknown;
  382. }
  383. public static SystemVoipStatus GetSystemVoipStatus()
  384. {
  385. if (Core.IsInitialized())
  386. {
  387. return CAPI.ovr_Voip_GetSystemVoipStatus();
  388. }
  389. return SystemVoipStatus.Unknown;
  390. }
  391. public static Oculus.Platform.VoipDtxState GetIsConnectionUsingDtx(UInt64 peerID)
  392. {
  393. if (Core.IsInitialized())
  394. {
  395. return CAPI.ovr_Voip_GetIsConnectionUsingDtx(peerID);
  396. }
  397. return Oculus.Platform.VoipDtxState.Unknown;
  398. }
  399. public static Oculus.Platform.VoipBitrate GetLocalBitrate(UInt64 peerID)
  400. {
  401. if (Core.IsInitialized())
  402. {
  403. return CAPI.ovr_Voip_GetLocalBitrate(peerID);
  404. }
  405. return Oculus.Platform.VoipBitrate.Unknown;
  406. }
  407. public static Oculus.Platform.VoipBitrate GetRemoteBitrate(UInt64 peerID)
  408. {
  409. if (Core.IsInitialized())
  410. {
  411. return CAPI.ovr_Voip_GetRemoteBitrate(peerID);
  412. }
  413. return Oculus.Platform.VoipBitrate.Unknown;
  414. }
  415. public static void SetNewConnectionOptions(VoipOptions voipOptions)
  416. {
  417. if (Core.IsInitialized())
  418. {
  419. CAPI.ovr_Voip_SetNewConnectionOptions((IntPtr)voipOptions);
  420. }
  421. }
  422. }
  423. public static partial class Achievements
  424. {
  425. /// Add 'count' to the achievement with the given name. This must be a COUNT
  426. /// achievement. The largest number that is supported by this method is the max
  427. /// value of a signed 64-bit integer. If the number is larger than that, it is
  428. /// clamped to that max value before being passed to the servers.
  429. ///
  430. public static Request<Models.AchievementUpdate> AddCount(string name, ulong count)
  431. {
  432. if (Core.IsInitialized())
  433. {
  434. return new Request<Models.AchievementUpdate>(CAPI.ovr_Achievements_AddCount(name, count));
  435. }
  436. return null;
  437. }
  438. /// Unlock fields of a BITFIELD achievement.
  439. /// \param name The name of the achievement to unlock
  440. /// \param fields A string containing either '0' or '1' characters. Every '1' will unlock the field in the corresponding position.
  441. ///
  442. public static Request<Models.AchievementUpdate> AddFields(string name, string fields)
  443. {
  444. if (Core.IsInitialized())
  445. {
  446. return new Request<Models.AchievementUpdate>(CAPI.ovr_Achievements_AddFields(name, fields));
  447. }
  448. return null;
  449. }
  450. /// Request all achievement definitions for the app.
  451. ///
  452. public static Request<Models.AchievementDefinitionList> GetAllDefinitions()
  453. {
  454. if (Core.IsInitialized())
  455. {
  456. return new Request<Models.AchievementDefinitionList>(CAPI.ovr_Achievements_GetAllDefinitions());
  457. }
  458. return null;
  459. }
  460. /// Request the progress for the user on all achievements in the app.
  461. ///
  462. public static Request<Models.AchievementProgressList> GetAllProgress()
  463. {
  464. if (Core.IsInitialized())
  465. {
  466. return new Request<Models.AchievementProgressList>(CAPI.ovr_Achievements_GetAllProgress());
  467. }
  468. return null;
  469. }
  470. /// Request the achievement definitions that match the specified names.
  471. ///
  472. public static Request<Models.AchievementDefinitionList> GetDefinitionsByName(string[] names)
  473. {
  474. if (Core.IsInitialized())
  475. {
  476. return new Request<Models.AchievementDefinitionList>(CAPI.ovr_Achievements_GetDefinitionsByName(names, (names != null ? names.Length : 0)));
  477. }
  478. return null;
  479. }
  480. /// Request the user's progress on the specified achievements.
  481. ///
  482. public static Request<Models.AchievementProgressList> GetProgressByName(string[] names)
  483. {
  484. if (Core.IsInitialized())
  485. {
  486. return new Request<Models.AchievementProgressList>(CAPI.ovr_Achievements_GetProgressByName(names, (names != null ? names.Length : 0)));
  487. }
  488. return null;
  489. }
  490. /// Unlock the achievement with the given name. This can be of any achievement
  491. /// type.
  492. ///
  493. public static Request<Models.AchievementUpdate> Unlock(string name)
  494. {
  495. if (Core.IsInitialized())
  496. {
  497. return new Request<Models.AchievementUpdate>(CAPI.ovr_Achievements_Unlock(name));
  498. }
  499. return null;
  500. }
  501. }
  502. public static partial class Application
  503. {
  504. /// Requests version information, including the currently installed and latest
  505. /// available version name and version code.
  506. ///
  507. public static Request<Models.ApplicationVersion> GetVersion()
  508. {
  509. if (Core.IsInitialized())
  510. {
  511. return new Request<Models.ApplicationVersion>(CAPI.ovr_Application_GetVersion());
  512. }
  513. return null;
  514. }
  515. /// Launches a different application in the user's library. If the user does
  516. /// not have that application installed, they will be taken to that app's page
  517. /// in the Oculus Store
  518. /// \param appID The ID of the app to launch
  519. /// \param deeplink_options Additional configuration for this requests. Optional.
  520. ///
  521. public static Request<string> LaunchOtherApp(UInt64 appID, ApplicationOptions deeplink_options = null)
  522. {
  523. if (Core.IsInitialized())
  524. {
  525. return new Request<string>(CAPI.ovr_Application_LaunchOtherApp(appID, (IntPtr)deeplink_options));
  526. }
  527. return null;
  528. }
  529. }
  530. public static partial class ApplicationLifecycle
  531. {
  532. /// Sent when a launch intent is received (for both cold and warm starts). The
  533. /// payload is the type of the intent. ApplicationLifecycle.GetLaunchDetails()
  534. /// should be called to get the other details.
  535. ///
  536. public static void SetLaunchIntentChangedNotificationCallback(Message<string>.Callback callback)
  537. {
  538. Callback.SetNotificationCallback(
  539. Message.MessageType.Notification_ApplicationLifecycle_LaunchIntentChanged,
  540. callback
  541. );
  542. }
  543. }
  544. public static partial class AssetFile
  545. {
  546. /// DEPRECATED. Use AssetFile.DeleteById()
  547. ///
  548. public static Request<Models.AssetFileDeleteResult> Delete(UInt64 assetFileID)
  549. {
  550. if (Core.IsInitialized())
  551. {
  552. return new Request<Models.AssetFileDeleteResult>(CAPI.ovr_AssetFile_Delete(assetFileID));
  553. }
  554. return null;
  555. }
  556. /// Removes an previously installed asset file from the device by its ID.
  557. /// Returns an object containing the asset ID and file name, and a success
  558. /// flag.
  559. /// \param assetFileID The asset file ID
  560. ///
  561. public static Request<Models.AssetFileDeleteResult> DeleteById(UInt64 assetFileID)
  562. {
  563. if (Core.IsInitialized())
  564. {
  565. return new Request<Models.AssetFileDeleteResult>(CAPI.ovr_AssetFile_DeleteById(assetFileID));
  566. }
  567. return null;
  568. }
  569. /// Removes an previously installed asset file from the device by its name.
  570. /// Returns an object containing the asset ID and file name, and a success
  571. /// flag.
  572. /// \param assetFileName The asset file name
  573. ///
  574. public static Request<Models.AssetFileDeleteResult> DeleteByName(string assetFileName)
  575. {
  576. if (Core.IsInitialized())
  577. {
  578. return new Request<Models.AssetFileDeleteResult>(CAPI.ovr_AssetFile_DeleteByName(assetFileName));
  579. }
  580. return null;
  581. }
  582. /// DEPRECATED. Use AssetFile.DownloadById()
  583. ///
  584. public static Request<Models.AssetFileDownloadResult> Download(UInt64 assetFileID)
  585. {
  586. if (Core.IsInitialized())
  587. {
  588. return new Request<Models.AssetFileDownloadResult>(CAPI.ovr_AssetFile_Download(assetFileID));
  589. }
  590. return null;
  591. }
  592. /// Downloads an asset file by its ID on demand. Returns an object containing
  593. /// the asset ID and filepath. Sends periodic
  594. /// MessageType.Notification_AssetFile_DownloadUpdate to track the downloads.
  595. /// \param assetFileID The asset file ID
  596. ///
  597. public static Request<Models.AssetFileDownloadResult> DownloadById(UInt64 assetFileID)
  598. {
  599. if (Core.IsInitialized())
  600. {
  601. return new Request<Models.AssetFileDownloadResult>(CAPI.ovr_AssetFile_DownloadById(assetFileID));
  602. }
  603. return null;
  604. }
  605. /// Downloads an asset file by its name on demand. Returns an object containing
  606. /// the asset ID and filepath. Sends periodic
  607. /// {notifications.asset_file.download_update}} to track the downloads.
  608. /// \param assetFileName The asset file name
  609. ///
  610. public static Request<Models.AssetFileDownloadResult> DownloadByName(string assetFileName)
  611. {
  612. if (Core.IsInitialized())
  613. {
  614. return new Request<Models.AssetFileDownloadResult>(CAPI.ovr_AssetFile_DownloadByName(assetFileName));
  615. }
  616. return null;
  617. }
  618. /// DEPRECATED. Use AssetFile.DownloadCancelById()
  619. ///
  620. public static Request<Models.AssetFileDownloadCancelResult> DownloadCancel(UInt64 assetFileID)
  621. {
  622. if (Core.IsInitialized())
  623. {
  624. return new Request<Models.AssetFileDownloadCancelResult>(CAPI.ovr_AssetFile_DownloadCancel(assetFileID));
  625. }
  626. return null;
  627. }
  628. /// Cancels a previously spawned download request for an asset file by its ID.
  629. /// Returns an object containing the asset ID and file path, and a success
  630. /// flag.
  631. /// \param assetFileID The asset file ID
  632. ///
  633. public static Request<Models.AssetFileDownloadCancelResult> DownloadCancelById(UInt64 assetFileID)
  634. {
  635. if (Core.IsInitialized())
  636. {
  637. return new Request<Models.AssetFileDownloadCancelResult>(CAPI.ovr_AssetFile_DownloadCancelById(assetFileID));
  638. }
  639. return null;
  640. }
  641. /// Cancels a previously spawned download request for an asset file by its
  642. /// name. Returns an object containing the asset ID and file path, and a
  643. /// success flag.
  644. /// \param assetFileName The asset file name
  645. ///
  646. public static Request<Models.AssetFileDownloadCancelResult> DownloadCancelByName(string assetFileName)
  647. {
  648. if (Core.IsInitialized())
  649. {
  650. return new Request<Models.AssetFileDownloadCancelResult>(CAPI.ovr_AssetFile_DownloadCancelByName(assetFileName));
  651. }
  652. return null;
  653. }
  654. /// Returns an array of objects with asset file names and their associated IDs,
  655. /// and and whether it's currently installed.
  656. ///
  657. public static Request<Models.AssetDetailsList> GetList()
  658. {
  659. if (Core.IsInitialized())
  660. {
  661. return new Request<Models.AssetDetailsList>(CAPI.ovr_AssetFile_GetList());
  662. }
  663. return null;
  664. }
  665. /// DEPRECATED. Use AssetFile.StatusById()
  666. ///
  667. public static Request<Models.AssetDetails> Status(UInt64 assetFileID)
  668. {
  669. if (Core.IsInitialized())
  670. {
  671. return new Request<Models.AssetDetails>(CAPI.ovr_AssetFile_Status(assetFileID));
  672. }
  673. return null;
  674. }
  675. /// Returns the details on a single asset: ID, file name, and whether it's
  676. /// currently installed
  677. /// \param assetFileID The asset file ID
  678. ///
  679. public static Request<Models.AssetDetails> StatusById(UInt64 assetFileID)
  680. {
  681. if (Core.IsInitialized())
  682. {
  683. return new Request<Models.AssetDetails>(CAPI.ovr_AssetFile_StatusById(assetFileID));
  684. }
  685. return null;
  686. }
  687. /// Returns the details on a single asset: ID, file name, and whether it's
  688. /// currently installed
  689. /// \param assetFileName The asset file name
  690. ///
  691. public static Request<Models.AssetDetails> StatusByName(string assetFileName)
  692. {
  693. if (Core.IsInitialized())
  694. {
  695. return new Request<Models.AssetDetails>(CAPI.ovr_AssetFile_StatusByName(assetFileName));
  696. }
  697. return null;
  698. }
  699. /// Sent to indicate download progress for asset files.
  700. ///
  701. public static void SetDownloadUpdateNotificationCallback(Message<Models.AssetFileDownloadUpdate>.Callback callback)
  702. {
  703. Callback.SetNotificationCallback(
  704. Message.MessageType.Notification_AssetFile_DownloadUpdate,
  705. callback
  706. );
  707. }
  708. }
  709. public static partial class Avatar
  710. {
  711. }
  712. public static partial class Cal
  713. {
  714. }
  715. public static partial class CloudStorage
  716. {
  717. /// Deletes the specified save data buffer. Conflicts are handled just like
  718. /// Saves.
  719. /// \param bucket The name of the storage bucket.
  720. /// \param key The name for this saved data.
  721. ///
  722. public static Request<Models.CloudStorageUpdateResponse> Delete(string bucket, string key)
  723. {
  724. if (Core.IsInitialized())
  725. {
  726. return new Request<Models.CloudStorageUpdateResponse>(CAPI.ovr_CloudStorage_Delete(bucket, key));
  727. }
  728. return null;
  729. }
  730. /// Loads the saved entry for the specified bucket and key. If a conflict
  731. /// exists with the key then an error message is returned.
  732. /// \param bucket The name of the storage bucket.
  733. /// \param key The name for this saved data.
  734. ///
  735. public static Request<Models.CloudStorageData> Load(string bucket, string key)
  736. {
  737. if (Core.IsInitialized())
  738. {
  739. return new Request<Models.CloudStorageData>(CAPI.ovr_CloudStorage_Load(bucket, key));
  740. }
  741. return null;
  742. }
  743. /// Loads all the metadata for the saves in the specified bucket, including
  744. /// conflicts.
  745. /// \param bucket The name of the storage bucket.
  746. ///
  747. public static Request<Models.CloudStorageMetadataList> LoadBucketMetadata(string bucket)
  748. {
  749. if (Core.IsInitialized())
  750. {
  751. return new Request<Models.CloudStorageMetadataList>(CAPI.ovr_CloudStorage_LoadBucketMetadata(bucket));
  752. }
  753. return null;
  754. }
  755. /// Loads the metadata for this bucket-key combination that need to be manually
  756. /// resolved.
  757. /// \param bucket The name of the storage bucket
  758. /// \param key The key for this saved data.
  759. ///
  760. public static Request<Models.CloudStorageConflictMetadata> LoadConflictMetadata(string bucket, string key)
  761. {
  762. if (Core.IsInitialized())
  763. {
  764. return new Request<Models.CloudStorageConflictMetadata>(CAPI.ovr_CloudStorage_LoadConflictMetadata(bucket, key));
  765. }
  766. return null;
  767. }
  768. /// Loads the data specified by the storage handle.
  769. ///
  770. public static Request<Models.CloudStorageData> LoadHandle(string handle)
  771. {
  772. if (Core.IsInitialized())
  773. {
  774. return new Request<Models.CloudStorageData>(CAPI.ovr_CloudStorage_LoadHandle(handle));
  775. }
  776. return null;
  777. }
  778. /// load the metadata for the specified key
  779. /// \param bucket The name of the storage bucket.
  780. /// \param key The name for this saved data.
  781. ///
  782. public static Request<Models.CloudStorageMetadata> LoadMetadata(string bucket, string key)
  783. {
  784. if (Core.IsInitialized())
  785. {
  786. return new Request<Models.CloudStorageMetadata>(CAPI.ovr_CloudStorage_LoadMetadata(bucket, key));
  787. }
  788. return null;
  789. }
  790. /// Selects the local save for manual conflict resolution.
  791. /// \param bucket The name of the storage bucket.
  792. /// \param key The name for this saved data.
  793. /// \param remoteHandle The handle of the remote that the local file was resolved against.
  794. ///
  795. public static Request<Models.CloudStorageUpdateResponse> ResolveKeepLocal(string bucket, string key, string remoteHandle)
  796. {
  797. if (Core.IsInitialized())
  798. {
  799. return new Request<Models.CloudStorageUpdateResponse>(CAPI.ovr_CloudStorage_ResolveKeepLocal(bucket, key, remoteHandle));
  800. }
  801. return null;
  802. }
  803. /// Selects the remote save for manual conflict resolution.
  804. /// \param bucket The name of the storage bucket.
  805. /// \param key The name for this saved data.
  806. /// \param remoteHandle The handle of the remote.
  807. ///
  808. public static Request<Models.CloudStorageUpdateResponse> ResolveKeepRemote(string bucket, string key, string remoteHandle)
  809. {
  810. if (Core.IsInitialized())
  811. {
  812. return new Request<Models.CloudStorageUpdateResponse>(CAPI.ovr_CloudStorage_ResolveKeepRemote(bucket, key, remoteHandle));
  813. }
  814. return null;
  815. }
  816. /// Note: Cloud Storage is only available for Rift apps.
  817. ///
  818. /// Send a save data buffer to the platform. CloudStorage.Save() passes a
  819. /// pointer to your data in an async call. You need to maintain the save data
  820. /// until you receive the message indicating that the save was successful.
  821. ///
  822. /// If the data is destroyed or modified prior to receiving that message the
  823. /// data will not be saved.
  824. /// \param bucket The name of the storage bucket.
  825. /// \param key The name for this saved data.
  826. /// \param data Start of the data block.
  827. /// \param counter Optional. Counter used for user data or auto-deconfliction.
  828. /// \param extraData Optional. String data that isn't used by the platform.
  829. ///
  830. /// <b>Error codes</b>
  831. /// - \b 100: The stored version has a later timestamp than the data provided. This cloud storage bucket's conflict resolution policy is configured to use the latest timestamp, which is configurable in the developer dashboard.
  832. ///
  833. public static Request<Models.CloudStorageUpdateResponse> Save(string bucket, string key, byte[] data, long counter, string extraData)
  834. {
  835. if (Core.IsInitialized())
  836. {
  837. return new Request<Models.CloudStorageUpdateResponse>(CAPI.ovr_CloudStorage_Save(bucket, key, data, (uint)(data != null ? data.Length : 0), counter, extraData));
  838. }
  839. return null;
  840. }
  841. }
  842. public static partial class CloudStorage2
  843. {
  844. /// Get the directory path for the current user/app pair that will be used
  845. /// during cloud storage synchronization
  846. ///
  847. public static Request<string> GetUserDirectoryPath()
  848. {
  849. if (Core.IsInitialized())
  850. {
  851. return new Request<string>(CAPI.ovr_CloudStorage2_GetUserDirectoryPath());
  852. }
  853. return null;
  854. }
  855. }
  856. public static partial class Colocation
  857. {
  858. }
  859. public static partial class Entitlements
  860. {
  861. /// Returns whether the current user is entitled to the current app.
  862. ///
  863. public static Request IsUserEntitledToApplication()
  864. {
  865. if (Core.IsInitialized())
  866. {
  867. return new Request(CAPI.ovr_Entitlement_GetIsViewerEntitled());
  868. }
  869. return null;
  870. }
  871. }
  872. public static partial class GraphAPI
  873. {
  874. }
  875. public static partial class HTTP
  876. {
  877. }
  878. public static partial class IAP
  879. {
  880. /// Allow the consumable IAP product to be purchased again. Conceptually, this
  881. /// indicates that the item was used or consumed.
  882. ///
  883. public static Request ConsumePurchase(string sku)
  884. {
  885. if (Core.IsInitialized())
  886. {
  887. return new Request(CAPI.ovr_IAP_ConsumePurchase(sku));
  888. }
  889. return null;
  890. }
  891. /// Retrieve a list of IAP products that can be purchased.
  892. /// \param skus The SKUs of the products to retrieve.
  893. ///
  894. public static Request<Models.ProductList> GetProductsBySKU(string[] skus)
  895. {
  896. if (Core.IsInitialized())
  897. {
  898. return new Request<Models.ProductList>(CAPI.ovr_IAP_GetProductsBySKU(skus, (skus != null ? skus.Length : 0)));
  899. }
  900. return null;
  901. }
  902. /// Retrieve a list of Purchase that the Logged-In-User has made. This list
  903. /// will also contain consumable purchases that have not been consumed.
  904. ///
  905. public static Request<Models.PurchaseList> GetViewerPurchases()
  906. {
  907. if (Core.IsInitialized())
  908. {
  909. return new Request<Models.PurchaseList>(CAPI.ovr_IAP_GetViewerPurchases());
  910. }
  911. return null;
  912. }
  913. /// Retrieve a list of Purchase that the Logged-In-User has made. This list
  914. /// will only contain durable purchase (non-consumable) and is populated from a
  915. /// device cache. It is recommended in all cases to use
  916. /// ovr_User_GetViewerPurchases first and only check the cache if that fails.
  917. ///
  918. public static Request<Models.PurchaseList> GetViewerPurchasesDurableCache()
  919. {
  920. if (Core.IsInitialized())
  921. {
  922. return new Request<Models.PurchaseList>(CAPI.ovr_IAP_GetViewerPurchasesDurableCache());
  923. }
  924. return null;
  925. }
  926. /// Launch the checkout flow to purchase the existing product. Oculus Home
  927. /// tries handle and fix as many errors as possible. Home returns the
  928. /// appropriate error message and how to resolveit, if possible. Returns a
  929. /// purchase on success, empty purchase on cancel, and an error on error.
  930. /// \param sku IAP sku for the item the user wishes to purchase.
  931. ///
  932. public static Request<Models.Purchase> LaunchCheckoutFlow(string sku)
  933. {
  934. if (Core.IsInitialized())
  935. {
  936. if (UnityEngine.Application.isEditor) {
  937. throw new NotImplementedException("LaunchCheckoutFlow() is not implemented in the editor yet.");
  938. }
  939. return new Request<Models.Purchase>(CAPI.ovr_IAP_LaunchCheckoutFlow(sku));
  940. }
  941. return null;
  942. }
  943. }
  944. public static partial class LanguagePack
  945. {
  946. /// Returns currently installed and selected language pack for an app in the
  947. /// view of the `asset_details`. Use `language` field to extract neeeded
  948. /// language info. A particular language can be download and installed by a
  949. /// user from the Oculus app on the application page.
  950. ///
  951. public static Request<Models.AssetDetails> GetCurrent()
  952. {
  953. if (Core.IsInitialized())
  954. {
  955. return new Request<Models.AssetDetails>(CAPI.ovr_LanguagePack_GetCurrent());
  956. }
  957. return null;
  958. }
  959. /// Sets the current language to specified. The parameter is the BCP47 language
  960. /// tag. If a language pack is not downloaded yet, spawns automatically the
  961. /// AssetFile.DownloadByName() request, and sends periodic
  962. /// MessageType.Notification_AssetFile_DownloadUpdate to track the downloads.
  963. /// Once the language asset file is downloaded, call LanguagePack.GetCurrent()
  964. /// to retrive the data, and use the language at runtime.
  965. /// \param tag BCP47 language tag
  966. ///
  967. public static Request<Models.AssetFileDownloadResult> SetCurrent(string tag)
  968. {
  969. if (Core.IsInitialized())
  970. {
  971. return new Request<Models.AssetFileDownloadResult>(CAPI.ovr_LanguagePack_SetCurrent(tag));
  972. }
  973. return null;
  974. }
  975. }
  976. public static partial class Leaderboards
  977. {
  978. /// Requests a block of Leaderboard Entries.
  979. /// \param leaderboardName The name of the leaderboard whose entries to return.
  980. /// \param limit Defines the maximum number of entries to return.
  981. /// \param filter Allows you to restrict the returned values by friends.
  982. /// \param startAt Defines whether to center the query on the user or start at the top of the leaderboard.
  983. ///
  984. /// <b>Error codes</b>
  985. /// - \b 12074: You're not yet ranked on this leaderboard.
  986. ///
  987. public static Request<Models.LeaderboardEntryList> GetEntries(string leaderboardName, int limit, LeaderboardFilterType filter, LeaderboardStartAt startAt)
  988. {
  989. if (Core.IsInitialized())
  990. {
  991. return new Request<Models.LeaderboardEntryList>(CAPI.ovr_Leaderboard_GetEntries(leaderboardName, limit, filter, startAt));
  992. }
  993. return null;
  994. }
  995. /// Requests a block of leaderboard Entries.
  996. /// \param leaderboardName The name of the leaderboard.
  997. /// \param limit The maximum number of entries to return.
  998. /// \param afterRank The position after which to start. For example, 10 returns leaderboard results starting with the 11th user.
  999. ///
  1000. public static Request<Models.LeaderboardEntryList> GetEntriesAfterRank(string leaderboardName, int limit, ulong afterRank)
  1001. {
  1002. if (Core.IsInitialized())
  1003. {
  1004. return new Request<Models.LeaderboardEntryList>(CAPI.ovr_Leaderboard_GetEntriesAfterRank(leaderboardName, limit, afterRank));
  1005. }
  1006. return null;
  1007. }
  1008. /// Writes a single entry to a leaderboard.
  1009. /// \param leaderboardName The leaderboard for which to write the entry.
  1010. /// \param score The score to write.
  1011. /// \param extraData A 2KB custom data field that is associated with the leaderboard entry. This can be a game replay or anything that provides more detail about the entry to the viewer.
  1012. /// \param forceUpdate If true, the score always updates. This happens even if it is not the user's best score.
  1013. ///
  1014. /// <b>Error codes</b>
  1015. /// - \b 100: Parameter {parameter}: invalid user id: {user_id}
  1016. ///
  1017. public static Request<bool> WriteEntry(string leaderboardName, long score, byte[] extraData = null, bool forceUpdate = false)
  1018. {
  1019. if (Core.IsInitialized())
  1020. {
  1021. return new Request<bool>(CAPI.ovr_Leaderboard_WriteEntry(leaderboardName, score, extraData, (uint)(extraData != null ? extraData.Length : 0), forceUpdate));
  1022. }
  1023. return null;
  1024. }
  1025. }
  1026. public static partial class Livestreaming
  1027. {
  1028. /// Return the status of the current livestreaming session if there is one.
  1029. ///
  1030. public static Request<Models.LivestreamingStatus> GetStatus()
  1031. {
  1032. if (Core.IsInitialized())
  1033. {
  1034. return new Request<Models.LivestreamingStatus>(CAPI.ovr_Livestreaming_GetStatus());
  1035. }
  1036. return null;
  1037. }
  1038. /// Pauses the livestreaming session if there is one. NOTE: this function is
  1039. /// safe to call if no session is active.
  1040. ///
  1041. public static Request<Models.LivestreamingStatus> PauseStream()
  1042. {
  1043. if (Core.IsInitialized())
  1044. {
  1045. return new Request<Models.LivestreamingStatus>(CAPI.ovr_Livestreaming_PauseStream());
  1046. }
  1047. return null;
  1048. }
  1049. /// Resumes the livestreaming session if there is one. NOTE: this function is
  1050. /// safe to call if no session is active.
  1051. ///
  1052. public static Request<Models.LivestreamingStatus> ResumeStream()
  1053. {
  1054. if (Core.IsInitialized())
  1055. {
  1056. return new Request<Models.LivestreamingStatus>(CAPI.ovr_Livestreaming_ResumeStream());
  1057. }
  1058. return null;
  1059. }
  1060. /// Indicates that the livestreaming session has been updated. You can use this
  1061. /// information to throttle your game performance or increase CPU/GPU
  1062. /// performance. Use Message.GetLivestreamingStatus() to extract the updated
  1063. /// livestreaming status.
  1064. ///
  1065. public static void SetStatusUpdateNotificationCallback(Message<Models.LivestreamingStatus>.Callback callback)
  1066. {
  1067. Callback.SetNotificationCallback(
  1068. Message.MessageType.Notification_Livestreaming_StatusChange,
  1069. callback
  1070. );
  1071. }
  1072. }
  1073. public static partial class Matchmaking
  1074. {
  1075. /// DEPRECATED. Use Browse2.
  1076. /// \param pool A BROWSE type matchmaking pool.
  1077. /// \param customQueryData Optional. Custom query data.
  1078. ///
  1079. /// <b>Error codes</b>
  1080. /// - \b 100: Pool {pool_key} does not contain custom data key {key}. You can configure matchmaking custom data at https://dashboard.oculus.com/application/&lt;app_id&gt;/matchmaking
  1081. /// - \b 12072: Unknown pool: {pool_key}. You can configure matchmaking pools at https://dashboard.oculus.com/application/&lt;app_id&gt;/matchmaking
  1082. ///
  1083. public static Request<Models.MatchmakingBrowseResult> Browse(string pool, CustomQuery customQueryData = null)
  1084. {
  1085. if (Core.IsInitialized())
  1086. {
  1087. return new Request<Models.MatchmakingBrowseResult>(CAPI.ovr_Matchmaking_Browse(pool, customQueryData != null ? customQueryData.ToUnmanaged() : IntPtr.Zero));
  1088. }
  1089. return null;
  1090. }
  1091. /// Modes: BROWSE
  1092. ///
  1093. /// See overview documentation above.
  1094. ///
  1095. /// Return a list of matchmaking rooms in the current pool filtered by skill
  1096. /// and ping (if enabled). This also enqueues the user in the matchmaking
  1097. /// queue. When the user has made a selection, call Rooms.Join2() on one of the
  1098. /// rooms that was returned. If the user stops browsing, call
  1099. /// Matchmaking.Cancel().
  1100. ///
  1101. /// In addition to the list of rooms, enqueue results are also returned. Call
  1102. /// MatchmakingBrowseResult.GetEnqueueResult() to obtain them. See
  1103. /// OVR_MatchmakingEnqueueResult.h for details.
  1104. /// \param pool A BROWSE type matchmaking pool.
  1105. /// \param matchmakingOptions Additional matchmaking configuration for this request. Optional.
  1106. ///
  1107. /// <b>Error codes</b>
  1108. /// - \b 100: Pool {pool_key} does not contain custom data key {key}. You can configure matchmaking custom data at https://dashboard.oculus.com/application/&lt;app_id&gt;/matchmaking
  1109. /// - \b 12072: Unknown pool: {pool_key}. You can configure matchmaking pools at https://dashboard.oculus.com/application/&lt;app_id&gt;/matchmaking
  1110. ///
  1111. public static Request<Models.MatchmakingBrowseResult> Browse2(string pool, MatchmakingOptions matchmakingOptions = null)
  1112. {
  1113. if (Core.IsInitialized())
  1114. {
  1115. return new Request<Models.MatchmakingBrowseResult>(CAPI.ovr_Matchmaking_Browse2(pool, (IntPtr)matchmakingOptions));
  1116. }
  1117. return null;
  1118. }
  1119. /// DEPRECATED. Use Cancel2.
  1120. /// \param pool The pool in question.
  1121. /// \param requestHash Used to find your entry in a queue.
  1122. ///
  1123. /// <b>Error codes</b>
  1124. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is currently in another room (perhaps on another device), and thus is no longer in this room. Users can only be in one room at a time. If they are active on two different devices at once, there will be undefined behavior.
  1125. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is not in the room (or any room). Perhaps they already left, or they stopped heartbeating. If this is a test environment, make sure you are not using the deprecated initialization methods ovr_PlatformInitializeStandaloneAccessToken (C++)/StandalonePlatform.Initialize(accessToken) (C#).
  1126. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is not the owner of the room.
  1127. /// - \b 100: Invalid room_id: {room_id}. Either the ID is not a valid room or the user does not have permission to see or act on the room.
  1128. ///
  1129. public static Request Cancel(string pool, string requestHash)
  1130. {
  1131. if (Core.IsInitialized())
  1132. {
  1133. return new Request(CAPI.ovr_Matchmaking_Cancel(pool, requestHash));
  1134. }
  1135. return null;
  1136. }
  1137. /// Modes: QUICKMATCH, BROWSE
  1138. ///
  1139. /// Makes a best effort to cancel a previous Enqueue request before a match
  1140. /// occurs. Typically triggered when a user gives up waiting. For BROWSE mode,
  1141. /// call this when a user gives up looking through the room list or when the
  1142. /// host of a room wants to stop receiving new users. If you don't cancel but
  1143. /// the user goes offline, the user/room will be timed out of the queue within
  1144. /// 30 seconds.
  1145. ///
  1146. /// <b>Error codes</b>
  1147. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is currently in another room (perhaps on another device), and thus is no longer in this room. Users can only be in one room at a time. If they are active on two different devices at once, there will be undefined behavior.
  1148. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is not in the room (or any room). Perhaps they already left, or they stopped heartbeating. If this is a test environment, make sure you are not using the deprecated initialization methods ovr_PlatformInitializeStandaloneAccessToken (C++)/StandalonePlatform.Initialize(accessToken) (C#).
  1149. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is not the owner of the room.
  1150. /// - \b 100: Invalid room_id: {room_id}. Either the ID is not a valid room or the user does not have permission to see or act on the room.
  1151. ///
  1152. public static Request Cancel()
  1153. {
  1154. if (Core.IsInitialized())
  1155. {
  1156. return new Request(CAPI.ovr_Matchmaking_Cancel2());
  1157. }
  1158. return null;
  1159. }
  1160. /// DEPRECATED. Use CreateAndEnqueueRoom2.
  1161. /// \param pool The matchmaking pool to use, which is defined for the app.
  1162. /// \param maxUsers Overrides the Max Users value, which is configured in pool settings of the Developer Dashboard.
  1163. /// \param subscribeToUpdates If true, sends a message with type MessageType.Notification_Room_RoomUpdate when the room data changes, such as when users join or leave.
  1164. /// \param customQueryData Optional. See "Custom criteria" section above.
  1165. ///
  1166. /// <b>Error codes</b>
  1167. /// - \b 100: Pool {pool_key} does not contain custom data key {key}. You can configure matchmaking custom data at https://dashboard.oculus.com/application/&lt;app_id&gt;/matchmaking
  1168. /// - \b 12051: Pool '{pool_key}' is configured for Quickmatch mode. In Quickmatch mode, rooms are created on users' behalf when a match is found. Specify Advanced Quickmatch or Browse mode to use this feature.
  1169. /// - \b 12072: Unknown pool: {pool_key}. You can configure matchmaking pools at https://dashboard.oculus.com/application/&lt;app_id&gt;/matchmaking
  1170. /// - \b 12089: You have asked to enqueue {num_users} users together, but this must be less than the maximum number of users in a room, {max_users}.
  1171. ///
  1172. public static Request<Models.MatchmakingEnqueueResultAndRoom> CreateAndEnqueueRoom(string pool, uint maxUsers, bool subscribeToUpdates = false, CustomQuery customQueryData = null)
  1173. {
  1174. if (Core.IsInitialized())
  1175. {
  1176. return new Request<Models.MatchmakingEnqueueResultAndRoom>(CAPI.ovr_Matchmaking_CreateAndEnqueueRoom(pool, maxUsers, subscribeToUpdates, customQueryData != null ? customQueryData.ToUnmanaged() : IntPtr.Zero));
  1177. }
  1178. return null;
  1179. }
  1180. /// Modes: BROWSE, QUICKMATCH (Advanced; Can Users Create Rooms = true)
  1181. ///
  1182. /// See overview documentation above.
  1183. ///
  1184. /// Create a matchmaking room, join it, and enqueue it. This is the preferred
  1185. /// method. But, if you do not wish to automatically enqueue the room, you can
  1186. /// call CreateRoom2 instead.
  1187. ///
  1188. /// Visit https://dashboard.oculus.com/application/[YOUR_APP_ID]/matchmaking to
  1189. /// set up pools and queries
  1190. /// \param pool The matchmaking pool to use, which is defined for the app.
  1191. /// \param matchmakingOptions Additional matchmaking configuration for this request. Optional.
  1192. ///
  1193. /// <b>Error codes</b>
  1194. /// - \b 100: Pool {pool_key} does not contain custom data key {key}. You can configure matchmaking custom data at https://dashboard.oculus.com/application/&lt;app_id&gt;/matchmaking
  1195. /// - \b 12051: Pool '{pool_key}' is configured for Quickmatch mode. In Quickmatch mode, rooms are created on users' behalf when a match is found. Specify Advanced Quickmatch or Browse mode to use this feature.
  1196. /// - \b 12072: Unknown pool: {pool_key}. You can configure matchmaking pools at https://dashboard.oculus.com/application/&lt;app_id&gt;/matchmaking
  1197. /// - \b 12089: You have asked to enqueue {num_users} users together, but this must be less than the maximum number of users in a room, {max_users}.
  1198. ///
  1199. public static Request<Models.MatchmakingEnqueueResultAndRoom> CreateAndEnqueueRoom2(string pool, MatchmakingOptions matchmakingOptions = null)
  1200. {
  1201. if (Core.IsInitialized())
  1202. {
  1203. return new Request<Models.MatchmakingEnqueueResultAndRoom>(CAPI.ovr_Matchmaking_CreateAndEnqueueRoom2(pool, (IntPtr)matchmakingOptions));
  1204. }
  1205. return null;
  1206. }
  1207. /// DEPRECATED. Use CreateRoom2.
  1208. /// \param pool The matchmaking pool to use, which is defined for the app.
  1209. /// \param maxUsers Overrides the Max Users value, which is configured in pool settings of the Developer Dashboard.
  1210. /// \param subscribeToUpdates If true, sends a message with type MessageType.Notification_Room_RoomUpdate when room data changes, such as when users join or leave.
  1211. ///
  1212. public static Request<Models.Room> CreateRoom(string pool, uint maxUsers, bool subscribeToUpdates = false)
  1213. {
  1214. if (Core.IsInitialized())
  1215. {
  1216. return new Request<Models.Room>(CAPI.ovr_Matchmaking_CreateRoom(pool, maxUsers, subscribeToUpdates));
  1217. }
  1218. return null;
  1219. }
  1220. /// Create a matchmaking room and join it, but do not enqueue the room. After
  1221. /// creation, you can call EnqueueRoom2. However, Oculus recommends using
  1222. /// CreateAndEnqueueRoom2 instead.
  1223. ///
  1224. /// Modes: BROWSE, QUICKMATCH (Advanced; Can Users Create Rooms = true)
  1225. ///
  1226. /// Create a matchmaking room and join it, but do not enqueue the room. After
  1227. /// creation, you can call EnqueueRoom. Consider using CreateAndEnqueueRoom
  1228. /// instead.
  1229. ///
  1230. /// Visit https://dashboard.oculus.com/application/[YOUR_APP_ID]/matchmaking to
  1231. /// set up pools and queries
  1232. /// \param pool The matchmaking pool to use, which is defined for the app.
  1233. /// \param matchmakingOptions Additional matchmaking configuration for this request. Optional.
  1234. ///
  1235. public static Request<Models.Room> CreateRoom2(string pool, MatchmakingOptions matchmakingOptions = null)
  1236. {
  1237. if (Core.IsInitialized())
  1238. {
  1239. return new Request<Models.Room>(CAPI.ovr_Matchmaking_CreateRoom2(pool, (IntPtr)matchmakingOptions));
  1240. }
  1241. return null;
  1242. }
  1243. /// DEPRECATED. Use Enqueue2.
  1244. /// \param pool The pool to enqueue in.
  1245. /// \param customQueryData Optional. See "Custom criteria" section above.
  1246. ///
  1247. /// <b>Error codes</b>
  1248. /// - \b 100: Pool {pool_key} does not contain custom data key {key}. You can configure matchmaking custom data at https://dashboard.oculus.com/application/&lt;app_id&gt;/matchmaking
  1249. /// - \b 12072: Unknown pool: {pool_key}. You can configure matchmaking pools at https://dashboard.oculus.com/application/&lt;app_id&gt;/matchmaking
  1250. ///
  1251. public static Request<Models.MatchmakingEnqueueResult> Enqueue(string pool, CustomQuery customQueryData = null)
  1252. {
  1253. if (Core.IsInitialized())
  1254. {
  1255. return new Request<Models.MatchmakingEnqueueResult>(CAPI.ovr_Matchmaking_Enqueue(pool, customQueryData != null ? customQueryData.ToUnmanaged() : IntPtr.Zero));
  1256. }
  1257. return null;
  1258. }
  1259. /// Modes: QUICKMATCH
  1260. ///
  1261. /// See overview documentation above.
  1262. ///
  1263. /// Enqueue yourself to await an available matchmaking room. The platform
  1264. /// returns a MessageType.Notification_Matchmaking_MatchFound message when a
  1265. /// match is found. Call Rooms.Join2() on the returned room. The response
  1266. /// contains useful information to display to the user to set expectations for
  1267. /// how long it will take to get a match.
  1268. ///
  1269. /// If the user stops waiting, call Matchmaking.Cancel().
  1270. /// \param pool The pool to enqueue in.
  1271. /// \param matchmakingOptions Additional matchmaking configuration for this request. Optional.
  1272. ///
  1273. /// <b>Error codes</b>
  1274. /// - \b 100: Pool {pool_key} does not contain custom data key {key}. You can configure matchmaking custom data at https://dashboard.oculus.com/application/&lt;app_id&gt;/matchmaking
  1275. /// - \b 12072: Unknown pool: {pool_key}. You can configure matchmaking pools at https://dashboard.oculus.com/application/&lt;app_id&gt;/matchmaking
  1276. ///
  1277. public static Request<Models.MatchmakingEnqueueResult> Enqueue2(string pool, MatchmakingOptions matchmakingOptions = null)
  1278. {
  1279. if (Core.IsInitialized())
  1280. {
  1281. return new Request<Models.MatchmakingEnqueueResult>(CAPI.ovr_Matchmaking_Enqueue2(pool, (IntPtr)matchmakingOptions));
  1282. }
  1283. return null;
  1284. }
  1285. /// DEPRECATED. Please use Matchmaking.EnqueueRoom2() instead.
  1286. /// \param roomID Returned either from MessageType.Notification_Matchmaking_MatchFound or from Matchmaking.CreateRoom().
  1287. /// \param customQueryData Optional. See the "Custom criteria" section above.
  1288. ///
  1289. /// <b>Error codes</b>
  1290. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is currently in another room (perhaps on another device), and thus is no longer in this room. Users can only be in one room at a time. If they are active on two different devices at once, there will be undefined behavior.
  1291. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is not in the room (or any room). Perhaps they already left, or they stopped heartbeating. If this is a test environment, make sure you are not using the deprecated initialization methods ovr_PlatformInitializeStandaloneAccessToken (C++)/StandalonePlatform.Initialize(accessToken) (C#).
  1292. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is not the owner of the room.
  1293. /// - \b 100: Invalid room_id: {room_id}. Either the ID is not a valid room or the user does not have permission to see or act on the room.
  1294. /// - \b 12051: Pool '{pool_key}' is configured for Quickmatch mode. In Quickmatch mode, rooms are created on users' behalf when a match is found. Specify Advanced Quickmatch or Browse mode to use this feature.
  1295. ///
  1296. public static Request<Models.MatchmakingEnqueueResult> EnqueueRoom(UInt64 roomID, CustomQuery customQueryData = null)
  1297. {
  1298. if (Core.IsInitialized())
  1299. {
  1300. return new Request<Models.MatchmakingEnqueueResult>(CAPI.ovr_Matchmaking_EnqueueRoom(roomID, customQueryData != null ? customQueryData.ToUnmanaged() : IntPtr.Zero));
  1301. }
  1302. return null;
  1303. }
  1304. /// Modes: BROWSE (for Rooms only), ROOM
  1305. ///
  1306. /// See the overview documentation above. Enqueue yourself to await an
  1307. /// available matchmaking room. MessageType.Notification_Matchmaking_MatchFound
  1308. /// gets enqueued when a match is found.
  1309. ///
  1310. /// The response contains useful information to display to the user to set
  1311. /// expectations for how long it will take to get a match.
  1312. ///
  1313. /// If the user stops waiting, call Matchmaking.Cancel().
  1314. /// \param roomID Returned either from MessageType.Notification_Matchmaking_MatchFound or from Matchmaking.CreateRoom().
  1315. /// \param matchmakingOptions Additional matchmaking configuration for this request. Optional.
  1316. ///
  1317. /// <b>Error codes</b>
  1318. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is currently in another room (perhaps on another device), and thus is no longer in this room. Users can only be in one room at a time. If they are active on two different devices at once, there will be undefined behavior.
  1319. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is not in the room (or any room). Perhaps they already left, or they stopped heartbeating. If this is a test environment, make sure you are not using the deprecated initialization methods ovr_PlatformInitializeStandaloneAccessToken (C++)/StandalonePlatform.Initialize(accessToken) (C#).
  1320. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is not the owner of the room.
  1321. /// - \b 100: Invalid room_id: {room_id}. Either the ID is not a valid room or the user does not have permission to see or act on the room.
  1322. /// - \b 12051: Pool '{pool_key}' is configured for Quickmatch mode. In Quickmatch mode, rooms are created on users' behalf when a match is found. Specify Advanced Quickmatch or Browse mode to use this feature.
  1323. ///
  1324. public static Request<Models.MatchmakingEnqueueResult> EnqueueRoom2(UInt64 roomID, MatchmakingOptions matchmakingOptions = null)
  1325. {
  1326. if (Core.IsInitialized())
  1327. {
  1328. return new Request<Models.MatchmakingEnqueueResult>(CAPI.ovr_Matchmaking_EnqueueRoom2(roomID, (IntPtr)matchmakingOptions));
  1329. }
  1330. return null;
  1331. }
  1332. /// Modes: QUICKMATCH, BROWSE
  1333. ///
  1334. /// Used to debug the state of the current matchmaking pool queue. This is not
  1335. /// intended to be used in production.
  1336. ///
  1337. public static Request<Models.MatchmakingAdminSnapshot> GetAdminSnapshot()
  1338. {
  1339. if (Core.IsInitialized())
  1340. {
  1341. return new Request<Models.MatchmakingAdminSnapshot>(CAPI.ovr_Matchmaking_GetAdminSnapshot());
  1342. }
  1343. return null;
  1344. }
  1345. /// DEPRECATED. Use ovr_Room_Join2.
  1346. /// \param roomID ID of a room previously returned from MessageType.Notification_Matchmaking_MatchFound or Matchmaking.Browse().
  1347. /// \param subscribeToUpdates If true, sends a message with type MessageType.Notification_Room_RoomUpdate when room data changes, such as when users join or leave.
  1348. ///
  1349. public static Request<Models.Room> JoinRoom(UInt64 roomID, bool subscribeToUpdates = false)
  1350. {
  1351. if (Core.IsInitialized())
  1352. {
  1353. return new Request<Models.Room>(CAPI.ovr_Matchmaking_JoinRoom(roomID, subscribeToUpdates));
  1354. }
  1355. return null;
  1356. }
  1357. /// Modes: QUICKMATCH, BROWSE (+ Skill Pool)
  1358. ///
  1359. /// For pools with skill-based matching. See overview documentation above.
  1360. ///
  1361. /// Call after calling Rooms.Join2() when the players are present to begin a
  1362. /// rated match for which you plan to report the results (using
  1363. /// Matchmaking.ReportResultInsecure()).
  1364. ///
  1365. /// <b>Error codes</b>
  1366. /// - \b 100: There is no active match associated with the room {room_id}.
  1367. /// - \b 100: You can only start matches, report matches, and track skill ratings in matchmaking rooms. {room_id} is a room, but it is not a matchmaking room.
  1368. ///
  1369. public static Request StartMatch(UInt64 roomID)
  1370. {
  1371. if (Core.IsInitialized())
  1372. {
  1373. return new Request(CAPI.ovr_Matchmaking_StartMatch(roomID));
  1374. }
  1375. return null;
  1376. }
  1377. /// Indicates that a match has been found, for example after calling
  1378. /// Matchmaking.Enqueue(). Use Message.GetRoom() to extract the matchmaking
  1379. /// room.
  1380. ///
  1381. public static void SetMatchFoundNotificationCallback(Message<Models.Room>.Callback callback)
  1382. {
  1383. Callback.SetNotificationCallback(
  1384. Message.MessageType.Notification_Matchmaking_MatchFound,
  1385. callback
  1386. );
  1387. }
  1388. }
  1389. public static partial class Media
  1390. {
  1391. /// Launch the Share to Facebook modal via a deeplink to Home on Gear VR,
  1392. /// allowing users to share local media files to Facebook. Accepts a
  1393. /// postTextSuggestion string for the default text of the Facebook post.
  1394. /// Requires a filePath string as the path to the image to be shared to
  1395. /// Facebook. This image should be located in your app's internal storage
  1396. /// directory. Requires a contentType indicating the type of media to be shared
  1397. /// (only 'photo' is currently supported.)
  1398. /// \param postTextSuggestion this text will prepopulate the facebook status text-input box within the share modal
  1399. /// \param filePath path to the file to be shared to facebook
  1400. /// \param contentType content type of the media to be shared
  1401. ///
  1402. public static Request<Models.ShareMediaResult> ShareToFacebook(string postTextSuggestion, string filePath, MediaContentType contentType)
  1403. {
  1404. if (Core.IsInitialized())
  1405. {
  1406. return new Request<Models.ShareMediaResult>(CAPI.ovr_Media_ShareToFacebook(postTextSuggestion, filePath, contentType));
  1407. }
  1408. return null;
  1409. }
  1410. }
  1411. public static partial class NetSync
  1412. {
  1413. /// Sent when the status of a connection has changed.
  1414. ///
  1415. public static void SetConnectionStatusChangedNotificationCallback(Message<Models.NetSyncConnection>.Callback callback)
  1416. {
  1417. Callback.SetNotificationCallback(
  1418. Message.MessageType.Notification_NetSync_ConnectionStatusChanged,
  1419. callback
  1420. );
  1421. }
  1422. /// Sent when the list of known connected sessions has changed. Contains the
  1423. /// new list of sessions.
  1424. ///
  1425. public static void SetSessionsChangedNotificationCallback(Message<Models.NetSyncSessionsChangedNotification>.Callback callback)
  1426. {
  1427. Callback.SetNotificationCallback(
  1428. Message.MessageType.Notification_NetSync_SessionsChanged,
  1429. callback
  1430. );
  1431. }
  1432. }
  1433. public static partial class Net
  1434. {
  1435. /// Indicates that a connection has been established or there's been an error.
  1436. /// Use NetworkingPeer.GetState() to get the result; as above,
  1437. /// NetworkingPeer.GetID() returns the ID of the peer this message is for.
  1438. ///
  1439. public static void SetConnectionStateChangedCallback(Message<Models.NetworkingPeer>.Callback callback)
  1440. {
  1441. Callback.SetNotificationCallback(
  1442. Message.MessageType.Notification_Networking_ConnectionStateChange,
  1443. callback
  1444. );
  1445. }
  1446. /// Indicates that another user is attempting to establish a P2P connection
  1447. /// with us. Use NetworkingPeer.GetID() to extract the ID of the peer.
  1448. ///
  1449. public static void SetPeerConnectRequestCallback(Message<Models.NetworkingPeer>.Callback callback)
  1450. {
  1451. Callback.SetNotificationCallback(
  1452. Message.MessageType.Notification_Networking_PeerConnectRequest,
  1453. callback
  1454. );
  1455. }
  1456. /// Generated in response to Net.Ping(). Either contains ping time in
  1457. /// microseconds or indicates that there was a timeout.
  1458. ///
  1459. public static void SetPingResultNotificationCallback(Message<Models.PingResult>.Callback callback)
  1460. {
  1461. Callback.SetNotificationCallback(
  1462. Message.MessageType.Notification_Networking_PingResult,
  1463. callback
  1464. );
  1465. }
  1466. }
  1467. public static partial class Notifications
  1468. {
  1469. /// Retrieve a list of all pending room invites for your application (for
  1470. /// example, notifications that may have been sent before the user launched
  1471. /// your game). You can also get push notifications with
  1472. /// MessageType.Notification_Room_InviteReceived.
  1473. ///
  1474. public static Request<Models.RoomInviteNotificationList> GetRoomInviteNotifications()
  1475. {
  1476. if (Core.IsInitialized())
  1477. {
  1478. return new Request<Models.RoomInviteNotificationList>(CAPI.ovr_Notification_GetRoomInvites());
  1479. }
  1480. return null;
  1481. }
  1482. /// Mark a notification as read. This causes it to disappear from the Universal
  1483. /// Menu, the Oculus App, Oculus Home, and in-app retrieval.
  1484. ///
  1485. public static Request MarkAsRead(UInt64 notificationID)
  1486. {
  1487. if (Core.IsInitialized())
  1488. {
  1489. return new Request(CAPI.ovr_Notification_MarkAsRead(notificationID));
  1490. }
  1491. return null;
  1492. }
  1493. }
  1494. public static partial class Parties
  1495. {
  1496. /// Load the party the current user is in.
  1497. ///
  1498. public static Request<Models.Party> GetCurrent()
  1499. {
  1500. if (Core.IsInitialized())
  1501. {
  1502. return new Request<Models.Party>(CAPI.ovr_Party_GetCurrent());
  1503. }
  1504. return null;
  1505. }
  1506. /// Indicates that party has been updated
  1507. ///
  1508. public static void SetPartyUpdateNotificationCallback(Message<Models.PartyUpdateNotification>.Callback callback)
  1509. {
  1510. Callback.SetNotificationCallback(
  1511. Message.MessageType.Notification_Party_PartyUpdate,
  1512. callback
  1513. );
  1514. }
  1515. }
  1516. public static partial class RichPresence
  1517. {
  1518. /// Clear rich presence for running app
  1519. ///
  1520. public static Request Clear()
  1521. {
  1522. if (Core.IsInitialized())
  1523. {
  1524. return new Request(CAPI.ovr_RichPresence_Clear());
  1525. }
  1526. return null;
  1527. }
  1528. /// Gets all the destinations that the presence can be set to
  1529. ///
  1530. public static Request<Models.DestinationList> GetDestinations()
  1531. {
  1532. if (Core.IsInitialized())
  1533. {
  1534. return new Request<Models.DestinationList>(CAPI.ovr_RichPresence_GetDestinations());
  1535. }
  1536. return null;
  1537. }
  1538. /// Set rich presence for running app
  1539. ///
  1540. public static Request Set(RichPresenceOptions richPresenceOptions)
  1541. {
  1542. if (Core.IsInitialized())
  1543. {
  1544. return new Request(CAPI.ovr_RichPresence_Set((IntPtr)richPresenceOptions));
  1545. }
  1546. return null;
  1547. }
  1548. }
  1549. public static partial class Rooms
  1550. {
  1551. /// DEPRECATED. Use CreateAndJoinPrivate2.
  1552. /// \param joinPolicy Specifies who can join the room without an invite.
  1553. /// \param maxUsers The maximum number of users allowed in the room, including the creator.
  1554. /// \param subscribeToUpdates If true, sends a message with type MessageType.Notification_Room_RoomUpdate when room data changes, such as when users join or leave.
  1555. ///
  1556. public static Request<Models.Room> CreateAndJoinPrivate(RoomJoinPolicy joinPolicy, uint maxUsers, bool subscribeToUpdates = false)
  1557. {
  1558. if (Core.IsInitialized())
  1559. {
  1560. return new Request<Models.Room>(CAPI.ovr_Room_CreateAndJoinPrivate(joinPolicy, maxUsers, subscribeToUpdates));
  1561. }
  1562. return null;
  1563. }
  1564. /// Creates a new private (client controlled) room and adds the caller to it.
  1565. /// This type of room is good for matches where the user wants to play with
  1566. /// friends, as they're primarially discoverable by examining which rooms your
  1567. /// friends are in.
  1568. /// \param joinPolicy Specifies who can join the room without an invite.
  1569. /// \param maxUsers The maximum number of users allowed in the room, including the creator.
  1570. /// \param roomOptions Additional room configuration for this request. Optional.
  1571. ///
  1572. public static Request<Models.Room> CreateAndJoinPrivate2(RoomJoinPolicy joinPolicy, uint maxUsers, RoomOptions roomOptions)
  1573. {
  1574. if (Core.IsInitialized())
  1575. {
  1576. return new Request<Models.Room>(CAPI.ovr_Room_CreateAndJoinPrivate2(joinPolicy, maxUsers, (IntPtr)roomOptions));
  1577. }
  1578. return null;
  1579. }
  1580. /// Allows arbitrary rooms for the application to be loaded.
  1581. /// \param roomID The room to load.
  1582. ///
  1583. public static Request<Models.Room> Get(UInt64 roomID)
  1584. {
  1585. if (Core.IsInitialized())
  1586. {
  1587. return new Request<Models.Room>(CAPI.ovr_Room_Get(roomID));
  1588. }
  1589. return null;
  1590. }
  1591. /// Easy loading of the room you're currently in. If you don't want live
  1592. /// updates on your current room (by using subscribeToUpdates), you can use
  1593. /// this to refresh the data.
  1594. ///
  1595. public static Request<Models.Room> GetCurrent()
  1596. {
  1597. if (Core.IsInitialized())
  1598. {
  1599. return new Request<Models.Room>(CAPI.ovr_Room_GetCurrent());
  1600. }
  1601. return null;
  1602. }
  1603. /// Allows the current room for a given user to be loaded. Remember that the
  1604. /// user's privacy settings may not allow their room to be loaded. Because of
  1605. /// this, it's often possible to load the users in a room, but not to take
  1606. /// those users and load their room.
  1607. /// \param userID ID of the user for which to load the room.
  1608. ///
  1609. public static Request<Models.Room> GetCurrentForUser(UInt64 userID)
  1610. {
  1611. if (Core.IsInitialized())
  1612. {
  1613. return new Request<Models.Room>(CAPI.ovr_Room_GetCurrentForUser(userID));
  1614. }
  1615. return null;
  1616. }
  1617. /// DEPRECATED. Use GetInvitableUsers2.
  1618. ///
  1619. public static Request<Models.UserList> GetInvitableUsers()
  1620. {
  1621. if (Core.IsInitialized())
  1622. {
  1623. return new Request<Models.UserList>(CAPI.ovr_Room_GetInvitableUsers());
  1624. }
  1625. return null;
  1626. }
  1627. /// Loads a list of users you can invite to a room. These are pulled from your
  1628. /// friends list and recently met lists and filtered for relevance and
  1629. /// interest. If the room cannot be joined, this list will be empty. By
  1630. /// default, the invitable users returned will be for the user's current room.
  1631. ///
  1632. /// If your application grouping was created after September 9 2017, recently
  1633. /// met users will be included by default. If your application grouping was
  1634. /// created before then, you can go to edit the setting in the "Rooms and
  1635. /// Matchmaking" section of Platform Services at dashboard.oculus.com
  1636. ///
  1637. /// Customization can be done via RoomOptions. Create this object with
  1638. /// RoomOptions(). The params that could be used are:
  1639. ///
  1640. /// 1. RoomOptions.SetRoomId()- will return the invitable users for this room
  1641. /// (instead of the current room).
  1642. ///
  1643. /// 2. RoomOptions.SetOrdering() - returns the list of users in the provided
  1644. /// ordering (see UserOrdering enum).
  1645. ///
  1646. /// 3. RoomOptions.SetRecentlyMetTimeWindow() - how long long ago should we
  1647. /// include users you've recently met in the results?
  1648. ///
  1649. /// 4. RoomOptions.SetMaxUserResults() - we will limit the number of results
  1650. /// returned. By default, the number is unlimited, but the server may choose to
  1651. /// limit results for performance reasons.
  1652. ///
  1653. /// 5. RoomOptions.SetExcludeRecentlyMet() - Don't include users recently in
  1654. /// rooms with this user in the result. Also, see the above comment.
  1655. ///
  1656. /// Example custom C++ usage:
  1657. ///
  1658. /// auto roomOptions = ovr_RoomOptions_Create();
  1659. /// ovr_RoomOptions_SetOrdering(roomOptions, ovrUserOrdering_PresenceAlphabetical);
  1660. /// ovr_RoomOptions_SetRoomId(roomOptions, roomID);
  1661. /// ovr_Room_GetInvitableUsers2(roomOptions);
  1662. /// ovr_RoomOptions_Destroy(roomOptions);
  1663. /// \param roomOptions Additional configuration for this request. Optional.
  1664. ///
  1665. public static Request<Models.UserList> GetInvitableUsers2(RoomOptions roomOptions = null)
  1666. {
  1667. if (Core.IsInitialized())
  1668. {
  1669. return new Request<Models.UserList>(CAPI.ovr_Room_GetInvitableUsers2((IntPtr)roomOptions));
  1670. }
  1671. return null;
  1672. }
  1673. /// Fetches the list of moderated rooms created for the application.
  1674. ///
  1675. public static Request<Models.RoomList> GetModeratedRooms()
  1676. {
  1677. if (Core.IsInitialized())
  1678. {
  1679. return new Request<Models.RoomList>(CAPI.ovr_Room_GetModeratedRooms());
  1680. }
  1681. return null;
  1682. }
  1683. /// Invites a user to the specified room. They will receive a notification via
  1684. /// MessageType.Notification_Room_InviteReceived if they are in your game,
  1685. /// and/or they can poll for room invites using
  1686. /// Notifications.GetRoomInviteNotifications().
  1687. /// \param roomID The ID of your current room.
  1688. /// \param inviteToken A user's invite token, returned by Rooms.GetInvitableUsers().
  1689. ///
  1690. /// <b>Error codes</b>
  1691. /// - \b 100: The invite token has expired, the user will need to be reinvited to the room.
  1692. /// - \b 100: The target user cannot join you in your current experience
  1693. /// - \b 100: You cannot send an invite to a room you are not in
  1694. ///
  1695. public static Request<Models.Room> InviteUser(UInt64 roomID, string inviteToken)
  1696. {
  1697. if (Core.IsInitialized())
  1698. {
  1699. return new Request<Models.Room>(CAPI.ovr_Room_InviteUser(roomID, inviteToken));
  1700. }
  1701. return null;
  1702. }
  1703. /// Joins the target room (leaving the one you're currently in).
  1704. /// \param roomID The room to join.
  1705. /// \param subscribeToUpdates If true, sends a message with type MessageType.Notification_Room_RoomUpdate when room data changes, such as when users join or leave.
  1706. ///
  1707. /// <b>Error codes</b>
  1708. /// - \b 10: The room you're attempting to join is currently locked. Please try again later.
  1709. /// - \b 10: You don't have permission to enter this room. You may need to be invited first.
  1710. /// - \b 100: Invalid room_id: {room_id}. Either the ID is not a valid room or the user does not have permission to see or act on the room.
  1711. /// - \b 100: The room you're attempting to join is full. Please try again later.
  1712. /// - \b 100: This game isn't available. If it already started or was canceled, you can host a new game at any point.
  1713. ///
  1714. public static Request<Models.Room> Join(UInt64 roomID, bool subscribeToUpdates = false)
  1715. {
  1716. if (Core.IsInitialized())
  1717. {
  1718. return new Request<Models.Room>(CAPI.ovr_Room_Join(roomID, subscribeToUpdates));
  1719. }
  1720. return null;
  1721. }
  1722. /// Joins the target room (leaving the one you're currently in).
  1723. /// \param roomID The room to join.
  1724. /// \param roomOptions Additional room configuration for this request. Optional.
  1725. ///
  1726. /// <b>Error codes</b>
  1727. /// - \b 10: The room you're attempting to join is currently locked. Please try again later.
  1728. /// - \b 10: You don't have permission to enter this room. You may need to be invited first.
  1729. /// - \b 100: Invalid room_id: {room_id}. Either the ID is not a valid room or the user does not have permission to see or act on the room.
  1730. /// - \b 100: The room you're attempting to join is full. Please try again later.
  1731. /// - \b 100: This game isn't available. If it already started or was canceled, you can host a new game at any point.
  1732. ///
  1733. public static Request<Models.Room> Join2(UInt64 roomID, RoomOptions roomOptions)
  1734. {
  1735. if (Core.IsInitialized())
  1736. {
  1737. return new Request<Models.Room>(CAPI.ovr_Room_Join2(roomID, (IntPtr)roomOptions));
  1738. }
  1739. return null;
  1740. }
  1741. /// Allows the room owner to kick a user out of the current room.
  1742. /// \param roomID The room that you currently own (check Room.GetOwner()).
  1743. /// \param userID The user to be kicked (cannot be yourself).
  1744. /// \param kickDurationSeconds Length of the ban, in seconds.
  1745. ///
  1746. /// <b>Error codes</b>
  1747. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is not in the room (or any room). Perhaps they already left, or they stopped heartbeating. If this is a test environment, make sure you are not using the deprecated initialization methods ovr_PlatformInitializeStandaloneAccessToken (C++)/StandalonePlatform.Initialize(accessToken) (C#).
  1748. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is not the owner of the room.
  1749. /// - \b 100: You cannot remove yourself from room {room_id}
  1750. ///
  1751. public static Request<Models.Room> KickUser(UInt64 roomID, UInt64 userID, int kickDurationSeconds)
  1752. {
  1753. if (Core.IsInitialized())
  1754. {
  1755. return new Request<Models.Room>(CAPI.ovr_Room_KickUser(roomID, userID, kickDurationSeconds));
  1756. }
  1757. return null;
  1758. }
  1759. /// Launch the invitable user flow to invite to the logged in user's current
  1760. /// room. This is intended to be a nice shortcut for developers not wanting to
  1761. /// build out their own Invite UI although it has the same rules as if you
  1762. /// build it yourself.
  1763. ///
  1764. public static Request LaunchInvitableUserFlow(UInt64 roomID)
  1765. {
  1766. if (Core.IsInitialized())
  1767. {
  1768. return new Request(CAPI.ovr_Room_LaunchInvitableUserFlow(roomID));
  1769. }
  1770. return null;
  1771. }
  1772. /// Removes you from your current room. Returns the solo room you are now in if
  1773. /// it succeeds
  1774. /// \param roomID The room you're currently in.
  1775. ///
  1776. public static Request<Models.Room> Leave(UInt64 roomID)
  1777. {
  1778. if (Core.IsInitialized())
  1779. {
  1780. return new Request<Models.Room>(CAPI.ovr_Room_Leave(roomID));
  1781. }
  1782. return null;
  1783. }
  1784. /// Allows the room owner to set the description of their room.
  1785. /// \param roomID The room that you currently own (check Room.GetOwner()).
  1786. /// \param description The new name of the room.
  1787. ///
  1788. /// <b>Error codes</b>
  1789. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is currently in another room (perhaps on another device), and thus is no longer in this room. Users can only be in one room at a time. If they are active on two different devices at once, there will be undefined behavior.
  1790. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is not in the room (or any room). Perhaps they already left, or they stopped heartbeating. If this is a test environment, make sure you are not using the deprecated initialization methods ovr_PlatformInitializeStandaloneAccessToken (C++)/StandalonePlatform.Initialize(accessToken) (C#).
  1791. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is not the owner of the room.
  1792. ///
  1793. public static Request<Models.Room> SetDescription(UInt64 roomID, string description)
  1794. {
  1795. if (Core.IsInitialized())
  1796. {
  1797. return new Request<Models.Room>(CAPI.ovr_Room_SetDescription(roomID, description));
  1798. }
  1799. return null;
  1800. }
  1801. /// Disallow new members from being able to join the room. This will prevent
  1802. /// joins from Rooms.Join(), invites, 'Join From Home', etc. Users that are in
  1803. /// the room at the time of lockdown WILL be able to rejoin.
  1804. /// \param roomID The room whose membership you want to lock or unlock.
  1805. /// \param membershipLockStatus The new LockStatus for the room
  1806. ///
  1807. /// <b>Error codes</b>
  1808. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is currently in another room (perhaps on another device), and thus is no longer in this room. Users can only be in one room at a time. If they are active on two different devices at once, there will be undefined behavior.
  1809. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is not in the room (or any room). Perhaps they already left, or they stopped heartbeating. If this is a test environment, make sure you are not using the deprecated initialization methods ovr_PlatformInitializeStandaloneAccessToken (C++)/StandalonePlatform.Initialize(accessToken) (C#).
  1810. /// - \b 10: Room {room_id}: The user does not have permission to {cannot_action} because the user is not the owner of the room.
  1811. ///
  1812. public static Request<Models.Room> UpdateMembershipLockStatus(UInt64 roomID, RoomMembershipLockStatus membershipLockStatus)
  1813. {
  1814. if (Core.IsInitialized())
  1815. {
  1816. return new Request<Models.Room>(CAPI.ovr_Room_UpdateMembershipLockStatus(roomID, membershipLockStatus));
  1817. }
  1818. return null;
  1819. }
  1820. /// Allows the room owner to transfer ownership to someone else.
  1821. /// \param roomID The room that the user owns (check Room.GetOwner()).
  1822. /// \param userID The new user to make an owner; the user must be in the room.
  1823. ///
  1824. public static Request UpdateOwner(UInt64 roomID, UInt64 userID)
  1825. {
  1826. if (Core.IsInitialized())
  1827. {
  1828. return new Request(CAPI.ovr_Room_UpdateOwner(roomID, userID));
  1829. }
  1830. return null;
  1831. }
  1832. /// Sets the join policy of the user's private room.
  1833. /// \param roomID The room ID that the user owns (check Room.GetOwner()).
  1834. /// \param newJoinPolicy The new join policy for the room.
  1835. ///
  1836. public static Request<Models.Room> UpdatePrivateRoomJoinPolicy(UInt64 roomID, RoomJoinPolicy newJoinPolicy)
  1837. {
  1838. if (Core.IsInitialized())
  1839. {
  1840. return new Request<Models.Room>(CAPI.ovr_Room_UpdatePrivateRoomJoinPolicy(roomID, newJoinPolicy));
  1841. }
  1842. return null;
  1843. }
  1844. /// Indicates that the user has accepted an invitation, for example in Oculus
  1845. /// Home. Use Message.GetString() to extract the ID of the room that the user
  1846. /// has been inivted to as a string. Then call ovrID_FromString() to parse it
  1847. /// into an ovrID.
  1848. ///
  1849. /// Note that you must call Rooms.Join() if you want to actually join the room.
  1850. ///
  1851. public static void SetRoomInviteAcceptedNotificationCallback(Message<string>.Callback callback)
  1852. {
  1853. Callback.SetNotificationCallback(
  1854. Message.MessageType.Notification_Room_InviteAccepted,
  1855. callback
  1856. );
  1857. }
  1858. /// Handle this to notify the user when they've received an invitation to join
  1859. /// a room in your game. You can use this in lieu of, or in addition to,
  1860. /// polling for room invitations via
  1861. /// Notifications.GetRoomInviteNotifications().
  1862. ///
  1863. public static void SetRoomInviteReceivedNotificationCallback(Message<Models.RoomInviteNotification>.Callback callback)
  1864. {
  1865. Callback.SetNotificationCallback(
  1866. Message.MessageType.Notification_Room_InviteReceived,
  1867. callback
  1868. );
  1869. }
  1870. /// Indicates that the current room has been updated. Use Message.GetRoom() to
  1871. /// extract the updated room.
  1872. ///
  1873. public static void SetUpdateNotificationCallback(Message<Models.Room>.Callback callback)
  1874. {
  1875. Callback.SetNotificationCallback(
  1876. Message.MessageType.Notification_Room_RoomUpdate,
  1877. callback
  1878. );
  1879. }
  1880. }
  1881. public static partial class Users
  1882. {
  1883. /// Retrieve the user with the given ID. This might fail if the ID is invalid
  1884. /// or the user is blocked.
  1885. ///
  1886. /// NOTE: Users will have a unique ID per application.
  1887. /// \param userID User ID retrieved with this application.
  1888. ///
  1889. public static Request<Models.User> Get(UInt64 userID)
  1890. {
  1891. if (Core.IsInitialized())
  1892. {
  1893. return new Request<Models.User>(CAPI.ovr_User_Get(userID));
  1894. }
  1895. return null;
  1896. }
  1897. /// Return an access token for this user, suitable for making REST calls
  1898. /// against graph.oculus.com.
  1899. ///
  1900. public static Request<string> GetAccessToken()
  1901. {
  1902. if (Core.IsInitialized())
  1903. {
  1904. return new Request<string>(CAPI.ovr_User_GetAccessToken());
  1905. }
  1906. return null;
  1907. }
  1908. /// Retrieve the currently signed in user. This call is available offline.
  1909. ///
  1910. /// NOTE: This will not return the user's presence as it should always be
  1911. /// 'online' in your application.
  1912. ///
  1913. /// NOTE: Users will have a unique ID per application.
  1914. ///
  1915. public static Request<Models.User> GetLoggedInUser()
  1916. {
  1917. if (Core.IsInitialized())
  1918. {
  1919. return new Request<Models.User>(CAPI.ovr_User_GetLoggedInUser());
  1920. }
  1921. return null;
  1922. }
  1923. /// Retrieve a list of the logged in user's friends.
  1924. ///
  1925. public static Request<Models.UserList> GetLoggedInUserFriends()
  1926. {
  1927. if (Core.IsInitialized())
  1928. {
  1929. return new Request<Models.UserList>(CAPI.ovr_User_GetLoggedInUserFriends());
  1930. }
  1931. return null;
  1932. }
  1933. /// Retrieve a list of the logged in user's friends and any rooms they might be
  1934. /// in.
  1935. ///
  1936. public static Request<Models.UserAndRoomList> GetLoggedInUserFriendsAndRooms()
  1937. {
  1938. if (Core.IsInitialized())
  1939. {
  1940. return new Request<Models.UserAndRoomList>(CAPI.ovr_User_GetLoggedInUserFriendsAndRooms());
  1941. }
  1942. return null;
  1943. }
  1944. /// Returns a list of users that the logged in user was in a room with
  1945. /// recently, sorted by relevance, along with any rooms they might be in. All
  1946. /// you need to do to use this method is to use our Rooms API, and we will
  1947. /// track the number of times users are together, their most recent encounter,
  1948. /// and the amount of time they spend together.
  1949. ///
  1950. /// Customization can be done via UserOptions. Create this object with
  1951. /// UserOptions(). The params that could be used are:
  1952. ///
  1953. /// 1. UserOptions.SetTimeWindow() - how recently should the users have played?
  1954. /// The default is TimeWindow.ThirtyDays.
  1955. ///
  1956. /// 2. UserOptions.SetMaxUsers() - we will limit the number of results
  1957. /// returned. By default, the number is unlimited, but the server may choose to
  1958. /// limit results for performance reasons.
  1959. /// \param userOptions Additional configuration for this request. Optional.
  1960. ///
  1961. public static Request<Models.UserAndRoomList> GetLoggedInUserRecentlyMetUsersAndRooms(UserOptions userOptions = null)
  1962. {
  1963. if (Core.IsInitialized())
  1964. {
  1965. return new Request<Models.UserAndRoomList>(CAPI.ovr_User_GetLoggedInUserRecentlyMetUsersAndRooms((IntPtr)userOptions));
  1966. }
  1967. return null;
  1968. }
  1969. /// returns an ovrID which is unique per org. allows different apps within the
  1970. /// same org to identify the user.
  1971. /// \param userID to load the org scoped id of
  1972. ///
  1973. public static Request<Models.OrgScopedID> GetOrgScopedID(UInt64 userID)
  1974. {
  1975. if (Core.IsInitialized())
  1976. {
  1977. return new Request<Models.OrgScopedID>(CAPI.ovr_User_GetOrgScopedID(userID));
  1978. }
  1979. return null;
  1980. }
  1981. /// Returns all accounts belonging to this user. Accounts are the Oculus user
  1982. /// and x-users that are linked to this user.
  1983. ///
  1984. public static Request<Models.SdkAccountList> GetSdkAccounts()
  1985. {
  1986. if (Core.IsInitialized())
  1987. {
  1988. return new Request<Models.SdkAccountList>(CAPI.ovr_User_GetSdkAccounts());
  1989. }
  1990. return null;
  1991. }
  1992. /// Part of the scheme to confirm the identity of a particular user in your
  1993. /// backend. You can pass the result of Users.GetUserProof() and a user ID from
  1994. /// Users.Get() to your your backend. Your server can then use our api to
  1995. /// verify identity. 'https://graph.oculus.com/user_nonce_validate?nonce=USER_P
  1996. /// ROOF&user_id=USER_ID&access_token=ACCESS_TOKEN'
  1997. ///
  1998. /// NOTE: The nonce is only good for one check and then it is invalidated.
  1999. ///
  2000. public static Request<Models.UserProof> GetUserProof()
  2001. {
  2002. if (Core.IsInitialized())
  2003. {
  2004. return new Request<Models.UserProof>(CAPI.ovr_User_GetUserProof());
  2005. }
  2006. return null;
  2007. }
  2008. /// Launch the flow for sending a friend request to a user.
  2009. /// \param userID User ID of user to send a friend request to
  2010. ///
  2011. public static Request<Models.LaunchFriendRequestFlowResult> LaunchFriendRequestFlow(UInt64 userID)
  2012. {
  2013. if (Core.IsInitialized())
  2014. {
  2015. return new Request<Models.LaunchFriendRequestFlowResult>(CAPI.ovr_User_LaunchFriendRequestFlow(userID));
  2016. }
  2017. return null;
  2018. }
  2019. /// Launch the profile of the given user. The profile surfaces information
  2020. /// about the user and supports relevant actions that the viewer may take on
  2021. /// that user, e.g. sending a friend request.
  2022. /// \param userID User ID for profile being viewed
  2023. ///
  2024. public static Request LaunchProfile(UInt64 userID)
  2025. {
  2026. if (Core.IsInitialized())
  2027. {
  2028. return new Request(CAPI.ovr_User_LaunchProfile(userID));
  2029. }
  2030. return null;
  2031. }
  2032. }
  2033. public static partial class Voip
  2034. {
  2035. /// Sets whether SystemVoip should be suppressed so that this app's Voip can
  2036. /// use the mic and play incoming Voip audio.
  2037. ///
  2038. public static Request<Models.SystemVoipState> SetSystemVoipSuppressed(bool suppressed)
  2039. {
  2040. if (Core.IsInitialized())
  2041. {
  2042. return new Request<Models.SystemVoipState>(CAPI.ovr_Voip_SetSystemVoipSuppressed(suppressed));
  2043. }
  2044. return null;
  2045. }
  2046. /// Sent when another user is attempting to establish a VoIP connection. Use
  2047. /// Message.GetNetworkingPeer() to extract information about the user, and
  2048. /// Voip.Accept() to accept the connection.
  2049. ///
  2050. public static void SetVoipConnectRequestCallback(Message<Models.NetworkingPeer>.Callback callback)
  2051. {
  2052. Callback.SetNotificationCallback(
  2053. Message.MessageType.Notification_Voip_ConnectRequest,
  2054. callback
  2055. );
  2056. }
  2057. /// Sent to indicate that the state of the VoIP connection changed. Use
  2058. /// Message.GetNetworkingPeer() and NetworkingPeer.GetState() to extract the
  2059. /// current state.
  2060. ///
  2061. public static void SetVoipStateChangeCallback(Message<Models.NetworkingPeer>.Callback callback)
  2062. {
  2063. Callback.SetNotificationCallback(
  2064. Message.MessageType.Notification_Voip_StateChange,
  2065. callback
  2066. );
  2067. }
  2068. /// Sent to indicate that some part of the overall state of SystemVoip has
  2069. /// changed. Use Message.GetSystemVoipState() and the properties of
  2070. /// SystemVoipState to extract the state that triggered the notification.
  2071. ///
  2072. /// Note that the state may have changed further since the notification was
  2073. /// generated, and that you may call the `GetSystemVoip...()` family of
  2074. /// functions at any time to get the current state directly.
  2075. ///
  2076. public static void SetSystemVoipStateNotificationCallback(Message<Models.SystemVoipState>.Callback callback)
  2077. {
  2078. Callback.SetNotificationCallback(
  2079. Message.MessageType.Notification_Voip_SystemVoipState,
  2080. callback
  2081. );
  2082. }
  2083. }
  2084. public static partial class Achievements {
  2085. public static Request<Models.AchievementDefinitionList> GetNextAchievementDefinitionListPage(Models.AchievementDefinitionList list) {
  2086. if (!list.HasNextPage)
  2087. {
  2088. Debug.LogWarning("Oculus.Platform.GetNextAchievementDefinitionListPage: List has no next page");
  2089. return null;
  2090. }
  2091. if (Core.IsInitialized())
  2092. {
  2093. return new Request<Models.AchievementDefinitionList>(
  2094. CAPI.ovr_HTTP_GetWithMessageType(
  2095. list.NextUrl,
  2096. (int)Message.MessageType.Achievements_GetNextAchievementDefinitionArrayPage
  2097. )
  2098. );
  2099. }
  2100. return null;
  2101. }
  2102. public static Request<Models.AchievementProgressList> GetNextAchievementProgressListPage(Models.AchievementProgressList list) {
  2103. if (!list.HasNextPage)
  2104. {
  2105. Debug.LogWarning("Oculus.Platform.GetNextAchievementProgressListPage: List has no next page");
  2106. return null;
  2107. }
  2108. if (Core.IsInitialized())
  2109. {
  2110. return new Request<Models.AchievementProgressList>(
  2111. CAPI.ovr_HTTP_GetWithMessageType(
  2112. list.NextUrl,
  2113. (int)Message.MessageType.Achievements_GetNextAchievementProgressArrayPage
  2114. )
  2115. );
  2116. }
  2117. return null;
  2118. }
  2119. }
  2120. public static partial class CloudStorage {
  2121. public static Request<Models.CloudStorageMetadataList> GetNextCloudStorageMetadataListPage(Models.CloudStorageMetadataList list) {
  2122. if (!list.HasNextPage)
  2123. {
  2124. Debug.LogWarning("Oculus.Platform.GetNextCloudStorageMetadataListPage: List has no next page");
  2125. return null;
  2126. }
  2127. if (Core.IsInitialized())
  2128. {
  2129. return new Request<Models.CloudStorageMetadataList>(
  2130. CAPI.ovr_HTTP_GetWithMessageType(
  2131. list.NextUrl,
  2132. (int)Message.MessageType.CloudStorage_GetNextCloudStorageMetadataArrayPage
  2133. )
  2134. );
  2135. }
  2136. return null;
  2137. }
  2138. }
  2139. public static partial class IAP {
  2140. public static Request<Models.ProductList> GetNextProductListPage(Models.ProductList list) {
  2141. if (!list.HasNextPage)
  2142. {
  2143. Debug.LogWarning("Oculus.Platform.GetNextProductListPage: List has no next page");
  2144. return null;
  2145. }
  2146. if (Core.IsInitialized())
  2147. {
  2148. return new Request<Models.ProductList>(
  2149. CAPI.ovr_HTTP_GetWithMessageType(
  2150. list.NextUrl,
  2151. (int)Message.MessageType.IAP_GetNextProductArrayPage
  2152. )
  2153. );
  2154. }
  2155. return null;
  2156. }
  2157. public static Request<Models.PurchaseList> GetNextPurchaseListPage(Models.PurchaseList list) {
  2158. if (!list.HasNextPage)
  2159. {
  2160. Debug.LogWarning("Oculus.Platform.GetNextPurchaseListPage: List has no next page");
  2161. return null;
  2162. }
  2163. if (Core.IsInitialized())
  2164. {
  2165. return new Request<Models.PurchaseList>(
  2166. CAPI.ovr_HTTP_GetWithMessageType(
  2167. list.NextUrl,
  2168. (int)Message.MessageType.IAP_GetNextPurchaseArrayPage
  2169. )
  2170. );
  2171. }
  2172. return null;
  2173. }
  2174. }
  2175. public static partial class Notifications {
  2176. public static Request<Models.RoomInviteNotificationList> GetNextRoomInviteNotificationListPage(Models.RoomInviteNotificationList list) {
  2177. if (!list.HasNextPage)
  2178. {
  2179. Debug.LogWarning("Oculus.Platform.GetNextRoomInviteNotificationListPage: List has no next page");
  2180. return null;
  2181. }
  2182. if (Core.IsInitialized())
  2183. {
  2184. return new Request<Models.RoomInviteNotificationList>(
  2185. CAPI.ovr_HTTP_GetWithMessageType(
  2186. list.NextUrl,
  2187. (int)Message.MessageType.Notification_GetNextRoomInviteNotificationArrayPage
  2188. )
  2189. );
  2190. }
  2191. return null;
  2192. }
  2193. }
  2194. public static partial class RichPresence {
  2195. public static Request<Models.DestinationList> GetNextDestinationListPage(Models.DestinationList list) {
  2196. if (!list.HasNextPage)
  2197. {
  2198. Debug.LogWarning("Oculus.Platform.GetNextDestinationListPage: List has no next page");
  2199. return null;
  2200. }
  2201. if (Core.IsInitialized())
  2202. {
  2203. return new Request<Models.DestinationList>(
  2204. CAPI.ovr_HTTP_GetWithMessageType(
  2205. list.NextUrl,
  2206. (int)Message.MessageType.RichPresence_GetNextDestinationArrayPage
  2207. )
  2208. );
  2209. }
  2210. return null;
  2211. }
  2212. }
  2213. public static partial class Rooms {
  2214. public static Request<Models.RoomList> GetNextRoomListPage(Models.RoomList list) {
  2215. if (!list.HasNextPage)
  2216. {
  2217. Debug.LogWarning("Oculus.Platform.GetNextRoomListPage: List has no next page");
  2218. return null;
  2219. }
  2220. if (Core.IsInitialized())
  2221. {
  2222. return new Request<Models.RoomList>(
  2223. CAPI.ovr_HTTP_GetWithMessageType(
  2224. list.NextUrl,
  2225. (int)Message.MessageType.Room_GetNextRoomArrayPage
  2226. )
  2227. );
  2228. }
  2229. return null;
  2230. }
  2231. }
  2232. public static partial class Users {
  2233. public static Request<Models.UserAndRoomList> GetNextUserAndRoomListPage(Models.UserAndRoomList list) {
  2234. if (!list.HasNextPage)
  2235. {
  2236. Debug.LogWarning("Oculus.Platform.GetNextUserAndRoomListPage: List has no next page");
  2237. return null;
  2238. }
  2239. if (Core.IsInitialized())
  2240. {
  2241. return new Request<Models.UserAndRoomList>(
  2242. CAPI.ovr_HTTP_GetWithMessageType(
  2243. list.NextUrl,
  2244. (int)Message.MessageType.User_GetNextUserAndRoomArrayPage
  2245. )
  2246. );
  2247. }
  2248. return null;
  2249. }
  2250. public static Request<Models.UserList> GetNextUserListPage(Models.UserList list) {
  2251. if (!list.HasNextPage)
  2252. {
  2253. Debug.LogWarning("Oculus.Platform.GetNextUserListPage: List has no next page");
  2254. return null;
  2255. }
  2256. if (Core.IsInitialized())
  2257. {
  2258. return new Request<Models.UserList>(
  2259. CAPI.ovr_HTTP_GetWithMessageType(
  2260. list.NextUrl,
  2261. (int)Message.MessageType.User_GetNextUserArrayPage
  2262. )
  2263. );
  2264. }
  2265. return null;
  2266. }
  2267. }
  2268. }