AESOP Protocol Messages
[AESOP Network Protocol]


All TCP AESOP protocol messages have the same basic format. More...

Collaboration diagram for AESOP Protocol Messages:



smart_ptr< netlib::MessageBufferaesop::createTcpConnectMessage (long token)
 Message: TcpConnect
From: Client
To: Server
Clients must send one of these whenever they set up a TCP connection with the server.
smart_ptr< netlib::MessageBufferaesop::createNotifyErrorMessage (eErrorCode errorCode, const char *message)
 Message: Notify Error
From: Server
To: Client
General error message from client to server.
smart_ptr< netlib::MessageBufferaesop::createConversationDialogMessage (int localPlayerId, const char *conversationGuid, int dialogId, const char *dialogData)
 Message: Conversation Dialog
From: Server
To: Client

smart_ptr< netlib::MessageBufferaesop::createConversationReplyMessage (int playerId, const char *conversationGuid, int dialogId, const char *reply)
 Message: Conversation Reply
From: Client
To: Server

smart_ptr< netlib::MessageBufferaesop::createRefreshConversationMessage (int playerId, const char *conversationGuid)
 Message: Refresh Conversation
From: Client
To: Server

smart_ptr< netlib::MessageBufferaesop::createTerminateConversationMessage (int playerId, const char *conversationGuid)
 Message: Terminate Conversation
From: Server
To: Client

smart_ptr< netlib::MessageBufferaesop::createNewGameMessage (int playerId)
 Message: New Game
From: Client
To: Server


Detailed Description


All TCP AESOP protocol messages have the same basic format.

They are plain text (low-bit ASCII only), following the Datahash format (see the wavepacket-lib documentation for Datahashes at http://wavepacket-lib.sourceforge.net/group__datahash.html)

At the top level, any TCP message consists of only two elements: a header subhash with only two elements, and a data hash containing arbitrary (message-dependent) data.

        header {
                namespace       client | server
                command         XXXXXXX
        }
        data {
                [data depends on the command/message being sent]
        }

The header section contains only two fields:

Both the namespace and command fields can occur only once, and have only a simple string value.

The data section is a recursive Datahash object. The exact data depends on the message being sent. Wire formats are listed below for all messages.


Function Documentation

smart_ptr< netlib::MessageBuffer > aesop::createTcpConnectMessage ( long  token  ) 

Message: TcpConnect
From: Client
To: Server
Clients must send one of these whenever they set up a TCP connection with the server.

The client must provide the token that the server gives in the connection response (UDP handshake).

Wire Format:

        header {
                namespace       server
                command         tcp
        }
        data {
                token           <long>
        }
smart_ptr< netlib::MessageBuffer > aesop::createNotifyErrorMessage ( eErrorCode  errorCode,
const char *  message 
)

Message: Notify Error
From: Server
To: Client
General error message from client to server.

This could be as a result of a bad message from the client, or because the server has other reasons.

Wire Format:

        header {
                namespace       client
                command         error
        }
        data {
                errorCode       <long>
                message         <message>
        }
smart_ptr< netlib::MessageBuffer > aesop::createConversationDialogMessage ( int  localPlayerId,
const char *  conversationGuid,
int  dialogId,
const char *  dialogData 
)

Message: Conversation Dialog
From: Server
To: Client

This message is sent from the server to the client when the server believes that a particular player needs to be shown a dialog as part of an ongoing conversation. This is also the first message sent when a conversation is initiated, and is also sent if the client requests that the server refresh a current conversation (see createRefreshConversationMessage()).

When it receives this message, the client should recognize that the given conversation is occurring (remember this conversation GUID), and present the given dialog to the player specified. The client should also keep track of what dialog is being shown to the player as part of each conversation.

In general, a player may have multiple conversations going at any one time! However, a given conversation will only ever have a single active dialog.

Wire format:

        header {
                namespace               client
                command                 converse-dialog
        }
        data {
                playerId                [local player ID on client]
                conversationGuid        XXXXXXXXXX
                dialogId                YYYYYYYYYY
                dialog {
                        ...
                }
        }

See also Conversation Library.

smart_ptr< netlib::MessageBuffer > aesop::createConversationReplyMessage ( int  playerId,
const char *  conversationGuid,
int  dialogId,
const char *  reply 
)

Message: Conversation Reply
From: Client
To: Server

This message is sent when a player has selected or otherwise completed a dialog as part of a conversation (this includes escaping or quitting the dialog). See Dialog Library for details on dialogs and replies.

Wire format:

        header {
                namespace               server
                command                 converse-reply
        }
        data {
                playerId                [local player ID on client]
                conversationGuid        XXXXXXXX
                dialogId                YYYYYYYY
                reply {
                        ...
                }
        }

See also Conversation Library.

smart_ptr< netlib::MessageBuffer > aesop::createRefreshConversationMessage ( int  playerId,
const char *  conversationGuid 
)

Message: Refresh Conversation
From: Client
To: Server

Typically this is sent when a client believes it may have an out-of-date view of a particular conversation. The server will look at the requested conversation ID, and send back either a Conversation Dialog message (see createConversationDialogMessage()) or a Terminate Conversation message (see createTerminateConversationMessage()).

Wire format:

        header {
                namespace               server
                command                 converse-refresh
        }
        data {
                playerId                [local player ID on client]
                conversationGuid        XXXXXXXX
        }

See also Conversation Library.

smart_ptr< netlib::MessageBuffer > aesop::createTerminateConversationMessage ( int  playerId,
const char *  conversationGuid 
)

Message: Terminate Conversation
From: Server
To: Client

Sent by the server to tell the client that the given conversation has now ended. This is also sent if the client calls Refresh Conversation on a conversation that has since ended (see createRefreshConversationMessage()).

See createConversationDialogMessage() for more info.

Wire format:

        header {
                namespace               client
                command                 converse-end
        }
        data {
                playerId                [local player ID on client]
                conversationGuid        XXXXXXXX
        }

See also Conversation Library.

smart_ptr< netlib::MessageBuffer > aesop::createNewGameMessage ( int  playerId  ) 

Message: New Game
From: Client
To: Server

Sent by the client to tell the server to start a new game. WARNING: this will nuke any currently running games and start a new one! Make sure there are warning dialogs etc. before you let a user send this message.

Wire format:

        header {
                namespace               server
                command                 new-game
        }
        data {
                playerId                [local player ID on client]
        }