Protocol v1.2 - acreloaded/ms GitHub Wiki

Warning: Deprecation

This specification has been superseded by v1.3, but there is still legacy support for it.

Specification

By nature, the GUIDs are untrustable.

  • /cube/:method/:client_definitions/:guid
  • /cube/:method
  • /cube - imply :method as list
    • INTENT: retrieve a cube-compatible server list
    • :method = (update|list|version)
    • :client_definitions is an unsigned 8-bit integer that describes the environment of the system
    • :guid is a numeric identifier (probably an unsigned 32-bit integer) of the system
    • Send masterserver_flags [flags]
      • OR all flags together:
      • Group A (only 1 of these 3 should be set)
        • 1 - IP Whitelisted
        • 2 - IP Banned (Blacklisted)
        • 4 - Muted
    • Send current_version [version] if :method ≠ "list"
    • Send server IPs (addserver [ip] [port] [weight]) if :method ≠ "version"
  • /reg/:proto/:port/:guid
    • INTENT: register a server
    • :proto is the protocol version of the server and is an unsigned 32-bit integer
    • :port is an UDP port number in the range [0,65535)
    • :guid is a numeric identifier (probably an unsigned 32-bit integer) of the system
    • perform an optional socket check
    • a human-readable response not starting with the control character "*" should be returned
  • /con/:port/:ip/:guid/:id/:user
  • /con/:port/:ip/:guid
    • INTENT: check if a connecting client is allowed into the server
    • :port is the server's port number
    • :ip is either an IPv4 or IPv6 address describing the client's host
    • :guid is the reported decimal GUID (probably an unsigned 32-bit integer) of the connecting client
    • :id is the auth ID number (so that the server may track it)
    • :user is the client's reported forum user ID
    • if both :id and :user are present, output:
      • *f if auth is disabled, or the user ID is invalid
      • *c[nonce] with a random alphanumeric string (up to 128 characters) to challenge the client, which MUST include a timestamp for security reasons.
      • a line feed character, followed by the regular response
    • your response must be as follows:
      • *bw - whitelisted IP
      • *bi - blacklisted IP, but also not whitelisted
      • *bm - muted and not allowed to speak or use /kick or /ban
      • *a - no matches, usual response
  • /ver/:port/:id/:answer
    • INTENT: verify the answer to an auth request
    • :port is the server's port number
    • :id is the auth ID number (so that the server may track it)
    • :answer should match { sha1( [user ID] + ":" + (pre-shared key) + "!" + [nonce]) }
    • *f if an error occurs (auth is disabled, server is not registered, cannot find request ID for server, etc.)
    • *d if authentication does not match (will previously disconnect client, but not anymore)
    • *s[priv][name] - auth succeeded, where
      • [priv] is only one "char" that describes the allowed privilege (x for name only, 0 for deban, 1+ for privilege)
      • [name] is the forum username