Godot Version
4.2.1
Question
I am trying to make a 3D multiplayer game but I am having trouble with the upnp function. I cannot get it to find a valid gateway, I checked and my router has UPNP turned on and it even works fine with my playstation just not with godot. Here is my code
func upnp_setup():
#OLD BUG
var upnp = UPNP.new()
var discover_result = upnp.discover()
assert(discover_result == UPNP.UPNP_RESULT_SUCCESS,
“UPNP Discover Failed! Error %s” % discover_result)
assert(upnp.get_gateway() and upnp.get_gateway().is_valid_gateway(), \
"UPNP Invalid Gateway!")
var map_result = upnp.add_port_mapping(PORT)
assert(map_result == UPNP.UPNP_RESULT_SUCCESS, \
"UPNP Port Mapping Failed! Error %s" % map_result)
print("Success! Join Address: %s" % upnp.query_external_address())
I got it from DevLogLogans video. It seems as though other have had this same problem before and don’t know how to fix it