debug_routematch = false
debug_templates = true
default_locale_name = en
-sqlalchemy.url = postgresql+psycopg2://xonstat:xonstat@localhost:5432/xonstatdb
+sqlalchemy.url = postgresql+psycopg2://xonstat:xonstat@localhost:5433/xonstatdb
session.type = file
session.data_dir = %(here)s/data/sessions/data
session.lock_dir = %(here)s/data/sessions/lock
session.key = xonstat
-session.secret = 433fa4b080c2147c79c0ed1cb54e3ce81371fb33
+session.secret = CHANGEMECHANGEMECHANGEME
jinja2.directories = xonstat:templates
mako.directories = xonstat:templates
+# how many "real" players are required before the data
+# is stored in the database
+xonstat.minimum_required_players = 1
+
[pipeline:main]
pipeline =
egg:WebError#evalerror
qualname = xonstat
[logger_sqlalchemy]
-level = INFO
+level = WARN
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
import logging\r
import re\r
import time\r
+from pyramid.config import get_current_registry\r
from pyramid.response import Response\r
from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound\r
from xonstat.models import *\r
"""\r
flg_has_min_real_players = True\r
\r
+ settings = get_current_registry().settings\r
+ try: \r
+ minimum_required_players = int(\r
+ settings['xonstat.minimum_required_players'])\r
+ except:\r
+ minimum_required_players = 2\r
+\r
real_players = 0\r
for events in player_events:\r
if is_real_player(events):\r
real_players += 1\r
\r
#TODO: put this into a config setting in the ini file?\r
- if real_players < 1:\r
+ if real_players < minimum_required_players:\r
flg_has_min_real_players = False\r
\r
return flg_has_min_real_players\r
"""\r
flg_has_req_metadata = True\r
\r
- if 'T' not in game_meta or\\r
- 'G' not in game_meta or\\r
- 'M' not in game_meta or\\r
- 'S' not in game_meta:\r
+ if 'T' not in metadata or\\r
+ 'G' not in metadata or\\r
+ 'M' not in metadata or\\r
+ 'S' not in metadata:\r
flg_has_req_metadata = False\r
\r
return flg_has_req_metadata\r
start_dt=datetime.datetime(\r
*time.gmtime(float(game_meta['T']))[:6]), \r
server_id=server.server_id, game_type_cd=game_meta['G'], \r
- map_id=gmap.map_id, winner=winner)\r
+ map_id=gmap.map_id)\r
\r
# find or create a record for each player\r
# and add stats for each if they were present at the end\r