serverwatcher 5.9.dev4__tar.gz → 5.9.dev6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {serverwatcher-5.9.dev4/src/serverwatcher.egg-info → serverwatcher-5.9.dev6}/PKG-INFO +1 -1
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/pyproject.toml +1 -1
- serverwatcher-5.9.dev6/src/serverwatcher/configclasses/messages.py +57 -0
- serverwatcher-5.9.dev6/src/serverwatcher/configclasses/watcher.py +28 -0
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher/watcher.py +2 -2
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6/src/serverwatcher.egg-info}/PKG-INFO +1 -1
- serverwatcher-5.9.dev4/src/serverwatcher/configclasses/messages.py +0 -61
- serverwatcher-5.9.dev4/src/serverwatcher/configclasses/watcher.py +0 -32
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/LICENSE +0 -0
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/README.md +0 -0
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/setup.cfg +0 -0
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher/__init__.py +0 -0
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher/configclasses/__init__.py +0 -0
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher/configclasses/config.py +0 -0
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher/defaultconfigs/config.yaml +0 -0
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher/defaultconfigs/messages.yaml +0 -0
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher/defaultconfigs/watcher.yaml +0 -0
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher/validator.py +0 -0
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher.egg-info/SOURCES.txt +0 -0
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher.egg-info/dependency_links.txt +0 -0
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher.egg-info/requires.txt +0 -0
- {serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
from hungerlib import datamap, datamap_api
|
|
2
|
+
|
|
3
|
+
@datamap(syntax=datamap_api.braces, mode="config")
|
|
4
|
+
class MessagesConfig:
|
|
5
|
+
prefix: str = "prefix"
|
|
6
|
+
bullet: str = "bullet"
|
|
7
|
+
|
|
8
|
+
broadcast_restart_at: str = "broadcast_restart_at"
|
|
9
|
+
|
|
10
|
+
minute_120: str = "broadcast_minutes.120"
|
|
11
|
+
minute_60: str = "broadcast_minutes.60"
|
|
12
|
+
minute_45: str = "broadcast_minutes.45"
|
|
13
|
+
minute_30: str = "broadcast_minutes.30"
|
|
14
|
+
minute_15: str = "broadcast_minutes.15"
|
|
15
|
+
minute_5: str = "broadcast_minutes.5"
|
|
16
|
+
minute_1: str = "broadcast_minutes.1"
|
|
17
|
+
|
|
18
|
+
second_10: str = "broadcast_seconds.10"
|
|
19
|
+
second_9: str = "broadcast_seconds.9"
|
|
20
|
+
second_8: str = "broadcast_seconds.8"
|
|
21
|
+
second_7: str = "broadcast_seconds.7"
|
|
22
|
+
second_6: str = "broadcast_seconds.6"
|
|
23
|
+
second_5: str = "broadcast_seconds.5"
|
|
24
|
+
second_4: str = "broadcast_seconds.4"
|
|
25
|
+
second_3: str = "broadcast_seconds.3"
|
|
26
|
+
second_2: str = "broadcast_seconds.2"
|
|
27
|
+
second_1: str = "broadcast_seconds.1"
|
|
28
|
+
|
|
29
|
+
startup: str = "logging.startup"
|
|
30
|
+
status_check: str = "logging.status_check"
|
|
31
|
+
validation_fail: str = "logging.validation_fail"
|
|
32
|
+
validation_ok: str = "logging.validation_ok"
|
|
33
|
+
shutdown: str = "logging.shutdown"
|
|
34
|
+
immediate_restart: str = "logging.immediate_restart"
|
|
35
|
+
no_restart: str = "logging.no_restart"
|
|
36
|
+
scheduled: str = "logging.scheduled"
|
|
37
|
+
gap_low: str = "logging.gap_low"
|
|
38
|
+
gap_high: str = "logging.gap_high"
|
|
39
|
+
|
|
40
|
+
pro_restart_splash: str = "reasons.pro_splash"
|
|
41
|
+
anti_restart_splash: str = "reasons.anti_splash"
|
|
42
|
+
|
|
43
|
+
reason_restart_soon: str = "reasons.restart_soon"
|
|
44
|
+
reason_ram: str = "reasons.ram"
|
|
45
|
+
reason_cpu: str = "reasons.cpu"
|
|
46
|
+
reason_uptime: str = "reasons.uptime"
|
|
47
|
+
reason_tps: str = "reasons.tps"
|
|
48
|
+
reason_low_uptime: str = "reasons.low_uptime"
|
|
49
|
+
reason_players: str = "reasons.players"
|
|
50
|
+
|
|
51
|
+
pro_restart_number: str = "reasons.pro_restart_number"
|
|
52
|
+
anti_restart_number: str = "reasons.anti_restart_number"
|
|
53
|
+
|
|
54
|
+
restart_action_sent: str = "restarts.restart_action_sent"
|
|
55
|
+
server_back_online: str = "restarts.back_online"
|
|
56
|
+
server_back_online_broadcast: str = "restarts.back_online_broadcast"
|
|
57
|
+
server_failed_restart: str = "restarts.failed_restart"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from hungerlib import datamap, datamap_api
|
|
2
|
+
|
|
3
|
+
@datamap(syntax=datamap_api.braces, mode="config")
|
|
4
|
+
class WatcherConfig:
|
|
5
|
+
watch_interval: int = "watch_interval"
|
|
6
|
+
schedule_control: bool = "schedule_control.enabled"
|
|
7
|
+
restart_soon_id: int = "schedule_control.restart_soon_id"
|
|
8
|
+
|
|
9
|
+
threshold_ram: int = "thresholds.ram"
|
|
10
|
+
threshold_cpu: int = "thresholds.cpu"
|
|
11
|
+
threshold_uptime: int = "thresholds.uptime"
|
|
12
|
+
threshold_tps: float = "thresholds.tps"
|
|
13
|
+
|
|
14
|
+
weight_restart_soon: int = "weights.restart_soon"
|
|
15
|
+
weight_ram: int = "weights.ram"
|
|
16
|
+
weight_cpu: int = "weights.cpu"
|
|
17
|
+
weight_uptime: int = "weights.uptime"
|
|
18
|
+
weight_tps: int = "weights.tps"
|
|
19
|
+
|
|
20
|
+
weight_low_uptime: int = "weights.low_uptime"
|
|
21
|
+
weight_per_player: int = "weights.per_player"
|
|
22
|
+
|
|
23
|
+
low_gap_minutes: int = "gaps.low_gap_minutes"
|
|
24
|
+
high_gap_minutes: int = "gaps.high_gap_minutes"
|
|
25
|
+
|
|
26
|
+
restart_wait_seconds: int = "restart.wait_seconds"
|
|
27
|
+
restart_timeout: int = "restart.online_timeout"
|
|
28
|
+
restart_online_interval: int = "restart.online_interval"
|
|
@@ -127,7 +127,7 @@ class ServerWatcher:
|
|
|
127
127
|
lambda msg=mapit(getattr(self.messages, k)):
|
|
128
128
|
self.router.broadcast(msg)
|
|
129
129
|
)
|
|
130
|
-
for k in vars(self.messages)
|
|
130
|
+
for k in vars(self.messages.__dataclass_fields__)
|
|
131
131
|
if k.startswith("minute_")
|
|
132
132
|
}
|
|
133
133
|
|
|
@@ -136,7 +136,7 @@ class ServerWatcher:
|
|
|
136
136
|
lambda msg=mapit(getattr(self.messages, k)):
|
|
137
137
|
self.router.broadcast(msg)
|
|
138
138
|
)
|
|
139
|
-
for k in vars(self.messages)
|
|
139
|
+
for k in vars(self.messages.__dataclass_fields__)
|
|
140
140
|
if k.startswith("second_")
|
|
141
141
|
}
|
|
142
142
|
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
from dataclasses import field
|
|
2
|
-
from hungerlib import datamap, datamap_api
|
|
3
|
-
|
|
4
|
-
def yaml_key(path: str, default=None):
|
|
5
|
-
return field(default=default, metadata={"yaml_key": path})
|
|
6
|
-
|
|
7
|
-
@datamap(syntax=datamap_api.braces)
|
|
8
|
-
class MessagesConfig:
|
|
9
|
-
prefix: str = yaml_key("prefix", "<aqua>[Server Watcher]")
|
|
10
|
-
bullet: str = yaml_key("bullet")
|
|
11
|
-
|
|
12
|
-
broadcast_restart_at: str = yaml_key("broadcast_restart_at")
|
|
13
|
-
|
|
14
|
-
minute_120: str = yaml_key("broadcast_minutes.120", "{prefix} Restart in 2 hours!")
|
|
15
|
-
minute_60: str = yaml_key("broadcast_minutes.60", "{prefix} Restart in 1 hour!")
|
|
16
|
-
minute_45: str = yaml_key("broadcast_minutes.45", "{prefix} Restart in 45 minutes!")
|
|
17
|
-
minute_30: str = yaml_key("broadcast_minutes.30", "{prefix} Restart in 30 minutes!")
|
|
18
|
-
minute_15: str = yaml_key("broadcast_minutes.15", "{prefix} Restart in 15 minutes!")
|
|
19
|
-
minute_5: str = yaml_key("broadcast_minutes.5", "{prefix} Restart in 5 minutes!")
|
|
20
|
-
minute_1: str = yaml_key("broadcast_minutes.1", "{prefix} Restart in 1 minute!")
|
|
21
|
-
|
|
22
|
-
second_10: str = yaml_key("broadcast_seconds.10", "{prefix} Restart in 10 seconds!")
|
|
23
|
-
second_9: str = yaml_key("broadcast_seconds.9", "{prefix} Restart in 9 seconds!")
|
|
24
|
-
second_8: str = yaml_key("broadcast_seconds.8", "{prefix} Restart in 8 seconds!")
|
|
25
|
-
second_7: str = yaml_key("broadcast_seconds.7", "{prefix} Restart in 7 seconds!")
|
|
26
|
-
second_6: str = yaml_key("broadcast_seconds.6", "{prefix} Restart in 6 seconds!")
|
|
27
|
-
second_5: str = yaml_key("broadcast_seconds.5", "{prefix} Restart in 5 seconds!")
|
|
28
|
-
second_4: str = yaml_key("broadcast_seconds.4", "{prefix} Restart in 4 seconds!")
|
|
29
|
-
second_3: str = yaml_key("broadcast_seconds.3", "{prefix} Restart in 3 seconds!")
|
|
30
|
-
second_2: str = yaml_key("broadcast_seconds.2", "{prefix} Restart in 2 seconds!")
|
|
31
|
-
second_1: str = yaml_key("broadcast_seconds.1", "{prefix} Restart in 1 second!")
|
|
32
|
-
|
|
33
|
-
startup: str = yaml_key("logging.startup")
|
|
34
|
-
status_check: str = yaml_key("logging.status_check")
|
|
35
|
-
validation_fail: str = yaml_key("logging.validation_fail")
|
|
36
|
-
validation_ok: str = yaml_key("logging.validation_ok")
|
|
37
|
-
shutdown: str = yaml_key("logging.shutdown")
|
|
38
|
-
immediate_restart: str = yaml_key("logging.immediate_restart")
|
|
39
|
-
no_restart: str = yaml_key("logging.no_restart")
|
|
40
|
-
scheduled: str = yaml_key("logging.scheduled")
|
|
41
|
-
gap_low: str = yaml_key("logging.gap_low")
|
|
42
|
-
gap_high: str = yaml_key("logging.gap_high")
|
|
43
|
-
|
|
44
|
-
pro_restart_splash: str = yaml_key("reasons.pro_splash")
|
|
45
|
-
anti_restart_splash: str = yaml_key("reasons.anti_splash")
|
|
46
|
-
|
|
47
|
-
reason_restart_soon: str = yaml_key("reasons.restart_soon")
|
|
48
|
-
reason_ram: str = yaml_key("reasons.ram")
|
|
49
|
-
reason_cpu: str = yaml_key("reasons.cpu")
|
|
50
|
-
reason_uptime: str = yaml_key("reasons.uptime")
|
|
51
|
-
reason_tps: str = yaml_key("reasons.tps")
|
|
52
|
-
reason_low_uptime: str = yaml_key("reasons.low_uptime")
|
|
53
|
-
reason_players: str = yaml_key("reasons.players")
|
|
54
|
-
|
|
55
|
-
pro_restart_number: str = yaml_key("reasons.pro_restart_number")
|
|
56
|
-
anti_restart_number: str = yaml_key("reasons.anti_restart_number")
|
|
57
|
-
|
|
58
|
-
restart_action_sent: str = yaml_key("restarts.restart_action_sent")
|
|
59
|
-
server_back_online: str = yaml_key("restarts.back_online")
|
|
60
|
-
server_back_online_broadcast: str = yaml_key("restarts.back_online_broadcast")
|
|
61
|
-
server_failed_restart: str = yaml_key("restarts.failed_restart")
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from dataclasses import field
|
|
2
|
-
from hungerlib import datamap, datamap_api
|
|
3
|
-
|
|
4
|
-
def yaml_key(path: str, default=None):
|
|
5
|
-
return field(default=default, metadata={"yaml_key": path})
|
|
6
|
-
|
|
7
|
-
@datamap(syntax=datamap_api.braces)
|
|
8
|
-
class WatcherConfig:
|
|
9
|
-
watch_interval: int = yaml_key("watch_interval")
|
|
10
|
-
schedule_control: bool = yaml_key("schedule_control.enabled")
|
|
11
|
-
restart_soon_id: int = yaml_key("schedule_control.restart_soon_id")
|
|
12
|
-
|
|
13
|
-
threshold_ram: int = yaml_key("thresholds.ram")
|
|
14
|
-
threshold_cpu: int = yaml_key("thresholds.cpu")
|
|
15
|
-
threshold_uptime: int = yaml_key("thresholds.uptime")
|
|
16
|
-
threshold_tps: float = yaml_key("thresholds.tps")
|
|
17
|
-
|
|
18
|
-
weight_restart_soon: int = yaml_key("weights.restart_soon")
|
|
19
|
-
weight_ram: int = yaml_key("weights.ram")
|
|
20
|
-
weight_cpu: int = yaml_key("weights.cpu")
|
|
21
|
-
weight_uptime: int = yaml_key("weights.uptime")
|
|
22
|
-
weight_tps: int = yaml_key("weights.tps")
|
|
23
|
-
|
|
24
|
-
weight_low_uptime: int = yaml_key("weights.low_uptime")
|
|
25
|
-
weight_per_player: int = yaml_key("weights.per_player")
|
|
26
|
-
|
|
27
|
-
low_gap_minutes: int = yaml_key("gaps.low_gap_minutes")
|
|
28
|
-
high_gap_minutes: int = yaml_key("gaps.high_gap_minutes")
|
|
29
|
-
|
|
30
|
-
restart_wait_seconds: int = yaml_key("restart.wait_seconds")
|
|
31
|
-
restart_timeout: int = yaml_key("restart.online_timeout")
|
|
32
|
-
restart_online_interval: int = yaml_key("restart.online_interval")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher/configclasses/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher/defaultconfigs/config.yaml
RENAMED
|
File without changes
|
{serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher/defaultconfigs/messages.yaml
RENAMED
|
File without changes
|
{serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher/defaultconfigs/watcher.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{serverwatcher-5.9.dev4 → serverwatcher-5.9.dev6}/src/serverwatcher.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|