$Search
Syntax
Active user
$Search <ip>:<port> <searchstring>
Passive user
$Search Hub:<requestornick> <searchstring>
Description
This command is used to initiate a search. The format used differs based on whether the client is in active mode or passive mode.
Active User Request:
- <ip> is this client's own IP address.
- <port> is a UDP port on which the client is listening for responses.
Passive User Request:
- <requestornick> is the Nick of the Passive User doing the Search.
<searchstring> is a string describing the file the client is searching for. It is made up of a question mark ('?') delimited string as follows:
<sizerestricted>?<ismaxsize>?<size>?<datatype>?<searchpattern>
- <sizerestricted> is 'T' if the search should be restricted to files of a minimum or maximum size, otherwise 'F'.
- <ismaxsize> is 'F' if <sizerestricted> is 'F' or if the size restriction places an lower limit on file size, otherwise 'T'.
- <size> is the minimum or maximum size of the file to report (according to <ismaxsize>) if <sizerestricted> is 'T', otherwise 0.
- <datatype> restricts the search to files of a particular type. It is an integer selected from:
- 1 for any file type
- 2 for audio files ("mp3", "mp2", "wav", "au", "rm", "mid", "sm")
- 3 for compressed files ("zip", "arj", "rar", "lzh", "gz", "z", "arc", "pak")
- 4 for documents ("doc", "txt", "wri", "pdf", "ps", "tex")
- 5 for executables ("pm", "exe", "bat", "com")
- 6 for pictures ("gif", "jpg", "jpeg", "bmp", "pcx", "png", "wmf", "psd")
- 7 for video ("mpg", "mpeg", "avi", "asf", "mov")
- 8 for folders
- 9 for TTHSearch
- <searchpattern> is used by other users to determine if any files match.
- if is TTHSearch then <searchpattern> is TTH:_base32_representation_of_file_tth_
- Behavior of DC++:
- Spaces are replaced by '$'.
- As with all NMDC messages, '$' and '|' are escaped with "$" and "|", with '&' being further replaced with "&"
The server must forward this message unmodified to all the other users. Every other user with one or more matching files must send a UDP packet to <ip>:<port> for Active requests or a reply to the Hub for Passive requests.
See the $SR command for details of response format.
Examples
$Search 64.78.55.32:412 T?T?500000?1?Gentoo$2005 $Search Hub:SomeNick T?T?500000?1?Gentoo$2005
$Search 17.12.85.3:3746 F?T?0?9?TTH:TO32WPD6AQE7VA7654HEAM5GKFQGIL7F2BEKFNA $Search Hub:SomeNick F?T?0?9?TTH:TO32WPD6AQE7VA7654HEAM5GKFQGIL7F2BEKFNA
