This commit is contained in:
Bertrand BRUN 2011-02-12 15:41:11 +01:00
commit 480074037f
8 changed files with 28 additions and 18 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -1,6 +0,0 @@
cat dump.url
# Aller à cette adresse, et télécharger le dernier dump
./dump2sqlite.sh 01232011-LEXICALNET-JEUXDEMOTS-FR-NOHTML.txt > sql
pv sql | sqlite3 php/db
sudo chown -R user.www-data php
chmod 664 php/db

16
code/serveur/README.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
# cat dump.url
# Aller à cette adresse, et télécharger le dernier dump
echo "Étape 1/3 : Téléchargement"
wget 'http://www.lirmm.fr/~lafourcade/JDM-LEXICALNET-FR/02122011-LEXICALNET-JEUXDEMOTS-FR-NOHTML.txt'
echo "Étape 2/3 : Conversion vers sql"
./dump2sqlite.sh 01232011-LEXICALNET-JEUXDEMOTS-FR-NOHTML.txt > sql
echo "Étape 3/3 : Insertion dans la bdd"
mv php/db php/db.old
pv sql | sqlite3 php/db
sudo chown -R $USER.www-data php
chmod 664 php/db

View File

@ -1 +1 @@
http://www.lirmm.fr/~lafourcade/JDM-LEXICALNET-FR/
http://www.lirmm.fr/~lafourcade/JDM-LEXICALNET-FR/?C=M;O=D

View File

@ -8,6 +8,7 @@ echo " Et c'est parti !" >&2
echo >&2
# Played_game(type) : 0 => partie de référence, 1 => joueur
# Note : l'index i_played_game_all sert à la vérification lors du set_partie.
cat <<EOF
begin transaction;
@ -20,7 +21,15 @@ create table game(gid integer primary key autoincrement, eid_central_word, relat
create table game_cloud(gid, num, difficulty, eid_word, totalWeight, probaR1, probaR2, probaR0, probaTrash);
create table played_game(pgid integer primary key autoincrement, gid, login, timestamp);
create table played_game_cloud(pgid, gid, type, num, relation, weight, score);
insert into user(login, mail, hash_passwd, score) values('foo', 'foo@isp.com', '$(echo -n 'bar' | md5sum | cut -d ' ' -f 1)', 0);
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_start_type on relation(start,type);
create index i_relation_end_type on relation(end,type);
create index i_played_game_all on played_game(pgid, gid, login, timestamp);
EOF
# tr : pour virer le CRLF qui traîne
@ -38,13 +47,4 @@ cat "$1" \
| grep -v '^//' \
| grep -v '^$'
# Note : l'index i_played_game_all sert à la vérification lors du set_partie.
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_start_type on relation(start,type);
create index i_relation_end_type on relation(end,type);
create index i_played_game_all on played_game(pgid, gid, login, timestamp);
commit;
EOF
echo "commit;"

View File

@ -159,7 +159,7 @@ function cg_build_result_sets($cloudSize, $centerEid, $r1, $r2)
*/
function cg_choose_relations()
{
$relations = array(5, 7, 9, 10, /* Pas d'icônes pour celles-ci. */ 13, 14, 22);
$relations = array(5, 7, 9, 10);// /* Pas d'icônes pour celles-ci. */ 13, 14, 22);
$r1 = rand(0,count($relations)-1);
$r2 = rand(0,count($relations)-2);