moved docs into a 'documentation' directory
This commit is contained in:
parent
d588b554bf
commit
1b706ec81f
4 changed files with 0 additions and 0 deletions
49
documentation/development/INSTALL
Normal file
49
documentation/development/INSTALL
Normal file
|
@ -0,0 +1,49 @@
|
|||
----------------- creating the database --------------------
|
||||
#installing PostgreSQL the Debian way
|
||||
apt-get install postgresql
|
||||
su postgres
|
||||
#in template1
|
||||
psql template1
|
||||
#at the prompt write:
|
||||
CREATE DATABASE webgo ;
|
||||
#now create user who is allowed to administrate this database
|
||||
#user and password should be changed;>
|
||||
CREATE USER name PASSWORD 'password';
|
||||
#now make a super user out of this user:
|
||||
#TODO:tighter rights for user, this should be unsecure
|
||||
ALTER USER name CREATEUSER;
|
||||
#now change the user and password variables in the script
|
||||
|
||||
#default values at beginning of psql.py:
|
||||
#webgouser
|
||||
#webgopassword
|
||||
|
||||
----------------- configuring apache2 -----------------------
|
||||
|
||||
|
||||
Steps to do to get a runnable version:
|
||||
1. apt-get install apache2 libapache2-mod-python
|
||||
2. create /etc/apache2/conf.d/webgo.conf with content:
|
||||
|
||||
Alias /webgo /home/mtsrc/daten/projekte/webgo/
|
||||
|
||||
<DirectoryMatch /home/mtsrc/daten/projekte/webgo/>
|
||||
|
||||
AddHandler mod_python .py
|
||||
PythonHandler main
|
||||
PythonDebug On
|
||||
|
||||
|
||||
</DirectoryMatch>
|
||||
|
||||
|
||||
|
||||
You should replace the directory settings for optimal results ;>
|
||||
|
||||
3. set ownership of webgo directory to ownership of the web server
|
||||
-- since the use of mod_python this should not be needed?
|
||||
--------------------------------------------------------------
|
||||
|
||||
this should be all.
|
||||
try visiting http://localhost/webgo.main.py with a web browser.
|
||||
Errors get written to /tmp/cgi_errors.log and to the webpage.
|
29
documentation/development/README
Normal file
29
documentation/development/README
Normal file
|
@ -0,0 +1,29 @@
|
|||
------------------------------------------
|
||||
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.
|
||||
------------------------------------------
|
||||
some code snippets for reference:
|
||||
|
||||
|
||||
How to make the goban clickable:
|
||||
data += '<form method="post">'
|
||||
data += '<input type=image src="img/bottomrightline.png" name="untenrechts">'
|
||||
#insert rest of goban here
|
||||
data += '</form>'
|
||||
print data
|
||||
|
||||
How to extract the data from this POST with the cgi module:
|
||||
import cgi
|
||||
#get instance of fieldstorage
|
||||
form = cgi.FieldStorage()
|
||||
#if form == empty (which means if page is displayed for the first time):
|
||||
if form.keys() != []:
|
||||
#cut out the name of the clicked button
|
||||
print string.split(form.keys()[0],".x")[0]
|
||||
|
||||
------------------------------------------
|
55
documentation/development/ROADMAP
Normal file
55
documentation/development/ROADMAP
Normal file
|
@ -0,0 +1,55 @@
|
|||
|
||||
M0: debug messages as html
|
||||
Create a script that prints the python stderr of thea main script as html,
|
||||
so debugging the cgi becomes more easy.
|
||||
|
||||
M1: user interaction thorugh images
|
||||
Completed, when a user can click on an image, and the image gets replaced
|
||||
as a result.
|
||||
|
||||
m2: autogenerate images
|
||||
There are partly transparent images of black and white stones, center,
|
||||
border and hoshi squares, all available in png format. The Milestone is
|
||||
considered complete when the program can automatically generate combined
|
||||
images of all squares with all stones. The stones have to be on top ;>
|
||||
|
||||
m3: display working 9x9 goban
|
||||
Completed, when the cgi script has an internal representation of a goban
|
||||
that can handle stones, and this goban is displayed on a html page.
|
||||
|
||||
m4: handle player turns
|
||||
The program knows wether it is the turn of black or white, and prints the
|
||||
current turn color on the html page displaying the goban. If player white
|
||||
clicks on an empty square, a white stone will be layed onto that square.
|
||||
Same for Player black.
|
||||
|
||||
m5: goban inside database
|
||||
Manage the goban inside a postgresql database, so all user input changes a
|
||||
table in the database. Includes a 'size' item that contains the length of
|
||||
on side of the board, so that gobans of size 9x9, 13x13 and 19x19 can be
|
||||
displayed.
|
||||
|
||||
. <--- YOU ARE HERE.
|
||||
|
||||
m6: manage users and game sessions inside database
|
||||
manage user accounts and the game(s) they currently play inside the data-
|
||||
base. each game has its own table, which contains players, current turn,
|
||||
size, the goban inside the database. users are managed in a different
|
||||
table. For each user the following data is stored: password, current games
|
||||
(up to 8 or so). So if the user calls the cgi script, she has to send
|
||||
username and password and is then given the choice of game to play. If
|
||||
there is only one active game, directly present the goban.
|
||||
|
||||
m7: implement Go rules
|
||||
Do not accept player moves which violate go rules. Remove beaten stones.
|
||||
Count and display the score for each player.
|
||||
|
||||
m8: make it pretty, make it fast.
|
||||
Create nicer images replacing the old ones which were just for testing
|
||||
Find bottlenecks and optimize them for speed.
|
||||
-- python profiler
|
||||
-- http://peter.mapledesign.co.uk/weblog/archives/python_is_slow.html
|
||||
create a set of images smaller than 50 pixels (for the 19x19 goban)
|
||||
|
||||
m9: make it standards compliant
|
||||
w3c validation
|
1
documentation/development/TODO
Normal file
1
documentation/development/TODO
Normal file
|
@ -0,0 +1 @@
|
|||
- hoshi Bilder fuer weisse und schwarze Steine erstellen
|
Loading…
Add table
Add a link
Reference in a new issue