Skip to content

Vendors: update MafiaNet to v0.10.0#212

Merged
Segfaultd merged 3 commits into
developfrom
update/mafianet-0.10.0
Jun 15, 2026
Merged

Vendors: update MafiaNet to v0.10.0#212
Segfaultd merged 3 commits into
developfrom
update/mafianet-0.10.0

Conversation

@Segfaultd

@Segfaultd Segfaultd commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

Updates the vendored MafiaNet dependency from v0.9.0 → v0.10.0 (commit 0ab32ce5) and adapts the Framework to its breaking API changes.

Vendored bump (vendors/mafianet/)

  • Replaced the Source/ tree with the v0.10.0 tag (new sources PeerHandle.cpp, PointGridSectorizer.cpp, guid_util.cpp are picked up automatically via the existing file(GLOB ...)).
  • Updated VERSION.txt, the CMakeLists.txt pin comment, and README.md to v0.10.0.

Our-side fixes (code/framework/)

v0.10.0 turns the global C enums into scoped enum classes and removes the non-thread-safe GUID stringifier. Adapted all 6 call sites:

Old New
PacketPriority / PacketReliability MafiaNet::Priority / MafiaNet::Reliability
HIGH_PRIORITY / RELIABLE_ORDERED MafiaNet::Priority::High / MafiaNet::Reliability::ReliableOrdered
IMMEDIATE_PRIORITY, LOW_PRIORITY MafiaNet::Priority::Immediate, ::Low
packet->guid.ToString() MafiaNet::to_string(packet->guid) (+ #include <mafianet/guid_util.h>)

Enum values are preserved upstream, so the change is wire-compatible.

Files touched: network_peer.h, network_server.{h,cpp}, network_client.cpp, integrations/client/instance.cpp.

Testing

  • MafiaNet, Framework, FrameworkServer, FrameworkTests build cleanly.
  • RunFrameworkTests: 123/123 pass.

Caveat

This was a server-only build config — FrameworkClient (incl. network_client.cpp, integrations/client/instance.cpp) was not compiled locally. Those client edits are mechanical and verified against the new signatures, but should be confirmed in a client build.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added RAII wrapper types for safer packet and peer resource management
    • Added thread-safe GUID conversion utility and optional peer address lookup
    • Added spatial grid indexing for efficient point-based range queries
    • Introduced canonical type aliases for improved API ergonomics
  • API Changes

    • Priority and reliability parameters migrated to scoped enum types (breaking change requiring code updates)

Bump vendored MafiaNet from v0.9.0 to v0.10.0 (commit 0ab32ce5).

Notable upstream changes: scoped MafiaNet::Priority / MafiaNet::Reliability
enum classes replacing the global PacketPriority / PacketReliability C
enums (wire-compatible, values preserved), removal of the non-thread-safe
RakNetGUID::ToString() member in favor of MafiaNet::to_string(), plus the
new umbrella header, RAII handles and PointGridSectorizer.

Refresh VERSION.txt, the CMakeLists pin comment and README to v0.10.0.
MafiaNet v0.10.0 replaces the global PacketPriority / PacketReliability
enums with scoped MafiaNet::Priority / MafiaNet::Reliability enum classes
and removes the non-thread-safe RakNetGUID::ToString() member.

Update RPC/peer call sites to the new types and enumerators, and switch
GUID logging to MafiaNet::to_string().
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

This PR vendors MafiaNet 0.10.0, introduces new helper headers and utility classes, replaces legacy packet priority and reliability types with scoped MafiaNet enums across the library, and updates framework networking code to the new APIs and GUID formatting helpers.

Changes

MafiaNet 0.10 update

Layer / File(s) Summary
Public API and helper additions
vendors/mafianet/Source/include/mafianet/PacketPriority.h, vendors/mafianet/Source/include/mafianet/{aliases.h,guid_util.h,mafianet.h,PeerHandle.h,PointGridSectorizer.h,version.h}, vendors/mafianet/Source/src/{guid_util.cpp,PeerHandle.cpp,PointGridSectorizer.cpp,RakNetTypes.cpp}, vendors/mafianet/Source/CMakeLists.txt, vendors/mafianet/{README.md,VERSION.txt,CMakeLists.txt}
MafiaNet 0.10.0 adds scoped Priority and Reliability enums, GUID utilities, alias and umbrella headers, RAII peer and packet handles, a point-grid sectorizer, and corresponding build and version metadata updates.
Core transport enum migration
vendors/mafianet/Source/include/mafianet/{peerinterface.h,peer.h,InternalPacket.h,PluginInterface2.h,ReliabilityLayer.h,DirectoryDeltaTransfer.h,FileListTransfer.h,VariableDeltaSerializer.h,statistics.h,...}, vendors/mafianet/Source/src/{RakPeer.cpp,ReliabilityLayer.cpp,PluginInterface2.cpp,DirectoryDeltaTransfer.cpp,FileListTransfer.cpp,RakNetStatistics.cpp,PacketLogger.cpp,VariableDeltaSerializer.cpp}
Core send, shutdown, buffering, serialization, transfer, and statistics paths now use scoped MafiaNet enum types and constants, with matching bounds checks, metadata encoding, and helper comparisons.
Plugin and subsystem call-site migration
vendors/mafianet/Source/include/mafianet/{RPC4Plugin.h,RelayPlugin.h,ReplicaManager3.h}, vendors/mafianet/Source/src/{CloudClient.cpp,CloudServer.cpp,ConnectionGraph2.cpp,FullyConnectedMesh2.cpp,NatPunchthrough*.cpp,NatTypeDetection*.cpp,RPC4Plugin.cpp,ReadyEvent.cpp,RelayPlugin.cpp,ReplicaManager3.cpp,Router2.cpp,Team*.cpp,TwoWayAuthentication.cpp,UDPProxy*.cpp,RakNetTransport2.cpp}
Plugin and subsystem networking code updates public signatures and send call arguments to the scoped MafiaNet enums while preserving existing request, relay, replication, NAT, routing, team, and authentication flows.
Framework integration updates
code/framework/src/networking/{network_peer.h,network_client.cpp,network_server.h,network_server.cpp}, code/framework/src/integrations/client/instance.cpp
Framework RPC APIs, disconnect and kick paths, asset download calls, and server GUID logging are updated to use the new MafiaNet enums and MafiaNet::to_string(...) helper.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~70 minutes

Possibly related issues

  • MafiaHub/MafiaNet#14 — Adds the aliases.h canonical type aliases and exposes them through the umbrella header.
  • MafiaHub/MafiaNet#15 — Implements MafiaNet::to_string(...) and connected_address(...) for GUID formatting and optional address lookup.
  • MafiaHub/MafiaNet#16 — Adds the Peer and PacketPtr RAII wrappers for peer and packet lifetime management.

Possibly related PRs

  • MafiaHub/Framework#201 — Both PRs touch the same framework networking surfaces and RPC-related interfaces during networking API updates.

Poem

🐇 I found new enums in the clover bright,
Scoped and tidy in the moonlit light.
A GUID now strings without a fuss,
Peer handles hop along with us.
Grid cells bloom where packets play,
And MafiaNet hops to 0.10 today.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update/mafianet-0.10.0

@Segfaultd Segfaultd merged commit ea17b55 into develop Jun 15, 2026
4 of 5 checks passed
@Segfaultd Segfaultd deleted the update/mafianet-0.10.0 branch June 15, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants