generated from AfonsoCMSousa/CPP-Template
feat and fix: log and server issues
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#ifndef LOG_H
|
||||
#define LOG_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
|
||||
typedef enum {
|
||||
LOG_INFO,
|
||||
LOG_DEBUG,
|
||||
LOG_WARN,
|
||||
LOG_ERROR
|
||||
} LogLevel;
|
||||
|
||||
void log_print(LogLevel level, const char* format, ...);
|
||||
|
||||
#define log_info(...) log_print(LOG_INFO, __VA_ARGS__)
|
||||
#define log_debug(...) log_print(LOG_DEBUG, __VA_ARGS__)
|
||||
#define log_warn(...) log_print(LOG_WARN, __VA_ARGS__)
|
||||
#define log_error(...) log_print(LOG_ERROR, __VA_ARGS__)
|
||||
|
||||
#endif // LOG_H
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <sys/un.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "server_structs.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -199,6 +199,7 @@ enum ACSP_MessageType {
|
||||
// ============================
|
||||
// PROTOCOL VERSION
|
||||
// ============================
|
||||
// DONE: Update this when protocol changes
|
||||
PROTOCOL_VERSION = 4,
|
||||
|
||||
// ============================
|
||||
|
||||
@@ -14,7 +14,6 @@ private:
|
||||
|
||||
public:
|
||||
SessionManager(u_int8_t sid);
|
||||
~SessionManager();
|
||||
|
||||
void on_new_session(const trackAtributes &track);
|
||||
void on_player_connected(const carAtributes &car);
|
||||
|
||||
Reference in New Issue
Block a user