Client environment selection dropdown
This commit is contained in:
parent
ddf5275a37
commit
948b379f9d
Binary file not shown.
@ -1,8 +1,7 @@
|
|||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
const SERVER_HOST : String = "192.168.1.34"
|
var server_host : String = "127.0.0.1"
|
||||||
#const SERVER_HOST : String = "stage.dt.cloudsumu.com"
|
|
||||||
#const SERVER_HOST : String = "dt-in-Publi-1S7VAU6QPEQHR-51ac8fd89ed249aa.elb.us-east-1.amazonaws.com"
|
|
||||||
const SERVER_PORT : int = 7777
|
const SERVER_PORT : int = 7777
|
||||||
|
|
||||||
signal disconnection
|
signal disconnection
|
||||||
@ -29,15 +28,15 @@ var connection_timer : Timer
|
|||||||
func _init():
|
func _init():
|
||||||
server_address = GDNetAddress.new()
|
server_address = GDNetAddress.new()
|
||||||
|
|
||||||
server_address.set_host(SERVER_HOST)
|
|
||||||
server_address.set_port(SERVER_PORT)
|
|
||||||
|
|
||||||
client = GDNetHost.new()
|
client = GDNetHost.new()
|
||||||
client.set_max_peers(1)
|
client.set_max_peers(1)
|
||||||
client.set_event_wait(250)
|
client.set_event_wait(250)
|
||||||
client.bind()
|
client.bind()
|
||||||
|
|
||||||
func connect_to_server():
|
func connect_to_server():
|
||||||
|
|
||||||
|
server_address.set_host(server_host)
|
||||||
|
server_address.set_port(SERVER_PORT)
|
||||||
peer = client.host_connect(server_address)
|
peer = client.host_connect(server_address)
|
||||||
if not connection_timer:
|
if not connection_timer:
|
||||||
connection_timer = Timer.new()
|
connection_timer = Timer.new()
|
||||||
|
Reference in New Issue
Block a user