mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-25 22:25:49 +03:00
Remote storage invalidation tweaks
This commit is contained in:
parent
7445503580
commit
538bed982a
@ -290,7 +290,7 @@ public bool Delete()
|
||||
if ( !remoteStorage.native.FileDelete( FileName ) ) return false;
|
||||
|
||||
Exists = false;
|
||||
remoteStorage.InvalidateFiles();
|
||||
remoteStorage.FileDeleted( this );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -76,8 +76,6 @@ public IEnumerable<RemoteFile> Files
|
||||
public RemoteFile CreateFile( string path )
|
||||
{
|
||||
path = NormalizePath( path );
|
||||
|
||||
InvalidateFiles();
|
||||
var existing = Files.FirstOrDefault( x => x.FileName == path );
|
||||
return existing ?? new RemoteFile( this, path, client.SteamId, -1 );
|
||||
}
|
||||
@ -88,8 +86,6 @@ public RemoteFile CreateFile( string path )
|
||||
public RemoteFile OpenFile( string path )
|
||||
{
|
||||
path = NormalizePath( path );
|
||||
|
||||
InvalidateFiles();
|
||||
var existing = Files.FirstOrDefault( x => x.FileName == path );
|
||||
return existing;
|
||||
}
|
||||
@ -163,8 +159,6 @@ internal void OnWrittenNewFile( RemoteFile file )
|
||||
|
||||
_files.Add( file );
|
||||
file.Exists = true;
|
||||
|
||||
InvalidateFiles();
|
||||
}
|
||||
|
||||
internal void InvalidateFiles()
|
||||
@ -172,6 +166,11 @@ internal void InvalidateFiles()
|
||||
_filesInvalid = true;
|
||||
}
|
||||
|
||||
internal void FileDeleted( RemoteFile file )
|
||||
{
|
||||
_files.Remove( file );
|
||||
}
|
||||
|
||||
private void UpdateFiles()
|
||||
{
|
||||
if ( !_filesInvalid ) return;
|
||||
|
Loading…
Reference in New Issue
Block a user