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