-Euphorik - Protocole v3
+Euphorik - Protocole v3
-----------------------
== Introduction ==
"reply" : "ok"
}
+Entete des messages clients :
+Si la version du protocole n'est pas similaire du coté serveur la requête est refusée
+<client_header>
+ {
+ "action" : <action>,
+ "version" : 3
+ }
+
=== Enregistrement et authentification ===
Permet de créer un nouvel utilisateur.
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"
}
"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"
}
=== Profile ===
c -> s
{
- "action" : "set_profile",
+ "header" : {action : "set_profile", version : 3},
"cookie" : "LKJDLAKSJBFLKASN",
"login" : "paul49",
"password" : "IJKJDHHSAD9081238",
"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
Si "main_page" est absent alors est vaut 1.
"cookie" n'est pas obligatoire.
+<message>
+ {
+ "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,
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" : <message> | null,
+ "messages" : [ <message>, .. ]
}
- ...
]
}
ou
=== Wait event (page = admin) ===
c -> s
{
- "action" : "wait_event",
+ "header" : {action : "wait_event", version : 3},
"page" : "admin",
"last_troll" : 5
}
=== Envoie d'un troll ===
c -> s
{
- "action" : "put_troll",
+ "header" : {action : "put_troll", version : 3},
"cookie" : "LKJDLAKSJBFLKASN",
"content" : "Un bon troll velu !"
}
=== 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 !"
=== Suppression d'un troll ===
c -> s
{
- "action" : "del_troll",
+ "header" : {action : "del_troll", version : 3},
"cookie" : "LKJDLAKSJBFLKASN",
"troll_id" : 3
}
c -> s
{
- "action" : "put_message",
+ "header" : {action : "put_message", version : 3},
"cookie" : "LKJDLAKSJBFLKASN",
"nick" : "Paul",
"content" : "Bonjour",
=== Slapage ===
c -> s
{
- "action" : "slap",
+ "header" : {action : "slap", version : 3},
"cookie" : "LKJDLAKSJBFLKASN",
"user_id" : 67,
"reason" : "blablabla"
=== Bannissement ===
c -> s
{
- "action" : "ban",
+ "header" : {action : "ban", version : 3},
"cookie" : "LKJDLAKSJBFLKASN",
"duration" : 15, // en minute
"user_id" : 67,
=== Liste des ip bannis ===
c -> s
{
- "action" : "list_banned_ips",
+ "header" : {action : "list_banned_ips", version : 3},
"cookie" : "LKJDLAKSJBFLKASN"
}
=== Débannissement ===
c -> s
{
- "action" : "unban",
+ "header" : {action : "unban", version : 3},
"cookie" : "LKJDLAKSJBFLKASN"
"ip" : "192.168.1.2"
}
c -> s
{
- "action" : "correction",
+ "header" : {action : "correction", version : 3},
"cookie" : "LKJDLAKSJBFLKASN",
"content" : "Euh non ok, c'est faux"
}