이대로 제출해버릴까..
This commit is contained in:
@@ -7,7 +7,7 @@ struct Address;
|
||||
|
||||
class Socket {
|
||||
public:
|
||||
Socket() = default;
|
||||
Socket();
|
||||
Socket(int domain, int type, int protocol);
|
||||
~Socket();
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ class TCPSocket : public Socket {
|
||||
public:
|
||||
using Socket::init;
|
||||
using Socket::Socket;
|
||||
TCPSocket(int domain);
|
||||
|
||||
int init(int domain);
|
||||
int listen(int __n);
|
||||
void accept(std::shared_ptr<TCPSocket>& newSock, Address& addr);
|
||||
|
||||
29
include/utils/ConfigManager.h
Normal file
29
include/utils/ConfigManager.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
#include <json/json.h>
|
||||
|
||||
#include <fstream>
|
||||
|
||||
namespace utils {
|
||||
|
||||
struct Config;
|
||||
|
||||
class ConfigManager {
|
||||
public:
|
||||
static Config load();
|
||||
static void save(Config&);
|
||||
};
|
||||
|
||||
struct Config {
|
||||
~Config() { ConfigManager::save(*this); }
|
||||
Json::Value configJsonRoot;
|
||||
std::uint32_t ipVersion = 0;
|
||||
gsl::czstring IP = "";
|
||||
std::uint32_t Port = 0;
|
||||
spdlog::level::level_enum logLevel = spdlog::level::off;
|
||||
gsl::czstring logFileName = "";
|
||||
std::uint32_t logfileSize = 0;
|
||||
std::uint32_t logfileCount = 0;
|
||||
std::uint64_t playerid = 0;
|
||||
};
|
||||
|
||||
} // namespace utils
|
||||
@@ -103,6 +103,7 @@ struct Model {
|
||||
material = std::move(other.material);
|
||||
original_offset = other.original_offset;
|
||||
owner = other.owner;
|
||||
OwnerID = ID;
|
||||
radius = other.radius;
|
||||
lifespan = other.lifespan;
|
||||
OnColision = other.OnColision;
|
||||
@@ -148,6 +149,7 @@ struct Model {
|
||||
glm::vec3 original_offset = glm::vec3(0.f);
|
||||
|
||||
std::weak_ptr<Model> owner;
|
||||
utils::Snowflake OwnerID;
|
||||
|
||||
std::float_t radius = 0.f;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class Physics {
|
||||
std::unordered_map<std::string, std::shared_ptr<Model>>& models);
|
||||
static void invokeOnColisionEvent(
|
||||
gsl::not_null<utils::ThreadPool*> thread_pool,
|
||||
std::unordered_map<utils::Snowflake, Model>& models);
|
||||
std::unordered_map<utils::Snowflake, std::shared_ptr<Model>>& models);
|
||||
|
||||
bool RayTrace(const glm::vec3& rayOrigin, const glm::vec3& rayDir,
|
||||
const glm::vec3& v0, const glm::vec3& v1, const glm::vec3& v2,
|
||||
|
||||
Reference in New Issue
Block a user