You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `MinimumPrivilegeLevel` enum is used to specify the type of token you want to obtain. The following levels are available:
64
+
- NOT_AUTHENTICATED
65
+
- CLIENT
66
+
- ADMINISTRATOR
67
+
- INITIAL_ADMIN
68
+
- API_TOKEN
69
+
70
+
55
71
### Health Check
56
72
57
-
To verify that the server is running and responsive, you can perform a health check:
73
+
To verify that the server is running and responsive, you can perform a health check. This will return the server's current state. You dont need a token to perform a health check.
58
74
59
75
```python
60
76
response = api.health_check()
61
77
print(response.data)
62
78
```
63
79
80
+
### Querying server state
81
+
82
+
You can query the server's current state. This return information about the server and the current game session.
83
+
84
+
```python
85
+
# Get server state
86
+
response = api.query_server_state()
87
+
print(response.data)
88
+
```
89
+
64
90
### Server Options
65
91
66
92
You can query the server's current options and apply new ones:
You can run commands on the server or shut it down:
143
+
You can run commands on the server or shut it down using the API. The `run_command` method is used to execute a server command. The `shutdown` method is used to shut down the server.
118
144
119
145
```python
120
146
# Run a server command
@@ -128,36 +154,37 @@ response = api.shutdown()
128
154
129
155
### Authentication
130
156
131
-
-`passwordless_login(minimum_privilege_level: MinimumPrivilegeLevel)`: Log in without a password.
132
-
-`password_login(minimum_privilege_level: MinimumPrivilegeLevel, password: str)`: Log in using a password.
157
+
-`passwordless_login(minimum_privilege_level: MinimumPrivilegeLevel)`: Log in without a password to obtain a token that is automatically saved.
158
+
-`password_login(minimum_privilege_level: MinimumPrivilegeLevel, password: str)`: Log in using a password to obtain a token that is automatically saved.
133
159
134
160
### Server Management
135
161
136
-
-`health_check(client_custom_data: str = '')`: Perform a health check on the server.
137
-
-`shutdown()`: Shut down the server.
162
+
-`health_check(client_custom_data: str = '')`: Perform a health check on the server. This will return the server's current state.
163
+
-`query_server_state()`: Query the server's current state. This includes information about the server and the current game session.
164
+
-`shutdown()`: Shut down the server. This will stop the server process.
138
165
139
166
### Game Management
140
167
141
-
-`create_new_game(game_data: NewGameData)`: Create a new game session.
142
-
-`load_game(save_name: str, enable_advanced_game_settings: bool = False)`: Load a saved game.
143
-
-`save_game(save_name: str)`: Save the current game session.
144
-
-`delete_save_file(save_name: str)`: Delete a saved game.
145
-
-`enumerate_sessions()`: List all available game sessions.
168
+
-`create_new_game(game_data: NewGameData)`: Create a new game session. This will start a new game with the specified settings.
169
+
-`load_game(save_name: str, enable_advanced_game_settings: bool = False)`: Load a saved game. This will load a previously saved game session.
170
+
-`save_game(save_name: str)`: Save the current game session. This will save the current game state to a file.
171
+
-`delete_save_file(save_name: str)`: Delete a saved game. This will delete a previously saved game session.
172
+
-`enumerate_sessions()`: List all available game sessions. This will return a list of saved game sessions.
146
173
147
174
### Server Settings
148
175
149
-
-`get_server_options()`: Get current server settings.
150
-
-`apply_server_options(options: dict)`: Apply new server settings.
151
-
-`get_advanced_game_settings()`: Get advanced game settings.
152
-
-`apply_advanced_game_settings(settings: AdvancedGameSettings)`: Apply new advanced game settings.
176
+
-`get_server_options()`: Get current server settings. This includes the server name, description, and other options.
177
+
-`apply_server_options(options: dict)`: Apply new server settings. This will update the server options with the specified values.
178
+
-`get_advanced_game_settings()`: Get advanced game settings. This includes settings such as resource settings, enemy settings, and other advanced options.
179
+
-`apply_advanced_game_settings(settings: AdvancedGameSettings)`: Apply new advanced game settings. This will update the advanced game settings with the specified values.
153
180
154
181
### Commands
155
182
156
-
-`run_command(command: str)`: Run a server command.
183
+
-`run_command(command: str)`: Run a server command. This will execute the specified command on the server.
157
184
158
185
## Error Handling
159
186
160
-
Errors returned by the API will raise an `APIError` exception, which contains the error message from the server.
187
+
Errors returned by the API will raise an `APIError` exception, which contains the error message from the server. You can catch and handle these errors in your code. For example:
161
188
162
189
```python
163
190
try:
@@ -172,4 +199,12 @@ Contributions are welcome! If you find a bug or have a feature request, please c
172
199
173
200
## License
174
201
175
-
This project is licensed under the MIT License. See the LICENSE file for details.
202
+
This project is licensed under the MIT License. See the LICENSE file for details.
203
+
204
+
## Acknowledgements
205
+
206
+
This package is not affiliated with or endorsed by Coffee Stain Studios. Satisfactory is a trademark of Coffee Stain Studios AB.
207
+
208
+
## References
209
+
210
+
-[Satisfactory Dedicated Server API Documentation](https://satisfactory.wiki.gg/wiki/Dedicated_servers/HTTPS_API)
0 commit comments