Skip to content

Commit

Permalink
Strip colons from the server IPs in the cache directory (OpenDreamPro…
Browse files Browse the repository at this point in the history
…ject#1930)

Co-authored-by: ike709 <[email protected]>
  • Loading branch information
ike709 and ike709 authored Aug 17, 2024
1 parent 3db18c7 commit fe4f235
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion OpenDreamClient/Resources/DreamResourceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ private void EnsureCacheDirectory() {
return;
if(_netManager.ServerChannel is null)
throw new Exception("Server doesn't appear to be connected, can't use cache right now!");
_cacheDirectory = new ResPath($"/OpenDream/Cache/{_netManager.ServerChannel.RemoteEndPoint}");

var address = _netManager.ServerChannel.RemoteEndPoint.ToString();
address = address.Replace(':', '.'); // colons aren't legal on Windows

_cacheDirectory = new ResPath($"/OpenDream/Cache/{address}");
_resourceManager.UserData.CreateDir(_cacheDirectory);
if (!_resourceManager.UserData.Exists(_cacheDirectory))
throw new Exception($"Could not create cache directory at {_cacheDirectory}");
Expand Down

0 comments on commit fe4f235

Please sign in to comment.