Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #87 from yannickgloster/quick-bug-fixes
Browse files Browse the repository at this point in the history
Quick Fixes
  • Loading branch information
lexesj committed Nov 10, 2020
2 parents 96f2a36 + 7619270 commit 2397ae7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cogs/csgo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import aiohttp
import asyncio
import checks
import datetime
import discord
import json
import os
Expand All @@ -12,7 +13,7 @@
from bot import Discord_10man
from collections import Counter
from databases import Database
from datetime import date
from datetime import datetime
from discord.ext import commands, tasks
from random import choice, shuffle, randint
from steam.steamid import SteamID
Expand Down Expand Up @@ -329,13 +330,13 @@ async def pug(self, ctx: commands.Context, *args):
team2_name = f'team_{unidecode(team2_captain.display_name)}'

match_config = {
'matchid': f'PUG-{date.today().strftime("%d-%B-%Y")}',
'matchid': f'PUG_{datetime.now().strftime("%Y-%m-%d-%H-%M-%S")}',
'num_maps': 1,
'maplist': map_list,
'skip_veto': True,
'veto_first': 'team1',
'side_type': 'always_knife',
'players_per_team': self.bot.match_size/2,
'players_per_team': int(self.bot.match_size/2),
'min_players_to_ready': 1,
'spectators': spectator_steamIDs,
'team1': {
Expand Down
4 changes: 4 additions & 0 deletions utils/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import socket
import traceback
import uuid
import valve.rcon

from aiohttp import web
from json import JSONDecodeError
Expand Down Expand Up @@ -124,6 +125,9 @@ async def _handler(self, request: web.Request) -> web.Response:
await server.score_message.edit(content='Game Over')
elif get5_event['event'] == 'series_cancel':
await server.score_message.edit(content='Game Cancelled by Admin')
# Temporary fix, Get5 breaks on a series cancel unless map changes
valve.rcon.execute((server.server_address, server.server_port), server.RCON_password,
'changelevel de_mirage')

score_embed: discord.Embed = server.score_message.embeds[0]
score_embed.set_footer(text='🟥 Ended')
Expand Down

0 comments on commit 2397ae7

Please sign in to comment.