diff -ur c:\il2_stats_patching\il2_stats_1.2.32\il2_stats/src/core/urls.py ./src/core/urls.py --- c:\il2_stats_patching\il2_stats_1.2.32\il2_stats/src/core/urls.py 2019-06-12 18:29:02.358685400 -0600 +++ ./src/core/urls.py 2019-05-06 08:07:40.560821600 -0600 @@ -33,6 +33,7 @@ url(r'^robots\.txt$', RedirectView.as_view(url=staticfiles_storage.url('robots.txt'))), url(r'^admin/', admin.site.urls), + url(r'^maps/$', chunks.views.page, {'key': 'maps', 'template': 'maps.html'}, name='maps'), url(r'^faq/$', chunks.views.page, {'key': 'faq', 'template': 'faq.html'}, name='faq'), url(r'^info/$', chunks.views.page, {'key': 'info', 'template': 'info.html'}, name='info'), url(r'^', include('stats.urls', namespace='stats')), Only in ./src/custom: __pycache__ diff -ur c:\il2_stats_patching\il2_stats_1.2.32\il2_stats/src/locale/de/LC_MESSAGES/django.po ./src/locale/de/LC_MESSAGES/django.po --- c:\il2_stats_patching\il2_stats_1.2.32\il2_stats/src/locale/de/LC_MESSAGES/django.po 2019-06-12 18:29:02.456424100 -0600 +++ ./src/locale/de/LC_MESSAGES/django.po 2019-04-30 07:55:13.978171500 -0600 @@ -3424,7 +3424,7 @@ #: .\stats\templates\pilot_sortie.html:688 msgctxt "sortie" -msgid "Coalition won a mission" +msgid "Coalition won the mission" msgstr "Koalition hat die Mission gewonnen" #: .\stats\templates\pilot_sortie.html:709 diff -ur c:\il2_stats_patching\il2_stats_1.2.32\il2_stats/src/locale/es/LC_MESSAGES/django.po ./src/locale/es/LC_MESSAGES/django.po --- c:\il2_stats_patching\il2_stats_1.2.32\il2_stats/src/locale/es/LC_MESSAGES/django.po 2019-06-12 18:29:02.484349600 -0600 +++ ./src/locale/es/LC_MESSAGES/django.po 2019-04-30 07:55:13.989142100 -0600 @@ -3365,7 +3365,7 @@ #: .\stats\templates\pilot_sortie.html:688 msgctxt "sortie" -msgid "Coalition won a mission" +msgid "Coalition won the mission" msgstr "Coalición ganó la misión" #: .\stats\templates\pilot_sortie.html:709 diff -ur c:\il2_stats_patching\il2_stats_1.2.32\il2_stats/src/locale/fr/LC_MESSAGES/django.po ./src/locale/fr/LC_MESSAGES/django.po --- c:\il2_stats_patching\il2_stats_1.2.32\il2_stats/src/locale/fr/LC_MESSAGES/django.po 2019-06-12 18:29:02.516264200 -0600 +++ ./src/locale/fr/LC_MESSAGES/django.po 2019-04-30 07:55:13.996123400 -0600 @@ -3370,7 +3370,7 @@ #: .\stats\templates\pilot_sortie.html:688 msgctxt "sortie" -msgid "Coalition won a mission" +msgid "Coalition won the mission" msgstr "La coalition a gagné une mission" #: .\stats\templates\pilot_sortie.html:709 diff -ur c:\il2_stats_patching\il2_stats_1.2.32\il2_stats/src/locale/ru/LC_MESSAGES/django.po ./src/locale/ru/LC_MESSAGES/django.po --- c:\il2_stats_patching\il2_stats_1.2.32\il2_stats/src/locale/ru/LC_MESSAGES/django.po 2019-06-12 18:29:02.546184500 -0600 +++ ./src/locale/ru/LC_MESSAGES/django.po 2019-04-30 07:55:14.004104000 -0600 @@ -3342,7 +3342,7 @@ #: .\stats\templates\pilot_sortie.html:688 msgctxt "sortie" -msgid "Coalition won a mission" +msgid "Coalition won the mission" msgstr "Коалиция победила в миссии" #: .\stats\templates\pilot_sortie.html:709 diff -ur c:\il2_stats_patching\il2_stats_1.2.32\il2_stats/src/stats/stats_whore.py ./src/stats/stats_whore.py --- c:\il2_stats_patching\il2_stats_1.2.32\il2_stats/src/stats/stats_whore.py 2019-06-12 18:29:03.142589600 -0600 +++ ./src/stats/stats_whore.py 2019-04-19 11:51:42.830510400 -0600 @@ -49,12 +49,16 @@ waiting_new_report = False online_timestamp = 0 + logger.info(MISSION_REPORT_PATH) + while True: new_reports = [] for m_report_file in MISSION_REPORT_PATH.glob('missionReport*[[]0[]].txt'): if m_report_file.name not in processed_reports: new_reports.append(m_report_file) + #logger.info(len(new_reports)) + if len(new_reports) > 1: waiting_new_report = False # обрабатываем все логи кроме последней миссии @@ -64,11 +68,15 @@ processed_reports.append(m_report_file.name) continue elif len(new_reports) == 1: + #logger.info('Doing something with that report 0 file') m_report_file = new_reports[0] m_report_files = collect_mission_reports(m_report_file=m_report_file) online_timestamp = update_online(m_report_files=m_report_files, online_timestamp=online_timestamp) # если последний файл был создан более 2х минут назад - обрабатываем его + #logger.info('time check') + #logger.info(time.time() - m_report_files[-1].stat().st_mtime) if time.time() - m_report_files[-1].stat().st_mtime > 120: + #logger.info('inside if block') waiting_new_report = False stats_whore(m_report_file=m_report_file) cleanup(m_report_file=m_report_file) @@ -781,12 +789,13 @@ # бонус процент bonus_pct = 0 bonus_dict = {} + penalty_pct = 0 # бонусы получают только "честные" игроки if new_sortie.fairplay == 100: if new_sortie.is_landed: - bonus_pct += 25 - bonus_dict['landed'] = 25 + bonus_pct += 100 + bonus_dict['landed'] = 100 if new_sortie.coalition == new_sortie.mission.winning_coalition: bonus_pct += 25 bonus_dict['winning_coalition'] = 25 @@ -799,7 +808,20 @@ bonus_score = new_sortie.score * bonus_pct // 100 new_sortie.score_dict['bonus'] = bonus_score new_sortie.score += bonus_score + + if new_sortie.is_dead or new_sortie.is_captured: + penalty_pct = 100 + elif new_sortie.is_bailout: + penalty_pct = 50 + elif new_sortie.is_shotdown: + penalty_pct = 20 + + new_sortie.score = new_sortie.score * ((100 - penalty_pct) / 100) + new_sortie.score_dict['penalty_pct'] = penalty_pct + penalty_score = new_sortie.score * (100 - new_sortie.fairplay) // 100 new_sortie.score_dict['penalty'] = penalty_score new_sortie.score -= penalty_score + if new_sortie.score < 0: + new_sortie.score = 0 # new_sortie.save() diff -ur c:\il2_stats_patching\il2_stats_1.2.32\il2_stats/src/stats/templates/pilot_sortie.html ./src/stats/templates/pilot_sortie.html --- c:\il2_stats_patching\il2_stats_1.2.32\il2_stats/src/stats/templates/pilot_sortie.html 2019-06-12 18:29:06.559452100 -0600 +++ ./src/stats/templates/pilot_sortie.html 2019-04-30 07:54:51.179187600 -0600 @@ -657,6 +657,26 @@ {% endif %} + {% if sortie.score_dict.penalty_pct %} +