조작이 둔할 때가 생기는데 뭘까?

This commit is contained in:
2025-06-19 03:26:03 +09:00
parent fc8217a608
commit dc2c106bad
4 changed files with 22 additions and 7 deletions

View File

@@ -13,6 +13,9 @@
#define LISTENIP "::"
#define LISTENPORT 9010
#define TICKRATE 60
constexpr double TICKDELAY = (1 / TICKRATE);
std::uint8_t CLIENTID = 0;
std::unordered_map<utils::Snowflake, veng::Model> MODELS;
@@ -59,7 +62,7 @@ void ClientRefresher(utils::ThreadPool* tp, Network::IOCP* iocp) {
static double last_frame_time_;
auto current_time = glfwGetTime();
bool needs_all_update = false;
if (current_time - last_all_updated >= .01f) {
if (current_time - last_all_updated >= TICKDELAY) {
needs_all_update = true;
last_all_updated = glfwGetTime();
}
@@ -100,12 +103,12 @@ void ClientRefresher(utils::ThreadPool* tp, Network::IOCP* iocp) {
}
CLIENTS_MUTEX.lock();
for (auto& client : CLIENTS) {
if (client->sock == 0) continue;
for (auto& model : MODELS) {
if (model.second.name == "camera_lag") continue;
for (auto& model : MODELS) {
if (model.second.name == "camera_lag") continue;
model.second.Update(delta_time);
for (auto& client : CLIENTS) {
if (client->sock == 0) continue;
std::vector<char> send_data;
model.second.Update(delta_time);
auto model_serialized = model.second.Serialize();
Packet::Header header;
header.opcode = Packet::Opcode::UPDATEMODEL;