+
+
+
+
+
+ Time |
+ SteamID |
+ Name |
+ Message |
+
+
+
+{%- for chat in chats %}
+
+
+ {{ (chat.tick * session.tickinterval) | to_duration }}
+ |
+ {{ chat.player_guid }} |
+ {{ chat.name }} |
+ {{ chat.chat }} |
+
+{%- endfor %}
+
+
@@ -154,7 +168,7 @@ var g_events = [
playlist.load([
{%- for guid, psess in player_sessions.items() %}
{%- if psess.voicetime > 0 %}
-{src: "/static/css-ze-parsed/{{ session.demoname }}/voice/{{ guid }}.demopus", name: "{{ guid }}"},
+{src: "/static/css-ze-parsed/{{ session.demoname }}/voice/{{ guid }}.demopus", name: "{{ guid }}", info: "{{ psess.player.name }}"},
{%- endif -%}
{% endfor %}
]).then(function() {
diff --git a/demweb/views.py b/demweb/views.py
index 34c1cac..5b5a9b1 100644
--- a/demweb/views.py
+++ b/demweb/views.py
@@ -40,3 +40,16 @@ def session(session_id):
chats=chats,
events=events
)
+
+@bp.route('/player/
')
+def player(guid):
+ player = Player.query.filter_by(guid=guid).one()
+ if not player:
+ return '404 Not Found', 404
+
+ player_sessions = PlayerSession.query.filter_by(player_guid=guid).all()
+
+ return render_template('player.html',
+ player=player,
+ player_sessions=player_sessions
+ )
diff --git a/parser.py b/parser.py
index 9eb481d..4860fe6 100644
--- a/parser.py
+++ b/parser.py
@@ -125,7 +125,7 @@ def parse_demo(path):
kills = models.Player.kills + obj['kills'],
voicetime = models.Player.voicetime + obj['voicetime'],
first_seen = func.least(models.Player.first_seen, starttime),
- last_seen = func.greatest(models.Player.first_seen, starttime),
+ last_seen = func.greatest(models.Player.last_seen, starttime),
))
db.session.commit()
break
@@ -225,9 +225,11 @@ def parse_demo(path):
eventdata = obj.copy()
del eventdata['tick']
del eventdata['event']
+ if 'steamid' in eventdata:
+ del eventdata['steamid']
event = models.Event(
- player_guid=guid,
+ player_guid=obj['steamid'] if 'steamid' in obj else None,
session_id=session.id,
tick=obj['tick'],
time=starttime + timedelta(seconds=obj['tick'] * tickinterval),
diff --git a/requirements.txt b/requirements.txt
index 88606fd..8cbca54 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -12,6 +12,7 @@ orjson==3.5.2
python-dotenv==0.17.1
SQLAlchemy==1.4.15
tqdm==4.60.0
+uWSGI==2.0.19.1
Werkzeug==2.0.0
zope.event==4.5.0
zope.interface==5.4.0