Skip to content

Commit

Permalink
configurable output packets recording
Browse files Browse the repository at this point in the history
  • Loading branch information
gesior committed Aug 25, 2022
1 parent d8c70b1 commit 334eb12
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions config.lua
Expand Up @@ -171,6 +171,7 @@ location = "Sweden"
-- Cams system
camsEnabled = true
camsRecordInputPackets = true
camsRecordOutputPackets = true
camsDirectory = "cams/"
camsMemoryBufferPacketsNumber = 5000
camsCloseCamIfNoPacketsForSeconds = 20
4 changes: 4 additions & 0 deletions src/cams.cpp
Expand Up @@ -189,6 +189,10 @@ void Cams::addOutputPacket(uint64_t camId, const NetworkMessage &msg)
return;
}

if (!g_config.getBoolean(ConfigManager::CAMS_RECORD_OUTPUT_PACKETS)) {
return;
}

std::lock_guard<std::mutex> lockClass(playerCamsLock);

auto it = playerCams.find(camId);
Expand Down
1 change: 1 addition & 0 deletions src/configmanager.cpp
Expand Up @@ -266,6 +266,7 @@ bool ConfigManager::load()
boolean[PLAYER_CONSOLE_LOGS] = getGlobalBoolean(L, "showPlayerLogInConsole", true);
boolean[CAMS_ENABLED] = getGlobalBoolean(L, "camsEnabled", false);
boolean[CAMS_RECORD_INPUT_PACKETS] = getGlobalBoolean(L, "camsRecordInputPackets", false);
boolean[CAMS_RECORD_OUTPUT_PACKETS] = getGlobalBoolean(L, "camsRecordOutputPackets", false);

string[DEFAULT_PRIORITY] = getGlobalString(L, "defaultPriority", "high");
string[SERVER_NAME] = getGlobalString(L, "serverName", "");
Expand Down
1 change: 1 addition & 0 deletions src/configmanager.h
Expand Up @@ -71,6 +71,7 @@ class ConfigManager
PLAYER_CONSOLE_LOGS,
CAMS_ENABLED,
CAMS_RECORD_INPUT_PACKETS,
CAMS_RECORD_OUTPUT_PACKETS,

LAST_BOOLEAN_CONFIG /* this must be the last one */
};
Expand Down

0 comments on commit 334eb12

Please sign in to comment.