Improve Logging

This commit is contained in:
TheBrokenRail 2020-11-02 15:27:41 -05:00
parent 55c789dab2
commit 5414913620
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@
#include <libcore/libcore.h> #include <libcore/libcore.h>
#define PATCH_PRINTF(file, line, start, str) if (file != NULL) fprintf(stderr, "[%s:%i] Patching (0x%04x) - "str": 0x%02x 0x%02x 0x%02x 0x%02x\n", file, line, (uint32_t) start, data[0], data[1], data[2], data[3]); #define PATCH_PRINTF(file, line, start, str) if (file != NULL) fprintf(stderr, "[PATCH]: (%s:%i) Patching (0x%04x) - "str": 0x%02x 0x%02x 0x%02x 0x%02x\n", file, line, (uint32_t) start, data[0], data[1], data[2], data[3]);
#define ORIGINAL_SIZE 8 #define ORIGINAL_SIZE 8

View File

@ -81,7 +81,7 @@ static void *CreativeMode = (void *) 0x1b258;
// Patch Game Mode // Patch Game Mode
static void set_is_survival(int new_is_survival) { static void set_is_survival(int new_is_survival) {
if (is_survival != new_is_survival) { if (is_survival != new_is_survival) {
fprintf(stderr, "Setting Game Mode: %s\n", new_is_survival ? "Survival" : "Creative"); INFO("Setting Game Mode: %s", new_is_survival ? "Survival" : "Creative");
// Correct Inventpry UI // Correct Inventpry UI
unsigned char inventory_patch[4] = {new_is_survival ? 0x00 : 0x01, 0x30, 0xa0, 0xe3}; unsigned char inventory_patch[4] = {new_is_survival ? 0x00 : 0x01, 0x30, 0xa0, 0xe3};
@ -152,7 +152,7 @@ int extra_has_feature(const char *name) {
tok = strtok(NULL, "|"); tok = strtok(NULL, "|");
} }
free(features); free(features);
fprintf(stderr, "Feature: %s: %s\n", name, ret ? "Enabled" : "Disabled"); INFO("Feature: %s: %s", name, ret ? "Enabled" : "Disabled");
return ret; return ret;
} }
} }
@ -252,7 +252,7 @@ __attribute__((constructor)) static void init() {
username = server_get_motd(); username = server_get_motd();
} else { } else {
username = get_username(); username = get_username();
fprintf(stderr, "Setting Username: %s\n", username); INFO("Setting Username: %s", username);
} }
char **default_username = (char **) 0x18fd4; char **default_username = (char **) 0x18fd4;
if (strcmp(*default_username, "StevePi") != 0) { if (strcmp(*default_username, "StevePi") != 0) {