diff --git a/ext/crlib b/ext/crlib index 28b1cf2..9375af6 160000 --- a/ext/crlib +++ b/ext/crlib @@ -1 +1 @@ -Subproject commit 28b1cf23456d630b886150483d9b5d9f004f9451 +Subproject commit 9375af6e408b5fcd195c2bce5f2565bc3fbd3160 diff --git a/inc/support.h b/inc/support.h index 122ef32..5305a32 100644 --- a/inc/support.h +++ b/inc/support.h @@ -112,6 +112,9 @@ public: // checks if same model ommiting the models directory bool isModel (const edict_t *ent, StringRef model); + // get the current date and time as string + String getCurrentDateTime (); + public: // re-show welcome after changelevel ? diff --git a/src/engine.cpp b/src/engine.cpp index d054c21..6a355dd 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -473,7 +473,7 @@ void Game::sendClientMessage (bool console, edict_t *ent, StringRef message) { // used to split messages auto sendTextMsg = [&console, &ent] (StringRef text) { - MessageWriter (MSG_ONE, msgs.id (NetMsg::TextMsg), nullptr, ent) + MessageWriter (MSG_ONE_UNRELIABLE, msgs.id (NetMsg::TextMsg), nullptr, ent) .writeByte (console ? HUD_PRINTCONSOLE : HUD_PRINTCENTER) .writeString (text.chars ()); }; diff --git a/src/graph.cpp b/src/graph.cpp index 24f1231..baa31e4 100644 --- a/src/graph.cpp +++ b/src/graph.cpp @@ -2399,9 +2399,10 @@ void BotGraph::frame () { // show the information about that point graphMessage.assignf ("\n\n\n\n Graph Information:\n\n" + " Map: %s @ %s\n" " Node %d of %d, Radius: %.1f, Light: %.1f\n" " Flags: %s\n" - " Origin: %s\n\n", nearestIndex, m_paths.length () - 1, path.radius, path.light, getFlagsAsStr (nearestIndex), pathOriginStr (nearestIndex)); + " Origin: %s\n\n", game.getMapName (), util.getCurrentDateTime (), nearestIndex, m_paths.length () - 1, path.radius, path.light, getFlagsAsStr (nearestIndex), pathOriginStr (nearestIndex)); // if node is not changed display experience also if (!m_hasChanged) { diff --git a/src/support.cpp b/src/support.cpp index 2792a26..0151579 100644 --- a/src/support.cpp +++ b/src/support.cpp @@ -681,6 +681,18 @@ bool BotSupport::isModel (const edict_t *ent, StringRef model) { return model.startsWith (ent->v.model.chars (9)); } +String BotSupport::getCurrentDateTime () { + time_t ticks = time (&ticks); + tm timeinfo {}; + + plat.loctime (&timeinfo, &ticks); + + auto timebuf = strings.chars (); + strftime (timebuf, StringBuffer::StaticBufferSize, "%d-%m-%Y %H:%M:%S", &timeinfo); + + return String (timebuf); +} + int32 BotSupport::sendTo (int socket, const void *message, size_t length, int flags, const sockaddr *dest, int destLength) { const auto send = [&] (const Twin &msg) -> int32 { return Socket::sendto (socket, msg.first, msg.second, flags, dest, destLength);