From 7619270fa13979fcf84d70dcc5b2087951c30661 Mon Sep 17 00:00:00 2001 From: Yannick Gloster Date: Tue, 10 Nov 2020 08:28:12 +0000 Subject: [PATCH] Quick Fixes - Added more info to match ID - Fixed players per team to int and not double - Added temporary fix to get5 cancel event --- cogs/csgo.py | 7 ++++--- utils/server.py | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cogs/csgo.py b/cogs/csgo.py index 401b4aa..11c6dd2 100644 --- a/cogs/csgo.py +++ b/cogs/csgo.py @@ -1,6 +1,7 @@ import aiohttp import asyncio import checks +import datetime import discord import json import os @@ -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 @@ -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': { diff --git a/utils/server.py b/utils/server.py index ebf63d0..8ed2b7b 100644 --- a/utils/server.py +++ b/utils/server.py @@ -2,6 +2,7 @@ import socket import traceback import uuid +import valve.rcon from aiohttp import web from json import JSONDecodeError @@ -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')