#Closing a server (ENetMultiplayerPeer)

3 messages · Page 1 of 1 (latest)

wild lynx
#

I am currently looking into making multiplayer work for my co-op platformer game, and managed to get the basics of hosting and joining work thanks to a tutorial.

Hosting is done with the create_server command from ENetMultiplayerPeer.

However, I can't seem to find a way to close a created server. I searched and tried for things like close_server or something similar, but couldn't find it or get anything to work. How do I achieve this?

(NOTE: If I don't close the server but instead just set the instanced ENetMultiplayerPeer variable to null, I get an error (code 20) when attempting to host again; presumably because the previously created server is still open)

wild lynx
#

^ For reference, this is the code creating the server

#

And this is where I am attempting to close it