renamed /getMeteoroid to /getMeteoroids

small corrections in ip daemon
This commit is contained in:
Joel Klimont 2021-10-06 00:19:58 +02:00
parent 89d681d10f
commit 436ef35d46
7 changed files with 30 additions and 16 deletions

View file

@ -194,18 +194,18 @@ class DoubleElim:
return response, res.status_code
@staticmethod
def get_meteoroid() -> Tuple[List[Dict], int]:
"""Makes the /api/getMeteoroid call to the api.
def get_meteoroids() -> Tuple[List[Dict], int]:
"""Makes the /api/getMeteoroids call to the api.
:return: A list will all meteoroids currently on the game field. Meteoroids are dictionaries that look like: {"x": 0, "y": 0}
:rtype: Tuple[List[Dict], int]
"""
res = requests.get(API_URL_GET_METEOROID)
if res.status_code == 408:
Logging.get_logger().error(f"DoubleElim.get_meteoroid timeout!")
Logging.get_logger().error(f"DoubleElim.get_meteoroids timeout!")
time.sleep(0.01)
return DoubleElim.get_meteoroid()
return DoubleElim.get_meteoroids()
response = json.loads(res.content)
Logging.get_logger().debug(f"DoubleElim.get_meteoroid = {response}, status code = {res.status_code}")
return response, res.status_code
Logging.get_logger().debug(f"DoubleElim.get_meteoroids = {response}, status code = {res.status_code}")
return response, res.status_code