|
TT Client Library 1.0.0
C++ library for Tandem Tales clients.
|
The join message is the first message sent from a client to the server to provide the agent's credentials and its preferences for what story world, role, and partner they want for their session. More...
#include <tt/io/Join.h>


Public Member Functions | |
| Join (std::string name, std::string password, std::string world, Role role, std::string partner) | |
| Constructs a new join message with an agent's credentials and preferences. | |
| std::string | toString () const override |
| Returns a string representation of this object. | |
| bool | matches (Join other) |
| Returns true if this join request is compatible with another, meaning a session could be created between the agents who sent the messages. | |
| std::string | type () const override |
| Type used for JSON deserialization. | |
| Public Member Functions inherited from tt::Message | |
| Message () | |
| Constructs a message. | |
| const Client * | getClient () const |
Returns the tt::Client who sent this message, or null if this message was sent by the server. | |
| void | setClient (const Client *client) |
Sets the tt::Client who sent this message. | |
Public Attributes | |
| std::string | name |
| The new agent's name. | |
| std::string | password |
The new agent's password, which must be provided if the agent is using a name that is reserved on this server, or which should be empty if the agent is not using a reserved name. | |
| std::string | world |
| The name of the story world this new agent wants to play in, or empty if they are willing to play in any story world. | |
| Role | role |
| The role this new agent wants to have in their session, or empty if they are willing to play either role. | |
| std::string | partner |
| The name of the partner this new agent wants to play with, or empty if they are willing to play with any partner. | |
The join message is the first message sent from a client to the server to provide the agent's credentials and its preferences for what story world, role, and partner they want for their session.
| Join::Join | ( | std::string | name, |
| std::string | password, | ||
| std::string | world, | ||
| Role | role, | ||
| std::string | partner ) |
Constructs a new join message with an agent's credentials and preferences.
| name | the new agent's name |
| password | the new agent's password, or empty if they are not using a reserved name |
| world | the world the new agent wants to play in, or empty if they have no preference |
| role | the role the new agent wants to have, or empty if they have no preference |
| partner | the name of the partner this new agent wants to play with, or empty if they have no preference |
| bool Join::matches | ( | Join | other | ) |
Returns true if this join request is compatible with another, meaning a session could be created between the agents who sent the messages.
This method will not match two requests which both specify no preference for a partner. In other words, at least one of the requests must specify a partner.
| other | the join message of another agent waiting for a session |
|
overridevirtual |
Returns a string representation of this object.
Reimplemented from tt::Message.
|
inlineoverridevirtual |
Type used for JSON deserialization.
Implements tt::Message.