Index: binary-improvements/MapRendering/API.cs
===================================================================
--- binary-improvements/MapRendering/API.cs	(revision 228)
+++ binary-improvements/MapRendering/API.cs	(revision 230)
@@ -3,16 +3,14 @@
 namespace MapRendering
 {
-	public class API : AllocsFixes.ModAPI {
-		public override string ModName () {
-			return "AllocsMapRendering";
+	public class API : ModApiAbstract {
+
+		public override void GameAwake () {
+			new AllocsFixes.NetConnections.Servers.Web.Web ();
 		}
 
-		public override string ModVersion () {
-			return "1.0 for A11.2";
+		public override void CalcChunkColorsDone (Chunk _chunk) {
+			AllocsFixes.MapRendering.MapRendering.RenderSingleChunk (_chunk);
 		}
 
-		public override void CalcMapColors (Chunk _chunk) {
-			AllocsFixes.MapRendering.MapRendering.RenderSingleChunk (_chunk);
-		}
 	}
 }
Index: binary-improvements/MapRendering/Commands/EnableRendering.cs
===================================================================
--- binary-improvements/MapRendering/Commands/EnableRendering.cs	(revision 228)
+++ binary-improvements/MapRendering/Commands/EnableRendering.cs	(revision 230)
@@ -4,30 +4,26 @@
 namespace AllocsFixes.CustomCommands
 {
-	public class EnableRendering : ConsoleCommand
+	public class EnableRendering : ConsoleCmdAbstract
 	{
-		public EnableRendering (ConsoleSdtd cons) : base(cons)
-		{
-		}
-
-		public override string Description ()
+		public override string GetDescription ()
 		{
 			return "enable/disable live map rendering";
 		}
 
-		public override string[] Names ()
+		public override string[] GetCommands ()
 		{
-			return new string[] { "enablerendering", string.Empty };
+			return new string[] { "enablerendering" };
 		}
 
-		public override void Run (string[] _params)
+		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo)
 		{
 			try {
-				if (_params.Length != 1) {
-					m_Console.SendResult ("Current state: " + AllocsFixes.MapRendering.MapRendering.renderingEnabled);
+				if (_params.Count != 1) {
+					SdtdConsole.Instance.Output ("Current state: " + AllocsFixes.MapRendering.MapRendering.renderingEnabled);
 					return;
 				}
 
 				AllocsFixes.MapRendering.MapRendering.renderingEnabled = _params[0].Equals("1");
-				m_Console.SendResult ("Set live map rendering to " + _params [0].Equals ("1"));
+				SdtdConsole.Instance.Output ("Set live map rendering to " + _params [0].Equals ("1"));
 			} catch (Exception e) {
 				Log.Out ("Error in EnableRendering.Run: " + e);
Index: binary-improvements/MapRendering/Commands/RenderMap.cs
===================================================================
--- binary-improvements/MapRendering/Commands/RenderMap.cs	(revision 228)
+++ binary-improvements/MapRendering/Commands/RenderMap.cs	(revision 230)
@@ -6,26 +6,22 @@
 namespace AllocsFixes.CustomCommands
 {
-	public class RenderMap : ConsoleCommand
+	public class RenderMap : ConsoleCmdAbstract
 	{
-		public RenderMap (ConsoleSdtd cons) : base(cons)
-		{
-		}
-
-		public override string Description ()
+		public override string GetDescription ()
 		{
 			return "render the current map to a file";
 		}
 
-		public override string[] Names ()
+		public override string[] GetCommands ()
 		{
-			return new string[] { "rendermap", "rm" };
+			return new string[] { "rendermap" };
 		}
 
-		public override void Run (string[] _params)
+		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo)
 		{
 			try {
 				AllocsFixes.MapRendering.MapRendering.Instance.RenderFullMap ();
 
-				m_Console.SendResult ("Render map done");
+				SdtdConsole.Instance.Output ("Render map done");
 			} catch (Exception e) {
 				Log.Out ("Error in RenderMap.Run: " + e);
Index: binary-improvements/MapRendering/Commands/webstat.cs
===================================================================
--- binary-improvements/MapRendering/Commands/webstat.cs	(revision 230)
+++ binary-improvements/MapRendering/Commands/webstat.cs	(revision 230)
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+
+namespace AllocsFixes.CustomCommands
+{
+	public class webstat : ConsoleCmdAbstract
+	{
+		public override string GetDescription ()
+		{
+			return "DEBUG PURPOSES ONLY";
+		}
+
+		public override string[] GetCommands ()
+		{
+			return new string[] { "webstat" };
+		}
+
+		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo)
+		{
+			try {
+				SdtdConsole.Instance.Output ("Current handlers: " + AllocsFixes.NetConnections.Servers.Web.Web.currentHandlers + " - total: " + AllocsFixes.NetConnections.Servers.Web.Web.handlingCount);
+			} catch (Exception e) {
+				Log.Out ("Error in webstat.Run: " + e);
+			}
+		}
+	}
+}
Index: binary-improvements/MapRendering/MapRendering.csproj
===================================================================
--- binary-improvements/MapRendering/MapRendering.csproj	(revision 228)
+++ 	(revision )
@@ -1,61 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>10.0.0</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{A1847B5F-7BFC-4BCD-94AA-A6C9FB7E7C54}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <RootNamespace>MapRendering</RootNamespace>
-    <AssemblyName>MapRendering</AssemblyName>
-    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>none</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>..\bin\Mods\AllocsMapRendering\</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>false</ConsolePause>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="LogLibrary">
-      <HintPath>..\7dtd-binaries\LogLibrary.dll</HintPath>
-      <Private>False</Private>
-    </Reference>
-    <Reference Include="UnityEngine">
-      <HintPath>..\7dtd-binaries\UnityEngine.dll</HintPath>
-      <Private>False</Private>
-    </Reference>
-    <Reference Include="Assembly-CSharp">
-      <HintPath>..\7dtd-binaries\Assembly-CSharp.dll</HintPath>
-      <Private>False</Private>
-    </Reference>
-    <Reference Include="mscorlib">
-      <HintPath>..\7dtd-binaries\mscorlib.dll</HintPath>
-      <Private>False</Private>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="AssemblyInfo.cs" />
-    <Compile Include="MapRendering\MapRendering.cs" />
-    <Compile Include="MapRendering\MapRenderBlockBuffer.cs" />
-    <Compile Include="MapRendering\Constants.cs" />
-    <Compile Include="Commands\RenderMap.cs" />
-    <Compile Include="Commands\EnableRendering.cs" />
-    <Compile Include="API.cs" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <ItemGroup>
-    <ProjectReference Include="..\7dtd-server-fixes\7dtd-server-fixes.csproj">
-      <Project>{81DA7F87-1A66-4920-AADA-6EAF1971F8D0}</Project>
-      <Name>7dtd-server-fixes</Name>
-      <Private>False</Private>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="Commands\" />
-  </ItemGroup>
-</Project>
Index: binary-improvements/MapRendering/MapRendering/MapRenderBlockBuffer.cs
===================================================================
--- binary-improvements/MapRendering/MapRendering/MapRenderBlockBuffer.cs	(revision 228)
+++ binary-improvements/MapRendering/MapRendering/MapRenderBlockBuffer.cs	(revision 230)
@@ -53,6 +53,9 @@
 		}
 
-		public void SetPart (Vector2i offset, int partSize, Color[] pixels)
-		{
+		public void SetPart (Vector2i offset, int partSize, Color[] pixels) {
+			if (offset.x + partSize > blockMap.width || offset.y + partSize > blockMap.height) {
+				Log.Error (string.Format ("MapBlockBuffer[{0}].SetPart ({1}, {2}, {3}) has blockMap.size ({4}/{5})", zoomLevel, offset, partSize, pixels.Length, blockMap.width, blockMap.height));
+				return;
+			}
 			blockMap.SetPixels (offset.x, offset.y, partSize, partSize, pixels);
 		}
@@ -71,11 +74,8 @@
 		{
 			byte[] array = cache.LoadTile (zoomLevel, _fileName);
-			if (array != null) {
-				blockMap.LoadImage (array);
-			} else {
-				//try {
-				//byte[] array = File.ReadAllBytes (_fileName);
-				//blockMap.LoadImage (array);
-				//} catch (Exception) {
+			if (array == null || !blockMap.LoadImage (array)) {
+				if (blockMap.height != Constants.MAP_BLOCK_SIZE || blockMap.width != Constants.MAP_BLOCK_SIZE) {
+					blockMap.Resize (Constants.MAP_BLOCK_SIZE, Constants.MAP_BLOCK_SIZE);
+				}
 				for (int x = 0; x < Constants.MAP_BLOCK_SIZE; x++) {
 					for (int y = 0; y < Constants.MAP_BLOCK_SIZE; y++) {
@@ -86,14 +86,7 @@
 		}
 
-		private void saveTextureToFile (string _fileName)
-		{
+		private void saveTextureToFile (string _fileName) {
 			byte[] array = blockMap.EncodeToPNG ();
 			cache.SaveTile (zoomLevel, array);
-//			try {
-//				byte[] array = blockMap.EncodeToPNG ();
-//				File.WriteAllBytes (_fileName, array);
-//			} catch (Exception e) {
-//				Log.Out ("Exception in MapRenderBlockBuffer.saveTextureToFile(): " + e);
-//			}
 		}
 
Index: binary-improvements/MapRendering/MapRendering/MapRendering.cs
===================================================================
--- binary-improvements/MapRendering/MapRendering/MapRendering.cs	(revision 228)
+++ binary-improvements/MapRendering/MapRendering/MapRendering.cs	(revision 230)
@@ -210,4 +210,7 @@
 						//Log.Out ("Dirty: " + v + " render: true");
 						chunksDone.Add (v);
+						if (dirtyChunks [v].Length != Constants.MAP_CHUNK_SIZE * Constants.MAP_CHUNK_SIZE) {
+							Log.Error (string.Format ("Rendering chunk has incorrect data size of {0} instead of {1}", dirtyChunks [v].Length, Constants.MAP_CHUNK_SIZE * Constants.MAP_CHUNK_SIZE));
+						}
 						zoomLevelBuffers [Constants.ZOOMLEVELS - 1].SetPart (v_blockOffset, Constants.MAP_CHUNK_SIZE, dirtyChunks [v]);
 					} else {
Index: binary-improvements/MapRendering/ModInfo.xml
===================================================================
--- binary-improvements/MapRendering/ModInfo.xml	(revision 230)
+++ binary-improvements/MapRendering/ModInfo.xml	(revision 230)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<xml>
+	<ModInfo>
+		<Name value="Allocs MapRendering and Webinterface" />
+		<Description value="Render the game map to image map tiles as it is uncovered" />
+		<Author value="Christian 'Alloc' Illy" />
+		<Version value="2" />
+		<Website value="http://7dtd.illy.bz" />
+	</ModInfo>
+</xml>
Index: binary-improvements/MapRendering/Web/API/GetLandClaims.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetLandClaims.cs	(revision 230)
+++ binary-improvements/MapRendering/Web/API/GetLandClaims.cs	(revision 230)
@@ -0,0 +1,74 @@
+using AllocsFixes.JSON;
+using AllocsFixes.PersistentData;
+using System;
+using System.Collections.Generic;
+using System.Net;
+
+namespace AllocsFixes.NetConnections.Servers.Web.API
+{
+	public class GetLandClaims : WebAPI
+	{
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, HttpListenerBasicIdentity user)
+		{
+			string steamid = string.Empty;
+
+			if (req.QueryString ["steamid"] != null) {
+				long tempLong;
+				steamid = req.QueryString ["steamid"];
+				if (steamid.Length != 17 || !long.TryParse (steamid, out tempLong)) {
+					resp.StatusCode = (int)HttpStatusCode.InternalServerError;
+					Web.SetResponseTextContent (resp, "Invalid SteamID given");
+					return;
+				}
+			}
+
+			JSONObject result = new JSONObject ();
+			result.Add ("claimsize", new JSONNumber (GamePrefs.GetInt (EnumGamePrefs.LandClaimSize)));
+
+			JSONArray claimOwners = new JSONArray ();
+			result.Add ("claimowners", claimOwners);
+
+			Dictionary<Vector3i, PersistentPlayerData> d = GameManager.Instance.GetPersistentPlayerList ().positionToLPBlockOwner;
+			if (d != null) {
+				World w = GameManager.Instance.World;
+				Dictionary<PersistentPlayerData, List<Vector3i>> owners = new Dictionary<PersistentPlayerData, List<Vector3i>> ();
+				foreach (KeyValuePair<Vector3i, PersistentPlayerData> kvp in d) {
+					if (steamid.Length == 0 || kvp.Value.PlayerId.Equals (steamid)) {
+						if (!owners.ContainsKey (kvp.Value)) {
+							owners.Add (kvp.Value, new List<Vector3i> ());
+						}
+						owners [kvp.Value].Add (kvp.Key);
+					}
+				}
+
+				foreach (KeyValuePair<PersistentPlayerData, List<Vector3i>> kvp in owners) {
+					if (steamid.Length == 0 || kvp.Key.PlayerId.Equals (steamid)) {
+						string curID = kvp.Key.PlayerId;
+						bool isActive = w.LandClaimIsActive (kvp.Key);
+
+						JSONObject owner = new JSONObject ();
+						claimOwners.Add (owner);
+
+						owner.Add ("steamid", new JSONString (curID));
+						owner.Add ("claimactive", new JSONBoolean (isActive));
+
+						JSONArray claims = new JSONArray ();
+						owner.Add ("claims", claims);
+
+						foreach (Vector3i v in kvp.Value) {
+							JSONObject claim = new JSONObject ();
+							claim.Add ("x", new JSONNumber (v.x));
+							claim.Add ("y", new JSONNumber (v.y));
+							claim.Add ("z", new JSONNumber (v.z));
+
+							claims.Add (claim);
+						}
+					}
+				}
+			}
+
+			WriteJSON (resp, result);
+		}
+	}
+}
+
Index: binary-improvements/MapRendering/Web/API/GetPlayerInventory.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetPlayerInventory.cs	(revision 230)
+++ binary-improvements/MapRendering/Web/API/GetPlayerInventory.cs	(revision 230)
@@ -0,0 +1,63 @@
+using AllocsFixes.JSON;
+using AllocsFixes.PersistentData;
+using System;
+using System.Collections.Generic;
+using System.Net;
+
+namespace AllocsFixes.NetConnections.Servers.Web.API
+{
+	public class GetPlayerInventory : WebAPI
+	{
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, HttpListenerBasicIdentity user)
+		{
+			if (req.QueryString ["steamid"] == null) {
+				resp.StatusCode = (int)HttpStatusCode.InternalServerError;
+				Web.SetResponseTextContent (resp, "No SteamID given");
+				return;
+			}
+
+			Player p = PersistentContainer.Instance.Players [req.QueryString ["steamid"]];
+			if (p == null) {
+				resp.StatusCode = (int)HttpStatusCode.InternalServerError;
+				Web.SetResponseTextContent (resp, "Invalid or unknown SteamID given");
+				return;
+			}
+
+			PersistentData.Inventory inv = p.Inventory;
+
+
+			JSONObject result = new JSONObject ();
+
+			JSONArray bag = new JSONArray ();
+			JSONArray belt = new JSONArray ();
+			result.Add ("bag", bag);
+			result.Add ("belt", belt);
+
+			for (int i = 0; i < inv.belt.Count; i++) {
+				JSONObject item = new JSONObject();
+				if (inv.belt [i] != null) {
+					item.Add ("count", new JSONNumber(inv.belt[i].count));
+					item.Add ("name", new JSONString(inv.belt[i].itemName));
+				} else {
+					item.Add ("count", new JSONNumber(0));
+					item.Add ("name", new JSONString(string.Empty));
+				}
+				belt.Add(item);
+			}
+			for (int i = 0; i < inv.bag.Count; i++) {
+				JSONObject item = new JSONObject();
+				if (inv.bag [i] != null) {
+					item.Add ("count", new JSONNumber(inv.bag[i].count));
+					item.Add ("name", new JSONString(inv.bag[i].itemName));
+				} else {
+					item.Add ("count", new JSONNumber(0));
+					item.Add ("name", new JSONString(string.Empty));
+				}
+				bag.Add(item);
+			}
+
+			WriteJSON (resp, result);
+		}
+	}
+}
+
Index: binary-improvements/MapRendering/Web/API/GetPlayersLocation.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetPlayersLocation.cs	(revision 230)
+++ binary-improvements/MapRendering/Web/API/GetPlayersLocation.cs	(revision 230)
@@ -0,0 +1,39 @@
+using AllocsFixes.JSON;
+using AllocsFixes.PersistentData;
+using System;
+using System.Collections.Generic;
+using System.Net;
+
+namespace AllocsFixes.NetConnections.Servers.Web.API
+{
+	public class GetPlayersLocation : WebAPI
+	{
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, HttpListenerBasicIdentity user)
+		{
+			JSONArray playersJsResult = new JSONArray ();
+
+			Players playersList = PersistentContainer.Instance.Players;
+
+			foreach (string sid in playersList.SteamIDs) {
+				Player p = playersList[sid];
+
+				JSONObject pos = new JSONObject();
+				pos.Add("x", new JSONNumber(p.LastPosition.x));
+				pos.Add("y", new JSONNumber(p.LastPosition.y));
+				pos.Add("z", new JSONNumber(p.LastPosition.z));
+
+				JSONObject pJson = new JSONObject();
+				pJson.Add("steamid", new JSONString(sid));
+				pJson.Add("ip", new JSONString(p.IP));
+				pJson.Add("name", new JSONString(p.Name));
+				pJson.Add("online", new JSONBoolean(p.IsOnline));
+				pJson.Add("position", pos);
+
+				playersJsResult.Add(pJson);
+			}
+
+			WriteJSON(resp, playersJsResult);
+		}
+	}
+}
+
Index: binary-improvements/MapRendering/Web/API/GetPlayersOnline.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetPlayersOnline.cs	(revision 230)
+++ binary-improvements/MapRendering/Web/API/GetPlayersOnline.cs	(revision 230)
@@ -0,0 +1,41 @@
+using AllocsFixes.JSON;
+using System;
+using System.Collections.Generic;
+using System.Net;
+
+namespace AllocsFixes.NetConnections.Servers.Web.API
+{
+	public class GetPlayersOnline : WebAPI
+	{
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, HttpListenerBasicIdentity user)
+		{
+			JSONArray players = new JSONArray();
+
+			World w = GameManager.Instance.World;
+			foreach (KeyValuePair<int, EntityPlayer> current in w.Players.dict) {
+				ClientInfo ci = ConnectionManager.Instance.GetClientInfoForEntityId (current.Key);
+				string ip = string.Empty;
+				if (ci != null) {
+					ip = ci.ip;
+				}
+
+				JSONObject pos = new JSONObject();
+				pos.Add("x", new JSONNumber((int)current.Value.GetPosition().x));
+				pos.Add("y", new JSONNumber((int)current.Value.GetPosition().y));
+				pos.Add("z", new JSONNumber((int)current.Value.GetPosition().z));
+
+				JSONObject p = new JSONObject();
+				p.Add("steamid", new JSONString(ci.playerId));
+				p.Add("ip", new JSONString(ip));
+				p.Add("name", new JSONString(current.Value.EntityName));
+				p.Add("online", new JSONBoolean(true));
+				p.Add("position", pos);
+
+				players.Add(p);
+			}
+
+			WriteJSON(resp, players);
+		}
+	}
+}
+
Index: binary-improvements/MapRendering/Web/API/WebAPI.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/WebAPI.cs	(revision 230)
+++ binary-improvements/MapRendering/Web/API/WebAPI.cs	(revision 230)
@@ -0,0 +1,21 @@
+using System;
+using System.Net;
+using System.Text;
+
+namespace AllocsFixes.NetConnections.Servers.Web.API
+{
+	public abstract class WebAPI
+	{
+		public void WriteJSON (HttpListenerResponse resp, JSON.JSONNode root)
+		{
+			byte[] buf = Encoding.UTF8.GetBytes (root.ToString());
+			resp.ContentLength64 = buf.Length;
+			resp.ContentType = "application/json";
+			resp.ContentEncoding = Encoding.UTF8;
+			resp.OutputStream.Write (buf, 0, buf.Length);
+		}
+
+		public abstract void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, HttpListenerBasicIdentity user);
+	}
+}
+
Index: binary-improvements/MapRendering/Web/ApiHandler.cs
===================================================================
--- binary-improvements/MapRendering/Web/ApiHandler.cs	(revision 230)
+++ binary-improvements/MapRendering/Web/ApiHandler.cs	(revision 230)
@@ -0,0 +1,56 @@
+using AllocsFixes.NetConnections.Servers.Web.API;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Net;
+using System.Threading;
+
+namespace AllocsFixes.NetConnections.Servers.Web
+{
+	public class ApiHandler : PathHandler
+	{
+		private string staticPart;
+		private Dictionary<String, WebAPI> apis = new Dictionary<string, WebAPI> ();
+
+		public ApiHandler (string staticPart)
+		{
+			this.staticPart = staticPart;
+			apis.Add ("getlandclaims", new GetLandClaims ());
+			apis.Add ("getplayersonline", new GetPlayersOnline ());
+			apis.Add ("getplayerslocation", new GetPlayersLocation ());
+			apis.Add ("getplayerinventory", new GetPlayerInventory ());
+		}
+
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, HttpListenerBasicIdentity user)
+		{
+			string apiName = req.Url.AbsolutePath.Remove (0, staticPart.Length);
+			if (!AuthorizeForCommand (apiName, user)) {
+				resp.StatusCode = (int)HttpStatusCode.Forbidden;
+			} else {
+				foreach (KeyValuePair<string, WebAPI> kvp in apis) {
+					try {
+						if (apiName.StartsWith (kvp.Key)) {
+							kvp.Value.HandleRequest (req, resp, user);
+							return;
+						}
+					} catch (Exception e) {
+						Log.Out ("Error in ApiHandler.HandleRequest(): Handler threw an exception: " + e);
+						resp.StatusCode = (int)HttpStatusCode.InternalServerError;
+						return;
+					}
+				}
+			}
+	
+			Log.Out ("Error in ApiHandler.HandleRequest(): No handler found for API \"" + apiName + "\"");
+			resp.StatusCode = (int)HttpStatusCode.NotFound;
+		}
+
+		private bool AuthorizeForCommand (string apiName, HttpListenerBasicIdentity user)
+		{
+			return true;
+		}
+
+	}
+
+}
+
Index: binary-improvements/MapRendering/Web/MimeType.cs
===================================================================
--- binary-improvements/MapRendering/Web/MimeType.cs	(revision 230)
+++ binary-improvements/MapRendering/Web/MimeType.cs	(revision 230)
@@ -0,0 +1,587 @@
+using System;
+using System.Collections.Generic;
+
+namespace AllocsFixes.NetConnections.Servers.Web
+{
+	public class MimeType
+	{
+		private static IDictionary<string, string> _mappings = new Dictionary<string, string> (StringComparer.InvariantCultureIgnoreCase) {
+        {".323", "text/h323"},
+        {".3g2", "video/3gpp2"},
+        {".3gp", "video/3gpp"},
+        {".3gp2", "video/3gpp2"},
+        {".3gpp", "video/3gpp"},
+        {".7z", "application/x-7z-compressed"},
+        {".aa", "audio/audible"},
+        {".AAC", "audio/aac"},
+        {".aaf", "application/octet-stream"},
+        {".aax", "audio/vnd.audible.aax"},
+        {".ac3", "audio/ac3"},
+        {".aca", "application/octet-stream"},
+        {".accda", "application/msaccess.addin"},
+        {".accdb", "application/msaccess"},
+        {".accdc", "application/msaccess.cab"},
+        {".accde", "application/msaccess"},
+        {".accdr", "application/msaccess.runtime"},
+        {".accdt", "application/msaccess"},
+        {".accdw", "application/msaccess.webapplication"},
+        {".accft", "application/msaccess.ftemplate"},
+        {".acx", "application/internet-property-stream"},
+        {".AddIn", "text/xml"},
+        {".ade", "application/msaccess"},
+        {".adobebridge", "application/x-bridge-url"},
+        {".adp", "application/msaccess"},
+        {".ADT", "audio/vnd.dlna.adts"},
+        {".ADTS", "audio/aac"},
+        {".afm", "application/octet-stream"},
+        {".ai", "application/postscript"},
+        {".aif", "audio/x-aiff"},
+        {".aifc", "audio/aiff"},
+        {".aiff", "audio/aiff"},
+        {".air", "application/vnd.adobe.air-application-installer-package+zip"},
+        {".amc", "application/x-mpeg"},
+        {".application", "application/x-ms-application"},
+        {".art", "image/x-jg"},
+        {".asa", "application/xml"},
+        {".asax", "application/xml"},
+        {".ascx", "application/xml"},
+        {".asd", "application/octet-stream"},
+        {".asf", "video/x-ms-asf"},
+        {".ashx", "application/xml"},
+        {".asi", "application/octet-stream"},
+        {".asm", "text/plain"},
+        {".asmx", "application/xml"},
+        {".aspx", "application/xml"},
+        {".asr", "video/x-ms-asf"},
+        {".asx", "video/x-ms-asf"},
+        {".atom", "application/atom+xml"},
+        {".au", "audio/basic"},
+        {".avi", "video/x-msvideo"},
+        {".axs", "application/olescript"},
+        {".bas", "text/plain"},
+        {".bcpio", "application/x-bcpio"},
+        {".bin", "application/octet-stream"},
+        {".bmp", "image/bmp"},
+        {".c", "text/plain"},
+        {".cab", "application/octet-stream"},
+        {".caf", "audio/x-caf"},
+        {".calx", "application/vnd.ms-office.calx"},
+        {".cat", "application/vnd.ms-pki.seccat"},
+        {".cc", "text/plain"},
+        {".cd", "text/plain"},
+        {".cdda", "audio/aiff"},
+        {".cdf", "application/x-cdf"},
+        {".cer", "application/x-x509-ca-cert"},
+        {".chm", "application/octet-stream"},
+        {".class", "application/x-java-applet"},
+        {".clp", "application/x-msclip"},
+        {".cmx", "image/x-cmx"},
+        {".cnf", "text/plain"},
+        {".cod", "image/cis-cod"},
+        {".config", "application/xml"},
+        {".contact", "text/x-ms-contact"},
+        {".coverage", "application/xml"},
+        {".cpio", "application/x-cpio"},
+        {".cpp", "text/plain"},
+        {".crd", "application/x-mscardfile"},
+        {".crl", "application/pkix-crl"},
+        {".crt", "application/x-x509-ca-cert"},
+        {".cs", "text/plain"},
+        {".csdproj", "text/plain"},
+        {".csh", "application/x-csh"},
+        {".csproj", "text/plain"},
+        {".css", "text/css"},
+        {".csv", "text/csv"},
+        {".cur", "application/octet-stream"},
+        {".cxx", "text/plain"},
+        {".dat", "application/octet-stream"},
+        {".datasource", "application/xml"},
+        {".dbproj", "text/plain"},
+        {".dcr", "application/x-director"},
+        {".def", "text/plain"},
+        {".deploy", "application/octet-stream"},
+        {".der", "application/x-x509-ca-cert"},
+        {".dgml", "application/xml"},
+        {".dib", "image/bmp"},
+        {".dif", "video/x-dv"},
+        {".dir", "application/x-director"},
+        {".disco", "text/xml"},
+        {".dll", "application/x-msdownload"},
+        {".dll.config", "text/xml"},
+        {".dlm", "text/dlm"},
+        {".doc", "application/msword"},
+        {".docm", "application/vnd.ms-word.document.macroEnabled.12"},
+        {".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"},
+        {".dot", "application/msword"},
+        {".dotm", "application/vnd.ms-word.template.macroEnabled.12"},
+        {".dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template"},
+        {".dsp", "application/octet-stream"},
+        {".dsw", "text/plain"},
+        {".dtd", "text/xml"},
+        {".dtsConfig", "text/xml"},
+        {".dv", "video/x-dv"},
+        {".dvi", "application/x-dvi"},
+        {".dwf", "drawing/x-dwf"},
+        {".dwp", "application/octet-stream"},
+        {".dxr", "application/x-director"},
+        {".eml", "message/rfc822"},
+        {".emz", "application/octet-stream"},
+        {".eot", "application/octet-stream"},
+        {".eps", "application/postscript"},
+        {".etl", "application/etl"},
+        {".etx", "text/x-setext"},
+        {".evy", "application/envoy"},
+        {".exe", "application/octet-stream"},
+        {".exe.config", "text/xml"},
+        {".fdf", "application/vnd.fdf"},
+        {".fif", "application/fractals"},
+        {".filters", "Application/xml"},
+        {".fla", "application/octet-stream"},
+        {".flr", "x-world/x-vrml"},
+        {".flv", "video/x-flv"},
+        {".fsscript", "application/fsharp-script"},
+        {".fsx", "application/fsharp-script"},
+        {".generictest", "application/xml"},
+        {".gif", "image/gif"},
+        {".group", "text/x-ms-group"},
+        {".gsm", "audio/x-gsm"},
+        {".gtar", "application/x-gtar"},
+        {".gz", "application/x-gzip"},
+        {".h", "text/plain"},
+        {".hdf", "application/x-hdf"},
+        {".hdml", "text/x-hdml"},
+        {".hhc", "application/x-oleobject"},
+        {".hhk", "application/octet-stream"},
+        {".hhp", "application/octet-stream"},
+        {".hlp", "application/winhlp"},
+        {".hpp", "text/plain"},
+        {".hqx", "application/mac-binhex40"},
+        {".hta", "application/hta"},
+        {".htc", "text/x-component"},
+        {".htm", "text/html"},
+        {".html", "text/html"},
+        {".htt", "text/webviewhtml"},
+        {".hxa", "application/xml"},
+        {".hxc", "application/xml"},
+        {".hxd", "application/octet-stream"},
+        {".hxe", "application/xml"},
+        {".hxf", "application/xml"},
+        {".hxh", "application/octet-stream"},
+        {".hxi", "application/octet-stream"},
+        {".hxk", "application/xml"},
+        {".hxq", "application/octet-stream"},
+        {".hxr", "application/octet-stream"},
+        {".hxs", "application/octet-stream"},
+        {".hxt", "text/html"},
+        {".hxv", "application/xml"},
+        {".hxw", "application/octet-stream"},
+        {".hxx", "text/plain"},
+        {".i", "text/plain"},
+        {".ico", "image/x-icon"},
+        {".ics", "application/octet-stream"},
+        {".idl", "text/plain"},
+        {".ief", "image/ief"},
+        {".iii", "application/x-iphone"},
+        {".inc", "text/plain"},
+        {".inf", "application/octet-stream"},
+        {".inl", "text/plain"},
+        {".ins", "application/x-internet-signup"},
+        {".ipa", "application/x-itunes-ipa"},
+        {".ipg", "application/x-itunes-ipg"},
+        {".ipproj", "text/plain"},
+        {".ipsw", "application/x-itunes-ipsw"},
+        {".iqy", "text/x-ms-iqy"},
+        {".isp", "application/x-internet-signup"},
+        {".ite", "application/x-itunes-ite"},
+        {".itlp", "application/x-itunes-itlp"},
+        {".itms", "application/x-itunes-itms"},
+        {".itpc", "application/x-itunes-itpc"},
+        {".IVF", "video/x-ivf"},
+        {".jar", "application/java-archive"},
+        {".java", "application/octet-stream"},
+        {".jck", "application/liquidmotion"},
+        {".jcz", "application/liquidmotion"},
+        {".jfif", "image/pjpeg"},
+        {".jnlp", "application/x-java-jnlp-file"},
+        {".jpb", "application/octet-stream"},
+        {".jpe", "image/jpeg"},
+        {".jpeg", "image/jpeg"},
+        {".jpg", "image/jpeg"},
+        {".js", "application/x-javascript"},
+		{".json", "application/json"},
+        {".jsx", "text/jscript"},
+        {".jsxbin", "text/plain"},
+        {".latex", "application/x-latex"},
+        {".library-ms", "application/windows-library+xml"},
+        {".lit", "application/x-ms-reader"},
+        {".loadtest", "application/xml"},
+        {".lpk", "application/octet-stream"},
+        {".lsf", "video/x-la-asf"},
+        {".lst", "text/plain"},
+        {".lsx", "video/x-la-asf"},
+        {".lzh", "application/octet-stream"},
+        {".m13", "application/x-msmediaview"},
+        {".m14", "application/x-msmediaview"},
+        {".m1v", "video/mpeg"},
+        {".m2t", "video/vnd.dlna.mpeg-tts"},
+        {".m2ts", "video/vnd.dlna.mpeg-tts"},
+        {".m2v", "video/mpeg"},
+        {".m3u", "audio/x-mpegurl"},
+        {".m3u8", "audio/x-mpegurl"},
+        {".m4a", "audio/m4a"},
+        {".m4b", "audio/m4b"},
+        {".m4p", "audio/m4p"},
+        {".m4r", "audio/x-m4r"},
+        {".m4v", "video/x-m4v"},
+        {".mac", "image/x-macpaint"},
+        {".mak", "text/plain"},
+        {".man", "application/x-troff-man"},
+        {".manifest", "application/x-ms-manifest"},
+        {".map", "text/plain"},
+        {".master", "application/xml"},
+        {".mda", "application/msaccess"},
+        {".mdb", "application/x-msaccess"},
+        {".mde", "application/msaccess"},
+        {".mdp", "application/octet-stream"},
+        {".me", "application/x-troff-me"},
+        {".mfp", "application/x-shockwave-flash"},
+        {".mht", "message/rfc822"},
+        {".mhtml", "message/rfc822"},
+        {".mid", "audio/mid"},
+        {".midi", "audio/mid"},
+        {".mix", "application/octet-stream"},
+        {".mk", "text/plain"},
+        {".mmf", "application/x-smaf"},
+        {".mno", "text/xml"},
+        {".mny", "application/x-msmoney"},
+        {".mod", "video/mpeg"},
+        {".mov", "video/quicktime"},
+        {".movie", "video/x-sgi-movie"},
+        {".mp2", "video/mpeg"},
+        {".mp2v", "video/mpeg"},
+        {".mp3", "audio/mpeg"},
+        {".mp4", "video/mp4"},
+        {".mp4v", "video/mp4"},
+        {".mpa", "video/mpeg"},
+        {".mpe", "video/mpeg"},
+        {".mpeg", "video/mpeg"},
+        {".mpf", "application/vnd.ms-mediapackage"},
+        {".mpg", "video/mpeg"},
+        {".mpp", "application/vnd.ms-project"},
+        {".mpv2", "video/mpeg"},
+        {".mqv", "video/quicktime"},
+        {".ms", "application/x-troff-ms"},
+        {".msi", "application/octet-stream"},
+        {".mso", "application/octet-stream"},
+        {".mts", "video/vnd.dlna.mpeg-tts"},
+        {".mtx", "application/xml"},
+        {".mvb", "application/x-msmediaview"},
+        {".mvc", "application/x-miva-compiled"},
+        {".mxp", "application/x-mmxp"},
+        {".nc", "application/x-netcdf"},
+        {".nsc", "video/x-ms-asf"},
+        {".nws", "message/rfc822"},
+        {".ocx", "application/octet-stream"},
+        {".oda", "application/oda"},
+        {".odc", "text/x-ms-odc"},
+        {".odh", "text/plain"},
+        {".odl", "text/plain"},
+        {".odp", "application/vnd.oasis.opendocument.presentation"},
+        {".ods", "application/oleobject"},
+        {".odt", "application/vnd.oasis.opendocument.text"},
+        {".one", "application/onenote"},
+        {".onea", "application/onenote"},
+        {".onepkg", "application/onenote"},
+        {".onetmp", "application/onenote"},
+        {".onetoc", "application/onenote"},
+        {".onetoc2", "application/onenote"},
+        {".orderedtest", "application/xml"},
+        {".osdx", "application/opensearchdescription+xml"},
+        {".p10", "application/pkcs10"},
+        {".p12", "application/x-pkcs12"},
+        {".p7b", "application/x-pkcs7-certificates"},
+        {".p7c", "application/pkcs7-mime"},
+        {".p7m", "application/pkcs7-mime"},
+        {".p7r", "application/x-pkcs7-certreqresp"},
+        {".p7s", "application/pkcs7-signature"},
+        {".pbm", "image/x-portable-bitmap"},
+        {".pcast", "application/x-podcast"},
+        {".pct", "image/pict"},
+        {".pcx", "application/octet-stream"},
+        {".pcz", "application/octet-stream"},
+        {".pdf", "application/pdf"},
+        {".pfb", "application/octet-stream"},
+        {".pfm", "application/octet-stream"},
+        {".pfx", "application/x-pkcs12"},
+        {".pgm", "image/x-portable-graymap"},
+        {".pic", "image/pict"},
+        {".pict", "image/pict"},
+        {".pkgdef", "text/plain"},
+        {".pkgundef", "text/plain"},
+        {".pko", "application/vnd.ms-pki.pko"},
+        {".pls", "audio/scpls"},
+        {".pma", "application/x-perfmon"},
+        {".pmc", "application/x-perfmon"},
+        {".pml", "application/x-perfmon"},
+        {".pmr", "application/x-perfmon"},
+        {".pmw", "application/x-perfmon"},
+        {".png", "image/png"},
+        {".pnm", "image/x-portable-anymap"},
+        {".pnt", "image/x-macpaint"},
+        {".pntg", "image/x-macpaint"},
+        {".pnz", "image/png"},
+        {".pot", "application/vnd.ms-powerpoint"},
+        {".potm", "application/vnd.ms-powerpoint.template.macroEnabled.12"},
+        {".potx", "application/vnd.openxmlformats-officedocument.presentationml.template"},
+        {".ppa", "application/vnd.ms-powerpoint"},
+        {".ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12"},
+        {".ppm", "image/x-portable-pixmap"},
+        {".pps", "application/vnd.ms-powerpoint"},
+        {".ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"},
+        {".ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow"},
+        {".ppt", "application/vnd.ms-powerpoint"},
+        {".pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"},
+        {".pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"},
+        {".prf", "application/pics-rules"},
+        {".prm", "application/octet-stream"},
+        {".prx", "application/octet-stream"},
+        {".ps", "application/postscript"},
+        {".psc1", "application/PowerShell"},
+        {".psd", "application/octet-stream"},
+        {".psess", "application/xml"},
+        {".psm", "application/octet-stream"},
+        {".psp", "application/octet-stream"},
+        {".pub", "application/x-mspublisher"},
+        {".pwz", "application/vnd.ms-powerpoint"},
+        {".qht", "text/x-html-insertion"},
+        {".qhtm", "text/x-html-insertion"},
+        {".qt", "video/quicktime"},
+        {".qti", "image/x-quicktime"},
+        {".qtif", "image/x-quicktime"},
+        {".qtl", "application/x-quicktimeplayer"},
+        {".qxd", "application/octet-stream"},
+        {".ra", "audio/x-pn-realaudio"},
+        {".ram", "audio/x-pn-realaudio"},
+        {".rar", "application/octet-stream"},
+        {".ras", "image/x-cmu-raster"},
+        {".rat", "application/rat-file"},
+        {".rc", "text/plain"},
+        {".rc2", "text/plain"},
+        {".rct", "text/plain"},
+        {".rdlc", "application/xml"},
+        {".resx", "application/xml"},
+        {".rf", "image/vnd.rn-realflash"},
+        {".rgb", "image/x-rgb"},
+        {".rgs", "text/plain"},
+        {".rm", "application/vnd.rn-realmedia"},
+        {".rmi", "audio/mid"},
+        {".rmp", "application/vnd.rn-rn_music_package"},
+        {".roff", "application/x-troff"},
+        {".rpm", "audio/x-pn-realaudio-plugin"},
+        {".rqy", "text/x-ms-rqy"},
+        {".rtf", "application/rtf"},
+        {".rtx", "text/richtext"},
+        {".ruleset", "application/xml"},
+        {".s", "text/plain"},
+        {".safariextz", "application/x-safari-safariextz"},
+        {".scd", "application/x-msschedule"},
+        {".sct", "text/scriptlet"},
+        {".sd2", "audio/x-sd2"},
+        {".sdp", "application/sdp"},
+        {".sea", "application/octet-stream"},
+        {".searchConnector-ms", "application/windows-search-connector+xml"},
+        {".setpay", "application/set-payment-initiation"},
+        {".setreg", "application/set-registration-initiation"},
+        {".settings", "application/xml"},
+        {".sgimb", "application/x-sgimb"},
+        {".sgml", "text/sgml"},
+        {".sh", "application/x-sh"},
+        {".shar", "application/x-shar"},
+        {".shtml", "text/html"},
+        {".sit", "application/x-stuffit"},
+        {".sitemap", "application/xml"},
+        {".skin", "application/xml"},
+        {".sldm", "application/vnd.ms-powerpoint.slide.macroEnabled.12"},
+        {".sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide"},
+        {".slk", "application/vnd.ms-excel"},
+        {".sln", "text/plain"},
+        {".slupkg-ms", "application/x-ms-license"},
+        {".smd", "audio/x-smd"},
+        {".smi", "application/octet-stream"},
+        {".smx", "audio/x-smd"},
+        {".smz", "audio/x-smd"},
+        {".snd", "audio/basic"},
+        {".snippet", "application/xml"},
+        {".snp", "application/octet-stream"},
+        {".sol", "text/plain"},
+        {".sor", "text/plain"},
+        {".spc", "application/x-pkcs7-certificates"},
+        {".spl", "application/futuresplash"},
+        {".src", "application/x-wais-source"},
+        {".srf", "text/plain"},
+        {".SSISDeploymentManifest", "text/xml"},
+        {".ssm", "application/streamingmedia"},
+        {".sst", "application/vnd.ms-pki.certstore"},
+        {".stl", "application/vnd.ms-pki.stl"},
+        {".sv4cpio", "application/x-sv4cpio"},
+        {".sv4crc", "application/x-sv4crc"},
+        {".svc", "application/xml"},
+        {".swf", "application/x-shockwave-flash"},
+        {".t", "application/x-troff"},
+        {".tar", "application/x-tar"},
+        {".tcl", "application/x-tcl"},
+        {".testrunconfig", "application/xml"},
+        {".testsettings", "application/xml"},
+        {".tex", "application/x-tex"},
+        {".texi", "application/x-texinfo"},
+        {".texinfo", "application/x-texinfo"},
+        {".tgz", "application/x-compressed"},
+        {".thmx", "application/vnd.ms-officetheme"},
+        {".thn", "application/octet-stream"},
+        {".tif", "image/tiff"},
+        {".tiff", "image/tiff"},
+        {".tlh", "text/plain"},
+        {".tli", "text/plain"},
+        {".toc", "application/octet-stream"},
+        {".tr", "application/x-troff"},
+        {".trm", "application/x-msterminal"},
+        {".trx", "application/xml"},
+        {".ts", "video/vnd.dlna.mpeg-tts"},
+        {".tsv", "text/tab-separated-values"},
+        {".ttf", "application/octet-stream"},
+        {".tts", "video/vnd.dlna.mpeg-tts"},
+        {".txt", "text/plain"},
+        {".u32", "application/octet-stream"},
+        {".uls", "text/iuls"},
+        {".user", "text/plain"},
+        {".ustar", "application/x-ustar"},
+        {".vb", "text/plain"},
+        {".vbdproj", "text/plain"},
+        {".vbk", "video/mpeg"},
+        {".vbproj", "text/plain"},
+        {".vbs", "text/vbscript"},
+        {".vcf", "text/x-vcard"},
+        {".vcproj", "Application/xml"},
+        {".vcs", "text/plain"},
+        {".vcxproj", "Application/xml"},
+        {".vddproj", "text/plain"},
+        {".vdp", "text/plain"},
+        {".vdproj", "text/plain"},
+        {".vdx", "application/vnd.ms-visio.viewer"},
+        {".vml", "text/xml"},
+        {".vscontent", "application/xml"},
+        {".vsct", "text/xml"},
+        {".vsd", "application/vnd.visio"},
+        {".vsi", "application/ms-vsi"},
+        {".vsix", "application/vsix"},
+        {".vsixlangpack", "text/xml"},
+        {".vsixmanifest", "text/xml"},
+        {".vsmdi", "application/xml"},
+        {".vspscc", "text/plain"},
+        {".vss", "application/vnd.visio"},
+        {".vsscc", "text/plain"},
+        {".vssettings", "text/xml"},
+        {".vssscc", "text/plain"},
+        {".vst", "application/vnd.visio"},
+        {".vstemplate", "text/xml"},
+        {".vsto", "application/x-ms-vsto"},
+        {".vsw", "application/vnd.visio"},
+        {".vsx", "application/vnd.visio"},
+        {".vtx", "application/vnd.visio"},
+        {".wav", "audio/wav"},
+        {".wave", "audio/wav"},
+        {".wax", "audio/x-ms-wax"},
+        {".wbk", "application/msword"},
+        {".wbmp", "image/vnd.wap.wbmp"},
+        {".wcm", "application/vnd.ms-works"},
+        {".wdb", "application/vnd.ms-works"},
+        {".wdp", "image/vnd.ms-photo"},
+        {".webarchive", "application/x-safari-webarchive"},
+        {".webtest", "application/xml"},
+        {".wiq", "application/xml"},
+        {".wiz", "application/msword"},
+        {".wks", "application/vnd.ms-works"},
+        {".WLMP", "application/wlmoviemaker"},
+        {".wlpginstall", "application/x-wlpg-detect"},
+        {".wlpginstall3", "application/x-wlpg3-detect"},
+        {".wm", "video/x-ms-wm"},
+        {".wma", "audio/x-ms-wma"},
+        {".wmd", "application/x-ms-wmd"},
+        {".wmf", "application/x-msmetafile"},
+        {".wml", "text/vnd.wap.wml"},
+        {".wmlc", "application/vnd.wap.wmlc"},
+        {".wmls", "text/vnd.wap.wmlscript"},
+        {".wmlsc", "application/vnd.wap.wmlscriptc"},
+        {".wmp", "video/x-ms-wmp"},
+        {".wmv", "video/x-ms-wmv"},
+        {".wmx", "video/x-ms-wmx"},
+        {".wmz", "application/x-ms-wmz"},
+        {".wpl", "application/vnd.ms-wpl"},
+        {".wps", "application/vnd.ms-works"},
+        {".wri", "application/x-mswrite"},
+        {".wrl", "x-world/x-vrml"},
+        {".wrz", "x-world/x-vrml"},
+        {".wsc", "text/scriptlet"},
+        {".wsdl", "text/xml"},
+        {".wvx", "video/x-ms-wvx"},
+        {".x", "application/directx"},
+        {".xaf", "x-world/x-vrml"},
+        {".xaml", "application/xaml+xml"},
+        {".xap", "application/x-silverlight-app"},
+        {".xbap", "application/x-ms-xbap"},
+        {".xbm", "image/x-xbitmap"},
+        {".xdr", "text/plain"},
+        {".xht", "application/xhtml+xml"},
+        {".xhtml", "application/xhtml+xml"},
+        {".xla", "application/vnd.ms-excel"},
+        {".xlam", "application/vnd.ms-excel.addin.macroEnabled.12"},
+        {".xlc", "application/vnd.ms-excel"},
+        {".xld", "application/vnd.ms-excel"},
+        {".xlk", "application/vnd.ms-excel"},
+        {".xll", "application/vnd.ms-excel"},
+        {".xlm", "application/vnd.ms-excel"},
+        {".xls", "application/vnd.ms-excel"},
+        {".xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12"},
+        {".xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12"},
+        {".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},
+        {".xlt", "application/vnd.ms-excel"},
+        {".xltm", "application/vnd.ms-excel.template.macroEnabled.12"},
+        {".xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template"},
+        {".xlw", "application/vnd.ms-excel"},
+        {".xml", "text/xml"},
+        {".xmta", "application/xml"},
+        {".xof", "x-world/x-vrml"},
+        {".XOML", "text/plain"},
+        {".xpm", "image/x-xpixmap"},
+        {".xps", "application/vnd.ms-xpsdocument"},
+        {".xrm-ms", "text/xml"},
+        {".xsc", "application/xml"},
+        {".xsd", "text/xml"},
+        {".xsf", "text/xml"},
+        {".xsl", "text/xml"},
+        {".xslt", "text/xml"},
+        {".xsn", "application/octet-stream"},
+        {".xss", "application/xml"},
+        {".xtp", "application/octet-stream"},
+        {".xwd", "image/x-xwindowdump"},
+        {".z", "application/x-compress"},
+        {".zip", "application/x-zip-compressed"},
+        };
+
+		public static string GetMimeType (string extension)
+		{
+			if (extension == null) {
+				throw new ArgumentNullException ("extension");
+			}
+
+			if (!extension.StartsWith (".")) {
+				extension = "." + extension;
+			}
+
+			string mime;
+
+			return _mappings.TryGetValue (extension, out mime) ? mime : "application/octet-stream";
+		}
+	}
+}
+
Index: binary-improvements/MapRendering/Web/PathHandler.cs
===================================================================
--- binary-improvements/MapRendering/Web/PathHandler.cs	(revision 230)
+++ binary-improvements/MapRendering/Web/PathHandler.cs	(revision 230)
@@ -0,0 +1,11 @@
+using System;
+using System.Net;
+
+namespace AllocsFixes.NetConnections.Servers.Web
+{
+	public abstract class PathHandler
+	{
+		public abstract void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, HttpListenerBasicIdentity user);
+	}
+}
+
Index: binary-improvements/MapRendering/Web/SimpleRedirectHandler.cs
===================================================================
--- binary-improvements/MapRendering/Web/SimpleRedirectHandler.cs	(revision 230)
+++ binary-improvements/MapRendering/Web/SimpleRedirectHandler.cs	(revision 230)
@@ -0,0 +1,21 @@
+using System;
+using System.Net;
+
+namespace AllocsFixes.NetConnections.Servers.Web
+{
+	public class SimpleRedirectHandler : PathHandler
+	{
+		string target;
+
+		public SimpleRedirectHandler (string target)
+		{
+			this.target = target;
+		}
+
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, HttpListenerBasicIdentity user)
+		{
+			resp.Redirect (target);
+		}
+	}
+}
+
Index: binary-improvements/MapRendering/Web/StaticHandler.cs
===================================================================
--- binary-improvements/MapRendering/Web/StaticHandler.cs	(revision 230)
+++ binary-improvements/MapRendering/Web/StaticHandler.cs	(revision 230)
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Net;
+using System.Threading;
+
+namespace AllocsFixes.NetConnections.Servers.Web
+{
+	public class StaticHandler : PathHandler
+	{
+		private string datapath;
+		private string staticPart;
+		private AllocsFixes.FileCache.AbstractCache cache;
+		private bool logMissingFiles;
+
+		public StaticHandler (string staticPart, string filePath, AllocsFixes.FileCache.AbstractCache cache, bool logMissingFiles)
+		{
+			this.staticPart = staticPart;
+			this.datapath = filePath;
+			this.cache = cache;
+			this.logMissingFiles = logMissingFiles;
+		}
+
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, HttpListenerBasicIdentity user)
+		{
+			string fn = req.Url.AbsolutePath.Remove (0, staticPart.Length);
+
+			byte[] content = cache.GetFileContent (datapath + "/" + fn);
+			if (content != null) {
+				resp.ContentType = MimeType.GetMimeType (Path.GetExtension (fn));
+				resp.ContentLength64 = content.Length;
+				resp.OutputStream.Write (content, 0, content.Length);
+			} else {
+				resp.StatusCode = (int)HttpStatusCode.NotFound;
+				if (logMissingFiles)
+					Log.Out ("Web:Static:FileNotFound: \"" + req.Url.AbsolutePath + "\" @ \"" + datapath + "/" + req.Url.AbsolutePath.Remove (0, staticPart.Length) + "\"");
+				return;
+			}
+		}
+	}
+}
+
Index: binary-improvements/MapRendering/Web/Web.cs
===================================================================
--- binary-improvements/MapRendering/Web/Web.cs	(revision 230)
+++ binary-improvements/MapRendering/Web/Web.cs	(revision 230)
@@ -0,0 +1,171 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Net;
+using System.Net.Sockets;
+using System.Reflection;
+using System.Text;
+using System.Threading;
+using UnityEngine;
+
+namespace AllocsFixes.NetConnections.Servers.Web
+{
+	public class Web : IConsoleServer {
+		private readonly HttpListener _listener = new HttpListener ();
+		private Dictionary<string, PathHandler> handlers = new Dictionary<string, PathHandler> ();
+		private bool authEnabled = false;
+		private string realm = "7dtd Admin Panel";
+		public static int handlingCount = 0;
+		public static int currentHandlers = 0;
+		private string dataFolder;
+		private bool mapEnabled = false;
+
+		public Web () {
+			try {
+				int webPort = GamePrefs.GetInt (EnumGamePrefs.ControlPanelPort);
+				if (webPort < 1 || webPort > 65533) {
+					Log.Out ("Webserver not started (ControlPanelPort not within 1-65534)");
+					return;
+				}
+				if (!Directory.Exists (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location) + "/webserver")) {
+					Log.Out ("Webserver not started (folder \"webserver\" not found in WebInterface mod folder)");
+					return;
+				}
+
+				dataFolder = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location) + "/webserver";
+
+				if (!HttpListener.IsSupported) {
+					Log.Out ("Webserver not started (needs Windows XP SP2, Server 2003 or later or Mono)");
+					return;
+				}
+ 
+				handlers.Add (
+						"/index.htm",
+						new SimpleRedirectHandler ("/static/index.html"));
+				handlers.Add (
+						"/favicon.ico",
+						new SimpleRedirectHandler ("/static/favicon.ico"));
+				handlers.Add (
+						"/static/",
+						new StaticHandler (
+								"/static/",
+								dataFolder,
+								new AllocsFixes.FileCache.DirectAccess (),
+								true)
+				); // TODO: Enable cache
+
+				handlers.Add (
+					"/map/",
+					new StaticHandler (
+						"/map/",
+						StaticDirectories.GetSaveGameDir () + "/map",
+						MapRendering.MapRendering.GetTileCache (),
+						false)
+				);
+
+				handlers.Add ("/api/", new ApiHandler ("/api/"));
+
+				_listener.Prefixes.Add (String.Format ("http://*:{0}/", webPort + 2));
+				authEnabled = File.Exists (dataFolder + "/protect");
+				if (authEnabled) {
+					_listener.AuthenticationSchemes = AuthenticationSchemes.Basic;
+				}
+				_listener.Start ();
+				_listener.Realm = realm;
+
+				SdtdConsole.Instance.RegisterServer (this);
+
+				_listener.BeginGetContext (new AsyncCallback (HandleRequest), _listener);
+
+				Log.Out ("Started Webserver on " + (webPort + 2) + " (authentication " + (authEnabled ? "enabled" : "disabled") + ")");
+			} catch (Exception e) {
+				Log.Out ("Error in Web.ctor: " + e);
+			}
+		}
+
+		private void HandleRequest (IAsyncResult result) {
+			if (_listener.IsListening) {
+				Interlocked.Increment (ref handlingCount);
+				Interlocked.Increment (ref currentHandlers);
+				HttpListenerContext ctx = _listener.EndGetContext (result);
+				_listener.BeginGetContext (new AsyncCallback (HandleRequest), _listener);
+				try {
+					ctx.Response.ProtocolVersion = new Version ("1.0");
+
+					HttpListenerBasicIdentity user = Authorize (ctx);
+
+					if (!authEnabled || (user.Name.ToLower ().Equals ("admin") && user.Password.Equals (GamePrefs.GetString (EnumGamePrefs.ControlPanelPassword)))) {
+						if (ctx.Request.Url.AbsolutePath.Length < 2) {
+							handlers ["/index.htm"].HandleRequest (ctx.Request, ctx.Response, user);
+							return;
+						} else {
+							foreach (KeyValuePair<string, PathHandler> kvp in handlers) {
+								if (ctx.Request.Url.AbsolutePath.StartsWith (kvp.Key)) {
+									kvp.Value.HandleRequest (ctx.Request, ctx.Response, user);
+									return;
+								}
+							}
+						}
+
+						Log.Out ("Error in Web.HandleRequest(): No handler found for path \"" + ctx.Request.Url.AbsolutePath + "\"");
+						ctx.Response.StatusCode = (int)HttpStatusCode.NotFound;
+					} else {
+						ctx.Response.StatusCode = (int)HttpStatusCode.Unauthorized;
+						ctx.Response.Headers ["WWW-Authenticate"] = "Basic realm=\"" + realm + "\"";
+					}
+				} catch (IOException e) {
+					if (e.InnerException is SocketException) {
+						Log.Out ("Error in Web.HandleRequest(): Remote host closed connection: " + e.InnerException.Message);
+					} else {
+						Log.Out ("Error (IO) in Web.HandleRequest(): " + e);
+					}
+				} catch (Exception e) {
+					Log.Out ("Error in Web.HandleRequest(): " + e);
+				} finally {
+					if (ctx != null) {
+						ctx.Response.OutputStream.Close ();
+					}
+					Interlocked.Decrement (ref currentHandlers);
+				}
+			}
+		}
+
+		private HttpListenerBasicIdentity Authorize (HttpListenerContext ctx) {
+			try {
+				return (HttpListenerBasicIdentity)ctx.User.Identity;
+			} catch (NullReferenceException) {
+				return null;
+			}
+		}
+
+		public void Disconnect () {
+			try {
+				_listener.Stop ();
+				_listener.Close ();
+			} catch (Exception e) {
+				Log.Out ("Error in Web.Disconnect: " + e);
+			}
+		}
+
+		public void SendLine (string line) {
+			try {
+				//Log.Out ("NOT IMPLEMENTED: Web.WriteToClient");
+			} catch (Exception e) {
+				Log.Out ("Error in Web.WriteToClient: " + e);
+			}
+		}
+
+		public void SendLog (string text, string trace, UnityEngine.LogType type) {
+			//throw new System.NotImplementedException ();
+		}
+
+		public static void SetResponseTextContent (HttpListenerResponse resp, string text) {
+			byte[] buf = Encoding.UTF8.GetBytes (text);
+			resp.ContentLength64 = buf.Length;
+			resp.ContentType = "text/html";
+			resp.ContentEncoding = Encoding.UTF8;
+			resp.OutputStream.Write (buf, 0, buf.Length);
+		}
+
+	}
+}
Index: binary-improvements/MapRendering/WebAndMapRendering.csproj
===================================================================
--- binary-improvements/MapRendering/WebAndMapRendering.csproj	(revision 230)
+++ binary-improvements/MapRendering/WebAndMapRendering.csproj	(revision 230)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>10.0.0</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{A1847B5F-7BFC-4BCD-94AA-A6C9FB7E7C54}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <RootNamespace>MapRendering</RootNamespace>
+    <AssemblyName>MapRendering</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>none</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\bin\Mods\Allocs_WebAndMapRendering\</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="LogLibrary">
+      <HintPath>..\7dtd-binaries\LogLibrary.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="UnityEngine">
+      <HintPath>..\7dtd-binaries\UnityEngine.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Assembly-CSharp">
+      <HintPath>..\7dtd-binaries\Assembly-CSharp.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="mscorlib">
+      <HintPath>..\7dtd-binaries\mscorlib.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="AssemblyInfo.cs" />
+    <Compile Include="MapRendering\MapRendering.cs" />
+    <Compile Include="MapRendering\MapRenderBlockBuffer.cs" />
+    <Compile Include="MapRendering\Constants.cs" />
+    <Compile Include="Commands\RenderMap.cs" />
+    <Compile Include="Commands\EnableRendering.cs" />
+    <Compile Include="API.cs" />
+    <Compile Include="Web\Web.cs" />
+    <Compile Include="Web\PathHandler.cs" />
+    <Compile Include="Web\StaticHandler.cs" />
+    <Compile Include="Web\SimpleRedirectHandler.cs" />
+    <Compile Include="Web\MimeType.cs" />
+    <Compile Include="Web\ApiHandler.cs" />
+    <Compile Include="Web\API\GetPlayersOnline.cs" />
+    <Compile Include="Web\API\WebAPI.cs" />
+    <Compile Include="Web\API\GetPlayersLocation.cs" />
+    <Compile Include="Web\API\GetPlayerInventory.cs" />
+    <Compile Include="Web\API\GetLandClaims.cs" />
+    <Compile Include="Commands\webstat.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <ItemGroup>
+    <ProjectReference Include="..\7dtd-server-fixes\7dtd-server-fixes.csproj">
+      <Project>{81DA7F87-1A66-4920-AADA-6EAF1971F8D0}</Project>
+      <Name>7dtd-server-fixes</Name>
+      <Private>False</Private>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Commands\" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="ModInfo.xml">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+</Project>
