Index: nary-improvements/7dtd-server-fixes/src/AllocsNetTelnetServer.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/AllocsNetTelnetServer.cs	(revision 131)
+++ 	(revision )
@@ -1,182 +1,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Net;
-using System.Net.Sockets;
-using System.Reflection;
-using System.Threading;
-
-namespace AllocsFixes
-{
-	public class AllocsNetTelnetServer
-	{
-		private static Thread telnetThread = null;
-		private static TcpListener listener = null;
-		private static bool closed = false;
-		private static bool authEnabled = false;
-		private static List<AllocsTelnetConnection> connections = new List<AllocsTelnetConnection> ();
-
-		public static void init (int port)
-		{
-			try {
-				Log.Out ("[7dtd-server-fixes by Alloc] Version: " + Assembly.GetExecutingAssembly ().GetName ().Version);
-				authEnabled = GamePrefs.GetString (EnumGamePrefs.TelnetPassword).Length != 0;
-				if (authEnabled)
-					listener = new TcpListener (IPAddress.Any, port);
-				else
-					listener = new TcpListener (IPAddress.Loopback, port);
-				telnetThread = ThreadMaster.Create ("thread Allocs TelnetListenThread", new ThreadStart (telnetListenThread));
-				telnetThread.Start ();
-				Log.Out ("Started Allocs NetTelnetServer thread on " + port);
-			} catch (Exception e) {
-				Log.Out ("Error in AllocsTelnetServer.init: " + e);
-			}
-		}
-
-		private static void telnetListenThread ()
-		{
-			try {
-				Log.Out ("Started thread_Allocs_TelnetListenThread()");
-				listener.Start ();
-				while (!closed) {
-					Thread.Sleep (10);
-					if (listener.Pending ()) {
-						AllocsTelnetConnection c = new AllocsTelnetConnection (listener.AcceptTcpClient (), authEnabled);
-						connections.Add (c);
-						Log.Out ("Telnet connection from: " + c.GetEndPoint ());
-						if (authEnabled) {
-							c.WriteLine ("Please enter password:");
-						} else {
-							LoginMessage (c);
-						}
-					}
-
-					foreach (AllocsTelnetConnection c in connections) {
-						if (c.IsClosed ()) {
-							c.Close ();
-							connections.Remove (c);
-							break;
-						}
-						if (c.Read ()) {
-							string line = lineCorrecter (c.GetLine ());
-							if (!c.IsAuthenticated ()) {
-								if (line.Equals (GamePrefs.GetString (EnumGamePrefs.TelnetPassword))) {
-									c.SetAuthenticated ();
-									c.WriteLine ("Logon successful.");
-									c.WriteLine (string.Empty);
-									c.WriteLine (string.Empty);
-									c.WriteLine (string.Empty);
-									LoginMessage (c);
-								} else {
-									c.WriteLine ("Password incorrect, please enter password:");
-								}
-							} else {
-								if (line.ToLower ().Equals ("exit")) {
-									Log.Out ("Telnet connection closed by client: " + c.GetEndPoint ());
-									c.Close ();
-									connections.Remove (c);
-									break;
-								}
-								Log.Out ("Telnet executed \"" + line + "\" from: " + c.GetEndPoint ());
-								ConsoleOutputSeparator.QueueTelnetCommand (line, c);
-							}
-						}
-					}
-				}
-				Log.Out ("Exited thread_Allocs_TelnetListenThread()");
-				ThreadMaster.Remove (Thread.CurrentThread.Name);
-			} catch (Exception ex) {
-				Log.Out ("Error in Allocs telnetListenThread: " + ex.Message);
-				Log.Out ("Stack Trace: " + ex.StackTrace);
-			}
-		}
-
-		private static void LoginMessage (AllocsTelnetConnection c)
-		{
-			c.WriteLine ("*** Connected with 7DTD server.");
-			c.WriteLine ("*** Dedicated server only build");
-			c.WriteLine ("*** Allocs server fixes loaded");
-			c.WriteLine (string.Empty);
-			c.WriteLine ("Server IP:   " + 
-				((GamePrefs.GetString (EnumGamePrefs.ServerIP) != null && GamePrefs.GetString (EnumGamePrefs.ServerIP).Length != 0) ? GamePrefs.GetString (EnumGamePrefs.ServerIP) : "Any")
-			);
-			c.WriteLine ("Server port: " + GamePrefs.GetInt (EnumGamePrefs.ServerPort));
-			c.WriteLine ("Max players: " + GamePrefs.GetInt (EnumGamePrefs.ServerMaxPlayerCount));
-			c.WriteLine ("Game mode:   " + GamePrefs.GetString (EnumGamePrefs.GameMode));
-			c.WriteLine ("World:       " + GamePrefs.GetString (EnumGamePrefs.GameWorld));
-			c.WriteLine ("Game name:   " + GamePrefs.GetString (EnumGamePrefs.GameName));
-			c.WriteLine ("Difficulty:  " + GamePrefs.GetInt (EnumGamePrefs.GameDifficulty));
-			c.WriteLine (string.Empty);
-			c.WriteLine ("Press 'help' to get a list of all commands. Press 'exit' to end session.");
-			c.WriteLine (string.Empty);
-		}
-
-		private static string lineCorrecter (string line)
-		{
-			string res = "";
-			for (int i = 0; i < line.Length; i++) {
-				if (line [i] >= ' ' && line [i] != '\'' && line [i] <= '~') {
-					res += line [i];
-				}
-			}
-			return res.Trim ();
-		}
-
-		public static void Disconnect ()
-		{
-			try {
-				closed = true;
-				if (listener != null) {
-					listener.Stop ();
-				}
-				foreach (AllocsTelnetConnection c in connections) {
-					c.Close ();
-				}
-				Thread.Sleep (100);
-			} catch (Exception e) {
-				Log.Out ("Error in AllocsTelnetServer.Disconnect: " + e);
-			}
-		}
-
-		public static void SetConsole (ConsoleSdtd console)
-		{
-		}
-
-		private static void RemoveClosedConnections ()
-		{
-			try {
-				foreach (AllocsTelnetConnection c in connections) {
-					if (c.IsClosed ()) {
-						c.Close ();
-					}
-				}
-			} catch (Exception e) {
-				Log.Out ("Error in AllocsTelnetServer.RemoveClosedConnections: " + e);
-			}
-		}
-
-		public static void WriteToClient (string line)
-		{
-			if (line == null) {
-				return;
-			}
-			RemoveClosedConnections ();
-			foreach (AllocsTelnetConnection c in connections) {
-				if (c.IsAuthenticated ())
-					c.WriteLine (line);
-			}
-		}
-
-		public static void WriteToClient_Single (string line, AllocsTelnetConnection client)
-		{
-			if (line == null) {
-				return;
-			}
-			RemoveClosedConnections ();
-			foreach (AllocsTelnetConnection c in connections) {
-				if (c.IsAuthenticated () && (c == client))
-					c.WriteLine (line);
-			}
-		}
-	}
-}
Index: nary-improvements/7dtd-server-fixes/src/AllocsTelnetConnection.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/AllocsTelnetConnection.cs	(revision 131)
+++ 	(revision )
@@ -1,97 +1,0 @@
-using System;
-using System.Net;
-using System.Net.Sockets;
-
-namespace AllocsFixes
-{
-public class AllocsTelnetConnection
-{
-	private bool authenticated = false;
-	private bool authEnabled;
-	private TcpClient client;
-	private NetworkStream stream;
-	private string lineBuffer = string.Empty;
-	private EndPoint endpoint;
-
-	public AllocsTelnetConnection (TcpClient client, bool authEnabled)
-	{
-		this.authEnabled = authEnabled;
-		this.client = client;
-		this.stream = client.GetStream ();
-		this.endpoint = client.Client.RemoteEndPoint;
-	}
-
-	public EndPoint GetEndPoint ()
-	{
-		return endpoint;
-	}
-
-	private void WriteByte (byte v)
-	{
-		if (!IsClosed () && stream.CanWrite) {
-			stream.WriteByte (v);
-		}
-	}
-
-	public void WriteLine (string s)
-	{
-		try {
-			if (!IsClosed () && stream.CanWrite) {
-				for (int i = 0; i < s.Length; i++) {
-					WriteByte ((byte)s [i]);
-				}
-				WriteByte(13);
-				WriteByte (10);
-			}
-		} catch (Exception e) {
-			Log.Out("Error writing to client: " + e);
-		}
-	}
-
-	public void Close ()
-	{
-		if (client != null)
-			client.Close ();
-		client = null;
-	}
-
-	public bool IsClosed ()
-	{
-		if (client != null && !client.Connected) {
-			Log.Out ("Telnet connection interrupted: " + endpoint);
-		}
-		return (client == null) || (!client.Connected);
-	}
-
-	public bool IsAuthenticated ()
-	{
-		return !authEnabled || authenticated;
-	}
-
-	public void SetAuthenticated ()
-	{
-		authenticated = true;
-	}
-
-	public bool Read ()
-	{
-		while (!IsClosed() && stream.CanRead && stream.DataAvailable) {
-			int b = stream.ReadByte ();
-			if (b == '\r' || b == '\n') {
-				if (lineBuffer.Length > 0)
-					return true;
-			} else {
-				lineBuffer += (char)b;
-			}
-		}
-		return false;
-	}
-
-	public string GetLine ()
-	{
-		string res = lineBuffer;
-		lineBuffer = string.Empty;
-		return res;
-	}
-}
-}
Index: nary-improvements/7dtd-server-fixes/src/ConsoleOutputSeparator.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/ConsoleOutputSeparator.cs	(revision 131)
+++ 	(revision )
@@ -1,87 +1,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using UnityEngine;
-
-namespace AllocsFixes
-{
-	public class ConsoleOutputSeparator
-	{
-		public struct AllocsTelnetCommand
-		{
-			public string command;
-			public AllocsTelnetConnection client;
-
-			public AllocsTelnetCommand (string _cmd, AllocsTelnetConnection _client)
-			{
-				command = _cmd;
-				client = _client;
-			}
-		}
-
-		private static List<AllocsTelnetCommand> telnetCommandQueue = new List<AllocsTelnetCommand> ();
-		private static bool isCurrentCommandFromClient = false;
-		private static AllocsTelnetConnection issuerOfCurrentTelnetCommand;
-
-		public static void C_ExecuteCmdFromClient (ConsoleSdtd console, NetworkPlayer _networkPlayer, string _playerID, string _command)
-		{
-			Log.Out ("Executed command \"" + _command + "\" from player \"" + _playerID + "\"");
-
-			object obj = telnetCommandQueue;
-			Monitor.Enter (obj);
-			try {
-				isCurrentCommandFromClient = true;
-				console.issuerOfCurrentClientCommand = _networkPlayer;
-				console.ExecuteClientCmdInternal (_playerID, _command);
-				isCurrentCommandFromClient = false;
-			} finally {
-				Monitor.Exit (obj);
-			}
-
-		}
-
-		public static void C_SendResult (ConsoleSdtd console, string _line)
-		{
-			if (isCurrentCommandFromClient) {
-				console.gameManager.GetRPCNetworkView ().RPC ("RPC_Console", console.issuerOfCurrentClientCommand, new object[]
-			{
-				_line,
-				false
-			}
-				);
-			} else {
-				if (console.telnetServer != null && issuerOfCurrentTelnetCommand != null)
-					AllocsNetTelnetServer.WriteToClient_Single (_line, issuerOfCurrentTelnetCommand);
-				else if (ControlPanel.IsStarted ())
-					ControlPanel.AddTextToOutputBuffer (_line);
-			}
-		}
-
-		public static void C_Run (ConsoleSdtd console)
-		{
-			if (telnetCommandQueue.Count > 0) {
-				object obj = telnetCommandQueue;
-				Monitor.Enter (obj);
-				try {
-					issuerOfCurrentTelnetCommand = telnetCommandQueue [0].client;
-					console.ExecuteRemoteCmdInternal (telnetCommandQueue [0].command, false);
-					telnetCommandQueue.RemoveAt (0);
-					issuerOfCurrentTelnetCommand = null;
-				} finally {
-					Monitor.Exit (obj);
-				}
-			}
-		}
-
-		public static void QueueTelnetCommand (string _line, AllocsTelnetConnection _con)
-		{
-			object obj = telnetCommandQueue;
-			Monitor.Enter (obj);
-			try {
-				telnetCommandQueue.Add (new AllocsTelnetCommand (_line, _con));
-			} finally {
-				Monitor.Exit (obj);
-			}
-		}
-	}
-}
Index: /binary-improvements/7dtd-server-fixes/src/MapRendering/MapRendering.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/MapRendering/MapRendering.cs	(revision 131)
+++ /binary-improvements/7dtd-server-fixes/src/MapRendering/MapRendering.cs	(revision 132)
@@ -24,11 +24,9 @@
 		private MapRenderBlockBuffer[] zoomLevelBuffers = new MapRenderBlockBuffer[Constants.ZOOMLEVELS];
 		private Color[] chunkColors = new Color[Constants.MAP_CHUNK_SIZE * Constants.MAP_CHUNK_SIZE];
-		private System.Timers.Timer chunkSaveTimer = new System.Timers.Timer (100);
+		private System.Timers.Timer chunkSaveTimer = new System.Timers.Timer (500);
 		private bool renderingFullMap = false;
 
 		private MapRendering ()
 		{
-			string regionSaveDir = StaticDirectories.GetSaveGameRegionDir ();
-			rfm = new RegionFileManager (regionSaveDir, regionSaveDir, 1, false);
 			Constants.MAP_DIRECTORY = StaticDirectories.GetSaveGameDir () + "/map";
 
@@ -64,4 +62,7 @@
 			MicroStopwatch microStopwatch = new MicroStopwatch ();
 
+			string regionSaveDir = StaticDirectories.GetSaveGameRegionDir ();
+			rfm = new RegionFileManager (regionSaveDir, regionSaveDir, 1, false);
+
 			if (Directory.Exists (Constants.MAP_DIRECTORY))
 				Directory.Delete (Constants.MAP_DIRECTORY, true);
@@ -88,4 +89,6 @@
 			}
 			SaveAllBlockMaps (null, null);
+
+			rfm = null;
 
 			byte[] array = fullMapTexture.EncodeToPNG ();
Index: /binary-improvements/7dtd-server-fixes/src/NetConnections/ConsoleOutputSeparator.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/NetConnections/ConsoleOutputSeparator.cs	(revision 132)
+++ /binary-improvements/7dtd-server-fixes/src/NetConnections/ConsoleOutputSeparator.cs	(revision 132)
@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using UnityEngine;
+
+namespace AllocsFixes.NetConnections
+{
+	public class ConsoleOutputSeparator
+	{
+		public struct NetCommand
+		{
+			public string command;
+			public IConnection client;
+
+			public NetCommand (string _cmd, IConnection _client)
+			{
+				command = _cmd;
+				client = _client;
+			}
+		}
+
+		private static List<NetCommand> netCommandQueue = new List<NetCommand> ();
+		private static bool isCurrentCommandFromClient = false;
+		private static IConnection issuerOfCurrentCommand;
+
+		public static void C_ExecuteCmdFromClient (ConsoleSdtd console, NetworkPlayer _networkPlayer, string _playerID, string _command)
+		{
+			Log.Out ("Executed command \"" + _command + "\" from player \"" + _playerID + "\"");
+
+			object obj = netCommandQueue;
+			Monitor.Enter (obj);
+			try {
+				isCurrentCommandFromClient = true;
+				console.issuerOfCurrentClientCommand = _networkPlayer;
+				console.ExecuteClientCmdInternal (_playerID, _command);
+				isCurrentCommandFromClient = false;
+			} finally {
+				Monitor.Exit (obj);
+			}
+
+		}
+
+		public static void C_SendResult (ConsoleSdtd console, string _line)
+		{
+			if (isCurrentCommandFromClient) {
+				console.gameManager.GetRPCNetworkView ().RPC ("RPC_Console", console.issuerOfCurrentClientCommand, new object[]
+			{
+				_line,
+				false
+			}
+				);
+			} else {
+				if (console.telnetServer != null && issuerOfCurrentCommand != null)
+					NetTelnetServer.WriteToClient_Single (_line, issuerOfCurrentCommand);
+				else if (ControlPanel.IsStarted ())
+					ControlPanel.AddTextToOutputBuffer (_line);
+			}
+		}
+
+		public static void C_Run (ConsoleSdtd console)
+		{
+			if (netCommandQueue.Count > 0) {
+				object obj = netCommandQueue;
+				Monitor.Enter (obj);
+				try {
+					issuerOfCurrentCommand = netCommandQueue [0].client;
+					console.ExecuteRemoteCmdInternal (netCommandQueue [0].command, false);
+					netCommandQueue.RemoveAt (0);
+					issuerOfCurrentCommand = null;
+				} finally {
+					Monitor.Exit (obj);
+				}
+			}
+		}
+
+		public static void QueueNetCommand (string _line, IConnection _con)
+		{
+			object obj = netCommandQueue;
+			Monitor.Enter (obj);
+			try {
+				netCommandQueue.Add (new NetCommand (_line, _con));
+			} finally {
+				Monitor.Exit (obj);
+			}
+		}
+	}
+}
Index: /binary-improvements/7dtd-server-fixes/src/NetConnections/IConnection.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/NetConnections/IConnection.cs	(revision 132)
+++ /binary-improvements/7dtd-server-fixes/src/NetConnections/IConnection.cs	(revision 132)
@@ -0,0 +1,9 @@
+using System;
+
+namespace AllocsFixes.NetConnections
+{
+	public interface IConnection
+	{
+	}
+}
+
Index: /binary-improvements/7dtd-server-fixes/src/NetConnections/IServer.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/NetConnections/IServer.cs	(revision 132)
+++ /binary-improvements/7dtd-server-fixes/src/NetConnections/IServer.cs	(revision 132)
@@ -0,0 +1,14 @@
+using System;
+
+namespace AllocsFixes.NetConnections
+{
+	public interface IServer
+	{
+		void Disconnect ();
+
+		void WriteToClient (string line);
+
+		void WriteToClient_Single (string line, IConnection client);
+	}
+}
+
Index: /binary-improvements/7dtd-server-fixes/src/NetConnections/NetTelnetServer.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/NetConnections/NetTelnetServer.cs	(revision 132)
+++ /binary-improvements/7dtd-server-fixes/src/NetConnections/NetTelnetServer.cs	(revision 132)
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Net;
+using System.Net.Sockets;
+using System.Reflection;
+using System.Threading;
+
+namespace AllocsFixes.NetConnections
+{
+	public class NetTelnetServer
+	{
+		private static List<IServer> servers = new List<IServer>();
+
+		public static void init (int port)
+		{
+			try {
+				Log.Out ("[7dtd-server-fixes by Alloc] Version: " + Assembly.GetExecutingAssembly ().GetName ().Version);
+				servers.Add(new Servers.Telnet.Telnet(port));
+			} catch (Exception e) {
+				Log.Out ("Error in AllocsTelnetServer.init: " + e);
+			}
+		}
+
+		public static void SetConsole (ConsoleSdtd console)
+		{
+		}
+
+		public static void Disconnect ()
+		{
+			foreach (IServer s in servers)
+				s.Disconnect();
+		}
+
+		public static void WriteToClient (string line)
+		{
+			if (line == null) {
+				return;
+			}
+			foreach (IServer s in servers)
+				s.WriteToClient(line);
+		}
+
+		public static void WriteToClient_Single (string line, IConnection client)
+		{
+			if (line == null) {
+				return;
+			}
+			foreach (IServer s in servers)
+				s.WriteToClient_Single(line, client);
+		}
+	}
+}
Index: /binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Telnet/Telnet.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Telnet/Telnet.cs	(revision 132)
+++ /binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Telnet/Telnet.cs	(revision 132)
@@ -0,0 +1,179 @@
+using System;
+using System.Collections.Generic;
+using System.Net;
+using System.Net.Sockets;
+using System.Threading;
+
+namespace AllocsFixes.NetConnections.Servers.Telnet
+{
+	public class Telnet : IServer
+	{
+		private static Thread telnetThread = null;
+		private static TcpListener listener = null;
+		private static bool closed = false;
+		private static bool authEnabled = false;
+		private static List<TelnetConnection> connections = new List<TelnetConnection> ();
+
+		public Telnet (int port)
+		{
+			try {
+				authEnabled = GamePrefs.GetString (EnumGamePrefs.TelnetPassword).Length != 0;
+				if (authEnabled)
+					listener = new TcpListener (IPAddress.Any, port);
+				else
+					listener = new TcpListener (IPAddress.Loopback, port);
+				telnetThread = ThreadMaster.Create ("thread TelnetListenThread", new ThreadStart (telnetListenThread));
+				telnetThread.Start ();
+				Log.Out ("Started Telnet thread on " + port);
+			} catch (Exception e) {
+				Log.Out ("Error in Telnet.ctor: " + e);
+			}
+		}
+
+		private void telnetListenThread ()
+		{
+			try {
+				Log.Out ("Started thread_TelnetListenThread()");
+				listener.Start ();
+				while (!closed) {
+					Thread.Sleep (10);
+					if (listener.Pending ()) {
+						TelnetConnection c = new TelnetConnection (listener.AcceptTcpClient (), authEnabled);
+						connections.Add (c);
+						Log.Out ("Telnet connection from: " + c.GetEndPoint ());
+						if (authEnabled) {
+							c.WriteLine ("Please enter password:");
+						} else {
+							LoginMessage (c);
+						}
+					}
+
+					foreach (TelnetConnection c in connections) {
+						if (c.IsClosed ()) {
+							c.Close ();
+							connections.Remove (c);
+							break;
+						}
+						if (c.Read ()) {
+							string line = lineCorrecter (c.GetLine ());
+							if (!c.IsAuthenticated ()) {
+								if (line.Equals (GamePrefs.GetString (EnumGamePrefs.TelnetPassword))) {
+									c.SetAuthenticated ();
+									c.WriteLine ("Logon successful.");
+									c.WriteLine (string.Empty);
+									c.WriteLine (string.Empty);
+									c.WriteLine (string.Empty);
+									LoginMessage (c);
+								} else {
+									c.WriteLine ("Password incorrect, please enter password:");
+								}
+							} else {
+								if (line.ToLower ().Equals ("exit")) {
+									Log.Out ("Telnet connection closed by client: " + c.GetEndPoint ());
+									c.Close ();
+									connections.Remove (c);
+									break;
+								}
+								Log.Out ("Telnet executed \"" + line + "\" from: " + c.GetEndPoint ());
+								ConsoleOutputSeparator.QueueNetCommand (line, c);
+							}
+						}
+					}
+				}
+				Log.Out ("Exited thread_TelnetListenThread()");
+				ThreadMaster.Remove (Thread.CurrentThread.Name);
+			} catch (Exception ex) {
+				Log.Out ("Error in TelnetListenThread: " + ex.Message);
+				Log.Out ("Stack Trace: " + ex.StackTrace);
+			}
+		}
+
+		private void LoginMessage (TelnetConnection c)
+		{
+			c.WriteLine ("*** Connected with 7DTD server.");
+			c.WriteLine ("*** Dedicated server only build");
+			c.WriteLine ("*** Allocs server fixes loaded");
+			c.WriteLine (string.Empty);
+			c.WriteLine ("Server IP:   " + 
+				((GamePrefs.GetString (EnumGamePrefs.ServerIP) != null && GamePrefs.GetString (EnumGamePrefs.ServerIP).Length != 0) ? GamePrefs.GetString (EnumGamePrefs.ServerIP) : "Any")
+			);
+			c.WriteLine ("Server port: " + GamePrefs.GetInt (EnumGamePrefs.ServerPort));
+			c.WriteLine ("Max players: " + GamePrefs.GetInt (EnumGamePrefs.ServerMaxPlayerCount));
+			c.WriteLine ("Game mode:   " + GamePrefs.GetString (EnumGamePrefs.GameMode));
+			c.WriteLine ("World:       " + GamePrefs.GetString (EnumGamePrefs.GameWorld));
+			c.WriteLine ("Game name:   " + GamePrefs.GetString (EnumGamePrefs.GameName));
+			c.WriteLine ("Difficulty:  " + GamePrefs.GetInt (EnumGamePrefs.GameDifficulty));
+			c.WriteLine (string.Empty);
+			c.WriteLine ("Press 'help' to get a list of all commands. Press 'exit' to end session.");
+			c.WriteLine (string.Empty);
+		}
+
+		private string lineCorrecter (string line)
+		{
+			string res = "";
+			for (int i = 0; i < line.Length; i++) {
+				if (line [i] >= ' ' && line [i] != '\'' && line [i] <= '~') {
+					res += line [i];
+				}
+			}
+			return res.Trim ();
+		}
+
+		public void Disconnect ()
+		{
+			try {
+				closed = true;
+				if (listener != null) {
+					listener.Stop ();
+				}
+				foreach (TelnetConnection c in connections) {
+					c.Close ();
+				}
+				Thread.Sleep (100);
+			} catch (Exception e) {
+				Log.Out ("Error in Telnet.Disconnect: " + e);
+			}
+		}
+
+		private void RemoveClosedConnections ()
+		{
+			try {
+				foreach (TelnetConnection c in connections) {
+					if (c.IsClosed ()) {
+						c.Close ();
+					}
+				}
+			} catch (Exception e) {
+				Log.Out ("Error in Telnet.RemoveClosedConnections: " + e);
+			}
+		}
+
+		public void WriteToClient (string line)
+		{
+			if (line == null) {
+				return;
+			}
+			RemoveClosedConnections ();
+			foreach (TelnetConnection c in connections) {
+				if (c.IsAuthenticated ())
+					c.WriteLine (line);
+			}
+		}
+
+		public void WriteToClient_Single (string line, IConnection client)
+		{
+			if (line == null) {
+				return;
+			}
+			RemoveClosedConnections ();
+			foreach (TelnetConnection con in connections) {
+				if (con == client) {
+					if (con.IsAuthenticated ())
+						con.WriteLine (line);
+				}
+			}
+		}
+
+	}
+}
+
Index: /binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Telnet/TelnetConnection.cs
===================================================================
--- /binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Telnet/TelnetConnection.cs	(revision 132)
+++ /binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Telnet/TelnetConnection.cs	(revision 132)
@@ -0,0 +1,98 @@
+using System;
+using System.Net;
+using System.Net.Sockets;
+
+namespace AllocsFixes.NetConnections.Servers.Telnet
+{
+	public class TelnetConnection : IConnection
+	{
+		private bool authenticated = false;
+		private bool authEnabled;
+		private TcpClient client;
+		private NetworkStream stream;
+		private string lineBuffer = string.Empty;
+		private EndPoint endpoint;
+
+		public TelnetConnection (TcpClient client, bool authEnabled)
+		{
+			this.authEnabled = authEnabled;
+			this.client = client;
+			this.stream = client.GetStream ();
+			this.endpoint = client.Client.RemoteEndPoint;
+		}
+
+		public EndPoint GetEndPoint ()
+		{
+			return endpoint;
+		}
+
+		private void WriteByte (byte v)
+		{
+			if (!IsClosed () && stream.CanWrite) {
+				stream.WriteByte (v);
+			}
+		}
+
+		public void WriteLine (string s)
+		{
+			try {
+				if (!IsClosed () && stream.CanWrite) {
+					for (int i = 0; i < s.Length; i++) {
+						WriteByte ((byte)s [i]);
+					}
+					WriteByte (13);
+					WriteByte (10);
+				}
+			} catch (Exception e) {
+				Log.Out ("Error writing to client: " + e);
+			}
+		}
+
+		public void Close ()
+		{
+			if (client != null)
+				client.Close ();
+			client = null;
+		}
+
+		public bool IsClosed ()
+		{
+			if (client != null && !client.Connected) {
+				Log.Out ("Telnet connection interrupted: " + endpoint);
+			}
+			return (client == null) || (!client.Connected);
+		}
+
+		public bool IsAuthenticated ()
+		{
+			return !authEnabled || authenticated;
+		}
+
+		public void SetAuthenticated ()
+		{
+			authenticated = true;
+		}
+
+		public bool Read ()
+		{
+			while (!IsClosed() && stream.CanRead && stream.DataAvailable) {
+				int b = stream.ReadByte ();
+				if (b == '\r' || b == '\n') {
+					if (lineBuffer.Length > 0)
+						return true;
+				} else {
+					lineBuffer += (char)b;
+				}
+			}
+			return false;
+		}
+
+		public string GetLine ()
+		{
+			string res = lineBuffer;
+			lineBuffer = string.Empty;
+			return res;
+		}
+
+	}
+}
