45 lines
No EOL
2.5 KiB
Text
45 lines
No EOL
2.5 KiB
Text
------------------------------------------
|
|
developers only! this game is currently not playable!
|
|
|
|
main.py is the main script. call this from a browser.
|
|
|
|
the init_webgo.main() in main.py reinitializes the whole database on each call, so
|
|
comment the line out if you do not want that. init_webgo also creates two test users,
|
|
gast and gast2. password = username. you can use those to log in.
|
|
------------------------------------------
|
|
want to create your own goban images? Simple: just replace the images in
|
|
imgsource/ with the desired ones. then run generate_goban_images.py and
|
|
the new images get written to img/.
|
|
------------------------------------------
|
|
overview of the files:
|
|
main.py -the main script. Essentially a wrapper that prints the
|
|
traceback if something went wrong.
|
|
login.py -this file contains functions for login and game
|
|
selection/modification.
|
|
goban.py -code for displaying a goban as a html page.
|
|
psql.py -all functions directly accessing the database.
|
|
init_webgo.py -re-initialize the whole game. deletes everything and
|
|
sets some defaults.
|
|
helper.py -small functions for string manipulation etc.
|
|
generate_goban_images.py
|
|
-recreate the goban images. just run from console.
|
|
gnugo.py -contains functions using gnugo in gtp mode. used for
|
|
evaluating wether or not a move is legal.
|
|
filehandling.py -contains functions for, well, file handling ;>
|
|
|
|
------------------------------------------
|
|
coding guidelines
|
|
tab == 4 whitespaces.
|
|
function names are all lowercase with _ as a seperator.
|
|
------------------------------------------
|
|
how is the data saved internally:
|
|
for each go game a table is generated. this table has a 'sgf' field containing the current board in sgf file format (needed for gnugo move validation). It also has fields for each goban field. The 'sgf' entry is the SPOT for the current state of the board.
|
|
If the board gets changed, this means the 'sgf' file gets changed and then the changed fields in the table get
|
|
updated accordingly. This is a bit unclean, but it means I do not have to write a sgf parser ;>
|
|
------------------------------------------
|
|
known bugs:
|
|
"DatabaseError: error 'ERROR: current transaction is aborted, commands ignored until end of transaction block"
|
|
seems to be a problem with mod_python and a cached database connection. /etc/init.d/apache2 restart helps.
|
|
|
|
in general: If you get an error message while coding and think you fixed the bug, but the error persists, try
|
|
reloading apache. |