Index: /binary-improvements/7dtd-server-fixes/ModInfo.xml
===================================================================
--- /binary-improvements/7dtd-server-fixes/ModInfo.xml	(revision 308)
+++ /binary-improvements/7dtd-server-fixes/ModInfo.xml	(revision 309)
@@ -5,5 +5,5 @@
 		<Description value="Common functions" />
 		<Author value="Christian 'Alloc' Illy" />
-		<Version value="15" />
+		<Version value="16" />
 		<Website value="http://7dtd.illy.bz" />
 	</ModInfo>
Index: /binary-improvements/7dtd-server-fixes/src/JSON/JSONArray.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/JSON/JSONArray.cs	(revision 308)
+++ /binary-improvements/7dtd-server-fixes/src/JSON/JSONArray.cs	(revision 309)
@@ -23,23 +23,22 @@
 		}
 
-		public override string ToString (bool prettyPrint = false, int currentLevel = 0)
+		public override void ToString (StringBuilder stringBuilder, bool prettyPrint = false, int currentLevel = 0)
 		{
-			StringBuilder sb = new StringBuilder ("[");
+			stringBuilder.Append ("[");
 			if (prettyPrint)
-				sb.Append ('\n');
+				stringBuilder.Append ('\n');
 			foreach (JSONNode n in nodes) {
 				if (prettyPrint)
-					sb.Append (new String ('\t', currentLevel + 1));
-				sb.Append (n.ToString (prettyPrint, currentLevel + 1));
-				sb.Append (",");
+					stringBuilder.Append (new String ('\t', currentLevel + 1));
+				n.ToString (stringBuilder, prettyPrint, currentLevel + 1);
+				stringBuilder.Append (",");
 				if (prettyPrint)
-					sb.Append ('\n');
+					stringBuilder.Append ('\n');
 			}
-			if (sb.Length > 1)
-				sb.Remove (sb.Length - (prettyPrint ? 2 : 1), 1);
+			if (stringBuilder.Length > 1)
+				stringBuilder.Remove (stringBuilder.Length - (prettyPrint ? 2 : 1), 1);
 			if (prettyPrint)
-				sb.Append (new String ('\t', currentLevel));
-			sb.Append ("]");
-			return sb.ToString ();
+				stringBuilder.Append (new String ('\t', currentLevel));
+			stringBuilder.Append ("]");
 		}
 
Index: /binary-improvements/7dtd-server-fixes/src/JSON/JSONBoolean.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/JSON/JSONBoolean.cs	(revision 308)
+++ /binary-improvements/7dtd-server-fixes/src/JSON/JSONBoolean.cs	(revision 309)
@@ -1,3 +1,4 @@
 using System;
+using System.Text;
 
 namespace AllocsFixes.JSON
@@ -17,7 +18,7 @@
 		}
 
-		public override string ToString (bool prettyPrint = false, int currentLevel = 0)
+		public override void ToString (StringBuilder stringBuilder, bool prettyPrint = false, int currentLevel = 0)
 		{
-			return value.ToString (System.Globalization.CultureInfo.InvariantCulture).ToLower ();
+			stringBuilder.Append (value ? "true" : "false");
 		}
 
Index: /binary-improvements/7dtd-server-fixes/src/JSON/JSONNode.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/JSON/JSONNode.cs	(revision 308)
+++ /binary-improvements/7dtd-server-fixes/src/JSON/JSONNode.cs	(revision 309)
@@ -1,3 +1,4 @@
 using System;
+using System.Text;
 
 namespace AllocsFixes.JSON
@@ -5,6 +6,11 @@
 	public abstract class JSONNode
 	{
-		public abstract string ToString(bool prettyPrint = false, int currentLevel = 0);
+		public abstract void ToString(StringBuilder stringBuilder, bool prettyPrint = false, int currentLevel = 0);
+
+		public override string ToString () {
+			StringBuilder sb = new StringBuilder ();
+			ToString (sb);
+			return sb.ToString ();
+		}
 	}
 }
-
Index: /binary-improvements/7dtd-server-fixes/src/JSON/JSONNull.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/JSON/JSONNull.cs	(revision 308)
+++ /binary-improvements/7dtd-server-fixes/src/JSON/JSONNull.cs	(revision 309)
@@ -1,3 +1,4 @@
 using System;
+using System.Text;
 
 namespace AllocsFixes.JSON
@@ -9,7 +10,7 @@
 		}
 
-		public override string ToString (bool prettyPrint = false, int currentLevel = 0)
+		public override void ToString (StringBuilder stringBuilder, bool prettyPrint = false, int currentLevel = 0)
 		{
-			return "null";
+			stringBuilder.Append ("null");
 		}
 
Index: /binary-improvements/7dtd-server-fixes/src/JSON/JSONNumber.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/JSON/JSONNumber.cs	(revision 308)
+++ /binary-improvements/7dtd-server-fixes/src/JSON/JSONNumber.cs	(revision 309)
@@ -23,7 +23,7 @@
 		}
 
-		public override string ToString (bool prettyPrint = false, int currentLevel = 0)
+		public override void ToString (StringBuilder stringBuilder, bool prettyPrint = false, int currentLevel = 0)
 		{
-			return value.ToString (System.Globalization.CultureInfo.InvariantCulture);
+			stringBuilder.Append (value.ToCultureInvariantString ());
 		}
 
@@ -86,5 +86,5 @@
 				} else {
 					double number;
-					if (!double.TryParse (sbNum.ToString (), out number)) {
+					if (!Utils.TryParseDouble(sbNum.ToString (), out number)) {
 						throw new MalformedJSONException ("Mantissa is not a valid decimal (\"" + sbNum.ToString () + "\")");
 					}
Index: /binary-improvements/7dtd-server-fixes/src/JSON/JSONObject.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/JSON/JSONObject.cs	(revision 308)
+++ /binary-improvements/7dtd-server-fixes/src/JSON/JSONObject.cs	(revision 309)
@@ -32,26 +32,25 @@
 		}
 
-		public override string ToString (bool prettyPrint = false, int currentLevel = 0)
+		public override void ToString (StringBuilder stringBuilder, bool prettyPrint = false, int currentLevel = 0)
 		{
-			StringBuilder sb = new StringBuilder ("{");
+			stringBuilder.Append ("{");
 			if (prettyPrint)
-				sb.Append ('\n');
+				stringBuilder.Append ('\n');
 			foreach (KeyValuePair<string, JSONNode> kvp in nodes) {
 				if (prettyPrint)
-					sb.Append (new String ('\t', currentLevel + 1));
-				sb.Append (String.Format ("\"{0}\":", kvp.Key));
+					stringBuilder.Append (new String ('\t', currentLevel + 1));
+				stringBuilder.Append (String.Format ("\"{0}\":", kvp.Key));
 				if (prettyPrint)
-					sb.Append (" ");
-				sb.Append (kvp.Value.ToString (prettyPrint, currentLevel + 1));
-				sb.Append (",");
+					stringBuilder.Append (" ");
+				kvp.Value.ToString (stringBuilder, prettyPrint, currentLevel + 1);
+				stringBuilder.Append (",");
 				if (prettyPrint)
-					sb.Append ('\n');
+					stringBuilder.Append ('\n');
 			}
-			if (sb.Length > 1)
-				sb.Remove (sb.Length - (prettyPrint ? 2 : 1), 1);
+			if (stringBuilder.Length > 1)
+				stringBuilder.Remove (stringBuilder.Length - (prettyPrint ? 2 : 1), 1);
 			if (prettyPrint)
-				sb.Append (new String ('\t', currentLevel));
-			sb.Append ("}");
-			return sb.ToString ();
+				stringBuilder.Append (new String ('\t', currentLevel));
+			stringBuilder.Append ("}");
 		}
 
Index: /binary-improvements/7dtd-server-fixes/src/JSON/JSONString.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/JSON/JSONString.cs	(revision 308)
+++ /binary-improvements/7dtd-server-fixes/src/JSON/JSONString.cs	(revision 309)
@@ -18,14 +18,17 @@
 		}
 
-		public override string ToString (bool prettyPrint = false, int currentLevel = 0)
+		public override void ToString (StringBuilder stringBuilder, bool prettyPrint = false, int currentLevel = 0)
 		{
 			if (value == null || value.Length == 0) {
-				return "\"\"";
+				stringBuilder.Append ("\"\"");
+				return;
 			}
 
 			int len = value.Length;
 
-			StringBuilder sb = new StringBuilder (len + 4);
+			stringBuilder.EnsureCapacity (stringBuilder.Length + 2*len);
 			String t;
+
+			stringBuilder.Append ('"');
 
 			foreach (char c in value) {
@@ -34,28 +37,28 @@
 					case '"':
 //					case '/':
-						sb.Append ('\\');
-						sb.Append (c);
+						stringBuilder.Append ('\\');
+						stringBuilder.Append (c);
 						break;
 					case '\b':
-						sb.Append ("\\b");
+						stringBuilder.Append ("\\b");
 						break;
 					case '\t':
-						sb.Append ("\\t");
+						stringBuilder.Append ("\\t");
 						break;
 					case '\n':
-						sb.Append ("\\n");
+						stringBuilder.Append ("\\n");
 						break;
 					case '\f':
-						sb.Append ("\\f");
+						stringBuilder.Append ("\\f");
 						break;
 					case '\r':
-						sb.Append ("\\r");
+						stringBuilder.Append ("\\r");
 						break;
 					default:
 						if (c < ' ') {
-							t = "000" + String.Format ("X", c);
-							sb.Append ("\\u" + t.Substring (t.Length - 4));
+							stringBuilder.Append ("\\u");
+							stringBuilder.Append (((int)c).ToString ("X4"));
 						} else {
-							sb.Append (c);
+							stringBuilder.Append (c);
 						}
 						break;
@@ -63,5 +66,5 @@
 			}
 
-			return string.Format ("\"{0}\"", sb.ToString ());
+			stringBuilder.Append ('"');
 		}
 
Index: /binary-improvements/AllocsCommands/AllocsCommands.csproj
===================================================================
--- /binary-improvements/AllocsCommands/AllocsCommands.csproj	(revision 308)
+++ /binary-improvements/AllocsCommands/AllocsCommands.csproj	(revision 309)
@@ -39,4 +39,8 @@
       <Private>False</Private>
     </Reference>
+    <Reference Include="Assembly-CSharp-firstpass">
+      <HintPath>..\..\..\RPGMod\7dtd-binaries\Assembly-CSharp-firstpass.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
   </ItemGroup>
   <ItemGroup>
Index: /binary-improvements/AllocsCommands/Commands/Reply.cs
===================================================================
--- /binary-improvements/AllocsCommands/Commands/Reply.cs	(revision 308)
+++ /binary-improvements/AllocsCommands/Commands/Reply.cs	(revision 309)
@@ -35,9 +35,5 @@
 				Chat.SendMessage (receiver, _sender, message);
 			} else {
-				if (receiver != null) {
-					SdtdConsole.Instance.Output ("The sender of the PM you last received is currently not online.");
-				} else {
-					SdtdConsole.Instance.Output ("You have not received a PM so far.");
-				}
+				SdtdConsole.Instance.Output ("You have not received a PM so far or sender of last received PM is no longer online.");
 			}
 		}
Index: /binary-improvements/AllocsCommands/ModInfo.xml
===================================================================
--- /binary-improvements/AllocsCommands/ModInfo.xml	(revision 308)
+++ /binary-improvements/AllocsCommands/ModInfo.xml	(revision 309)
@@ -5,5 +5,5 @@
 		<Description value="Additional commands for server operation" />
 		<Author value="Christian 'Alloc' Illy" />
-		<Version value="13" />
+		<Version value="14" />
 		<Website value="http://7dtd.illy.bz" />
 	</ModInfo>
Index: /binary-improvements/AllocsCommands/PrivateMessageConnections.cs
===================================================================
--- /binary-improvements/AllocsCommands/PrivateMessageConnections.cs	(revision 308)
+++ /binary-improvements/AllocsCommands/PrivateMessageConnections.cs	(revision 309)
@@ -1,4 +1,5 @@
 using System;
 using System.Collections.Generic;
+using Steamworks;
 
 namespace AllocsFixes.CustomCommands
@@ -6,18 +7,18 @@
 	public class PrivateMessageConnections
 	{
-		private static Dictionary<ClientInfo, ClientInfo> senderOfLastPM = new Dictionary<ClientInfo, ClientInfo> ();
+		private static Dictionary<CSteamID, CSteamID> senderOfLastPM = new Dictionary<CSteamID, CSteamID> ();
 
 		public static void SetLastPMSender (ClientInfo _sender, ClientInfo _receiver)
 		{
-			if (senderOfLastPM.ContainsKey (_receiver))
-				senderOfLastPM [_receiver] = _sender;
-			else
-				senderOfLastPM.Add (_receiver, _sender);
+			senderOfLastPM [_receiver.steamId] = _sender.steamId;
 		}
 
 		public static ClientInfo GetLastPMSenderForPlayer (ClientInfo _player)
 		{
-			if (senderOfLastPM.ContainsKey (_player))
-				return senderOfLastPM [_player];
+			if (senderOfLastPM.ContainsKey (_player.steamId)) {
+				CSteamID recSteamId = senderOfLastPM [_player.steamId];
+				ClientInfo recInfo = ConnectionManager.Instance.GetClientInfoForSteamId (recSteamId);
+				return recInfo;
+			}
 			return null;
 		}
Index: /binary-improvements/MapRendering/ModInfo.xml
===================================================================
--- /binary-improvements/MapRendering/ModInfo.xml	(revision 308)
+++ /binary-improvements/MapRendering/ModInfo.xml	(revision 309)
@@ -5,5 +5,5 @@
 		<Description value="Render the game map to image map tiles as it is uncovered" />
 		<Author value="Christian 'Alloc' Illy" />
-		<Version value="20" />
+		<Version value="21" />
 		<Website value="http://7dtd.illy.bz" />
 	</ModInfo>
Index: /binary-improvements/MapRendering/Web/API/GetPlayerList.cs
===================================================================
--- /binary-improvements/MapRendering/Web/API/GetPlayerList.cs	(revision 308)
+++ /binary-improvements/MapRendering/Web/API/GetPlayerList.cs	(revision 309)
@@ -67,5 +67,5 @@
 
 					pJson.Add ("totalplaytime", new JSONNumber (p.TotalPlayTime));
-					pJson.Add ("lastonline", new JSONString (p.LastOnline.ToUniversalTime ().ToString ("s")));
+					pJson.Add ("lastonline", new JSONString (p.LastOnline.ToUniversalTime ().ToString ("yyyy-MM-ddTHH:mm:ssZ")));
 					pJson.Add ("ping", new JSONNumber (p.IsOnline ? p.ClientInfo.ping : -1));
 
Index: /binary-improvements/MapRendering/Web/API/GetPlayersOnline.cs
===================================================================
--- /binary-improvements/MapRendering/Web/API/GetPlayersOnline.cs	(revision 308)
+++ /binary-improvements/MapRendering/Web/API/GetPlayersOnline.cs	(revision 309)
@@ -26,5 +26,5 @@
 				p.Add ("steamid", new JSONString (ci.playerId));
 				p.Add ("entityid", new JSONNumber (ci.entityId));
-				p.Add ("ip", new JSONString (ci != null ? ci.ip : string.Empty));
+				p.Add ("ip", new JSONString (ci.ip));
 				p.Add ("name", new JSONString (current.Value.EntityName));
 				p.Add ("online", new JSONBoolean (true));
Index: /binary-improvements/MapRendering/Web/API/WebAPI.cs
===================================================================
--- /binary-improvements/MapRendering/Web/API/WebAPI.cs	(revision 308)
+++ /binary-improvements/MapRendering/Web/API/WebAPI.cs	(revision 309)
@@ -9,5 +9,7 @@
 		public static void WriteJSON (HttpListenerResponse resp, JSON.JSONNode root)
 		{
-			byte[] buf = Encoding.UTF8.GetBytes (root.ToString());
+			StringBuilder sb = new StringBuilder ();
+			root.ToString (sb);
+			byte[] buf = Encoding.UTF8.GetBytes (sb.ToString ());
 			resp.ContentLength64 = buf.Length;
 			resp.ContentType = "application/json";
Index: /binary-improvements/MapRendering/Web/Handlers/UserStatusHandler.cs
===================================================================
--- /binary-improvements/MapRendering/Web/Handlers/UserStatusHandler.cs	(revision 308)
+++ /binary-improvements/MapRendering/Web/Handlers/UserStatusHandler.cs	(revision 309)
@@ -28,13 +28,5 @@
 			result.Add ("permissions", perms);
 
-			WriteJSON (resp, result);
-		}
-
-		public void WriteJSON (HttpListenerResponse resp, 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);
+			AllocsFixes.NetConnections.Servers.Web.API.WebAPI.WriteJSON (resp, result);
 		}
 
Index: /binary-improvements/MapRendering/Web/Web.cs
===================================================================
--- /binary-improvements/MapRendering/Web/Web.cs	(revision 308)
+++ /binary-improvements/MapRendering/Web/Web.cs	(revision 309)
@@ -78,5 +78,5 @@
 									dataFolder,
 									new AllocsFixes.FileCache.SimpleCache (),
-									true)
+									false)
 					);
 				} else {
@@ -87,5 +87,5 @@
 									dataFolder,
 									new AllocsFixes.FileCache.DirectAccess (),
-									true)
+									false)
 					);
 				}
@@ -185,5 +185,6 @@
 					}
 
-					Log.Out ("Error in Web.HandleRequest(): No handler found for path \"" + request.Url.AbsolutePath + "\"");
+					// Not really relevant for non-debugging purposes:
+					//Log.Out ("Error in Web.HandleRequest(): No handler found for path \"" + request.Url.AbsolutePath + "\"");
 					response.StatusCode = (int)HttpStatusCode.NotFound;
 				} catch (IOException e) {
Index: /binary-improvements/MapRendering/Web/WebCommandResult.cs
===================================================================
--- /binary-improvements/MapRendering/Web/WebCommandResult.cs	(revision 308)
+++ /binary-improvements/MapRendering/Web/WebCommandResult.cs	(revision 309)
@@ -47,7 +47,7 @@
 			}
 
-			response.SendChunked = false;
+			try {
+				response.SendChunked = false;
 
-			try {
 				if (responseType == ResultType.Raw) {
 					WebAPI.WriteText (response, sb.ToString ());
Index: /binary-improvements/bundle_creation/makefile
===================================================================
--- /binary-improvements/bundle_creation/makefile	(revision 308)
+++ /binary-improvements/bundle_creation/makefile	(revision 309)
@@ -1,3 +1,3 @@
-HOST=178.63.97.203
+HOST=136.243.11.25
 PORT=51010
 SERVERPATH=/srv/www/illy.bz/http/fi/7dtd/
