AddRequest
(
request
)
|
This method adds a request to the mapping of callbacks. It takes one parameter: the request to be added. If the request ID is 0, it means an early out error happened in the C SDK and the request is not added to the mapping. An error message is logged in this case.
Signature
static void Oculus.Platform.Callback.AddRequest(Request request) Parameters request: RequestReturns void |
HandleMessage
(
msg
)
|
This method handles a message by executing the associated callback function. It checks if a message callback has been set for the request ID, and if so, it calls the request.HandleMessage(msg) method on the corresponding request object. If no callback is registered for the request ID, it checks if there is a callback handler registered for the message type and calls the callbackHolder.HandleMessage(msg) method on it. If there is no callback handler registered, it checks if the message is a Join Intent notification and queues it up for processing.
Signature
static void Oculus.Platform.Callback.HandleMessage(Message msg) Parameters msg: MessageReturns void |
OnApplicationQuit
()
|
This method is called when the application quits. It clears out all outstanding callbacks by clearing the request IDs to requests and notification callbacks dictionaries.
Signature
static void Oculus.Platform.Callback.OnApplicationQuit() Returns void |
RunCallbacks
()
|
This method runs the callbacks for all pending messages. It repeatedly pops a message from the message queue using Platform.Message.PopMessage() and handles it until the queue is empty.
Signature
static void Oculus.Platform.Callback.RunCallbacks() Returns void |
RunLimitedCallbacks
(
limit
)
|
This method runs a limited number of callbacks for pending messages. It pops a message from the message queue using Platform.Message.PopMessage() and handles it up to the specified limit.
Signature
static void Oculus.Platform.Callback.RunLimitedCallbacks(uint limit) Parameters limit: uintReturns void |
SetNotificationCallback
(
type
, callback
)
|
This method sets the callback function for a specific notification message type. It takes two parameters: the type of notification message to set the callback for, and the callback function itself. If the provided callback is null, it throws an exception. It stores the callback function in a dictionary, using the notification message type as the key.
Signature
static void Oculus.Platform.Callback.SetNotificationCallback(Message.MessageType type, Message.Callback callback) Parameters type: Message.MessageTypecallback: Message.CallbackReturns void |
SetNotificationCallback< T >
(
type
, callback
)
|
This method sets the callback function for a specific notification message type. It takes two parameters: the type of notification message to set the callback for, and the callback function itself. If the provided callback is null, it throws an exception. It stores the callback function in a dictionary, using the notification message type as the key. If the notification message type is Notification_GroupPresence_JoinIntentReceived, it flushes the join intent notification queue by calling FlushJoinIntentNotificationQueue().
Signature
static void Oculus.Platform.Callback.SetNotificationCallback< T >(Message.MessageType type, Message< T >.Callback callback) Parameters type: Message.MessageTypeReturns void |