LeviLamina
Loading...
Searching...
No Matches
ShadowBanList.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/raknet/RakPeer.h"
7
8// auto generated forward declare list
9// clang-format off
10namespace RakNet { struct SystemAddress; }
11// clang-format on
12
13namespace RakNet {
14
15class ShadowBanList {
16public:
17 // ShadowBanList inner types declare
18 // clang-format off
19 struct Entry;
20 // clang-format on
21
22 // ShadowBanList inner types define
23 struct Entry {
24 public:
25 // member variables
26 // NOLINTBEGIN
30 // NOLINTEND
31
32 public:
33 // prevent constructor by default
34 Entry& operator=(Entry const&);
35 Entry(Entry const&);
36 Entry();
37 };
38
39 using BanCallback = ::std::function<void(::std::string const&)>;
40
41 using Ip = ::std::array<::std::byte, 16>;
42
43 using LoggingFunctor = ::std::function<void(::std::string const&)>;
44
45 using Time = ::std::chrono::seconds;
46
47public:
48 // member variables
49 // NOLINTBEGIN
50 ::ll::TypedStorage<8, 8, ::std::chrono::seconds> banExpiryDuration;
51 ::ll::TypedStorage<8, 8, ::std::chrono::seconds> appHandshakeGracePeriod;
52 ::ll::TypedStorage<8, 10240, ::std::array<::std::optional<::RakNet::ShadowBanList::Entry>, 256>> mEntries;
53 ::ll::TypedStorage<8, 64, ::std::function<void(::std::string const&)>> mBanCallback;
54 // NOLINTEND
55
56public:
57 // prevent constructor by default
58 ShadowBanList();
59
60public:
61 // member functions
62 // NOLINTBEGIN
63 MCAPI ShadowBanList(
64 ::std::function<void(::std::string const&)> addBanCallback,
65 ::std::chrono::seconds banExpiryDuration,
66 ::std::chrono::seconds appHandshakeGracePeriod
67 );
68
69 MCAPI ushort addBan(::RakNet::SystemAddress const& addr, ::std::chrono::seconds time);
70
71 MCAPI ::RakNet::RakPeer::RemoteSystemStruct* shouldDisconnectConnection(
73 ::std::chrono::seconds now,
74 ::gsl::span<::RakNet::RakPeer::RemoteSystemStruct*> remotes
75 );
76
77 MCAPI bool tryUnban(::RakNet::SystemAddress const& addr);
78
79 MCAPI uint64 updateBans(::std::chrono::seconds now);
80
81 MCAPI ~ShadowBanList();
82 // NOLINTEND
83
84public:
85 // constructor thunks
86 // NOLINTBEGIN
87 MCAPI void* $ctor(
88 ::std::function<void(::std::string const&)> addBanCallback,
89 ::std::chrono::seconds banExpiryDuration,
90 ::std::chrono::seconds appHandshakeGracePeriod
91 );
92 // NOLINTEND
93
94public:
95 // destructor thunk
96 // NOLINTBEGIN
97 MCAPI void $dtor();
98 // NOLINTEND
99};
100
101} // namespace RakNet
Definition ShadowBanList.h:23
Definition SystemAddress.h:7
Definition Alias.h:14