Changeset 113
- Timestamp:
- Jul 27, 2014, 11:30:15 AM (10 years ago)
- Location:
- binary-improvements
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/7dtd-server-fixes.csproj
r109 r113 59 59 <Compile Include="src\TelnetCommands\Reply.cs" /> 60 60 <Compile Include="src\TelnetCommands\Kill.cs" /> 61 <Compile Include="src\TelnetCommands\ListLandProtection.cs" /> 62 <Compile Include="src\TelnetCommands\RemoveLandProtection.cs" /> 61 63 </ItemGroup> 62 64 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -
binary-improvements/7dtd-server-fixes/src/CommandExtensions.cs
r109 r113 10 10 manager.m_GUIConsole.AddCommand (new GetTime (manager.m_GUIConsole)); 11 11 manager.m_GUIConsole.AddCommand (new Kill (manager.m_GUIConsole)); 12 manager.m_GUIConsole.AddCommand (new ListLandProtection (manager.m_GUIConsole)); 12 13 manager.m_GUIConsole.AddCommand (new ListPlayersExtended (manager.m_GUIConsole)); 14 manager.m_GUIConsole.AddCommand (new RemoveLandProtection (manager.m_GUIConsole)); 13 15 manager.m_GUIConsole.AddCommand (new Reply (manager.m_GUIConsole)); 14 16 manager.m_GUIConsole.AddCommand (new SayToPlayer (manager.m_GUIConsole)); -
binary-improvements/7dtd-server-fixes/src/TelnetCommands/Kill.cs
r112 r113 20 20 public override void Run (string[] _params) 21 21 { 22 m_Console.SendResult("Command \"kill\" is currently not implemented!"); 23 return; 24 /* 22 25 try { 23 26 if (_params.Length != 1) { … … 33 36 } 34 37 35 CommonMappingFunctions.GetEntityPlayer(ci).Kill(null); 38 EntityPlayer p = CommonMappingFunctions.GetEntityPlayer(ci); 39 p.Stats.Health.Value = 1; 40 p.Stats.SendAll(); 36 41 m_Console.SendResult ("Killed player " + _params[0]); 37 42 } catch (Exception e) { 38 43 Log.Out ("Error in Kill.Run: " + e); 39 } 44 }*/ 40 45 } 41 46 } -
binary-improvements/NamePatcher/ManualPatches.cs
r107 r113 61 61 public static void applyManualPatches (ModuleDefinition mainModule) 62 62 { 63 renameMember (mainModule.GetType ("ItemBlock").BaseType.Resolve (), "ItemBase");64 65 63 FieldDefinition fd; 66 64 MethodDefinition md; 65 bool renamed = false; 66 67 68 renamed = false; 69 foreach (TypeDefinition td in mainModule.Types) { 70 md = getMethodInType (td, (method, isConstructor, retType, paramCount, paramList) => { 71 return !isConstructor && method.IsPublic && method.IsStatic && paramCount == 0 && retType.Name.Equals ("Boolean") && method.Name.Equals ("CheckIfStartedAsDedicatedServer"); 72 } 73 ); 74 if (md != null) { 75 renameMember (td, "StaticDirectories"); 76 renamed = true; 77 break; 78 } 79 } 80 if (!renamed) 81 Console.WriteLine ("FAILED: StaticDirectories"); 82 renamed = false; 83 84 85 renameMember (mainModule.GetType ("ItemBlock").BaseType.Resolve (), "ItemBase"); 86 87 88 fd = getFieldInType (mainModule.GetType ("PersistentPlayerList"), (field, fieldType) => { 89 return fieldType.FullName.Contains ("Dictionary") && fieldType.FullName.Contains ("Vector3i") && fieldType.FullName.Contains ("PersistentPlayerData"); } 90 ); 91 if (fd != null) { 92 makeFieldPublic (fd); 93 renameMember (fd, "positionToLPBlockOwner"); 94 } else { 95 Console.WriteLine ("FAILED: PersistentPlayerList.positionToLPBlockOwner"); 96 } 67 97 68 98 … … 78 108 79 109 110 // Fields in PlayerDataFile 80 111 fd = getFieldInType (mainModule.GetType ("PlayerDataFile"), (field, fieldType) => { 81 112 return field.Name.Equals ("inventory") && fieldType.IsArray; } … … 109 140 110 141 142 // Fields in AdminTools 111 143 fd = getFieldInType (mainModule.GetType ("AdminTools"), (field, fieldType) => { 112 144 return fieldType.FullName.Contains ("List") && fieldType.FullName.Contains ("AdminToolsCommandPermissions"); } … … 120 152 121 153 154 // Fields and methods in World 122 155 fd = getFieldInType (mainModule.GetType ("World"), (field, fieldType) => { 123 156 return fieldType.FullName.Equals ("System.UInt64"); } … … 130 163 131 164 165 md = getMethodInType (mainModule.GetType ("World"), (method, isConstructor, retType, paramCount, paramList) => { 166 return !isConstructor && paramCount == 1 && paramList [0].ParameterType.Name.Equals ("PersistentPlayerData") && method.IsPrivate && retType.Name.Equals ("Boolean"); 167 } 168 ); 169 if (md != null) { 170 md.IsPrivate = false; 171 md.IsPublic = true; 172 renameMember (md, "LandClaimIsActive"); 173 } else { 174 Console.WriteLine ("FAILED: World.LandClaimIsActive()"); 175 } 176 177 178 md = getMethodInType (mainModule.GetType ("World"), (method, isConstructor, retType, paramCount, paramList) => { 179 return !isConstructor && paramCount == 1 && paramList [0].ParameterType.Name.Equals ("PersistentPlayerData") && method.IsPrivate && retType.Name.Equals ("Single"); 180 } 181 ); 182 if (md != null) { 183 md.IsPrivate = false; 184 md.IsPublic = true; 185 renameMember (md, "LandClaimPower"); 186 } else { 187 Console.WriteLine ("FAILED: World.LandClaimPower()"); 188 } 189 190 191 // Fields in GameManager 132 192 fd = getFieldInType (mainModule.GetType ("GameManager"), (field, fieldType) => { 133 193 return fieldType.FullName.Equals ("ConnectionManager"); } … … 141 201 142 202 203 // Fields in ConnectionManager 143 204 fd = getFieldInType (mainModule.GetType ("ConnectionManager"), (field, fieldType) => { 144 205 return fieldType.FullName.Equals ("GameManager"); } … … 176 237 TypeDefinition typeConsole = null; 177 238 239 // Fields in NetTelnetServer 178 240 fd = getFieldInType (mainModule.GetType ("NetTelnetServer"), (field, fieldType) => { 179 241 return NameNormalizer.makeValidName (fieldType.Name) != null; }
Note:
See TracChangeset
for help on using the changeset viewer.