X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=doc%2Fprotocole3.txt;h=c3c2e6af86947583ade712f43ab3658d7ccfd136;hb=ccb7fdfe9914f47cc38f96e5973851f2c6f0c4b6;hp=612650214cdd025f406a8257c2746b7222c296f0;hpb=c39e55c505a27e30209fcfb6d837d6ec8a82b990;p=euphorik.git diff --git a/doc/protocole3.txt b/doc/protocole3.txt index 6126502..c3c2e6a 100644 --- a/doc/protocole3.txt +++ b/doc/protocole3.txt @@ -29,6 +29,19 @@ c : client s : server Les messages client vers serveur sont envoyés par HTTP-POST. +A toutes les requêtes le serveur peut répondre une erreur : + + { + "reply" : "error", + "error_message" : "blabla" + } + +Message ok générique : + + { + "reply" : "ok" + } + C.1. Login ---------- @@ -55,7 +68,7 @@ ou s -> c { "reply" : "login", - "status" : "registration_ok" | "authentification_ok" | "error", + "status" : "registration_ok" | "authentification_ok", "cookie" : "LKJDLAKSJBFLKASN", "id" : 193, "pseudo" : "Paul", @@ -68,8 +81,7 @@ s -> c "root" : 123, "page" : 1 } - ], - "error_message" : "blabla" + ] } @@ -84,7 +96,6 @@ c -> s C.3. Profile ------------ -Modification du profile, seul "cookie" est obligatoire. c -> s { @@ -95,7 +106,7 @@ c -> s "pseudo" : "Paul", "email" : "paul@pierre.com", "css" : "css/3/euphorik.css", - "mainPage" : 1, + "main_page" : 1, "conversations" : [ { "root" : 123, @@ -104,11 +115,10 @@ c -> s ] } -s -> c - { - "reply" : "ok" | "error", - "error_message" : "blabla" - } +s -> c + +ou + C.4. Wait event @@ -122,7 +132,7 @@ c -> s "cookie" : "LKJDLAKSJBFLKASN", "message_count" : 10, "last_message_id" : 163, - "mainPage" : 1, + "main_page" : 1, "conversations" : [ { "root" : 123, @@ -166,9 +176,26 @@ ou "reply" : "error", "error_message" : "blabla" } + + +C.5. Envoie troll +------------------- + +c -> s + { + "action" : "put_troll", + "cookie" : "LKJDLAKSJBFLKASN", + "content" : "Un bon troll velu !" + } + +s -> c + { + "reply" : "ok" | "error", + "error_message" : "blabla" + } + - -C.5. Envoie message +C.6. Envoie message ------------------- Le client envoie un message, le message peut répondre à un certain nombre d'autres messages. "answer_to" n'est pas obligatoire. @@ -179,6 +206,7 @@ c -> s "cookie" : "LKJDLAKSJBFLKASN", "nick" : "Paul", "content" : "Bonjour", + "Troll" : 45, "answer_to" : [ 345, 532, ... ] } @@ -189,7 +217,7 @@ s -> c } -C.6 Ajout d'une correction d'un messages +C.7. Ajout d'une correction d'un messages ---------------------------------------- Le client envoie un correctif sous la forme de texte supplémentaire à appondre au dernier messages. Le message est appondu avec un " +++ " devant, par exemple :