Changes between Version 1 and Version 2 of AnnotatedObbySession

Show
Ignore:
Timestamp:
05/09/06 01:01:50 (7 years ago)
Author:
technomancy (IP: 71.103.88.166)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AnnotatedObbySession

    v1 v2  
    33Below is the traffic generated by a simple session between [http://dev.technomancy.us/phil/wiki/ebby Ebby] and Gobby. I've annotated it so that others who may try to implement Obby support in other editors will have an easy starting point and hints on the protocol. Lines in ''italics'' are sent by Ebby, plain lines are sent by Gobby. 
    44 
    5 Note that this pertains to version 0.3 of the protocol. 
     5Everything the server sends consists of a command and parameters. Some commands also have subcommands, such as {{{obby_document}}} having subcommands like {{{subscribe}}}, {{{sync_line}}}, and {{{record}}}. The {{{record}}} subcommand is further divided up into {{{ins}}} and {{{del}}}. 
     6 
     7All numbers given are in hexadecimal. 
     8 
     9Note that this pertains to version 0.3 of the protocol. (Gobby 0.3 is rather temperamental in a few areas. Sending incorrect operation counts (see below) or positions beyond the end of the document will cause crashes. This has been fixed in 0.4.) 
    610 
    711''net6_client_login:phil:88ff44'' 
     
    1115{{{obby_welcome:5:2q3zg3il03:pm6vo8c81hi8a28j6ifqfhwmnwhsku7meo7gl2lyjg81ep0qwqojc6i6lygfb2el5lxr8smhg2lufjxxgd0iyno9vn88naikemz:4d}}} 
    1216 
    13 The server responds with an obby_welcome command, the version of the protocol it supports, and (I believe) an RSA authentication. 
     17The server responds with an {{{obby_welcome}}} command, the version of the protocol it supports, and (I believe) an RSA authentication. 
    1418 
    1519{{{obby_sync_init:5}}} 
     
    2933I believe this represents other users who may have edited existing documents, but are no longer connected. 
    3034 
    31 {{{obby_sync_doclist_document:1:1:a:1 
     35{{{obby_sync_doclist_document:1:1:a:1}}} 
    3236 
    33 obby_sync_doclist_document:1:2:b:1}}} 
     37{{{obby_sync_doclist_document:1:2:b:1}}} 
    3438 
    35 The server then sends a list of every open document. Each document is identified by a pair of numbers: one for the obby user id of the creator, and one for the per-user index of the document. (User #2's first document would be "2 1", their second "2 2", etc.) The fields here are creator's user id, creator document index, document name, and a list of users currently subscribed to the document. The server may also notify the client of new documents created by sending {{{obby_document_create}}} with the same parameters. 
     39The server then sends a list of every open document. Each document is identified by a pair of numbers: one for the obby user id of the creator, and one for the per-user index of the document. (User 2's first document would be "2 1", their second "2 2", etc.) The fields here are creator's user id, creator document index, document name, and a list of users currently subscribed to the document. The server may also notify the client of new documents created by sending {{{obby_document_create}}} with the same parameters. 
    3640 
    3741{{{obby_sync_final}}} 
     
    4751The server tells the client how many lines there are in the document. 
    4852 
    49 {{{obby_document:1 1:sync_line:jibbery jabbery:0:1 
     53{{{obby_document:1 1:sync_line:jibbery jabbery:0:1}}} 
    5054 
    51 obby_document:1 1:sync_line: this is also cool. :0:3:7:1 
     55{{{obby_document:1 1:sync_line: this is also cool. :0:3:7:1}}} 
    5256 
    53 obby_document:1 1:sync_line:another line here.:0:1}}} 
     57{{{obby_document:1 1:sync_line:another line here.:0:1}}} 
    5458 
    55 Each line is sent. The numbers after the line indicate who authored it. On the second line, it says :0:3:7:1. This indicates that the first chunk of the line (starting at position 0) was authored by user #3, while the second chunk of the line (starting at position 7) was authored by user #1. 
     59Each line is sent. The numbers after the line indicate who authored it. On the second line, it says :0:3:7:1. This indicates that the first chunk of the line (starting at position 0) was authored by user 3, while the second chunk of the line (starting at position 7) was authored by user 1. 
    5660 
    5761{{{obby_document:1 1:subscribe:2}}} 
    5862 
    5963The server is done sending lines, and the client is considered subscribed. 
    60  
    6164 
    6265''obby_document:1 1:record:0:0:ins:37:s'' 
     
    7073''obby_document:1 1:record:4:0:ins:3b: '' 
    7174 
    72 obby_document:1 1:record:1:0:5:ins:3c:r 
     75Here is an instance of the {{{record}}} subcommand. Our client has just entered the word 'sent ' and transmitted it to the server. The numbers in between {{{record}}} and {{{ins}}} are the local and remote operation counts. Every time the client makes a modification to the document, the local operation count should increase. Every time the server transmits a change, the client should increase its remote operation count. The number right after {{{ins}}} is the position at which the character should be inserted. 
    7376 
    74 obby_document:1 1:record:1:1:5:ins:3d:e 
     77{{{obby_document:1 1:record:1:0:5:ins:3c:r}}} 
    7578 
    76 obby_document:1 1:record:1:2:5:ins:3e:c 
     79{{{obby_document:1 1:record:1:1:5:ins:3d:e}}} 
    7780 
    78 obby_document:1 1:record:1:3:5:ins:3f:e 
     81{{{obby_document:1 1:record:1:2:5:ins:3e:c}}} 
    7982 
    80 obby_document:1 1:record:1:4:5:ins:40:i 
     83{{{obby_document:1 1:record:1:3:5:ins:3f:e}}} 
    8184 
    82 obby_document:1 1:record:1:5:5:ins:41:v 
     85{{{obby_document:1 1:record:1:4:5:ins:40:i}}} 
    8386 
    84 obby_document:1 1:record:1:6:5:ins:42:e 
     87{{{obby_document:1 1:record:1:5:5:ins:41:v}}} 
    8588 
    86 obby_document:1 1:record:1:7:5:ins:43:d 
     89{{{obby_document:1 1:record:1:6:5:ins:42:e}}} 
     90 
     91{{{obby_document:1 1:record:1:7:5:ins:43:d}}} 
     92 
     93Note that when the server sends insertions, the position of the local operation count and remote operation count is reversed. Here a remote user just typed the word 'received' at a position right after our client typed 'sent '. Note that if the client were to transmit something at this point, '''it should sent 8''' as the remote operation count, not 7. This is because every received modification should increase the remote operation count to one greater than what the message indicating the change shows. 
     94 
     95{{{obby_document:1 1:record:1:8:15:del:23:1}}} 
     96 
     97Here the server informs the client that a deletion has occurred with a {{{del}}}. Apart from the operation count information directly proceeding the {{{record}}} subcommand, the final two parameters indicate the position the deletion began as well as the length of the deletion. 
     98 
     99{{{obby_document:1 1:record:1:9:15:del:3c:8}}} 
     100 
     101Here a whole 8 characters have been deleted, from 0x3c to 0x44.