File tree 3 files changed +96
-0
lines changed
lib/Nitrapi/Services/Gameservers
3 files changed +96
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,15 @@ public function getDetails() {
39
39
return new GameserverDetails ($ this ->info ['gameserver ' ]);
40
40
}
41
41
42
+ /**
43
+ * Returns available features from the gameserver
44
+ *
45
+ * @return GameserverFeatures
46
+ */
47
+ public function getFeatures () {
48
+ return new GameserverFeatures ($ this ->info ['gameserver ' ]['game_specific ' ]['features ' ]);
49
+ }
50
+
42
51
public function getCustomerSettings () {
43
52
return new CustomerSettings ($ this , $ this ->info ['gameserver ' ]['settings ' ]);
44
53
}
Original file line number Diff line number Diff line change @@ -20,6 +20,21 @@ public function getStatus() {
20
20
return (string )$ this ->data ['status ' ];
21
21
}
22
22
23
+ /**
24
+ * @return bool
25
+ */
26
+ public function isManagedRoot () {
27
+ return isset ($ this ->data ['managed_root ' ]);
28
+ }
29
+
30
+ /**
31
+ * @return array
32
+ */
33
+ public function getManagedRoot () {
34
+ if (!$ this ->isManagedRoot ()) return [];
35
+ return $ this ->data ['managed_root ' ];
36
+ }
37
+
23
38
/**
24
39
* Returns the username
25
40
*
@@ -245,4 +260,31 @@ public function getQuota() {
245
260
public function getWebsocketToken () {
246
261
return $ this ->data ['websocket_token ' ];
247
262
}
263
+
264
+ /**
265
+ * Returns the gameserver game path
266
+ *
267
+ * @return string
268
+ */
269
+ public function getPath () {
270
+ return $ this ->data ['game_specific ' ]['path ' ];
271
+ }
272
+
273
+ /**
274
+ * Returns the log files of the server
275
+ *
276
+ * @return array
277
+ */
278
+ public function getLogFiles () {
279
+ return $ this ->data ['game_specific ' ]['log_files ' ];
280
+ }
281
+
282
+ /**
283
+ * Returns the config files of the server
284
+ *
285
+ * @return array
286
+ */
287
+ public function getConfigFiles () {
288
+ return $ this ->data ['game_specific ' ]['config_files ' ];
289
+ }
248
290
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Nitrapi \Services \Gameservers ;
4
+
5
+
6
+ class GameserverFeatures
7
+ {
8
+ protected $ data ;
9
+
10
+ public function __construct (array &$ data ) {
11
+ $ this ->data = $ data ;
12
+ }
13
+
14
+ public function hasBackups () {
15
+ return $ this ->data ['has_backups ' ];
16
+ }
17
+
18
+ public function hasApplicationServer () {
19
+ return $ this ->data ['has_application_server ' ];
20
+ }
21
+
22
+ public function hasFileBrowser () {
23
+ return $ this ->data ['has_file_browser ' ];
24
+ }
25
+
26
+ public function hasExpertMode () {
27
+ return $ this ->data ['has_expert_mode ' ];
28
+ }
29
+
30
+ public function hasPluginSystem () {
31
+ return $ this ->data ['has_plugin_system ' ];
32
+ }
33
+
34
+ public function hasDatabase () {
35
+ return $ this ->data ['has_database ' ];
36
+ }
37
+
38
+ public function hasRestartMessageSupport () {
39
+ return $ this ->data ['has_restart_message_support ' ];
40
+ }
41
+
42
+ public function hasFTP () {
43
+ return $ this ->data ['has_ftp ' ];
44
+ }
45
+ }
You can’t perform that action at this time.
0 commit comments