DBIsOutdatedException implemented

main
Inga 🏳‍🌈 13 years ago
parent cfbbeda57c
commit 2f3ca29639
  1. 2
      Builder/IISMainHandler/build.txt
  2. 4
      FLocal.IISHandler/MainHandler.cs
  3. 14
      Patcher.Web/DBIsOutdatedException.cs
  4. 1
      Patcher.Web/Patcher.Web.csproj
  5. 6
      Patcher.Web/PatcherInfo.cs

@ -19,9 +19,7 @@ namespace FLocal.IISHandler {
private void doProcessRequest(HttpContext httpcontext) { private void doProcessRequest(HttpContext httpcontext) {
if(PatcherInfo.instance.IsNeedsPatching) { PatcherInfo.instance.CheckDBUpToDate();
throw new FLocalException("DB is outdated");
}
Uri current = httpcontext.Request.Url; Uri current = httpcontext.Request.Url;
if(!current.Host.EndsWith(Config.instance.BaseHost)) { if(!current.Host.EndsWith(Config.instance.BaseHost)) {

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Patcher.Web {
class DBIsOutdatedException : ApplicationException {
public DBIsOutdatedException()
: base("DB is outdated") {
}
}
}

@ -47,6 +47,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="CheckParams.cs" /> <Compile Include="CheckParams.cs" />
<Compile Include="DBIsOutdatedException.cs" />
<Compile Include="InteractiveResponseStream.cs" /> <Compile Include="InteractiveResponseStream.cs" />
<Compile Include="MainHandler.cs" /> <Compile Include="MainHandler.cs" />
<Compile Include="IPatcherConfiguration.cs" /> <Compile Include="IPatcherConfiguration.cs" />

@ -23,6 +23,12 @@ namespace Patcher.Web {
} }
} }
public void CheckDBUpToDate() {
if(this.IsNeedsPatching) {
throw new DBIsOutdatedException();
}
}
internal void PatchesInstalled() { internal void PatchesInstalled() {
this.AreNewPatchesInstalled = true; this.AreNewPatchesInstalled = true;
} }

Loading…
Cancel
Save