- Edited
So i tried the following
#Server
var NET = ENetConnection.new()
NET.create_host_bound("127.0.0.1", port, 500, 5, 0, 0)
func _process(delta):
var service = NET.service()
print(len(NET.get_peers()),' ', NET.get_incoming_connections())
if service[1] != null:
print("object changed") # If it changes, then the client is likely "connected"
#Client
var NET = ENetConnection.new()
var host = null
var peer = null
var state = 0
func setup_connection():
host = NET.create_host(1, 5, 0, 0)
peer = NET.connect_to_host("127.0.0.1", 12000, 5)
func _process(delta):
var new_state = peer.get_state()
if state != new_state:
state = new_state
handle_state(new_state)
The Client and Server run on the same localhost machine, But somehow the client doesn't show up in the server. am I required to use 'ENetMultiplayerPeer' or am I missing something ?
I want to use Enet, but on a lower level to maintain more control.