[+] Union function declaration

This commit is contained in:
Charles Le Maux 2024-07-14 19:24:39 +02:00
parent c2f21cb1c1
commit cfec606d23

View File

@ -1,6 +1,7 @@
import subprocess import subprocess
import shlex import shlex
import time import time
from typing import Union
class MinecraftServerManager: class MinecraftServerManager:
@ -13,7 +14,7 @@ class MinecraftServerManager:
self.cooldowns = {} self.cooldowns = {}
def start_server(self, server_directory: str, port: int, def start_server(self, server_directory: str, port: int,
java_executable='java', jar_file='server.jar', memory_size='2048M') -> int or None: java_executable='java', jar_file='server.jar', memory_size='2048M') -> Union[int, None]:
if port in self.servers: if port in self.servers:
return None return None