X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=doc%2Fprotocole3.txt;h=2eb81a62ded3883bcc676bb78f6185f4654a0339;hp=0af2cce9142ff6ee52f5d3a63eda04058b309e50;hb=d0a68333e392d0aac61b612a07dd9cc80c4eeb93;hpb=eaeff7851380cf9a416fd609fd9e90297f8f5918 diff --git a/doc/protocole3.txt b/doc/protocole3.txt index 0af2cce..2eb81a6 100644 --- a/doc/protocole3.txt +++ b/doc/protocole3.txt @@ -37,14 +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 + } + +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 } @@ -55,9 +55,10 @@ Le mot de passe est hashé en md5. c -> s { - "header" : {action : "authentification", version : 3}, + "header" : {action : "register", version : 3}, "login" : "paul", - "password" : "IJKJDHHSAD9081238" + "password" : "IJKJDHHSAD9081238", + "profile" : { .. } // voir } ou { @@ -65,7 +66,7 @@ ou "cookie" : "LKJDLAKSJBFLKASN" } ou - { + { "header" : {action : "authentification", version : 3}, "login" : "paul", "password" : "IJKJDHHSAD9081238" @@ -74,54 +75,44 @@ ou s -> c { "reply" : "register" | "authentification", - "status" : "auth_not_registered", - "cookie" : "LKJDLAKSJBFLKASN", - "id" : 193, - "css" : "css/1/euphorik.css", - "main_page" : 1 - } -ou - { - "reply" : "register" | "authentification", - "status" : "auth_registered", + "status" : "auth_registered" | "auth_not_registered", "cookie" : "LKJDLAKSJBFLKASN", "id" : 193, - "nick" : "Paul", "login" : "paul49", - "email" : "paul@pierre.com", - "css" : "css/3/euphorik.css", - "nick_format" : "nick" | "login" | "nick_login", - "view_times" : true | false, - "view_tooltips" : true | false, - // "main_page" : 1, - "conversations" : [3, 8], - "ek_master" : true | false + "ek_master" : true | false, + "profile" : } === Logout === c -> s - { + { "header" : {action : "logout", version : 3}, "cookie" : "LKJDLAKSJBFLKASN" } === Profile === -c -> s - { - "header" : {action : "set_profile", version : 3}, - "cookie" : "LKJDLAKSJBFLKASN", - "login" : "paul49", - "password" : "IJKJDHHSAD9081238", + + { "nick" : "Paul", "email" : "paul@pierre.com", "css" : "css/3/euphorik.css", + "chat_order" : "chrono" | "reverse", "nick_format" : "nick" | "login" | "nick_login", "view_times" : true | false, "view_tooltips" : true | false, - "main_page" : 1, - "conversations" : [3, 8] + "conversations" : [{"root" : 3, "minimized" : true}, + "ostentatious_master" : "invisible" | "light" | "heavy" + } + +c -> s + { + "header" : {action : "set_profile", version : 3}, + "cookie" : "LKJDLAKSJBFLKASN", + "login" : "paul49", + "password" : "IJKJDHHSAD9081238", + "profile" : } s -> c @@ -134,28 +125,30 @@ 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 - } + + + { + "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, + "ostentatious_master" : "invisible" | "light" | "heavy", + "last_modification" : "Hier 17:26:54" + } c -> s - { + { "header" : {action : "wait_event", version : 3}, "page" : "chat" "cookie" : "LKJDLAKSJBFLKASN", @@ -176,12 +169,13 @@ s -> c La première conversation est la principale (main). L'ordre des conversation est le même que celui des données de l'utilisateur. Le format de la date n'est pas formel. +first correpond au premier message de la conversation, vaut 'null' pour la conversation principale ainsi que pour les conversations vides. { "reply" : "new_message", "conversations" : [ { - "last_page" : true | false, - "first" : , + "last_page" : true | false, + "first" : | null, "messages" : [ , .. ] } ] @@ -190,7 +184,8 @@ ou { "reply" : "message_updated", "message_id" : 123, - "content" : "Salut +++ poulpe" + "content" : "Salut poulpe", + "last_modification" : "Hier 17:26:54" } ou { @@ -205,7 +200,7 @@ ou === Wait event (page = admin) === c -> s - { + { "header" : {action : "wait_event", version : 3}, "page" : "admin", "last_troll" : 5 @@ -247,7 +242,7 @@ s -> c === Envoie d'un troll === c -> s - { + { "header" : {action : "put_troll", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "content" : "Un bon troll velu !" @@ -261,7 +256,7 @@ ou === Modification d'un troll === c -> s - { + { "header" : {action : "mod_troll", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "troll_id" : 3, @@ -276,7 +271,7 @@ ou === Suppression d'un troll === c -> s - { + { "header" : {action : "del_troll", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "troll_id" : 3 @@ -293,7 +288,7 @@ Le client envoie un message, le message peut répondre à un certain nombre d'au "answer_to" n'est pas obligatoire. c -> s - { + { "header" : {action : "put_message", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "nick" : "Paul", @@ -309,7 +304,7 @@ ou === Slapage === c -> s - { + { "header" : {action : "slap", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "user_id" : 67, @@ -324,7 +319,7 @@ ou === Bannissement === c -> s - { + { "header" : {action : "ban", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "duration" : 15, // en minute @@ -340,7 +335,7 @@ ou === Liste des ip bannis === c -> s - { + { "header" : {action : "list_banned_ips", version : 3}, "cookie" : "LKJDLAKSJBFLKASN" } @@ -365,7 +360,7 @@ s -> c === Débannissement === c -> s - { + { "header" : {action : "unban", version : 3}, "cookie" : "LKJDLAKSJBFLKASN" "ip" : "192.168.1.2" @@ -383,7 +378,7 @@ Le message est appondu avec un " +++ " devant, par exemple : > Gnome c'est mieux que KDE +++ Euh non ok, c'est faux c -> s - { + { "header" : {action : "correction", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "content" : "Euh non ok, c'est faux"