Skip to content

Commit

Permalink
新版本提交
Browse files Browse the repository at this point in the history
  • Loading branch information
Difficulty-in-naming committed Jun 18, 2023
1 parent 3ac0cc5 commit 2629122
Show file tree
Hide file tree
Showing 463 changed files with 50,821 additions and 81 deletions.
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,13 @@ Temporary Items
obj
bin
packages
excel call/TestExcel_Auto.xlsx
CrossPlatformGenerator/Publish
/Dotnet/excel call/TestExcel_Auto.xlsx
/Dotnet/CrossPlatformGenerator/Publish
/Unity/Build/
/Unity/Library/
/Unity/Logs/
/Unity/Temp/
/Unity/Log.txt
/Unity/*.csproj
/Unity/*.sln
/Unity/UserSettings/
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<LangVersion>11</LangVersion>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Hocon" Version="2.0.3" />
<PackageReference Include="Hocon.Json" Version="2.1.2" />
<PackageReference Include="MemoryPack" Version="1.8.13" />
<PackageReference Include="MessagePack" Version="2.4.35" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="4.3.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.3.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.3.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
<PackageReference Include="Nett" Version="0.15.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="NPOI" Version="2.5.6" />
<PackageReference Include="protobuf-net" Version="3.1.25" />
<PackageReference Include="ScriptGenerateNetCore" Version="1.0.1" />
<PackageReference Include="sqlite-net" Version="1.6.292" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Publish\**" />
<Compile Include="..\..\Unity\Assets\Scripts\Core\**\*.cs">
<Link>Core\%(RecursiveDir)%(FileName)%(Extension)</Link>
</Compile>
</ItemGroup>

<ItemGroup>
Expand All @@ -38,4 +42,19 @@
</None>
</ItemGroup>

<ItemGroup>
<Reference Include="MemoryPack.Generator.Roslyn3">
<HintPath>..\..\Unity\Assets\Scripts\ThirdParty\MemoryPack.Generator.Roslyn3.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="MasterMemory" Version="2.1.2" />
<!-- Install MSBuild Task(with PrivateAssets="All", it means to use dependency only in build time). -->
<PackageReference Include="MasterMemory.MSBuild.Tasks" Version="2.1.2" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\Unity\Assets\Scripts\ThirdParty\MemoryPack.Generator.Roslyn3.dll">
<Link>MemoryPack.Generator.Roslyn3.dll</Link>
</Content>
</ItemGroup>
</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ public static class Batch
private static FileSystemWatcher _watcher;
public static void StartServer(string path)
{
Console.WriteLine("开启服务器成功");
path = Path.GetDirectoryName(path);
Console.WriteLine("开启服务器成功" + path);
_watcher = new FileSystemWatcher(path);
GC.KeepAlive(_watcher);
_watcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName | NotifyFilters.Size | NotifyFilters.CreationTime;
_watcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName |
NotifyFilters.Attributes | NotifyFilters.Security | NotifyFilters.Size | NotifyFilters.CreationTime;
_watcher.InternalBufferSize = 1024 * 1024 * 30;
// fsw.Path = path;
_watcher.Filter = "*.xlsx";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CDev_005CProject_005CGitea5_005CUnity_005CAssets_005CPlugins_005CMemoryPack_005CRuntime_005CMemoryPack_002EGenerator_005CMemoryPack_002EGenerator_002ERoslyn3_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CDev_005CProject_005CGitea5_005CUnity_005CExcel_005Cunity_002D4_002E8_002Dapi_005Cmscorlib_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=3F45D91B_002D6162_002D4431_002DB0DA_002D7F3645EBAE07_002Ff_003AGenerateConfig_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=84E99079_002DC450_002D4C56_002DA3FE_002D3880A52067BD_002Fd_003ACore_002Ff_003ACodeGenerate_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=84E99079_002DC450_002D4C56_002DA3FE_002D3880A52067BD_002Fd_003ACore_002Ff_003AConfig_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
Expand All @@ -8,6 +10,8 @@
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=84E99079_002DC450_002D4C56_002DA3FE_002D3880A52067BD_002Fd_003ACore_002Ff_003ASQLite_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=84E99079_002DC450_002D4C56_002DA3FE_002D3880A52067BD_002Fd_003ACore_002Ff_003AUtility_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=84E99079_002DC450_002D4C56_002DA3FE_002D3880A52067BD_002Fd_003ACore_002Ff_003AWorkBookCore_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:Boolean x:Key="/Default/CodeInspection/HotReload/DebugHotReloadEnabled/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/HotReload/RuntimeHotReloadEnabled/@EntryValue">True</s:Boolean>
<s:Int64 x:Key="/Default/CodeStyle/Naming/CSharpAutoNaming/AutoNamingCompletedVersion/@EntryValue">2</s:Int64>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=EnumMember/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=Locals/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
Expand All @@ -23,4 +27,6 @@
&lt;Assembly Path="C:\Users\Unity1\.nuget\packages\microsoft.extensions.logging\2.2.0\lib\netstandard2.0\Microsoft.Extensions.Logging.dll" /&gt;&#xD;
&lt;Assembly Path="C:\Users\Unity1\.nuget\packages\microsoft.extensions.logging.abstractions\2.2.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll" /&gt;&#xD;
&lt;Assembly Path="C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.5\ref\net6.0\System.Collections.dll" /&gt;&#xD;
&lt;Assembly Path="C:\Users\Administrator\.nuget\packages\mastermemory.annotations\2.4.4\lib\netstandard2.0\MasterMemory.Annotations.dll" /&gt;&#xD;
&lt;Assembly Path="C:\Users\Administrator\.nuget\packages\memorypack.core\1.7.5\lib\net7.0\MemoryPack.Core.dll" /&gt;&#xD;
&lt;/AssemblyExplorer&gt;</s:String></wpf:ResourceDictionary>
File renamed without changes.
7 changes: 7 additions & 0 deletions Dotnet/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "7.0.0",
"rollForward": "latestMajor",
"allowPrerelease": true
}
}
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ How To Use
===
在Config中修改GeneratorType的属性去生成不同的类型的数据文件

FAQ
Unity中使用MemoryPack
===
Q:我的CSV使用的是空格作为分隔符.使用这个项目可以正常导出数据文件吗
A:可以,你只需要修改Config.txt中的CSVDelimiters属性的格式为空格就可以了
1.修改Build.cmd中的Unity路径/或者自己导入Unity然后将项目导出
2.修改Config的导出类型

正在计划
FAQ
===
- 使用字节流导出sqlite
Q:我的CSV使用的是空格作为分隔符.使用这个项目可以正常导出数据文件吗
A:可以,你只需要修改Config.txt中的CSVDelimiters属性的格式为空格就可以了
2 changes: 2 additions & 0 deletions Unity/Assembly-CSharp.Player.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Cscripts_005Cjson_002Enet_0020converter/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
2 changes: 2 additions & 0 deletions Unity/Assembly-CSharp.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Cscripts_005Cjson_002Enet_0020converter/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
8 changes: 8 additions & 0 deletions Unity/Assets/Plugins.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Unity/Assets/Plugins/MemoryPack.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Unity/Assets/Plugins/MemoryPack/Runtime.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Unity/Assets/Plugins/MemoryPack/Runtime/MemoryPack.Core.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

154 changes: 154 additions & 0 deletions Unity/Assets/Plugins/MemoryPack/Runtime/MemoryPack.Core/Attributes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;

#nullable enable
namespace MemoryPack {

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, AllowMultiple = false, Inherited = false)]
public sealed class MemoryPackableAttribute : Attribute
{
public GenerateType GenerateType { get; }
public SerializeLayout SerializeLayout { get; }

// ctor parameter count is used in MemoryPackGenerator.Parser TypeMeta for detect which ctor used.
// if modify ctor, be careful.

public MemoryPackableAttribute(GenerateType generateType = GenerateType.Object, SerializeLayout serializeLayout = SerializeLayout.Sequential)
{
this.GenerateType = generateType;
this.SerializeLayout = (generateType == GenerateType.VersionTolerant)
? SerializeLayout.Explicit
: serializeLayout;
}

// set SerializeLayout only allows Object
public MemoryPackableAttribute(SerializeLayout serializeLayout)
{
this.GenerateType = GenerateType.Object;
this.SerializeLayout = serializeLayout;
}
}

public enum GenerateType
{
Object,
VersionTolerant,
CircularReference,
Collection,
NoGenerate
}

public enum SerializeLayout
{
Sequential, // default
Explicit
}

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
public sealed class MemoryPackUnionAttribute : Attribute
{
public ushort Tag { get; }
public Type Type { get; }

public MemoryPackUnionAttribute(ushort tag, Type type)
{
this.Tag = tag;
this.Type = type;
}
}

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class MemoryPackUnionFormatterAttribute : Attribute
{
public Type Type { get; }

public MemoryPackUnionFormatterAttribute(Type type)
{
this.Type = type;
}
}

[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed class MemoryPackAllowSerializeAttribute : Attribute
{
}

[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed class MemoryPackOrderAttribute : Attribute
{
public int Order { get; }

public MemoryPackOrderAttribute(int order)
{
this.Order = order;
}
}

#if !UNITY_2021_2_OR_NEWER

[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public abstract class MemoryPackCustomFormatterAttribute<T> : Attribute
{
public abstract IMemoryPackFormatter<T> GetFormatter();
}

[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public abstract class MemoryPackCustomFormatterAttribute<TFormatter, T> : Attribute
where TFormatter : IMemoryPackFormatter<T>
{
public abstract TFormatter GetFormatter();
}

#endif

// similar naming as System.Text.Json attribtues
// https://docs.microsoft.com/en-us/dotnet/api/system.text.json.serialization.jsonattribute

[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed class MemoryPackIgnoreAttribute : Attribute
{
}

[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed class MemoryPackIncludeAttribute : Attribute
{
}

[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
public sealed class MemoryPackConstructorAttribute : Attribute
{
}

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public sealed class MemoryPackOnSerializingAttribute : Attribute
{
}

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public sealed class MemoryPackOnSerializedAttribute : Attribute
{
}

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public sealed class MemoryPackOnDeserializingAttribute : Attribute
{
}

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public sealed class MemoryPackOnDeserializedAttribute : Attribute
{
}

// Others

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false, Inherited = false)]
public sealed class GenerateTypeScriptAttribute : Attribute
{
}

}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2629122

Please sign in to comment.