diff --git a/game/btl4main.cpp b/game/btl4main.cpp index 7ac9db9..e4fbff2 100644 --- a/game/btl4main.cpp +++ b/game/btl4main.cpp @@ -605,6 +605,35 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine SYSTEMTIME lt; GetLocalTime(<); // NOT cmd's %DATE%: locale-ordered, and // on en-US it contains '/' (path chars). + + // THE LOG DAY STARTS AT 06:00 LOCAL, NOT MIDNIGHT. Playtests run + // late, and a midnight boundary splits one evening across two files + // exactly when the session is most worth reading whole -- the 01:30 + // crash lands in a different file from the 23:00 run that set it up. + // (A 02:00 session is also "last night" to everyone who was in it, + // so a file named for the new calendar date reads wrong anyway.) + // Shift the clock back 6h before taking the date: the log day then + // runs 06:00 -> 06:00 and one night is one file. Only the FILENAME + // is shifted -- every line inside still carries real local time, and + // the session header still records the true date. + { + const ULONGLONG LogDayStartHour = 6; + FILETIME ft; + if (SystemTimeToFileTime(<, &ft)) // pure arithmetic; no TZ + { // conversion either way + ULARGE_INTEGER u; + u.LowPart = ft.dwLowDateTime; + u.HighPart = ft.dwHighDateTime; + u.QuadPart -= LogDayStartHour * 3600ULL * 10000000ULL; // 100ns + ft.dwLowDateTime = u.LowPart; + ft.dwHighDateTime = u.HighPart; + SYSTEMTIME shifted; + // FileTimeToSystemTime carries month/year boundaries for us, + // so 01:00 on the 1st correctly names the previous month. + if (FileTimeToSystemTime(&ft, &shifted)) + lt = shifted; + } + } // SIZE ROLL-OVER -- never deletes anything, but keeps each FILE small // enough to actually send. A playtest evening concatenates into one // file (4.3 MB from a single session in scratchpad/night5/), and the diff --git a/players/README.txt b/players/README.txt index e4caee4..eb276f7 100644 --- a/players/README.txt +++ b/players/README.txt @@ -41,9 +41,13 @@ a crash loses it) or if you were playing SOLO or over STEAM (no relay to upload through). IF ANYTHING CRASHED OR MISBEHAVED, send BOTH of these -- neither is ever uploaded, they only exist on your machine: - content\join_YYYYMMDD.log today's date; the NEWEST one. There is now - ONE log per day holding every session, so a - crash is no longer erased when you relaunch. + content\join_YYYYMMDD.log just take the NEWEST one; do not go by the + date in the name. A log DAY runs 6am to 6am, + so whatever you played after midnight is still + filed under the evening you started -- one + night stays in one file. There is ONE log per + day holding every session, so a crash is no + longer erased when you relaunch. Each session inside it starts with a line "===== BT411 SESSION ... =====" naming your build and PC, so it still identifies itself diff --git a/players/play_solo.bat b/players/play_solo.bat index fc7bc3a..6e2eda9 100644 --- a/players/play_solo.bat +++ b/players/play_solo.bat @@ -95,13 +95,16 @@ if defined BT_STILL_RUNNING ( echo. echo The game has exited. If it closed unexpectedly, send the operator echo BOTH of these from the content folder: -echo content\lastrun_solo.txt (tiny -- send it EVEN IF there is no -echo log dated today: that combination is -echo how we spot a blocked launch) +echo content\lastrun_solo.txt (tiny -- send it EVEN IF there is +echo no solo_*.log at all: that combination +echo is how we spot a blocked launch) echo content\solo_YYYYMMDD.log -echo (the newest solo_*.log -- it holds every session from today, and each -echo one starts with a "===== BT411 SESSION" line naming your build and PC, -echo so it identifies itself even if the filename gets changed in transit.) +echo (just take the NEWEST solo_*.log -- do not go by the date in the name. +echo A log day runs 6am to 6am, so anything you played after midnight is +echo still filed under the evening you started, which keeps one night in +echo one file. Each session inside starts with a "===== BT411 SESSION" +echo line naming your build and PC, so it identifies itself even if the +echo filename gets changed in transit.) pause exit /b :badpath diff --git a/players/play_steam.bat b/players/play_steam.bat index b17f0ce..edb4fd4 100644 --- a/players/play_steam.bat +++ b/players/play_steam.bat @@ -88,10 +88,13 @@ if defined BT_STILL_RUNNING ( ) echo. echo The game has exited. If it closed unexpectedly, send the operator BOTH -echo content\lastrun_steam.txt (tiny -- send it EVEN IF there is no log -echo dated today: that is how we spot a -echo launch that was blocked before it ran) -echo content\steam_YYYYMMDD.log (today's, newest) +echo content\lastrun_steam.txt (tiny -- send it EVEN IF there is no +echo steam_*.log at all: that is how we spot +echo a launch blocked before it ran) +echo content\steam_YYYYMMDD.log (just the NEWEST one -- ignore the date. +echo A log day runs 6am to 6am, so a session +echo after midnight stays filed under the +echo evening you started.) echo Steam not running = the menu still works but lobbies will not appear. pause exit /b