Changeset 142


Ignore:
Timestamp:
Aug 29, 2014, 4:18:16 PM (10 years ago)
Author:
alloc
Message:

Fixes: Fixed #49

Location:
binary-improvements
Files:
5 added
11 edited

Legend:

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

    r140 r142  
    2828    <ErrorReport>prompt</ErrorReport>
    2929    <WarningLevel>4</WarningLevel>
     30    <ConsolePause>false</ConsolePause>
     31  </PropertyGroup>
     32  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Version|AnyCPU' ">
     33    <DebugType>none</DebugType>
     34    <Optimize>true</Optimize>
     35    <OutputPath>..\bin\Release</OutputPath>
     36    <ErrorReport>prompt</ErrorReport>
     37    <WarningLevel>4</WarningLevel>
     38    <CustomCommands>
     39      <CustomCommands>
     40        <Command type="AfterBuild" command="bash -c &quot;monodis --assembly ${TargetFile} | grep Version &gt; ${TargetDir}/${ProjectName}_version.txt&quot;" />
     41      </CustomCommands>
     42    </CustomCommands>
    3043    <ConsolePause>false</ConsolePause>
    3144  </PropertyGroup>
     
    8093    <Compile Include="src\NetConnections\Servers\Web\MimeType.cs" />
    8194    <Compile Include="src\CustomCommands\EnableRendering.cs" />
     95    <Compile Include="src\PersistentData\PersistentContainer.cs" />
     96    <Compile Include="src\PersistentData\KnownPlayers.cs" />
     97    <Compile Include="src\StateManager.cs" />
    8298  </ItemGroup>
    8399  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
     
    90106    <Folder Include="src\NetConnections\Servers\Telnet\" />
    91107    <Folder Include="src\NetConnections\Servers\Web\" />
     108    <Folder Include="src\PersistentData\" />
    92109  </ItemGroup>
    93110</Project>
  • binary-improvements/7dtd-server-fixes/src/MapRendering/MapRenderBlockBuffer.cs

    r130 r142  
    3737                                Directory.CreateDirectory (folder);
    3838                                if (!fileName.Equals (currentBlockMap)) {
    39                                         if (currentBlockMap.Length > 0)
    40                                                 saveTextureToFile (currentBlockMap);
     39                                        SaveBlock();
    4140                                        loadTextureFromFile (fileName);
    4241                                }
  • binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Telnet/Telnet.cs

    r132 r142  
    113113                        string res = "";
    114114                        for (int i = 0; i < line.Length; i++) {
    115                                 if (line [i] >= ' ' && line [i] != '\'' && line [i] <= '~') {
     115                                if (line [i] >= ' ' && line [i] != '\'') {
    116116                                        res += line [i];
    117117                                }
  • binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Telnet/TelnetConnection.cs

    r132 r142  
    22using System.Net;
    33using System.Net.Sockets;
     4using System.Text;
    45
    56namespace AllocsFixes.NetConnections.Servers.Telnet
     
    1112                private TcpClient client;
    1213                private NetworkStream stream;
    13                 private string lineBuffer = string.Empty;
     14                private int lineBufferLength = 0;
     15                private byte[] lineBuffer = new byte[200];
    1416                private EndPoint endpoint;
    1517
     
    3840                        try {
    3941                                if (!IsClosed () && stream.CanWrite) {
    40                                         for (int i = 0; i < s.Length; i++) {
    41                                                 WriteByte ((byte)s [i]);
    42                                         }
     42                                        byte[] utfData = Encoding.UTF8.GetBytes (s);
     43                                        stream.Write(utfData, 0, utfData.Length);
    4344                                        WriteByte (13);
    4445                                        WriteByte (10);
     
    7980                                int b = stream.ReadByte ();
    8081                                if (b == '\r' || b == '\n') {
    81                                         if (lineBuffer.Length > 0)
     82                                        if (lineBufferLength > 0)
    8283                                                return true;
    83                                 } else {
    84                                         lineBuffer += (char)b;
     84                                } else if (b >= 0) {
     85                                        lineBuffer[lineBufferLength] = (byte)b;
     86                                        lineBufferLength++;
    8587                                }
    8688                        }
     
    9092                public string GetLine ()
    9193                {
    92                         string res = lineBuffer;
    93                         lineBuffer = string.Empty;
     94                        string res = Encoding.UTF8.GetString(lineBuffer, 0, lineBufferLength);;
     95                        lineBufferLength = 0;
    9496                        return res;
    9597                }
  • binary-improvements/7dtd-server-fixes/src/NetConnections/Servers/Web/Web.cs

    r140 r142  
    113113                {
    114114                        try {
    115                                 Log.Out ("NOT IMPLEMENTED: Web.WriteToClient");
     115                                //Log.Out ("NOT IMPLEMENTED: Web.WriteToClient");
    116116                        } catch (Exception e) {
    117117                                Log.Out ("Error in Web.WriteToClient: " + e);
     
    122122                {
    123123                        try {
    124                                 Log.Out ("NOT IMPLEMENTED: Web.WriteToClient_Single");
     124                                //Log.Out ("NOT IMPLEMENTED: Web.WriteToClient_Single");
    125125                        } catch (Exception e) {
    126126                                Log.Out ("Error in Web.WriteToClient_Single: " + e);
  • binary-improvements/assembly-patcher/Assembly-Patcher.csproj

    r115 r142  
    3131    <Externalconsole>true</Externalconsole>
    3232  </PropertyGroup>
     33  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Version|AnyCPU' ">
     34    <DebugType>none</DebugType>
     35    <Optimize>false</Optimize>
     36    <OutputPath>..\bin\Release</OutputPath>
     37    <WarningLevel>4</WarningLevel>
     38    <Externalconsole>true</Externalconsole>
     39  </PropertyGroup>
    3340  <ItemGroup>
    3441    <Reference Include="System" />
  • binary-improvements/assembly-patcher/Main.cs

    r133 r142  
    5050                        TypeDefinition type = module.GetType ("GameManager");
    5151                        addHook (type, "SavePlayerData", true, 2, true, typeof(AllocsFixes.PlayerDataStuff).GetMethod ("GM_SavePlayerData"));
    52                         addHook (type, "Awake", true, 0, true, typeof(AllocsFixes.CommandExtensions).GetMethod ("InitCommandExtensions"));
     52                        addHook (type, "Awake", true, 0, true, typeof(AllocsFixes.StateManager).GetMethod ("Awake"));
     53                        addHook (type, "Shutdown", true, 0, false, typeof(AllocsFixes.StateManager).GetMethod ("Shutdown"));
    5354                }
    5455
  • binary-improvements/server-fixes.sln

    r115 r142  
    1212                Debug|x86 = Debug|x86
    1313                Release|x86 = Release|x86
     14                Release_Version|Any CPU = Release_Version|Any CPU
    1415        EndGlobalSection
    1516        GlobalSection(ProjectConfigurationPlatforms) = postSolution
    1617                {81DA7F87-1A66-4920-AADA-6EAF1971F8D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    1718                {81DA7F87-1A66-4920-AADA-6EAF1971F8D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
     19                {81DA7F87-1A66-4920-AADA-6EAF1971F8D0}.Release_Version|Any CPU.ActiveCfg = Release_Version|Any CPU
     20                {81DA7F87-1A66-4920-AADA-6EAF1971F8D0}.Release_Version|Any CPU.Build.0 = Release_Version|Any CPU
    1821                {81DA7F87-1A66-4920-AADA-6EAF1971F8D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
    1922                {81DA7F87-1A66-4920-AADA-6EAF1971F8D0}.Release|Any CPU.Build.0 = Release|Any CPU
     
    2225                {FFDBEC4C-E28E-4BF5-A271-33D9368F7F6D}.Debug|x86.ActiveCfg = Debug|x86
    2326                {FFDBEC4C-E28E-4BF5-A271-33D9368F7F6D}.Debug|x86.Build.0 = Debug|x86
     27                {FFDBEC4C-E28E-4BF5-A271-33D9368F7F6D}.Release_Version|Any CPU.ActiveCfg = Release_Version|Any CPU
     28                {FFDBEC4C-E28E-4BF5-A271-33D9368F7F6D}.Release_Version|Any CPU.Build.0 = Release_Version|Any CPU
    2429                {FFDBEC4C-E28E-4BF5-A271-33D9368F7F6D}.Release|Any CPU.ActiveCfg = Release|x86
    2530                {FFDBEC4C-E28E-4BF5-A271-33D9368F7F6D}.Release|Any CPU.Build.0 = Release|x86
  • binary-improvements/server-fixes.userprefs

    r133 r142  
    11<Properties>
    2   <MonoDevelop.Ide.Workspace ActiveConfiguration="Release" />
    3   <MonoDevelop.Ide.Workbench ActiveDocument="7dtd-server-fixes/src/NetConnections/Servers/Web/Web.cs">
     2  <MonoDevelop.Ide.Workspace ActiveConfiguration="Release_Version" />
     3  <MonoDevelop.Ide.Workbench ActiveDocument="assembly-patcher/Main.cs">
    44    <Files>
    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" />
     5      <File FileName="assembly-patcher/Main.cs" Line="21" Column="4" />
     6      <File FileName="7dtd-server-fixes/src/NetConnections/NetTelnetServer.cs" Line="28" Column="1" />
    77      <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" />
     8      <File FileName="7dtd-server-fixes/src/NetConnections/Servers/Telnet/TelnetConnection.cs" Line="95" Column="1" />
     9      <File FileName="7dtd-server-fixes/src/MapRendering/MapRendering.cs" Line="21" Column="1" />
     10      <File FileName="7dtd-server-fixes/src/MapRendering/MapRenderBlockBuffer.cs" Line="40" Column="1" />
     11      <File FileName="7dtd-server-fixes/src/NetConnections/Servers/Web/Web.cs" Line="77" Column="59" />
     12      <File FileName="7dtd-server-fixes/src/NetConnections/Servers/Web/StaticHandler.cs" Line="54" Column="1" />
     13      <File FileName="7dtd-server-fixes/src/PersistentData/PersistentContainer.cs" Line="45" Column="19" />
     14      <File FileName="7dtd-server-fixes/src/PersistentData/KnownPlayers.cs" Line="20" Column="6" />
     15      <File FileName="7dtd-server-fixes/src/StateManager.cs" Line="28" Column="1" />
    1216    </Files>
    1317    <Pads>
Note: See TracChangeset for help on using the changeset viewer.