source: binary-improvements2/7dtd-server-fixes/src/FileCache/DirectAccess.cs@ 381

Last change on this file since 381 was 351, checked in by alloc, 6 years ago

Fixed game version compatibility of GamePrefs
Code style cleanup (mostly argument names)

File size: 466 bytes
Line 
1using System;
2using System.IO;
3
4namespace AllocsFixes.FileCache {
5 // Not caching at all, simply reading from disk on each request
6 public class DirectAccess : AbstractCache {
7 public override byte[] GetFileContent (string _filename) {
8 try {
9 if (!File.Exists (_filename)) {
10 return null;
11 }
12
13 return File.ReadAllBytes (_filename);
14 } catch (Exception e) {
15 Log.Out ("Error in DirectAccess.GetFileContent: " + e);
16 }
17
18 return null;
19 }
20 }
21}
Note: See TracBrowser for help on using the repository browser.