Class Stop
agent to indicate that no more
turns will happen in the session (though reports may still
happen) and that the session should end soon.
An agent can send the stop message (1) if they want to stop a session early
before the story had reached one of its defined endings, or (2) to indicate
they are finished and have no more reports to send. After an
agent sends the stop message, they may not send any more messages (including
reports), though they may stay connected to wait for the end
message.
The server will send the stop message to notify both agents that no more turns can be taken. This will happen when (1) the story reaches one of its defined endings, (2) one of the agents in the session stops it early, (3) one of the agents in the session disconnects, or (4) the server shuts down.
Once an agent receives the stop message, it cannot take any more turns, even
if the story has not reached one of its defined endings. However, an agent
may still send reports. When an agent is done sending reports,
it should send a stop message to indicate this.
After both agents have either sent stop messages or disconnected, the end message will be sent to both agents.
- Author:
- Stephen G. Ware
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal EndingOne of thepre-defined endingsfrom the story world, or null if this session did not reach one of those endingsfinal StringA message explaining how the session endedfinal RoleThe participant who ended the session, or null if the session reached a pre-defined ending or was ended by the server -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a stop message for the role who stopped the session before it reached a pre-defined ending.Constructs a stop message from a pre-defined story ending.Constructs a stop message with a string explaining how the session ended before it reached a pre-definded ending. -
Method Summary
-
Field Details
-
ending
One of thepre-defined endingsfrom the story world, or null if this session did not reach one of those endings -
role
The participant who ended the session, or null if the session reached a pre-defined ending or was ended by the server -
message
A message explaining how the session ended
-
-
Constructor Details
-
Stop
Constructs a stop message from a pre-defined story ending.- Parameters:
ending- the pre-defined ending that occurred in the story
-
Stop
Constructs a stop message for the role who stopped the session before it reached a pre-defined ending.- Parameters:
role- the role who stopped the story
-
Stop
Constructs a stop message with a string explaining how the session ended before it reached a pre-definded ending.- Parameters:
message- a string explaining why the session ended
-
-
Method Details
-
toString
-
verify
public void verify()Description copied from class:MessageChecks that this message is correctly configured and throws an exception if not. This method should be called soon after the message has been parsed. It should check that all the necessary fields are set and that their values are legal values.
-