Skip to content

Improve realtime P2P mechanism & added toggle Button Connection:#2

Merged
Habbatul merged 1 commit intomasterfrom
peer-to-peer
Jul 7, 2025
Merged

Improve realtime P2P mechanism & added toggle Button Connection:#2
Habbatul merged 1 commit intomasterfrom
peer-to-peer

Conversation

@Habbatul
Copy link
Copy Markdown
Owner

@Habbatul Habbatul commented Jul 7, 2025

  • Created a GUI button to start/stop P2P connection using a callback function to toggle P2P and WebSocket connections.
  • Added a function that accepts a callback to handle disconnection events (e.g., when a player disconnects) — used for removing entries from the remote player map.
  • Added a function that accepts a callback to send position updates when the local player moves (currently using dx & dy player) — used to real time position data sending.
  • Added a function that accepts a callback triggered on the first onOpen event of the dataChannel "position" — used to initiate position sending.

- Created a GUI button to start/stop P2P connection using a callback function to toggle P2P and WebSocket connections.
- Added a function that accepts a callback to handle disconnection events (e.g., when a player disconnects) — used for removing entries from the remote player map.
- Added a function that accepts a callback to send position updates when the local player moves (currently using dx & dy player) — used to real time position data sending.
- Added a function that accepts a callback triggered on the first onOpen event of the dataChannel "position" — used to initiate position sending.
@Habbatul Habbatul merged commit b052c9b into master Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant