shoutbox with new users and message display
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
extends Node
|
||||
|
||||
var network = NetworkedMultiplayerENet.new()
|
||||
var ip = "127.0.0.1"
|
||||
var port = 3000
|
||||
|
||||
func connect_to_server():
|
||||
network.create_client(ip, port)
|
||||
get_tree().set_network_peer(network)
|
||||
network.connect("connection_failed", self, "_connection_failed")
|
||||
network.connect("connection_succeeded", self, "_connection_succeeded")
|
||||
|
||||
func _connection_failed():
|
||||
print_debug("Failed to connect")
|
||||
|
||||
func _connection_succeeded():
|
||||
print_debug("Connected")
|
||||
|
||||
func _ready():
|
||||
connect_to_server()
|
||||
|
||||
Reference in New Issue
Block a user