Introduce full asyncio version (still some module to migrate). Defender JSONRPC Server ready and using with uvcorn

This commit is contained in:
adator
2025-11-20 00:29:32 +01:00
parent 1b30b1ff4e
commit aa15aea749
34 changed files with 2533 additions and 2627 deletions

View File

@@ -4,30 +4,29 @@ from .inspircd import Inspircd
from ..interfaces.iprotocol import IProtocol
if TYPE_CHECKING:
from core.irc import Irc
from core.loader import Loader
class ProtocolFactorty:
def __init__(self, uplink: 'Irc'):
def __init__(self, context: 'Loader'):
"""ProtocolFactory init.
Args:
uplink (Irc): The Irc object
context (Loader): The Context object
"""
self.__Config = uplink.Config
self.__uplink = uplink
self.__ctx = context
def get(self) -> Optional[IProtocol]:
protocol = self.__Config.SERVEUR_PROTOCOL
protocol = self.__ctx.Config.SERVEUR_PROTOCOL
match protocol:
case 'unreal6':
self.__uplink.Logs.debug(f"[PROTOCOL] {protocol} has been loaded")
return Unrealircd6(self.__uplink)
self.__ctx.Logs.debug(f"[PROTOCOL] {protocol} has been loaded")
return Unrealircd6(self.__ctx)
case 'inspircd':
self.__uplink.Logs.debug(f"[PROTOCOL] {protocol} has been loaded")
return Inspircd(self.__uplink)
self.__ctx.Logs.debug(f"[PROTOCOL] {protocol} has been loaded")
return Inspircd(self.__ctx)
case _:
self.__uplink.Logs.critical(f"[PROTOCOL ERROR] This protocol name ({protocol} is not valid!)")
self.__ctx.Logs.critical(f"[PROTOCOL ERROR] This protocol name ({protocol} is not valid!)")
raise Exception("Unknown protocol!")

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff