now tools -- wiki and sqldump

4 views
Skip to first unread message

mysq...@gmail.com

unread,
Sep 14, 2008, 11:08:47 PM9/14/08
to mysqlgame
OK so if you refresh dashboard, you'll see a couple of new links at
the top for wiki and sqldump. Wiki is a wiki. It would be cool if some
of the knowledge that's come up here was documented over there, but do
whatever you want with it. Sqldump is a link to dumps that will
hopefully be updated every night, midnight EST. The cron hasn't run
successfully yet, but I think tonight might be the night. :)

Olivier has been helpful in trying to get the dumps to import in
databases *other* than mysql -- hopefully it's working for that now
too, but I'm not sure.

It's possible for the dump for a given shard to fail because it's
taking too long, and it gets killed so it won't use too much CPU. For
those of you writing tools, the url is constant, and the export date
is listed at the top of the file, so if that doesn't change, the
export failed. If dumps seem to be running ok without causing
problems, we may move them to a more frequent schedule.

Also in this update:
- finally fixed that embarrassing multiple-defense-multiplier-ignores-
constraints bug.
- expiration emails will say which shard they're coming from.

--Jack

mysq...@gmail.com

unread,
Sep 14, 2008, 11:12:02 PM9/14/08
to mysqlgame
Oh, and a section of the wiki on feature requests would be really
helpful.

Warll

unread,
Sep 15, 2008, 2:01:22 AM9/15/08
to mysqlgame
Ok I added two pages. Do what you want with them, I won't feel "too"
heart broken if they were to be deleted.

Vince

unread,
Sep 15, 2008, 4:08:53 AM9/15/08
to mysqlgame
That roxx !

Vince

unread,
Sep 15, 2008, 5:22:56 AM9/15/08
to mysqlgame
my contribution :
-----------------------

DELIMITER $$

DROP PROCEDURE IF EXISTS mysqlgame.scan_good_targets$$

CREATE PROCEDURE mysqlgame.scan_good_targets (rowidlow int, rowidhigh
int, myAM int, myrowid int)
BEGIN
select row_id 'id', money-(attackers*attack_multiplier/myAM +
defenders*defense_multiplier/myAM) * 20 'gain',
rows.name 'row', players.name 'plyer', money, fuel,
attackers 'att', attack_multiplier 'AM', defenders 'def',
defense_multiplier 'DM',
fuel/(ABS(row_id - myrowid)*0.125)
'nb_att_free_launch',
(attackers*attack_multiplier/myAM +
defenders*defense_multiplier/myAM) 'destry_limit',
ABS(row_id - myrowid)*0.125 'fl_cost_per_att'
from rows
inner join players on rows.owner = players.player_id
where (defense_multiplier >= (myAM-3) or attack_multiplier >=
(myAM-3))
and money > (attackers*attack_multiplier/myAM +
defenders*defense_multiplier/myAM) * 20
and row_id between rowidlow and rowidhigh
ORDER BY 2 DESC;
END$$

DELIMITER ;

dolmen

unread,
Sep 15, 2008, 9:38:24 PM9/15/08
to mysqlgame


On 15 sep, 05:08, mysqlg...@gmail.com wrote:
> Olivier has been helpful in trying to get the dumps to import in
> databases *other* than mysql -- hopefully it's working for that now
> too, but I'm not sure.

The SQL dump is now running fine in SQLite 3.

Here is my import script (named mysqlgame3.sh) :
--------8<--------8<--------8<--------8<--------8<--------
#!/bin/bash
db=$(basename "$0" .sh)
[[ -f "$db.db" ]] && rm -f "$db.db"
unzip -p "$db.zip" "$db.sql" | sqlite3 "$db.db"
--------8<--------8<--------8<--------8<--------8<--------

Olivier.
Reply all
Reply to author
Forward
0 new messages