Skip to content

Commit d23ca34

Browse files
committed
setup/patcher update.
1 parent 73074c7 commit d23ca34

29 files changed

+517
-463
lines changed

.editorconfig

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,83 @@
11
root = true
22

33
[*.cs]
4+
5+
#Core editorconfig formatting - indentation
6+
7+
#use hard tabs for indentation
8+
indent_style = tab
9+
indent_size = 4
10+
11+
#Formatting - new line options
12+
13+
#place else statements on a new line
14+
csharp_new_line_before_else = true
15+
#place catch statements on a new line
16+
csharp_new_line_before_catch = true
17+
#place finally statements on a new line
18+
csharp_new_line_before_finally = true
19+
20+
#require braces to be on a new line for types (Allman)
21+
#everything else uses K&R
22+
csharp_new_line_before_open_brace = types
23+
24+
#Formatting - spacing options
25+
26+
#require NO space between a cast and the value
27+
csharp_space_after_cast = false
28+
#require a space before the colon for bases or interfaces in a type declaration
29+
csharp_space_after_colon_in_inheritance_clause = true
30+
#require a space after a keyword in a control flow statement such as a for loop
31+
csharp_space_after_keywords_in_control_flow_statements = true
32+
#require a space before the colon for bases or interfaces in a type declaration
33+
csharp_space_before_colon_in_inheritance_clause = true
34+
#remove space within empty argument list parentheses
35+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
36+
#remove space between method call name and opening parenthesis
37+
csharp_space_between_method_call_name_and_opening_parenthesis = false
38+
#do not place space characters after the opening parenthesis and before the closing parenthesis of a method call
39+
csharp_space_between_method_call_parameter_list_parentheses = false
40+
#remove space within empty parameter list parentheses for a method declaration
41+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
42+
#place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list.
43+
csharp_space_between_method_declaration_parameter_list_parentheses = false
44+
45+
#Formatting - wrapping options
46+
47+
#leave code block on single line
48+
csharp_preserve_single_line_blocks = true
49+
#leave statements and member declarations on the same line
50+
csharp_preserve_single_line_statements = true
51+
52+
#Style - expression bodied member options
53+
54+
#prefer block bodies for constructors
55+
csharp_style_expression_bodied_constructors = false:suggestion
56+
#prefer expression-bodied members for methods when they will be a single line
57+
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
58+
#prefer expression-bodied members for properties when they will be a single line
59+
csharp_style_expression_bodied_properties = when_on_single_line:suggestion
60+
#prefer expression-bodied members for indexers when they will be a single line
61+
csharp_style_expression_bodied_indexers = when_on_single_line:suggestion
62+
#prefer expression-bodied members for accessors when they will be a single line
63+
csharp_style_expression_bodied_accessors = when_on_single_line:suggestion
64+
65+
#Style - expression level options
66+
67+
#prefer out variables to be declared inline in the argument list of a method call when possible
68+
csharp_style_inlined_variable_declaration = true:suggestion
69+
#prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them
70+
dotnet_style_predefined_type_for_member_access = true:suggestion
71+
72+
#Style - implicit and explicit types
73+
74+
#prefer explicit type over var to declare variables with built-in system types such as int
75+
csharp_style_var_for_built_in_types = false:suggestion
76+
#prefer explicit type over var when the type is already mentioned on the right-hand side of a declaration
77+
csharp_style_var_when_type_is_apparent = true:none
78+
79+
[*.json]
480
indent_style = tab
5-
indent_size = 4
81+
# unfortuantely anything other than tab_width and indent_size 1 causes VS to become whimsical about indenting
82+
indent_size = 1
83+
tab_width = 1

.gitattributes

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
# Auto detect text files and perform LF normalization
2-
* text=auto
3-
4-
# Custom for Visual Studio
5-
*.cs diff=csharp
6-
7-
# Standard to msysgit
8-
*.doc diff=astextplain
9-
*.DOC diff=astextplain
10-
*.docx diff=astextplain
11-
*.DOCX diff=astextplain
12-
*.dot diff=astextplain
13-
*.DOT diff=astextplain
14-
*.pdf diff=astextplain
15-
*.PDF diff=astextplain
16-
*.rtf diff=astextplain
17-
*.RTF diff=astextplain
1+
solutions/ReleaseExtras/Terraria text eol=lf
2+
solutions/ReleaseExtras/tModLoader-mono text eol=lf
3+
solutions/ReleaseExtras/tModLoader-kick text eol=lf

.gitignore

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@
66
*.suo
77
*.cache
88
*.force
9-
solutions/**/*.zip
109
installer2/*.class
1110
installer2/*.jar
12-
/solutions/packages
1311
solutions/documentation/html
1412
solutions/documentation/*.tmp
15-
solutions/*.zip
16-
solutions/.vs/**/*
17-
solutions/.idea/**/*
13+
solutions/**/*.zip
14+
solutions/**/*.tar.gz
15+
**/packages/
16+
**/.vs/
17+
**/.idea/
18+
/test/Terraria.xml
19+
/test/Test Local/Players
20+
/test/Test Local/Worlds
21+
/test/Test Local/Logs
22+
/test/Test Local/*.json
23+
/test/Test Local/Mods
24+
/test/Test Local/Mod Configs
25+
/ExampleMod/Fonts/ExampleFont.xnb
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
using Mono.Cecil;
2+
using MonoMod;
3+
using MonoMod.RuntimeDetour.HookGen;
4+
using System.IO;
5+
using XnaToFna;
6+
7+
namespace HookGenWrapper
8+
{
9+
/// <summary>
10+
/// HookGen/MonoMod uses Cecil 0.10 while ILSpy uses Cecil 0.9, so separate projects are required
11+
/// </summary>
12+
public static class HookGenWrapper
13+
{
14+
public static void HookGen(string inputPath, string outputPath, string refsDir)
15+
{
16+
using (MonoModder mm = new MonoModder {
17+
InputPath = inputPath,
18+
OutputPath = outputPath,
19+
ReadingMode = ReadingMode.Deferred,
20+
21+
MissingDependencyThrow = false,
22+
}) {
23+
mm.Read();
24+
mm.MapDependencies();
25+
mm.DependencyCache["MonoMod.RuntimeDetour"] = ModuleDefinition.ReadModule(Path.Combine(refsDir, "MonoMod.RuntimeDetour.dll"));
26+
27+
HookGenerator gen = new HookGenerator(mm, "TerrariaHooks") {
28+
HookPrivate = true,
29+
};
30+
gen.Generate();
31+
gen.OutputModule.Write(outputPath);
32+
}
33+
}
34+
35+
public static void XnaToFna(string inputPath, string refsDir)
36+
{
37+
using (var xnaToFnaUtil = new XnaToFnaUtil {
38+
HookCompat = false,
39+
HookHacks = false,
40+
HookEntryPoint = false,
41+
HookBinaryFormatter = false,
42+
HookReflection = false,
43+
AddAssemblyReference = false
44+
})
45+
{
46+
xnaToFnaUtil.ScanPath(Path.Combine(refsDir, "FNA.dll"));
47+
xnaToFnaUtil.ScanPath(inputPath);
48+
xnaToFnaUtil.RelinkAll();
49+
}
50+
}
51+
}
52+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{A386559E-0850-47AD-8F5B-D1492FA27980}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>HookGenWrapper</RootNamespace>
11+
<AssemblyName>HookGenWrapper</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<Deterministic>true</Deterministic>
15+
<TargetFrameworkProfile />
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<ItemGroup>
27+
<Reference Include="Mono.Cecil">
28+
<HintPath>..\..\references\Mono.Cecil.dll</HintPath>
29+
</Reference>
30+
<Reference Include="MonoMod">
31+
<HintPath>..\lib\MonoMod.exe</HintPath>
32+
</Reference>
33+
<Reference Include="MonoMod.RuntimeDetour.HookGen">
34+
<HintPath>..\lib\MonoMod.RuntimeDetour.HookGen.exe</HintPath>
35+
</Reference>
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Xml.Linq" />
39+
<Reference Include="System.Data.DataSetExtensions" />
40+
<Reference Include="Microsoft.CSharp" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Net.Http" />
43+
<Reference Include="System.Xml" />
44+
<Reference Include="XnaToFna">
45+
<HintPath>..\lib\XnaToFna.exe</HintPath>
46+
</Reference>
47+
</ItemGroup>
48+
<ItemGroup>
49+
<Compile Include="HookGenWrapper.cs" />
50+
<Compile Include="Properties\AssemblyInfo.cs" />
51+
</ItemGroup>
52+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
53+
</Project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("HookGenWrapper")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("HookGenWrapper")]
13+
[assembly: AssemblyCopyright("Copyright © 2018")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("a386559e-0850-47ad-8f5b-d1492fa27980")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

setup/Properties/Resources.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup/Properties/Settings.Designer.cs

Lines changed: 31 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup/Properties/Settings.settings

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626
<Setting Name="ServerVersion" Type="System.String" Scope="Application">
2727
<Value Profile="(Default)">1.3.5.1</Value>
2828
</Setting>
29+
<Setting Name="SteamClientWinMD5" Type="System.String" Scope="Application">
30+
<Value Profile="(Default)">3179a1ec67d5f80bfb77175c403d59c7</Value>
31+
</Setting>
32+
<Setting Name="GoGClientWinMD5" Type="System.String" Scope="Application">
33+
<Value Profile="(Default)">b92f242bc874dddbf08f705661b313a9</Value>
34+
</Setting>
35+
<Setting Name="DecompiledDiffCutoff" Type="System.DateTime" Scope="User">
36+
<Value Profile="(Default)">2015-01-01</Value>
37+
</Setting>
2938
<Setting Name="TerraCustomDiffCutoff" Type="System.DateTime" Scope="User">
3039
<Value Profile="(Default)">2015-01-01</Value>
3140
</Setting>

setup/Setup/DiffTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ namespace Terraria.ModLoader.Setup
1010
{
1111
public class DiffTask : Task
1212
{
13-
public static string[] extensions = { ".cs", ".csproj", ".ico", ".resx", ".png", "App.config", ".json" };
14-
public static string[] excluded = { "bin" + Path.DirectorySeparatorChar, "obj" + Path.DirectorySeparatorChar };
13+
public static string[] extensions = { ".cs", ".csproj", ".ico", ".resx", ".png", "App.config", ".json", ".bat", ".sh" };
14+
public static string[] excluded = { "bin" + Path.DirectorySeparatorChar, "obj" + Path.DirectorySeparatorChar, "Properties" + Path.DirectorySeparatorChar};
1515
public static readonly string RemovedFileList = "removed_files.list";
1616
public static readonly string HunkOffsetRegex = @"@@ -(\d+),(\d+) \+([_\d]+),(\d+) @@";
1717

0 commit comments

Comments
 (0)