이대로 제출해버릴까..

This commit is contained in:
2025-06-21 22:19:10 +09:00
parent 3a526edcf4
commit 0536f9fb11
19 changed files with 343 additions and 89 deletions

View File

@@ -7,7 +7,7 @@ struct Address;
class Socket {
public:
Socket() = default;
Socket();
Socket(int domain, int type, int protocol);
~Socket();

View File

@@ -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);

View 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

View File

@@ -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;

View File

@@ -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,