extends Node

var server = preload('res://Server.tscn')
var auth = preload('res://Auth.tscn')

func _ready():
	var args = Array(OS.get_cmdline_args())
	if args.size() == 0:
		return
	match args[0]:
		"-server":
			print("player starting server...")
			var server2 = server.instance()
			var auth2 = auth.instance()
			server2.port = int(args[1])
			yield(get_tree().create_timer(1.0),'timeout')
			get_parent().add_child(server2)
			get_parent().add_child(auth2)
		"-x509":
			print("generating SSl Cert...")
#			get_tree().change_scene("res://x509Gen/X509Generator.tscn")
