diff options
author | Freeyorp <TheFreeYorp+github@gmail.com> | 2018-12-30 20:42:35 +1300 |
---|---|---|
committer | gumi <git@gumi.ca> | 2018-12-30 10:31:04 -0500 |
commit | f445da8b5a489cad8451aec4143516b37ab34aa1 (patch) | |
tree | b67a4aecf9e6b6216851d789796ec16dc36485ff /src/char/char.hpp | |
parent | 5540d3a9fa3879600485c99c2fe7eab2fd815747 (diff) | |
download | tmwa-f445da8b5a489cad8451aec4143516b37ab34aa1.tar.gz tmwa-f445da8b5a489cad8451aec4143516b37ab34aa1.tar.bz2 tmwa-f445da8b5a489cad8451aec4143516b37ab34aa1.tar.xz tmwa-f445da8b5a489cad8451aec4143516b37ab34aa1.zip |
Improve char-server logging
Sends many important messages to both stdout and to log, rather than
just one or the other, which required often time consuming reconstruction.
Also shout on many more cases of unusual behaviour, and log the IP in a
format suitable for fail2ban or other anti-bruteforce measures.
When unusual unauthenticated behaviour is detected, close the connection
immediately, rather than just skipping the current packet.
Diffstat (limited to 'src/char/char.hpp')
-rw-r--r-- | src/char/char.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/char/char.hpp b/src/char/char.hpp index a771730..1151750 100644 --- a/src/char/char.hpp +++ b/src/char/char.hpp @@ -71,5 +71,10 @@ void char_log(XString line); #define CHAR_LOG(fmt, ...) \ char_log(STRPRINTF(fmt, ## __VA_ARGS__)) +#define CHAR_LOG_AND_ECHO(...) \ + do { \ + PRINTF(__VA_ARGS__); \ + CHAR_LOG(__VA_ARGS__); \ + } while (0) } // namespace char_ } // namespace tmwa |