Changeset 133 for binary-improvements


Ignore:
Timestamp:
Aug 27, 2014, 3:29:15 AM (5 years ago)
Author:
alloc
Message:

Fixes

Location:
binary-improvements
Files:
21 added
6 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements/7dtd-server-fixes/7dtd-server-fixes.csproj

    r130 r133  
    1010    <AssemblyName>7dtd-server-fixes</AssemblyName>
    1111    <RootNamespace>AllocsFixes</RootNamespace>
     12    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    1213  </PropertyGroup>
    1314  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     
    4243  </ItemGroup>
    4344  <ItemGroup>
    44     <Compile Include="src\AllocsNetTelnetServer.cs" />
    4545    <Compile Include="src\AssemblyInfo.cs" />
    46     <Compile Include="src\AllocsTelnetConnection.cs" />
    4746    <Compile Include="src\AllocsLogFunctions.cs" />
    4847    <Compile Include="src\AdminToolsStuff.cs" />
     
    5049    <Compile Include="src\CommandExtensions.cs" />
    5150    <Compile Include="src\CommonMappingFunctions.cs" />
    52     <Compile Include="src\ConsoleOutputSeparator.cs" />
    5351    <Compile Include="src\MapRendering\MapRendering.cs" />
    5452    <Compile Include="src\MapRendering\MapRenderBlockBuffer.cs" />
     
    7068    <Compile Include="src\CustomCommands\Give.cs" />
    7169    <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" />
    7281  </ItemGroup>
    7382  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
     
    7685    <Folder Include="src\MapRendering\" />
    7786    <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\" />
    7891  </ItemGroup>
    7992</Project>
  • binary-improvements/7dtd-server-fixes/src/NetConnections/NetTelnetServer.cs

    r132 r133  
    66using System.Reflection;
    77using System.Threading;
     8using UnityEngine;
    89
    910namespace AllocsFixes.NetConnections
     
    1112        public class NetTelnetServer
    1213        {
    13                 private static List<IServer> servers = new List<IServer>();
     14                private static List<IServer> servers = new List<IServer> ();
    1415
    1516                public static void init (int port)
     
    1718                        try {
    1819                                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                                }
    2028                        } catch (Exception e) {
    21                                 Log.Out ("Error in AllocsTelnetServer.init: " + e);
     29                                Log.Out ("Error in NetTelnetServer.init: " + e);
    2230                        }
    2331                }
     
    3038                {
    3139                        foreach (IServer s in servers)
    32                                 s.Disconnect();
     40                                s.Disconnect ();
    3341                }
    3442
     
    3947                        }
    4048                        foreach (IServer s in servers)
    41                                 s.WriteToClient(line);
     49                                s.WriteToClient (line);
    4250                }
    4351
     
    4856                        }
    4957                        foreach (IServer s in servers)
    50                                 s.WriteToClient_Single(line, client);
     58                                s.WriteToClient_Single (line, client);
    5159                }
    5260        }
  • binary-improvements/assembly-patcher/Main.cs

    r130 r133  
    4141                {
    4242                        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"));
    4646                }
    4747
     
    6868                {
    6969                        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"));
    7474                }
    7575
  • binary-improvements/server-fixes.userprefs

    r130 r133  
    11<Properties>
    22  <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">
    44    <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" />
    1512    </Files>
     13    <Pads>
     14      <Pad Id="ClassPad">
     15        <State expanded="True" selected="True" />
     16      </Pad>
     17    </Pads>
    1618  </MonoDevelop.Ide.Workbench>
    1719  <MonoDevelop.Ide.DebuggingService.Breakpoints>
Note: See TracChangeset for help on using the changeset viewer.