This should allow the GeoIP.dat file to be found, and used the same way it used to on TShock 4. It appears I had missed including this in the upgrade, and simply allowing it to copy to the output will allow the system to start working again. Confirmed by enabling in config and joining via mobile (external network) and my country has appeared, N/A otherwise (local network) Note: only ipv4 was tested.
98 lines
No EOL
4.7 KiB
XML
98 lines
No EOL
4.7 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
|
|
<PropertyGroup>
|
|
<OutputType>Exe</OutputType>
|
|
<TargetFramework>net6.0</TargetFramework>
|
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
<Nullable>enable</Nullable>
|
|
<AssemblyName>TShock.Server</AssemblyName> <!-- TShock was initially decided on by a community poll, however tshock already exists as a folder and will clash -->
|
|
<RunPostBuildEvent>Always</RunPostBuildEvent>
|
|
<DebugType>embedded</DebugType>
|
|
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract> <!-- needed for sqlite native libs -->
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<ProjectReference Include="..\TerrariaServerAPI\TerrariaServerAPI\TerrariaServerAPI.csproj" ExcludeFromSingleFile="true" />
|
|
<ProjectReference Include="..\TShockAPI\TShockAPI.csproj" ExcludeFromSingleFile="true" ReferenceOutputAssembly="false" /> <!-- allow api to rebuilt with this project, so ServerPlugins are refreshed -->
|
|
<Reference Include="HttpServer" ExcludeFromSingleFile="true">
|
|
<HintPath>..\prebuilts\HttpServer.dll</HintPath>
|
|
</Reference>
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<None Include="..\prebuilts\GeoIP.dat">
|
|
<Link>GeoIP.dat</Link>
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
</None>
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
|
|
<PackageReference Include="MySql.Data" Version="8.0.31" />
|
|
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.10" />
|
|
<PackageReference Include="ModFramework" Version="1.1.6" GeneratePathProperty="true" /> <!-- only used to extract out to ./bin. -->
|
|
<PackageReference Include="GetText.NET" Version="1.6.6" /> <!-- only used to extract out to ./bin. -->
|
|
|
|
<!-- the launcher doesnt need the direct OTAPI reference, but since PackageReference[ExcludeFromSingleFile] doesnt work, exclude the assets and copy manually -->
|
|
<PackageReference Include="OTAPI.Upcoming" Version="3.1.15" ExcludeAssets="all" GeneratePathProperty="true" />
|
|
<None Include="$(PkgOTAPI_Upcoming)\lib\net6.0\OTAPI.dll">
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
|
</None>
|
|
<None Include="$(PkgOTAPI_Upcoming)\lib\net6.0\OTAPI.Runtime.dll">
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
|
</None>
|
|
<None Include="$(PkgModFramework)\lib\net6.0\ModFramework.dll">
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
|
</None>
|
|
</ItemGroup>
|
|
|
|
<Target Name="CheckMsgfmtCallable">
|
|
<Exec Command="msgfmt --help > NUL" IgnoreExitCode="True" Condition=" '$(OS)' == 'Windows_NT' ">
|
|
<Output TaskParameter="ExitCode" PropertyName="MsgfmtExitCode" />
|
|
</Exec>
|
|
<Exec Command="msgfmt --help 2>/dev/null >/dev/null" IgnoreExitCode="True" Condition=" '$(OS)' != 'Windows_NT' ">
|
|
<Output TaskParameter="ExitCode" PropertyName="MsgfmtExitCode" />
|
|
</Exec>
|
|
</Target>
|
|
|
|
<!-- The condition for a Target can't come from the values of another target, so instead we have to put the same condition on all three of the items inside. -->
|
|
<Target
|
|
Name="GenerateMOFiles"
|
|
DependsOnTargets="CheckMsgfmtCallable"
|
|
AfterTargets="PostBuildEvent;Publish"
|
|
Inputs="..\i18n\**\*.po"
|
|
Outputs="$(OutDir)i18n\**\*.mo">
|
|
<ItemGroup Condition="'$(MsgfmtExitCode)' == '0'">
|
|
<POFiles Include="..\i18n\**\*.po" />
|
|
</ItemGroup>
|
|
<MakeDir Directories="$(OutDir)i18n/%(POFiles.RecursiveDir)" Condition="'$(MsgfmtExitCode)' == '0'" />
|
|
<Exec Command="msgfmt -o $(OutDir)i18n/%(RecursiveDir)%(Filename).mo @(POFiles)" Outputs="$(OutDir)i18n\**\*.mo" Condition="'$(MsgfmtExitCode)' == '0'">
|
|
<Output ItemName="Generated" TaskParameter="Outputs"/>
|
|
</Exec>
|
|
</Target>
|
|
|
|
<Target Name="CreateServerPlugins" AfterTargets="PostBuildEvent;Publish">
|
|
<MakeDir Directories="$(OutDir)ServerPlugins" />
|
|
<MakeDir Directories="$(PublishDir)ServerPlugins" />
|
|
<ItemGroup>
|
|
<ApiFiles Include="$(ProjectDir)../TShockAPI/bin/$(Configuration)/$(TargetFramework)/TShockAPI*" />
|
|
</ItemGroup>
|
|
<Copy SourceFiles="@(ApiFiles)" DestinationFolder="$(OutDir)ServerPlugins" ContinueOnError="true" />
|
|
<Copy SourceFiles="@(ApiFiles)" DestinationFolder="$(PublishDir)ServerPlugins" ContinueOnError="true" />
|
|
</Target>
|
|
<Target Name="CopyI18n" AfterTargets="Publish">
|
|
<ItemGroup>
|
|
<MOFiles Include="$(OutDir)**/*.mo"/>
|
|
</ItemGroup>
|
|
<Copy SourceFiles="@(MOFiles)" DestinationFolder="$(PublishDir)%(RecursiveDir)" />
|
|
</Target>
|
|
<Target Name="MoveBin" AfterTargets="Publish">
|
|
<ItemGroup>
|
|
<MoveBinaries Include="$(PublishDir)*" Exclude="$(PublishDir)\TShock.Server*;$(PublishDir)\GeoIP.dat" />
|
|
</ItemGroup>
|
|
<Move SourceFiles="@(MoveBinaries)" DestinationFolder="$(PublishDir)bin" ContinueOnError="true" />
|
|
</Target>
|
|
</Project> |