Explorar el Código

升级服务器和客户端MongoDB.Driver版本,解决mongodb编译报错NU1903导致无法编译的问题

johnclot69 hace 1 año
padre
commit
d76633ac5b

+ 6 - 9
DotNet/ThirdParty/DotNet.ThirdParty.csproj

@@ -60,6 +60,10 @@
         <Link>Runtimes\win\native\kcp.dll</Link>
         <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       </Content>
+      <Content Include="..\..\Unity\Assets\Plugins\x86_64\RecastDll.dll">
+        <Link>Runtimes\win\native\RecastDll.dll</Link>
+        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+      </Content>
       <Content Include="..\..\Unity\Assets\Plugins\x86_64\libkcp.so">
         <Link>Runtimes\linux\native\libkcp.so</Link>
         <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -68,21 +72,14 @@
         <Link>Runtimes\linux\native\libRecastDll.so</Link>
         <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       </Content>
-      <Content Include="..\..\Unity\Assets\Plugins\x86_64\RecastDll.dll">
-        <Link>Runtimes\win\native\RecastDll.dll</Link>
-        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      </Content>
     </ItemGroup>
 
     <ItemGroup>
-        <PackageReference Include="SuperSocket.ClientEngine" Version="0.10.0" />
-        <PackageReference Include="SuperSocket.ProtoBase" Version="1.7.0.17" />
-        <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
         <PackageReference Include="CommandLineParser" Version="2.9.1" />
         <PackageReference Include="EPPlus" Version="7.0.3" />
-        <PackageReference Include="MongoDB.Driver" Version="2.17.1" />
+        <PackageReference Include="MongoDB.Driver" Version="2.22.0" />
         <PackageReference Include="NLog" Version="5.2.7" />
-        <PackageReference Include="protobuf-net" Version="2.4.8" />
+        <PackageReference Include="protobuf-net" Version="3.2.30" />
         <PackageReference Include="SharpZipLib" Version="1.4.2" />
         <PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.0.1" />
         <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />

BIN
Unity/Assets/Plugins/MongoDB/MongoDB.Bson.dll


+ 2 - 0
Unity/Assets/Scripts/Core/Serialize/MongoHelper.cs

@@ -112,6 +112,8 @@ namespace ET
 
         public static void Init()
         {
+            var objectSerializer = new ObjectSerializer(type => ObjectSerializer.DefaultAllowedTypes(type) || type.FullName.StartsWith("ET"));
+            BsonSerializer.RegisterSerializer(objectSerializer);
         }
 
         public static void RegisterStruct<T>() where T : struct