5#include <tt/io/Message.h>
66 std::string
toString()
const override;
81 std::string
type()
const override {
88 static const bool matches(
const T* o1,
const T* o2) {
89 return o1 ==
nullptr || o2 ==
nullptr || *o1 == *o2;
94 void from_json(
const nlohmann::json& j,
Join& msg);
95 void to_json(nlohmann::json& j,
const Join& msg);
The join message is the first message sent from a client to the server to provide the agent's credent...
Definition Join.h:18
std::string name
The new agent's name.
Definition Join.h:21
std::string partner
The name of the partner this new agent wants to play with, or empty if they are willing to play with ...
Definition Join.h:46
std::string type() const override
Type used for JSON deserialization.
Definition Join.h:81
Role role
The role this new agent wants to have in their session, or empty if they are willing to play either r...
Definition Join.h:40
std::string toString() const override
Returns a string representation of this object.
Definition Join.cpp:10
std::string password
The new agent's password, which must be provided if the agent is using a name that is reserved on thi...
Definition Join.h:28
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 ...
Definition Join.h:34
bool matches(Join other)
Returns true if this join request is compatible with another, meaning a session could be created betw...
Definition Join.cpp:23
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.
Definition Join.cpp:6
Message()
Constructs a message.
Definition Message.h:32
Tandem Tales is a platform that enables short, paired storytelling exercises between two agents over ...
Definition Client.h:22
Role
Represents the two roles in a collaborative storytelling session: the Player, who typically controls ...
Definition Role.h:16
@ NONE
No role, used as a "null" value.
Definition Role.h:32