-Euphorik - Protocole v3
+Euphorik - Protocole v3
-----------------------
== Introduction ==
<ok>
{
"reply" : "ok"
+ }\r
+\r
+Entete des messages clients :\r
+Si la version du protocole n'est pas similaire du coté serveur la requête est refusée\r
+<client_header>\r
+ {\r
+ "action" : <action>,\r
+ "version" : 3\r
}
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",
+ {\r
+ "header" : {action : "authentification", version : 3},
"login" : "paul",
"password" : "IJKJDHHSAD9081238"
}
=== Logout ===
c -> s
- {
- "action" : "logout",
+ {\r
+ "header" : {action : "logout", version : 3},
"cookie" : "LKJDLAKSJBFLKASN"
}
=== Profile ===
c -> s
- {
- "action" : "set_profile",
+ {\r
+ "header" : {action : "set_profile", version : 3},
"cookie" : "LKJDLAKSJBFLKASN",
"login" : "paul49",
"password" : "IJKJDHHSAD9081238",
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.
+\r
+<message>\r
+ {\r
+ "id" : 54,\r
+ "user_id" : 344,\r
+ "date" : "Hier 17:26:54",\r
+ "system" : true | false,\r
+ "owner" : true | false,\r
+ "answered" : true | false,\r
+ "is_a_reply" : true | false,\r
+ "nick" : "Paul",\r
+ "login" : "paul_22",\r
+ "content" : "Salut",\r
+ "root" : 453,\r
+ "answer_to" : [\r
+ { "id" : 123, "nick" : "Pierre", "login" : "pierre_45" }\r
+ ]\r
+ "ek_master" : true | false\r
+ }\r
c -> s
- {
- "action" : "wait_event",
+ {\r
+ "header" : {action : "wait_event", version : 3},
"page" : "chat"
"cookie" : "LKJDLAKSJBFLKASN",
"message_count" : 10,
"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,\r
+ "first" : <message>,
+ "messages" : [ <message>, .. ]
}
- ...
]
}
ou
=== Wait event (page = admin) ===
c -> s
- {
- "action" : "wait_event",
+ {\r
+ "header" : {action : "wait_event", version : 3},
"page" : "admin",
"last_troll" : 5
}
=== Envoie d'un troll ===
c -> s
- {
- "action" : "put_troll",
+ {\r
+ "header" : {action : "put_troll", version : 3},
"cookie" : "LKJDLAKSJBFLKASN",
"content" : "Un bon troll velu !"
}
=== Modification d'un troll ===
c -> s
- {
- "action" : "mod_troll",
+ {\r
+ "header" : {action : "mod_troll", version : 3},
"cookie" : "LKJDLAKSJBFLKASN",
"troll_id" : 3,
"content" : "Un bon troll velu 2 !"
=== Suppression d'un troll ===
c -> s
- {
- "action" : "del_troll",
+ {\r
+ "header" : {action : "del_troll", version : 3},
"cookie" : "LKJDLAKSJBFLKASN",
"troll_id" : 3
}
"answer_to" n'est pas obligatoire.
c -> s
- {
- "action" : "put_message",
+ {\r
+ "header" : {action : "put_message", version : 3},
"cookie" : "LKJDLAKSJBFLKASN",
"nick" : "Paul",
"content" : "Bonjour",
=== Slapage ===
c -> s
- {
- "action" : "slap",
+ {\r
+ "header" : {action : "slap", version : 3},
"cookie" : "LKJDLAKSJBFLKASN",
"user_id" : 67,
"reason" : "blablabla"
=== Bannissement ===
c -> s
- {
- "action" : "ban",
+ {\r
+ "header" : {action : "ban", version : 3},
"cookie" : "LKJDLAKSJBFLKASN",
"duration" : 15, // en minute
"user_id" : 67,
=== Liste des ip bannis ===
c -> s
- {
- "action" : "list_banned_ips",
+ {\r
+ "header" : {action : "list_banned_ips", version : 3},
"cookie" : "LKJDLAKSJBFLKASN"
}
=== Débannissement ===
c -> s
- {
- "action" : "unban",
+ {\r
+ "header" : {action : "unban", version : 3},
"cookie" : "LKJDLAKSJBFLKASN"
"ip" : "192.168.1.2"
}
> Gnome c'est mieux que KDE +++ Euh non ok, c'est faux
c -> s
- {
- "action" : "correction",
+ {\r
+ "header" : {action : "correction", version : 3},
"cookie" : "LKJDLAKSJBFLKASN",
"content" : "Euh non ok, c'est faux"
}