mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Refactor Python API structure and enhance backend command handling
Major refactor of the Python API: moved modules into subdirectories, replaced app.py with api.py, and added new audio and utility modules. Backend C++ code now tracks command execution results, exposes them via the API, and improves command result handling. Also includes updates to the SRS audio handler, random string generation, and VSCode launch configurations.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "framework.h"
|
||||
#include "utils.h"
|
||||
#include <chrono>
|
||||
|
||||
// Get current date/time, format is YYYY-MM-DD.HH:mm:ss
|
||||
const std::string CurrentDateTime()
|
||||
@@ -44,7 +45,11 @@ std::string to_string(const std::wstring& wstr)
|
||||
|
||||
std::string random_string(size_t length)
|
||||
{
|
||||
srand(static_cast<unsigned int>(time(NULL)));
|
||||
// Use nanoseconds since epoch as a seed for random number generation
|
||||
auto now = std::chrono::high_resolution_clock::now();
|
||||
auto nanos = std::chrono::duration_cast<std::chrono::nanoseconds>(now.time_since_epoch()).count();
|
||||
srand(static_cast<unsigned int>(nanos));
|
||||
|
||||
auto randchar = []() -> char
|
||||
{
|
||||
const char charset[] =
|
||||
|
||||
Reference in New Issue
Block a user