Class ConversationSpaceComponent
Defined in File ConversationSpaceComponent.h
Inheritance Relationships
Base Types
public csp::multiplayer::ComponentBase
(Class ComponentBase)public csp::multiplayer::IPositionComponent
(Class IPositionComponent)public csp::multiplayer::IRotationComponent
(Class IRotationComponent)
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
Parent – csp::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
Message – const csp::common::String& : The message to be stored.
Callback – csp::systems::StringResultCallback : Callback when asynchronous task finishes.
- 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
Callback – csp::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
Message – const csp::common::String& : The message to be stored.
Callback – MessageResultCallback : 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 DeleteMessage(const csp::common::String &MessageId, csp::systems::NullResultCallback Callback)
Deletes a particular message.
- Parameters
MessageId – const csp::common::String& : Id of the message to delete. The id can be retreived from the result callback when the message was added.
Callback – csp::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.
- 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
ResultsSkipNumber – const csp::common::Optional<int>& : Optional parameter representing the number of result entries that will be skipped from the result. For no skip pass an empty optional.
ResultsMaxNumber – const csp::common::Optional<int>& : Optional parameter representing the maximum number of result entries to be retrieved. For all available result entries pass an empty optional.
Callback – csp::multiplayer::MessageCollectionResultCallback : 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 GetConversationInfo(ConversationResultCallback Callback)
Retrieves message details for the root message in the conversation.
- Parameters
Callback – csp::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
NewData – const csp::multiplayer::MessageUpdateParams& : The information to update the root message with.
Callback – csp::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.
- 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
MessageId – const csp::common::String& : The message id to retrieve information for. The id can be retreived from the result callback when the message was added.
Callback – csp::multiplayer::MessageResultCallback : 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 UpdateMessage(const csp::common::String &MessageId, const MessageUpdateParams &NewData, MessageResultCallback Callback)
Updates information for a specified message in the conversation.
- Parameters
MessageId – const csp::common::String& : The message id to update information for. The id can be retreived from the result callback when the message was added.
NewData – const csp::multiplayer::MessageUpdateParams& : The information to update the specified message with.
Callback – csp::multiplayer::MessageResultCallback : 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
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
Callback – csp::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
Callback – csp::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
UpdateParams – const AnnotationUpdateParams& : The annotation data for this annotation.
Annotation – const systems::BufferAssetDataSource& : The annotation image data for this annotation.
AnnotationThumbnail – const systems::BufferAssetDataSource& : The annotation thumbnail image data for this annotation.
Callback – csp::multiplayer::AnnotationResultCallback : 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 DeleteConversationAnnotation(csp::systems::NullResultCallback Callback)
Deletes an annotation associated with the root message in the conversation.
- Parameters
Callback – csp::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
MessageId – const csp::common::String& : The message id the annotation is associated with.
Callback – csp::multiplayer::AnnotationResultCallback : 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 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
MessageId – const csp::common::String& : The message id to attach an annotation to.
UpdateParams – const AnnotationUpdateParams& : The annotation data for this annotation.
Annotation – const systems::BufferAssetDataSource& : The annotation image data for this annotation.
AnnotationThumbnail – const systems::BufferAssetDataSource& : The annotation thumbnail image data for this annotation.
Callback – csp::multiplayer::AnnotationResultCallback : 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 DeleteAnnotation(const csp::common::String &MessageId, csp::systems::NullResultCallback Callback)
Deletes an annotation associated with a message.
- Parameters
MessageId – const csp::common::String& : The message id whose annotation to delete.
Callback – csp::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 GetAnnotationThumbnailsForConversation(AnnotationThumbnailCollectionResultCallback Callback)
Gets all thumbnails in the conversation.
- Parameters
Callback – csp::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
Callback – ConversationUpdateCallbackHandler: 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.
-
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
-
typedef std::function<void(const csp::common::ConversationNetworkEventData&)> ConversationUpdateCallbackHandler