X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=doc%2Fprotocole3.txt;h=977cfc33765b2e72c818394a4d3ed7ba18ab0798;hp=e89b357a793a8b0f4f211cda35ddedb475d288e9;hb=bb692b6ec033e2c6ce4dd12d95831af96033ec6f;hpb=2424ba818818a6bd0b547fa540742f9b54db990b diff --git a/doc/protocole3.txt b/doc/protocole3.txt index e89b357..977cfc3 100644 --- a/doc/protocole3.txt +++ b/doc/protocole3.txt @@ -1,4 +1,4 @@ -Euphorik - Protocole v3 +Euphorik - Protocole v3 ----------------------- == Introduction == @@ -39,6 +39,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 + } + === Enregistrement et authentification === Permet de créer un nouvel utilisateur. @@ -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" } @@ -82,19 +90,20 @@ ou "login" : "paul49", "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], - "ek_master" : true | false + "conversations" : [{"root" : 3, "minimized" : true}, + "ek_master" : true | false, + "ostentatious_master" : "invisible" | "light" | "heavy" } === Logout === c -> s { - "action" : "logout", + "header" : {action : "logout", version : 3}, "cookie" : "LKJDLAKSJBFLKASN" } @@ -102,18 +111,19 @@ c -> s === Profile === c -> s { - "action" : "set_profile", + "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" } s -> c @@ -127,9 +137,29 @@ 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, + "ostentatious_master" : "invisible" | "light" | "heavy" + } + c -> s { - "action" : "wait_event", + "header" : {action : "wait_event", version : 3}, "page" : "chat" "cookie" : "LKJDLAKSJBFLKASN", "message_count" : 10, @@ -149,32 +179,15 @@ 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, - "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 - } - ] + "first" : | null, + "messages" : [ , .. ] } - ... ] } ou @@ -197,7 +210,7 @@ ou === Wait event (page = admin) === c -> s { - "action" : "wait_event", + "header" : {action : "wait_event", version : 3}, "page" : "admin", "last_troll" : 5 } @@ -239,7 +252,7 @@ s -> c === Envoie d'un troll === c -> s { - "action" : "put_troll", + "header" : {action : "put_troll", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "content" : "Un bon troll velu !" } @@ -253,7 +266,7 @@ 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 !" @@ -268,7 +281,7 @@ ou === Suppression d'un troll === c -> s { - "action" : "del_troll", + "header" : {action : "del_troll", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "troll_id" : 3 } @@ -285,7 +298,7 @@ Le client envoie un message, le message peut répondre à un certain nombre d'au c -> s { - "action" : "put_message", + "header" : {action : "put_message", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "nick" : "Paul", "content" : "Bonjour", @@ -301,7 +314,7 @@ ou === Slapage === c -> s { - "action" : "slap", + "header" : {action : "slap", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "user_id" : 67, "reason" : "blablabla" @@ -316,7 +329,7 @@ ou === Bannissement === c -> s { - "action" : "ban", + "header" : {action : "ban", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "duration" : 15, // en minute "user_id" : 67, @@ -332,7 +345,7 @@ ou === Liste des ip bannis === c -> s { - "action" : "list_banned_ips", + "header" : {action : "list_banned_ips", version : 3}, "cookie" : "LKJDLAKSJBFLKASN" } @@ -357,7 +370,7 @@ s -> c === Débannissement === c -> s { - "action" : "unban", + "header" : {action : "unban", version : 3}, "cookie" : "LKJDLAKSJBFLKASN" "ip" : "192.168.1.2" } @@ -375,7 +388,7 @@ Le message est appondu avec un " +++ " devant, par exemple : c -> s { - "action" : "correction", + "header" : {action : "correction", version : 3}, "cookie" : "LKJDLAKSJBFLKASN", "content" : "Euh non ok, c'est faux" }