wiki:CreatingOtherClients

How to create a Museek client

Socket

  • /tmp/museekd.USERNAME
  • localhost:2240

Messages

Generic message format

  1. uint message_len -- Length of the message (including the message code) (unsigned chars)
  2. uint message_code -- Message code
  3. Message specific data

Primitive Data types

  • bool -- 8bit character (0 == false, not 0 == true)
  • uint -- 32bit unsigned little endian ordered integer
  • off_t -- 64bit signed little endian ordered integer
  • string -- the length of the string (as an uint) + character data

(all strings are UTF8)

Complex Data types

userdata

Statistics about a user

  1. uint status -- user's status
  2. uint avgspeed -- user's average upload speed
  3. uint downloadnum -- (unknown)
  4. uint files -- number of files a user has shared
  5. uint dirs -- number of dirs a user has shared
  6. bool slotsfull -- wether or not the user has an upload slot available

transfer

Information about a transfer

  1. bool is_upload -- Is this an upload or a download?
  2. string user -- The user associated with this transfer
  3. string path -- The original path to the transfer
  4. uint place -- Place in queue or (uint)-1 if unknown (only valid for downloads)
  5. uint state -- The transfer's state
    • 00: Finished
    • 01: Transferring
    • 02: Negotiating
    • 03: Waiting
    • 04: Establishing
    • 05: Initiating
    • 06: Connecting
    • 07: Queued
    • 08: Getting address
    • 09: Getting status
    • 10: Awaiting user
    • 11: Connection closed
    • 12: Cannot connect
    • 13: Aborted
    • 14: Error
  6. string error -- If the transfer's in error state, this contains the error
  7. off_t position -- How far has the transfer proceded
  8. off_t size -- Total size of this transfer
  9. uint rate -- How fast the transfer is proceding

fileentry

Information about a shared file

  1. off_t filesize -- the file's size
  2. string ext -- the file's extended attribute format (only 'mp3' and 'ogg' or an empty string are supported)
  3. uint numattrs -- number of extended attributes
  4. Iterate the range of numattrs
    • uint attr -- an attribute The extended attribute format holds 3 attributes:
      1. uint bitrate -- the bitrate of the file
      2. uint length -- duration of the file in seconds
      3. uint vbr -- wether the mp3 has a variable bitrate or not

folder

Information about a shared folder

  1. uint numfiles -- how many files the folder contains
  2. Iterate the range of numfiles
    1. string file -- the filename or full path (depends on context)
    2. fileentry info -- the file's information

sharesdb

Information about a user's shares

  1. uint numfolders -- how many folders there are
  2. Iterate the range of numfolders
    1. string folder -- the folder's path
    2. folder files -- the files contained in this folder (filenames are relative)

cipher

AES (aka Rijndael) encrypted string

Configuration strings are sent over the communication layer encrypted as they may contain sensitive information. The keyphrase of the AES cipher equals the password used to log in. This complex data type start with the length of the unencrypted string (n), followed by the encrypted string data. Crucial note: The amount of encrypted characters sent is n rounded up to the nearest 16 byte block size. For exmaple: if the original string was 6 characters long, n will be 6 but is following by 16 characters of data.

0x0000 Ping

  • Client - Ask the daemon to respond
    1. uint id - Unique identifier
  • Daemon
    1. uint id - Unique identifier (same as what was sent)

0x0001 Challenge

  • Client
    • Not Sent - (use 0x0002 Login to reply)
  • Daemon - Daemon sends this authentication challenge when connected
    1. uint version - Daemon interface protocol revision
    2. string challenge - The challenge. Stick interface password at the end of this and generate a hash

0x0002 Login

  • Client - Login attempt
    1. string algorithm - Digest algorithm, one of the following
      • SHA1 SHA-1 algorithm
      • SHA256 SHA256 algorithm
      • MD5 MD5 algorithm
    2. string chresponse - Challenge response (hex string version of challenge digest)
    3. uint mask - Interface interest mask, bitwise OR-ed value of any or all of the following
      • 0x01 - Receive chat related messages
      • 0x02 - Receive private messages
      • 0x04 - Receive transfer messages
      • 0x08 - Receive user info message
      • 0x10 - Receive user shares messages
      • 0x20 - Receive interest and recommendation messages
      • 0x40 - Receive config messages
  • Daemon - Login response
    1. bool ok -Wether login was successful
    2. string message - In case of failure, what was the error:
      • INVHASH - Invalid digest algorithm
      • INVPASS - Invalid password
    3. string challenge -New challenge, in case the interface wishes to try again

0x0003 Server state

  • Client
    • Not Sent - (Automatically sent on client connection)
  • Daemon - Network connection status
    1. bool connected - Wether the daemon is connected to the soulseek network
    2. string username - Soulseek Username

0x0004 Check privileges

  • Client - Check how many seconds of privileges you have left
    • Empty Message
  • Daemon
    1. uint seconds - The number of seconds of privileges you have

0x0005 Set status

  • Client - Set away status
    1. uint status - (0 == online, 1 == away)
  • Daemon - Away status set
    1. uint status - (0 == online, 1 == away)

0x0010 Status Message

  • Client
    • Not Sent - (Sent by daemon with no interaction required)
  • Daemon - Forward messages to the clients
    1. bool messagetype - ( 0 == Server, 1 == Peer )
    2. string message - If connected, this contains the message

0x0100 Configuration state

  • Client
    • Not Sent - (Automatically sent on client connection)
  • Daemon - Contents of the configuration database
    1. uint ndomains number of domains registered
    2. Iterate the range of ndomains
      1. cipher domain domain name
      2. uint nkeys number of keys registered in this domain
      3. Iterate the range of nkeys
        1. cipher key name of this key
        2. cipher value ciphered value of this key

0x0101 Config set

  • Client - Make a change to the configuration database
    1. cipher domain - Domain to make a change in
    2. cipher key - Key to change
    3. cipher value - Value to change it to
  • Daemon - Config was changed
    1. cipher domain - The domain a change took place in
    2. cipher key - The key that was changed
    3. cipher value - The new value

0x0102 Config remove

  • Client - Remove a key from the configuration database
    1. cipher domain Domain to remove a key from
    2. cipher key Key to remove
  • Daemon
    1. cipher domain Domain that a key was removed from
    2. cipher key Name of the key that was removed

0x103 Set user image

  • Client - Set the image that gets sent with the user info
    1. string image - The image data
  • Daemon
    • Not Sent

0x0201 Peer exists

  • Client - Check if a certain username is valid
    1. string username Name of the user to check
  • Daemon
    1. string username - Username that was checked
    2. bool exists - Wether the username is valid or not

0x0202 Peer status

  • Client - Get a user's status
    1. string username - Name of the user to get the status of
  • Daemon
    1. string username - Name of the user that changed status
    2. uint status - User's current status, one of the following:
      • 0x00 Offline
      • 0x01 Away
      • 0x02 Online

0x0203 Peer statistics

  • Client - Get a users's statistics
    1. string username Name of the user to get the stats of
  • Daemon
    1. string username - Name of the user daemon is reporting statistics for
    2. uint avgspeed - User's average speed
    3. uint numdownloads - User's total download count (?)
    4. uint numfiles - User's file-count
    5. uint numdirs - User's directory-count

0x0206 Peer address

  • Client - Get a user's IP address and port
    1. string username - User to get the IP of
  • Daemon
    1. string username - User we got the IP of
    2. string IP - User's IP address
    3. uint port - User's client port number

0x0204 User info

  • Client - Get a user's user-info
    1. string username - User to get the userinfo of
  • Daemon
    1. string username - User we got userinfo of
    2. string info - User's self-description
    3. string picture - User's picture
    4. uint uploads - User's total upload count
    5. uint queuelen - User's queue length
    6. bool slotfree - Wether user has a free upload slot

0x0205 User shares

  • Client - Get a user's shares
    1. string username - User to get the shares of
  • Daemon
    1. string username - User the daemon got the shares of
    2. sharesdb shares - The shares

0x0207 Give privileges

  • Client - Donate (part) of your privileges to another user
    1. string username - Username of the person to donate privileges to
    2. uint days - How many days of privileges to donate
  • Daemon
    • Not Sent

0x0300 Room state

  • Client - List of rooms and joined rooms and their users
    • Not Sent
  • Daemon
    1. uint numrooms - Number of rooms in the room list
    2. Iterate the range of numrooms
      1. string roomname - Name of the room
      2. uint numusers - Number of users in this room
      3. uint numjoined - Number of rooms we've joined
      4. Iterate the range of numjoined
        1. string roomname - Name of the room
        2. uint numusers - Number of users in this room
        3. Iterate the range of numusers
          1. string username - Name of the user
          2. userdata data User's statistics
        4. uint numtickers - Number of tickers set for this room
        5. Iterate the range of numtickers
          1. string username - Name of the ticker owner
          2. string message - Contents of the ticker

0x0301 Room list

  • Client - Refresh room list
    • Empty Message
  • Daemon
    1. uint numrooms - Number of rooms in the room list
    2. Iterate the range of numrooms_
      1. string roomname - Name of the room
      2. uint numusers - Number of users in this room

0x0302 Private message

  • Client - Send / receive a private message
    1. string username - The user to send a message to
    2. string message - The actual message
  • Daemon
    1. uint direction - Direction (0 = incoming, 1 = outgoing)
    2. uint timestamp - Timestamp of when the message was received (server's timezone)
    3. string username - The user that sent the message
    4. string message - The actual message

0x0303 Join room

  • Client - Join(ed) a room
    1. string room - The name of the room to join
  • Daemon
    1. string room - The name of the room we joined
    2. uint numusers - Number of users in this room
    3. Iterate the range of numusers
      1. string username - Name of the user
      2. userdata data - User's statistics

0x0304 Leave room

  • Client - Leave / left a room
    1. string room - Name of the room to leave
  • Daemon
    1. string room - Name of the room we left

0x0305 User joined room

  • Client - A user joined a room
    • Not Sent
  • Daemon
    1. string room - Room the user joined
    2. string username - User that joined
    3. userdata data - User's statistics

0x0306 User left room

  • Client - A user left a room
    • Not Sent
  • Daemon
    1. string room - Room the user left
    2. string username - User that left

0x0307 Say in room

  • Client - Say something in a chatroom
    1. string room - The name of the room to say something in
    2. string line - What you want to say
  • Daemon
    1. string room - The name of the room someone said something in
    2. string user - User that said something
    3. string line - What the user said

0x0308 Room tickers

  • Client - List of tickers set for a room
    • Not Sent
  • Daemon
    1. string room - Which room the tickers are reported for
    2. uint numtickers How many tickers are set
    3. Iterate the range of numtickers
      1. string user - The user that this ticker belongs to
      2. string message - The actual ticker message

0x0309 Set room ticker

  • Client - Set your room ticker / a room ticker was set
    1. string room - The room to set the ticker in
    2. string message - The actual ticker message
  • Daemon
    1. string room - The room a ticker was set in
    2. string user - The user that set the ticker
    3. string message - The actual ticker message

0x0401 Search

  • Client - Start a new search
    1. uint type - Search type (0 = global, 1 = buddies, 2 = room)
    2. string query - What you want to search for
  • Daemon
    1. string query - The query we're delivering a ticket for
    2. uint ticket - The search ticket

0x0402 Search reply

  • Client - Terminate a search, or results delivered by peers
    1. uint ticket - The ticket of the search you wish to terminate
  • Daemon
    1. uint ticket - Ticket the search results are for
    2. string username - User that delivered the results
    3. bool slotfree - Wether the user has a free upload slot
    4. uint avgspeed - User's average speed
    5. uint queuelen - User's queue length
    6. folder results - The actual results

0x0403 User Search

  • Client - Start a new search of only users shares
    1. string user - Who's shares you wish to search
    2. string query - What you want to search for
  • Daemon
    • Not Sent

0x0405 WishList Search

  • Client - Start a new wishlist search
    1. string query - What you want to search for
  • Daemon
    • Not Sent

0x0500 Transfer state

  • Client - Actual state of all transfers
    • Not Sent
  • Daemon
    1. uint numtransfers - Number of transfers
    2. Iterate the range of numtransfers
      1. transfer entry - The transfer entry

0x0501 Transfer update

  • Client - Status update of a transfer
    1. string username - User to update a transfer of
    2. string path - Path of the transfer to update (place in queue)
  • Daemon
    1. transfer entry - The new state of the transfer

0x0502 Transfer remove

  • Client - Remove a transfer from the list
    1. bool upload - Remove upload? (if false, remove download)
    2. string username - User to clear a transfer from
    3. string path - Path of the transfer to clear
  • Daemon
    1. bool upload - Was an upload removed? (if false, download was removed)
    2. string username - User a transfer was removed from
    3. string path - Path of the transfer that was removed

0x0503 Download file

  • Client - Download a file from someone (or retry an existing transfer)
    1. string username - Username to download a file from
    2. string path - Path of the file to download
  • Daemon
    • Not Sent

0x0507 Download file to

  • Client - Download a file to a directory
    1. string username - Username to download a file from
    2. string path - Path of the file to download
    3. string localpath - Path to store the file name
  • Daemon
    • Not Sent

0x0504 Download folder

  • Client - Download a folder recursively
    1. string username - User to download a folder from
    2. string folder - Path to the folder to download
  • Daemon
    • Not Sent

0x0505 Abort transfer

  • Client - Terminate a transfer
    1. bool upload - Abort an upload? (if false, abort download)
    2. string username - User to abort the transfer from
    3. string path - Path of the transfer to abort
  • Daemon
    • Not Sent

0x0506 Upload file

  • Client - Upload a file from your shares to someone
    1. string username - Username to upload a file to
    2. string path - Path of the file in your shares to upload
  • Daemon
    • Not Sent

0x0600 Get Recommendations

  • Client - Refresh Recommendations list
    • Empty Message
  • Daemon
    1. uint numrecommendations - Number of recommendations
    2. Iterate the range of numrecommendations
      1. string recommendation - Name of recommend
      2. uint numrecommendation - Number of users with recommend

0x0601 Get Global Recommendations

  • Client - Refresh Global Recommendations list
    • Empty Message
  • Daemon
    1. uint numrecommendations - Number of recommendations
    2. Iterate the range of numrecommendations
      1. string recommendation - Name of recommend
      2. uint numrecommendation - Number of users with recommend

0x0602 Get Similar Users

  • Client - Refresh Similar Users list
    • Empty Message
  • Daemon
    1. uint numusers - Number of users
    2. Iterate the range of numusers
      1. string users - Name of user
      2. uint numuser - Number of user

0x0603 Get Item Recommendations

  • Client - Refresh Recommendations list that matches item
    1. string item
  • Daemon
    1. string item
    2. uint numrecommendations - Number of recommendations
    3. Iterate the range of numrecommendations
      1. string recommendation - Name of recommend
      2. uint numrecommendation - Number or recommendations for this item

0x0604 Get Item Similar Users

  • Client - Refresh Similar Users that match item
    1. string item
  • Daemon
    1. string item
    2. uint numusers - Number of users
    3. Iterate the range of numusers
      1. string users - Name of user
      2. uint numuser - Number of user

0x0610 Add Liked Interest

Liked Interest added

  • Client
    1. string interest - Name of the Interest to add
  • Daemon
    1. string interest - Name of the Interest added

0x0611 Remove Liked Interest

Interest Removed

  • Client
    1. string interest - Name of the Interest to remove
  • Daemon
    1. string interest - Name of the Interest remove

0x0612 Add Hated Interest

Hated Interest added

  • Client
    1. string interest - Name of the Interest to add
  • Daemon
    1. string interest - Name of the Interest added

0x0613 Remove Hated Interest

Hated Interest removed

  • Client
    1. string interest - Name of the Interest to remove
  • Daemon
    1. string interest - Name of the Interest remove

0x0700 Connect to Server

  • Client - Manually Connect to server
    • Empty Message
  • Daemon
    • Not Sent

0x0701 Disconnect from Server

  • Client - Manually Disconnects from server
    • Empty Message
  • Daemon
    • Not Sent

0x0703 Reload Shares

  • Client - Reload the Shares Databases
    • Empty Message
  • Daemon
    • Not Sent

Login challenge

  • MD5
  • SHA1
  • SHA256

Soulseek weirdness

Last modified 11 years ago Last modified on 24/07/2006 02:18:50