mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-04 23:06:08 +00:00
deprecate ForEachClientWeak in favor of new ForEachClient
This commit is contained in:
6
include/IterationDecision.h
Normal file
6
include/IterationDecision.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
enum IterationDecision {
|
||||
Continue,
|
||||
Break,
|
||||
};
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "IThreaded.h"
|
||||
#include "IterationDecision.h"
|
||||
#include "RWMutex.h"
|
||||
#include "TScopedTimer.h"
|
||||
#include <functional>
|
||||
@@ -23,7 +24,9 @@ public:
|
||||
void InsertClient(const std::shared_ptr<TClient>& Ptr);
|
||||
void RemoveClient(const std::weak_ptr<TClient>&);
|
||||
// in Fn, return true to continue, return false to break
|
||||
void ForEachClient(const std::function<bool(std::weak_ptr<TClient>)>& Fn);
|
||||
[[deprecated("use ForEachClient instead")]] void ForEachClientWeak(const std::function<bool(std::weak_ptr<TClient>)>& Fn);
|
||||
// in Fn, return Break or Continue
|
||||
void ForEachClient(const std::function<IterationDecision(const std::shared_ptr<TClient>&)>& Fn);
|
||||
size_t ClientCount() const;
|
||||
|
||||
static void GlobalParser(const std::weak_ptr<TClient>& Client, std::vector<uint8_t>&& Packet, TNetwork& Network);
|
||||
|
||||
Reference in New Issue
Block a user