Skip to content

Mod: port off flecs onto native MafiaNet replication#17

Open
Kheartz wants to merge 1 commit into
mainfrom
flecs-to-native-replication
Open

Mod: port off flecs onto native MafiaNet replication#17
Kheartz wants to merge 1 commit into
mainfrom
flecs-to-native-replication

Conversation

@Kheartz

@Kheartz Kheartz commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

The framework replaced flecs + the streamer/message entity-sync layer with native ReplicaManager3 + RPC4 (MafiaHub/Framework@4bd235e). Port HogwartsMP onto it:

  • Humans are NetworkEntity subclasses: a shared HumanEntity (spawnProfile
    • nickname in the construction snapshot) and a client ClientHuman that binds the local player when owned or spawns a student proxy otherwise. Both register the same "HogwartsMP::Human" type with the EntityRegistry.
  • The server builds avatars in onPlayerConnect via ReplicationManager (CreateEntity/SetOwner/SetViewer); World.spawnHuman spawns server-owned NPCs. Per-entity spawn/update/despawn messages are gone.
  • Chat moves to the framework's built-in ChatMessage RPC and chat/connect callbacks; weather is a plain WeatherState + migrated SetWeather RPC.
  • Scripting Human now derives the framework's NetworkID-based Player builtin; the old flecs Entity builtin is removed.
  • Size the interest grid for Hogwarts' cm-scale coordinates.
  • Rename the SDK's SHA1_WORKSPACE_BLOCK to avoid a clash with mafianet's DR_SHA1.h, now pulled in transitively by the networking headers.

Used MafiaHub/MafiaMP@bb8c21b as a reference.

Verified client-server interaction. One hiccup was solved by changes that I proposed upstream MafiaHub/Framework#206

GHA checks failing--should be addressed by MafiaHub/Framework#207

@Kheartz Kheartz requested a review from Segfaultd June 14, 2026 21:30
@Kheartz Kheartz force-pushed the flecs-to-native-replication branch 2 times, most recently from 8a37e36 to bf5940d Compare June 14, 2026 21:46
@Kheartz Kheartz force-pushed the flecs-to-native-replication branch from bf5940d to 7a40563 Compare June 17, 2026 14:35
The framework replaced flecs + the streamer/message entity-sync layer
with native ReplicaManager3 + RPC4 (#201/#205). Port HogwartsMP onto it:

- Humans are NetworkEntity subclasses: a shared HumanEntity (spawnProfile
  + nickname in the construction snapshot) and a client ClientHuman that
  binds the local player when owned or spawns a student proxy otherwise.
  Both register the same "HogwartsMP::Human" type with the EntityRegistry.
- The server builds avatars in onPlayerConnect via ReplicationManager
  (CreateEntity/SetOwner/SetViewer); World.spawnHuman spawns server-owned
  NPCs. Per-entity spawn/update/despawn messages are gone.
- Chat moves to the framework's built-in ChatMessage RPC and chat/connect
  callbacks; weather is a plain WeatherState + migrated SetWeather RPC.
- Scripting Human now derives the framework's NetworkID-based Player
  builtin; the old flecs Entity builtin is removed.
- Size the interest grid for Hogwarts' cm-scale coordinates.
- Rename the SDK's SHA1_WORKSPACE_BLOCK to avoid a clash with mafianet's
  DR_SHA1.h, now pulled in transitively by the networking headers.
@Kheartz Kheartz force-pushed the flecs-to-native-replication branch from 7a40563 to 45778b0 Compare June 17, 2026 14:45
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.

2 participants