mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
A crash report is worth nothing sitting on the player's disk. On startup, drain the crash_report_*.txt files the handler left behind to the endpoint named by CRASH_TELEMETRY_URL in Ja2 Settings; an empty or absent key turns the feature off entirely. The first launch asks the player once and remembers the answer in telemetry.consent -- declined means the reports simply keep accumulating locally. This lands in its own translation unit rather than in more of debug_win_util.cpp. Everything in that file runs inside a faulting thread and may not allocate; everything here runs at startup with a healthy heap and is ordinary code. Two files keep the no-heap rule easy to see and easy to hold. The draining runs on a detached thread. The uploads are synchronous WinHttp calls with seconds-long timeouts, and this sits on the startup path, so on the main thread an unreachable endpoint is a stall the player watches before the splash screen. Nothing waits on the result: if the player quits first the process exits from under the thread, which costs nothing, since an interrupted upload leaves the file on disk and it goes out next launch. The consent prompt stays on the main thread on purpose -- it is a question, and a question has to be asked before anything is sent. Which reports get deleted is chosen so that a mistake cannot destroy them. A file goes away on 2xx, and on 400/413/415, i.e. content the server will never accept. Everything else keeps it: no connection, 5xx, and notably the 403/404 of a mistyped CRASH_TELEMETRY_URL, which would otherwise silently eat every player's crash history. Bounds all round: every WinHttp phase has a timeout, a report over 256 KB is not one of ours and never goes on the wire, at most 20 uploads per launch so a crash-looping build cannot turn startup into an upload session, and reports older than 30 days are dropped unsent. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
36 lines
1.4 KiB
CMake
36 lines
1.4 KiB
CMake
set(sgpSrc
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/Button Sound Control.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/Button System.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/Compression.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/crash_telemetry.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/Cursor Control.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/DEBUG.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/debug_util.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/debug_win_util.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/DirectDraw Calls.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/DirectX Common.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/English.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/FileMan.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/Font.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/himage.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/impTGA.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/input.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/line.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/MemMan.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/mousesystem.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/PCX.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/PngLoader.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/Random.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/sgp_logger.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/shading.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/soundman.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/STCI.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/stringicmp.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/timer.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/video.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/vobject.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/vobject_blitters.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/vsurface.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/WinFont.cpp"
|
|
PARENT_SCOPE)
|