This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
network_protocol [2009-08-13 07:24] – skyjake | network_protocol [2009-08-13 07:24] (current) – /* user.welcome (Update) */ skyjake | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{stub}} | ||
+ | |||
+ | This article describes the network packets used by [[libdeng2]], | ||
+ | |||
+ | |||
+ | ====== CommandPackets ====== | ||
+ | |||
+ | All CommandPackets will receive a reply in the form of a RecordPacket. | ||
+ | |||
+ | |||
+ | ===== status ===== | ||
+ | |||
+ | Client sends this to query the server' | ||
+ | |||
+ | Reply from server (server.status): | ||
+ | * Array of Numbers **version**: | ||
+ | * **sessions** | ||
+ | * **{session-id}** | ||
+ | * Dictionary of Text to Text **users**: user id ⇒ user name. | ||
+ | |||
+ | |||
+ | ===== session.new ===== | ||
+ | |||
+ | Client sends this to create a new session on the server. | ||
+ | * Text **map**: map to load in the session' | ||
+ | |||
+ | Reply: | ||
+ | * Text **id**: id of the created session. | ||
+ | |||
+ | |||
+ | ===== session.delete ===== | ||
+ | |||
+ | Client sends this to destroy an existing session on the server. | ||
+ | * Text **id**: session id. | ||
+ | |||
+ | |||
+ | ===== session.join ===== | ||
+ | |||
+ | Client sends this when it wishes to join a session in progress. | ||
+ | * Text **id**: id of the session. | ||
+ | * Block **userState**: | ||
+ | |||
+ | Reply from server: | ||
+ | * Text **userId**: user's id in the session. | ||
+ | |||
+ | |||
+ | ===== session.leave ===== | ||
+ | |||
+ | Client sends this when it is leaving a session in progress. | ||
+ | |||
+ | No reply. | ||
+ | |||
+ | |||
+ | ====== RecordPackets ====== | ||
+ | |||
+ | |||
+ | |||
+ | ===== user.welcome (Update) ===== | ||
+ | |||
+ | Sent to a client after it has been promoted to user in the session. | ||
+ | * Block **worldState**: | ||
+ | * **users** | ||
+ | * Block **{user-id}**: | ||
+ | |||
+ | The user's own state is not included under **users**. | ||
+ | |||
+ | |||
+ | ===== user.joined (Update) ===== | ||
+ | |||
+ | Sent after a client has been promoted to user in the session. Not sent to the promoted user. | ||
+ | * Text **id**: id of the user who joined. | ||
+ | * Block **userState**: | ||
+ | |||
+ | |||
+ | ===== user.left (Update) ===== | ||
+ | |||
+ | Sent after a client has been demoted from the session. Not sent to the demoted client. | ||
+ | * Text **id**: id of the user who left. | ||
+ | |||
+ | |||
+ | ===== session.ended (Update) ===== | ||
+ | |||
+ | Sent when the session ends on the serverside, signaling the user session to end as well. | ||
+ | |||
+ | |||
+ | |||