Changeset 230
- Timestamp:
- Apr 18, 2015, 4:27:57 PM (10 years ago)
- Location:
- binary-improvements
- Files:
-
- 21 added
- 17 deleted
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-binaries/README.txt
r224 r230 1 Put the Assembly-CSharp.deobf.dll (output of the Deobfuscator [1]),2 Assembly-CSharp-firstpass.dll, EasyAntiCheat.Client/Server.dll, 3 LogLibrary.dll, mscorlib.dll andUnityEngine.dll in this folder.1 Put the Assembly-CSharp.deobf.dll renamed to Assembly-CSharp.dll (output of 2 the Deobfuscator [1]), LogLibrary.dll, mscorlib.dll, System.dll and 3 UnityEngine.dll in this folder. 4 4 5 5 [1]: https://github.com/DerPopo/deobfuscate-7dtd -
binary-improvements/7dtd-server-fixes/7dtd-server-fixes.csproj
r224 r230 15 15 <DebugType>none</DebugType> 16 16 <Optimize>true</Optimize> 17 <OutputPath>..\bin\ 7DaysToDie_Data\Managed</OutputPath>17 <OutputPath>..\bin\Mods\Allocs_CommonFunc</OutputPath> 18 18 <ErrorReport>prompt</ErrorReport> 19 19 <WarningLevel>4</WarningLevel> … … 23 23 <DebugType>none</DebugType> 24 24 <Optimize>true</Optimize> 25 <OutputPath>..\bin\ 7DaysToDie_Data\Managed</OutputPath>25 <OutputPath>..\bin\Mods\Allocs_CommonFunc</OutputPath> 26 26 <ErrorReport>prompt</ErrorReport> 27 27 <WarningLevel>4</WarningLevel> … … 34 34 </PropertyGroup> 35 35 <ItemGroup> 36 <Reference Include="System" /> 36 <Reference Include="Assembly-CSharp"> 37 <HintPath>..\7dtd-binaries\Assembly-CSharp.dll</HintPath> 38 <Private>False</Private> 39 </Reference> 40 <Reference Include="mscorlib"> 41 <HintPath>..\7dtd-binaries\mscorlib.dll</HintPath> 42 <Private>False</Private> 43 </Reference> 44 <Reference Include="System"> 45 <HintPath>..\7dtd-binaries\System.dll</HintPath> 46 <Private>False</Private> 47 </Reference> 37 48 <Reference Include="UnityEngine"> 38 49 <HintPath>..\7dtd-binaries\UnityEngine.dll</HintPath> 39 </Reference> 40 <Reference Include="EasyAntiCheat.Client"> 41 <HintPath>..\7dtd-binaries\EasyAntiCheat.Client.dll</HintPath> 42 </Reference> 43 <Reference Include="EasyAntiCheat.Server"> 44 <HintPath>..\7dtd-binaries\EasyAntiCheat.Server.dll</HintPath> 45 </Reference> 46 <Reference Include="Assembly-CSharp-firstpass"> 47 <HintPath>..\7dtd-binaries\Assembly-CSharp-firstpass.dll</HintPath> 50 <Private>False</Private> 48 51 </Reference> 49 52 <Reference Include="LogLibrary"> 50 53 <HintPath>..\7dtd-binaries\LogLibrary.dll</HintPath> 51 </Reference> 52 <Reference Include="mscorlib"> 53 <HintPath>..\7dtd-binaries\mscorlib.dll</HintPath> 54 </Reference> 55 <Reference Include="Assembly-CSharp"> 56 <HintPath>..\7dtd-binaries\Assembly-CSharp.dll</HintPath> 54 <Private>False</Private> 57 55 </Reference> 58 56 </ItemGroup> … … 61 59 <Compile Include="src\AllocsLogFunctions.cs" /> 62 60 <Compile Include="src\PlayerDataStuff.cs" /> 63 <Compile Include="src\CommandExtensions.cs" />64 <Compile Include="src\CommonMappingFunctions.cs" />65 <Compile Include="src\NetConnections\ConsoleOutputSeparator.cs" />66 <Compile Include="src\NetConnections\NetTelnetServer.cs" />67 <Compile Include="src\NetConnections\IServer.cs" />68 <Compile Include="src\NetConnections\IConnection.cs" />69 <Compile Include="src\NetConnections\Servers\Telnet\Telnet.cs" />70 <Compile Include="src\NetConnections\Servers\Telnet\TelnetConnection.cs" />71 61 <Compile Include="src\PersistentData\PersistentContainer.cs" /> 72 62 <Compile Include="src\StateManager.cs" /> … … 90 80 <Compile Include="src\FileCache\SimpleCache.cs" /> 91 81 <Compile Include="src\FileCache\MapTileCache.cs" /> 92 <Compile Include="src\Mods.cs" /> 93 <Compile Include="src\ModAPI.cs" /> 94 <Compile Include="src\Version.cs" /> 82 <Compile Include="src\API.cs" /> 95 83 </ItemGroup> 96 84 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> 97 85 <ItemGroup> 98 86 <Folder Include="src\" /> 99 <Folder Include="src\CustomCommands\" />100 <Folder Include="src\NetConnections\" />101 <Folder Include="src\NetConnections\Servers\" />102 <Folder Include="src\NetConnections\Servers\Telnet\" />103 87 <Folder Include="src\PersistentData\" /> 104 88 <Folder Include="src\JSON\Parser\" /> 105 89 <Folder Include="src\FileCache\" /> 106 90 </ItemGroup> 91 <ItemGroup> 92 <None Include="ModInfo.xml"> 93 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 94 </None> 95 </ItemGroup> 107 96 </Project> -
binary-improvements/7dtd-server-fixes/src/AllocsLogFunctions.cs
r228 r230 8 8 public class AllocsLogFunctions 9 9 { 10 public static void RequestToSpawnPlayer ( GameManager manager,int _clientId, string _name, int _chunkViewDim, PlayerProfile _playerProfile)10 public static void RequestToSpawnPlayer (int _clientId, string _name, int _chunkViewDim, PlayerProfile _playerProfile) 11 11 { 12 12 try { 13 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromClientID (_clientId); 14 int entityId = CommonMappingFunctions.GetEntityID (ci); 15 EntityPlayer ep = CommonMappingFunctions.GetEntityPlayer (ci); 16 string steamId = CommonMappingFunctions.GetSteamID (ci); 17 18 string ip = ci.ip; 19 string name = string.Empty; 20 21 if (ep != null) 22 name = ep.EntityName; 13 ClientInfo ci = ConnectionManager.Instance.GetClient (_clientId); 23 14 24 15 Log.Out ("Player connected, clientid=" + _clientId + 25 ", entityid=" + entityId +26 ", name=" + name +27 ", steamid=" + steamId +28 ", ip=" + ip16 ", entityid=" + ci.entityId + 17 ", name=" + ci.playerName + 18 ", steamid=" + ci.playerId + 19 ", ip=" + ci.ip 29 20 ); 30 21 31 PersistentContainer.Instance.Players [ steamId].SetOnline (ci);22 PersistentContainer.Instance.Players [ci.playerId].SetOnline (ci); 32 23 PersistentData.PersistentContainer.Instance.Save (); 33 34 Mods.CallRequestToSpawnPlayer (_clientId, _name, _chunkViewDim, _playerProfile);35 24 } catch (Exception e) { 36 25 Log.Out ("Error in AllocsLogFunctions.RequestToSpawnPlayer: " + e); … … 38 27 } 39 28 40 public static void PlayerDisconnected (C onnectionManager manager, ClientInfo _cInfo, bool _bShutdown)29 public static void PlayerDisconnected (ClientInfo _cInfo, bool _bShutdown) 41 30 { 42 31 try { … … 48 37 } 49 38 PersistentData.PersistentContainer.Instance.Save (); 50 51 Mods.CallPlayerDisconnected (_cInfo, _bShutdown);52 39 } catch (Exception e) { 53 40 Log.Out ("Error in AllocsLogFunctions.PlayerDisconnected: " + e); -
binary-improvements/7dtd-server-fixes/src/AssemblyInfo.cs
r228 r230 18 18 // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 19 20 [assembly: AssemblyVersion("0.11 2.*")]20 [assembly: AssemblyVersion("0.113.*")] 21 21 22 22 // The following attributes are used to specify the signing key for the assembly, -
binary-improvements/7dtd-server-fixes/src/PersistentData/PersistentContainer.cs
r146 r230 54 54 return true; 55 55 } catch (Exception e) { 56 Log.Out ("Exception in PersistentContainer.Load: " + e.Message); 56 Log.Error ("Exception in PersistentContainer.Load"); 57 Log.Exception (e); 57 58 } 58 59 } -
binary-improvements/7dtd-server-fixes/src/PersistentData/Player.cs
r228 r230 59 59 get { 60 60 if (IsOnline) { 61 return CommonMappingFunctions.GetEntityPlayer (clientInfo);61 return GameManager.Instance.World.Players.dict [clientInfo.entityId]; 62 62 } else { 63 63 return null; … … 116 116 Log.Out ("Player set to online: " + steamId); 117 117 clientInfo = ci; 118 entityId = CommonMappingFunctions.GetEntityID (ci);119 name = CommonMappingFunctions.GetPlayerName (ci);118 entityId = ci.entityId; 119 name = ci.playerName; 120 120 ip = ci.ip; 121 121 } -
binary-improvements/7dtd-server-fixes/src/PlayerDataStuff.cs
r224 r230 11 11 { 12 12 try { 13 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromClientID(_clientId); 14 string steamId = CommonMappingFunctions.GetSteamID(ci); 15 PersistentContainer.Instance.Players[steamId].Inventory.Update(_playerDataFile); 16 Mods.CallSavePlayerData (_clientId, _playerDataFile); 13 ClientInfo ci = ConnectionManager.Instance.GetClient (_clientId); 14 PersistentContainer.Instance.Players[ci.playerId].Inventory.Update(_playerDataFile); 17 15 } catch (Exception e) { 18 16 Log.Out ("Error in GM_SavePlayerData: " + e); -
binary-improvements/7dtd-server-fixes/src/StateManager.cs
r224 r230 1 using AllocsFixes.NetConnections.Servers.Telnet;2 1 using System; 3 2 using System.Reflection; … … 7 6 public class StateManager 8 7 { 9 public static void Awake ( GameManager manager)8 public static void Awake () 10 9 { 11 10 try { 12 11 Log.Out ("[7dtd-server-fixes by Alloc] Version: " + Assembly.GetExecutingAssembly ().GetName ().Version); 13 14 Mods.LoadMods ();15 Mods.CallGameAwake ();16 CommandExtensions.InitCommandExtensions (manager);17 18 new Telnet ();19 12 20 13 ItemList.Instance.Init (); … … 26 19 } 27 20 28 public static void Shutdown ( GameManager manager)21 public static void Shutdown () 29 22 { 30 23 try { 31 24 Log.Out ("Server shutting down!"); 32 Mods.CallGameShutdown ();33 25 PersistentData.PersistentContainer.Instance.Save (); 34 26 } catch (Exception e) { -
binary-improvements/AllocsCommands/AllocsCommands.csproj
r224 r230 15 15 <DebugType>none</DebugType> 16 16 <Optimize>true</Optimize> 17 <OutputPath>..\bin\Mods\Allocs Commands\</OutputPath>17 <OutputPath>..\bin\Mods\Allocs_CommandExtensions\</OutputPath> 18 18 <ErrorReport>prompt</ErrorReport> 19 19 <WarningLevel>4</WarningLevel> … … 41 41 <ItemGroup> 42 42 <Compile Include="AssemblyInfo.cs" /> 43 <Compile Include="Commands\GetGamePrefs.cs" />44 <Compile Include="Commands\GetTime.cs" />45 43 <Compile Include="Commands\Give.cs" /> 46 <Compile Include="Commands\Kill.cs" />47 44 <Compile Include="Commands\ListItems.cs" /> 48 45 <Compile Include="Commands\ListKnownPlayers.cs" /> 49 46 <Compile Include="Commands\ListLandProtection.cs" /> 50 <Compile Include="Commands\ListPlayerIds.cs" />51 <Compile Include="Commands\PrivateMassageConnections.cs" />52 47 <Compile Include="Commands\RemoveLandProtection.cs" /> 53 48 <Compile Include="Commands\Reply.cs" /> 54 49 <Compile Include="Commands\SayToPlayer.cs" /> 55 <Compile Include="Commands\SetTimeReal.cs" />56 50 <Compile Include="Commands\ShowInventory.cs" /> 57 51 <Compile Include="Commands\TeleportPlayer.cs" /> 58 <Compile Include=" Commands\Unban.cs" />59 <Compile Include=" API.cs" />52 <Compile Include="PrivateMassageConnections.cs" /> 53 <Compile Include="Chat.cs" /> 60 54 </ItemGroup> 61 55 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> … … 70 64 <Folder Include="Commands\" /> 71 65 </ItemGroup> 66 <ItemGroup> 67 <None Include="ModInfo.xml"> 68 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 69 </None> 70 </ItemGroup> 72 71 </Project> -
binary-improvements/AllocsCommands/Commands/Give.cs
r224 r230 5 5 namespace AllocsFixes.CustomCommands 6 6 { 7 public class Give : ConsoleC ommand7 public class Give : ConsoleCmdAbstract 8 8 { 9 public Give (ConsoleSdtd cons) : base(cons) 10 { 11 } 12 13 public override string Description () 9 public override string GetDescription () 14 10 { 15 11 return "give an item to a player (entity id or name)"; 16 12 } 17 13 18 public override string[] Names ()14 public override string[] GetCommands () 19 15 { 20 16 return new string[] { "give", string.Empty }; 21 17 } 22 18 23 public override void Run (string[] _params)19 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) 24 20 { 25 21 try { 26 if (_params. Length!= 3) {27 m_Console.SendResult ("Usage: give <playername|entityid> <itemname> <amount>");22 if (_params.Count != 3) { 23 SdtdConsole.Instance.Output ("Usage: give <playername|entityid> <itemname> <amount>"); 28 24 return; 29 25 } 30 26 31 ClientInfo ci = Co mmonMappingFunctions.GetClientInfoFromNameOrID (_params [0], false);27 ClientInfo ci = ConsoleHelper.ParseParamIdOrName (_params [0]); 32 28 33 29 if (ci == null) { 34 m_Console.SendResult ("Playername or entity id not found.");30 SdtdConsole.Instance.Output ("Playername or entity id not found."); 35 31 return; 36 32 } 37 33 38 ItemValue iv = ItemList.Instance.GetItemValue (_params[1]);34 ItemValue iv = ItemList.Instance.GetItemValue (_params[1]); 39 35 if (iv == null) { 40 m_Console.SendResult ("Item not found.");36 SdtdConsole.Instance.Output ("Item not found."); 41 37 return; 42 38 } … … 44 40 int n = int.MinValue; 45 41 if (!int.TryParse (_params [2], out n) || n <= 0) { 46 m_Console.SendResult ("Amount is not an integer or not greater than zero.");42 SdtdConsole.Instance.Output ("Amount is not an integer or not greater than zero."); 47 43 return; 48 44 } 49 45 50 EntityPlayer p = CommonMappingFunctions.GetEntityPlayer (ci);46 EntityPlayer p = GameManager.Instance.World.Players.dict [ci.entityId]; 51 47 52 48 InventoryField invField = new InventoryField (iv, n); 53 49 54 CommonMappingFunctions.GetGameManager ().ItemDropServer (invField, p.GetPosition (), Vector3.zero, -1, 50);50 GameManager.Instance.ItemDropServer (invField, p.GetPosition (), Vector3.zero, -1, 50); 55 51 56 m_Console.SendResult ("Dropped item");52 SdtdConsole.Instance.Output ("Dropped item"); 57 53 } catch (Exception e) { 58 54 Log.Out ("Error in Give.Run: " + e); -
binary-improvements/AllocsCommands/Commands/ListItems.cs
r224 r230 4 4 namespace AllocsFixes.CustomCommands 5 5 { 6 public class ListItems : ConsoleC ommand6 public class ListItems : ConsoleCmdAbstract 7 7 { 8 public ListItems (ConsoleSdtd cons) : base(cons) 9 { 10 } 11 12 public override string Description () 8 public override string GetDescription () 13 9 { 14 10 return "lists all items that contain the given substring"; 15 11 } 16 12 17 public override string[] Names ()13 public override string[] GetCommands () 18 14 { 19 15 return new string[] { "listitems", "li" }; 20 16 } 21 17 22 public override void Run (string[] _params)18 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) 23 19 { 24 20 try { 25 if (_params. Length!= 1 || _params [0].Length == 0) {26 m_Console.SendResult ("Usage: listitems <searchString>");21 if (_params.Count != 1 || _params [0].Length == 0) { 22 SdtdConsole.Instance.Output ("Usage: listitems <searchString>"); 27 23 return; 28 24 } … … 31 27 foreach (string s in ItemList.Instance.ItemNames) { 32 28 if (s.ToLower ().Contains (_params [0].ToLower ())) { 33 m_Console.SendResult (" " + s);29 SdtdConsole.Instance.Output (" " + s); 34 30 n++; 35 31 } 36 32 } 37 33 38 m_Console.SendResult ("Listed " + n + " matching items.");34 SdtdConsole.Instance.Output ("Listed " + n + " matching items."); 39 35 } catch (Exception e) { 40 36 Log.Out ("Error in ListItems.Run: " + e); -
binary-improvements/AllocsCommands/Commands/ListKnownPlayers.cs
r224 r230 5 5 namespace AllocsFixes.CustomCommands 6 6 { 7 public class ListKnownPlayers : ConsoleC ommand7 public class ListKnownPlayers : ConsoleCmdAbstract 8 8 { 9 public ListKnownPlayers (ConsoleSdtd cons) : base(cons) 10 { 11 } 12 13 public override string Description () 9 public override string GetDescription () 14 10 { 15 11 return "lists all players that were ever online (optionally filtered)"; 16 12 } 17 13 18 public override string[] Names ()14 public override string[] GetCommands () 19 15 { 20 16 return new string[] { "listknownplayers", "lkp" }; 21 17 } 22 18 23 public override void Run (string[] _params)19 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) 24 20 { 25 21 try { 26 AdminTools admTools = CommonMappingFunctions.GetGameManager ().adminTools;22 AdminTools admTools = GameManager.Instance.adminTools; 27 23 28 24 bool onlineOnly = false; … … 30 26 string nameFilter = string.Empty; 31 27 32 if (_params. Length== 1) {28 if (_params.Count == 1) { 33 29 if (_params [0].ToLower ().Equals ("-online")) { 34 30 onlineOnly = true; … … 49 45 && (nameFilter.Length == 0 || p.Name.ToLower ().Contains (nameFilter)) 50 46 ) { 51 m_Console.SendResult (String.Format ("{0}. {1}, id={2}, steamid={3}, online={4}, ip={5}, playtime={6} m, seen={7}",47 SdtdConsole.Instance.Output (String.Format ("{0}. {1}, id={2}, steamid={3}, online={4}, ip={5}, playtime={6} m, seen={7}", 52 48 ++num, p.Name, p.EntityID, sid, p.IsOnline, p.IP, 53 49 p.TotalPlayTime / 60, … … 56 52 } 57 53 } 58 m_Console.SendResult ("Total of " + PersistentContainer.Instance.Players.Count + " known");54 SdtdConsole.Instance.Output ("Total of " + PersistentContainer.Instance.Players.Count + " known"); 59 55 } catch (Exception e) { 60 56 Log.Out ("Error in ListKnownPlayers.Run: " + e); -
binary-improvements/AllocsCommands/Commands/ListLandProtection.cs
r224 r230 4 4 namespace AllocsFixes.CustomCommands 5 5 { 6 public class ListLandProtection : ConsoleC ommand6 public class ListLandProtection : ConsoleCmdAbstract 7 7 { 8 public ListLandProtection (ConsoleSdtd cons) : base(cons) 9 { 10 } 11 12 public override string Description () 8 public override string GetDescription () 13 9 { 14 10 return "lists all land protection blocks and owners"; 15 11 } 16 12 17 public override string[] Names ()13 public override string[] GetCommands () 18 14 { 19 15 return new string[] { "listlandprotection", "llp" }; 20 16 } 21 17 22 public override void Execute Remote (string _sender, string[] _params)18 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) 23 19 { 24 20 try { 25 if (_params.Length >= 1 && _params [0].ToLower ().Equals ("nearby")) { 26 string[] params2 = new string[_params.Length + 1]; 27 for (int i = 0; i < _params.Length; i++) 28 params2 [i] = _params [i]; 29 params2 [_params.Length] = _sender; 30 _params = params2; 21 if (_senderInfo.RemoteClientInfo != null) { 22 if (_params.Count >= 1 && _params [0].ToLower ().Equals ("nearby")) { 23 _params.Add (_senderInfo.RemoteClientInfo.playerId); 24 } 31 25 } 32 Run (_params);33 } catch (Exception e) {34 Log.Out ("Error in ListLandProtection.ExecuteRemote: " + e);35 }36 }37 26 38 public override void Run (string[] _params) 39 { 40 try { 41 World w = CommonMappingFunctions.GetGameManager ().World; 42 PersistentPlayerList ppl = CommonMappingFunctions.GetGameManager ().GetPersistentPlayerList (); 27 World w = GameManager.Instance.World; 28 PersistentPlayerList ppl = GameManager.Instance.GetPersistentPlayerList (); 43 29 44 30 bool summaryOnly = false; … … 48 34 int closeToDistance = 32; 49 35 50 if (_params. Length== 1) {36 if (_params.Count == 1) { 51 37 long tempLong; 52 38 … … 56 42 steamIdFilter = _params [0]; 57 43 } else { 58 ClientInfo ci = Co mmonMappingFunctions.GetClientInfoFromNameOrID (_params [0], true);44 ClientInfo ci = ConsoleHelper.ParseParamIdOrName (_params [0]); 59 45 if (ci != null) { 60 steamIdFilter = CommonMappingFunctions.GetSteamID (ci);46 steamIdFilter = ci.playerId; 61 47 } else { 62 m_Console.SendResult ("Player name or entity id \"" + _params [0] + "\" not found.");48 SdtdConsole.Instance.Output ("Player name or entity id \"" + _params [0] + "\" not found."); 63 49 return; 64 50 } 65 51 } 66 } else if (_params. Length>= 2) {52 } else if (_params.Count >= 2) { 67 53 if (_params [0].ToLower ().Equals ("nearby")) { 68 54 try { 69 if (_params. Length== 3) {55 if (_params.Count == 3) { 70 56 if (!int.TryParse (_params[1], out closeToDistance)) { 71 m_Console.SendResult ("Given radius is not an integer!");57 SdtdConsole.Instance.Output ("Given radius is not an integer!"); 72 58 } 73 59 } 74 ClientInfo ci = Co mmonMappingFunctions.GetClientInfoFromSteamID (_params [_params.Length- 1]);75 EntityPlayer ep = CommonMappingFunctions.GetEntityPlayer (ci);60 ClientInfo ci = ConsoleHelper.ParseParamSteamIdOnline (_params [_params.Count - 1]); 61 EntityPlayer ep = w.Players.dict [ci.entityId]; 76 62 closeTo = new Vector3i (ep.GetPosition ()); 77 63 onlyCloseToPlayer = true; 78 64 } catch (Exception e) { 79 m_Console.SendResult ("Error getting current player's position");65 SdtdConsole.Instance.Output ("Error getting current player's position"); 80 66 Log.Out ("Error in ListLandProtection.Run: " + e); 81 67 } 82 68 } else { 83 m_Console.SendResult ("Illegal parameter list");69 SdtdConsole.Instance.Output ("Illegal parameter list"); 84 70 return; 85 71 } … … 103 89 name += " (" + kvp.Key.PlayerId + ")"; 104 90 105 m_Console.SendResult (String.Format ("Player \"{0}\" owns {3} keystones (protected: {1}, current hardness multiplier: {2})", name, w.LandClaimIsActive (kvp.Key), w.LandClaimPower (kvp.Key), kvp.Value.Count));91 SdtdConsole.Instance.Output (String.Format ("Player \"{0}\" owns {3} keystones (protected: {1}, current hardness multiplier: {2})", name, w.LandClaimIsActive (kvp.Key), w.LandClaimPower (kvp.Key), kvp.Value.Count)); 106 92 if (!summaryOnly) { 107 93 foreach (Vector3i v in kvp.Value) { 108 m_Console.SendResult (" (" + v.ToString () + ")");94 SdtdConsole.Instance.Output (" (" + v.ToString () + ")"); 109 95 } 110 96 } … … 114 100 115 101 if (steamIdFilter.Length == 0) 116 m_Console.SendResult ("Total of " + d.Count + " keystones in the game");102 SdtdConsole.Instance.Output ("Total of " + d.Count + " keystones in the game"); 117 103 } catch (Exception e) { 118 104 Log.Out ("Error in ListLandProtection.Run: " + e); -
binary-improvements/AllocsCommands/Commands/RemoveLandProtection.cs
r224 r230 4 4 namespace AllocsFixes.CustomCommands 5 5 { 6 public class RemoveLandProtection : ConsoleC ommand6 public class RemoveLandProtection : ConsoleCmdAbstract 7 7 { 8 public RemoveLandProtection (ConsoleSdtd cons) : base(cons) 9 { 10 } 11 12 public override string Description () 8 public override string GetDescription () 13 9 { 14 10 return "removes the association of a land protection block to the owner"; 15 11 } 16 12 17 public override string[] Names ()13 public override string[] GetCommands () 18 14 { 19 15 return new string[] { "removelandprotection", "rlp" }; … … 23 19 { 24 20 try { 25 PersistentPlayerList ppl = CommonMappingFunctions.GetGameManager ().GetPersistentPlayerList ();21 PersistentPlayerList ppl = GameManager.Instance.GetPersistentPlayerList (); 26 22 27 23 if (_id.Length < 1 || !ppl.Players.ContainsKey (_id)) { 28 m_Console.SendResult ("Not a valid Steam ID or user has never logged on. Use \"listlandprotection\" to get a list of keystones.");24 SdtdConsole.Instance.Output ("Not a valid Steam ID or user has never logged on. Use \"listlandprotection\" to get a list of keystones."); 29 25 return; 30 26 } 31 27 if (ppl.Players [_id].LPBlocks == null || ppl.Players [_id].LPBlocks.Count == 0) { 32 m_Console.SendResult ("Player does not own any keystones. Use \"listlandprotection\" to get a list of keystones.");28 SdtdConsole.Instance.Output ("Player does not own any keystones. Use \"listlandprotection\" to get a list of keystones."); 33 29 return; 34 30 } … … 39 35 changes.Add (bci); 40 36 } 41 CommonMappingFunctions.GetGameManager ().SetBlocksRPC (changes);37 GameManager.Instance.SetBlocksRPC (changes); 42 38 43 m_Console.SendResult ("Tried to remove #" + changes.Count + " land protection blocks for player \"" + _id + "\". Note "+39 SdtdConsole.Instance.Output ("Tried to remove #" + changes.Count + " land protection blocks for player \"" + _id + "\". Note "+ 44 40 "that only blocks in chunks that are currently loaded (close to any player) could be removed. "+ 45 41 "Please check for remaining blocks by running:"); 46 m_Console.SendResult(" listlandprotection " + _id);42 SdtdConsole.Instance.Output(" listlandprotection " + _id); 47 43 } catch (Exception e) { 48 44 Log.Out ("Error in RemoveLandProtection.removeById: " + e); … … 50 46 } 51 47 52 private void removeByPosition ( string[]_coords)48 private void removeByPosition (List<string> _coords) 53 49 { 54 50 try { … … 61 57 62 58 if (x == int.MinValue || y == int.MinValue || z == int.MinValue) { 63 m_Console.SendResult ("At least one of the given coordinates is not a valid integer");59 SdtdConsole.Instance.Output ("At least one of the given coordinates is not a valid integer"); 64 60 return; 65 61 } … … 67 63 Vector3i v = new Vector3i (x, y, z); 68 64 69 PersistentPlayerList ppl = CommonMappingFunctions.GetGameManager ().GetPersistentPlayerList ();65 PersistentPlayerList ppl = GameManager.Instance.GetPersistentPlayerList (); 70 66 71 67 Dictionary<Vector3i, PersistentPlayerData> d = ppl.positionToLPBlockOwner; 72 68 if (d == null || !d.ContainsKey (v)) { 73 m_Console.SendResult ("No land protection block at the given position or not a valid position. Use \"listlandprotection\" to get a list of keystones.");69 SdtdConsole.Instance.Output ("No land protection block at the given position or not a valid position. Use \"listlandprotection\" to get a list of keystones."); 74 70 return; 75 71 } … … 80 76 changes.Add (bci); 81 77 82 CommonMappingFunctions.GetGameManager ().SetBlocksRPC (changes);78 GameManager.Instance.SetBlocksRPC (changes); 83 79 84 m_Console.SendResult ("Land protection block at (" + v.ToString () + ") removed");80 SdtdConsole.Instance.Output ("Land protection block at (" + v.ToString () + ") removed"); 85 81 } catch (Exception e) { 86 82 Log.Out ("Error in RemoveLandProtection.removeByPosition: " + e); … … 88 84 } 89 85 90 public override void Run (string[] _params)86 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) 91 87 { 92 88 try { 93 if (_params. Length== 1) {89 if (_params.Count == 1) { 94 90 removeById (_params [0]); 95 } else if (_params. Length== 3) {91 } else if (_params.Count == 3) { 96 92 removeByPosition (_params); 97 93 } else { 98 m_Console.SendResult ("Usage: removelandprotection <x> <y> <z> OR removelandprotection <steamid>");94 SdtdConsole.Instance.Output ("Usage: removelandprotection <x> <y> <z> OR removelandprotection <steamid>"); 99 95 } 100 96 } catch (Exception e) { -
binary-improvements/AllocsCommands/Commands/Reply.cs
r224 r230 4 4 namespace AllocsFixes.CustomCommands 5 5 { 6 public class Reply : ConsoleC ommand6 public class Reply : ConsoleCmdAbstract 7 7 { 8 public Reply (ConsoleSdtd cons) : base(cons) 9 { 10 } 11 12 public override string Description () 8 public override string GetDescription () 13 9 { 14 10 return "send a message to the player who last sent you a PM"; 15 11 } 16 12 17 public override string[] Names ()13 public override string[] GetCommands () 18 14 { 19 15 return new string[] { "reply", "re" }; 20 16 } 21 17 22 private void SendMessage (ClientInfo _receiver, ClientInfo _sender, string _message)18 private void RunInternal (ClientInfo _sender, List<string> _params) 23 19 { 24 PrivateMassageConnections.SetLastPMSender (_sender, _receiver); 25 string senderName = CommonMappingFunctions.GetPlayerName (_sender); 26 27 _receiver.netConnection [0].AddToSendQueue (new NetPackage_GameInfoMessage (_message, senderName + " (PM)")); 28 string receiverName = CommonMappingFunctions.GetPlayerName (_receiver); 29 m_Console.SendResult ("Message to player " + (receiverName != null ? "\"" + receiverName + "\"" : "unknownName") + " sent with sender \"" + senderName + "\""); 30 } 31 32 private void RunInternal (ClientInfo _sender, string[] _params) 33 { 34 if (_params.Length < 1) { 35 m_Console.SendResult ("Usage: reply <message>"); 20 if (_params.Count < 1) { 21 SdtdConsole.Instance.Output ("Usage: reply <message>"); 36 22 return; 37 23 } 38 24 39 25 string message = _params [0]; 40 for (int i = 1; i < _params.Length; i++) {41 message += " " + _params [i];42 }43 26 44 27 ClientInfo receiver = PrivateMassageConnections.GetLastPMSenderForPlayer (_sender); 45 if (receiver != null && CommonMappingFunctions.GetClientID (receiver)>= 0) {46 SendMessage (receiver, _sender, message);28 if (receiver != null && receiver.clientId >= 0) { 29 Chat.SendMessage (receiver, _sender, message); 47 30 } else { 48 31 if (receiver != null) { 49 m_Console.SendResult ("The sender of the PM you last received is currently not online.");32 SdtdConsole.Instance.Output ("The sender of the PM you last received is currently not online."); 50 33 } else { 51 m_Console.SendResult ("You have not received a PM so far.");34 SdtdConsole.Instance.Output ("You have not received a PM so far."); 52 35 } 53 36 } 54 37 } 55 38 56 public override void ExecuteRemote (string _sender, string[] _params) 57 { 58 try { 59 m_Console.SendResult (string.Format ("{0} executing remote command '{1}' {2}", _sender, this.Names () [0], string.Join (" ", _params))); 60 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromSteamID (_sender); 61 RunInternal (ci, _params); 62 } catch (Exception e) { 63 Log.Out ("Error in Reply.ExecuteRemote: " + e); 39 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) { 40 if (_senderInfo.RemoteClientInfo == null) { 41 Log.Out ("Command \"reply\" can only be used on clients!"); 42 } else { 43 RunInternal (_senderInfo.RemoteClientInfo, _params); 64 44 } 65 }66 67 public override void Run (string[] _params)68 {69 Log.Out ("Command \"reply\" can only be used on clients!");70 45 } 71 46 } -
binary-improvements/AllocsCommands/Commands/SayToPlayer.cs
r224 r230 4 4 namespace AllocsFixes.CustomCommands 5 5 { 6 public class SayToPlayer : ConsoleC ommand6 public class SayToPlayer : ConsoleCmdAbstract 7 7 { 8 public SayToPlayer (ConsoleSdtd cons) : base(cons) 9 { 10 } 11 12 public override string Description () 8 public override string GetDescription () 13 9 { 14 10 return "send a message to a single player"; 15 11 } 16 12 17 public override string[] Names ()13 public override string[] GetCommands () 18 14 { 19 15 return new string[] { "sayplayer", "pm" }; 20 16 } 21 17 22 private void SendMessage (ClientInfo _receiver, ClientInfo _sender, string _message)18 private void RunInternal (ClientInfo _sender, List<string> _params) 23 19 { 24 string senderName; 25 if (_sender != null) { 26 PrivateMassageConnections.SetLastPMSender (_sender, _receiver); 27 senderName = CommonMappingFunctions.GetPlayerName (_sender); 28 } else { 29 senderName = "Server"; 30 } 31 ConnectionManager.Instance.SendPackage (new NetPackage_GameInfoMessage (_message, senderName + " (PM)"), new PackageDestinationSingleEntityID (_receiver.entityId)); 32 string receiverName = CommonMappingFunctions.GetPlayerName (_receiver); 33 m_Console.SendResult ("Message to player " + (receiverName != null ? "\"" + receiverName + "\"" : "unknownName") + " sent with sender \"" + senderName + "\""); 34 } 35 36 private void RunInternal (ClientInfo _sender, string[] _params) 37 { 38 if (_params.Length < 2) { 39 m_Console.SendResult ("Usage: sayplayer <playername|entityid> <message>"); 20 if (_params.Count < 2) { 21 SdtdConsole.Instance.Output ("Usage: sayplayer <playername|entityid> <message>"); 40 22 return; 41 23 } 42 24 43 25 string message = _params [1]; 44 for (int i = 2; i < _params.Length; i++) {45 message += " " + _params [i];46 }47 26 48 ClientInfo receiver = Co mmonMappingFunctions.GetClientInfoFromNameOrID (_params [0], true);27 ClientInfo receiver = ConsoleHelper.ParseParamIdOrName (_params [0]); 49 28 if (receiver != null) { 50 SendMessage (receiver, _sender, message);29 Chat.SendMessage (receiver, _sender, message); 51 30 } else { 52 m_Console.SendResult ("Playername or entity ID not found.");31 SdtdConsole.Instance.Output ("Playername or entity ID not found."); 53 32 } 54 33 } 55 34 56 public override void Execute Remote (string _sender, string[] _params)35 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) 57 36 { 58 37 try { 59 this.m_Console.SendResult (string.Format ("{0} executing remote command '{1}' {2}", _sender, this.Names () [0], string.Join (" ", _params))); 60 ClientInfo ci = CommonMappingFunctions.GetClientInfoFromSteamID (_sender); 61 RunInternal (ci, _params); 62 } catch (Exception e) { 63 Log.Out ("Error in SayToPlayer.ExecuteRemote: " + e); 64 } 65 } 66 67 public override void Run (string[] _params) 68 { 69 try { 70 RunInternal (null, _params); 38 if (_senderInfo.RemoteClientInfo != null) { 39 RunInternal (_senderInfo.RemoteClientInfo, _params); 40 } else { 41 RunInternal (null, _params); 42 } 71 43 } catch (Exception e) { 72 44 Log.Out ("Error in SayToPlayer.Run: " + e); -
binary-improvements/AllocsCommands/Commands/ShowInventory.cs
r224 r230 5 5 namespace AllocsFixes.CustomCommands 6 6 { 7 public class ShowInventory : ConsoleC ommand7 public class ShowInventory : ConsoleCmdAbstract 8 8 { 9 public ShowInventory (ConsoleSdtd cons) : base(cons) 10 { 11 } 12 13 public override string Description () 9 public override string GetDescription () 14 10 { 15 11 return "list inventory of a given player (steam id, entity id or name)"; 16 12 } 17 13 18 public override string[] Names ()14 public override string[] GetCommands () 19 15 { 20 16 return new string[] { "showinventory", "si" }; 21 17 } 22 18 23 public override void Run (string[] _params)19 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) 24 20 { 25 21 try { 26 if (_params. Length< 1) {27 m_Console.SendResult ("Usage: showinventory <steamid|playername|entityid>");22 if (_params.Count < 1) { 23 SdtdConsole.Instance.Output ("Usage: showinventory <steamid|playername|entityid>"); 28 24 return; 29 25 } … … 31 27 string steamid = PersistentContainer.Instance.Players.GetSteamID (_params [0], true); 32 28 if (steamid == null) { 33 m_Console.SendResult ("Playername or entity/steamid id not found or no inventory saved (first saved after a player has been online for 30s).");29 SdtdConsole.Instance.Output ("Playername or entity/steamid id not found or no inventory saved (first saved after a player has been online for 30s)."); 34 30 return; 35 31 } … … 38 34 PersistentData.Inventory inv = p.Inventory; 39 35 40 m_Console.SendResult ("Belt of player " + p.Name + ":");36 SdtdConsole.Instance.Output ("Belt of player " + p.Name + ":"); 41 37 for (int i = 0; i < inv.belt.Count; i++) { 42 38 if (inv.belt [i] != null) 43 m_Console.SendResult (string.Format (" Slot {0}: {1:000} * {2}", i, inv.belt [i].count, inv.belt [i].itemName));39 SdtdConsole.Instance.Output (string.Format (" Slot {0}: {1:000} * {2}", i, inv.belt [i].count, inv.belt [i].itemName)); 44 40 } 45 m_Console.SendResult (string.Empty);46 m_Console.SendResult ("Bagpack of player " + p.Name + ":");41 SdtdConsole.Instance.Output (string.Empty); 42 SdtdConsole.Instance.Output ("Bagpack of player " + p.Name + ":"); 47 43 for (int i = 0; i < inv.bag.Count; i++) { 48 44 if (inv.bag [i] != null) 49 m_Console.SendResult (string.Format (" Slot {0}: {1:000} * {2}", i, inv.bag [i].count, inv.bag [i].itemName));45 SdtdConsole.Instance.Output (string.Format (" Slot {0}: {1:000} * {2}", i, inv.bag [i].count, inv.bag [i].itemName)); 50 46 } 51 m_Console.SendResult (string.Empty);47 SdtdConsole.Instance.Output (string.Empty); 52 48 } catch (Exception e) { 53 49 Log.Out ("Error in ShowInventory.Run: " + e); -
binary-improvements/AllocsCommands/Commands/TeleportPlayer.cs
r228 r230 1 using AllocsFixes.PersistentData;2 1 using System; 3 2 using System.Collections.Generic; … … 6 5 namespace AllocsFixes.CustomCommands 7 6 { 8 public class TeleportPlayer : ConsoleC ommand7 public class TeleportPlayer : ConsoleCmdAbstract 9 8 { 10 public TeleportPlayer (ConsoleSdtd cons) : base(cons) 11 { 12 } 13 14 public override string Description () 9 public override string GetDescription () 15 10 { 16 11 return "teleport a player to a given location"; 17 12 } 18 13 19 public override string[] Names ()14 public override string[] GetCommands () 20 15 { 21 16 return new string[] { "teleportplayer", "tele" }; 22 17 } 23 18 24 public override void Run (string[] _params)19 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) 25 20 { 26 21 try { 27 if (_params. Length != 4 && _params.Length!= 2) {28 m_Console.SendResult ("Usage: teleportplayer <entityid|playername|steamid> <x> <y> <z>");29 m_Console.SendResult (" or: teleportplayer <entityid|playername|steamid> <target entityid|playername|steamid>");22 if (_params.Count != 4 && _params.Count != 2) { 23 SdtdConsole.Instance.Output ("Usage: teleportplayer <entityid|playername|steamid> <x> <y> <z>"); 24 SdtdConsole.Instance.Output (" or: teleportplayer <entityid|playername|steamid> <target entityid|playername|steamid>"); 30 25 } else { 31 Player p1 = PersistentContainer.Instance.Players.GetPlayerByNameOrId (_params [0], true);32 if ( p1 == null) {33 m_Console.SendResult ("Playername or entity/steamid id not found.");26 ClientInfo ci1 = ConsoleHelper.ParseParamIdOrName (_params [0]); 27 if (ci1 == null) { 28 SdtdConsole.Instance.Output ("Playername or entity/steamid id not found."); 34 29 return; 35 30 } 36 if (!p1.IsOnline) { 37 m_Console.SendResult ("Player not online."); 38 return; 39 } 31 EntityPlayer ep1 = GameManager.Instance.World.Players.dict [ci1.entityId]; 40 32 41 if (_params. Length== 4) {33 if (_params.Count == 4) { 42 34 int x = int.MinValue; 43 35 int y = int.MinValue; … … 49 41 50 42 if (x == int.MinValue || y == int.MinValue || z == int.MinValue) { 51 m_Console.SendResult ("At least one of the given coordinates is not a valid integer");43 SdtdConsole.Instance.Output ("At least one of the given coordinates is not a valid integer"); 52 44 return; 53 45 } 54 46 55 p1.Entity.position.x = x;56 p1.Entity.position.y = y;57 p1.Entity.position.z = z;47 ep1.position.x = x; 48 ep1.position.y = y; 49 ep1.position.z = z; 58 50 } else { 59 Player p2 = PersistentContainer.Instance.Players.GetPlayerByNameOrId (_params [1], true);60 if ( p2 == null) {61 m_Console.SendResult ("Target playername or entity/steamid id not found.");51 ClientInfo ci2 = ConsoleHelper.ParseParamIdOrName (_params [1]); 52 if (ci2 == null) { 53 SdtdConsole.Instance.Output ("Target playername or entity/steamid id not found."); 62 54 return; 63 55 } 64 if (!p2.IsOnline) { 65 m_Console.SendResult ("Target player not online."); 66 return; 67 } 56 EntityPlayer ep2 = GameManager.Instance.World.Players.dict [ci2.entityId]; 68 57 69 p1.Entity.position = p2.Entity.GetPosition();70 p1.Entity.position.y += 1;71 p1.Entity.position.z += 1;58 ep1.position = ep2.GetPosition(); 59 ep1.position.y += 1; 60 ep1.position.z += 1; 72 61 } 73 62 74 NetPackage_EntityTeleport pkg = new NetPackage_EntityTeleport ( p1.Entity);63 NetPackage_EntityTeleport pkg = new NetPackage_EntityTeleport (ep1); 75 64 76 ConnectionManager.Instance.SendPackage (pkg, new PackageDestinationSingleEntityID (p1.ClientInfo.entityId));65 ci1.netConnection [0].AddToSendQueue (pkg); 77 66 } 78 67 } catch (Exception e) { -
binary-improvements/MapRendering/API.cs
r228 r230 3 3 namespace MapRendering 4 4 { 5 public class API : AllocsFixes.ModAPI { 6 public override string ModName () { 7 return "AllocsMapRendering"; 5 public class API : ModApiAbstract { 6 7 public override void GameAwake () { 8 new AllocsFixes.NetConnections.Servers.Web.Web (); 8 9 } 9 10 10 public override string ModVersion () {11 return "1.0 for A11.2";11 public override void CalcChunkColorsDone (Chunk _chunk) { 12 AllocsFixes.MapRendering.MapRendering.RenderSingleChunk (_chunk); 12 13 } 13 14 14 public override void CalcMapColors (Chunk _chunk) {15 AllocsFixes.MapRendering.MapRendering.RenderSingleChunk (_chunk);16 }17 15 } 18 16 } -
binary-improvements/MapRendering/Commands/EnableRendering.cs
r224 r230 4 4 namespace AllocsFixes.CustomCommands 5 5 { 6 public class EnableRendering : ConsoleC ommand6 public class EnableRendering : ConsoleCmdAbstract 7 7 { 8 public EnableRendering (ConsoleSdtd cons) : base(cons) 9 { 10 } 11 12 public override string Description () 8 public override string GetDescription () 13 9 { 14 10 return "enable/disable live map rendering"; 15 11 } 16 12 17 public override string[] Names ()13 public override string[] GetCommands () 18 14 { 19 return new string[] { "enablerendering" , string.Empty};15 return new string[] { "enablerendering" }; 20 16 } 21 17 22 public override void Run (string[] _params)18 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) 23 19 { 24 20 try { 25 if (_params. Length!= 1) {26 m_Console.SendResult ("Current state: " + AllocsFixes.MapRendering.MapRendering.renderingEnabled);21 if (_params.Count != 1) { 22 SdtdConsole.Instance.Output ("Current state: " + AllocsFixes.MapRendering.MapRendering.renderingEnabled); 27 23 return; 28 24 } 29 25 30 26 AllocsFixes.MapRendering.MapRendering.renderingEnabled = _params[0].Equals("1"); 31 m_Console.SendResult ("Set live map rendering to " + _params [0].Equals ("1"));27 SdtdConsole.Instance.Output ("Set live map rendering to " + _params [0].Equals ("1")); 32 28 } catch (Exception e) { 33 29 Log.Out ("Error in EnableRendering.Run: " + e); -
binary-improvements/MapRendering/Commands/RenderMap.cs
r224 r230 6 6 namespace AllocsFixes.CustomCommands 7 7 { 8 public class RenderMap : ConsoleC ommand8 public class RenderMap : ConsoleCmdAbstract 9 9 { 10 public RenderMap (ConsoleSdtd cons) : base(cons) 11 { 12 } 13 14 public override string Description () 10 public override string GetDescription () 15 11 { 16 12 return "render the current map to a file"; 17 13 } 18 14 19 public override string[] Names ()15 public override string[] GetCommands () 20 16 { 21 return new string[] { "rendermap" , "rm"};17 return new string[] { "rendermap" }; 22 18 } 23 19 24 public override void Run (string[] _params)20 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) 25 21 { 26 22 try { 27 23 AllocsFixes.MapRendering.MapRendering.Instance.RenderFullMap (); 28 24 29 m_Console.SendResult ("Render map done");25 SdtdConsole.Instance.Output ("Render map done"); 30 26 } catch (Exception e) { 31 27 Log.Out ("Error in RenderMap.Run: " + e); -
binary-improvements/MapRendering/MapRendering/MapRenderBlockBuffer.cs
r224 r230 53 53 } 54 54 55 public void SetPart (Vector2i offset, int partSize, Color[] pixels) 56 { 55 public void SetPart (Vector2i offset, int partSize, Color[] pixels) { 56 if (offset.x + partSize > blockMap.width || offset.y + partSize > blockMap.height) { 57 Log.Error (string.Format ("MapBlockBuffer[{0}].SetPart ({1}, {2}, {3}) has blockMap.size ({4}/{5})", zoomLevel, offset, partSize, pixels.Length, blockMap.width, blockMap.height)); 58 return; 59 } 57 60 blockMap.SetPixels (offset.x, offset.y, partSize, partSize, pixels); 58 61 } … … 71 74 { 72 75 byte[] array = cache.LoadTile (zoomLevel, _fileName); 73 if (array != null) { 74 blockMap.LoadImage (array); 75 } else { 76 //try { 77 //byte[] array = File.ReadAllBytes (_fileName); 78 //blockMap.LoadImage (array); 79 //} catch (Exception) { 76 if (array == null || !blockMap.LoadImage (array)) { 77 if (blockMap.height != Constants.MAP_BLOCK_SIZE || blockMap.width != Constants.MAP_BLOCK_SIZE) { 78 blockMap.Resize (Constants.MAP_BLOCK_SIZE, Constants.MAP_BLOCK_SIZE); 79 } 80 80 for (int x = 0; x < Constants.MAP_BLOCK_SIZE; x++) { 81 81 for (int y = 0; y < Constants.MAP_BLOCK_SIZE; y++) { … … 86 86 } 87 87 88 private void saveTextureToFile (string _fileName) 89 { 88 private void saveTextureToFile (string _fileName) { 90 89 byte[] array = blockMap.EncodeToPNG (); 91 90 cache.SaveTile (zoomLevel, array); 92 // try {93 // byte[] array = blockMap.EncodeToPNG ();94 // File.WriteAllBytes (_fileName, array);95 // } catch (Exception e) {96 // Log.Out ("Exception in MapRenderBlockBuffer.saveTextureToFile(): " + e);97 // }98 91 } 99 92 -
binary-improvements/MapRendering/MapRendering/MapRendering.cs
r224 r230 210 210 //Log.Out ("Dirty: " + v + " render: true"); 211 211 chunksDone.Add (v); 212 if (dirtyChunks [v].Length != Constants.MAP_CHUNK_SIZE * Constants.MAP_CHUNK_SIZE) { 213 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)); 214 } 212 215 zoomLevelBuffers [Constants.ZOOMLEVELS - 1].SetPart (v_blockOffset, Constants.MAP_CHUNK_SIZE, dirtyChunks [v]); 213 216 } else { -
binary-improvements/bundle_creation/makefile
r227 r230 3 3 SERVERPATH=/srv/www/illy.bz/http/fi/7dtd/ 4 4 5 VERSIONFILE=../bin/ 7DaysToDie_Data/Managed/7dtd-server-fixes_version.txt5 VERSIONFILE=../bin/Mods/Allocs_CommonFunc/7dtd-server-fixes_version.txt 6 6 VERSION=$(shell cat ${VERSIONFILE} | grep "Version" | cut -d\ -f8) 7 7 ARCHIVENAME=server_fixes_v${VERSION}.tar.gz … … 26 26 SERVERFIXES: 27 27 @echo Copying server fixes... 28 @rm 7DaysToDie_Data -R 29 @rm Mods -R 28 30 @mkdir -p 7DaysToDie_Data/Managed 29 @cp ../bin/7DaysToDie_Data/Managed/Assembly-CSharp.patched.dll 7DaysToDie_Data/Managed/Assembly-CSharp.dll 30 @cp ../bin/7DaysToDie_Data/Managed/7dtd-server-fixes.dll 7DaysToDie_Data/Managed/ 31 @cp ../bin/7DaysToDie_Data/Managed/7dtd-server-fixes_version.txt 7DaysToDie_Data/Managed/ 31 @cp ../7dtd-binaries/Assembly-CSharp.dll 7DaysToDie_Data/Managed/Assembly-CSharp.dll 32 32 @mkdir -p Mods 33 33 @cp ../bin/Mods/* Mods/ -R 34 @mkdir -p Mods/Allocs WebInterface/webserver35 @cp ../webserver/* Mods/Allocs WebInterface/webserver/ -R36 @rm Mods/Allocs WebInterface/webserver/protect -f34 @mkdir -p Mods/Allocs_WebAndMapRendering/webserver 35 @cp ../webserver/* Mods/Allocs_WebAndMapRendering/webserver/ -R 36 @rm Mods/Allocs_WebAndMapRendering/webserver/protect -f 37 37 @find . -name "*~" -exec rm {} \; 38 38 -
binary-improvements/server-fixes.sln
r224 r230 4 4 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "7dtd-server-fixes", "7dtd-server-fixes\7dtd-server-fixes.csproj", "{81DA7F87-1A66-4920-AADA-6EAF1971F8D0}" 5 5 EndProject 6 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-Patcher", "assembly-patcher\Assembly-Patcher.csproj", "{FFDBEC4C-E28E-4BF5-A271-33D9368F7F6D}"7 EndProject8 6 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AllocsCommands", "AllocsCommands\AllocsCommands.csproj", "{E273D042-57F9-4E2E-8268-5053527E5287}" 9 7 EndProject 10 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapRendering", "MapRendering\MapRendering.csproj", "{A1847B5F-7BFC-4BCD-94AA-A6C9FB7E7C54}" 11 EndProject 12 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebInterface", "WebInterface\WebInterface.csproj", "{5D85493E-D928-42E6-943D-1B6B47186E08}" 8 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebAndMapRendering", "MapRendering\WebAndMapRendering.csproj", "{A1847B5F-7BFC-4BCD-94AA-A6C9FB7E7C54}" 13 9 EndProject 14 10 Global … … 18 14 EndGlobalSection 19 15 GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 {5D85493E-D928-42E6-943D-1B6B47186E08}.Release_Version|Any CPU.ActiveCfg = Release|Any CPU21 {5D85493E-D928-42E6-943D-1B6B47186E08}.Release_Version|Any CPU.Build.0 = Release|Any CPU22 {5D85493E-D928-42E6-943D-1B6B47186E08}.Release|Any CPU.ActiveCfg = Release|Any CPU23 {5D85493E-D928-42E6-943D-1B6B47186E08}.Release|Any CPU.Build.0 = Release|Any CPU24 16 {81DA7F87-1A66-4920-AADA-6EAF1971F8D0}.Release_Version|Any CPU.ActiveCfg = Release_Version|Any CPU 25 17 {81DA7F87-1A66-4920-AADA-6EAF1971F8D0}.Release_Version|Any CPU.Build.0 = Release_Version|Any CPU … … 34 26 {E273D042-57F9-4E2E-8268-5053527E5287}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 27 {E273D042-57F9-4E2E-8268-5053527E5287}.Release|Any CPU.Build.0 = Release|Any CPU 36 {FFDBEC4C-E28E-4BF5-A271-33D9368F7F6D}.Release_Version|Any CPU.ActiveCfg = Release|x8637 {FFDBEC4C-E28E-4BF5-A271-33D9368F7F6D}.Release_Version|Any CPU.Build.0 = Release|x8638 {FFDBEC4C-E28E-4BF5-A271-33D9368F7F6D}.Release|Any CPU.ActiveCfg = Release|x8639 {FFDBEC4C-E28E-4BF5-A271-33D9368F7F6D}.Release|Any CPU.Build.0 = Release|x8640 28 EndGlobalSection 41 29 GlobalSection(MonoDevelopProperties) = preSolution 42 StartupItem = assembly-patcher\Assembly-Patcher.csproj30 StartupItem = 7dtd-server-fixes\7dtd-server-fixes.csproj 43 31 outputpath = bin 44 32 EndGlobalSection -
binary-improvements/server-fixes.userprefs
r228 r230 1 1 <Properties> 2 2 <MonoDevelop.Ide.Workspace ActiveConfiguration="Release_Version" /> 3 <MonoDevelop.Ide.Workbench ActiveDocument=" AllocsCommands/Commands/TeleportPlayer.cs">3 <MonoDevelop.Ide.Workbench ActiveDocument="MapRendering/Web/Web.cs"> 4 4 <Files> 5 <File FileName="7dtd-server-fixes/src/AssemblyInfo.cs" Line="20" Column="34" /> 6 <File FileName="assembly-patcher/Main.cs" Line="33" Column="105" /> 7 <File FileName="7dtd-server-fixes/src/CommandExtensions.cs" Line="24" Column="1" /> 8 <File FileName="7dtd-server-fixes/src/Mods.cs" Line="32" Column="36" /> 9 <File FileName="7dtd-server-fixes/src/ModAPI.cs" Line="11" Column="40" /> 10 <File FileName="7dtd-server-fixes/src/StateManager.cs" Line="15" Column="14" /> 11 <File FileName="WebInterface/Web/Web.cs" Line="71" Column="28" /> 12 <File FileName="MapRendering/API.cs" Line="20" Column="1" /> 13 <File FileName="AllocsCommands/API.cs" Line="11" Column="15" /> 14 <File FileName="WebInterface/API.cs" Line="11" Column="25" /> 15 <File FileName="AllocsCommands/Commands/TeleportPlayer.cs" Line="70" Column="32" /> 16 <File FileName="AllocsCommands/Commands/SayToPlayer.cs" Line="31" Column="168" /> 5 <File FileName="MapRendering/MapRendering/MapRendering.cs" Line="34" Column="26" /> 6 <File FileName="MapRendering/ModInfo.xml" Line="4" Column="52" /> 7 <File FileName="MapRendering/API.cs" Line="18" Column="1" /> 8 <File FileName="MapRendering/Web/Web.cs" Line="63" Column="1" /> 17 9 </Files> 18 10 <Pads>
Note:
See TracChangeset
for help on using the changeset viewer.