Index: binary-improvements/7dtd-server-fixes/src/API.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/API.cs	(revision 230)
+++ binary-improvements/7dtd-server-fixes/src/API.cs	(revision 230)
@@ -0,0 +1,31 @@
+using System;
+
+namespace AllocsFixes
+{
+	public class API : ModApiAbstract {
+
+		public override void GameAwake () {
+			StateManager.Awake ();
+		}
+
+		public override void GameShutdown () {
+			StateManager.Shutdown ();
+		}
+		
+		public override void SavePlayerData (int _clientId, PlayerDataFile _playerDataFile) {
+		}
+
+		public override void PlayerLogin (int _clientId, string _name, string _playerId, string _token, string _compatibilityVersion) {
+		}
+		
+		public override void PlayerSpawning (int _clientId, string _name, int _chunkViewDim, PlayerProfile _playerProfile) {
+			AllocsLogFunctions.RequestToSpawnPlayer (_clientId, _name, _chunkViewDim, _playerProfile);
+		}
+		
+		public override void PlayerDisconnected (ClientInfo _cInfo, bool _bShutdown) {
+			AllocsLogFunctions.PlayerDisconnected (_cInfo, _bShutdown);
+		}
+
+	}
+}
+
Index: binary-improvements/7dtd-server-fixes/src/AllocsLogFunctions.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/AllocsLogFunctions.cs	(revision 228)
+++ binary-improvements/7dtd-server-fixes/src/AllocsLogFunctions.cs	(revision 230)
@@ -8,29 +8,18 @@
 	public class AllocsLogFunctions
 	{
-		public static void RequestToSpawnPlayer (GameManager manager, int _clientId, string _name, int _chunkViewDim, PlayerProfile _playerProfile)
+		public static void RequestToSpawnPlayer (int _clientId, string _name, int _chunkViewDim, PlayerProfile _playerProfile)
 		{
 			try {
-				ClientInfo ci = CommonMappingFunctions.GetClientInfoFromClientID (_clientId);
-				int entityId = CommonMappingFunctions.GetEntityID (ci);
-				EntityPlayer ep = CommonMappingFunctions.GetEntityPlayer (ci);
-				string steamId = CommonMappingFunctions.GetSteamID (ci);
-
-				string ip = ci.ip;
-				string name = string.Empty;
-
-				if (ep != null)
-					name = ep.EntityName;
+				ClientInfo ci = ConnectionManager.Instance.GetClient (_clientId);
 
 				Log.Out ("Player connected, clientid=" + _clientId +
-					", entityid=" + entityId +
-					", name=" + name +
-					", steamid=" + steamId +
-					", ip=" + ip
+					", entityid=" + ci.entityId +
+					", name=" + ci.playerName +
+					", steamid=" + ci.playerId +
+					", ip=" + ci.ip
 				);
 
-				PersistentContainer.Instance.Players [steamId].SetOnline (ci);
+				PersistentContainer.Instance.Players [ci.playerId].SetOnline (ci);
 				PersistentData.PersistentContainer.Instance.Save ();
-
-				Mods.CallRequestToSpawnPlayer (_clientId, _name, _chunkViewDim, _playerProfile);
 			} catch (Exception e) {
 				Log.Out ("Error in AllocsLogFunctions.RequestToSpawnPlayer: " + e);
@@ -38,5 +27,5 @@
 		}
 
-		public static void PlayerDisconnected (ConnectionManager manager, ClientInfo _cInfo, bool _bShutdown)
+		public static void PlayerDisconnected (ClientInfo _cInfo, bool _bShutdown)
 		{
 			try {
@@ -48,6 +37,4 @@
 				}
 				PersistentData.PersistentContainer.Instance.Save ();
-
-				Mods.CallPlayerDisconnected (_cInfo, _bShutdown);
 			} catch (Exception e) {
 				Log.Out ("Error in AllocsLogFunctions.PlayerDisconnected: " + e);
Index: binary-improvements/7dtd-server-fixes/src/AssemblyInfo.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/AssemblyInfo.cs	(revision 228)
+++ binary-improvements/7dtd-server-fixes/src/AssemblyInfo.cs	(revision 230)
@@ -18,5 +18,5 @@
 // and "{Major}.{Minor}.{Build}.*" will update just the revision.
 
-[assembly: AssemblyVersion("0.112.*")]
+[assembly: AssemblyVersion("0.113.*")]
 
 // The following attributes are used to specify the signing key for the assembly, 
Index: binary-improvements/7dtd-server-fixes/src/CommandExtensions.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/CommandExtensions.cs	(revision 228)
+++ 	(revision )
@@ -1,39 +1,0 @@
-using AllocsFixes.CustomCommands;
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-
-namespace AllocsFixes
-{
-	public class CommandExtensions
-	{
-		public static void InitCommandExtensions (GameManager manager)
-		{
-			try {
-				ConsoleSdtd cons = manager.m_GUIConsole;
-				Type commandType = typeof (ConsoleCommand);
-
-				Mods.ModData thisMd = new Mods.ModData ();
-				thisMd.assembly = Assembly.GetExecutingAssembly ();
-
-				List<Mods.ModData> mods = Mods.LoadedMods ();
-				mods.Add (thisMd);
-
-				foreach (Mods.ModData md in mods) {
-					foreach (Type t in md.assembly.GetTypes()) {
-						if (t.IsClass && commandType.IsAssignableFrom (t)) {
-							try {
-								ConstructorInfo ctor = t.GetConstructor (new Type[] {typeof(ConsoleSdtd)});
-								cons.AddCommand ((ConsoleCommand)ctor.Invoke (new object[] {cons}));
-							} catch (Exception e) {
-								Log.Out ("Could not register custom command \"" + t.Name + "\": " + e);
-							}
-						}
-					}
-				}
-			} catch (Exception e) {
-				Log.Out ("Error registering custom commands: " + e);
-			}
-		}
-	}
-}
Index: binary-improvements/7dtd-server-fixes/src/CommonMappingFunctions.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/CommonMappingFunctions.cs	(revision 228)
+++ 	(revision )
@@ -1,124 +1,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text.RegularExpressions;
-using Steamworks;
-
-namespace AllocsFixes
-{
-	public class CommonMappingFunctions
-	{
-		public static ConnectionManager GetConnectionManager ()
-		{
-			return ConnectionManager.Instance;
-		}
-
-		public static GameManager GetGameManager ()
-		{
-			return GameManager.Instance;
-		}
-
-		public static string GetPlayerName (ClientInfo _ci)
-		{
-			return _ci.playerName;
-		}
-
-		public static EntityPlayer GetEntityPlayer (ClientInfo _ci)
-		{
-			return GetGameManager ().World.Players.dict [_ci.entityId];
-		}
-
-		public static string GetSteamID (ClientInfo _ci)
-		{
-			return _ci.playerId;
-		}
-
-		public static int GetClientID (ClientInfo _ci)
-		{
-			return _ci.clientId;
-		}
-
-		public static int GetEntityID (ClientInfo _ci)
-		{
-			return _ci.entityId;
-		}
-
-		public static ClientInfo GetClientInfoFromEntityID (int _entityId)
-		{
-			try {
-				ConnectionManager cm = GetConnectionManager ();
-
-				return cm.GetClientInfoForEntityId (_entityId);
-			} catch (Exception e) {
-				Log.Out ("Error getting ClientInfo for entity ID: " + e);
-			}
-			return null;
-		}
-
-		public static ClientInfo GetClientInfoFromClientID (int _clientId)
-		{
-			try {
-				ConnectionManager cm = GetConnectionManager ();
-
-				if (cm.connectedClients.ContainsKey (_clientId))
-					return cm.connectedClients [_clientId];
-				else
-					return null;
-			} catch (Exception e) {
-				Log.Out ("Error getting ClientInfo for client ID: " + e);
-			}
-			return null;
-		}
-
-		public static ClientInfo GetClientInfoFromPlayerName (string _playerName, bool ignoreColorcodes)
-		{
-			try {
-				ConnectionManager cm = GetConnectionManager ();
-
-				_playerName = _playerName.ToLower ();
-				if (ignoreColorcodes) {
-					_playerName = Regex.Replace (_playerName, "\\[[0-9a-fA-F]{6}\\]", "");
-				}
-				foreach (ClientInfo ci in cm.connectedClients.Values) {
-					string curName = GetPlayerName (ci).ToLower ();
-					if (ignoreColorcodes) {
-						curName = Regex.Replace (curName, "\\[[0-9a-fA-F]{6}\\]", "");
-					}
-					if (curName.Equals (_playerName)) {
-						return ci;
-					}
-				}
-			} catch (Exception e) {
-				Log.Out ("Error getting ClientInfo for player name: " + e);
-			}
-			return null;
-		}
-
-		public static ClientInfo GetClientInfoFromNameOrID (string _nameOrId, bool ignoreColorcodes)
-		{
-			try {
-				long tempLong;
-				if (_nameOrId.Length == 17 && long.TryParse (_nameOrId, out tempLong)) {
-					return GetClientInfoFromSteamID (_nameOrId);
-				} else {
-					int entityId = -1;
-					if (int.TryParse (_nameOrId, out entityId)) {
-						ClientInfo ci = GetClientInfoFromEntityID (entityId);
-						if (ci != null)
-							return ci;
-					}
-
-					return GetClientInfoFromPlayerName (_nameOrId, ignoreColorcodes);
-				}
-			} catch (Exception e) {
-				Log.Out ("Error getting ClientInfo for steam ID / entity ID / player name \"" + _nameOrId + "\": " + e);
-			}
-			return null;
-		}
-
-		public static ClientInfo GetClientInfoFromSteamID (string _steamId)
-		{
-			return GetConnectionManager ().GetClientInfoForPlayerId (_steamId);
-		}
-
-	}
-}
Index: binary-improvements/7dtd-server-fixes/src/ModAPI.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/ModAPI.cs	(revision 228)
+++ 	(revision )
@@ -1,32 +1,0 @@
-using System;
-
-namespace AllocsFixes
-{
-	public abstract class ModAPI {
-		public ModAPI () {
-		}
-
-		public abstract string ModName ();
-
-		public abstract string ModVersion ();
-
-		public virtual void GameAwake () {
-		}
-
-		public virtual void GameShutdown () {
-		}
-
-		public virtual void SavePlayerData (int _clientId, PlayerDataFile _playerDataFile) {
-		}
-
-		public virtual void RequestToSpawnPlayer (int _clientId, string _name, int _chunkViewDim, PlayerProfile _playerProfile) {
-		}
-
-		public virtual void PlayerDisconnected (ClientInfo _cInfo, bool _bShutdown) {
-		}
-
-		public virtual void CalcMapColors (Chunk _chunk) {
-		}
-	}
-}
-
Index: binary-improvements/7dtd-server-fixes/src/Mods.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/Mods.cs	(revision 228)
+++ 	(revision )
@@ -1,145 +1,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
-using UnityEngine;
-
-namespace AllocsFixes
-{
-	public static class Mods {
-		public class ModData {
-			public Assembly assembly;
-			public string name;
-			public string version;
-			public ModAPI apiInstance;
-		}
-
-		private static readonly string MOD_PATH = Application.dataPath + "/../Mods";
-		private static Dictionary<string, ModData> loadedMods = new Dictionary<string, ModData> ();
-
-		public static void LoadMods () {
-			if (Directory.Exists (MOD_PATH)) {
-				Log.Out ("Loading mods");
-
-				foreach (string modDir in Directory.GetDirectories (MOD_PATH)) {
-					foreach (string modDll in Directory.GetFiles (modDir, "*.dll")) {
-						try {
-							Assembly assemblyInstance = Assembly.LoadFrom (modDll);
-
-							ModData md = new ModData ();
-							md.assembly = assemblyInstance;
-
-							md.apiInstance = CreateApiInstance (md);
-							if (md.apiInstance == null) {
-								Log.Warning ("DLL does not declare a class of type ModAPI, ignoring");
-								continue;
-							}
-							if (string.IsNullOrEmpty (md.apiInstance.ModName ())) {
-								Log.Warning ("DLL's ModAPI does not override ModName(), ignoring");
-								continue;
-							}
-							if (loadedMods.ContainsKey (md.apiInstance.ModName ())) {
-								Log.Warning ("DLL's ModAPI.ModName() returns name that's already loaded, ignoring");
-								continue;
-							}
-							md.name = md.apiInstance.ModName ();
-							md.version = md.apiInstance.ModVersion ();
-
-							loadedMods.Add (md.name, md);
-
-							Log.Out ("Loaded mod: " + md.name + " (" + md.version + ")");
-						} catch (Exception e) {
-							Log.Error ("Failed loading DLL");
-							Log.Exception (e);
-						}
-					}
-				}
-
-				Log.Out ("Loading mods done");
-			} else {
-				Log.Out ("No mods folder found");
-			}
-		}
-
-		public static bool ModLoaded (string _modName) {
-			return loadedMods.ContainsKey (_modName);
-		}
-
-		public static Assembly GetModAssembly (string _modName) {
-			if (ModLoaded (_modName)) {
-				return loadedMods [_modName].assembly;
-			}
-			return null;
-		}
-
-		public static List<ModData> LoadedMods () {
-			List<ModData> res = new List<ModData> ();
-			foreach (ModData md in loadedMods.Values) {
-				res.Add (md);
-			}
-			return res;
-		}
-
-		private static ModAPI CreateApiInstance (ModData _md) {
-			Type modApiType = typeof (ModAPI);
-			foreach (Type t in _md.assembly.GetTypes ()) {
-				if (modApiType.IsAssignableFrom (t)) {
-					Log.Out ("Found ModAPI");
-
-					return Activator.CreateInstance(t) as ModAPI;
-				}
-			}
-			return null;
-		}
-
-		public static void CallGameAwake () {
-			foreach (ModData md in loadedMods.Values) {
-				if (md.apiInstance != null) {
-					md.apiInstance.GameAwake ();
-				}
-			}
-		}
-
-		public static void CallGameShutdown () {
-			foreach (ModData md in loadedMods.Values) {
-				if (md.apiInstance != null) {
-					md.apiInstance.GameShutdown ();
-				}
-			}
-		}
-
-		public static void CallSavePlayerData (int _clientId, PlayerDataFile _playerDataFile) {
-			foreach (ModData md in loadedMods.Values) {
-				if (md.apiInstance != null) {
-					md.apiInstance.SavePlayerData (_clientId, _playerDataFile);
-				}
-			}
-		}
-
-		public static void CallRequestToSpawnPlayer (int _clientId, string _name, int _chunkViewDim, PlayerProfile _playerProfile) {
-			foreach (ModData md in loadedMods.Values) {
-				if (md.apiInstance != null) {
-					md.apiInstance.RequestToSpawnPlayer (_clientId, _name, _chunkViewDim, _playerProfile);
-				}
-			}
-		}
-
-		public static void CallPlayerDisconnected (ClientInfo _cInfo, bool _bShutdown) {
-			foreach (ModData md in loadedMods.Values) {
-				if (md.apiInstance != null) {
-					md.apiInstance.PlayerDisconnected (_cInfo, _bShutdown);
-				}
-			}
-		}
-
-		public static void CallCalcMapColors (Chunk _chunk) {
-			foreach (ModData md in loadedMods.Values) {
-				if (md.apiInstance != null) {
-					md.apiInstance.CalcMapColors (_chunk);
-				}
-			}
-		}
-
-	
-	}
-}
Index: binary-improvements/7dtd-server-fixes/src/PersistentData/PersistentContainer.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/PersistentData/PersistentContainer.cs	(revision 228)
+++ binary-improvements/7dtd-server-fixes/src/PersistentData/PersistentContainer.cs	(revision 230)
@@ -54,5 +54,6 @@
 					return true;
 				} catch (Exception e) {
-					Log.Out ("Exception in PersistentContainer.Load: " + e.Message);
+					Log.Error ("Exception in PersistentContainer.Load");
+					Log.Exception (e);
 				}
 			}
Index: binary-improvements/7dtd-server-fixes/src/PersistentData/Player.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/PersistentData/Player.cs	(revision 228)
+++ binary-improvements/7dtd-server-fixes/src/PersistentData/Player.cs	(revision 230)
@@ -59,5 +59,5 @@
 			get {
 				if (IsOnline) {
-					return CommonMappingFunctions.GetEntityPlayer (clientInfo);
+					return GameManager.Instance.World.Players.dict [clientInfo.entityId];
 				} else {
 					return null;
@@ -116,6 +116,6 @@
 			Log.Out ("Player set to online: " + steamId);
 			clientInfo = ci;
-			entityId = CommonMappingFunctions.GetEntityID (ci);
-			name = CommonMappingFunctions.GetPlayerName (ci);
+			entityId = ci.entityId;
+			name = ci.playerName;
 			ip = ci.ip;
 		}
Index: binary-improvements/7dtd-server-fixes/src/PlayerDataStuff.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/PlayerDataStuff.cs	(revision 228)
+++ binary-improvements/7dtd-server-fixes/src/PlayerDataStuff.cs	(revision 230)
@@ -11,8 +11,6 @@
 		{
 			try {
-				ClientInfo ci = CommonMappingFunctions.GetClientInfoFromClientID(_clientId);
-				string steamId = CommonMappingFunctions.GetSteamID(ci);
-				PersistentContainer.Instance.Players[steamId].Inventory.Update(_playerDataFile);
-				Mods.CallSavePlayerData (_clientId, _playerDataFile);
+				ClientInfo ci = ConnectionManager.Instance.GetClient (_clientId);
+				PersistentContainer.Instance.Players[ci.playerId].Inventory.Update(_playerDataFile);
 			} catch (Exception e) {
 				Log.Out ("Error in GM_SavePlayerData: " + e);
Index: binary-improvements/7dtd-server-fixes/src/StateManager.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/StateManager.cs	(revision 228)
+++ binary-improvements/7dtd-server-fixes/src/StateManager.cs	(revision 230)
@@ -1,3 +1,2 @@
-using AllocsFixes.NetConnections.Servers.Telnet;
 using System;
 using System.Reflection;
@@ -7,14 +6,8 @@
 	public class StateManager
 	{
-		public static void Awake (GameManager manager)
+		public static void Awake ()
 		{
 			try {
 				Log.Out ("[7dtd-server-fixes by Alloc] Version: " + Assembly.GetExecutingAssembly ().GetName ().Version);
-
-				Mods.LoadMods ();
-				Mods.CallGameAwake ();
-				CommandExtensions.InitCommandExtensions (manager);
-
-				new Telnet ();
 
 				ItemList.Instance.Init ();
@@ -26,9 +19,8 @@
 		}
 
-		public static void Shutdown (GameManager manager)
+		public static void Shutdown ()
 		{
 			try {
 				Log.Out ("Server shutting down!");
-				Mods.CallGameShutdown ();
 				PersistentData.PersistentContainer.Instance.Save ();
 			} catch (Exception e) {
Index: binary-improvements/7dtd-server-fixes/src/Version.cs
===================================================================
--- binary-improvements/7dtd-server-fixes/src/Version.cs	(revision 228)
+++ 	(revision )
@@ -1,36 +1,0 @@
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-
-namespace AllocsFixes.CustomCommands
-{
-	public class Version : ConsoleCommand
-	{
-		public Version (ConsoleSdtd cons) : base(cons)
-		{
-		}
-
-		public override string Description ()
-		{
-			return "get the currently running version of the server fixes and loaded mods";
-		}
-
-		public override string[] Names ()
-		{
-			return new string[] { "version", string.Empty };
-		}
-
-		public override void Run (string[] _params)
-		{
-			try {
-				m_Console.SendResult ("Versions:");
-				m_Console.SendResult ("Server fixes: " + Assembly.GetExecutingAssembly ().GetName ().Version);
-				foreach (Mods.ModData md in Mods.LoadedMods ()) {
-					m_Console.SendResult ("Mod " + md.name + ": " + md.version);
-				}
-			} catch (Exception e) {
-				Log.Out ("Error in Version.Run: " + e);
-			}
-		}
-	}
-}
