-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformats2.txt
3128 lines (2700 loc) · 125 KB
/
formats2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
A description of the easily parsable ICC output formats
Original Authors
Herbert Enderton
Daniel Sleator
Copyright (C) 1996-2010 Internet Chess Club
Note: This description of ICC's formats, and the formats themselves are
copyrighted by the Internet Chess Club. The information in this
document is only for use by people writing software that uses these
formats while connected to ICC. If you were intending to make some
other use of this information, then read no further and delete this
document now.
1. Introduction.
We have introduced a new format for data to be presented by the ICC.
The purposes of the new format are:
(1) To give capabilities to clients and robots that they would not
otherwise have.
(2) To make it easier for client and robot writers to process the ICC
output.
(3) To obviate the need for clients and robots to depend on specific
wordings of messages (intended for humans).
The design of the new format is flexible. It will allow us to continue
to add to it without disturbing existing clients at all. It will allow
each client or robot to choose exactly which of the options it wants.
The behavior of the chess server currently has (and will always have)
the following properties:
The server receives data from the clients as a sequence of lines, each
of which is one "command".
The server orders the commands for execution (in the order in which
the commands are received). It fully completes each command before
starting the next one.
Each command causes some data to be sent to various players. A
response is always generated to the issuer of a command.
The data generated in response to a command that is sent to a
particular player is called a "unit".
(It's also possible for the server itself to generate messages to
players; e.g., the response to a ping.)
Here is some terminology for the formats under discussion.
Level 0: This is what the server generates by default.
Level 1: This is the same as level 0, (not counting the prompt, which
will not be generated) but the start and end of each unit is
clearly delimited, and also labeled with the "command number"
of the command generating it, and the player generating
it. (the player who issued that command).
Level 2: The information has been reformatted for ease of parsing by
client. A unit in this format is called a "DG". (We used
to call it a "datagram" but that term has a completely unrelated
technical meaning to network programmers.)
Level 1 can be turned on, which suppresses the ICC prompt, and
introduces bracketing of units of output from the ICC. The purpose of
level1 was simply to group the existing ICC output into discrete units
according to the command and player that generated it. Independently
level2 is controlled by around 150 binary variables, each of which controls
the generating of a special DG of the given type, corresponding to
the occurrence of some event.
Level1 makes it easy for a client to know when the output of a command
has ended, what the command was, and who issued it. Certain other types
of information (not generated by a command) are also easily identified
in level1, such as the list of events of the week, and list of news
items one gets when one logs in.
Level2 makes some of the following things possible (and easy):
* Maintaining a list of all logged in players and their ratings.
* Maintaining a list of all current games.
* Maintaining a list of everybody watching my game.
* Processing of match requests
* move lists for my game, or a game I'm observing.
2. Turning it on.
To turn on level1 style output, you can issue the command
set level1 1
Well, actually it has gotten more complex than that, because we hacked
in meanings to the 2's 4's and 8's bits. I.e., the level1 ICC variable takes
values 0-15. If it's odd, that enables the level1 groupings described
below. If (level1 & 2), that tells the server to send
"\031<" (control-Y <) to the user when starting to interpret his or
her command, and "\031>" upon completing that command (unless the
command was something like "exit"). The (level1 & 4) and (level1 & 8)
features are described below.
For each level 2 data type there is a corresponding binary variable that
the user can set. The command to set it is:
set-2 23 1
Which will set level-2 variable 23 to a value of 1. Another way
for a robot or a client to set these variables is to do it on the
"login:" line. If a string like "level1=1" is entered at "login:" then
level1 is turned on. The ICC then goes back to waiting for your name.
Similarly, at the login prompt you can write:
level2settings=10010101010101000101011110101001001101001100
where the string to the right of the equal sign is a sequence of bits.
The leftmost bit becomes your level2setting[0], and so forth.
There are some level-2 units (noted as "verbose" in the descriptions below)
which are expensive to turn on, in the sense that turning them on results in
the sending of lots of data. Turning them all on at once can cause
a buffer overflow and lost data (see appendix 3), so those should be turned
on individually with set-2 commands, and only when the user takes some action
(such as asking for a player list), because of the lag that will ensue.
3. Level 1.
When you have level1 1, all output to you is bracketed by a header line
(starting with "^Y[" (control Y followed by "[") and detailed below) and
an ending with "^Y]". These bracketings can be nested up to at most 3
levels currently (eventually it may go higher).
The header lines have the following form:
<start-char><command-number> <player-name>
where <start-char> is "^Y[", <command-number> is a number corresponding
to the command that resulted in the output (see Appendix 1 below), and
<player-name> is the name of the player issuing that command, or * if it
was you. In a couple of special cases <player-name> might be "$server$"
or "$LoggingIn$" or some such.
With level1 1, you do not get prompts. (Not the normal prompt,
anyway; you still see prompts like "password:", but that's not really
a prompt in the same sense "aics%" is; it's really the output of the
login command). How will the client know when it has gotten all the
output for the user's command? First of all the client should be
keeping track of the nesting depth of the level1 brackets. Secondly,
the output to a user's command will begin with a header line of
the form "^Y[ command-number *", and end with "^Y]". So when the
client sees the ^Y] that corresponds to a top-level level1 header
containing a *, that's the end of the output for that command.
Or you could set level1=3 (or 2) and go by the ^Y< and ^Y> delimiters.
Note that ALL output that results from your (or somebody else's)
execution of a command will be put within the brackets. E.g. there may
well be stuff inside a CN_TELL bracketing besides the message; send
yourself a message for an example.
Example of nesting: Fishbait, an admin, has tell=0 when he types "spoof
guest53 partner fishbait". guest53, if he has formatllevel 1, sees
something like this:
^Y[328 fishbait
fishbait spoofs you: "partner fishbait"
^Y[199 *
Sending a 'tell' message to inform your chosen partner...
^Y[101 *
Not sent -- fishbait does not get messages from unregistered players.
^Y]^Y]^Y]
There are very few commands which spawn off other commands in this way.
Actually, we will probably do away with level1 nesting, because it just
seems to get in the way.
See Appendix 1 for a current list of command numbers, taken verbatim
from config.h. More command numbers will be added over time, and some
of these command numbers will fall into disuse, but we don't intend to
change any of the bindings outright.
A few explanations about some of the command codes and associated symbols:
The distinction between SCN and CN commands is only meaningful if you
look at the server code. Don't worry about it. E.g. SCN_BAD is the
code for output like "You can say 'abort' while playing" or "No such
command", while CN_BAD is for commands such as "shutdow" that always
produce the same boring error messages. Not an important distinction,
I wouldn't think.
If you have gin=1, you'll get a message when somebody starts a game, but
the command number will depend on the command they use to start it
(e.g. match or accept). There are a few other similar cases, where the
command number depends on the command typed rather than the type of action
that results. On the other hand some commands use the same command
codes, such as "refresh" and "prefresh". Then there's "tell", which uses
a different command number for channel tells and personal tells. Some of
these choices were arbitrary.
CN_FOLLOW0 is for follow with no arguments. Similarly CN_OBSERVE0 etc.
'tell' messages are further broken down as CN_TELL, CN_CHANNELTELL,
CN_QTELL, and CN_CHANNELQTELL. Oh also CN_PTELL.
The info shown when you join the server, if you've entered level1 before
before entering your login name, is bracketed by category, more or less.
Thus the event list is bracketed with an SCN_EVENTS header and so forth,
with all of it nested within an SCN_REALLY_LOG_IN header. Try it.
I'm not too sure about all the funny cases that can come up, e.g. if you
start registering at the login prompt, or the server is full so you're
forced to quit. Logout info is similarly grouped.
When a user disconnects the server sends one extra ^Y] at the end of
all other output, if that user has level1 on.
Level 1 is not really needed (e.g. Blitzin 1.72 doesn't use it), but it was
handy when we didn't have Level 2 developed. Blitzin 2.34 uses level1=15.
It ignores the command number; it just needs level1 to know which output
is due to the user's own commands and which window to send it to.
New as of September 1998: If (level1 & 5) and you send a command to the
server prefixed with <backquote><arbitrary-word><backquote>
(e.g. `asdf`history) the arbitrary-word will be echoed
back to you as follows
^Y[<command-number> <player-name-field> <arbitrary-word>\n<text-data>^Y]
Since the arbitrary string only occurs when you use the
backquotes, the player-name field will always be * (yourself),
except maybe for ping responses in which case it will be $server$.
(But please don't freak out if in the future it is something else.)
Arbitrary-word can be up to 99 characters and may not contain
whitespace. Blitzin2 uses this to guide response output to the
window where the command was entered.
And if (level1 & 8), the level1 header will just have * or % in place of
the command issuer's name, depending on whether it was you sending the
command or someone else. (Plus maybe $server$ for ping responses.)
When level 1 units get nested, only the outermost unit echoes the
arbitrary string. Note also that level 2 DGs are (almost always)
bracketed inside level 1 units (if they're both turned on), so with some
clever parsing, you can associate the arbitrary string with level 2 DGs.
4. Level 2.
Every level 2 DG looks like:
A "^Y(" followed by a decimal number which is the level 2 data type
number, followed by a series of blank separated arguments. Followed
by a "^Y)".
In general, setting a specific level-2 variable to 1 turns on messages
of that type. Some of them have other effects, like causing a list to
be generated. (E.g. if you turn on DG_GAME_STARTED with "set-2 12 1"
you'll effectively get a list of the current games, one DG per
game. If your level2setting[12] was already 1, you'll get the list anyway,
even though you should have known it already.)
The client should not break if a DG has more fields than it
expects. It should just ignore any fields after the last one that it
expects to find. This allows us to add more information to DGs
without breaking existing clients. (Another and more common way for us
to do this is for us to add a new DG type.)
The following will be adhered to: You will ONLY get DGs of the
type that you've requested. This means that there may be more than one
type of DGs that are EXACTLY the same except for the number.
It's also possible to set up level-2 variable assignments that don't
make any sense. For example, asking for the moves of games I'm
observing while not asking for notification of which games I'm
observing. (But we give you the DGs you ask for; if they make
sense to you, great.)
Below are the level-2 DG types.
Notes:
The "form" shows some things in parentheses. This omits the ^Y
and the DG number.
The titles are a string, such as {GM TD}. Titles currently include:
(GM) grandmaster
(IM) international master
(FM) FIDE master
(WGM) woman grandmaster
(WIM) woman international master
(WFM) woman FIDE master
(TD) tournament director
(C) computer
(U) unregistered
(*) administrator
(DM) display master (daroo master)
(H) helper
A few of the items below are merely variables with no corresponding
DG -- instead, they just control the information included in other
DGs.
The delimiters "^Y{" and "^Y}" and "{" and "}" are used to quote
strings. This allows a string to contain any sequence of printable
characters. (Strings quoted by "{" and "}" will not contain
curly braces.)
Number meaning
0 DG_WHO_AM_I
Form: (myname titles)
This is sent right after I login. It tells the client
what my name is. This is needed because level 2 DGs do
not use a "*" for my name (to avoid having to generate
different messages for everybody) and because if I login with
"g" the client needs to be told what my name is.
---------------PLAYER SETS-------------------
Use the following DG types if you want to maintain a list of
current players. The player info items such as DG_BULLET can be
used only in conjunction with DG_PLAYER_ARRIVED.
These DGs are considered verbose; they don't scale up
well, resulting in too much data sent to the user when there
are 1000+ people logged on. We no longer support these except
for specially designated accounts such as Tomato.
Here is the list of verbose DGs:
DG_PLAYER_ARRIVED DG_PLAYER_LEFT
DG_GAME_STARTED DG_GAME_RESULT DG_EXAMINED_GAME_IS_GONE
DG_PEOPLE_IN_MY_CHANNEL DG_CHANNELS_SHARED DG_SEES_SHOUTS
Currently, only TDs like Tomato can use these.
As of the next boot after 12-Jan-2003, the following DGs are not shown if to you
if you have tell=0 and the guy is a guest (just to save bandwidth to Tomato):
DG_PLAYER_ARRIVED
DG_GAME_STARTED
1 DG_PLAYER_ARRIVED
This indicates that the client wants to maintain the set of
logged in players. Whenever a player connects a
DG_PLAYER_ARRIVED DG is generated of the following form:
(playername <ratings> <open> <state>)
The <ratings> info depends on the setting of these level-2
variables described below: DG_BULLET, DG_BLITZ, DG_STANDARD, DG_WILD,
DG_BUGHOUSE, DG_LOSERS, DG_CRAZYHOUSE, DG_FIVEMINUTE, DG_ONEMINUTE,
DG_CORRESPONDENCE_RATING, DG_FIFTEENMINUTE, DG_THREEMINUTE,
DG_FORTYFIVEMINUTE, DG_CHESS960. A rating will be sent for each
rating datagram that has been turned on. Ratings are sent in
pairs of numbers, first the rating and then the annotation, as
described in DG_BULLET. The ratings will be sent in DG order,
as listed above. Turn on modifier variables (e.g. DG_BULLET)
before turning on this one.
The <open> info is a single number, as described in DG_OPEN.
The <state> info is a pair of fields (state plus game number), as
described in DG_STATE.
When this DG is turned on (with set-2 or during login),
a raw list of DGs of this type is sent to me for all the
current players. Note that when the server is crowded this can
be a lot of data, so it is not recommended that this happen
without the user expressly requesting it.
2 DG_PLAYER_LEFT
A player disconnected.
Form: (playername)
3 DG_BULLET
"bullet" rating.
The form of every rating is the following:
(playername rating annotation)
The rating is a decimal number. The annotation is 0
if the player has no rating in that category,
1 for a provisional rating, 2 for an established rating.
Shouldn't get rating DGs for unregs. However this
information will be included in the DG_PLAYER_ARRIVED type
DG (just as a "0 0" for each rating selected).
When level2setting[DG_BULLET]=1 and level2setting[DG_PLAYER_ARRIVED]=1,
I get a rating DG any time someone's rating changes (i.e. when
their game ends), and a dg_player_arrived message instead when I or
he connect. If level2setting[DG_PLAYER_ARRIVED]=1, and I do a
set-2 to enable DG_BULLET ratings, I get a list of bullet rating
messages. No rating DG messages are sent unless DG_PLAYER_ARRIVED
is also enabled.
4 DG_BLITZ
"blitz" rating. (See DG_BULLET.)
5 DG_STANDARD
"standard" rating. (See DG_BULLET.)
6 DG_WILD
"wild" rating. (See DG_BULLET.)
7 DG_BUGHOUSE
"bughouse" rating. (See DG_BULLET.)
88 DG_LOSERS
"loser's" chess rating. (See DG_BULLET.)
121 DG_CRAZYHOUSE
"crazyhouse" rating. (See DG_BULLET.)
125 DG_FIVEMINUTE
"5-minute" rating. (See DG_BULLET.)
126 DG_ONEMINUTE
"1-minute" rating. (See DG_BULLET.)
140 DG_CORRESPONDENCE_RATING
"correspondence" rating. (See DG_BULLET.)
145 DG_FIFTEENMINUTE
"15-minute" rating. (See DG_BULLET.)
149 DG_THREEMINUTE
"3-minute" rating. (See DG_BULLET.)
150 DG_FORTYFIVEMINUTE
"45 45 pool" rating. (See DG_BULLET.)
151 DG_CHESS960
"Fisher random pool" 3 1 rating. (See DG_BULLET.)
Special note about DG_TIMESTAMP, DG_TITLES, DG_OPEN, and DG_STATE:
Like the update messages above, these are only sent if you also
have DG_PLAYER_ARRIVED enabled. This test was inadvertently
omitted prior to Sept 1997.
(Possibly they should be sent if you have DG_NOTIFY_ARRIVED too,
but for now, they're not.)
8 DG_TIMESTAMP
form: (playername timestamp-client-number)
Timestamp Client information of this player:
Actually these are never sent; they only appear
as part of a player-arrived DG.
9 DG_TITLES
form: (playername titles)
Title DGs are rarely sent (only when somebody's titles
change; most commonly, when an admin turns their "*" on or off).
Again, these player-info DGs are only sent when
DG_PLAYER_ARRIVED messages are also enabled.
10 DG_OPEN
0 or 1
11 DG_STATE
form: (playername P 23)
State information (including game number)
P=playing
E=examining
S=playing simul
X=none of the above
indicates that this player is now playing game 23.
If the state is X, then a game number of 0 is used.
We haven't decided what the game number should be for someone
giving a simul. It might be garbage for now, and/or a list
of games in the future.
55 DG_PLAYER_ARRIVED_SIMPLE
(name)
This would be equivalent to having DG_PLAYER_ARRIVED without any
the companion items enabled, except for one thing: when DG_PLAYER_ARRIVED
is disabled during bandwidth emergencies, this one stays active.
---------------GAME LIST-----------------
If you want to maintain a list of games in progress, use the following
three DG types. It only makes sense to use all or none of them.
These DGs are considered verbose; they don't scale up
well, resulting in too much data sent to the user when there
are 1000+ people logged on. We no longer support these except
for specially designated accounts such as Tomato.
12 DG_GAME_STARTED
Form: (gamenumber whitename blackname wild-number rating-type rated
white-initial white-increment black-initial black-increment
played-game {ex-string} white-rating black-rating game-id
white-titles black-titles irregular-legality irregular-semantics
uses-plunkers fancy-timecontrol promote-to-king)
Indicate to me the start of games. (Or it may have started
a while ago and I just logged in.)
When this feature is activated, I get a list of all the games.
It includes both regular and examined games. The list may
take a while to transmit.
whitename and blackname may contain punctuation, and while they currently
have no spaces and are 15 characters or less, don't count on that.
rating-type is a string such as "Blitz".
rated is 1 or 0.
white-initial and black-initial are in minutes.
white-increment and black-increment are in seconds.
played-game is 1 for real games and 0 for examined games.
ex-string might be "Ex: continuation", and is at most 30 characters.
white-rating and black-rating are the player's relevant ratings at
game start, and are 0 for unrated players.
game-id is a number that can be used to specify a stored game, e.g. with
"sposition #902425349". So far, it's close to the Unix time of the
game start, but that will no longer be true when we surpass 84000 games/day.
irregular-legality is 0 normally, 1 if there are legal moves that wouldn't
be legal in chess (i.e., turn off client-side legal move checking unless
the client is familiar with this wild type)
irregular-semantics is 0 normally, 1 for atomic chess and other variants
where you can't update the board based on the last move by usual rules.
(see also DG_SET_BOARD)
uses-plunkers is 0 normally, 1 for bughouse and similar variants.
fancy-timecontrol if non-null specifies a time control that supercedes the
white-initial white-increment black-initial black-increment fields.
The format is as in PGN, although we might extend that to allow Bronstein delays,
time odds, and other strange situations.
and to improve readability.
Examples you might actually see:
40/7200:20/3600 (2 hours, plus an hour after 40th, 60th move, 80th move...)
40/5400+30:900+30 (90 minutes, plus 15 minutes after 40th move, plus 30 second increment throughout)
? (unknown -- best not to display clocks)
- (untimed -- best not to display clocks)
Ideas for extending it:
40/2h:20/1h (h for hour, m for minute, s for second (default))
G/25m (a G/ or SD/ means for the rest of the game)
5m+d3 (Bronstein delay)
30+d0.2 (1/5th second delay)
0+d10 (simply you have 10 seconds for each move)
*60s (hourglass)
? (unknown)
untimed
5m+10 vs 6m+10
correspondence 10/30days (clocks in 60ths of a day and tick upward)
G/2h:25/10m byo-yomi (for the game of Go ... okay never mind)
promote-to-king is 0 normally, 1 if it may sometimes be legal to promote a pawn to a king.
13 DG_GAME_RESULT
Form: (gamenumber become-examined game_result_code score_string2 description-string ECO)
This is sent when a played game ends.
The "become-examined" bit is 1 if the game becomes an
examined game. If it is zero, then the game is gone.
This may also be sent when you look at a game which isn't currently
being played; i.e., with sposition, or when you refresh or begin to
observe an examined game.
There are three outcome codes, given in the following order:
(1) game_result, e.g. "Mat" (the 3-letter codes used in game lists)
(2) score_string2, "0-1", "1-0", "1/2-1/2", "*", or "aborted"
(3) description_string, e.g. "White checkmated"
The ECO field is new as of November 2001. It may be "?" in many
cases (maybe all cases) especially if it turns out that computing
this is expensive, but we'll try it for now.
14 DG_EXAMINED_GAME_IS_GONE
Form: (gamenumber)
The last step of the life cycle of a game.
Only generated for examined games.
---------------MY GAMES-----------------
The following variables are used if you want to maintain more detailed
information about "your" games, namely, the ones that you're playing,
examining, or observing. We start with the most basic ones, which just
let me identify the games that are "mine" and some basic information
about them. The first three of these are identical to the three above.
There is never any reason to use both.
The server is supposed to send out the game-started DGs
prior to the other detailed information (move lists etc). That
way clients know upon receiving a DG_MY_GAME_STARTED or
DG_STARTED_OBSERVING to create a game record and note the
players' names, time controls etc, and then have a place to
put other data as it comes in. The simplest way for the client
to know when it is safe to destroy that game record is probably
to watch for DG_MY_RELATION_TO_GAME messages with symbol "X".
15 DG_MY_GAME_STARTED
This generates a DG that's exactly like
DG_GAME_STARTED. Except that I know it's my game, and that
I just started playing or examining. (If they're both
turned on, then redundant messages are generated, but there's
no need for them both to be on.)
16 DG_MY_GAME_RESULT
Same as DG_GAME_RESULT. Generated for any game I'm playing,
examining or observing.
17 DG_MY_GAME_ENDED
Same as DG_EXAMINED_GAME_IS_GONE. I might be examining or
observing the game, but note that I only get this when
an examined game ends -- for played games ending, I get
DG_MY_GAME_RESULT instead.
18 DG_STARTED_OBSERVING
This is exactly the same as DG_MY_GAME_STARTED, but I'm
an observer of the game, not a player or examiner.
19 DG_STOP_OBSERVING
Form: (gamenumber)
I just stopped observing a game. This is not sent if the game
I'm watching ends, only if I stop watching it while it still
exists. [This DG is probably not needed, given that you
have DG_MY_RELATION_TO_GAME.]
40 DG_ISOLATED_BOARD
This is the same as DG_STARTED_OBSERVING (and DG_GAME_STARTED etc),
but I'm not observing the game, I just asked for an isolated
peek (with "refresh <game>" or "prefresh"). The commands sposition
and smoves can also generated one of these, in which case the
gamenumber will be -1.
20 DG_PLAYERS_IN_MY_GAME
To keep track of who is observing the games I'm
observing (or playing or examining).
If this is set then when I start observing (or playing or
examining) a game, I get a sequence of messages like:
(gamenumber playername symbol kibvalue)
The symbol indicates if this player is observing, playing,
or examining the game.
O=observing
PW=playing white
PB=playing black
SW=playing simul and is white
SB=playing simul and is black
E=Examining
X=None (has left the table)
Note that the above are pair-wise mutually exclusive.
The kibvalue indicates whether or not this player hears
kibitzes or whispers.
A player giving a simul might show up as PW when "at the board"
and SW the rest of the time.
21 DG_OFFERS_IN_MY_GAME
Form: (gamenumber wdraw bdraw wadjourn badjourn wabort babort wtakeback btakeback)
Display of offers.
The first 6 of these (after gamenumber) are bits. The last 2
indicate the number of moves requested to be taken back.
[Any move resets opponent's offers. Currently an offer DG
is NOT sent in this case. Turning on the DG does not squelch the
text message.]
22 DG_TAKEBACK
Form: (gamenumber takeback-count)
A takeback occurred in the game that I'm observing or playing.
23 DG_BACKWARD
Form: (gamenumber backup-count)
A player backed up in an examined game.
Also generated by the "revert" command.
The following four variables control the format of the DG_SEND_MOVES and
DG_MOVE_LIST DGs. These four are just variables and have no
corresponding DGs, just entries in the DG_SEND_MOVES and DG_MOVE_LIST
DGs. See also DG_IS_VARIATION.
33 DG_MOVE_ALGEBRAIC
A.k.a. pretty or short form of move, e.g. Nf3 or fxg8=Q+.
34 DG_MOVE_SMITH
This format is defined as follows:
<from square><to square>[<capture indicator>][<promoted to>]
2 chars 2 chars 0 or 1 char 0 or 1 char
The capture indicator is one of pnbrqkEcC.
It indicates the type of piece captured. "c" indicates a short castling
move (in which case the coordinates are for the king's movements), and C
indicates a long castling move. A "E" indicates an en-passant capture.
If it's not a capture, or castling move, the field is empty.
The promotion information is one of "NBRQ", indicating the promoted piece.
example: e4g5p is a N move from e4 to g5 capturing a pawn.
f7f8Q is a queening move
f7g8nQ is a pawn move capturing a knight and queening.
One advantage of this system that it's easy to parse, and it's
reversible--you can walk forward and backward through the move
list only knowing the current position at a given time.
The notation is a "improvement" of a notation suggested
by Warren Smith.
Note: bughouse plunks are the same in all move formats, e.g. "Q@f7+"
Mystery kriegspiel moves are either "?" or of the form "?xb1".
35 DG_MOVE_TIME
Number of seconds used by the player to make this move.
36 DG_MOVE_CLOCK
Time (in seconds) on the player's clock after making this move
(after incrementing).
24 DG_SEND_MOVES
A move was made. Also sent when an examiner uses "forward".
Form: (gamenumber algebraic-move smith-move time clock is-variation)
where last five fields are OPTIONAL, controlled by
the variables described above.
With these and the DG_MOVE_LIST or DG_POSITION_BEGIN DGs, a smart
client can reasonably disable sending of the board by using style 13.
25 DG_MOVE_LIST
Loading of move list.
If this variable is set, I get one of these DGs when:
(1) I start observing a game.
(2) I start playing or examining a game (though in this
case it usually just looks like (gamenumber *), unless
I'm resuming an adjourned game or it's a wild game.
(3) I use the "refresh <game>" command.
(4) I use the "copygame" command.
(5) An examiner edits the position of a game I'm observing
or examining.
(gamenumber initial-position {white-move1-info}{black-move1-info}{white-move2-info} ...)
Initial-position is either "*" in the case of the normal initial
position, or 64 characters indicating what occupies (-PNBRQKpnbrqk)
each square, in lexigraphic order (a8 b8 ... h1).
The move info is just as in DG_SEND_MOVE: five optional fields,
algebraic-move, smith-move, time, clock, and is-variation.
Turning it on with set-2 results in a DG_MOVE_LIST being sent for
each game of one's games.
gamenumber could be -1 in the case of a stored position (spos or smoves).
See DG_POSITION_BEGIN for a better version of this information.
37 DG_BUGHOUSE_HOLDINGS
Form: (gamenumber {white-holding} {black-holding})
where white-holding is a string such as PPNQ
You won't get <b1> lines if you have these on and use style 13.
57 DG_BUGHOUSE_PASS
(gamenumber color piece)
Not implemented; if you want it, let me know.
color is W or B. piece is one of PNBRQ. Only sent when there's
a capture on partner's board. You also need DG_BUGHOUSE_HOLDINGS
if only to find out the holdings when you start observing an ongoing
bughouse game. (But it's probably safe to discard all but the first
DG_BUGHOUSE_HOLDINGS message of any game and then maintain the list
using these and the moves.)
26 DG_KIBITZ
This is the level 2 version of kibitz.
Form: (gamenumber playername titles kib/whi ^Y{kib string^Y})
kib/whi is 1 if it's a kibitz 0 if whisper.
Normal form is inhibited if I get the level2 version.
38 DG_SET_CLOCK
(gamenumber white-clock black-clock)
Sent when a game I'm involved in has a clock adjusted, say by
the moretime command.
39 DG_FLIP
(gamenumber flip)
flip=1 means I am Black or have asked to watch from Black's point of view.
Normally precedes a DG_MOVE_LIST, and is sent in roughly the same
situations, i.e. when I first see a game. Also sent in response to
the flip <game> command, in which case a dg_refresh follows. The client
should not have to display the board on receiving the dg_flip, because
either a dg_move_list or a dg_refresh will follow.
41 DG_REFRESH
(gamenumber)
[maybe not needed]
This is the only DG I might get when you do "refresh <game>" for
a game which I am already observing or playing. Also sent on flip
command.
42 DG_ILLEGAL_MOVE
(gamenumber movestring reason)
Sent when I issued an illegal move (and am playing or examining).
The movestring is what I typed, up to a blank or 20 characters.
Reason codes include:
1 Bad or ambiguous notation
2 Illegal (covers most of rules of chess)
3 King in check (don't ask why this is singled out)
4 Not your move
5 Bughouse and don't have the piece you're trying to drop
6 Bughouse and drop-square isn't empty
7 Bughouse and pawn drop attempted on first or eighth rank
8 Special restriction in some future wild game type
9 Wait a few seconds before entering moves in examine mode
10 You lost on time before making that move
11 Continue the move (checkers multiple-jump)
I get the text message anyway.
43 DG_MY_RELATION_TO_GAME
(gamenumber symbol)
Same as DG_PLAYERS_IN_MY_GAME, but just for me, and only has
the two fields gamenumber and symbol.
44 DG_PARTNERSHIP
(name name forming)
Indicates a bughouse partnership has formed or dissolved.
forming is 1 or 0.
49 DG_JBOARD
The fields are:
64-char-board
side on move (B or W)
double-push-file as integer -1 to 7
castling rights (style-12 way e.g. 1 1 0 1 for any except Black O-O)
move number of next move (1 + number-of-half-moves-made/2)
algebraic last move (or {})
smith last move (handy for highlighting, I guess)
white clock
black clock
status: played (1), examined (0), or stored (-1)
flip
Snapshot of a game info that could be derived from DG_MOVE_LIST,
for clients that do not want to go that route. The J is for Java,
because this was originally implemented for jicc (coffeehouse).
DG_JBOARD is sent in approximately (maybe exactly) the same places
as a style 12 board would be generated, if you were using that style.
[To do: add bughouse holdings, kriegspiel warnings, and comments
such as "white offers a draw" that the client might reasonably like
to display.]
If you'd like a variation on this format added, email fishbait with
detailed specifications and he might add it.
70 DG_FEN
(gamenumber {FEN-string})
Presents the current position in Forsyth-Edwards notation.
http://www.research.digital.com/SRC/personal/Tim_Mann/Standard
has a description of FEN.
DG_FEN is not sent on every move, but only on the same occasions
that DG_MOVE_LIST might be sent.
56 DG_MSEC
(gamenumber color msec running free_time_to_move min_move_time)
Number of milliseconds on the clock (in range -2^31 to 2^31-1).
Color is "W" or "B". Running is 0 or 1, and is intended to tell
the client whether to make that clock tick down.
free_time_to_move - number of ms user has to move before clock starts, used to allow
time to move on first move as user may be afk when game starts
min_move_time - a move is charged this many ms even if it really took less. this is used
to prevent users winning just by always prevmoving and using zero time.
These DGs are sent in the following situations:
Played-game cases:
(1) when someone makes a move in a played game, to give their
new clock value, including increment earned.
(2) when someone's clock starts running
(2a) no-timestamp case, when it becomes his/your move
(2b) timestamp case, not you, ack-board received
(2c) timestamp case, your move now (inside ts signals)
(3) when a played game starts
(4) when a played game ends
(5) on a takeback
(6) setwhiteclock/setblackclock (but setting a moving clock is
unpredictable)
(~7) It is NOT sent in response to a moretime command.
Examine-mode cases:
[unclear what behavior we want here, but for now running=0 for these]
(8) move in examined game
(9) start of examined game
(10) backward or revert
(11) forward
(12) setwhiteclock/setblackclock
Misc:
(13) spos
(14) refresh of game not being observed
61 DG_MORETIME
(gamenumber color seconds)
Number of seconds added to color's clock in gamenumber. Color is
"W" or "B". This one is superior to DG_MSEC when adjusting a
moving clock. (Do not adjust timestamp alarm in response.)
---------------CHANNELS-----------------
28 DG_CHANNEL_TELL
The level 2 version of a channel tell. If this is on, the
normal form is inhibited.
Form: (channel playername titles ^Y{tell string^Y} type)
Type is similar to DG_PERSONAL_TELL: 1 normally, but 4 for
an "atell" (typically a helper's response to your question).
Below are DGs useful if you want to keep track of who else in
the channels you're in. These DGs are considered verbose,
and similar comments apply as for DG_PLAYER_ARRIVED and DG_GAME_STARTED.
27 DG_PEOPLE_IN_MY_CHANNEL
Show who is in my channels.
(channel playername come/go)
"come/go" is 1 if he/she is in the channel 0 if not in the
channel.
A sequence of these with come/go=1 is generated whenever I
enter a channel.
I do get one for myself when I enter or leave a channel.
When someone connects, if they subscribe to channels it is as
if they join each one, unless I have DG_CHANNELS_SHARED on
which presents the relevant data more compactly (see below).
When I connect, if I don't have DG_CHANNELS_SHARED on I get
many DG_PEOPLE_IN_MY_CHANNEL messages instead, which can
easily overflow my output buffer.
46 DG_CHANNELS_SHARED
(playername channels)
A list of the channels that both the player and I are in. Not
sent if the list is empty. Sent only when someone connects, and
a list of them when I connect, or I do a set-2.
Use DG_PEOPLE_IN_MY_CHANNEL to get updates about people joining
or leaving channels.
DG_CHANNELS_SHARED being on inhibits the sending of lists of
DG_PEOPLE_IN_MY_CHANNEL messages on connection.
This can still be a lot of characters, if you connect onto a
crowded server while subscribed to many channels. See appendix 3.
45 DG_SEES_SHOUTS
(playername bitvector)
In the spirit of DG_PEOPLE_IN_MY_CHANNEL, for clients that want
to have the same information for shouts and sshouts as for channels.
Considered verbose.
Bitvector is
0 if player sees neither
1 if player sees shouts but not sshouts
2 if player sees sshouts but not shouts
3 if player sees both
Sent whenever somebody changes their shout or sshout variable, or
if they connect and they see shouts or sshouts, or if I connect (in
which case I get the list of people who see either). I get might it
twice for myself on login. Not sent when a player disconnects.
---------------MATCHES-----------------
29 DG_MATCH
This happens when I'm successfully challenged for a match.
or when I successfully challenge another for a match.
The text version is sent anyway. (We used to suppress it,
but everybody seems to want it anyway.)
Form: (challenger-name challenger-rating challenger-titles
receiver-name receiver-rating receiver-titles
wild-number rating-type is-it-rated is-it-adjourned
challenger-time-control receiver-time-control
challenger-color-request [assess-loss assess-draw assess-win]
fancy-time-control)
challenger-rating and receiver-rating are two numbers each:
a rating and 0-2 as in rating DGs above.
challenger-time-control is also two numbers (initial and increment).
challenge-color-request is -1 normally, 0=Black, 1=White
The assessment data is only included if DG_MATCH_ASSESSMENT is on.
fancy-time-control is usually null {}, but if it isn't, see
the notes of DG_GAME_STARTED for info on what it means. It overrides
the time and inc if present, but those can still be used to estimate
etime and we'll try to keep them vaguely close to the real TC.
If you turn on DG_MATCH with set-2 you get one DG_MATCH message
per pending challenge.
30 DG_MATCH_REMOVED
This happens when a challenge is removed. The challenge is
identified by the challenger-name and receiver-name.
Form: (challenger-name receiver-name ^Y{Explanation string^Y})
Notice that this will break if we ever let you issue
simultaneous challenges to the same person.
When you start playing a game, you'll get DG_MATCH_REMOVED for
other challenges to you, but those challenges aren't entirely gone --
when you stop playing if they're still there you'll get DG_MATCH
for them again.