Merge branch 'master' of https://github.com/jsmaniac/2011-m1s2-ter
This commit is contained in:
commit
d70953c4fa
1
code/serveur/dump.url
Normal file
1
code/serveur/dump.url
Normal file
|
@ -0,0 +1 @@
|
|||
http://www.lirmm.fr/~lafourcade/JDM-LEXICALNET-FR/
|
48
code/serveur/dump2mysql.sh
Normal file
48
code/serveur/dump2mysql.sh
Normal file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo " dump2sql.sh : conversion des dumps de JeuxDeMots vers du sql (mysql)." >&2
|
||||
echo " La progression est affichée avec pv. Si vous n'avez pas pv, supprimez la ligne correspondante dans ce script." >&2
|
||||
echo " Et c'est parti !" >&2
|
||||
echo >&2
|
||||
|
||||
# game_played(type) : 0=partie de référence initiale, 1=partie d'un joueur.
|
||||
|
||||
cat <<EOF
|
||||
start transaction;
|
||||
create database if not exists pticlic;
|
||||
use pticlic;
|
||||
create table node(eid integer auto_increment, name varchar(255), type integer, weight integer, primary key(eid));
|
||||
create table relation(rid integer auto_increment, start integer, end integer, type integer, weight integer, primary key(rid));
|
||||
create table type_node(name varchar(255), num integer, primary key(num));
|
||||
create table type_relation(name varchar(255), num integer, extended_name varchar(16384), info varchar(16384), primary key(num));
|
||||
create table user(login varchar(255), mail varchar(255), hash_mdp char(32), primary key(login));
|
||||
create table game(pid integer auto_increment, eid_central_word integer, relation_1 integer, relation_2 integer, relation_3 integer, relation_4 integer, reference_played_game integer, primary key(pid));
|
||||
create table game_cloud(pid integer, num integer, eid_word integer);
|
||||
create table game_played(pid integer, type integer, num integer, relation integer, weight integer);
|
||||
EOF
|
||||
|
||||
# tr : pour virer le CRLF qui traîne
|
||||
# Le gros tas de sed / tr : pour virer le newline dans une des description étendue
|
||||
cat "$1" \
|
||||
| iconv -f iso-8859-1 -t utf-8 \
|
||||
| tr '\r' ' ' \
|
||||
| sed -e 's/X/XX/g' | sed -e 's/A/Xa/g' | tr '\n' 'A' | sed -e 's/A")/")/g' | tr 'A' '\n' | sed -e 's/Xa/A/g' | sed -e 's/XX/X/g' \
|
||||
| pv -s $(wc -c "$1" | cut -d ' ' -f 1) \
|
||||
| sed -e "s#'#''#g" \
|
||||
| sed -E -e 's#^// [0-9]+ occurrences of relations ([a-z_]+) \(t=([0-9]+) nom_etendu="([^"]+)" info="([^"]+)"\)$#insert into type_relation(name, num, extended_name, info) values('\''\1'\'', \2, '\''\3'\'', '\''\4'\'');#' \
|
||||
| sed -E -e 's#^// [0-9]+ occurrences of nodes ([a-z_]+) \(t=([0-9]+)\)$#insert into type_node(name, num) values('\''\1'\'', \2);#' \
|
||||
| sed -E -e 's#^eid=([0-9]+):n="(.*)":t=([0-9]+):w=(-?[0-9]+)$#insert into node(eid, name, type, weight) values(\1, '\''\2'\'', '\''\3'\'', '\''\4'\'');#' \
|
||||
| sed -E -e 's#^rid=([0-9]+):n1=([0-9]+):n2=([0-9]+):t=([0-9]+):w=(-?[0-9]+)#insert into relation(rid, start, end, type, weight) values(\1,\2,\3,\4,\5);#' \
|
||||
| grep -v 'insert into node(eid, name, type, weight) values(0,' \
|
||||
| grep -v '^//' \
|
||||
| grep -v '^$'
|
||||
|
||||
cat <<EOF
|
||||
create index i_relation_start on relation(start);
|
||||
create index i_relation_end on relation(end);
|
||||
create index i_relation_type on relation(type);
|
||||
create index i_relation_end_type on relation(end,type);
|
||||
create index i_sessid_login on sessid(login);
|
||||
create index i_sessid_sid on sessid(sid);
|
||||
commit;
|
||||
EOF
|
28
code/serveur/parties.json
Normal file
28
code/serveur/parties.json
Normal file
|
@ -0,0 +1,28 @@
|
|||
// Requête : http://serveur/pticlic.php?action=getparties&nb=2&mode=normal
|
||||
[
|
||||
{
|
||||
id: 1234,
|
||||
cat1: 11,
|
||||
cat2: 23,
|
||||
cat3: 35,
|
||||
cat4: 12,
|
||||
center: { id: 555, "chat" },
|
||||
cloud: [
|
||||
{ id: 123, name: "souris" },
|
||||
{ id: 111, name: "lait" },
|
||||
{ id: 345, name: "machine à laver" }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 1235,
|
||||
cat1 : 12,
|
||||
cat2 : 34,
|
||||
cat3 : -1,
|
||||
cat4 : -1,
|
||||
center: { id: 666, "bouteille" },
|
||||
cloud: [
|
||||
{ id: 11359, name: "jus de fruit" },
|
||||
{ id: 111, name: "lait" }
|
||||
]
|
||||
}
|
||||
]
|
|
@ -8,8 +8,8 @@ $email_admin = ''; // Adresse e-mail Administrateur.
|
|||
// Base de donées.
|
||||
$sql_serveur = 'localhost'; // Serveur de la Base De Donnée (BDD).
|
||||
$sql_login = 'root'; // Login BDD.
|
||||
$sql_pass = ''; // Pass BDD.
|
||||
$sql_bdd = 'ptitclic'; // Nom de la BDD.
|
||||
$sql_pass = ' '; // Pass BDD.
|
||||
$sql_bdd = 'pticlic'; // Nom de la BDD.
|
||||
|
||||
// Quelques fonctions utiles.
|
||||
include("function.php");
|
|
@ -29,9 +29,14 @@ function secure($string)
|
|||
return $string;
|
||||
}
|
||||
|
||||
// TODO Yoann : fonction qui échappe les "
|
||||
function escape_json_string($str) {
|
||||
return $str;
|
||||
}
|
||||
|
||||
function mDie($err,$msg)
|
||||
{
|
||||
echo "Error:".$err.":".$msg;
|
||||
echo "{ error:\"".escape_json_string($err)."\", msg:\"".escape_json_string($msg)."\"}";
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -24,6 +24,38 @@ if(strcmp($data['passwd'],$passwd) != 0)
|
|||
mDie(3,"Nom d'utilisateur ou mot de passe incorrect");
|
||||
|
||||
|
||||
function random_node() {
|
||||
return mysql("select eid from node where eid = (abs(random()) % (select max(eid) from node))+1 or eid = (select max(eid) from node where eid > 0) order by eid desc limit 1;");
|
||||
}
|
||||
|
||||
function create_game($cloud_size) {
|
||||
// select random node
|
||||
$eid_center=random_node();
|
||||
|
||||
// select neighbors 1 hop
|
||||
$niveau1=mysql("select end from relation where start = 42 limit $taille_nuage;");
|
||||
|
||||
// select neighbors 2 hops
|
||||
$niveau2=mysql("select * from relation where start in (select end from relation where start = 42) limit $taille_nuage;");
|
||||
|
||||
// select neighbors relative to the end (one hop start->end, one hop start<-end).
|
||||
$niveau3=mysql("select * from relation where end in (select end from relation where start = 42) and type not in (4, 12, 36, 18, 29, 45, 46, 47, 48, 1000, 1001) limit $taille_nuage;");
|
||||
|
||||
// pour compléter si nécessaire :
|
||||
// select random words
|
||||
$niveau4=array();
|
||||
for ($i=0; $i < $cloud_size; $i++) {
|
||||
$niveau4[$i] = ???
|
||||
}
|
||||
|
||||
// start transaction;
|
||||
// insert into game $eid_center
|
||||
// insert into game_cloud [$cloud_size mots choisis dans $niveau1, $niveau2, $niveau3, $niveau4]
|
||||
// insert into game_played une partie de référence.
|
||||
// commit;
|
||||
}
|
||||
|
||||
|
||||
// Sinon tout est bon on effectu l'opération correspondant à la commande passée.
|
||||
if($cmd == 0) // "Get partie"
|
||||
{
|
11
organisation/mail
Normal file
11
organisation/mail
Normal file
|
@ -0,0 +1,11 @@
|
|||
= Mail =
|
||||
|
||||
- demande adresse genre support@pticlic.org à M. Lafourcade
|
||||
- Indiquer à M. Lafourcade qu'il peut accéder au code source du projet à l'adresse https://github.com/jsmaniac/2011-m1s2-ter , et s'il veut un accès en écriture, il suffit qu'il s'inscrive sur github et envoie son login à l'un de nous.
|
||||
- demander à M. Lafourcade l'installation d'Android + Plugin Eclipse sur postes du bât.6
|
||||
* Pas convaincu des 6h15 pour 10 ETCS !! Ne pas le dire dans le rapport... On a ce volume d'horaires d'un courTDTP en général sans prendre en compte le travail suppl à faire à la maison. Ca me semble pas juste, quoiqu'on lise
|
||||
* publier annonce pour recherche d'Alpha testeurs
|
||||
* annonce AlphaTesteurs Forums Android
|
||||
* mail betatesteurs avec lien vers PtitClic version Lafourcade LUNDI 31/01/2011
|
||||
* download and install Gantt Project
|
||||
* fichier pticlic.gan (github)
|
3
organisation/notes
Normal file
3
organisation/notes
Normal file
|
@ -0,0 +1,3 @@
|
|||
- Une classe Constante pour toutes les constantes ("symboles" pour les paramètres, ...).
|
||||
- Boutons pour les différents modes de jeu directement sur la "page de garde".
|
||||
- Créer un splash au démarrage.
|
|
@ -66,6 +66,32 @@ The Android operating system software stack consists of Java applications runnin
|
|||
\item Caractères non échappés dans le dump de la base.% gd
|
||||
\end{itemize}
|
||||
|
||||
\section{Compte rendu des réunions}
|
||||
\subsection{14 janvier 2010}
|
||||
Outils :
|
||||
\begin{itemize}
|
||||
\item Langage Java
|
||||
\item Eclipse (version la plus récente)
|
||||
\item Plugin ADT (Android Developper Toolkit)
|
||||
\item SDK Android
|
||||
\item Github
|
||||
\item LaTeX
|
||||
\item JUnit peut-être
|
||||
\end{itemize}
|
||||
|
||||
Durée du projet 4 mois (4 itérations de 4 semaines)
|
||||
|
||||
Conventions de code : http://java.sun.com/docs/codeconv/html/CodeConventions.doc6.html
|
||||
|
||||
Code (noms de variables, etc.) en anglais, commentaires en français, javadoc en français.
|
||||
|
||||
\subsection{26 janvier 2011}
|
||||
Mettre le serveur (PHP) sur free.fr, pour pouvoir tester facilement
|
||||
|
||||
Utilisation d'une classe \verb!Constant!
|
||||
|
||||
Écran d'accueil du jeu : Image (splash), puis directement les icônes des modes de jeu + configuration, au lieu d'avoir un écran avec le logo et jouer/config, suivi du choix du mode de jeu.
|
||||
|
||||
\section{Deuxième section}
|
||||
\section{Troisième section}
|
||||
\newpage
|
||||
|
|
Loading…
Reference in New Issue
Block a user