Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyupe committed Mar 6, 2021
2 parents d64b525 + 84162de commit 93c05a2
Show file tree
Hide file tree
Showing 41 changed files with 13,409 additions and 2,925 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,11 @@ jobs:
with:
name: Bundle
path: bin\*.zip

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: bin\*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 0 additions & 11 deletions Cafe.Matcha.Packer/Cafe.Matcha.Packer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,6 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Global|AnyCPU'">
<OutputPath>bin\Release-Global\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
42 changes: 40 additions & 2 deletions Cafe.Matcha.Packer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,33 @@ namespace Cafe.Matcha.Packer

public class Program
{
private static void Main(string[] args)
private static void GenerateAssembly()
{
string version = DateTime.UtcNow.ToString("yy.M.d.Hmm");

var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\Cafe.Matcha\AssemblyCopyright.cs");
var template = @"using System.Reflection;
[assembly: AssemblyTitle(""Cafe.Matcha"")]
[assembly: AssemblyDescription(""Cafe.Matcha"")]
[assembly: AssemblyCompany(""FFCafe"")]
[assembly: AssemblyVersion(""{0}"")]
[assembly: AssemblyCopyright(""Copyright © FFCafe {1}"")]
namespace Cafe.Matcha
{
partial class Data {
public const string Version = ""{0}"";
}
}
";
var content = template.Replace("{0}", version).Replace("{1}", DateTime.Now.Year.ToString());
Console.WriteLine(content);
File.WriteAllText(path, content);
}

private static void Bundle(string env)
{
string env = args.Length >= 1 ? args[0] : "Release";
var root = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, env);
var entry = Path.Combine(root, "Cafe.Matcha.dll");
var version = FileVersionInfo.GetVersionInfo(entry);
Expand Down Expand Up @@ -45,5 +69,19 @@ private static void Main(string[] args)
}
}
}

private static void Main(string[] args)
{
string env = args.Length >= 1 ? args[0] : "Release";
if (env == "Assembly")
{
GenerateAssembly();
}
else
{
Bundle(env);
}
}

}
}
10 changes: 0 additions & 10 deletions Cafe.Matcha.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Global
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release-Global|Any CPU = Release-Global|Any CPU
Release-Global|x64 = Release-Global|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0A8BC2CF-BCBA-4A7F-974A-11F078BED997}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand All @@ -34,10 +32,6 @@ Global
{0A8BC2CF-BCBA-4A7F-974A-11F078BED997}.Release|Any CPU.Build.0 = Release|Any CPU
{0A8BC2CF-BCBA-4A7F-974A-11F078BED997}.Release|x64.ActiveCfg = Debug|Any CPU
{0A8BC2CF-BCBA-4A7F-974A-11F078BED997}.Release|x64.Build.0 = Debug|Any CPU
{0A8BC2CF-BCBA-4A7F-974A-11F078BED997}.Release-Global|Any CPU.ActiveCfg = Release-Global|Any CPU
{0A8BC2CF-BCBA-4A7F-974A-11F078BED997}.Release-Global|Any CPU.Build.0 = Release-Global|Any CPU
{0A8BC2CF-BCBA-4A7F-974A-11F078BED997}.Release-Global|x64.ActiveCfg = Release-Global|Any CPU
{0A8BC2CF-BCBA-4A7F-974A-11F078BED997}.Release-Global|x64.Build.0 = Release-Global|Any CPU
{5D469F03-878B-4652-AF39-20434C1EC28C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5D469F03-878B-4652-AF39-20434C1EC28C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D469F03-878B-4652-AF39-20434C1EC28C}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand All @@ -46,10 +40,6 @@ Global
{5D469F03-878B-4652-AF39-20434C1EC28C}.Release|Any CPU.Build.0 = Release|Any CPU
{5D469F03-878B-4652-AF39-20434C1EC28C}.Release|x64.ActiveCfg = Release|Any CPU
{5D469F03-878B-4652-AF39-20434C1EC28C}.Release|x64.Build.0 = Release|Any CPU
{5D469F03-878B-4652-AF39-20434C1EC28C}.Release-Global|Any CPU.ActiveCfg = Release-Global|Any CPU
{5D469F03-878B-4652-AF39-20434C1EC28C}.Release-Global|Any CPU.Build.0 = Release-Global|Any CPU
{5D469F03-878B-4652-AF39-20434C1EC28C}.Release-Global|x64.ActiveCfg = Release-Global|Any CPU
{5D469F03-878B-4652-AF39-20434C1EC28C}.Release-Global|x64.Build.0 = Release-Global|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
1 change: 1 addition & 0 deletions Cafe.Matcha/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AssemblyCopyright.cs
26 changes: 0 additions & 26 deletions Cafe.Matcha/AssemblyCopyright.cs

This file was deleted.

28 changes: 0 additions & 28 deletions Cafe.Matcha/AssemblyCopyright.tt

This file was deleted.

29 changes: 7 additions & 22 deletions Cafe.Matcha/Cafe.Matcha.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@
<PropertyGroup>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Global|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\bin\Release-Global\</OutputPath>
<Optimize>true</Optimize>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<DefineConstants>GLOBAL</DefineConstants>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Reference Include="Advanced Combat Tracker">
Expand Down Expand Up @@ -106,21 +95,19 @@
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyCopyright.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>AssemblyCopyright.tt</DependentUpon>
</Compile>
<Compile Include="AssemblyCopyright.cs" />
<Compile Include="Config.cs" />
<Compile Include="Constant\ActorControlType.cs" />
<Compile Include="Constant\EventType.cs" />
<Compile Include="Constant\FishEventBiteType.cs" />
<Compile Include="Constant\FishEventType.cs" />
<Compile Include="Constant\MatchaOpcode.cs" />
<Compile Include="Constant\Region.cs" />
<Compile Include="Constant\RequestType.cs" />
<Compile Include="Constant\Secret.cs" />
<Compile Include="Constant\Secret.Local.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="Network\State.cs" />
<Compile Include="Network\Universalis\Structures\UniversalisQueryResponse.cs" />
<Compile Include="Telemetry\Opcode.cs" />
<Compile Include="Utils\BindingTarget.cs" />
Expand Down Expand Up @@ -228,11 +215,8 @@
</Page>
</ItemGroup>
<ItemGroup>
<Content Include="AssemblyCopyright.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>AssemblyCopyright.cs</LastGenOutput>
</Content>
<Content Include="FodyWeavers.xml" />
<Resource Include="GitHub-Mark-32px.png" />
</ItemGroup>
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
Expand Down Expand Up @@ -267,13 +251,14 @@
</PackageReference>
</ItemGroup>
<PropertyGroup>
<PreBuildEvent>cd $(ProjectDir)Constant\
<PreBuildEvent>$(TargetDir)..\Cafe.Matcha.Packer Assembly
cd $(ProjectDir)Constant\

if not exist Secret.Local.cs (
type nul &gt; Secret.Local.cs
)</PreBuildEvent>
<PostBuildEvent>del $(TargetPath) /F
xcopy "$(TargetDir)confused\*.*" "$(TargetDir)" /E /Y /C
xcopy "$(TargetDir)confused\*.*" "$(TargetDir)" /E /Y /C
$(TargetDir)..\Cafe.Matcha.Packer $(ConfigurationName)</PostBuildEvent>
</PropertyGroup>
</Project>
19 changes: 19 additions & 0 deletions Cafe.Matcha/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,24 @@ public static void Save()
{
File.WriteAllText(configPath, JsonConvert.SerializeObject(Instance, Formatting.Indented));
}

public static string GetLanguageString()
{
switch (Instance.Language)
{
case FFXIV_ACT_Plugin.Common.Language.Chinese:
return "chs";
case FFXIV_ACT_Plugin.Common.Language.English:
return "en";
case FFXIV_ACT_Plugin.Common.Language.French:
return "fr";
case FFXIV_ACT_Plugin.Common.Language.German:
return "de";
case FFXIV_ACT_Plugin.Common.Language.Japanese:
return "ja";
default:
return "en";
}
}
}
}
95 changes: 62 additions & 33 deletions Cafe.Matcha/Constant/MatchaOpcode.cs
Original file line number Diff line number Diff line change
@@ -1,40 +1,69 @@
// Copyright (c) FFCafe. All rights reserved.
// Copyright (c) FFCafe. All rights reserved.
// Licensed under the AGPL-3.0 license. See LICENSE file in the project root for full license information.

namespace Cafe.Matcha.Constant
{
internal enum MatchaOpcode : ushort
using System.Collections.Generic;

internal enum MatchaOpcode
{
ActorControlSelf,
CEDirector,
CompanyAirshipStatus,
CompanySubmersibleStatus,
ContentFinderNotifyPop,
DirectorStart,
EventPlay,
Examine,
InitZone,
InventoryTransaction,
ItemInfo,
MarketBoardItemListing,
MarketBoardItemListingCount,
MarketBoardItemListingHistory,
PlayerSetup,
PlayerSpawn,
}

internal static class OpcodeStorage
{
#if GLOBAL
ActorControlSelf = 0x0165,
DirectorStart = 0x0399, //
ContentFinderNotifyPop = 0x145,
EventPlay = 0x02C3,
Examine = 0x038D, //
InitZone = 0x01CD,
ItemInfo = 0x02AA,
MarketBoardItemListingHistory = 0x0240,
MarketBoardItemListing = 0x00D7,
MarketBoardItemListingCount = 0x0244,
PlayerSpawn = 0x00B9,
PlayerSetup = 0x0071,
#else
ActorControlSelf = 0x007C,
CEDirector = 0x0144,
CompanyAirshipStatus = 0x0271,
CompanySubmersibleStatus = 0x0345,
ContentFinderNotifyPop = 0x02D0,
DirectorStart = 0x02f2,
EventPlay = 0x01B9,
Examine = 0x0316,
InitZone = 0x02D2,
InventoryTransaction = 0x00A8,
ItemInfo = 0x031A,
MarketBoardItemListing = 0x0158,
MarketBoardItemListingCount = 0x0280,
MarketBoardItemListingHistory = 0x01F3,
PlayerSetup = 0x01f9,
PlayerSpawn = 0x00D1,
#endif
public static Dictionary<ushort, MatchaOpcode> Global = new Dictionary<ushort, MatchaOpcode>
{
{ 0x03d5, MatchaOpcode.ActorControlSelf },
{ 0x01f5, MatchaOpcode.CEDirector },
{ 0x0206, MatchaOpcode.CompanyAirshipStatus },
{ 0x013b, MatchaOpcode.CompanySubmersibleStatus },
{ 0x026e, MatchaOpcode.ContentFinderNotifyPop },
{ 0x01d8, MatchaOpcode.DirectorStart },
{ 0x0276, MatchaOpcode.EventPlay },
{ 0x0261, MatchaOpcode.Examine },
{ 0x0233, MatchaOpcode.InitZone },
{ 0x02ee, MatchaOpcode.InventoryTransaction },
{ 0x0175, MatchaOpcode.ItemInfo },
{ 0x016b, MatchaOpcode.MarketBoardItemListing },
{ 0x00c0, MatchaOpcode.MarketBoardItemListingCount },
{ 0x01c3, MatchaOpcode.MarketBoardItemListingHistory },
{ 0x01e9, MatchaOpcode.PlayerSetup },
{ 0x01ab, MatchaOpcode.PlayerSpawn },
};
public static Dictionary<ushort, MatchaOpcode> China = new Dictionary<ushort, MatchaOpcode>
{
{ 0x007c, MatchaOpcode.ActorControlSelf },
{ 0x0144, MatchaOpcode.CEDirector },
{ 0x0271, MatchaOpcode.CompanyAirshipStatus },
{ 0x0345, MatchaOpcode.CompanySubmersibleStatus },
{ 0x02d0, MatchaOpcode.ContentFinderNotifyPop },
{ 0x02f2, MatchaOpcode.DirectorStart },
{ 0x01b9, MatchaOpcode.EventPlay },
{ 0x0316, MatchaOpcode.Examine },
{ 0x02d2, MatchaOpcode.InitZone },
{ 0x00a8, MatchaOpcode.InventoryTransaction },
{ 0x031a, MatchaOpcode.ItemInfo },
{ 0x0158, MatchaOpcode.MarketBoardItemListing },
{ 0x0280, MatchaOpcode.MarketBoardItemListingCount },
{ 0x01f3, MatchaOpcode.MarketBoardItemListingHistory },
{ 0x01f9, MatchaOpcode.PlayerSetup },
{ 0x00d1, MatchaOpcode.PlayerSpawn },
};
}
}
9 changes: 9 additions & 0 deletions Cafe.Matcha/Constant/Region.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Cafe.Matcha.Constant
{
public enum Region
{
Global,
China,
Korea
}
}

0 comments on commit 93c05a2

Please sign in to comment.