mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-26 06:35: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;
|
if ( !remoteStorage.native.FileDelete( FileName ) ) return false;
|
||||||
|
|
||||||
Exists = false;
|
Exists = false;
|
||||||
remoteStorage.InvalidateFiles();
|
remoteStorage.FileDeleted( this );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -76,8 +76,6 @@ public IEnumerable<RemoteFile> Files
|
|||||||
public RemoteFile CreateFile( string path )
|
public RemoteFile CreateFile( string path )
|
||||||
{
|
{
|
||||||
path = NormalizePath( path );
|
path = NormalizePath( path );
|
||||||
|
|
||||||
InvalidateFiles();
|
|
||||||
var existing = Files.FirstOrDefault( x => x.FileName == path );
|
var existing = Files.FirstOrDefault( x => x.FileName == path );
|
||||||
return existing ?? new RemoteFile( this, path, client.SteamId, -1 );
|
return existing ?? new RemoteFile( this, path, client.SteamId, -1 );
|
||||||
}
|
}
|
||||||
@ -88,8 +86,6 @@ public RemoteFile CreateFile( string path )
|
|||||||
public RemoteFile OpenFile( string path )
|
public RemoteFile OpenFile( string path )
|
||||||
{
|
{
|
||||||
path = NormalizePath( path );
|
path = NormalizePath( path );
|
||||||
|
|
||||||
InvalidateFiles();
|
|
||||||
var existing = Files.FirstOrDefault( x => x.FileName == path );
|
var existing = Files.FirstOrDefault( x => x.FileName == path );
|
||||||
return existing;
|
return existing;
|
||||||
}
|
}
|
||||||
@ -163,8 +159,6 @@ internal void OnWrittenNewFile( RemoteFile file )
|
|||||||
|
|
||||||
_files.Add( file );
|
_files.Add( file );
|
||||||
file.Exists = true;
|
file.Exists = true;
|
||||||
|
|
||||||
InvalidateFiles();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void InvalidateFiles()
|
internal void InvalidateFiles()
|
||||||
@ -172,6 +166,11 @@ internal void InvalidateFiles()
|
|||||||
_filesInvalid = true;
|
_filesInvalid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void FileDeleted( RemoteFile file )
|
||||||
|
{
|
||||||
|
_files.Remove( file );
|
||||||
|
}
|
||||||
|
|
||||||
private void UpdateFiles()
|
private void UpdateFiles()
|
||||||
{
|
{
|
||||||
if ( !_filesInvalid ) return;
|
if ( !_filesInvalid ) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user