chiark / gitweb /
Async client bindings for playlist support. Untested.
[disorder] / doc / disorder_protocol.5.in
CommitLineData
460b9539 1.\"
964e027d 2.\" Copyright (C) 2004-2008 Richard Kettlewell
460b9539 3.\"
4.\" This program is free software; you can redistribute it and/or modify
5.\" it under the terms of the GNU General Public License as published by
6.\" the Free Software Foundation; either version 2 of the License, or
7.\" (at your option) any later version.
8.\"
9.\" This program is distributed in the hope that it will be useful, but
10.\" WITHOUT ANY WARRANTY; without even the implied warranty of
11.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12.\" General Public License for more details.
13.\"
14.\" You should have received a copy of the GNU General Public License
15.\" along with this program; if not, write to the Free Software
16.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17.\" USA
18.\"
19.TH disorder_protocol 5
20.SH NAME
21disorder_protocol \- DisOrder communication protocol
22.SH DESCRIPTION
23The DisOrder client and server communicate via the protocol described
24in this man page.
25.PP
c0c23a60
RK
26The protocol is liable to change without notice.
27You are recommended to check the implementation before believing this document.
460b9539 28.SH "GENERAL SYNTAX"
c0c23a60
RK
29Everything is encoded using UTF-8.
30See
f9635e06
RK
31.B "CHARACTER ENCODING"
32below for more detail on character encoding issues.
460b9539 33.PP
f9635e06
RK
34Commands and responses consist of a line perhaps followed (depending on the
35command or response) by a body.
460b9539 36.PP
37The line syntax is the same as described in \fBdisorder_config\fR(5) except
38that comments are prohibited.
39.PP
40Bodies borrow their syntax from RFC821; they consist of zero or more ordinary
41lines, with any initial full stop doubled up, and are terminated by a line
42consisting of a full stop and a line feed.
fc80bbcd
RK
43.PP
44Commands only have a body if explicitly stated below.
45If they do have a body then the body should always be sent immediately;
46unlike (for instance) the SMTP "DATA" command there is no intermediate step
47where the server asks for the body to be sent.
48.PP
49Replies also only have a body if stated below.
50The presence of a reply body can always be inferred from the response code;
51if the last digit is a 3 then a body is present, otherwise it is not.
460b9539 52.SH COMMANDS
53Commands always have a command name as the first field of the line; responses
c0c23a60
RK
54always have a 3-digit response code as the first field.
55See below for more details about this field.
460b9539 56.PP
57All commands require the connection to have been already authenticated unless
c0c23a60
RK
58stated otherwise.
59If not stated otherwise, the \fBread\fR right is sufficient to execute
60the command.
460b9539 61.TP
0f55e905 62.B adduser \fIUSERNAME PASSWORD \fR[\fIRIGHTS\fR]
c0c23a60
RK
63Create a new user with the given username and password.
64The new user's rights list can be specified; if it is not
65then the \fBdefault_rights\fR setting applies instead.
66Requires the \fBadmin\fR right, and only works on local
0f55e905 67connections.
eb5dc014 68.TP
460b9539 69.B allfiles \fIDIRECTORY\fR [\fIREGEXP\fR]
5818980a 70List all the files and directories in \fIDIRECTORY\fR in a response body.
460b9539 71If \fIREGEXP\fR is present only matching files and directories are returned.
72.TP
ba39faf6 73.B confirm \fICONFIRMATION
c0c23a60
RK
74Confirm user registration.
75\fICONFIRMATION\fR is as returned from \fBregister\fR below.
76This command can be used without logging in.
ba39faf6 77.TP
eb5dc014 78.B cookie \fICOOKIE
0d350ff0 79Log a user back in using a cookie created with \fBmake\-cookie\fR.
c0c23a60 80The response contains the username.
eb5dc014
RK
81.TP
82.B deluser \fIUSERNAME
c0c23a60
RK
83Delete the named user.
84Requires the \fBadmin\fR right, and only works on local connections.
460b9539 85.TP
86.B dirs \fIDIRECTORY\fR [\fIREGEXP\fR]
5818980a 87List all the directories in \fIDIRECTORY\fR in a response body.
460b9539 88If \fIREGEXP\fR is present only matching directories are returned.
89.TP
90.B disable \fR[\fBnow\fR]
c0c23a60
RK
91Disable further playing.
92If the optional \fBnow\fR argument is present then the current track
93is stopped.
94Requires the \fBglobal prefs\fR right.
eb5dc014
RK
95.TP
96.B edituser \fIUSERNAME PROPERTY VALUE
c0c23a60
RK
97Set a user property.
98With the \fBadmin\fR right any username and property may be specified.
99Otherwise the \fBuserinfo\fR right is required and only the
eb5dc014 100\fBemail\fR and \fBpassword\fR properties may be set.
0517868c
RK
101.IP
102User properties are syntax-checked before setting. For instance \fBemail\fR
103must contain an "@" sign or you will get an error. (Setting an empty value for
104\fBemail\fR is allowed and removes the property.)
460b9539 105.TP
106.B enable
c0c23a60
RK
107Re-enable further playing, and is the opposite of \fBdisable\fR.
108Requires the \fBglobal prefs\fR right.
460b9539 109.TP
110.B enabled
c0c23a60
RK
111Report whether playing is enabled.
112The second field of the response line will be \fByes\fR or \fBno\fR.
460b9539 113.TP
114.B exists \fITRACK\fR
c0c23a60
RK
115Report whether the named track exists.
116The second field of the response line will be \fByes\fR or \fBno\fR.
460b9539 117.TP
118.B files \fIDIRECTORY\fR [\fIREGEXP\fR]
5818980a 119List all the files in \fIDIRECTORY\fR in a response body.
460b9539 120If \fIREGEXP\fR is present only matching files are returned.
121.TP
122.B get \fITRACK\fR \fIPREF\fR
c0c23a60
RK
123Getsa preference value.
124On success the second field of the response line will have the value.
fb1bc1f5
RK
125.IP
126If the track or preference do not exist then the response code is 555.
460b9539 127.TP
0d350ff0 128.B get\-global \fIKEY\fR
460b9539 129Get a global preference.
fb1bc1f5
RK
130.IP
131If the preference does not exist then the response code is 555.
460b9539 132.TP
133.B length \fITRACK\fR
c0c23a60
RK
134Get the length of the track in seconds.
135On success the second field of the response line will have the value.
460b9539 136.TP
137.B log
c0c23a60
RK
138Send event log messages in a response body.
139The command will never terminate.
140Any further data sent to the server will be discarded (explicitly;
141i.e. it will not accumulate in a buffer somewhere).
460b9539 142.IP
143See \fBEVENT LOG\fR below for more details.
144.TP
0d350ff0 145.B make\-cookie
eb5dc014
RK
146Returns an opaque string that can be used by the \fBcookie\fR command to log
147this user back in on another connection (until the cookie expires).
148.TP
460b9539 149.B move \fITRACK\fR \fIDELTA\fR
c0c23a60
RK
150Move a track in the queue.
151The track may be identified by ID (preferred) or name (which might cause
152confusion if it's there twice).
153\fIDELTA\fR should be an negative or positive integer and indicates how
154many steps towards the head of the queue the track should be moved.
eb5dc014
RK
155.IP
156Requires one of the \fBmove mine\fR, \fBmove random\fR or \fBmove any\fR rights
157depending on how the track came to be added to the queue.
460b9539 158.TP
159.B moveafter \fITARGET\fR \fIID\fR ...
c0c23a60
RK
160Move all the tracks in the \fIID\fR list after ID \fITARGET\fR.
161If \fITARGET\fR is the empty string then the listed tracks are put
162at the head of the queue.
163If \fITARGET\fR is listed in the ID list then the tracks are moved
460b9539 164to just after the first non-listed track before it, or to the head if there is
165no such track.
eb5dc014
RK
166.IP
167Requires one of the \fBmove mine\fR, \fBmove random\fR or \fBmove any\fR rights
168depending on how the tracks came to be added to the queue.
460b9539 169.TP
2a10b70b 170.B new \fR[\fIMAX\fR]
c0c23a60
RK
171Send the most recently added \fIMAX\fR tracks in a response body.
172If the argument is ommitted, the \fBnew_max\fR most recent tracks are
173listed (see \fBdisorder_config\fR(5)).
2a10b70b 174.TP
7858930d 175.B nop
c0c23a60
RK
176Do nothing.
177Used by
7858930d 178.BR disobedience (1)
c0c23a60
RK
179as a keepalive measure.
180This command does not require authentication.
7858930d 181.TP
460b9539 182.B part \fITRACK\fR \fICONTEXT\fI \fIPART\fR
c0c23a60
RK
183Get a track name part.
184Returns an empty string if a name part cannot be constructed.
460b9539 185.IP
186.I CONTEXT
187is one of
188.B sort
189or
190.B display
191and
192.I PART
193is usually one of
194.BR artist ,
195.B album
196or
197.BR title .
198.TP
199.B pause
c0c23a60
RK
200Pause the current track.
201Requires the \fBpause\fR right.
460b9539 202.TP
203.B play \fITRACK\fR
c0c23a60
RK
204Add a track to the queue.
205The response contains the queue ID of the track.
eb5dc014 206Requires the \fBplay\fR right.
460b9539 207.TP
208.B playing
5818980a 209Report what track is playing.
460b9539 210.IP
211If the response is \fB252\fR then the rest of the response line consists of
212track information (see below).
213.IP
214If the response is \fB259\fR then nothing is playing.
215.TP
fc80bbcd
RK
216.B playlist-delete \fIPLAYLIST\fR
217Delete a playlist.
218Requires permission to modify that playlist and the \fBplay\fR right.
219.TP
220.B playlist-get \fIPLAYLIST\fR
221Get the contents of a playlist, in a response body.
222Requires permission to read that playlist and the \fBread\fR right.
223.TP
224.B playlist-get-share \fIPLAYLIST\fR
225Get the sharing status of a playlist.
226The result will be \fBpublic\fR, \fBprivate\fR or \fBshared\fR.
227Requires permission to read that playlist and the \fBread\fR right.
228.TP
229.B playlist-lock \fIPLAYLIST\fR
230Lock a playlist.
231Requires permission to modify that playlist and the \fBplay\fR right.
232Only one playlist may be locked at a time on a given connection and the lock
233automatically expires when the connection is closed.
234.TP
235.B playlist-set \fIPLAYLIST\fR
236Set the contents of a playlist.
237The new contents should be supplied in a command body.
238Requires permission to modify that playlist and the \fBplay\fR right.
239The playlist must be locked.
240.TP
241.B playlist-set-share \fIPLAYLIST\fR \fISHARE\fR
242Set the sharing status of a playlist to
243\fBpublic\fR, \fBprivate\fR or \fBshared\fR.
244Requires permission to modify that playlist and the \fBplay\fR right.
245.TP
246.B playlist-unlock\fR
247Unlock the locked playlist.
248.TP
249.B playlists
250List all playlists that this connection has permission to read.
251Requires the \fBread\fR right.
252.TP
460b9539 253.B prefs \fBTRACK\fR
5818980a 254Send back the preferences for \fITRACK\fR in a response body.
460b9539 255Each line of the response has the usual line syntax, the first field being the
256name of the pref and the second the value.
257.TP
258.B queue
5818980a 259Send back the current queue in a response body, one track to a line, the track
c0c23a60
RK
260at the head of the queue (i.e. next to be be played) first.
261See below for the track information syntax.
460b9539 262.TP
0d350ff0 263.B random\-disable
c0c23a60
RK
264Disable random play (but don't stop the current track).
265Requires the \fBglobal prefs\fR right.
460b9539 266.TP
0d350ff0 267.B random\-enable
c0c23a60
RK
268Enable random play.
269Requires the \fBglobal prefs\fR right.
460b9539 270.TP
0d350ff0 271.B random\-enabled
c0c23a60
RK
272Report whether random play is enabled.
273The second field of the response line will be \fByes\fR or \fBno\fR.
460b9539 274.TP
275.B recent
5818980a 276Send back the current recently-played list in a response body, one track to a
c0c23a60
RK
277line, the track most recently played last.
278See below for the track information syntax.
460b9539 279.TP
280.B reconfigure
c0c23a60
RK
281Request that DisOrder reconfigure itself.
282Requires the \fBadmin\fR right.
460b9539 283.TP
90ad6c6e 284.B register \fIUSERNAME PASSWORD EMAIL
c0c23a60
RK
285Register a new user.
286Requires the \fBregister\fR right.
287The result contains a confirmation string; the user will be be able
288to log in until this has been presented back to the server via the
289\fBconfirm\fR command.
ba39faf6 290.TP
90ad6c6e
RK
291.B reminder \fIUSERNAME\fR
292Send a password reminder to user \fIUSERNAME\fR.
c0c23a60
RK
293If the user has no valid email address, or no password, or a
294reminder has been sent too recently, then no reminder will be sent.
6207d2f3 295.TP
460b9539 296.B remove \fIID\fR
c0c23a60
RK
297Remove the track identified by \fIID\fR.
298Requires one of the \fBremove mine\fR, \fBremove random\fR or
299\fBremove any\fR rights depending on how the
eb5dc014 300track came to be added to the queue.
460b9539 301.TP
dd9af5cb 302.B rescan \fR[\fBwait\fR] \fR[\fBfresh\fR]
c0c23a60
RK
303Rescan all roots for new or obsolete tracks.
304Requires the \fBrescan\fR right.
dd9af5cb
RK
305.IP
306If the \fBwait\fR flag is present then the response is delayed until the rescan
307completes.
308Otherwise the response arrives immediately.
309This is primarily intended for testing.
310.IP
311If the \fBfresh\fR flag is present a rescan is already underway then a second
312rescan will be started when it completes.
313The default behavior is to piggyback on the existing rescan.
314.IP
315NB that \fBfresh\fR is currently disabled in the server source, so using this
316flag will just provoke an error.
460b9539 317.TP
318.B resolve \fITRACK\fR
319Resolve a track name, i.e. if this is an alias then return the real track name.
320.TP
321.B resume
c0c23a60
RK
322Resume the current track after a \fBpause\fR command.
323Requires the \fBpause\fR right.
eb5dc014
RK
324.TP
325.B revoke \fBcookie\fR
0d350ff0 326Revoke a cookie previously created with \fBmake\-cookie\fR.
c0c23a60 327It will not be possible to use this cookie in the future.
460b9539 328.TP
0d350ff0 329.B rtp\-address
5818980a 330Report the RTP broadcast (or multicast) address, in the form \fIADDRESS
c0c23a60
RK
331PORT\fR.
332This command does not require authentication.
ca831831 333.TP
460b9539 334.B scratch \fR[\fIID\fR]
335Remove the track identified by \fIID\fR, or the currently playing track if no
c0c23a60
RK
336\fIID\fR is specified.
337Requires one of the \fBscratch mine\fR, \fBscratch random\fR or
338\fBscratch any\fR rights depending on how the track came to be
eb5dc014 339added to the queue.
460b9539 340.TP
2b33c4cf
RK
341.B schedule-add \fIWHEN\fR \fIPRIORITY\fR \fIACTION\fR ...
342Schedule an event for the future.
343.IP
344.I WHEN
345is the time when it should happen, as \fBtime_t\fR value.
346It must refer to a time in the future.
347.IP
348.I PRIORITY
349is the event priority.
350This can be \fBnormal\fR, in which case the event will be run at startup if its
351time has past, or \fBjunk\fR in which case it will be discarded if it is found
352to be in the past at startup.
353The meaning of other values is not defined.
354.IP
355.I ACTION
356is the action to perform.
357The choice of action determines the meaning of the remaining arguments.
358Possible actions are:
359.RS
360.TP
361.B play
362Play a track.
363The next argument is the track name.
364Requires the \fBplay\fR right.
365.TP
366.B set-global
367Set a global preference.
368The next argument is the preference name and the final argument is the value to
369set it to (omit it to unset it).
370Requires the \fBglobal prefs\fR right.
371.RE
372.IP
373You need the right at the point you create the event.
374It is not possible to create scheduled events in expectation of a future change
375in rights.
376.TP
377.B schedule-del \fIEVENT\fR
378Deletes a scheduled event.
379Users can always delete their own scheduled events; with the \fBadmin\fR
380right you can delete any event.
381.TP
382.B schedule-get \fIEVENT\fR
383Sends the details of scheduled event \fIEVENT\fR in a response body.
384Each line is a pair of strings quoted in the usual way, the first being the key
385ane the second the value.
386No particular order is used.
387.IP
388Scheduled events are considered public information.
389Right \fBread\fR is sufficient to see details of all events.
390.TP
391.B schedule-list
392Sends the event IDs of all scheduled events in a response body, in no
393particular order.
394Use \fBschedule-get\fR to get the details of each event.
395.TP
460b9539 396.B search \fITERMS\fR
c0c23a60
RK
397Search for tracks matching the search terms.
398The results are put in a response body, one to a line.
460b9539 399.IP
400The search string is split in the usual way, with quoting supported, into a
c0c23a60
RK
401list of terms.
402Only tracks matching all terms are included in the results.
460b9539 403.IP
404Any terms of the form \fBtag:\fITAG\fR limits the search to tracks with that
405tag.
406.IP
407All other terms are interpreted as individual words which must be present in
408the track name.
409.IP
410Spaces in terms don't currently make sense, but may one day be interpreted to
411allow searching for phrases.
412.TP
413.B \fBset\fR \fITRACK\fR \fIPREF\fR \fIVALUE\fR
c0c23a60
RK
414Set a preference.
415Requires the \fBprefs\fR right.
460b9539 416.TP
0d350ff0 417.B set\-global \fIKEY\fR \fIVALUE\fR
c0c23a60
RK
418Set a global preference.
419Requires the \fBglobal prefs\fR right.
460b9539 420.TP
421.B stats
422Send server statistics in plain text in a response body.
423.TP
424.B \fBtags\fR
425Send the list of currently known tags in a response body.
426.TP
427.B \fBunset\fR \fITRACK\fR \fIPREF\fR
c0c23a60
RK
428Unset a preference.
429Requires the \fBprefs\fR right.
460b9539 430.TP
0d350ff0 431.B \fBunset\-global\fR \fIKEY\fR
c0c23a60
RK
432Unset a global preference.
433Requires the \fBglobal prefs\fR right.
460b9539 434.TP
90ad6c6e
RK
435.B user \fIUSERNAME\fR \fIRESPONSE\fR
436Authenticate as user \fIUSERNAME\fR.
c0c23a60 437See
5e3f9e08
RK
438.B AUTHENTICATION
439below.
460b9539 440.TP
90ad6c6e 441.B userinfo \fIUSERNAME PROPERTY
3e3566ad
RK
442Get a user property.
443.TP
eb5dc014 444.B users
5818980a 445Send the list of currently known users in a response body.
eb5dc014 446.TP
460b9539 447.B version
448Send back a response with the server version as the second field.
449.TP
450.B volume \fR[\fILEFT\fR [\fIRIGHT\fR]]
451Get or set the volume.
452.IP
453With zero parameters just gets the volume and reports the left and right sides
454as the 2nd and 3rd fields of the response.
455.IP
c0c23a60
RK
456With one parameter sets both sides to the same value.
457With two parameters sets each side independently.
458Setting the volume requires the \fBvolume\fR right.
460b9539 459.SH RESPONSES
c0c23a60
RK
460Responses are three-digit codes.
461The first digit distinguishes errors from succesful responses:
460b9539 462.TP
463.B 2
464Operation succeeded.
465.TP
466.B 5
467Operation failed.
468.PP
469The second digit breaks down the origin of the response:
470.TP
471.B 0
c0c23a60
RK
472Generic responses not specific to the handling of the command.
473Mostly this is parse errors.
460b9539 474.TP
b4a80f69 475.B 1
47651x errors indicate that the user had insufficient rights for the command.
477.TP
460b9539 478.B 3
479Authentication responses.
480.TP
481.B 5
482Responses specific to the handling of the command.
483.PP
484The third digit provides extra information about the response:
485.TP
486.B 0
487Text part is just commentary.
488.TP
489.B 1
490Text part is a constant result e.g. \fBversion\fR.
491.TP
492.B 2
493Text part is a potentially variable result.
494.TP
495.B 3
496Text part is just commentary; a dot-stuffed body follows.
497.TP
498.B 4
c0c23a60
RK
499Text part is just commentary; an indefinite dot-stuffed body follows.
500(Used for \fBlog\fR.)
460b9539 501.TP
fb1bc1f5 502.B 5
c0c23a60
RK
503Used with "normal" errors, for instance a preference not being found.
504The text part is commentary.
fb1bc1f5 505.TP
460b9539 506.B 9
507The text part is just commentary (but would normally be a response for this
508command) e.g. \fBplaying\fR.
7b32e917
RK
509.PP
510Result strings (not bodies) intended for machine parsing (i.e. xx1 and xx2
511responses) are quoted.
460b9539 512.SH AUTHENTICATION
5e3f9e08 513When a connection is made the server sends a \fB231\fR response before any
c0c23a60
RK
514command is received.
515This contains a protocol generation, an algorithm name and a
516challenge encoded in hex, all separated by whitespace.
7b32e917
RK
517.PP
518The current protocol generation is \fB2\fR.
5e3f9e08 519.PP
b3141726 520The possible algorithms are (currently) \fBsha1\fR, \fBsha256\fR, \fBsha384\fR
c0c23a60
RK
521and \fBsha512\fR.
522\fBSHA1\fR etc work as synonyms.
460b9539 523.PP
5e3f9e08
RK
524The \fBuser\fR response consists of the selected hash of the user's password
525concatenated with the challenge, encoded in hex.
460b9539 526.SH "TRACK INFORMATION"
527Track information is encoded in a line (i.e. using the usual line syntax) as
c0c23a60
RK
528pairs of fields.
529The first is a name, the second a value.
530The names have the following meanings:
460b9539 531.TP 12
532.B expected
533The time the track is expected to be played at.
534.TP
535.B id
536A string uniquely identifying this queue entry.
537.TP
538.B played
539The time the track was played at.
540.TP
541.B scratched
542The user that scratched the track.
543.TP
544.B state
c0c23a60
RK
545The current track state.
546Valid states are:
460b9539 547.RS
548.TP 12
549.B failed
550The player failed (exited with nonzero status but wasn't scratched).
551.TP
552.B isscratch
553The track is actually a scratch.
554.TP
555.B no_player
556No player could be found for the track.
557.TP
558.B ok
559The track was played without any problems.
560.TP
561.B scratched
562The track was scratched.
563.TP
564.B started
565The track is currently playing.
566.TP
567.B unplayed
568In the queue, hasn't been played yet.
569.TP
570.B quitting
571The track was terminated because the server is shutting down.
572.RE
573.TP
574.B submitter
575The user that submitted the track.
576.TP
577.B track
578The filename of the track.
579.TP
580.B when
581The time the track was added to the queue.
582.TP
583.B wstat
584The wait status of the player in decimal.
585.SH NOTES
586Times are decimal integers using the server's \fBtime_t\fR.
587.PP
588For file listings, the regexp applies to the basename of the returned file, not
c0c23a60
RK
589the whole filename, and letter case is ignored.
590\fBpcrepattern\fR(3) describes the regexp syntax.
460b9539 591.PP
592Filenames are in UTF-8 even if the collection they come from uses some other
593encoding - if you want to access the real file (in such cases as the filenames
594actually correspond to a real file) you'll have to convert to whatever the
595right encoding is.
596.SH "EVENT LOG"
597The event log consists of lines starting with a hexadecimal timestamp and a
c0c23a60
RK
598keyword followed by (optionally) parameters.
599The parameters are quoted in the usual DisOrder way.
600Currently the following keywords are used:
460b9539 601.TP
602.B completed \fITRACK\fR
603Completed playing \fITRACK\fR
604.TP
605.B failed \fITRACK\fR \fIERROR\fR
606Completed playing \fITRACK\fR with an error status
607.TP
90ad6c6e
RK
608.B moved \fIUSERNAME\fR
609User \fIUSERNAME\fR moved some track(s).
c0c23a60 610Further details aren't included any more.
460b9539 611.TP
90ad6c6e 612.B playing \fITRACK\fR [\fIUSERNAME\fR]
460b9539 613Started playing \fITRACK\fR.
614.TP
615.B queue \fIQUEUE-ENTRY\fR...
616Added \fITRACK\fR to the queue.
617.TP
618.B recent_added \fIQUEUE-ENTRY\fR...
619Added \fIID\fR to the recently played list.
620.TP
621.B recent_removed \fIID\fR
622Removed \fIID\fR from the recently played list.
623.TP
90ad6c6e 624.B removed \fIID\fR [\fIUSERNAME\fR]
c0c23a60 625Queue entry \fIID\fR was removed.
90ad6c6e 626This is used both for explicit removal (when \fIUSERNAME\fR is present)
c0c23a60 627and when playing a track (when it is absent).
460b9539 628.TP
e025abff
RK
629.B rescanned
630A rescan completed.
631.TP
90ad6c6e
RK
632.B scratched \fITRACK\fR \fIUSERNAME\fR
633\fITRACK\fR was scratched by \fIUSERNAME\fR.
460b9539 634.TP
635.B state \fIKEYWORD\fR
c0c23a60
RK
636Some state change occurred.
637The current set of keywords is:
460b9539 638.RS
639.TP
5abe307a
RK
640.B completed
641The current track completed successfully.
642.TP
460b9539 643.B disable_play
644Playing was disabled.
645.TP
646.B disable_random
647Random play was disabled.
648.TP
649.B enable_play
650Playing was enabled.
651.TP
652.B enable_random
653Random play was enabled.
654.TP
5abe307a
RK
655.B failed
656The current track failed.
657.TP
460b9539 658.B pause
659The current track was paused.
660.TP
5abe307a
RK
661.B playing
662A track started playing.
663.TP
460b9539 664.B resume
665The current track was resumed.
5abe307a 666.TP
75e7b7c3 667.B rights_changed \fIRIGHTS\fR
ad492e00
RK
668User's rights were changed.
669.TP
5abe307a
RK
670.B scratched
671The current track was scratched.
672.PP
673To simplify client implementation, \fBstate\fR commands reflecting the current
674state are sent at the start of the log.
460b9539 675.RE
58d2aad2 676.TB
75e7b7c3 677.B user_add \fIUSERNAME\fR
58d2aad2
RK
678A user was created.
679.TP
75e7b7c3 680.B user_delete \fIUSERNAME\fR
58d2aad2
RK
681A user was deleted.
682.TP
75e7b7c3 683.B user_edit \fIUSERNAME\fR \fIPROPERTY\fR
58d2aad2
RK
684Some property of a user was edited.
685.TP
75e7b7c3 686.B user_confirm \fIUSERNAME\fR
58d2aad2 687A user's login was confirmed (via the web interface).
460b9539 688.TP
689.B volume \fILEFT\fR \fIRIGHT\fR
690The volume changed.
691.PP
692.IR QUEUE-ENTRY ...
693is as defined in
694.B "TRACK INFORMATION"
695above.
58d2aad2
RK
696.PP
697The \fBuser-*\fR messages are only sent to admin users, and are not sent over
698non-local connections unless \fBremote_userman\fR is enabled.
f9635e06 699.SH "CHARACTER ENCODING"
c0c23a60
RK
700All data sent by both server and client is encoded using UTF-8.
701Moreover it must be valid UTF-8, i.e. non-minimal sequences are not
702permitted, nor are surrogates, nor are code points outside the
703Unicode code space.
f9635e06
RK
704.PP
705There are no particular normalization requirements on either side of the
c0c23a60
RK
706protocol.
707The server currently converts internally to NFC, the client must
f9635e06
RK
708normalize the responses returned if it needs some normalized form for further
709processing.
710.PP
711The various characters which divide up lines may not be followed by combining
c0c23a60
RK
712characters.
713For instance all of the following are prohibited:
f9635e06
RK
714.TP
715.B o
c0c23a60
RK
716LINE FEED followed by a combining character.
717For example the sequence LINE FEED, COMBINING GRAVE ACCENT is never permitted.
f9635e06
RK
718.TP
719.B o
720APOSTROPHE or QUOTATION MARK followed by a combining character when used to
c0c23a60
RK
721delimit fields.
722For instance a line starting APOSTROPHE, COMBINING CEDILLA is prohibited.
f9635e06
RK
723.IP
724Note that such sequences are not prohibited when the quote character cannot be
c0c23a60
RK
725interpreted as a field delimiter.
726For instance APOSTROPHE, REVERSE SOLIDUS, APOSTROPHE, COMBINING CEDILLA,
727APOSTROPHE would be permitted.
f9635e06
RK
728.TP
729.B o
730REVERSE SOLIDUS (BACKSLASH) followed by a combining character in a quoted
c0c23a60
RK
731string when it is the first character of an escape sequence.
732For instance a line starting APOSTROPHE, REVERSE SOLIDUS, COMBINING TILDE
733is prohibited.
f9635e06
RK
734.IP
735As above such sequences are not prohibited when the character is not being used
c0c23a60
RK
736to start an escape sequence.
737For instance APOSTROPHE, REVERSE SOLIDUS, REVERSE SOLIDS, COMBINING TILDE,
738APOSTROPHE is permitted.
f9635e06
RK
739.TP
740.B o
741Any of the field-splitting whitespace characters followed by a combining
c0c23a60
RK
742character when not part of a quoted field.
743For instance a line starting COLON, SPACE, COMBINING CANDRABINDU is prohibited.
f9635e06
RK
744.IP
745As above non-delimiter uses are fine.
746.TP
747.B o
748The FULL STOP characters used to quote or delimit a body.
749.PP
750Furthermore none of these characters are permitted to appear in the context of
751a canonical decomposition (i.e. they must still be present when converted to
c0c23a60
RK
752NFC).
753In practice however this is not an issue in Unicode 5.0.
f9635e06
RK
754.PP
755These rules are consistent with the observation that the split() function is
c0c23a60
RK
756essentially a naive ASCII parser.
757The implication is not that these sequences never actually appear in
758the protocol, merely that the server is not required to honor them in
759any useful way nor be consistent between versions: in current
f9635e06
RK
760versions the result will be lines and fields that start with combining
761characters and are not necessarily split where you expect, but future versions
762may remove them, reject them or ignore some or all of the delimiters that have
763following combining characters, and no notice will be given of any change.
460b9539 764.SH "SEE ALSO"
765\fBdisorder\fR(1),
766\fBtime\fR(2),
767\fBdisorder\fR(3),
768\fBpcrepattern\fR(3)
769\fBdisorder_config\fR(5),
770\fBdisorderd\fR(8),
771\fButf8\fR(7)
772.\" Local Variables:
773.\" mode:nroff
774.\" fill-column:79
775.\" End: