89 Commits over 425 Days - 0.01cph!
Increase Rcon timeout period by responseDelaySeconds so we give more time to any intensive commands
Try waiting 30 seconds after server start to generate/upload map png (too much is going on at server start for this intensive command)
Use 0.5 scale so it renders faster
Let world.rendermap have 30 seconds so we can guarantee we get the right command response
Pass optional responseDelaySeconds arg when running rcon commands to wait longer for intensive commands, like world.rendermap
Truncate log lines >512 chars, increase max batch size from 50 to 500 to reduce request count
Stop logging exception stack traces, we can get them from sentry instead
Probably fix rcon client only returning the first response from the server
Revert previous whitespace changes as they break authentication. We're better off handling this on the API side
Replace whitespace in the SM key with underscores
▌▋▆ ▇▅▄▅ ▋█ ▉▄▇▇▅ ▇▊▊▋▅▇.▆▇█▉▄▌▉▊█▋▉ ▍▊▆ █▆▋ ▍▄█▌▇ ▆▌▊▋ ▄▊▌▇█▌▌▍▉▉▇▋ ▇▇▉█▆ ▊▄▄▊▄.▊▄▍▋▋▊▉▍▅
! ▉▍▇▌▌▌▄▇▋.▄▊▊▍▌▍ -> ▊▊▍█.▄▉▌▉▄▍
! ▄▋█▊▄ ▅█▊█▋▌▍█▊▊▅▇▇▄▄█▊▆▍▄▄▋▄▍▉▋▇ ▆▍▌▄▊▊▊▌▅▄ ▉▄▅ ▊▆▆ ▌▍
▅▉▉▄▉ ▇▉▉▊▍▇▇ ▋▌▄ █▊█▋▉█▋▊
▅▌▇ ▅▅▋ ▇▌▉▆▍▇▅ ▌▆ █▉▉▄ ▄▋▉▌▇▋ ▄▊▍/▋█▆██▍ ▇▅▅▆█▋▆ ▄▌▄ ▋ █▌▊ █▄▆▄▇▊▌▊, ▄▄ ▇▅, ▅█▄▄▄ ▉▌▆█
▅▇▇ ▅▇▋▊
▋▋▊ ▆▅▄▉▋▆▆▄▌▄▋▄ ▅▌▆▊▌ ▄▋ ▄▆▉▉▅▆▋▍▍▄▍▅▍▇█▄▍▄▌.▇▋▋█▄▅▋▄▅█▌▋▍▊▍
▊▇▋▉▌▇ ▍▇▇ ▍▌▌▌▋ ▋▋ ▆▉▍▊▄.▇▋▉▇█▅▉█▄.▇▍▉ ▍▊▄ ▇█▆ ▉▇█▇█▆▇▌▇ █▋▉ ▅▍▍▌▇▊▆▅ █▅█ ▍▆▊
▌▇▌▄▋▇ ▌▇ █▆▉ ▍▆▆ ▄▉▌▄▊▉▅ ▄▉▅▇▇▅▆▌█▍▉▅▌▇ ▄▄▆▋▇▊▌▉ ▊▇█ ▇▍▄ ▌▆▇ ▆▋█ ▌▋ ▋▊ ▇▅▉█ ▄▇▄▌█▍▄ ▉▉▇▇▌
▇▉▍ ▋▍▄▆▆▍▅▊ ▇▇▇█▆▆. ▉█▅ ▅ ▇█▇▇ ▉▌▍▄▆ ▊▍▌▌▄▇ ▌▍▋▆▍ (▇▉▍▊ ▊█). ▄█▋ ▇▄▍▅▋▄▄▉█▇▅▇ ▆▋█▊█▉▆ ▅█▆▌▅▆▌▌. ▉▊▊▅▋█ ▆▍▊▄▊ ▅▄ ▆▆▉▇▄▊▅▋█▄ ▆▍ ▌▇ ▆▄▅ ▋▍▌▅▉▌ ▌▅█ ▌▍▋▋ ▉▌▇▅ ▌▆'▋█ ▄▊▋▄. ▄▊█▆ ▍▄▍▌▉▇▋▇▍ ▋▇ ▋▆▊▋▅▍, ▋██ ▉▊█▄.
▇▋▊▇▅ ▅█▆▇▍ █▋▄ ▍▆ ▆▄▄▆▅▌▍▆.█▌▉▄▇▅▄▊ ▇▊▌▉▋▊▇▅
▋▇▅ ▇▆▅▍▅▄█.▅▇▉▇▇▆▇▉▆█▉▄▄▄▇▆ ▅▅▅▇█▊▋ ▌▉▋ ▊▊▍▆▍█▍
▍▄▋▅▍ ▆▊▆▆▇▌▉
▊▆▄▄▄▄▋ ▄▊ ▍█▉▊▌▉ ▉▋▉ ▄▉▅ ▄▅▄ ▉▄▆▍ █▅ ▅▇▌▇▌█▊ ▉▌▅▅█▆ - ▍▉▅█ ▅▊▄▉
▋▇▇█▊▅▍█ ▍▌▌▉ ▉▋▅▋▇▄▅▍▅ ▊▌ █▊▋ ▅▉█ ▊▅▆█▊█▍▉▍▆▇▊▅▌▇▆▍▋▅▇▇▅▄▉
▅▇▄█▌ ▋▌▄▇▄▇▋
▉▅▍▇▅▆ "▇▌▌▆▄▌█▅ ▋▄▍▆ ▄█▄▋▆▆█▉▊ ▆▇ ▆▇▅ ▉▊▊ ▌▌▌▅▅▋▆▋▍▇▆▄▊▍▋▄▅▍▌▊▋▌▊▌"
▊▉▅█ ▉▍▍▆▌█▍ ▅▅▅▌▋▌ ▄▇▌▆▉▍▆▊▆▆▅▊▄▍▍▆▄█▉▉▋▅▍█▍▅▅▍▉▍▍▄▅▌▋█▋▊▅▊.
▌▌▇▋▋▊ ▋▉▍▍▅▊▆▅ ▄▌▇█ ▇▇▋▆▄ ▇▆ ▄█▆▅▉██▇▍▊▍▌▆▊▆█▉
▄▊▌▇▋ ▄▋▌▄ ▇▆▌▌▊▋▄ #▉▊ ▅▉██ ▉▊▇▇█▅▄▅▋/▄▍▅▆██_▍▇█_█▇█
▄▅█▅▄▅ ▌▋▄ ▄▌▅ ▊▄ ▅▍█▉▉.▌▍▊▆▍▊▇▇▉.▊▇▋
remove unneeded 5min delay on TryUploadMapImage
Revert "Simplify file uploading to not use MultipartFormDataContent"
This reverts commit b0c590aaca7163ea0b4ffe6a0b1d4eb46b2d2e50.
Simplify file uploading to not use MultipartFormDataContent
Attempt to delete the map png file if loading failed - edge case
Use Timeout.InfiniteTimeSpan instead for clarity
Maker timer run at TimeSpan.MaxValue interval
Fix endpoint naming. Run 5 mins after server start (from 10). Fix MemoryStream getting disposed. Change scope of filestream so we can delete the file when we're done. Read responses as string, not json.
Change to use new renamed mapImageExists endpoint and log the url if it does already exist
Upload map image to files.facepunch.com via the publicapi and retrieve the url
Use cancellation token in HttpResponseMessage.EnsureSucessful
ask the backend if this server key/wipeid already has a map uploaded, if so, early exit
minor changes and comments
Make sure tasks are canceled when exiting Run()
▅▅▍▉█ ▌▌▆█▉█▊▌▉▌▉▆▅█▅▇▋▉▊▉▌▊▇▊█▍▇ ▉▅▍█▊▌█▄▆▄ ▌█▄ ▉▌▊ ▌▆
▊▆▍▍▄▆█▋▄.█▅▆▋▍▋ -> ▊▍▇▇.▄▍▄▄▉▆
▍▄▇ ▍█▋▍ ▊▊ ▅▉███ ▅▅▆▍▉▅.▆▅▆▌█▌▄▅▄█▉ ▆▅▇ ▅▅▍ ▋▅███ ▄▍▋▆ ▆▅▌▅▇▉▉▉▆▌▋▉ █▉▋▌▊ ▅▉▇▆▅.▆▄▆▉▌▄▋▋▄
Bugfix: reset stream position after copying data
- Backups was using a stream with a cursor at the end, so it was sending 0-length content
Tests: ran in test env, was able to download non-empty files
Merge pull request #8 from Facepunch/FixEmptyBackups
Bugfix: Send full backup files
Bugfix: reset stream position after copying data
- Backups was using a stream with a cursor at the end, so it was sending 0-length content
Tests: ran in test env, was able to download non-empty files
New: support xml-style errors from API
Allows to see more details about what's going wrong with the request(Azure SAS errors are xml)
Tests: got the SAS error locally, saw the logs in ServerManager
Bugfix: don't use a closed stream when retrying backup uploading
If we fail the upload at the point of consuming the stream (so passed backupBegin), it will close the stream and fall over on Position call, making retries useless.
Tests: when running own server it was erroring out on retries with stream closed exception - not anymore.
Bugfix: Don't wait after last upload retry
Tests: Saw the uploads fail, didn't see the log after last attempt.
Update: renamed file back to BackupData
I shouldn't have renamed it in the first place.
Clean: removing obsolete property
Tests: local run was able to upload files
Bugfix: respect the cancellation token when fetching a response of request
Update: limit how much time upload routine can take
- also add extra logging around processGuard semaphore
Tests: tested the entire flow by triggering 5 snapshots
Bugfix: use the right token for some async ops
Bugfix: avoid unlockign semaphore from the wrong thread
If it would time out during the wait period, it would release the semaphore in finally, leading to break of unique ownership promise
Clean: remove ITask inheritance from UploadPerfSnapshot
It used to be a task at the start, but not anymore
Update: review feedback
- dispose of the nested CTS for perf snapshot uploads
- Use async copy when creating an extra stream to send backup files
Tests: full local server flow + 2 snapshot uploads
Merge pull request #7 from Facepunch/DebugImprovements
Minor fixes and more verbose HTTP errors
WIP restart server at 4am local machine time, check for >=22 hour server uptime and do not restart Staging servers (env || hostname)
start the timer 10 minutes after the server is up and repeat every 5 minutes
Separate rcon logic and serverinfo loop out of ConsoleInputBar and into separate class CommandManager. Swapped out usages in RunServer.cs. Finished up the CheckForServerRestart functionality. Confirmed the project still builds
Was accidentally using DateTime.UtcNow instead of DateTime.Now
Change the time check to prevent the extremely rare edgecase of the server attempting to restart twice
Use the global cancellation token in the CommandManager, don't make a new one
CommandManager takes CancellationToken, not source
Rename CommandManager to more suitable ServerRcon
rename vars, too
Double time window to ensure we restart and store DateTimeOffset of when restart was last requested
Attempt to restart multiple times if we failed due to an exception
Log any errors
Minor changes
Merge pull request #6 from Facepunch/server_restarts
Server restarts
Attempt to restart multiple times if we failed due to an exception
Double time window to ensure we restart and store DateTimeOffset of when restart was last requested
Rename CommandManager to more suitable ServerRcon
Update: review feedback
- dispose of the nested CTS for perf snapshot uploads
- Use async copy when creating an extra stream to send backup files
Tests: full local server flow + 2 snapshot uploads
Bugfix: avoid unlockign semaphore from the wrong thread
If it would time out during the wait period, it would release the semaphore in finally, leading to break of unique ownership promise
Clean: remove ITask inheritance from UploadPerfSnapshot
It used to be a task at the start, but not anymore
CommandManager takes CancellationToken, not source
Was accidentally using DateTime.UtcNow instead of DateTime.Now
Change the time check to prevent the extremely rare edgecase of the server attempting to restart twice
Use the global cancellation token in the CommandManager, don't make a new one
Bugfix: use the right token for some async ops
Update: limit how much time upload routine can take
- also add extra logging around processGuard semaphore
Tests: tested the entire flow by triggering 5 snapshots
Bugfix: respect the cancellation token when fetching a response of request
New: support xml-style errors from API
Allows to see more details about what's going wrong with the request(Azure SAS errors are xml)
Tests: got the SAS error locally, saw the logs in ServerManager
Bugfix: don't use a closed stream when retrying backup uploading
If we fail the upload at the point of consuming the stream (so passed backupBegin), it will close the stream and fall over on Position call, making retries useless.
Tests: when running own server it was erroring out on retries with stream closed exception - not anymore.
Bugfix: Don't wait after last upload retry
Tests: Saw the uploads fail, didn't see the log after last attempt.
Update: renamed file back to BackupData
I shouldn't have renamed it in the first place.
Clean: removing obsolete property
Tests: local run was able to upload files
Separate rcon logic and serverinfo loop out of ConsoleInputBar and into separate class CommandManager. Swapped out usages in RunServer.cs. Finished up the CheckForServerRestart functionality. Confirmed the project still builds