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:
dmitry 2022-01-16 01:14:11 +03:00
commit d402f38295
No known key found for this signature in database
GPG key ID: 8297CE728B7A7E37
5 changed files with 19 additions and 3 deletions

View file

@ -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 <const uint8 *, size_t> &msg) -> int32 {
return Socket::sendto (socket, msg.first, msg.second, flags, dest, destLength);