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