Changeset 83


Ignore:
Timestamp:
Jul 18, 2014, 3:48:29 AM (10 years ago)
Author:
alloc
Message:

server fixes

Location:
binary-improvements
Files:
3 added
3 deleted
7 edited

Legend:

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

    r81 r83  
    3131    <Reference Include="System" />
    3232    <Reference Include="Assembly-CSharp">
    33       <HintPath>..\assembly-patcher\bin\Release\Assembly-CSharp.dll</HintPath>
     33      <HintPath>..\NamePatcher\bin\Release\Assembly-CSharp.dll</HintPath>
     34    </Reference>
     35    <Reference Include="UnityEngine">
     36      <HintPath>..\assembly-patcher\bin\Release\UnityEngine.dll</HintPath>
    3437    </Reference>
    3538  </ItemGroup>
     
    3942    <Compile Include="src\AllocsTelnetConnection.cs" />
    4043    <Compile Include="src\TelnetCommands\GetTime.cs" />
    41     <Compile Include="src\AllocsRequestToSpawnPlayer.cs" />
    4244    <Compile Include="src\TelnetCommands\ListPlayersExtended.cs" />
    4345    <Compile Include="src\TelnetCommands\GetGamePrefs.cs" />
     46    <Compile Include="src\TelnetCommands\SayToPlayer.cs" />
     47    <Compile Include="src\AllocsLogFunctions.cs" />
    4448  </ItemGroup>
    4549  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  • binary-improvements/7dtd-server-fixes/src/AllocsNetTelnetServer.cs

    r81 r83  
    136136                console.AddCommand(new GetTime(console));
    137137                console.AddCommand(new ListPlayersExtended(console));
     138                console.AddCommand(new SayToPlayer(console));
    138139        }
    139140
  • binary-improvements/NamePatcher/NamePatcher.cs

    r77 r83  
    103103                                TypeDefinition typeConsole = mainModule.GetType (consoleTypeName);
    104104                                string consoleCommandTypeName = string.Empty;
     105                                foreach (MethodDefinition md in typeConsole.Methods) {
     106                                        if (!md.IsConstructor) {
     107                                                if (md.Parameters.Count == 3 && md.Parameters [0].ParameterType.Name.Equals ("NetworkPlayer")) {
     108                                                        Console.WriteLine ("Renaming console method -> ExecuteCmdFromClient");
     109                                                        NameNormalizer.setName (md, "ExecuteCmdFromClient");
     110                                                }
     111                                        }
     112                                }
    105113                                foreach (FieldDefinition fd in typeConsole.Fields) {
    106114                                        TypeReference fdType = fd.FieldType;
  • binary-improvements/assembly-patcher/Assembly-Patcher.userprefs

    r78 r83  
    11<Properties>
    22  <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|x86" />
    3   <MonoDevelop.Ide.Workbench ActiveDocument="AssemblyInfo.cs">
     3  <MonoDevelop.Ide.Workbench ActiveDocument="Main.cs">
    44    <Files>
    5       <File FileName="Main.cs" Line="38" Column="4" />
     5      <File FileName="Main.cs" Line="48" Column="3" />
    66      <File FileName="AssemblyInfo.cs" Line="21" Column="1" />
    77    </Files>
  • binary-improvements/assembly-patcher/Main.cs

    r76 r83  
    1313                        telnetPatch (module);
    1414                        connectLogPatch (module);
     15                        executionLogPatch( module);
    1516                        module.Write ("Assembly-CSharp.dll");
    1617                        Console.WriteLine ("Done");
     
    2627
    2728                        markTypePatched (module, type);
    28                         addHook (type, "RequestToSpawnPlayer", true, 5, true, typeof(AllocsRequestToSpawnPlayer).GetMethod ("RequestToSpawnPlayer"));
     29                        addHook (type, "RequestToSpawnPlayer", true, 5, true, typeof(AllocsLogFunctions).GetMethod ("RequestToSpawnPlayer"));
     30                }
     31
     32                private static void executionLogPatch (ModuleDefinition module)
     33                {
     34                        TypeDefinition type = module.GetType ("ConsoleSdtd");
     35
     36                        if (isPatched (type)) {
     37                                return;
     38                        }
     39
     40                        markTypePatched (module, type);
     41                        addHook (type, "ExecuteCmdFromClient", true, 3, false, typeof(AllocsLogFunctions).GetMethod ("ExecuteCmdFromClient"));
    2942                }
    3043
Note: See TracChangeset for help on using the changeset viewer.