godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.71k stars 21.12k forks source link

no "IP" argument for Networking API #6248

Closed Marqin closed 8 years ago

Marqin commented 8 years ago

There is no option to set IP in create_server in NetworkedMultiplayerPeer. https://github.com/godotengine/godot/blob/master/modules/enet/networked_multiplayer_enet.h#L79

I've worked as sysadmin and servers with mutiple IPs (often FailOver IPs that can be rerouted to another server in matter of seconds) are really common.

And then comes this software than doesn't give you option to choose IP and screws your whole server....

Marqin commented 8 years ago

Seems TCP_server has the same bug - http://docs.godotengine.org/en/latest/classes/class_tcp_server.html?highlight=tcp

reduz commented 8 years ago

NetworkedMultiplayerENet wraps around ENet, which has no option for this as far as I know. We will not modify ENet, so we can keep it up to date. If you want to add it optionally for TCPServer feel free to do it and send a PR.

On Mon, Aug 22, 2016 at 6:52 PM, Hubert Jarosz notifications@github.com wrote:

Seems TCP_server has the same bug - http://docs.godotengine.org/ en/latest/classes/class_tcp_server.html?highlight=tcp

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/6248#issuecomment-241562840, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z27OW7p2_2id1Ohnd9dcTBW5eie3tks5qihomgaJpZM4JqV_k .

Marqin commented 8 years ago

It does. It's even mentioned in their official tutorial:

/* A specific host address can be specified by   */
/* enet_address_set_host (& address, "x.x.x.x"); */
bojidar-bg commented 8 years ago

@Marqin Given that TCP_Server accepts a list of accepted hosts in listen(), I think it is possible to tell it exactly which IP to use :wink:

Marqin commented 8 years ago

@reduz I've made PR to Godot and Godot-demos that adds IP argument for create_server.

I've checked it and it's working on OS X (binding on right IP, or on all when "0.0.0.0" provided).

Marqin commented 8 years ago

@bojidar-bg according to docs that argument is whitelist of IP's that can connect to this server.

akien-mga commented 8 years ago

Fixed by #6303.