X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=doc%2Fprotocole3.txt;h=8c8d2539f23e1c8d3f371d375216366e83bcfde8;hp=033c9ab10487c9ea71be5c555cfa409fb0a9e431;hb=994f68e1f8a7a43b55d6bd6214b2a0066671ba74;hpb=032b8fc6f8be99d2665e9d96a8f7f698239f96ea diff --git a/doc/protocole3.txt b/doc/protocole3.txt index 033c9ab..8c8d253 100644 --- a/doc/protocole3.txt +++ b/doc/protocole3.txt @@ -40,45 +40,54 @@ Message ok g } -=== Login === -Le mot de passe est hashé en md5. -L'action 'register' permet de créer un nouvel utilisateur. +=== Enregistrement et authentification === +Permet de créer un nouvel utilisateur. +"login" et "password" peuvent ne pas être fournis avec un message de type "register", dans ce cas l'utilisateur ne pourra s'authentifier qu'a l'aide de son cookie. +Le mot de passe est hashé en md5. -c -> s - { - "action" : "authentification", - "login" : "Paul", - "password" : "IJKJDHHSAD9081238" +c -> s + { + "action" : "authentification", + "login" : "paul", + "password" : "IJKJDHHSAD9081238" } -ou - { - "action" : "authentification", - "cookie" : "LKJDLAKSJBFLKASN" +ou + { + "action" : "authentification", + "cookie" : "LKJDLAKSJBFLKASN" } -ou - { - "action" : "register", - "login" : "Paul", - "password" : "IJKJDHHSAD9081238" +ou + { + "action" : "register", + "login" : "paul", + "password" : "IJKJDHHSAD9081238" } -s -> c - { - "reply" : "login", - "status" : "registration_ok" | "authentification_ok", +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", "cookie" : "LKJDLAKSJBFLKASN", "id" : 193, - "pseudo" : "Paul", + "nick" : "Paul", "login" : "paul49", "email" : "paul@pierre.com", - "css" : "css/3/euphorik.css", - "main_page" : 1, - "conversations" : [ - { - "racine" : 123, - "page" : 1 - } - ] + "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 } @@ -97,16 +106,14 @@ c -> s "cookie" : "LKJDLAKSJBFLKASN", "login" : "paul49", "password" : "IJKJDHHSAD9081238", - "pseudo" : "Paul", + "nick" : "Paul", "email" : "paul@pierre.com", - "css" : "css/3/euphorik.css", + "css" : "css/3/euphorik.css", + "nick_format" : "nick" | "login" | "nick_login", + "view_times" : true | false, + "view_tooltips" : true | false, "main_page" : 1, - "conversations" : [ - { - "racine" : 123, - "page" : 1 - } - ] + "conversations" : [3, 8] } s -> c @@ -115,9 +122,10 @@ ou -=== Wait event === +=== Wait event (page = chat) === Si "last_message_id" est absent alors le client ne possède pas de message. -Les conversations lié aux trolls sont définies dans le profile. +Si "main_page" est absent alors est vaut 1. +"cookie" n'est pas obligatoire. c -> s { @@ -126,10 +134,13 @@ c -> s "cookie" : "LKJDLAKSJBFLKASN", "message_count" : 10, "last_message_id" : 163, + "main_page" : 1, + "troll_id" : 45, "conversations" : [ { - "racine" : 123, - "page" : 1 + "root" : 123, + "page" : 1, + "last_message_id" : 4 (pas obligatoire) } ] } @@ -139,13 +150,14 @@ La premi 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. { - "reply" : "new_messages", + "reply" : "new_message", "conversations" : [ { "last_page" : true | false, "messages" : [ { - "id" : 54, + "id" : 54, + "user_id" : 344, "date" : "Hier 17:26:54", "system" : true | false, "owner" : true | false, @@ -153,10 +165,12 @@ Le format de la date n'est pas formel. "is_a_reply" : true | false, "nick" : "Paul", "login" : "paul_22", - "content" : "Salut", + "content" : "Salut", + "root" : 453, "answer_to" : [ - { "id" : 123, "pseudo" : "Pierre", "login" : "pierre_45" } + { "id" : 123, "nick" : "Pierre", "login" : "pierre_45" } ] + "ek_master" : true | false } ] } @@ -167,29 +181,103 @@ ou { "reply" : "message_updated", "message_id" : 123, - "contenu" : "Salut +++ poulpe" + "content" : "Salut +++ poulpe" } -ou - { - "reply" : "error", - "error_message" : "blabla" +ou + { + "reply" : "new_troll", + "troll_id" : 123, + "message_id" : 12, + "content" : "Linux sera desktop ready en 2008 ?" + } +ou + + + +=== Wait event (page = admin) === +c -> s + { + "action" : "wait_event", + "page" : "admin", + "last_troll" : 5 + } + +s -> c + { + "reply" : "troll_modified", + "troll_id" : 3, + "content" : "plop" + } +ou +s -> c + { + "reply" : "troll_added", + "trolls" : + [ + { + "troll_id" : 5, + "content" : "plop", + "author" : "" + "author_id" : 2 + } + ] + } +ou +s -> c + { + "reply" : "troll_deleted", + "troll_id" : 2 + } +ou +indique de mettre à jour la liste d'ips +s -> c + { + "reply" : "banned_ips_refresh" } -=== Envoie d'un troll === -TODO +=== Envoie d'un troll === c -> s { "action" : "put_troll", "cookie" : "LKJDLAKSJBFLKASN", "content" : "Un bon troll velu !" - } -=== Modification d'un troll === -TODO -=== Suppression d'un troll === -TODO -=== Noter un troll === -TODO + } + +s -> c + +ou + + + +=== Modification d'un troll === +c -> s + { + "action" : "mod_troll", + "cookie" : "LKJDLAKSJBFLKASN", + "troll_id" : 3, + "content" : "Un bon troll velu 2 !" + } + +s -> c + +ou + + + +=== Suppression d'un troll === +c -> s + { + "action" : "del_troll", + "cookie" : "LKJDLAKSJBFLKASN", + "troll_id" : 3 + } + +s -> c + +ou + + === Envoie message === Le client envoie un message, le message peut répondre à un certain nombre d'autres messages. @@ -204,12 +292,81 @@ c -> s "answer_to" : [ 345, 532, ... ] } -s -> c - { - "reply" : "ok" | "error", - "error_message" : "blabla" +s -> c + +ou + + + +=== Slapage === +c -> s + { + "action" : "slap", + "cookie" : "LKJDLAKSJBFLKASN", + "user_id" : 67, + "reason" : "blablabla" } - + +s -> c + +ou + + + +=== Bannissement === +c -> s + { + "action" : "ban", + "cookie" : "LKJDLAKSJBFLKASN", + "duration" : 15, // en minute + "user_id" : 67, + "reason" : "blablabla" + } + +s -> c + +ou + + + +=== Liste des ip bannis === +c -> s + { + "action" : "list_banned_ips", + "cookie" : "LKJDLAKSJBFLKASN" + } + +s -> c + { + "reply" : "list_banned_ips", + "list" : [ + { + ip : "192.168.1.2", + remaining_time : "1h23" + users : [ + { + nick : "Pierre" , + login : "pierre" + } + ] + } + ] + } + + +=== Débannissement === +c -> s + { + "action" : "unban", + "cookie" : "LKJDLAKSJBFLKASN" + "ip" : "192.168.1.2" + } + +s -> c + +ou + + === Ajout d'une correction d'un messages === Le client envoie un correctif sous la forme de texte supplémentaire à appondre au dernier messages.