forked from Hay1tsme/artemis
chuni: add matching config, stun turn stuff
This commit is contained in:
@ -89,6 +89,39 @@ class ChuniCryptoConfig:
|
||||
self.__config, "chuni", "crypto", "encrypted_only", default=False
|
||||
)
|
||||
|
||||
class ChuniMatchingConfig:
|
||||
def __init__(self, parent_config: "ChuniConfig") -> None:
|
||||
self.__config = parent_config
|
||||
|
||||
@property
|
||||
def enable(self) -> bool:
|
||||
return CoreConfig.get_config_field(
|
||||
self.__config, "chuni", "matching", "enable", default=False
|
||||
)
|
||||
|
||||
@property
|
||||
def stun_uri(self) -> str:
|
||||
return CoreConfig.get_config_field(
|
||||
self.__config, "chuni", "matching", "stun_uri", default="stun:stunserver.stunprotocol.org:3478"
|
||||
)
|
||||
|
||||
@property
|
||||
def turn_uri(self) -> str:
|
||||
return CoreConfig.get_config_field(
|
||||
self.__config, "chuni", "matching", "turn_uri", default="turn:stunserver.stunprotocol.org:3478"
|
||||
)
|
||||
|
||||
@property
|
||||
def match_time_limit(self) -> int:
|
||||
return CoreConfig.get_config_field(
|
||||
self.__config, "chuni", "matching", "match_time_limit", default=60
|
||||
)
|
||||
|
||||
@property
|
||||
def match_error_limit(self) -> int:
|
||||
return CoreConfig.get_config_field(
|
||||
self.__config, "chuni", "matching", "match_error_limit", default=9999
|
||||
)
|
||||
|
||||
class ChuniConfig(dict):
|
||||
def __init__(self) -> None:
|
||||
@ -97,3 +130,4 @@ class ChuniConfig(dict):
|
||||
self.mods = ChuniModsConfig(self)
|
||||
self.version = ChuniVersionConfig(self)
|
||||
self.crypto = ChuniCryptoConfig(self)
|
||||
self.matching = ChuniMatchingConfig(self)
|
||||
|
Reference in New Issue
Block a user