update players info

This commit is contained in:
Lion Kortlepel
2021-02-17 12:17:41 +01:00
committed by Anonymous275
parent bca4b3f140
commit 13f8be5d39
15 changed files with 135 additions and 44 deletions

View File

@@ -56,7 +56,7 @@ private:
static inline std::deque<TShutdownHandler> mShutdownHandlers {};
};
/*
#ifndef DEBUG
static inline void warn(const std::string& str) {
Application::Console().Write(std::string("[WARN] ") + str);
}
@@ -72,9 +72,9 @@ static inline void debug(const std::string& str) {
}
}
static inline void luaprint(const std::string& str) {
Application::Console().Write(std::string("[LUA] ") + str);
Application::Console().WriteRaw(str);
}
*/
#else // DEBUG
#define warn(x) Application::Console().Write(std::string(__PRETTY_FUNCTION__) + ":" + std::to_string(__LINE__) + std::string(" [WARN] ") + (x))
#define info(x) Application::Console().Write(std::string(__PRETTY_FUNCTION__) + ":" + std::to_string(__LINE__) + std::string(" [INFO] ") + (x))
@@ -86,6 +86,7 @@ static inline void luaprint(const std::string& str) {
Application::Console().Write(std::string(__PRETTY_FUNCTION__) + ":" + std::to_string(__LINE__) + std::string(" [DEBUG] ") + (x)); \
} \
} while (false)
#endif // DEBUG
#define Biggest 30000
std::string Comp(std::string Data);

View File

@@ -1,5 +1,6 @@
#pragma once
#include "TLuaFile.h"
#include "commandline/commandline.h"
#include <atomic>
#include <fstream>
@@ -9,7 +10,10 @@ public:
TConsole();
void Write(const std::string& str);
void WriteRaw(const std::string& str);
void InitializeLuaConsole(TLuaEngine& Engine);
private:
std::unique_ptr<TLuaFile> mLuaConsole { nullptr };
Commandline mCommandline;
};

View File

@@ -1,5 +1,4 @@
#ifndef TLUAENGINE_H
#define TLUAENGINE_H
#pragma once
#include "Common.h"
#include "IThreaded.h"
@@ -12,6 +11,7 @@
class TLuaEngine : public IThreaded {
public:
explicit TLuaEngine(TServer& Server, TTCPServer& TCPServer, TUDPServer& UDPServer);
~TLuaEngine();
using TSetOfLuaFile = std::set<std::unique_ptr<TLuaFile>>;
@@ -38,5 +38,3 @@ private:
bool mShutdown { false };
TSetOfLuaFile mLuaFiles;
};
#endif // TLUAENGINE_H

View File

@@ -11,6 +11,7 @@ class TResourceManager;
class TTCPServer : public IThreaded {
public:
explicit TTCPServer(TServer& Server, TPPSMonitor& PPSMonitor, TResourceManager& ResourceManager);
~TTCPServer();
void operator()() override;

View File

@@ -10,6 +10,7 @@
class TUDPServer : public IThreaded {
public:
explicit TUDPServer(TServer& Server, TPPSMonitor& PPSMonitor, TTCPServer& TCPServer);
~TUDPServer();
void operator()() override;
@@ -21,6 +22,7 @@ private:
TPPSMonitor& mPPSMonitor;
TTCPServer& mTCPServer;
SOCKET mUDPSock {};
bool mShutdown { false };
std::string UDPRcvFromClient(sockaddr_in& client) const;
};