20 lines
583 B
Python
20 lines
583 B
Python
from sampy.env import Environment
|
|
from sampy.struct.server import ServerConfig
|
|
|
|
from sampy.shared.glob import config
|
|
|
|
environments = []
|
|
|
|
for server in config["demo"]["servers"]:
|
|
server_config = ServerConfig(**server) # Initialize a new Server struct every time even if you are just changing the port (required due to reference and automation values)
|
|
env = Environment(server_config)
|
|
environments.append(env)
|
|
|
|
for env in environments:
|
|
env.start() # Start all servers
|
|
|
|
env_index = 0
|
|
while len(environments):
|
|
cmd = input("")
|
|
environments[env_index].command(cmd)
|