Updates
This commit is contained in:
parent
7693f962ca
commit
8d186c18cd
@ -63,12 +63,21 @@ find_package(spdlog REQUIRED)
|
|||||||
find_package(Jemalloc REQUIRED)
|
find_package(Jemalloc REQUIRED)
|
||||||
find_package(Protobuf REQUIRED)
|
find_package(Protobuf REQUIRED)
|
||||||
|
|
||||||
|
|
||||||
# LibEvent fucks up the CMAKE_FIND_LIBRARY_SUFFIXES variable
|
# LibEvent fucks up the CMAKE_FIND_LIBRARY_SUFFIXES variable
|
||||||
function(find_event)
|
macro(find_event static)
|
||||||
set(LIBEVENT_STATIC_LINK TRUE)
|
set(_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
find_package(Libevent REQUIRED)
|
if (${static})
|
||||||
endfunction()
|
set(LIBEVENT_STATIC_LINK TRUE)
|
||||||
find_event()
|
message("Use static libevent")
|
||||||
|
endif ()
|
||||||
|
find_package(Libevent 2.2 REQUIRED COMPONENTS core pthreads)
|
||||||
|
if (NOT Libevent_FOUND)
|
||||||
|
message(FATAL_ERROR "Failed to find libevent (Variable: ${LIBEVENT_FOUND})")
|
||||||
|
endif ()
|
||||||
|
message("Libevent version: ${Libevent_FOUND}")
|
||||||
|
endmacro()
|
||||||
|
find_event(TRUE)
|
||||||
|
|
||||||
#FIXME: Use module for this
|
#FIXME: Use module for this
|
||||||
include_directories(${breakpad_INCLUDE_DIR})
|
include_directories(${breakpad_INCLUDE_DIR})
|
||||||
@ -79,8 +88,8 @@ include_directories(${LIBEVENT_INCLUDE_DIRS})
|
|||||||
include_directories(${StringVariable_INCLUDE_DIR})
|
include_directories(${StringVariable_INCLUDE_DIR})
|
||||||
|
|
||||||
add_definitions(-DINET -DINET6)
|
add_definitions(-DINET -DINET6)
|
||||||
|
add_subdirectory(music/)
|
||||||
add_subdirectory(shared/)
|
add_subdirectory(shared/)
|
||||||
add_subdirectory(server/)
|
add_subdirectory(server/)
|
||||||
add_subdirectory(license/)
|
add_subdirectory(license/)
|
||||||
add_subdirectory(MusicBot/)
|
add_subdirectory(MusicBot/)
|
||||||
add_subdirectory(music/)
|
|
@ -13,6 +13,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/environment/)
|
|||||||
|
|
||||||
#disable for debug
|
#disable for debug
|
||||||
#add_definitions(-DRELEASE_MODE)
|
#add_definitions(-DRELEASE_MODE)
|
||||||
|
find_event(ON)
|
||||||
|
|
||||||
include_directories(../music/include/)
|
include_directories(../music/include/)
|
||||||
include_directories(../shared/src)
|
include_directories(../shared/src)
|
||||||
|
@ -695,7 +695,8 @@ command_result ConnectedClient::handleCommandBanAdd(Command &cmd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto max_ban_time = server->calculate_permission(permission::i_client_ban_max_bantime, this->getClientDatabaseId(), this->getType(), 0);
|
auto max_ban_time = server->calculate_permission(permission::i_client_ban_max_bantime, this->getClientDatabaseId(), this->getType(), 0);
|
||||||
if (max_ban_time.has_value && !max_ban_time.has_infinite_power()) {
|
if(!max_ban_time.has_value) return command_result{permission::i_client_ban_max_bantime};
|
||||||
|
if (!max_ban_time.has_infinite_power()) {
|
||||||
if (max_ban_time.value < time)
|
if (max_ban_time.value < time)
|
||||||
return command_result{permission::i_client_ban_max_bantime};
|
return command_result{permission::i_client_ban_max_bantime};
|
||||||
}
|
}
|
||||||
@ -844,7 +845,8 @@ command_result ConnectedClient::handleCommandBanClient(Command &cmd) {
|
|||||||
auto b_ban_hwid = permission::v2::permission_granted(1, this->calculate_permission(permission::b_client_ban_hwid, 0), false);
|
auto b_ban_hwid = permission::v2::permission_granted(1, this->calculate_permission(permission::b_client_ban_hwid, 0), false);
|
||||||
|
|
||||||
auto max_ban_time = this->calculate_permission(permission::i_client_ban_max_bantime, 0);
|
auto max_ban_time = this->calculate_permission(permission::i_client_ban_max_bantime, 0);
|
||||||
if (max_ban_time.has_value && !max_ban_time.has_infinite_power()) {
|
if(!max_ban_time.has_value) return command_result{permission::i_client_ban_max_bantime};
|
||||||
|
if (!max_ban_time.has_infinite_power()) {
|
||||||
if (max_ban_time.value < time)
|
if (max_ban_time.value < time)
|
||||||
return command_result{permission::i_client_ban_max_bantime};
|
return command_result{permission::i_client_ban_max_bantime};
|
||||||
}
|
}
|
||||||
|
2
shared
2
shared
@ -1 +1 @@
|
|||||||
Subproject commit 4aec154ff161bedaa4080387ad3cf0450f1db1d3
|
Subproject commit a8843f53113f814e7218f76683190072851b17df
|
Loading…
Reference in New Issue
Block a user