Skip to content

[DX L0] Add a real umbrella header mafianet.h #12

@Segfaultd

Description

@Segfaultd

Context

Source/include/mafianet/mafianet.h is a placeholder — its entire body is:

// placeholder for upcoming single file include simplification

There are 158 headers in Source/include/mafianet/. A basic client today pulls in a hand-picked subset. From Samples/ChatExample/Client/Chat Example Client.cpp:22-46:

#include "mafianet/MessageIdentifiers.h"
#include "mafianet/peerinterface.h"
#include "mafianet/statistics.h"
#include "mafianet/types.h"
#include "mafianet/BitStream.h"
// ... plus platform shims

Goal

One include for the common client/server path:

#include "mafianet/mafianet.h"

Where

Edit Source/include/mafianet/mafianet.h. Add an include guard / #pragma once and aggregate the core public headers:

#pragma once
#include "mafianet/peerinterface.h"     // RakPeerInterface
#include "mafianet/types.h"             // Packet, SystemAddress, RakNetGUID, enums
#include "mafianet/MessageIdentifiers.h"// ID_* + ID_USER_PACKET_ENUM
#include "mafianet/PacketPriority.h"    // PacketPriority / PacketReliability
#include "mafianet/BitStream.h"         // serialization
#include "mafianet/GetTime.h"           // MafiaNet::GetTime / TimeMS

Notes

  • Purely additive; the 158 granular headers stay for advanced users.
  • Do not include encryption headers here — connection security on master is opt-in via RakPeerInterface::InitializeSecurity() (gated behind the LIBCAT_SECURITY build define) and most users won't use it.
  • As later facade types land (Peer, Dispatcher, …), add them to this umbrella.

Acceptance criteria

  • A connect-and-send program compiles with only #include "mafianet/mafianet.h".
  • No new include cycles (verify a clean build).
cmake -DMAFIANET_BUILD_SAMPLES=ON -B build && cmake --build build -j$(sysctl -n hw.ncpu)

Dependencies

None — Layer 0 foundation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dxDeveloper experience / public API ergonomicsenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions