2020-03-29 18:49:22 +02:00
from sampy . env import Environment
2020-03-29 19:12:31 +02:00
from sampy . struct . server import ServerConfig
2020-03-29 18:49:22 +02:00
from sampy . shared . glob import config
environments = [ ]
for server in config [ " demo " ] [ " servers " ] :
2020-03-29 19:12:31 +02:00
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)
2020-03-29 18:49:22 +02:00
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 )