Auki::ConjureKit::ConjureKit
ConjureKit main module - provides basic networking and can be used in combination with other modules to provide more functionality.
Inherits from Auki.ConjureKit.IConjureKit
Public Functions
Name | |
---|---|
AukiCredentials | GetCredentials() Gets the current credentials. |
NetworkQuality | GetNetworkQuality() Returns the current NetworkQuality object. |
ConjureKitConfiguration | GetConfiguration() Gets the current configuration. |
Transform | GetCameraTransform() Gets the camera transform |
State State. | |
ConjureKitBridge | GetConjureKitBridge() Gets an object with common Unity callbacks. |
Session | GetSession() Gets currently joined Session object. |
void | RegisterModule(IConjureKitModule module) (Internal) Registers IAukiModule-conforming objects so they get updated and receive messages. |
Timestamp | GetNowAsProtobufTimestamp() Standard way of getting the current time. |
long | GetNowMilliseconds() Gets current time in milliseconds. |
ConjureKit(Transform mainCamera, string appKey, string appSecret, AukiDebug.LogLevel logLevel =AukiDebug.LogLevel.DEBUG) | |
void | Init(string configUri, Action onComplete =null, Action< string > onFailed =null) |
void | Init(ConjureKitConfiguration configuration, Action onComplete =null, Action< string > onFailed =null) |
void | Connect(Action< Session > onComplete =null, Action< string > onFailed =null) |
void | Connect(string sessionId, Action< Session > onComplete =null, Action< string > onFailed =null) |
void | Connect(string sessionId, string configUri, Action< Session > onComplete =null, Action< string > onFailed =null) |
void | Connect(string sessionId, ConjureKitConfiguration configuration, Action< Session > onComplete =null, Action< string > onFailed =null) |
bool | ConnectionErrorMessageIsInternetConnectivityIssue(string message) |
void | NotifyARCameraCalibrated() Notify Auki calibration has been achieved. |
void | Disconnect() Call when you want to disconnect from the Aukiverse. |
void | SetHagallFeatureConfiguration(IEnumerable< string > modules =null, IEnumerable< string > featureFlags =null) Sets lists of required Hagall modules and feature flags. |
void | SetHagallMinVersion(string version) Sets application-side request for minimum Hagall version. |
void | AddComponentType(string componentTypeName, Action< uint > onComplete, Action< string > onError =null) Low-level ECS method to add a component type to the Session. This method is obsolete and is scheduled for deletion. It is replaced by Session::AddComponentType(). |
void | GetComponentTypeId(string componentTypeName, Action< uint > onComplete, Action< string > onError =null) Low-level ECS method to get the id of a component type by name from a Session. This method is obsolete and is scheduled for deletion. It is replaced by Session::GetComponentTypeId(). |
void | GetComponentTypeName(uint componentTypeId, Action< string > onComplete, Action< string > onError =null) Low-level ECS method to get the name of a component type by id from a Hagall Session. This method is obsolete and is scheduled for deletion. It is replaced by Session::GetComponentTypeName(). |
void | AddComponent(uint componentTypeId, uint entityId, byte[] data, Action onComplete, Action< string > onError =null) Low-level ECS method to add a component type to the Session. This method is obsolete and is scheduled for deletion. It is replaced by Session::AddComponent(). |
void | DeleteComponent(uint componentTypeId, uint entityId, Action onComplete, Action< string > onError =null) Low-level ECS method to delete a component from an Entity in a Session. This method is obsolete and is scheduled for deletion. It is replaced by Session::DeleteComponent(). |
void | GetComponents(uint componentTypeId, Action< List< EntityComponent >> onComplete, Action< string > onError =null) Low-level ECS method to get all components of a component type in a Session. This method is obsolete and is scheduled for deletion. It is replaced by Session::GetComponents(). |
bool | UpdateComponent(uint componentTypeId, uint entityId, byte[] data) Low-level ECS method to update a component on an Entity in a Session. This method is obsolete and is scheduled for deletion. It is replaced by Session::UpdateComponent(). |
void | SubscribeToComponentType(uint componentTypeId, Action onComplete, Action< string > onError =null) Low-level ECS method to subscribe to updates of a component type This method is obsolete and is scheduled for deletion. It is replaced by Session::SubscribeToComponentType(). |
void | UnsubscribeToComponentType(uint componentTypeId, Action onComplete, Action< string > onError =null) Low-level ECS method to unsubscribe to updates of a component type This method is obsolete and is scheduled for deletion. It is replaced by Session::UnsubscribeToComponentType(). |
uint | GetNewRequestId() (Internal) Returns a new request id. |
void | Request(uint requestId, byte[] request, Action< byte[]> onResponse, Action< string > onError) (Internal) Sends a request to the server. |
void | _SendBytes(byte[] data) (Internal) Sends a message directly to Hagall. |
bool | SendCustomMessage(uint[] participantIds, byte[] data) Sends a custom message to other Participants. |
void | MeasurePing(Action< double > onComplete =null, Action< string > onError =null) Perform a millisecond ping measurement of the current session. The measurement is aggregated to ConjureKit's NetworkQuality object, accessible via ConjureKit.GetNetworkQuality(). |
Public Properties
Name | |
---|---|
Action< ConjureKitConfiguration > | OnInit Called after successful initialization or re-initialization of ConjureKit and its modules. The argument passed to OnInit is the configuration for which initialization took place. |
Action< Participant > | OnParticipantJoined Called when a new Participant joins the Session. |
Action< uint > | OnParticipantLeft Called when a Participant left the Session. |
Action< Entity > | OnEntityAdded Called when an Entity is added to the Session. |
Action< Entity > | OnEntityAddedResponse Called when an Entity add request was successful. |
Action< uint > | OnEntityDeleted Called when an Entity was deleted from the Session. |
Action< ComponentUpdateBroadcast > | OnComponentUpdate Low-level ECS callback method that is called when a component update is broadcast from a Session. Might later be replaced by Systems. |
Action< ComponentAddBroadcast > | OnComponentAdd Low-level ECS callback method that is called when a component is added to an Entity in a Session. Might later be replaced by Systems. |
Action< ComponentDeleteBroadcast > | OnComponentDelete Low-level ECS callback method that is called when a component is deleted from an Entity in a Session. Might later be replaced by Systems. |
Action< uint > | OnEntityDeletedResponse Called when an Entity delete request was successful. |
Action< Session > | OnJoined Called when a Session was joined. |
Action< Entity > | OnParticipantEntityCreated Called after calibration or immediately after joining a Session if this Participant is its host. |
Action< Session > | OnLeft Called when a Session was left. The argument is an inert copy of the old Session object as it stood before leaving. |
Action< State state has changed. | |
Action< Entity > | OnEntityUpdatePose Called when an Entity's Pose has been updated. |
Action< CustomMessageBroadcast > | OnCustomMessageBroadcast Called when a custom message broadcast has been received. |
Action | OnApplicationBackground Called when the application was sent to the background. |
Action | OnApplicationForeground Called when the application was sent to the foreground. |
Public Functions Documentation
function GetCredentials
AukiCredentials GetCredentials()
Gets the current credentials.
Return: AukiCredentials struct
function GetNetworkQuality
NetworkQuality GetNetworkQuality()
Returns the current NetworkQuality object.
Return: NetworkQuality object
function GetConfiguration
ConjureKitConfiguration GetConfiguration()
Gets the current configuration.
Return: AukiConfiguration struct
function GetCameraTransform
Transform GetCameraTransform()
Gets the camera transform
Return: Transform
function GetState
State GetState()
Gets current ConjureKit State.
Return: ConjureKit State
function GetConjureKitBridge
ConjureKitBridge GetConjureKitBridge()
Gets an object with common Unity callbacks.
Return: ConjureKitBridge object
function GetSession
Session GetSession()
Gets currently joined Session object.
Return: Session object or null
when not in a Session
function RegisterModule
void RegisterModule(
IConjureKitModule module
)
(Internal) Registers IAukiModule-conforming objects so they get updated and receive messages.
Parameters:
- conjureKitModule Module to be registered
function GetNowAsProtobufTimestamp
Timestamp GetNowAsProtobufTimestamp()
Standard way of getting the current time.
Return: Current time
function GetNowMilliseconds
long GetNowMilliseconds()
Gets current time in milliseconds.
Return: Current time in milliseconds
function ConjureKit
ConjureKit(
Transform mainCamera,
string appKey,
string appSecret,
AukiDebug.LogLevel logLevel =AukiDebug.LogLevel.DEBUG
)
function Init
void Init(
string configUri,
Action onComplete =null,
Action< string > onFailed =null
)
function Init
void Init(
ConjureKitConfiguration configuration,
Action onComplete =null,
Action< string > onFailed =null
)
function Connect
void Connect(
Action< Session > onComplete =null,
Action< string > onFailed =null
)
function Connect
void Connect(
string sessionId,
Action< Session > onComplete =null,
Action< string > onFailed =null
)
function Connect
void Connect(
string sessionId,
string configUri,
Action< Session > onComplete =null,
Action< string > onFailed =null
)
function Connect
void Connect(
string sessionId,
ConjureKitConfiguration configuration,
Action< Session > onComplete =null,
Action< string > onFailed =null
)
function ConnectionErrorMessageIsInternetConnectivityIssue
bool ConnectionErrorMessageIsInternetConnectivityIssue(
string message
)
function NotifyARCameraCalibrated
void NotifyARCameraCalibrated()
Notify Auki calibration has been achieved.
function Disconnect
void Disconnect()
Call when you want to disconnect from the Aukiverse.
function SetHagallFeatureConfiguration
void SetHagallFeatureConfiguration(
IEnumerable< string > modules =null,
IEnumerable< string > featureFlags =null
)
Sets lists of required Hagall modules and feature flags.
Parameters:
- modules List of required Hagall modules, default is
null
for none - featureFlags List of required Hagall feature flags, default is
null
for none
function SetHagallMinVersion
void SetHagallMinVersion(
string version
)
Sets application-side request for minimum Hagall version.
Parameters:
- version Hagall version number in format vMajor[.Minor][.Patch](e.g.,)
function AddComponentType
void AddComponentType(
string componentTypeName,
Action< uint > onComplete,
Action< string > onError =null
)
Low-level ECS method to add a component type to the Session. This method is obsolete and is scheduled for deletion. It is replaced by Session::AddComponentType().
function GetComponentTypeId
void GetComponentTypeId(
string componentTypeName,
Action< uint > onComplete,
Action< string > onError =null
)
Low-level ECS method to get the id of a component type by name from a Session. This method is obsolete and is scheduled for deletion. It is replaced by Session::GetComponentTypeId().
function GetComponentTypeName
void GetComponentTypeName(
uint componentTypeId,
Action< string > onComplete,
Action< string > onError =null
)
Low-level ECS method to get the name of a component type by id from a Hagall Session. This method is obsolete and is scheduled for deletion. It is replaced by Session::GetComponentTypeName().
function AddComponent
void AddComponent(
uint componentTypeId,
uint entityId,
byte[] data,
Action onComplete,
Action< string > onError =null
)
Low-level ECS method to add a component type to the Session. This method is obsolete and is scheduled for deletion. It is replaced by Session::AddComponent().
function DeleteComponent
void DeleteComponent(
uint componentTypeId,
uint entityId,
Action onComplete,
Action< string > onError =null
)
Low-level ECS method to delete a component from an Entity in a Session. This method is obsolete and is scheduled for deletion. It is replaced by Session::DeleteComponent().
function GetComponents
void GetComponents(
uint componentTypeId,
Action< List< EntityComponent >> onComplete,
Action< string > onError =null
)
Low-level ECS method to get all components of a component type in a Session. This method is obsolete and is scheduled for deletion. It is replaced by Session::GetComponents().
function UpdateComponent
bool UpdateComponent(
uint componentTypeId,
uint entityId,
byte[] data
)
Low-level ECS method to update a component on an Entity in a Session. This method is obsolete and is scheduled for deletion. It is replaced by Session::UpdateComponent().
Return: bool indicating success or failure of putting update message on send queue
function SubscribeToComponentType
void SubscribeToComponentType(
uint componentTypeId,
Action onComplete,
Action< string > onError =null
)
Low-level ECS method to subscribe to updates of a component type This method is obsolete and is scheduled for deletion. It is replaced by Session::SubscribeToComponentType().
function UnsubscribeToComponentType
void UnsubscribeToComponentType(
uint componentTypeId,
Action onComplete,
Action< string > onError =null
)
Low-level ECS method to unsubscribe to updates of a component type This method is obsolete and is scheduled for deletion. It is replaced by Session::UnsubscribeToComponentType().
function GetNewRequestId
uint GetNewRequestId()
(Internal) Returns a new request id.
Return: New request id
function Request
void Request(
uint requestId,
byte[] request,
Action< byte[]> onResponse,
Action< string > onError
)
(Internal) Sends a request to the server.
Parameters:
- requestId Request id
- request Byte array-encoded request
- onResponse Callback on success
- onError Callback on failure
function _SendBytes
void _SendBytes(
byte[] data
)
(Internal) Sends a message directly to Hagall.
Parameters:
- data
function SendCustomMessage
bool SendCustomMessage(
uint[] participantIds,
byte[] data
)
Sends a custom message to other Participants.
Parameters:
- participantIds An array of Participant Ids. Set to null to message all participants
- data An array of custom data. Maximum supported size is <= 1024 bytes for Hagall version < 0.4.101, <= 10240 bytes for Hagall version >= 0.4.101
Return: Success or failure
function MeasurePing
void MeasurePing(
Action< double > onComplete =null,
Action< string > onError =null
)
Perform a millisecond ping measurement of the current session. The measurement is aggregated to ConjureKit's NetworkQuality object, accessible via ConjureKit.GetNetworkQuality().
Parameters:
- onComplete Callback on success, invoked with millisecond amount
- onError Callback on failure
Public Property Documentation
property OnInit
Action< ConjureKitConfiguration > OnInit;
Called after successful initialization or re-initialization of ConjureKit and its modules. The argument passed to OnInit is the configuration for which initialization took place.
Return: Joining Participant object
property OnParticipantJoined
Action< Participant > OnParticipantJoined;
Called when a new Participant joins the Session.
Return: Joining Participant object
property OnParticipantLeft
Action< uint > OnParticipantLeft;
Called when a Participant left the Session.
Return: Id of Participant that left
property OnEntityAdded
Action< Entity > OnEntityAdded;
Called when an Entity is added to the Session.
Return: Added Entity object
Note: This event is triggered only for entities created by other participants in the session.
property OnEntityAddedResponse
Action< Entity > OnEntityAddedResponse;
Called when an Entity add request was successful.
Return: Added Entity object
property OnEntityDeleted
Action< uint > OnEntityDeleted;
Called when an Entity was deleted from the Session.
Return: Id of deleted Entity
Note: This event is triggered only for entities deleted by other participants in the session.
property OnComponentUpdate
Action< ComponentUpdateBroadcast > OnComponentUpdate;
Low-level ECS callback method that is called when a component update is broadcast from a Session. Might later be replaced by Systems.
Return: ComponentUpdateBroadcast
property OnComponentAdd
Action< ComponentAddBroadcast > OnComponentAdd;
Low-level ECS callback method that is called when a component is added to an Entity in a Session. Might later be replaced by Systems.
Return: ComponentAddBroadcast
property OnComponentDelete
Action< ComponentDeleteBroadcast > OnComponentDelete;
Low-level ECS callback method that is called when a component is deleted from an Entity in a Session. Might later be replaced by Systems.
Return: ComponentDeleteBroadcast
property OnEntityDeletedResponse
Action< uint > OnEntityDeletedResponse;
Called when an Entity delete request was successful.
Return: Id of deleted Entity
property OnJoined
Action< Session > OnJoined;
Called when a Session was joined.
property OnParticipantEntityCreated
Action< Entity > OnParticipantEntityCreated;
Called after calibration or immediately after joining a Session if this Participant is its host.
Return: ParticipantEntity object
property OnLeft
Action< Session > OnLeft;
Called when a Session was left. The argument is an inert copy of the old Session object as it stood before leaving.
property OnStateChanged
Action< State > OnStateChanged;
Called when the ConjureKit state has changed.
Return: New ConjureKit state
property OnEntityUpdatePose
Action< Entity > OnEntityUpdatePose;
Called when an Entity's Pose has been updated.
property OnCustomMessageBroadcast
Action< CustomMessageBroadcast > OnCustomMessageBroadcast;
Called when a custom message broadcast has been received.
Return: CustomMessageBroadcast object
property OnApplicationBackground
Action OnApplicationBackground;
Called when the application was sent to the background.
property OnApplicationForeground
Action OnApplicationForeground;
Called when the application was sent to the foreground.