From dc8da40d680b3fc364da7514fff0d76ea348aae4 Mon Sep 17 00:00:00 2001 From: Sakimori Date: Fri, 26 Feb 2021 02:26:45 -0500 Subject: [PATCH 1/4] added subdomain to flask routes --- main_controller.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/main_controller.py b/main_controller.py index c88631f..ccbc8f6 100644 --- a/main_controller.py +++ b/main_controller.py @@ -7,12 +7,13 @@ import database as db app = Flask("the-prestige", static_folder='simmadome/build') app.config['SECRET KEY'] = 'dev' -#app.config['SERVER_NAME'] = '0.0.0.0:5000' +#url = "sakimori.space:5000" +#app.config['SERVER_NAME'] = url socketio = SocketIO(app) # Serve React App -@app.route('/', defaults={'path': ''}) -@app.route('/') +@app.route('/', defaults={'path': ''}, subdomain = "simsim") +@app.route('/', subdomain = "simsim") def serve(path): if path != "" and os.path.exists(app.static_folder + '/' + path): return send_from_directory(app.static_folder, path) @@ -21,7 +22,7 @@ def serve(path): ### API -@app.route('/api/teams/search') +@app.route('/api/teams/search', subdomain = "simsim") def search_teams(): query = request.args.get('query') page_len = int(request.args.get('page_len')) @@ -41,7 +42,7 @@ def search_teams(): MAX_SUBLEAGUE_DIVISION_TOTAL = 22; MAX_TEAMS_PER_DIVISION = 12; -@app.route('/api/leagues', methods=['POST']) +@app.route('/api/leagues', methods=['POST'], subdomain = "simsim") def create_league(): config = json.loads(request.data) @@ -113,7 +114,7 @@ def create_league(): ### SOCKETS -thread2 = threading.Thread(target=socketio.run,args=(app,'0.0.0.0')) +thread2 = threading.Thread(target=socketio.run,args=(app,'sakimori.space:5000')) thread2.start() master_games_dic = {} #key timestamp : (game game, {} state) From d7bb16350ca17c37abb24037d463ddd333f2eb99 Mon Sep 17 00:00:00 2001 From: Sakimori Date: Tue, 2 Mar 2021 16:52:48 -0500 Subject: [PATCH 2/4] rebranding to sim16 in progress --- main_controller.py | 12 ++++++------ simmadome/public/index.html | 6 +++--- simmadome/src/index.tsx | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/main_controller.py b/main_controller.py index ccbc8f6..ee29855 100644 --- a/main_controller.py +++ b/main_controller.py @@ -5,15 +5,15 @@ from flask import Flask, url_for, Response, render_template, request, jsonify, s from flask_socketio import SocketIO, emit import database as db -app = Flask("the-prestige", static_folder='simmadome/build') +app = Flask("the-prestige", static_folder='simmadome/build/', subdomain_matching=True) app.config['SECRET KEY'] = 'dev' #url = "sakimori.space:5000" #app.config['SERVER_NAME'] = url socketio = SocketIO(app) # Serve React App -@app.route('/', defaults={'path': ''}, subdomain = "simsim") -@app.route('/', subdomain = "simsim") +@app.route('/', defaults={'path': ''}) +@app.route('/') def serve(path): if path != "" and os.path.exists(app.static_folder + '/' + path): return send_from_directory(app.static_folder, path) @@ -22,7 +22,7 @@ def serve(path): ### API -@app.route('/api/teams/search', subdomain = "simsim") +@app.route('/api/teams/search') def search_teams(): query = request.args.get('query') page_len = int(request.args.get('page_len')) @@ -42,7 +42,7 @@ def search_teams(): MAX_SUBLEAGUE_DIVISION_TOTAL = 22; MAX_TEAMS_PER_DIVISION = 12; -@app.route('/api/leagues', methods=['POST'], subdomain = "simsim") +@app.route('/api/leagues', methods=['POST']) def create_league(): config = json.loads(request.data) @@ -114,7 +114,7 @@ def create_league(): ### SOCKETS -thread2 = threading.Thread(target=socketio.run,args=(app,'sakimori.space:5000')) +thread2 = threading.Thread(target=socketio.run,args=(app,"0.0.0.0", "80")) thread2.start() master_games_dic = {} #key timestamp : (game game, {} state) diff --git a/simmadome/public/index.html b/simmadome/public/index.html index 825a173..0e14326 100644 --- a/simmadome/public/index.html +++ b/simmadome/public/index.html @@ -8,10 +8,10 @@ ⚾ The Simmadome - - + + - + diff --git a/simmadome/src/index.tsx b/simmadome/src/index.tsx index a6f4b73..af620c4 100644 --- a/simmadome/src/index.tsx +++ b/simmadome/src/index.tsx @@ -42,13 +42,13 @@ function Header() { Github - + Twitter -

THE SIMMADOME

-

Join SIBR on to start your own games!

+

THE OBSERVATORY

+

Join us on to start your own games!

); } From fb03ed257f810857b07aff2c133e40620b2c2aad Mon Sep 17 00:00:00 2001 From: Sakimori Date: Tue, 2 Mar 2021 20:00:52 -0500 Subject: [PATCH 3/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 12cb7b4..cc814d0 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ blaseball, blaseball, is back! in an unofficial capacity. this project is completely unaffiliated with the game band. -we have custom players (generated by onomancer), custom teams, custom leagues, all set up in discord and watchable at https://simsim.sibr.dev! +we have custom players (generated by onomancer), custom teams, custom leagues, all set up in discord and watchable at http://sim16.sakimori.space! if you would like to add matteo to your server to be able to set up teams and games, you can do so with this link: https://discord.com/api/oauth2/authorize?client_id=789956166796574740&permissions=388160&scope=bot From 6be6aff5163aa63d35c9df09a59931037ef13361 Mon Sep 17 00:00:00 2001 From: Sakimori Date: Tue, 2 Mar 2021 20:32:57 -0500 Subject: [PATCH 4/4] removed blall, replaced with ball --- main_controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main_controller.py b/main_controller.py index c5428fb..8855788 100644 --- a/main_controller.py +++ b/main_controller.py @@ -142,8 +142,8 @@ def update_loop(): state["home_score"] = this_game.teams["home"].score #update_pause = 0 #victory_lap = False if not this_game.play_has_begun: #weather_emoji - state["update_emoji"] = "🍿" #weather_text - state["update_text"] = "Play blall!" #they also need a timestamp + state["update_emoji"] = "🎆" #weather_text + state["update_text"] = "Play ball!" #they also need a timestamp state["start_delay"] -= 1 state["display_top_of_inning"] = state["top_of_inning"]