[PATCH] Prevent replay overwrites by using date and sequential ID
|Reported by:||elexis||Owned by:||elexis|
|Priority:||Must Have||Milestone:||Alpha 20|
Description (last modified by )
Currently the commands.txt files (and ooslog output) are created in a subdirectory of the sim-log directory.
The commands.txt file contains all commands sent by players and is therefore the key file when filing bug reports and replaying previous games visually with #9.
The problem I want to address here is that the subdirectory that contains the commands.txt file has a bad name. It uses the process ID and a sequential number. There are three problems with that:
- Old files will be overwritten.
- It is not easy to identify the correct directory when filing bugreports.
- The visual replay function #9 will be accessible from the main menu at some point. It should then display the correct date and time without relying on a fragile timestamp.
1. Why files will be overwritten
Process IDs are usually allocated on a sequential basis, beginning at 0 and rising to a maximum value which varies from system to system. Once this limit is reached, allocation restarts at 300 and again increases.
Therefore pIDs are not random but have a very limited keyspace (4 to 5 figures), which makes it very possible that old files will be overwritten. The sequential number that will be added to the PID will only be added if you play multiple games with the same instance of 0ad. If you reboot and get the same PID, then you overwrite the commands.txt file.
2. Identifying the correct directory
When people want to file a bugreport and the error appeared on the last game they played, then they only have to identify the file with the most recent filedate. Some have already problems with that (Mac users in particular, since that information isn't displayed by default). If the match was some time ago, the timestamp definitely helps identifying the correct file.
Open question: Should we make a subdirectory for the revision, so that the directory won't contain replay logs of different revisions? I.e. .../sim-log/alpha18/2015-05-20_03-38-38/commands.txt? No - that info should be saved to the commands.txt file.
Change History (30)
comment:4 by , 5 years ago
|Priority:||Should Have → Nice to Have|
|Summary:||[PATCH] Use date + time in sim-log directory instead of pid → [PATCH] Use date in commands.txt directory|
by , 5 years ago
comment:11 by , 5 years ago
|Milestone:||Alpha 20 → Alpha 19|
|Priority:||Should Have → Must Have|
|Summary:||[PATCH] Use date in commands.txt directory → [PATCH] Prevent replay overwrites by using date and sequential ID|