Module: Pixiurge::Protocol::Outgoing

Defined in:
lib/pixiurge/protocol.rb

Overview

Fixed constants for outgoing protocol messages. That means messages sent from the server to the front end rather than the opposite.

Since:

  • 0.1.0

Constant Summary

AUTH_FAILED_REGISTRATION =

Failed registration in the built-in AuthenticatedApp's protocol. The key "message" holds a human-readable reason for the failure.

Examples:

[ AUTH_FAILED_REGISTRATION, { "message" => "That name already exists" } ]

Since:

  • 0.1.0

"failed_registration"
AUTH_FAILED_LOGIN =

Failed login or failure to get login information in the built-in AuthenticatedApp's protocol. The key "message" holds a human-readable reason for the failure. This message is sent when getting the user's salt fails, usually because no such user exists.

Examples:

[ AUTH_FAILED_LOGIN, { "message" => "Wrong password" } ]

Since:

  • 0.1.0

"failed_login"
AUTH_REGISTRATION =

Successful registration in the built-in AuthenticatedApp's protocol.

Examples:

[ AUTH_REGISTRATION, { "username" => username } ]

Since:

  • 0.1.0

"registration"
AUTH_LOGIN =

Successful login in the built-in AuthenticatedApp's protocol.

Examples:

[ AUTH_LOGIN, { "username" => username } ]

Since:

  • 0.1.0

"login"
AUTH_SALT =

Successful query of the salt in the built-in AuthenticatedApp's protocol.

Examples:

[ AUTH_SALT, { "salt" => cryptographic_salt } ]

Since:

  • 0.1.0

"login_salt"
DISCONNECTION =

Let the front end know that the socket is being intentionally disconnected. Possible reasons include a user request to disconnect, another login from the same account or an administrator requesting the disconnect. After the message type, there is a hash argument. The "message" key holds a human-readable message with the reason for the disconnection.

Examples:

[ DISCONNECTION, { "message" => "Administrator has blocked this IP address." } ]

Since:

  • 0.1.0

"disconnect"
DISPLAY_INIT =

Set up an initial display with appropriate settings. It should normally never be sent a second time on the same connection. The final hash should contain display-relevant and server-variable settings like how fast in milliseconds a tick is.

Examples:

[ DISPLAY_INIT, { "ms_per_tick" => 300, "height" => 256, "width" => 256 } ]

Since:

  • 0.1.0

"display_init"
DISPLAY_DESTROY_ALL =

All currently shown displayables of any description should be hidden. Items, agents, locations and effects are all removed, animations should be cancelled and any hints or preloads no longer apply.

Examples:

[ DISPLAY_DESTROY_ALL ]

Since:

  • 0.1.0

"display_destroy_all"
DISPLAY_DESTROY_DISPLAYABLE =

Destroy a single Displayable by name.

Examples:

[ DISPLAY_DESTROY_DISPLAYABLE, "item name" ]

Since:

  • 0.1.0

"display_destroy"
DISPLAY_SHOW_DISPLAYABLE =

Show a Displayable object. The arguments following the message type are a String name for the item and then a Hash of additional details, such as the URL for a TMX item.

Examples:

[ DISPLAY_SHOW_DISPLAYABLE, "my room", { "type" => "tmx", "url" => "tmx/my_room_map.json" } ]

Since:

  • 0.1.0

"display_show"
DISPLAY_MOVE_DISPLAYABLE =

Move a Displayable object within a location. The arguments that follow are the Displayable's name, then a hash with the keys "old_position", "position" and "options".

Examples:

[ DISPLAY_MOVE_DISPLAYABLE, "item name", { "old_position" => "location_name#23,4", "position" => "location_name#23,5", "options" => { "locomotion" => "brachiating" } } ]

Since:

  • 0.1.0

"display_move"
DISPLAY_PAN_TO_PIXEL =

Pan the viewpoint's center to the pixel offset given.

Examples:

[ DISPLAY_PAN_TO_PIXEL, item_name, x_pixel, y_pixel, options ]

Since:

  • 0.1.0

"display_pan"