From f6c5379a8c55e6a63763b7cb2fb8d9b7e04e1717 Mon Sep 17 00:00:00 2001 From: MarcEricMartel Date: Thu, 7 Dec 2023 13:05:52 -0500 Subject: [PATCH] =?UTF-8?q?=C2=B0Oo.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SQCSim-srv/server.cpp | 16 ++++++++++------ SQCSim-srv/server.h | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/SQCSim-srv/server.cpp b/SQCSim-srv/server.cpp index 0e5221d..d749bb4 100644 --- a/SQCSim-srv/server.cpp +++ b/SQCSim-srv/server.cpp @@ -224,6 +224,14 @@ void Server::Run() { std::vector bullets, outbox_bullets; std::vector netbull; + Chat* startchat; + startchat->src_id = 0; + char startmess[] = "How would YOU like to die today, motherfuckers?"; + + strcpy(startchat->mess, 140, startmess); + + chatlog.emplace_back(startchat); + while (!endgame) { using namespace std::chrono; Timestamp tstamp = duration_cast(high_resolution_clock::now() - start).count(); @@ -330,10 +338,6 @@ void Server::Run() { } } - //for (auto& bull : outbox_bullets) - // delete bull; - //outbox_bullets.clear(); - for (auto& chat : chatlog) { Log(chat->mess, false, false); for (auto& [key, conn] : m_conns) @@ -354,7 +358,7 @@ void Server::Run() { Chat end; end.src_id = 0; - char endmess[] = "Game over, mothereffers."; + char endmess[] = "Game over, man. Game over."; strcpy(end.mess, 140, endmess); @@ -362,7 +366,7 @@ void Server::Run() { sendPackTo(m_sock_udp, &end, &m_buf, conn->getAddr()); // TODO: Gérer les 2-3 secondes post-game avant le billboard pour pas avoir un whiplash à la fin de la game. - + system("pause"); } inline std::string Server::LogTimestamp() { diff --git a/SQCSim-srv/server.h b/SQCSim-srv/server.h index 33fde93..72c0945 100644 --- a/SQCSim-srv/server.h +++ b/SQCSim-srv/server.h @@ -1,6 +1,7 @@ #ifndef SERVER_H__ #define SERVER_H__ +#include #include #include #include