Fix docs on multiplayer peer signals.
NetworkedMultiplayerPeerENet emits peer_connected and peer_disconnected
on both the client and the server:
6fed1ffa31/modules/enet/networked_multiplayer_enet.cpp (L268)
When trying to implement `NetworkedMultiplayerCustom`, I followed the
documentation and only emitted this signal on the server.
I ended up getting errors like:
```
Invalid packet received. Unabled to find requested cached node
```
While I didn't check other peer implementations, it seems that emitting
on both the client and server is required.
I copied the wording from the `master` branch documentation.
Here's some output from a test program with all the signals connected:
```
1948301815 got multiplayer.network_peer_connected from 1
1948301815 got peer.peer_connected from 1
1948301815 got multiplayer.connected_to_server
1948301815 got peer.connection_succeeded
1413532890 got multiplayer.network_peer_connected from 1
1413532890 got peer.peer_connected from 1
1413532890 got multiplayer.connected_to_server
1413532890 got peer.connection_succeeded
1 got multiplayer.network_peer_connected from 1413532890
1 got peer.peer_connected from 1413532890
1 got multiplayer.network_peer_connected from 1948301815
1 got peer.peer_connected from 1948301815
1413532890 got multiplayer.network_peer_connected from 1948301815
1413532890 got peer.peer_connected from 1948301815
1948301815 got multiplayer.network_peer_connected from 1413532890
1948301815 got peer.peer_connected from 1413532890
1 got multiplayer.network_peer_disconnected from 1948301815
1 got peer.peer_disconnected from 1948301815
1413532890 got multiplayer.network_peer_disconnected from 1948301815
1413532890 got peer.peer_disconnected from 1948301815
1 got multiplayer.network_peer_disconnected from 1413532890
1 got peer.peer_disconnected from 1413532890
```
This commit is contained in:
parent
e90ac4b0e7
commit
c3d9cc7068
1 changed files with 2 additions and 2 deletions
|
@ -67,13 +67,13 @@
|
|||
<signal name="peer_connected">
|
||||
<argument index="0" name="id" type="int" />
|
||||
<description>
|
||||
Emitted by the server when a client connects.
|
||||
Emitted when a remote peer connects.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="peer_disconnected">
|
||||
<argument index="0" name="id" type="int" />
|
||||
<description>
|
||||
Emitted by the server when a client disconnects.
|
||||
Emitted when a remote peer has disconnected.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="server_disconnected">
|
||||
|
|
Loading…
Reference in a new issue