diff --git a/src/packages/game/IZ_app_net.c b/src/packages/game/IZ_app_net.c index 780afbd..ad1367d 100644 --- a/src/packages/game/IZ_app_net.c +++ b/src/packages/game/IZ_app_net.c @@ -1,17 +1,22 @@ #include "IZ_app_net.h" void IZ_AppHandleNetworkingInboundBinaryEvents(struct IZ_App* app, void* binary_raw, size_t len) { + if (len < 1) { + return; + } u8* binary = binary_raw; size_t i; - printf("%lu: Binary", IZ_AppGetTicks(app)); - for (i = 0; i < len; i += 1) { - printf("%c%02x", i == 0 ? '(' : ' ', binary[i]); + char binary_string[len * 3 + 1]; + IZ_memset(binary_string, 0, len * 3 + 1); + sprintf(binary_string, "%02x", binary[0]); + for (i = 1; i < len; i += 1) { + sprintf(binary_string, "%s %02x", binary_string, binary[i]); } - printf(")\n"); + IZ_LogInfo(IZ_LOG_CATEGORY_INPUT, "net/ws", "Received binary(length: %d): %s", len, binary_string); } void IZ_AppHandleNetworkingInboundTextEvents(struct IZ_App* app, const char* text, size_t len) { - printf("%lu: String(%s)\n", IZ_AppGetTicks(app), text); + IZ_LogInfo(IZ_LOG_CATEGORY_INPUT, "net/ws", "Received string(length: %d): %s", len, text); } void IZ_AppHandleOutboundNetworking(struct IZ_App* app) { diff --git a/src/packages/game/data/IZ_list.c b/src/packages/game/data/IZ_list.c index 1dd2538..e8eb82e 100644 --- a/src/packages/game/data/IZ_list.c +++ b/src/packages/game/data/IZ_list.c @@ -57,7 +57,7 @@ void IZ_ListPrintNodeValues(IZ_List* list) { u64 index = 0; printf("\nlist@%p\n", list); do { - printf(" %lu@%p:%u\n", index, *list->iterator, *((unsigned int*)(*list->iterator)->value)); + printf(" %llu@%p:%u\n", index, *list->iterator, *((unsigned int*)(*list->iterator)->value)); index += 1; list->iterator = &(*list->iterator)->next; } while (*list->iterator);