From eaeff7851380cf9a416fd609fd9e90297f8f5918 Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Wed, 25 Jun 2008 13:43:13 +0000 Subject: [PATCH] =?utf8?q?MOD=20mise=20=C3=A0=20jour=20du=20protocole=20:?= =?utf8?q?=20ajout=20d'un=20num=C3=A9ro=20de=20version=20pour=20chaque=20m?= =?utf8?q?essage,=20ajout=20du=20premier=20message=20d'une=20conversation?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- doc/protocole3.txt | 113 ++++++++++++++++++++++++--------------------- 1 file changed, 61 insertions(+), 52 deletions(-) diff --git a/doc/protocole3.txt b/doc/protocole3.txt index e89b357..0af2cce 100644 --- a/doc/protocole3.txt +++ b/doc/protocole3.txt @@ -1,4 +1,4 @@ -Euphorik - Protocole v3 +Euphorik - Protocole v3 ----------------------- == Introduction == @@ -37,6 +37,14 @@ Message ok générique : { "reply" : "ok" + } + +Entete des messages clients : +Si la version du protocole n'est pas similaire du coté serveur la requête est refusée + + { + "action" : , + "version" : 3 } @@ -47,18 +55,18 @@ Le mot de passe est hashé en md5. c -> s { - "action" : "authentification", + "header" : {action : "authentification", version : 3}, "login" : "paul", "password" : "IJKJDHHSAD9081238" } ou { - "action" : "authentification", + "header" : {action : "authentification", version : 3} "cookie" : "LKJDLAKSJBFLKASN" } ou - { - "action" : "register", + { + "header" : {action : "authentification", version : 3}, "login" : "paul", "password" : "IJKJDHHSAD9081238" } @@ -93,16 +101,16 @@ ou === Logout === c -> s - { - "action" : "logout", + { + "header" : {action : "logout", version : 3}, "cookie" : "LKJDLAKSJBFLKASN" } === Profile === c -> s - { - "action" : "set_profile", + { + "header" : {action : "set_profile", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "login" : "paul49", "password" : "IJKJDHHSAD9081238", @@ -126,10 +134,29 @@ ou Si "last_message_id" est absent alors le client ne possède pas de message. Si "main_page" est absent alors est vaut 1. "cookie" n'est pas obligatoire. + + + { + "id" : 54, + "user_id" : 344, + "date" : "Hier 17:26:54", + "system" : true | false, + "owner" : true | false, + "answered" : true | false, + "is_a_reply" : true | false, + "nick" : "Paul", + "login" : "paul_22", + "content" : "Salut", + "root" : 453, + "answer_to" : [ + { "id" : 123, "nick" : "Pierre", "login" : "pierre_45" } + ] + "ek_master" : true | false + } c -> s - { - "action" : "wait_event", + { + "header" : {action : "wait_event", version : 3}, "page" : "chat" "cookie" : "LKJDLAKSJBFLKASN", "message_count" : 10, @@ -153,28 +180,10 @@ Le format de la date n'est pas formel. "reply" : "new_message", "conversations" : [ { - "last_page" : true | false, - "messages" : [ - { - "id" : 54, - "user_id" : 344, - "date" : "Hier 17:26:54", - "system" : true | false, - "owner" : true | false, - "answered" : true | false, - "is_a_reply" : true | false, - "nick" : "Paul", - "login" : "paul_22", - "content" : "Salut", - "root" : 453, - "answer_to" : [ - { "id" : 123, "nick" : "Pierre", "login" : "pierre_45" } - ] - "ek_master" : true | false - } - ] + "last_page" : true | false, + "first" : , + "messages" : [ , .. ] } - ... ] } ou @@ -196,8 +205,8 @@ ou === Wait event (page = admin) === c -> s - { - "action" : "wait_event", + { + "header" : {action : "wait_event", version : 3}, "page" : "admin", "last_troll" : 5 } @@ -238,8 +247,8 @@ s -> c === Envoie d'un troll === c -> s - { - "action" : "put_troll", + { + "header" : {action : "put_troll", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "content" : "Un bon troll velu !" } @@ -252,8 +261,8 @@ ou === Modification d'un troll === c -> s - { - "action" : "mod_troll", + { + "header" : {action : "mod_troll", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "troll_id" : 3, "content" : "Un bon troll velu 2 !" @@ -267,8 +276,8 @@ ou === Suppression d'un troll === c -> s - { - "action" : "del_troll", + { + "header" : {action : "del_troll", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "troll_id" : 3 } @@ -284,8 +293,8 @@ Le client envoie un message, le message peut répondre à un certain nombre d'au "answer_to" n'est pas obligatoire. c -> s - { - "action" : "put_message", + { + "header" : {action : "put_message", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "nick" : "Paul", "content" : "Bonjour", @@ -300,8 +309,8 @@ ou === Slapage === c -> s - { - "action" : "slap", + { + "header" : {action : "slap", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "user_id" : 67, "reason" : "blablabla" @@ -315,8 +324,8 @@ ou === Bannissement === c -> s - { - "action" : "ban", + { + "header" : {action : "ban", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "duration" : 15, // en minute "user_id" : 67, @@ -331,8 +340,8 @@ ou === Liste des ip bannis === c -> s - { - "action" : "list_banned_ips", + { + "header" : {action : "list_banned_ips", version : 3}, "cookie" : "LKJDLAKSJBFLKASN" } @@ -356,8 +365,8 @@ s -> c === Débannissement === c -> s - { - "action" : "unban", + { + "header" : {action : "unban", version : 3}, "cookie" : "LKJDLAKSJBFLKASN" "ip" : "192.168.1.2" } @@ -374,8 +383,8 @@ Le message est appondu avec un " +++ " devant, par exemple : > Gnome c'est mieux que KDE +++ Euh non ok, c'est faux c -> s - { - "action" : "correction", + { + "header" : {action : "correction", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "content" : "Euh non ok, c'est faux" } -- 2.43.0