Compare commits

...

2 Commits

Author SHA1 Message Date
Green Sky 2b186a3071
missing include 2023-01-16 17:05:10 +01:00
Green Sky fc13d93d42
reduce log spam 2023-01-16 15:30:46 +01:00
1 changed files with 9 additions and 0 deletions

View File

@ -1,8 +1,13 @@
#include "./ngc_ext.hpp"
//#include <cstdint>
#include <cstdio>
#include <new>
#ifndef EXTRA_LOGGING
#define EXTRA_LOGGING 0
#endif
using namespace NGC_EXT;
// global scope
@ -42,7 +47,9 @@ void NGC_EXT_handle_group_custom_packet(
PacketType pkg_type = static_cast<PacketType>(*(data + curser));
curser++;
#if defined(EXTRA_LOGGING) && EXTRA_LOGGING == 1
fprintf(stderr, "EX: custom_packet [%s] %lu\n", pkgid2str(pkg_type), length);
#endif
if (pkg_type == INVALID) {
fprintf(stderr, "(invalid)\n");
@ -52,7 +59,9 @@ void NGC_EXT_handle_group_custom_packet(
auto handle_fn = ngc_ext_ctx->callbacks[pkg_type];
auto handle_ud = ngc_ext_ctx->user_data[pkg_type]; // can be null
if (handle_fn == nullptr) {
#if defined(EXTRA_LOGGING) && EXTRA_LOGGING == 1
fprintf(stderr, "EX: !!! no handler for packet\n");
#endif
return;
}