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.

267 lines
11 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. public static class PlatformInternal
  11. {
  12. // Keep this enum in sync with ovrMessageTypeInternal in OVR_Platform_Internal.h
  13. public enum MessageTypeInternal : uint { //TODO - rename this to type; it's already in Message class
  14. Application_ExecuteCoordinatedLaunch = 0x267DB4F4,
  15. Application_GetInstalledApplications = 0x520F744C,
  16. Avatar_UpdateMetaData = 0x7BCFD98E,
  17. Cal_FinalizeApplication = 0x1DA9CBD5,
  18. Cal_GetSuggestedApplications = 0x56707015,
  19. Cal_ProposeApplication = 0x4E83F2DD,
  20. Colocation_GetCurrentMapUuid = 0x34557EB2,
  21. Colocation_RequestMap = 0x3215666D,
  22. Colocation_ShareMap = 0x186DC4DD,
  23. GraphAPI_Get = 0x30FF006E,
  24. GraphAPI_Post = 0x76A5A7C4,
  25. HTTP_Get = 0x6FB63223,
  26. HTTP_GetToFile = 0x4E81DC59,
  27. HTTP_MultiPartPost = 0x5842D210,
  28. HTTP_Post = 0x6B36A54F,
  29. Livestreaming_IsAllowedForApplication = 0x0B6D8D76,
  30. Livestreaming_StartPartyStream = 0x7B2F5CDC,
  31. Livestreaming_StartStream = 0x501AC7BE,
  32. Livestreaming_StopPartyStream = 0x27670F58,
  33. Livestreaming_StopStream = 0x44E40DCA,
  34. Livestreaming_UpdateCommentsOverlayVisibility = 0x1F7D8034,
  35. Livestreaming_UpdateMicStatus = 0x1C577D87,
  36. NetSync_Connect = 0x646D855F,
  37. NetSync_Disconnect = 0x1569FEB5,
  38. NetSync_GetSessions = 0x6ED60A35,
  39. NetSync_GetVoipAttenuation = 0x112ACA17,
  40. NetSync_GetVoipAttenuationDefault = 0x577BA8A0,
  41. NetSync_SetVoipAttenuation = 0x3497D7F6,
  42. NetSync_SetVoipGroup = 0x58129C8E,
  43. NetSync_SetVoipMicSource = 0x3302F770,
  44. NetSync_SetVoipSessionMuted = 0x5585FF0A,
  45. NetSync_SetVoipStreamMode = 0x67E19D37,
  46. Party_Create = 0x1AD31B4F,
  47. Party_GatherInApplication = 0x7287C183,
  48. Party_Get = 0x5E8953BD,
  49. Party_GetCurrentForUser = 0x58CBFF2A,
  50. Party_Invite = 0x35B5C4E3,
  51. Party_Join = 0x68027C73,
  52. Party_Leave = 0x329206D1,
  53. Room_CreateOrUpdateAndJoinNamed = 0x7C8E0A91,
  54. Room_GetNamedRooms = 0x077D6E8C,
  55. Room_GetSocialRooms = 0x61881D76,
  56. SystemPermissions_GetStatus = 0x1D6A2C09,
  57. SystemPermissions_LaunchDeeplink = 0x1A5A8431,
  58. User_CancelRecordingForReportFlow = 0x03E0D149,
  59. User_GetLinkedAccounts = 0x5793F456,
  60. User_LaunchBlockFlow = 0x6FD62528,
  61. User_LaunchReportFlow = 0x5662A011,
  62. User_LaunchReportFlow2 = 0x7F835863,
  63. User_LaunchUnblockFlow = 0x14A22A97,
  64. User_NewEntitledTestUser = 0x11741F03,
  65. User_NewTestUser = 0x36E84F8C,
  66. User_NewTestUserFriends = 0x1ED726C7,
  67. User_StartRecordingForReportFlow = 0x6C6E33E3,
  68. User_StopRecordingAndLaunchReportFlow = 0x60788C8B,
  69. User_StopRecordingAndLaunchReportFlow2 = 0x19C2B32B,
  70. User_TestUserCreateDeviceManifest = 0x6570B2BD
  71. };
  72. public static void CrashApplication() {
  73. CAPI.ovr_CrashApplication();
  74. }
  75. internal static Message ParseMessageHandle(IntPtr messageHandle, Message.MessageType messageType)
  76. {
  77. Message message = null;
  78. switch ((PlatformInternal.MessageTypeInternal)messageType)
  79. {
  80. case MessageTypeInternal.User_StartRecordingForReportFlow:
  81. message = new MessageWithAbuseReportRecording(messageHandle);
  82. break;
  83. case MessageTypeInternal.Cal_FinalizeApplication:
  84. message = new MessageWithCalApplicationFinalized(messageHandle);
  85. break;
  86. case MessageTypeInternal.Cal_GetSuggestedApplications:
  87. message = new MessageWithCalApplicationSuggestionList(messageHandle);
  88. break;
  89. case MessageTypeInternal.Application_ExecuteCoordinatedLaunch:
  90. case MessageTypeInternal.Cal_ProposeApplication:
  91. case MessageTypeInternal.Colocation_RequestMap:
  92. case MessageTypeInternal.Colocation_ShareMap:
  93. case MessageTypeInternal.Livestreaming_StopPartyStream:
  94. case MessageTypeInternal.Livestreaming_UpdateMicStatus:
  95. case MessageTypeInternal.NetSync_SetVoipAttenuation:
  96. case MessageTypeInternal.NetSync_SetVoipGroup:
  97. case MessageTypeInternal.NetSync_SetVoipMicSource:
  98. case MessageTypeInternal.Party_Leave:
  99. case MessageTypeInternal.User_CancelRecordingForReportFlow:
  100. case MessageTypeInternal.User_TestUserCreateDeviceManifest:
  101. message = new Message(messageHandle);
  102. break;
  103. case MessageTypeInternal.Application_GetInstalledApplications:
  104. message = new MessageWithInstalledApplicationList(messageHandle);
  105. break;
  106. case MessageTypeInternal.User_LaunchBlockFlow:
  107. message = new MessageWithLaunchBlockFlowResult(messageHandle);
  108. break;
  109. case MessageTypeInternal.User_LaunchReportFlow2:
  110. message = new MessageWithLaunchReportFlowResult(messageHandle);
  111. break;
  112. case MessageTypeInternal.User_LaunchUnblockFlow:
  113. message = new MessageWithLaunchUnblockFlowResult(messageHandle);
  114. break;
  115. case MessageTypeInternal.User_GetLinkedAccounts:
  116. message = new MessageWithLinkedAccountList(messageHandle);
  117. break;
  118. case MessageTypeInternal.Livestreaming_IsAllowedForApplication:
  119. message = new MessageWithLivestreamingApplicationStatus(messageHandle);
  120. break;
  121. case MessageTypeInternal.Livestreaming_StartPartyStream:
  122. case MessageTypeInternal.Livestreaming_StartStream:
  123. message = new MessageWithLivestreamingStartResult(messageHandle);
  124. break;
  125. case MessageTypeInternal.Livestreaming_UpdateCommentsOverlayVisibility:
  126. message = new MessageWithLivestreamingStatus(messageHandle);
  127. break;
  128. case MessageTypeInternal.Livestreaming_StopStream:
  129. message = new MessageWithLivestreamingVideoStats(messageHandle);
  130. break;
  131. case MessageTypeInternal.NetSync_Connect:
  132. case MessageTypeInternal.NetSync_Disconnect:
  133. message = new MessageWithNetSyncConnection(messageHandle);
  134. break;
  135. case MessageTypeInternal.NetSync_GetSessions:
  136. message = new MessageWithNetSyncSessionList(messageHandle);
  137. break;
  138. case MessageTypeInternal.NetSync_SetVoipSessionMuted:
  139. case MessageTypeInternal.NetSync_SetVoipStreamMode:
  140. message = new MessageWithNetSyncSetSessionPropertyResult(messageHandle);
  141. break;
  142. case MessageTypeInternal.NetSync_GetVoipAttenuation:
  143. case MessageTypeInternal.NetSync_GetVoipAttenuationDefault:
  144. message = new MessageWithNetSyncVoipAttenuationValueList(messageHandle);
  145. break;
  146. case MessageTypeInternal.Party_Get:
  147. message = new MessageWithParty(messageHandle);
  148. break;
  149. case MessageTypeInternal.Party_GetCurrentForUser:
  150. message = new MessageWithPartyUnderCurrentParty(messageHandle);
  151. break;
  152. case MessageTypeInternal.Party_Create:
  153. case MessageTypeInternal.Party_GatherInApplication:
  154. case MessageTypeInternal.Party_Invite:
  155. case MessageTypeInternal.Party_Join:
  156. message = new MessageWithPartyID(messageHandle);
  157. break;
  158. case MessageTypeInternal.Room_CreateOrUpdateAndJoinNamed:
  159. message = new MessageWithRoomUnderViewerRoom(messageHandle);
  160. break;
  161. case MessageTypeInternal.Room_GetNamedRooms:
  162. case MessageTypeInternal.Room_GetSocialRooms:
  163. message = new MessageWithRoomList(messageHandle);
  164. break;
  165. case MessageTypeInternal.Avatar_UpdateMetaData:
  166. case MessageTypeInternal.Colocation_GetCurrentMapUuid:
  167. case MessageTypeInternal.GraphAPI_Get:
  168. case MessageTypeInternal.GraphAPI_Post:
  169. case MessageTypeInternal.HTTP_Get:
  170. case MessageTypeInternal.HTTP_GetToFile:
  171. case MessageTypeInternal.HTTP_MultiPartPost:
  172. case MessageTypeInternal.HTTP_Post:
  173. case MessageTypeInternal.User_NewEntitledTestUser:
  174. case MessageTypeInternal.User_NewTestUser:
  175. case MessageTypeInternal.User_NewTestUserFriends:
  176. message = new MessageWithString(messageHandle);
  177. break;
  178. case MessageTypeInternal.SystemPermissions_GetStatus:
  179. case MessageTypeInternal.SystemPermissions_LaunchDeeplink:
  180. message = new MessageWithSystemPermission(messageHandle);
  181. break;
  182. case MessageTypeInternal.User_LaunchReportFlow:
  183. case MessageTypeInternal.User_StopRecordingAndLaunchReportFlow:
  184. case MessageTypeInternal.User_StopRecordingAndLaunchReportFlow2:
  185. message = new MessageWithUserReportID(messageHandle);
  186. break;
  187. }
  188. return message;
  189. }
  190. public static class HTTP
  191. {
  192. public static void SetHttpTransferUpdateCallback(Message<Models.HttpTransferUpdate>.Callback callback)
  193. {
  194. Callback.SetNotificationCallback(
  195. Message.MessageType.Notification_HTTP_Transfer,
  196. callback
  197. );
  198. }
  199. }
  200. public static Request<Models.PlatformInitialize> InitializeStandaloneAsync(ulong appID, string accessToken)
  201. {
  202. var platform = new StandalonePlatform();
  203. var initRequest = platform.AsyncInitialize(appID, accessToken);
  204. if (initRequest == null)
  205. {
  206. throw new UnityException("Oculus Platform failed to initialize.");
  207. }
  208. // This function is not named well. Actually means that we have called platform init.
  209. // Async initialization may not have finished at this point.
  210. Platform.Core.ForceInitialized();
  211. (new GameObject("Oculus.Platform.CallbackRunner")).AddComponent<CallbackRunner>();
  212. return initRequest;
  213. }
  214. public static class Users
  215. {
  216. public static Request<Models.LinkedAccountList> GetLinkedAccounts(ServiceProvider[] providers)
  217. {
  218. if (Core.IsInitialized())
  219. {
  220. UserOptions userOpts = new UserOptions();
  221. foreach (ServiceProvider provider in providers)
  222. {
  223. userOpts.AddServiceProvider(provider);
  224. }
  225. return new Request<Models.LinkedAccountList>(CAPI.ovr_User_GetLinkedAccounts((IntPtr)userOpts));
  226. }
  227. return null;
  228. }
  229. }
  230. }
  231. }