fixed outs not displaying, fixed game end notification in discord
This commit is contained in:
parent
503a1b7a18
commit
acdc160ab0
|
@ -111,7 +111,9 @@ def update_loop():
|
|||
state["update_pause"] = 2
|
||||
if state["end_delay"] < 0:
|
||||
master_games_dic.pop(game_time)
|
||||
state["end_delay"] -= 1
|
||||
else:
|
||||
state["end_delay"] -= 1
|
||||
master_games_dic[game_time][1]["end_delay"] -= 1
|
||||
else:
|
||||
this_game.gamestate_update_full()
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{% if state.bases[number] %}{{base_filled}}{% else %}{{base_empty}}{% endif %}
|
||||
{%- endmacro %}
|
||||
{% macro out(number) -%}
|
||||
{% if number <= state.outs %}{{out_filled}}{% else %}{{out_empty}}{% endif %}
|
||||
{% if number <= state.outs %}{{out_out}}{% else %}{{out_in}}{% endif %}
|
||||
{%- endmacro %}
|
||||
|
||||
<div class="header">
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
<Content Include="static\games_page.css" />
|
||||
<Content Include="static\loader.js" />
|
||||
<Content Include="static\prism.png" />
|
||||
<Content Include="templates\game.html" />
|
||||
<Content Include="templates\index.html" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -614,9 +614,12 @@ async def watch_game(channel, newgame, user = None, league = None):
|
|||
state_init["is_league"] = False
|
||||
|
||||
await channel.send(f"{newgame.teams['away'].name} vs. {newgame.teams['home'].name}, starting at {config()['simmadome_url']}")
|
||||
gamesarray.append((newgame, channel, user))
|
||||
timestamp = str(time.time() * 1000.0)
|
||||
gamesarray.append((newgame, channel, user, timestamp))
|
||||
|
||||
|
||||
main_controller.master_games_dic[str(time.time() * 1000.0)] = (newgame, state_init, discrim_string)
|
||||
|
||||
main_controller.master_games_dic[timestamp] = (newgame, state_init, discrim_string)
|
||||
|
||||
async def play_from_queue(channel, game, user_mention):
|
||||
await channel.send(f"{user_mention}, your game's ready.")
|
||||
|
@ -791,8 +794,8 @@ async def game_watcher():
|
|||
while True:
|
||||
this_array = gamesarray.copy()
|
||||
for i in range(0,len(this_array)):
|
||||
game, channel, user = this_array[i]
|
||||
if game.over:
|
||||
game, channel, user, key = this_array[i]
|
||||
if game.over and main_controller.master_games_dic[key][1]["end_delay"] <= 2:
|
||||
title_string = f"{game.teams['away'].name} at {game.teams['home'].name} ended after {game.inning-1} innings"
|
||||
if (game.inning - 1) > game.max_innings: #if extra innings
|
||||
title_string += f" with {game.inning - (game.max_innings+1)} extra innings."
|
||||
|
|
Loading…
Reference in New Issue
Block a user