Skip to content

Commit

Permalink
Added endmatch rcon command on load match endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Qwizi committed Mar 4, 2024
1 parent 571f382 commit 64cb2b7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion matches/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
from random import shuffle
from time import sleep
from django.conf import settings
from rcon import EmptyResponse, SessionTimeout, WrongPassword
import redis
Expand Down Expand Up @@ -289,7 +290,8 @@ def load(self, request):
api_key = f'"{settings.API_KEY}"'
load_match_command = "matchzy_loadmatch_url"
match_url = f'"{settings.HOST_URL}/api/matches/current/"'

response = self.__send_rcon_command("css_endmatch")
sleep(5)
self.__send_rcon_command(load_match_command, match_url, api_key_header, api_key)
return Response({"status": "match config loaded"})

Expand Down

0 comments on commit 64cb2b7

Please sign in to comment.