add: add current map and current time to graph editing overlay
fix: send client messages as unreliable to prevent reliable channel overflow (should solve problems when editing large number of waypoints on single location)
This commit is contained in:
parent
ae0156ff42
commit
d402f38295
5 changed files with 19 additions and 3 deletions
|
|
@ -1 +1 @@
|
||||||
Subproject commit 28b1cf23456d630b886150483d9b5d9f004f9451
|
Subproject commit 9375af6e408b5fcd195c2bce5f2565bc3fbd3160
|
||||||
|
|
@ -112,6 +112,9 @@ public:
|
||||||
// checks if same model ommiting the models directory
|
// checks if same model ommiting the models directory
|
||||||
bool isModel (const edict_t *ent, StringRef model);
|
bool isModel (const edict_t *ent, StringRef model);
|
||||||
|
|
||||||
|
// get the current date and time as string
|
||||||
|
String getCurrentDateTime ();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// re-show welcome after changelevel ?
|
// re-show welcome after changelevel ?
|
||||||
|
|
|
||||||
|
|
@ -473,7 +473,7 @@ void Game::sendClientMessage (bool console, edict_t *ent, StringRef message) {
|
||||||
|
|
||||||
// used to split messages
|
// used to split messages
|
||||||
auto sendTextMsg = [&console, &ent] (StringRef text) {
|
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)
|
.writeByte (console ? HUD_PRINTCONSOLE : HUD_PRINTCENTER)
|
||||||
.writeString (text.chars ());
|
.writeString (text.chars ());
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2399,9 +2399,10 @@ void BotGraph::frame () {
|
||||||
|
|
||||||
// show the information about that point
|
// show the information about that point
|
||||||
graphMessage.assignf ("\n\n\n\n Graph Information:\n\n"
|
graphMessage.assignf ("\n\n\n\n Graph Information:\n\n"
|
||||||
|
" Map: %s @ %s\n"
|
||||||
" Node %d of %d, Radius: %.1f, Light: %.1f\n"
|
" Node %d of %d, Radius: %.1f, Light: %.1f\n"
|
||||||
" Flags: %s\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 node is not changed display experience also
|
||||||
if (!m_hasChanged) {
|
if (!m_hasChanged) {
|
||||||
|
|
|
||||||
|
|
@ -681,6 +681,18 @@ bool BotSupport::isModel (const edict_t *ent, StringRef model) {
|
||||||
return model.startsWith (ent->v.model.chars (9));
|
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) {
|
int32 BotSupport::sendTo (int socket, const void *message, size_t length, int flags, const sockaddr *dest, int destLength) {
|
||||||
const auto send = [&] (const Twin <const uint8 *, size_t> &msg) -> int32 {
|
const auto send = [&] (const Twin <const uint8 *, size_t> &msg) -> int32 {
|
||||||
return Socket::sendto (socket, msg.first, msg.second, flags, dest, destLength);
|
return Socket::sendto (socket, msg.first, msg.second, flags, dest, destLength);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue