Changeset 133
- Timestamp:
- Aug 27, 2014, 3:29:15 AM (10 years ago)
- Location:
- binary-improvements
- Files:
-
- 21 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/7dtd-server-fixes.csproj
r130 r133 10 10 <AssemblyName>7dtd-server-fixes</AssemblyName> 11 11 <RootNamespace>AllocsFixes</RootNamespace> 12 <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> 12 13 </PropertyGroup> 13 14 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> … … 42 43 </ItemGroup> 43 44 <ItemGroup> 44 <Compile Include="src\AllocsNetTelnetServer.cs" />45 45 <Compile Include="src\AssemblyInfo.cs" /> 46 <Compile Include="src\AllocsTelnetConnection.cs" />47 46 <Compile Include="src\AllocsLogFunctions.cs" /> 48 47 <Compile Include="src\AdminToolsStuff.cs" /> … … 50 49 <Compile Include="src\CommandExtensions.cs" /> 51 50 <Compile Include="src\CommonMappingFunctions.cs" /> 52 <Compile Include="src\ConsoleOutputSeparator.cs" />53 51 <Compile Include="src\MapRendering\MapRendering.cs" /> 54 52 <Compile Include="src\MapRendering\MapRenderBlockBuffer.cs" /> … … 70 68 <Compile Include="src\CustomCommands\Give.cs" /> 71 69 <Compile Include="src\CustomCommands\ListItems.cs" /> 70 <Compile Include="src\NetConnections\ConsoleOutputSeparator.cs" /> 71 <Compile Include="src\NetConnections\NetTelnetServer.cs" /> 72 <Compile Include="src\NetConnections\IServer.cs" /> 73 <Compile Include="src\NetConnections\IConnection.cs" /> 74 <Compile Include="src\NetConnections\Servers\Telnet\Telnet.cs" /> 75 <Compile Include="src\NetConnections\Servers\Telnet\TelnetConnection.cs" /> 76 <Compile Include="src\NetConnections\Servers\Web\Web.cs" /> 77 <Compile Include="src\NetConnections\Servers\Web\PathHandler.cs" /> 78 <Compile Include="src\NetConnections\Servers\Web\StaticHandler.cs" /> 79 <Compile Include="src\NetConnections\Servers\Web\SimpleRedirectHandler.cs" /> 80 <Compile Include="src\NetConnections\Servers\Web\MimeType.cs" /> 72 81 </ItemGroup> 73 82 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> … … 76 85 <Folder Include="src\MapRendering\" /> 77 86 <Folder Include="src\CustomCommands\" /> 87 <Folder Include="src\NetConnections\" /> 88 <Folder Include="src\NetConnections\Servers\" /> 89 <Folder Include="src\NetConnections\Servers\Telnet\" /> 90 <Folder Include="src\NetConnections\Servers\Web\" /> 78 91 </ItemGroup> 79 92 </Project> -
binary-improvements/7dtd-server-fixes/src/NetConnections/NetTelnetServer.cs
r132 r133 6 6 using System.Reflection; 7 7 using System.Threading; 8 using UnityEngine; 8 9 9 10 namespace AllocsFixes.NetConnections … … 11 12 public class NetTelnetServer 12 13 { 13 private static List<IServer> servers = new List<IServer> ();14 private static List<IServer> servers = new List<IServer> (); 14 15 15 16 public static void init (int port) … … 17 18 try { 18 19 Log.Out ("[7dtd-server-fixes by Alloc] Version: " + Assembly.GetExecutingAssembly ().GetName ().Version); 19 servers.Add(new Servers.Telnet.Telnet(port)); 20 servers.Add (new Servers.Telnet.Telnet (port)); 21 22 int webPort = GamePrefs.GetInt (EnumGamePrefs.ControlPanelPort); 23 if (GamePrefs.GetBool (EnumGamePrefs.ControlPanelEnabled) && webPort > 0 && webPort < 65534) { 24 if (Directory.Exists (Application.dataPath + "/../webserver")) { 25 servers.Add (new Servers.Web.Web (webPort + 2)); 26 } 27 } 20 28 } catch (Exception e) { 21 Log.Out ("Error in AllocsTelnetServer.init: " + e);29 Log.Out ("Error in NetTelnetServer.init: " + e); 22 30 } 23 31 } … … 30 38 { 31 39 foreach (IServer s in servers) 32 s.Disconnect ();40 s.Disconnect (); 33 41 } 34 42 … … 39 47 } 40 48 foreach (IServer s in servers) 41 s.WriteToClient (line);49 s.WriteToClient (line); 42 50 } 43 51 … … 48 56 } 49 57 foreach (IServer s in servers) 50 s.WriteToClient_Single (line, client);58 s.WriteToClient_Single (line, client); 51 59 } 52 60 } -
binary-improvements/assembly-patcher/Main.cs
r130 r133 41 41 { 42 42 TypeDefinition type = module.GetType ("ConsoleSdtd"); 43 replaceMethod (type, "ExecuteCmdFromClient", true, 3, typeof(AllocsFixes. ConsoleOutputSeparator).GetMethod ("C_ExecuteCmdFromClient"));44 addHook (type, "Run", true, 0, true, typeof(AllocsFixes. ConsoleOutputSeparator).GetMethod ("C_Run"));45 replaceMethod (type, "SendResult", true, 1, typeof(AllocsFixes. ConsoleOutputSeparator).GetMethod ("C_SendResult"));43 replaceMethod (type, "ExecuteCmdFromClient", true, 3, typeof(AllocsFixes.NetConnections.ConsoleOutputSeparator).GetMethod ("C_ExecuteCmdFromClient")); 44 addHook (type, "Run", true, 0, true, typeof(AllocsFixes.NetConnections.ConsoleOutputSeparator).GetMethod ("C_Run")); 45 replaceMethod (type, "SendResult", true, 1, typeof(AllocsFixes.NetConnections.ConsoleOutputSeparator).GetMethod ("C_SendResult")); 46 46 } 47 47 … … 68 68 { 69 69 TypeDefinition type = module.GetType ("NetTelnetServer"); 70 replaceMethod (type, ".ctor", false, 1, typeof(AllocsFixes. AllocsNetTelnetServer).GetMethod ("init"));71 replaceMethod (type, "Disconnect", false, 0, typeof(AllocsFixes. AllocsNetTelnetServer).GetMethod ("Disconnect"));72 replaceMethod (type, "SetConsole", false, 1, typeof(AllocsFixes. AllocsNetTelnetServer).GetMethod ("SetConsole"));73 replaceMethod (type, "WriteToClient", false, 1, typeof(AllocsFixes. AllocsNetTelnetServer).GetMethod ("WriteToClient"));70 replaceMethod (type, ".ctor", false, 1, typeof(AllocsFixes.NetConnections.NetTelnetServer).GetMethod ("init")); 71 replaceMethod (type, "Disconnect", false, 0, typeof(AllocsFixes.NetConnections.NetTelnetServer).GetMethod ("Disconnect")); 72 replaceMethod (type, "SetConsole", false, 1, typeof(AllocsFixes.NetConnections.NetTelnetServer).GetMethod ("SetConsole")); 73 replaceMethod (type, "WriteToClient", false, 1, typeof(AllocsFixes.NetConnections.NetTelnetServer).GetMethod ("WriteToClient")); 74 74 } 75 75 -
binary-improvements/server-fixes.userprefs
r130 r133 1 1 <Properties> 2 2 <MonoDevelop.Ide.Workspace ActiveConfiguration="Release" /> 3 <MonoDevelop.Ide.Workbench ActiveDocument="7dtd-server-fixes/src/ TelnetCommands/RenderMap.cs">3 <MonoDevelop.Ide.Workbench ActiveDocument="7dtd-server-fixes/src/NetConnections/Servers/Web/Web.cs"> 4 4 <Files> 5 <File FileName="assembly-patcher/Main.cs" Line="37" Column="101" /> 6 <File FileName="7dtd-server-fixes/src/AllocsNetTelnetServer.cs" Line="1" Column="1" /> 7 <File FileName="7dtd-server-fixes/src/TelnetCommands/RemoveLandProtection.cs" Line="52" Column="1" /> 8 <File FileName="7dtd-server-fixes/src/CommandExtensions.cs" Line="18" Column="4" /> 9 <File FileName="7dtd-server-fixes/src/TelnetCommands/ShowInventory.cs" Line="45" Column="5" /> 10 <File FileName="7dtd-server-fixes/src/PlayerDataStuff.cs" Line="93" Column="48" /> 11 <File FileName="7dtd-server-fixes/src/TelnetCommands/RenderMap.cs" Line="1" Column="18" /> 12 <File FileName="7dtd-server-fixes/src/MapRendering/MapRenderBlockBuffer.cs" Line="40" Column="1" /> 13 <File FileName="7dtd-server-fixes/src/MapRendering/MapRendering.cs" Line="246" Column="1" /> 14 <File FileName="7dtd-server-fixes/src/MapRendering/Constants.cs" Line="5" Column="1" /> 5 <File FileName="assembly-patcher/Main.cs" Line="73" Column="85" /> 6 <File FileName="7dtd-server-fixes/src/NetConnections/NetTelnetServer.cs" Line="28" Column="27" /> 7 <File FileName="7dtd-server-fixes/src/NetConnections/IServer.cs" Line="7" Column="21" /> 8 <File FileName="7dtd-server-fixes/src/NetConnections/Servers/Telnet/Telnet.cs" Line="31" Column="1" /> 9 <File FileName="7dtd-server-fixes/src/NetConnections/Servers/Telnet/TelnetConnection.cs" Line="5" Column="52" /> 10 <File FileName="7dtd-server-fixes/src/MapRendering/MapRendering.cs" Line="75" Column="18" /> 11 <File FileName="7dtd-server-fixes/src/NetConnections/Servers/Web/Web.cs" Line="53" Column="1" /> 15 12 </Files> 13 <Pads> 14 <Pad Id="ClassPad"> 15 <State expanded="True" selected="True" /> 16 </Pad> 17 </Pads> 16 18 </MonoDevelop.Ide.Workbench> 17 19 <MonoDevelop.Ide.DebuggingService.Breakpoints>
Note:
See TracChangeset
for help on using the changeset viewer.