// Copyright Epic Games, Inc. All Rights Reserved. // This file is automatically generated. Changes to this file may be overwritten. namespace Epic.OnlineServices.RTC { public sealed partial class RTCInterface : Handle { public RTCInterface() { } public RTCInterface(System.IntPtr innerHandle) : base(innerHandle) { } /// /// The most recent version of the API. /// public const int AddnotifydisconnectedApiLatest = 1; /// /// The most recent version of the API. /// public const int AddnotifyparticipantstatuschangedApiLatest = 1; /// /// The most recent version of the API. /// public const int BlockparticipantApiLatest = 1; /// /// The most recent version of the API. /// public const int JoinroomApiLatest = 1; /// /// The most recent version of the API. /// public const int LeaveroomApiLatest = 1; /// /// The most recent version of the struct. /// public const int ParticipantmetadataApiLatest = 1; public const int ParticipantmetadataKeyMaxcharcount = 256; public const int ParticipantmetadataValueMaxcharcount = 256; /// /// The most recent version of the API. /// public const int SetroomsettingApiLatest = 1; /// /// The most recent version of the API. /// public const int SetsettingApiLatest = 1; /// /// Register to receive notifications when disconnected from the room. If the returned NotificationId is valid, you must call /// when you no longer wish to have your CompletionDelegate called. /// /// This function will always return when used with lobby RTC room. To be notified of the connection /// status of a Lobby-managed RTC room, use the function instead. /// /// /// /// Arbitrary data that is passed back in the CompletionDelegate /// The callback to be fired when a presence change occurs /// /// Notification ID representing the registered callback if successful, an invalid NotificationId if not /// public ulong AddNotifyDisconnected(ref AddNotifyDisconnectedOptions options, object clientData, OnDisconnectedCallback completionDelegate) { AddNotifyDisconnectedOptionsInternal optionsInternal = new AddNotifyDisconnectedOptionsInternal(); optionsInternal.Set(ref options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnDisconnectedCallbackInternal(OnDisconnectedCallbackInternalImplementation); Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal); var funcResult = Bindings.EOS_RTC_AddNotifyDisconnected(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal); Helper.Dispose(ref optionsInternal); Helper.AssignNotificationIdToCallback(clientDataAddress, funcResult); return funcResult; } /// /// Register to receive notifications when a participant's status changes (e.g: join or leave the room), or when the participant is added or removed /// from an applicable block list (e.g: Epic block list and/or current platform's block list). /// If the returned NotificationId is valid, you must call when you no longer wish to have your CompletionDelegate called. /// /// If you register to this notification before joining a room, you will receive a notification for every member already in the room when you join said room. /// This allows you to know who is already in the room when you join. /// /// To be used effectively with a Lobby-managed RTC room, this should be registered during the or completion /// callbacks when the ResultCode is . If this notification is registered after that point, it is possible to miss notifications for /// already-existing room participants. /// /// You can use this notification to detect internal automatic RTC blocks due to block lists. /// When a participant joins a room and while the system resolves the block list status of said participant, the participant is set to blocked and you'll receive /// a notification with ParticipantStatus set to and bParticipantInBlocklist set to true. /// Once the block list status is resolved, if the player is not in any applicable block list(s), it is then unblocked a new notification is sent with /// ParticipantStatus set to and bParticipantInBlocklist set to false. /// This notification is also raised when the local user joins the room, but NOT when the local user leaves the room. /// /// /// /// Arbitrary data that is passed back in the CompletionDelegate /// The callback to be fired when a presence change occurs /// /// Notification ID representing the registered callback if successful, an invalid NotificationId if not /// public ulong AddNotifyParticipantStatusChanged(ref AddNotifyParticipantStatusChangedOptions options, object clientData, OnParticipantStatusChangedCallback completionDelegate) { AddNotifyParticipantStatusChangedOptionsInternal optionsInternal = new AddNotifyParticipantStatusChangedOptionsInternal(); optionsInternal.Set(ref options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnParticipantStatusChangedCallbackInternal(OnParticipantStatusChangedCallbackInternalImplementation); Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal); var funcResult = Bindings.EOS_RTC_AddNotifyParticipantStatusChanged(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal); Helper.Dispose(ref optionsInternal); Helper.AssignNotificationIdToCallback(clientDataAddress, funcResult); return funcResult; } /// /// Use this function to block a participant already connected to the room. After blocking them no media will be sent or received between /// that user and the local user. This method can be used after receiving the OnParticipantStatusChanged notification. /// /// structure containing the parameters for the operation. /// Arbitrary data that is passed back in the CompletionDelegate /// a callback that is fired when the async operation completes, either successfully or in error /// /// if the operation succeeded /// if any of the parameters are incorrect /// if either the local user or specified participant are not in the specified room /// The user is in one of the platform's applicable block lists and thus an RTC unblock is not allowed. /// public void BlockParticipant(ref BlockParticipantOptions options, object clientData, OnBlockParticipantCallback completionDelegate) { BlockParticipantOptionsInternal optionsInternal = new BlockParticipantOptionsInternal(); optionsInternal.Set(ref options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnBlockParticipantCallbackInternal(OnBlockParticipantCallbackInternalImplementation); Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal); Bindings.EOS_RTC_BlockParticipant(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal); Helper.Dispose(ref optionsInternal); } /// /// Get a handle to the Audio interface /// eos_rtc_audio.h /// eos_rtc_audio_types.h /// /// /// handle /// public RTCAudio.RTCAudioInterface GetAudioInterface() { var funcResult = Bindings.EOS_RTC_GetAudioInterface(InnerHandle); RTCAudio.RTCAudioInterface funcResultReturn; Helper.Get(funcResult, out funcResultReturn); return funcResultReturn; } /// /// Use this function to join a room. /// /// This function does not need to called for the Lobby RTC Room system; doing so will return . The lobby system will /// automatically join and leave RTC Rooms for all lobbies that have RTC rooms enabled. /// /// structure containing the parameters for the operation. /// Arbitrary data that is passed back in the CompletionDelegate /// a callback that is fired when the async operation completes, either successfully or in error public void JoinRoom(ref JoinRoomOptions options, object clientData, OnJoinRoomCallback completionDelegate) { JoinRoomOptionsInternal optionsInternal = new JoinRoomOptionsInternal(); optionsInternal.Set(ref options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnJoinRoomCallbackInternal(OnJoinRoomCallbackInternalImplementation); Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal); Bindings.EOS_RTC_JoinRoom(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal); Helper.Dispose(ref optionsInternal); } /// /// Use this function to leave a room and clean up all the resources associated with it. This function has to always be called when the /// room is abandoned even if the user is already disconnected for other reasons. /// /// This function does not need to called for the Lobby RTC Room system; doing so will return . The lobby system will /// automatically join and leave RTC Rooms for all lobbies that have RTC rooms enabled. /// /// structure containing the parameters for the operation. /// Arbitrary data that is passed back in the CompletionDelegate /// a callback that is fired when the async operation completes, either successfully or in error /// /// if the operation succeeded /// if any of the parameters are incorrect /// if not in the specified room /// public void LeaveRoom(ref LeaveRoomOptions options, object clientData, OnLeaveRoomCallback completionDelegate) { LeaveRoomOptionsInternal optionsInternal = new LeaveRoomOptionsInternal(); optionsInternal.Set(ref options); var clientDataAddress = System.IntPtr.Zero; var completionDelegateInternal = new OnLeaveRoomCallbackInternal(OnLeaveRoomCallbackInternalImplementation); Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal); Bindings.EOS_RTC_LeaveRoom(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal); Helper.Dispose(ref optionsInternal); } /// /// Unregister a previously bound notification handler from receiving room disconnection notifications /// /// The Notification ID representing the registered callback public void RemoveNotifyDisconnected(ulong notificationId) { Bindings.EOS_RTC_RemoveNotifyDisconnected(InnerHandle, notificationId); Helper.RemoveCallbackByNotificationId(notificationId); } /// /// Unregister a previously bound notification handler from receiving participant status change notifications /// /// The Notification ID representing the registered callback public void RemoveNotifyParticipantStatusChanged(ulong notificationId) { Bindings.EOS_RTC_RemoveNotifyParticipantStatusChanged(InnerHandle, notificationId); Helper.RemoveCallbackByNotificationId(notificationId); } /// /// Use this function to control settings for the specific room. /// /// The available settings are documented as part of . /// /// structure containing the parameters for the operation /// /// when the setting is successfully set, when the setting is unknown, when the value is invalid. /// public Result SetRoomSetting(ref SetRoomSettingOptions options) { SetRoomSettingOptionsInternal optionsInternal = new SetRoomSettingOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_RTC_SetRoomSetting(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); return funcResult; } /// /// Use this function to control settings. /// /// The available settings are documented as part of . /// /// structure containing the parameters for the operation /// /// when the setting is successfully set, when the setting is unknown, when the value is invalid. /// public Result SetSetting(ref SetSettingOptions options) { SetSettingOptionsInternal optionsInternal = new SetSettingOptionsInternal(); optionsInternal.Set(ref options); var funcResult = Bindings.EOS_RTC_SetSetting(InnerHandle, ref optionsInternal); Helper.Dispose(ref optionsInternal); return funcResult; } [MonoPInvokeCallback(typeof(OnBlockParticipantCallbackInternal))] internal static void OnBlockParticipantCallbackInternalImplementation(ref BlockParticipantCallbackInfoInternal data) { OnBlockParticipantCallback callback; BlockParticipantCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo)) { callback(ref callbackInfo); } } [MonoPInvokeCallback(typeof(OnDisconnectedCallbackInternal))] internal static void OnDisconnectedCallbackInternalImplementation(ref DisconnectedCallbackInfoInternal data) { OnDisconnectedCallback callback; DisconnectedCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo)) { callback(ref callbackInfo); } } [MonoPInvokeCallback(typeof(OnJoinRoomCallbackInternal))] internal static void OnJoinRoomCallbackInternalImplementation(ref JoinRoomCallbackInfoInternal data) { OnJoinRoomCallback callback; JoinRoomCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo)) { callback(ref callbackInfo); } } [MonoPInvokeCallback(typeof(OnLeaveRoomCallbackInternal))] internal static void OnLeaveRoomCallbackInternalImplementation(ref LeaveRoomCallbackInfoInternal data) { OnLeaveRoomCallback callback; LeaveRoomCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo)) { callback(ref callbackInfo); } } [MonoPInvokeCallback(typeof(OnParticipantStatusChangedCallbackInternal))] internal static void OnParticipantStatusChangedCallbackInternalImplementation(ref ParticipantStatusChangedCallbackInfoInternal data) { OnParticipantStatusChangedCallback callback; ParticipantStatusChangedCallbackInfo callbackInfo; if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo)) { callback(ref callbackInfo); } } } }