Class ConversationSpaceComponent

Inheritance Relationships

Base Types

Class Documentation

class ConversationSpaceComponent : public csp::multiplayer::ComponentBase, public csp::multiplayer::IPositionComponent, public csp::multiplayer::IRotationComponent

Add a conversation with comment thread to your space.

These conversations have a spatial representation.

Public Types

typedef std::function<void(const csp::common::ConversationNetworkEventData&)> ConversationUpdateCallbackHandler

Public Functions

ConversationSpaceComponent(csp::common::LogSystem *LogSystem, SpaceEntity *Parent)

Constructs the conversation component, and associates it with the specified Parent space entity.

This constructor should not be called directly. Instead, use the SpaceEntity::AddComponent function.

Parameters

Parentcsp::multiplayer::SpaceEntity* : The Space entity that owns this component. This will also register the component to the entity.

Pre

Parent must not be null.

void CreateConversation(const csp::common::String &Message, csp::systems::StringResultCallback Callback)

Creates a conversation represented by this component.

Parameters
Pre

The conversation must not already exist (component must not have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

Post

The ConversationId property is now internally set when the callback is fired. This component should now be replicated, so other clients receive the update.

void DeleteConversation(csp::systems::NullResultCallback Callback)

Deletes this conversation, including all of its messages.

This function is called internally when the component is deleted.

Parameters

Callbackcsp::systems::NullResultCallback : callback when asynchronous task finishes

Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

void AddMessage(const csp::common::String &Message, MessageResultCallback Callback)

Adds a message to the conversation.

Parameters
Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

void DeleteMessage(const csp::common::String &MessageId, csp::systems::NullResultCallback Callback)

Deletes a particular message.

Parameters
Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

Pre

Client should be logged in with the same user account that created the message (ClientId of the message should match the current logged in user). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

void GetMessagesFromConversation(const csp::common::Optional<int> &ResultsSkipNumber, const csp::common::Optional<int> &ResultsMaxNumber, MessageCollectionResultCallback Callback)

Retrieves message details that are represented by this component.

This doesn’t include the original message that created the conversation.

Parameters
Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

void GetConversationInfo(ConversationResultCallback Callback)

Retrieves message details for the root message in the conversation.

Parameters

Callbackcsp::multiplayer::ConversationResultCallback : Callback when asynchronous task finishes.

Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

void UpdateConversation(const MessageUpdateParams &NewData, ConversationResultCallback Callback)

Updates information for the root message in the conversation.

Parameters
Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

Pre

Client should be logged in with the same user account that created the message (ClientId of the message should match the current logged in user). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

void GetMessageInfo(const csp::common::String &MessageId, MessageResultCallback Callback)

Retrieves message details for a specified message in this conversation.

Parameters
Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

void UpdateMessage(const csp::common::String &MessageId, const MessageUpdateParams &NewData, MessageResultCallback Callback)

Updates information for a specified message in the conversation.

Parameters
Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

Pre

Client should be logged in with the same user account that created the message (ClientId of the message should match the current logged in user). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

void GetNumberOfReplies(NumberOfRepliesResultCallback Callback)

Gets the Number Of Replies in the conversation.

Parameters

Callbackcsp::multiplayer::NumberOfRepliesResultCallback : Callback when asynchronous task finishes.

Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

void GetConversationAnnotation(AnnotationResultCallback Callback)

Gets the annotation for the root message in the conversation.

Parameters

Callbackcsp::multiplayer::NumberOfRepliesResultCallback : Callback when asynchronous task finishes.

Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

Pre

The conversation must have an annotation previously attached using SetConversationAnnotation. A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

void SetConversationAnnotation(const AnnotationUpdateParams &AnnotationParams, const csp::systems::BufferAssetDataSource &Annotation, const csp::systems::BufferAssetDataSource &AnnotationThumbnail, AnnotationResultCallback Callback)

Associates an annotation with the root message in the conversation.

If an annotation already exists on the conversation, it will be overwritten.

Parameters
Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

void DeleteConversationAnnotation(csp::systems::NullResultCallback Callback)

Deletes an annotation associated with the root message in the conversation.

Parameters

Callbackcsp::systems::NullResultCallback : Callback when asynchronous task finishes.

Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response. if this condition is not met, with a EResultCode::Failed response.

void GetAnnotation(const csp::common::String &MessageId, AnnotationResultCallback Callback)

Gets an annotation associated with a message.

Parameters
Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

Pre

The message must have an annotation previously attached using SetAnnotation. A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

void SetAnnotation(const csp::common::String &MessageId, const AnnotationUpdateParams &UpdateParams, const csp::systems::BufferAssetDataSource &Annotation, const csp::systems::BufferAssetDataSource &AnnotationThumbnail, AnnotationResultCallback Callback)

Associates an annotation with a message.

If an annotation already exists on the message, it will be overwritten.

Parameters
Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

void DeleteAnnotation(const csp::common::String &MessageId, csp::systems::NullResultCallback Callback)

Deletes an annotation associated with a message.

Parameters
Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

void GetAnnotationThumbnailsForConversation(AnnotationThumbnailCollectionResultCallback Callback)

Gets all thumbnails in the conversation.

Parameters

Callbackcsp::multiplayer::AnnotationThumbnailCollectionResultCallback : Callback when asynchronous task finishes.

Pre

This component must contain a valid conversation id (component must have a conversation id that isn’t an empty string). A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.

void SetConversationUpdateCallback(ConversationUpdateCallbackHandler Callback)

Sets a callback for when the conversation is updated by another client.

Parameters

CallbackConversationUpdateCallbackHandler: Callback to receive data for the conversation that has been changed.

bool GetIsVisible() const
void SetIsVisible(bool Value)
bool GetIsActive() const
void SetIsActive(bool Value)
void SetTitle(const csp::common::String &Value)

Sets the Title of the conversation.

Parameters

Value – - The new title.

const csp::common::String &GetTitle() const

Gets the Title of the conversation.

void SetResolved(bool Value)

Sets the resolved value for indicating that a conversation is resolved.

Parameters

Value – - The resolved state.

bool GetResolved() const

Gets the resolved value of the conversation.

void SetConversationCameraPosition(const csp::common::Vector3 &InValue)

Sets the value for the camera position used to view the conversation.

Parameters

InValue – const csp::common::Vector3& : The position for the camera.

const csp::common::Vector3 &GetConversationCameraPosition() const

Gets the value for the camera position of the conversation.

Returns

const csp::common::Vector3& : The camera view position.

void SetConversationCameraRotation(const csp::common::Vector4 &InValue)

Sets the value for the camera rotation used to view the conversation.

Parameters

InValue – const csp::common::Vector4& : The rotation for the camera.

const csp::common::Vector4 &GetConversationCameraRotation() const

Gets the value for the camera rotation of the conversation.

Returns

const csp::common::Vector4& : The camera view rotation.

Protected Functions

virtual void OnCreated() override
virtual void OnRemove() override
virtual void OnLocalDelete() override
virtual void SetPropertyFromPatch(uint32_t Key, const csp::common::ReplicatedValue &Value) override