From 5f34e4b27bd772239284104a6e62aca2250fe32f Mon Sep 17 00:00:00 2001
From: anima
Date: Sat, 21 Sep 2024 19:49:34 +0200
Subject: [PATCH] add server options
---
SatiAPI.py | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/SatiAPI.py b/SatiAPI.py
index 76fe840..a3f99d0 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.2.1'
+ __VERSION__ = '0.3.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
@@ -181,6 +181,7 @@ class SatiAPI:
def get_token(self, password: str = None, privilegeLevel: str = 'Administrator') -> bool:
"""get token from satisfacory dedicated server, password is needed!
+ Attempts to log in to the Dedicated Server as a player using either Admin Password or Client Protection Password. This function requires no Authentication.
:param password: password of admin level
:type password: string
@@ -219,7 +220,7 @@ class SatiAPI:
return True
def get_status(self) -> dict:
- """get basis status of satisfacory server
+ """Retrieves the current state of the Dedicated Server. Does not require any input parameters.
:return: full return from server
:rtpye: dict
@@ -239,7 +240,18 @@ class SatiAPI:
return self.__query('HealthCheck', data)
+ def get_server_options(self) -> dict:
+ """Retrieves currently applied server options and server options that are still pending application (because of needing session or server restart) Does not require input parameters.
+
+ :return: full return from server
+ :rtpye: dict
+ """
+ return self.__query('GetServerOptions')
+
+ ## todo
+ #PasswordlessLogin
+
if __name__ == "__main__":
sati = SatiAPI(loglevel=10)
# print('Verbundene Spieler: ', sati.get_status()['serverGameState']['numConnectedPlayers'])
- print(sati.health_check())
\ No newline at end of file
+ print(sati.get_server_options())
\ No newline at end of file