Skip to content

Commit

Permalink
Merge pull request spookybear0#68 from EboMike/cleanup
Browse files Browse the repository at this point in the history
Ran the entire codebase through the Linter.
  • Loading branch information
spookybear0 authored May 8, 2024
2 parents 887999b + 1afa865 commit 0206b78
Show file tree
Hide file tree
Showing 73 changed files with 3,786 additions and 3,488 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
python -m pytest --cov=./ --cov-report=xml --cov-report=html
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
python -m pytest --cov=./ --cov-report=xml --cov-report=html
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# laserforce_ranking

[![Python application](https://github.com/EboMike/laserforce_ranking/actions/workflows/python-app.yml/badge.svg)](https://github.com/EboMike/laserforce_ranking/actions/workflows/python-app.yml)
15 changes: 9 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import asyncio
import os
import sys
import asyncio
import router
from shared import app
from sanic.server.async_server import AsyncioServer
from mysql import MySQLPool
import threading

import webview
from sanic.server.async_server import AsyncioServer

import router
from mysql import MySQLPool
from shared import app

path = os.path.dirname(os.path.abspath(__file__))
os.chdir(path)
sys.path.append(path)


async def main():
router.add_all_routes(app)
app.static("assets", "assets", name="assets")
Expand All @@ -30,4 +33,4 @@ async def main():
threading.Thread(target=lambda: loop.run_until_complete(main()), daemon=True).start()

webview.create_window("Test", "http://localhost:8000/")
webview.start(http_server=True)
webview.start(http_server=True)
35 changes: 19 additions & 16 deletions assets/html/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,37 @@
<div class="info_div">
<h1>Website Info</h1>
<p>
This site was made for Invasion Laser Tag members to track and compare their stats to others
while providing a more fairand balanced matchmaking system for SM5 and Laserball.
The project is made for fun but improvements will continue to be made.
This site was made for Invasion Laser Tag members to track and compare their stats to others while providing
a more fair and balanced matchmaking system for SM5 and Laserball. The project is made for fun but
improvements will continue to be made.
If you have any comments or suggestions please contact me at <a href="mailto:collinmcarroll@gmail.com">collinmcarroll@gmail.com</a>.

<br><br>
Made with Python (PyPy) 3.10, sanic, jinja2, and tortoise-orm with MySql.
Ranking system uses a modified version of Microsoft's TrueSkill algorithm.
Made with Python (PyPy) 3.10, sanic, jinja2, and tortoise-orm with MySql. Ranking system uses a modified
version of Microsoft's TrueSkill algorithm.
</p>
<h1>Project Goals and Ambitions</h1>
<p>
The goal is to create a more balanced matchmaking system for SM5 and Laserball to create more fair, fun, and competitive games.
Games where teams are evenly matched are more fun for everyone.
This project also serves as a way to track your stats and see how you compare to other players.
The goal is to create a more balanced matchmaking system for SM5 and Laserball to create more fair, fun, and
competitive games. Games where teams are evenly matched are more fun for everyone. This project also serves
as a way to track your stats and see how you compare to other players.
</p>
<h1>Matchmaking/Ranking System</h1>
<p>
The ranking system used in this project is a modified version of the TrueSkill algorithm. It is a Bayesian ranking system that
takes into account the number of players, the number of teams, and the number of players per team. It is also used in games such as Halo 5.
For this use case, the algorithm is modified to take into account player performance for each game. The reason for this is so that
you can't just be carried by your team to a higher rank. This ranking system is used for both SM5 and Laserball to create more fair and balanced games.
The ranking system used in this project is a modified version of the TrueSkill algorithm. It is a Bayesian
ranking system that takes into account the number of players, the number of teams, and the number of players
per team. It is also used in games such as Halo 5. For this use case, the algorithm is modified to take into
account player performance for each game. The reason for this is so that you can't just be carried by your
team to a higher rank. This ranking system is used for both SM5 and Laserball to create more fair and
balanced games.
</p>
<h1>Open Source!</h1>
<p>
This project is open source, meaning the code is free to use and modify (with the restrictions of the licensing).
This project is open source, meaning the code is free to use and modify (with the restrictions of the
licensing).
You can find the code on my GitHub page <a href="https://github.com/spookybear0/laserforce_ranking">here</a>.
If you have any questions about usage or want to contribute in the form of code or suggestions, please contact me at
<a href="mailto:collinmcarroll@gmail.com">collinmcarroll@gmail.com</a>.
If you have any questions about usage or want to contribute in the form of code or suggestions, please
contact me at <a href="mailto:collinmcarroll@gmail.com">collinmcarroll@gmail.com</a>.
</p>
</div>
</div>
Expand Down
14 changes: 7 additions & 7 deletions assets/html/admin/player.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
{% block html_head %}
<style>

h1, h3, h5 {
text-align: center;
padding: 0;
margin-top: 0.25em;
margin-bottom: 0.25em;
scale: 1.1;
}
h1, h3, h5 {
text-align: center;
padding: 0;
margin-top: 0.25em;
margin-bottom: 0.25em;
scale: 1.1;
}

</style>
{% endblock %}
Expand Down
Loading

0 comments on commit 0206b78

Please sign in to comment.