branchrust_reboot/main/full_server_demoscancel
50 Commits over 29 Days - 0.07cph!
merge from main -> full_server_demos
merge simple_upload -> full_server_demos
merge main -> full_server_demos
network++
merge packet_ordering_2 -> full_server_demos
Merge from main -> full_server_demos
Merge from main -> full_server_demos
Simplify bandwidth calculations
Try to upload demo in 5m and any backlogged demos within 15m
Add a few retries when uploading demos
Easier to fix merge conflicts manually
Merge fix_recording_disconnects -> full_server_demos
Add upload queue for demos
Rate limit the uploads to avoid saturating server's bandwidth
Also include changeset & hostname for debugging
Include network protocol in demo header
Merge from main -> full_server_demos
Merge from main -> full_server_demos
Default to 8MB transfer size when benchmarking demo upload
Allow transfer size to be overwritten
Record disconnects to the demo thread
Merge from main -> full_server_demos
Merge from main -> full_server_demos
Don't upload demos when `upload_demos` is set false or when `upload_url` is unset
Rename variables inside `FullServerDemos.cs` to be as readable as possible
Add `upload_demos` convar to turn off uploading and keep it on disk
Missed one file for CS0197
Fix CS0197 warnings
- change static method `NetRead.Free( ref NetRead )` to `NetRead.RemoveReference()`
- move `Interlocked.Increment()` into `NetRead.AddReference()`
Fix the server recording inbound packets twice: once from decryption thread & once on the main thread
Don't split up PacketId and the rest of the packet
Cleanup variable names
Fix writing packet length directly to the FileStream instead of the Writer.BaseStream
Improve benchmark demo command
Merge from main -> full_server_demos
Add `benchmark_demo_upload` to ensure we don't overload the game server when uploading blobs
Merge from main -> full_server_demos
Don't record raknet packets used to establish a connection
Change default flush interval from 1 min -> 5 min
Store session start timestamp (when demo recording started) in header
Use connection Guid instead of dictionary in player lookup (to avoid players reconnecting causing issues)
- change DemoPlayerInfo.SteamId -> Guid (ulong technically)
Change path to `server-demos/{serverid}/sessions/{sessionid}/{chunkid}.sdem` (to make it easier to navigate in azure)
Fix compressedSize in demo header being incorrect (FileStream.Length > FileStream.Position)
Switch from `demo_server_id` -> `server_id` convar
- save across restarts
- set server_id on startup if not set
Remove `upload_token` convar, rely on putting SAS token in upload endpoint for now (can polish later once we figure out how we want to refresh tokens)
Fix hardcoded "test" container and use the container from the SAS url
Merge from main -> full_server_demos
Refactor into multiple .cs files as the code has grown
Delete demos off disk past a certain quota to avoid consuming entire disk during upload failure
Add `server_demo_disk_space_gb` (default 30GB)
Allow server demos to be turned on and off at runtime
merge packet_ordering -> full_server_demos
Cleanup upload code a bit
Store chunkId in header file
Merge from main -> full_server_demos
Enqueue packets for demo from network threads instead of main thread
Change header class from fields -> properties (for System.Text.Json)
Merge upload -> full_server_demos
Expose variables for server demos as convar
`full_server_demo` convar will only be applied on startup but can be changed at runtime to apply next restart
Moving from stash to branch*
When `ServerDemo` convar is enabled on startup, the server will recordall network traffic on the server as one big demo file
Packets sent to multiple players are only recorded once (store list of players sent to)
Inbound & outbound data is stored in the order it was processed on the server
The demo is written to disk on a separate thread to make performance impact minimal
Demo is split into 1 minute chunks for testing (will be 5 minutes later)
Each demo chunk is given a unique filename with the .sdem extension (represents .serverdemo)
A json "header file" is written with each demo chunk wiht information on how the demo should be loaded (list of players, number of packets, time span, etc)
Changed pooling of NetRead & NetWrite to use reference counting to account for another thread needing to finish processing before they are pooled