Ignore:
Timestamp:
Jan 19, 2019, 6:12:21 PM (6 years ago)
Author:
alloc
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements/MapRendering/Web/Handlers/StaticHandler.cs

    r332 r351  
    1010                private readonly string staticPart;
    1111
    12                 public StaticHandler (string staticPart, string filePath, AbstractCache cache, bool logMissingFiles,
    13                         string moduleName = null) : base (moduleName) {
    14                         this.staticPart = staticPart;
    15                         datapath = filePath + (filePath [filePath.Length - 1] == '/' ? "" : "/");
    16                         this.cache = cache;
    17                         this.logMissingFiles = logMissingFiles;
     12                public StaticHandler (string _staticPart, string _filePath, AbstractCache _cache, bool _logMissingFiles,
     13                        string _moduleName = null) : base (_moduleName) {
     14                        staticPart = _staticPart;
     15                        datapath = _filePath + (_filePath [_filePath.Length - 1] == '/' ? "" : "/");
     16                        cache = _cache;
     17                        logMissingFiles = _logMissingFiles;
    1818                }
    1919
    20                 public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
    21                         int permissionLevel) {
    22                         string fn = req.Url.AbsolutePath.Remove (0, staticPart.Length);
     20                public override void HandleRequest (HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _user,
     21                        int _permissionLevel) {
     22                        string fn = _req.Url.AbsolutePath.Remove (0, staticPart.Length);
    2323
    2424                        byte[] content = cache.GetFileContent (datapath + fn);
    2525
    2626                        if (content != null) {
    27                                 resp.ContentType = MimeType.GetMimeType (Path.GetExtension (fn));
    28                                 resp.ContentLength64 = content.Length;
    29                                 resp.OutputStream.Write (content, 0, content.Length);
     27                                _resp.ContentType = MimeType.GetMimeType (Path.GetExtension (fn));
     28                                _resp.ContentLength64 = content.Length;
     29                                _resp.OutputStream.Write (content, 0, content.Length);
    3030                        } else {
    31                                 resp.StatusCode = (int) HttpStatusCode.NotFound;
     31                                _resp.StatusCode = (int) HttpStatusCode.NotFound;
    3232                                if (logMissingFiles) {
    33                                         Log.Out ("Web:Static:FileNotFound: \"" + req.Url.AbsolutePath + "\" @ \"" + datapath + fn + "\"");
     33                                        Log.Out ("Web:Static:FileNotFound: \"" + _req.Url.AbsolutePath + "\" @ \"" + datapath + fn + "\"");
    3434                                }
    3535                        }
Note: See TracChangeset for help on using the changeset viewer.