Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frklan/godot-peer-finder
A Godot node to find other peers on the same network
https://github.com/frklan/godot-peer-finder
godot godot3 multiplayer udp
Last synced: 16 days ago
JSON representation
A Godot node to find other peers on the same network
- Host: GitHub
- URL: https://github.com/frklan/godot-peer-finder
- Owner: frklan
- License: other
- Created: 2020-07-26T11:17:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-26T17:28:19.000Z (over 4 years ago)
- Last Synced: 2024-11-20T23:33:51.587Z (3 months ago)
- Topics: godot, godot3, multiplayer, udp
- Language: GDScript
- Homepage:
- Size: 11.7 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
# Godot-Peer-Finder
Godot-Peer-Finder is a script that finds other instances on the same subnet by sending and receiveing UDP packets on port 35434.
## How to use
- Download the latest release from [https://github.com/frklan/Godot-Peer-Finder](https://github.com/frklan/Godot-Peer-Finder) somewhere in your project (e.g. as a sumbodule)
- Autoload the ´´´PeerFinder.gd´´´script in Godot (i.e. Project Settings -> Autoload)
- At a minimum, connect to the ```peer_found```and ```peer_lost``` signals, then call PeerFinder.start()## Example
See [https://github.com/frklan/Godot-Peer-Finder-Demo](https://github.com/frklan/Godot-Peer-Finder-Demo)
## Documentation
### Methods
## Start()
Starts the PeerFinder listening for peers and broadcasting it's existance.
### Stop()
Stops the PeerFiner listening and broadcasting
### Signals
| Name | Signal | Argument |
|-----------------------|-----------------|--------------------------------------------|
| Server started | server_started | None |
| Server stopped | server_stopped | None |
| New peer found | peer_found | [PeerEventPeerFound](#PeerEventPeerFound) |
| Per lost/dissapeard | peer_lost | [PeerEventPeerLost](#PeerEventPeerLost) |#### PeerEventPeerFound
An event that is dispatched when a new peer is discovered. Note the event will be dispatched again if the peer was previously seen and subsequently lost and rediscovered.
***Properties***
- peer_address: ***String*** A string containing the IP address of the remote peer
- peer_port: ***int*** The port the Peer appeared at (will always be 35434)
- packet_payload: ***String*** A string sent by the remote peer, currently hardcoded to "Hello"#### PeerEventPeerLost
An event sent when the PeerFinder has not received a UDP packet from the peer for more than 5 seconds
***Properties***
- peer_address: ***String*** A string containing the IP address of the remote peer
- peer_port: ***int*** The port the Peer appeared at (will always be 35434)## Contributing
Contributions are always welcome!
When contributing to this repository, please first discuss the change you wish to make via the issue tracker, email, or any other method with the owner of this repository before making a change.
Please note that we have a code of conduct, you are required to follow it in all your interactions with the project.
## Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/frklan/[TBD]/tags).
## Authors
- **Fredrik Andersson** - [frklan](https://github.com/frklan)
## License
This project is licensed under the CC BY-NC-SA License - see the [LICENSE](LICENSE) file for details
For commercial/proprietary licensing, please contact the project owner