diff --git a/mods/CMakeLists.txt b/mods/CMakeLists.txt index 35e687c1..84a322c2 100644 --- a/mods/CMakeLists.txt +++ b/mods/CMakeLists.txt @@ -17,10 +17,7 @@ install(DIRECTORY "include/" DESTINATION "${MCPI_SDK_INCLUDE_DIR}/mods") add_library(compat SHARED src/compat/compat.c src/compat/egl.c src/compat/x11.c src/compat/bcm_host.c) target_link_libraries(compat mods-headers reborn-patch media-layer-core) if(NOT MCPI_HEADLESS_MODE) - target_link_libraries(compat screenshot) -endif() -if(NOT MCPI_SERVER_MODE) - target_link_libraries(compat input sign chat home dl) + target_link_libraries(compat screenshot input sign chat home dl) endif() add_library(readdir SHARED src/readdir/readdir.c) @@ -33,7 +30,7 @@ target_link_libraries(version mods-headers reborn-patch symbols) add_library(chat SHARED src/chat/chat.cpp src/chat/ui.c) target_link_libraries(chat mods-headers reborn-patch symbols feature) -if(NOT MCPI_SERVER_MODE) +if(NOT MCPI_HEADLESS_MODE) target_link_libraries(chat input media-layer-core pthread) endif() diff --git a/mods/src/chat/chat.cpp b/mods/src/chat/chat.cpp index 6b753355..4b6b8ceb 100644 --- a/mods/src/chat/chat.cpp +++ b/mods/src/chat/chat.cpp @@ -5,18 +5,18 @@ #include #include #include -#ifndef MCPI_SERVER_MODE +#ifndef MCPI_HEADLESS_MODE #include #endif #include -#ifndef MCPI_SERVER_MODE +#ifndef MCPI_HEADLESS_MODE #include #endif #include #include -#ifndef MCPI_SERVER_MODE +#ifndef MCPI_HEADLESS_MODE #include #endif #include "chat-internal.h" @@ -42,7 +42,7 @@ std::string chat_send_api_command(unsigned char *minecraft, char *str) { } } -#ifndef MCPI_SERVER_MODE +#ifndef MCPI_HEADLESS_MODE // Send API Chat Command static void send_api_chat_command(unsigned char *minecraft, char *str) { char *command = NULL; @@ -95,7 +95,7 @@ static void ServerSideNetworkHandler_handle_ChatPacket_injection(unsigned char * } } -#ifndef MCPI_SERVER_MODE +#ifndef MCPI_HEADLESS_MODE // Message Queue static pthread_mutex_t queue_mutex = PTHREAD_MUTEX_INITIALIZER; static std::vector queue; @@ -144,7 +144,7 @@ void init_chat() { // Re-Broadcast ChatPacket patch_address(ServerSideNetworkHandler_handle_ChatPacket_vtable_addr, (void *) ServerSideNetworkHandler_handle_ChatPacket_injection); // Send Messages On Input Tick -#ifndef MCPI_SERVER_MODE +#ifndef MCPI_HEADLESS_MODE input_run_on_tick(send_queued_messages); #endif } diff --git a/mods/src/chat/ui.c b/mods/src/chat/ui.c index de023115..04c14da8 100644 --- a/mods/src/chat/ui.c +++ b/mods/src/chat/ui.c @@ -2,7 +2,7 @@ #include // Chat UI Code Is Useless In Headless Mode -#ifndef MCPI_SERVER_MODE +#ifndef MCPI_HEADLESS_MODE #include #include diff --git a/mods/src/compat/compat.c b/mods/src/compat/compat.c index d575e5a9..721f3181 100644 --- a/mods/src/compat/compat.c +++ b/mods/src/compat/compat.c @@ -25,7 +25,7 @@ HOOK(SDL_ShowCursor, int, (int toggle)) { } #endif -#ifndef MCPI_SERVER_MODE +#ifndef MCPI_HEADLESS_MODE #include #include @@ -37,12 +37,14 @@ HOOK(SDL_ShowCursor, int, (int toggle)) { HOOK(SDL_PollEvent, int, (SDL_Event *event)) { // In Server Mode, Exit Requests Are Handled In src/server/server.cpp // Check If Exit Is Requested +#ifndef MCPI_SERVER_MODE if (compat_check_exit_requested()) { // Send SDL_QUIT SDL_Event new_event; new_event.type = SDL_QUIT; SDL_PushEvent(&new_event); } +#endif // Poll Events ensure_SDL_PollEvent(); @@ -59,9 +61,7 @@ HOOK(SDL_PollEvent, int, (SDL_Event *event)) { media_toggle_fullscreen(); handled = 1; } else if (event->key.keysym.sym == SDLK_F2) { -#ifndef MCPI_HEADLESS_MODE screenshot_take(home_get()); -#endif handled = 1; } else if (event->key.keysym.sym == SDLK_F1) { input_hide_gui();