Creating JSONRPC Server

This commit is contained in:
adator
2025-11-16 19:13:26 +01:00
parent 2e422c93e5
commit c371910066
11 changed files with 347 additions and 14 deletions

View File

@@ -126,6 +126,8 @@ class Irc:
self.build_command(4, 'core', 'rehash', 'Reload the configuration file without restarting')
self.build_command(4, 'core', 'raw', 'Send a raw command directly to the IRC server')
self.build_command(4, 'core', 'print_vars', 'Print users in a file.')
self.build_command(4, 'core', 'start_rpc', 'Start defender jsonrpc server')
self.build_command(4, 'core', 'stop_rpc', 'Stop defender jsonrpc server')
# Define the IrcSocket object
self.IrcSocket: Optional[Union[socket.socket, SSLSocket]] = None
@@ -372,7 +374,7 @@ class Irc:
return uptime
def heartbeat(self, beat:float) -> None:
def heartbeat(self, beat: float) -> None:
"""Execute certaines commandes de nettoyage toutes les x secondes
x étant définit a l'initialisation de cette class (self.beat)
@@ -1272,5 +1274,11 @@ class Irc:
return None
case 'start_rpc':
self.Loader.RpcServer.start_server()
case 'stop_rpc':
self.Loader.RpcServer.stop_server()
case _:
pass