Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Move PeerID to hyperflux store #9204

Merged
merged 3 commits into from
Nov 7, 2023
Merged

Move PeerID to hyperflux store #9204

merged 3 commits into from
Nov 7, 2023

Conversation

HexaField
Copy link
Member

@HexaField HexaField commented Nov 3, 2023

Summary

🤖 Generated by Copilot at 1f3d47b

The pull request refactors the peerID management across the engine, the client, and the instance server by using the HyperFlux store as the single source of truth. This improves the peer-to-peer communication, synchronization, and testing of the engine. It also removes unused and redundant code from several files.

References

closes #insert number here

Explanation

🤖 Generated by Copilot at 1f3d47b

  • Removed uuidv4 and PeerID imports from several files where they are no longer needed (link,link,link,link,link)
  • Renamed engine_tw.tsx to engine.tsx to avoid confusion with the original file (link)
  • Changed Engine.instance.peerID from a string to a getter that returns the peerID from the HyperFlux store in Engine.ts (link)
  • Removed the assignment of Engine.instance.peerID to a random UUID from several files where it is no longer necessary (link,link,link,link,link,link,link)
  • Changed the peerID variable from a string to Engine.instance.store.peerID in several test files where it is used to match the peerID of the HyperFlux store (link,link,link,link,link,link,link,link,link,link,link,link,link,link)
  • Changed the authorityPeerID property of the NetworkObjectComponent from a string to Engine.instance.peerID in GrabbableSystem.test.ts (link)
  • Changed the peerID variable from a string to anotherPeerID in NetworkPeerFunctions.test.ts to avoid confusion with the peerID of the HyperFlux store and the engine instance (link,link,link)
  • Replaced the getPeerId function by the peerID property of the HyperFlux store in ActionFunctions.ts (link)
  • Added uuidv4 and PeerID imports to StoreFunctions.ts where they are needed to generate and store the peerID in the HyperFlux store (link)
  • Removed the getPeerId function from the HyperStore interface and replaced it by the peerID property of type PeerID in StoreFunctions.ts (link)
  • Initialized the peerID property to a random UUID in the createHyperStore function in StoreFunctions.ts (link)

🤖 Generated by Copilot at 1f3d47b

To improve the networking code
We refactored the use of peerID
We used HyperFlux store
To handle it more
And removed what was redundant or hid

QA Steps

List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.

Checklist

  • If this PR is still a WIP, convert to a draft
  • When this PR is ready, mark it as "Ready for review"
  • ensure all checks pass
  • Changes have been manually QA'd
  • Changes reviewed by at least 2 approved reviewers

@HexaField HexaField merged commit 05bea2b into dev Nov 7, 2023
8 checks passed
@HexaField HexaField deleted the move-peer-id-store branch November 7, 2023 08:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants