Skip to content

Commit 46c8315

Browse files
authored
Merge pull request #38 from NullSoldier/fix-server-config
Fix infinite restart issue
2 parents 462bd0f + bc429fd commit 46c8315

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

serverthrall/plugins/serverconfig.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ def ignore_modifications(self):
3737
class ServerConfig(IntervalTickPlugin):
3838

3939
CONFIG_MAPPING = {
40-
'ServerName': ('Engine', 'OnlineSubsystemSteam', 'ServerName'),
41-
'ServerPassword': ('Engine', 'OnlineSubsystemSteam', 'ServerPassword'),
42-
'QueryPort': ('Engine', 'OnlineSubsystemSteam', 'QueryPort'),
40+
'ServerName': ('Engine', 'OnlineSubsystem', 'ServerName'),
41+
'ServerPassword': ('Engine', 'OnlineSubsystem', 'ServerPassword'),
42+
'QueryPort': ('Engine', 'OnlineSubsystem', 'QueryPort'),
4343
'MaxPlayers': ('Game', '/Script/Engine.GameSession', 'MaxPlayers'),
4444
'AdminPassword': ('ServerSettings', 'ServerSettings', 'AdminPassword'),
4545
'MaxNudity': ('ServerSettings', 'ServerSettings', 'MaxNudity'),
@@ -51,7 +51,6 @@ class ServerConfig(IntervalTickPlugin):
5151
'NetServerMaxTickRate': ('Engine', '/Script/OnlineSubsystemUtils.IpNetDriver', 'NetServerMaxTickRate'),
5252
}
5353

54-
DEFAULT_WHITE_LIST = ['Port']
5554
FIVE_MINUTES = 5 * 60
5655

5756
def __init__(self, config):
@@ -62,6 +61,12 @@ def __init__(self, config):
6261
def ready(self, *args, **kwargs):
6362
super(ServerConfig, self).ready(*args, **kwargs)
6463

64+
self.logger.warn(
65+
"\n=============================================\n"
66+
"WARNING: ServerConfig plugin has known issues that MAY restart your server infinitely.\n"
67+
"https://github.com/NullSoldier/serverthrall/issues/37"
68+
"\n=============================================")
69+
6570
config_paths = self.get_conan_config_paths(self.thrall.conan_config)
6671
self.handler = OnModifiedHandler(self, config_paths, self.logger)
6772

@@ -105,9 +110,12 @@ def sync(self):
105110
original = self.thrall.conan_config.get(group, section, option)
106111

107112
if value is not None and value != original:
108-
use_default_config = option in self.DEFAULT_WHITE_LIST
109-
path = self.thrall.conan_config.set(group, section, option, value, use_default_config)
113+
path = self.thrall.conan_config.set(group, section, option, value, True)
114+
self.logger.info('Syncing %s.%s=%s, %s' % (section, option, value, path))
115+
116+
path = self.thrall.conan_config.set(group, section, option, value, False)
110117
self.logger.info('Syncing %s.%s=%s, %s' % (section, option, value, path))
118+
111119
changed = True
112120

113121
return changed

0 commit comments

Comments
 (0)