From 36f2e0619b98fde3af785ce16181a0b576ccc938 Mon Sep 17 00:00:00 2001
From: anima
Date: Sat, 21 Sep 2024 20:13:05 +0200
Subject: [PATCH] fix port
---
SatiAPI.py | 31 +++++++++++++++++++++++++++----
1 file changed, 27 insertions(+), 4 deletions(-)
diff --git a/SatiAPI.py b/SatiAPI.py
index 7071b5d..21c3ff4 100644
--- a/SatiAPI.py
+++ b/SatiAPI.py
@@ -16,7 +16,7 @@ urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
class SatiAPI:
"""A API wrapper for Satisfactory dedicated server"""
__AUTHOR__ = 'anima'
- __VERSION__ = '0.4.0'
+ __VERSION__ = '0.4.2'
def __init__(self, host: str = None, port: int = 7777, token: str = None, conffile: str = 'conf.yml', logfile: str = 'SatiAPI.log', loglevel: int = 20) -> None:
"""create a wrapper for satisfactory dedicated server
@@ -149,7 +149,7 @@ class SatiAPI:
:type query: string
:param data: (maybe optional) data to be send as dict
:type data: dict
- :return: response from server striped from "data" wrapper or False
+ :return: response from server
:rtype: dict | None | bool
"""
payload = dict()
@@ -163,7 +163,7 @@ class SatiAPI:
if self.token is not None:
headers['Authorization'] = f'Bearer {self.token}'
- response = requests.post(f'https://{self.host}:7777/api/v1', headers=headers, json=payload, verify=False)
+ response = requests.post(f'https://{self.host}:{self.port}/api/v1', headers=headers, json=payload, verify=False)
if response.status_code == 200:
json_response = json.loads(response.text)
if 'data' in json_response:
@@ -255,10 +255,33 @@ class SatiAPI:
:rtpye: dict
"""
return self.__query('GetAdvancedGameSettings')
+
+
+
+
+
## todo
#PasswordlessLogin
+ #ClaimServer
+ #RenameServer
+ #SetClientPassword
+ #SetAdminPassword
+ #SetAutoLoadSessionName
+ #ApplyServerOptions
+ #ApplyAdvancedGameSettings
+ #RunCommand
+ #Shutdown
+ #CreateNewGame
+ #SaveGame
+ #DeleteSaveFile
+ #DeleteSaveSession
+ #EnumerateSessions
+ #LoadGame
+ #UploadSaveGame
+ #DownloadSaveGame
if __name__ == "__main__":
sati = SatiAPI(loglevel=10)
# print('Verbundene Spieler: ', sati.get_status()['serverGameState']['numConnectedPlayers'])
- print(sati.get_advanced_game_settings())
\ No newline at end of file
+ print(sati.get_status())
+ # print(sati.get_advanced_game_settings())
\ No newline at end of file