-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change pong-server file architecture to properly separate the differe…
…nt programs
- Loading branch information
Showing
32 changed files
with
139 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
src/game_creator/shared_code | ||
src/game_server/shared_code | ||
src/redirection_server_deprecated/shared_code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
FROM python:3.12.0-bookworm | ||
|
||
# Créez le répertoire de travail et définissez-le comme répertoire de travail actuel | ||
RUN mkdir /app | ||
WORKDIR /app | ||
|
||
# Copiez le fichier requirements.txt dans le conteneur | ||
COPY requirements.txt /app/ | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the gunicorn config file | ||
COPY gunicorn/gunicorn.conf.py /app/gunicorn.conf.py | ||
|
||
# Installez les dépendances | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
COPY run.sh /app/run.sh | ||
RUN chmod +x /app/run.sh | ||
|
||
ARG PONG_GAME_APP_PATH | ||
ARG GAME_SERVER_PATH | ||
ARG PONG_GAME_SERVERS_MIN_PORT | ||
ARG PONG_GAME_SERVERS_MAX_PORT | ||
|
||
ENV PONG_GAME_APP_PATH=${PONG_GAME_APP_PATH} | ||
ENV GAME_SERVER_PATH=${GAME_SERVER_PATH} | ||
ENV PONG_GAME_SERVERS_MIN_PORT=${PONG_GAME_SERVERS_MIN_PORT} | ||
ENV PONG_GAME_SERVERS_MAX_PORT=${PONG_GAME_SERVERS_MAX_PORT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
# Copy the volume code to the src folder so that I can modify it without | ||
# changing anything on the host machine | ||
cp -r /app/pong_server_code /app/src | ||
|
||
# Copy the shared code to the game_creator folder | ||
rm -rf /app/src/game_creator/shared_code | ||
cp -r /app/src/shared_code /app/src/game_creator/shared_code | ||
|
||
# Copy the shared code to the game_server folder | ||
rm -rf /app/src/game_server/shared_code | ||
cp -r /app/src/shared_code /app/src/game_server/shared_code | ||
|
||
# Run game_creator | ||
gunicorn -c /app/gunicorn.conf.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
pylint () { | ||
( | ||
cd $1 && | ||
isort . && | ||
flake8 . --max-line-length=95 | ||
) | ||
} | ||
|
||
pylint src/game_creator | ||
pylint src/game_server | ||
pylint src/shared_code | ||
|
||
pylint src/redirection_server_deprecated |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from api.views import CreateGameView | ||
from django.urls import path | ||
|
||
from api.views import CreateGameView | ||
|
||
urlpatterns = [ | ||
path('', CreateGameView.as_view(), name='create_game'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
pong_server/src/game_server/Scene/PlayerFinder/PlayerFinder.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
pong_server/src/game_server/Scene/PlayerFinder/PlayerLocation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import src.game_server.settings as settings | ||
import settings as settings | ||
|
||
|
||
class BallBoundingBox(object): | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.