mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-02-16 10:41:01 +00:00
Remove Socket.io for now
it is being built every time and we dont need it
This commit is contained in:
@@ -91,7 +91,7 @@ private:
|
||||
static inline std::mutex mShutdownHandlersMutex {};
|
||||
static inline std::deque<TShutdownHandler> mShutdownHandlers {};
|
||||
|
||||
static inline Version mVersion { 2, 3, 0 };
|
||||
static inline Version mVersion { 2, 4, 0 };
|
||||
};
|
||||
|
||||
std::string ThreadName(bool DebugModeOverride = false);
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <deque>
|
||||
#include <mutex>
|
||||
#include <sio_client.h>
|
||||
#include <thread>
|
||||
#include <memory>
|
||||
|
||||
/*
|
||||
* We send relevant server events over socket.io to the backend.
|
||||
*
|
||||
* We send all events to `backend.beammp.com`, to the room `/key`
|
||||
* where `key` is the currently active auth-key.
|
||||
*/
|
||||
|
||||
enum class SocketIOEvent {
|
||||
ConsoleOut,
|
||||
CPUUsage,
|
||||
MemoryUsage,
|
||||
NetworkUsage,
|
||||
PlayerList,
|
||||
};
|
||||
|
||||
enum class SocketIORoom {
|
||||
None,
|
||||
Stats,
|
||||
Player,
|
||||
Info,
|
||||
Console,
|
||||
};
|
||||
|
||||
class SocketIO final {
|
||||
private:
|
||||
struct Event;
|
||||
|
||||
public:
|
||||
enum class EventType {
|
||||
};
|
||||
|
||||
// Singleton pattern
|
||||
static SocketIO& Get();
|
||||
|
||||
void Emit(SocketIOEvent Event, const std::string& Data);
|
||||
|
||||
~SocketIO();
|
||||
|
||||
void SetAuthenticated(bool auth) { mAuthenticated = auth; }
|
||||
|
||||
private:
|
||||
SocketIO() noexcept;
|
||||
|
||||
void ThreadMain();
|
||||
|
||||
struct Event {
|
||||
std::string Name;
|
||||
std::string Data;
|
||||
};
|
||||
|
||||
bool mAuthenticated { false };
|
||||
sio::client mClient;
|
||||
std::thread mThread;
|
||||
std::atomic_bool mCloseThread { false };
|
||||
std::mutex mQueueMutex;
|
||||
std::deque<Event> mQueue;
|
||||
|
||||
friend std::unique_ptr<SocketIO> std::make_unique<SocketIO>();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user