steam-min-cpp
Loading...
Searching...
No Matches
table.hpp
1
3#pragma once
4
5#include <array>
6#include <cstddef>
7
8// Forward declarations
9namespace Steam::Messaging {
10class CMClient;
11
12namespace Packets {
14class PacketMsg;
15} // namespace Packets
16} // namespace Steam::Messaging
17
18namespace Steam::Dispatch {
19using ProtoHandlerFn =
20 void (*)(Steam::Messaging::CMClient&,
21 const Steam::Messaging::Packets::PacketClientMsgProtobuf&);
22
23using MsgHandlerFn = void (*)(Steam::Messaging::CMClient&,
24 const Steam::Messaging::Packets::PacketMsg&);
25
26constexpr size_t MAX_EMSG = 12301;
27
28struct DispatchTable {
29 std::array<ProtoHandlerFn, MAX_EMSG> proto{};
30 std::array<MsgHandlerFn, MAX_EMSG> msg{};
31
32 DispatchTable() {
33 proto.fill(nullptr);
34 msg.fill(nullptr);
35 }
36};
37
38inline DispatchTable g_dispatch;
39} // namespace Steam::Dispatch
Definition packetbase.hpp:67