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

Fixes

Location:
binary-improvements/7dtd-server-fixes
Files:
6 added
2 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        }
Note: See TracChangeset for help on using the changeset viewer.