-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from agentsofthesystem/develop
Several Improvements, Documentation Updates, and Bug Fixes
- Loading branch information
Showing
30 changed files
with
743 additions
and
197 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
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,39 @@ | ||
"""Add updates to the game server table. | ||
Revision ID: database_v1 | ||
Revises: | ||
Create Date: 2023-10-08 14:10:31.088339 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
from application.common.constants import GameStates | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "database_v3" | ||
down_revision = "database_v2" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("games", schema=None) as batch_op: | ||
batch_op.add_column( | ||
sa.Column( | ||
"game_state", | ||
sa.String(length=25), | ||
default=GameStates.NOT_STATE.value, | ||
nullable=False, | ||
) | ||
) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("games", schema=None) as batch_op: | ||
batch_op.drop_column("game_state") | ||
# ### end Alembic commands ### |
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,32 @@ | ||
from flask import jsonify | ||
|
||
from application.models.games import Games | ||
from application.models.settings import Settings | ||
from application.models.tokens import Tokens | ||
|
||
|
||
def get_startup_data(): | ||
startup_data = {} | ||
game_server_list = {} | ||
token_list = {} | ||
settings_list = {} | ||
|
||
# All Games | ||
all_games = Games.query.all() | ||
game_server_list = [x.to_dict() for x in all_games] | ||
|
||
# All Active Tokens | ||
all_active_tokens = Tokens.query.filter_by(token_active=True).all() | ||
token_list = [x.to_dict() for x in all_active_tokens] | ||
|
||
# All Settings | ||
all_settings = Settings.query.all() | ||
settings_list = [x.to_dict() for x in all_settings] | ||
|
||
startup_data = { | ||
"games": game_server_list, | ||
"tokens": token_list, | ||
"settings": settings_list, | ||
} | ||
|
||
return jsonify(startup_data) |
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
Oops, something went wrong.