mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-06-17 14:12:25 +00:00
fix some unix stuff
This commit is contained in:
+1
-2
@@ -5,7 +5,7 @@ set(CMAKE_CXX_STANDARD 17)
|
|||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
|
||||||
|
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -static-libstdc++")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -g")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -g")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -s")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -s")
|
||||||
elseif (WIN32)
|
elseif (WIN32)
|
||||||
@@ -28,7 +28,6 @@ target_include_directories(BeamMP-Server SYSTEM PUBLIC ${LUA_INCLUDE_DIR} ${Boos
|
|||||||
|
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
find_package(Lua 5.3 REQUIRED)
|
find_package(Lua 5.3 REQUIRED)
|
||||||
target_include_directories(BeamMP-Server PRIVATE )
|
|
||||||
target_link_libraries(BeamMP-Server curl z pthread stdc++fs ${Boost_LINK_DIRS} ${LUA_LIBRARIES})
|
target_link_libraries(BeamMP-Server curl z pthread stdc++fs ${Boost_LINK_DIRS} ${LUA_LIBRARIES})
|
||||||
elseif (WIN32)
|
elseif (WIN32)
|
||||||
include(FindLua)
|
include(FindLua)
|
||||||
|
|||||||
@@ -63,20 +63,12 @@ static int _getch() {
|
|||||||
char buf = 0;
|
char buf = 0;
|
||||||
struct termios old;
|
struct termios old;
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
if (tcgetattr(0, &old) < 0)
|
|
||||||
perror("tcsetattr()");
|
|
||||||
old.c_lflag &= ~unsigned(ICANON);
|
old.c_lflag &= ~unsigned(ICANON);
|
||||||
old.c_lflag &= ~unsigned(ECHO);
|
old.c_lflag &= ~unsigned(ECHO);
|
||||||
old.c_cc[VMIN] = 1;
|
old.c_cc[VMIN] = 1;
|
||||||
old.c_cc[VTIME] = 0;
|
old.c_cc[VTIME] = 0;
|
||||||
if (tcsetattr(0, TCSANOW, &old) < 0)
|
|
||||||
perror("tcsetattr ICANON");
|
|
||||||
if (read(0, &buf, 1) < 0)
|
|
||||||
perror("read()");
|
|
||||||
old.c_lflag |= ICANON;
|
old.c_lflag |= ICANON;
|
||||||
old.c_lflag |= ECHO;
|
old.c_lflag |= ECHO;
|
||||||
if (tcsetattr(0, TCSADRAIN, &old) < 0)
|
|
||||||
perror("tcsetattr ~ICANON");
|
|
||||||
// no echo printf("%c\n", buf);
|
// no echo printf("%c\n", buf);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,9 @@ void VehicleParser(Client*c,const std::string& Pckt){
|
|||||||
SendToAll(c,Packet,false,true);
|
SendToAll(c,Packet,false,true);
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
AssertNotReachable();
|
#ifdef DEBUG
|
||||||
|
warn(std::string(Sec("possibly not implemented: '") + Packet + Sec("'")));
|
||||||
|
#endif // DEBUG
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user