Merge pull request #115 from onerain88/unity-support

Unity support
oneRain 2021-04-08 13:58:18 +08:00 committed by GitHub
commit 93bc79f9c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
68 changed files with 495 additions and 200 deletions

View File

@ -12,7 +12,9 @@
<Folder Include="Task\" />
<Folder Include="Exception\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Libs\Newtonsoft.Json\LC.Newtonsoft.Json.csproj" />
</ItemGroup>
</Project>

View File

@ -14,7 +14,7 @@ namespace LeanCloud.Engine {
return new Dictionary<string, string> {
{ "runtime", $"dotnet-{Environment.Version}" },
{ "version", LCApplication.SDKVersion }
{ "version", LCInternalApplication.SDKVersion }
};
}
}

View File

@ -8,8 +8,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common\Common.csproj" />
<ProjectReference Include="..\Storage\Storage\Storage.csproj" />
<ProjectReference Include="..\Storage\Storage.Standard\Storage.Standard.csproj" />
</ItemGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />

View File

@ -99,7 +99,7 @@ namespace LeanCloud.Engine {
LCApplication.Initialize(Environment.GetEnvironmentVariable("LEANCLOUD_APP_ID"),
Environment.GetEnvironmentVariable("LEANCLOUD_APP_KEY"),
Environment.GetEnvironmentVariable("LEANCLOUD_API_SERVER"));
LCApplication.AddHeader(LCHookKeyName, Environment.GetEnvironmentVariable("LEANCLOUD_APP_HOOK_KEY"));
LCInternalApplication.AddHeader(LCHookKeyName, Environment.GetEnvironmentVariable("LEANCLOUD_APP_HOOK_KEY"));
Assembly assembly = Assembly.GetCallingAssembly();
ClassHooks = assembly.GetTypes()

View File

@ -23,7 +23,7 @@
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<!-- Include PDB in the built .nupkg -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<ReleaseVersion>0.7.1</ReleaseVersion>
<ReleaseVersion>0.7.2</ReleaseVersion>
<PackageId>LC.Google.Protobuf</PackageId>
</PropertyGroup>

View File

@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LibraryFrameworks>netstandard2.0</LibraryFrameworks>
<UnityBuild>AOT</UnityBuild>
<TargetFrameworks Condition="'$(LibraryFrameworks)'==''">netstandard2.0;net45;portable-net45+win8+wpa81+wp8</TargetFrameworks>
<TargetFrameworks Condition="'$(LibraryFrameworks)'!=''">$(LibraryFrameworks)</TargetFrameworks>
@ -35,7 +34,7 @@
<!-- including PDB files in NuGet for source link because symbolsource.org does not support portable PDBs -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<ReleaseVersion>0.7.1</ReleaseVersion>
<ReleaseVersion>0.7.2</ReleaseVersion>
</PropertyGroup>
<ItemGroup>
<None Remove="**\*.orig" />

View File

@ -30,7 +30,7 @@
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<CodeAnalysisRuleset>Newtonsoft.Json.ruleset</CodeAnalysisRuleset>
<ReleaseVersion>0.7.1</ReleaseVersion>
<ReleaseVersion>0.7.2</ReleaseVersion>
</PropertyGroup>
<ItemGroup>
<None Remove="**\*.orig" />

View File

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ReleaseVersion>0.7.2</ReleaseVersion>
<AssemblyName>LiveQuery.Standard</AssemblyName>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\LiveQuery\LiveQuery.csproj" />
<ProjectReference Include="..\..\Realtime\Realtime.Standard\Realtime.Standard.csproj" />
</ItemGroup>
</Project>

View File

@ -14,6 +14,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LiveQuery\LiveQuery.csproj" />
<ProjectReference Include="..\LiveQuery.Standard\LiveQuery.Standard.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ReleaseVersion>0.7.2</ReleaseVersion>
<AssemblyName>LiveQuery.Unity</AssemblyName>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\LiveQuery.AOT\LiveQuery.AOT.csproj" />
<ProjectReference Include="..\..\Realtime\Realtime.Unity\Realtime.Unity.csproj" />
</ItemGroup>
</Project>

View File

@ -80,7 +80,7 @@ namespace LeanCloud.LiveQuery {
data.Add("sessionToken", user.SessionToken);
}
string path = "LiveQuery/subscribe";
Dictionary<string, object> result = await LCApplication.HttpClient.Post<Dictionary<string, object>>(path,
Dictionary<string, object> result = await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path,
data: data);
if (result.TryGetValue("query_id", out object id)) {
Id = id as string;
@ -95,7 +95,7 @@ namespace LeanCloud.LiveQuery {
{ "query_id", Id }
};
string path = "LiveQuery/unsubscribe";
await LCApplication.HttpClient.Post<Dictionary<string, object>>(path,
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path,
data: data);
// 移除
liveQueries.Remove(Id);
@ -104,7 +104,7 @@ namespace LeanCloud.LiveQuery {
private static async Task Login() {
Dictionary<string, object> data = new Dictionary<string, object> {
{ "cmd", "login" },
{ "appId", LCApplication.AppId },
{ "appId", LCInternalApplication.AppId },
{ "installationId", DeviceId },
{ "clientTs", DateTimeOffset.Now.ToUnixTimeMilliseconds() },
{ "service", 1 }

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ReleaseVersion>0.7.1</ReleaseVersion>
<ReleaseVersion>0.7.2</ReleaseVersion>
<AssemblyName>Realtime</AssemblyName>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

View File

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ReleaseVersion>0.7.2</ReleaseVersion>
<AssemblyName>Realtime.Standard</AssemblyName>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Realtime\Realtime.csproj" />
<ProjectReference Include="..\..\Storage\Storage.Standard\Storage.Standard.csproj" />
</ItemGroup>
</Project>

View File

@ -43,19 +43,19 @@ namespace Realtime.Test {
}
}
[Test]
public async Task QueryCompact() {
string memberId = "m1";
LCIMConversationQuery query = new LCIMConversationQuery(client)
.WhereEqualTo("m", memberId);
query.Compact = true;
ReadOnlyCollection<LCIMConversation> conversations = await query.Find();
foreach (LCIMConversation conversation in conversations) {
Assert.True(conversation.MemberIds.Count == 0);
await conversation.Fetch();
Assert.True(conversation.MemberIds.Count > 0);
}
}
//[Test]
//public async Task QueryCompact() {
// string memberId = "m1";
// LCIMConversationQuery query = new LCIMConversationQuery(client)
// .WhereEqualTo("m", memberId);
// query.Compact = true;
// ReadOnlyCollection<LCIMConversation> conversations = await query.Find();
// foreach (LCIMConversation conversation in conversations) {
// Assert.True(conversation.MemberIds.Count == 0);
// await conversation.Fetch();
// Assert.True(conversation.MemberIds.Count > 0);
// }
//}
[Test]
public async Task QueryWithLastMessage() {

View File

@ -14,7 +14,7 @@ namespace Realtime.Test {
public Task<LCIMSignature> CreateConnectSignature(string clientId) {
long timestamp = DateTimeOffset.Now.ToUnixTimeSeconds();
string nonce = NewNonce();
string signature = GenerateSignature(LCApplication.AppId, clientId, string.Empty, timestamp.ToString(), nonce);
string signature = GenerateSignature(LCInternalApplication.AppId, clientId, string.Empty, timestamp.ToString(), nonce);
return Task.FromResult(new LCIMSignature {
Signature = signature,
Timestamp = timestamp,
@ -31,7 +31,7 @@ namespace Realtime.Test {
}
long timestamp = DateTimeOffset.Now.ToUnixTimeSeconds();
string nonce = NewNonce();
string signature = GenerateSignature(LCApplication.AppId, clientId, sortedMemberIds, timestamp.ToString(), nonce);
string signature = GenerateSignature(LCInternalApplication.AppId, clientId, sortedMemberIds, timestamp.ToString(), nonce);
return Task.FromResult(new LCIMSignature {
Signature = signature,
Timestamp = timestamp,
@ -48,7 +48,7 @@ namespace Realtime.Test {
}
long timestamp = DateTimeOffset.Now.ToUnixTimeSeconds();
string nonce = NewNonce();
string signature = GenerateSignature(LCApplication.AppId, clientId, conversationId, sortedMemberIds, timestamp.ToString(), nonce, action);
string signature = GenerateSignature(LCInternalApplication.AppId, clientId, conversationId, sortedMemberIds, timestamp.ToString(), nonce, action);
return Task.FromResult(new LCIMSignature {
Signature = signature,
Timestamp = timestamp,
@ -65,7 +65,7 @@ namespace Realtime.Test {
}
long timestamp = DateTimeOffset.Now.ToUnixTimeSeconds();
string nonce = NewNonce();
string signature = GenerateSignature(LCApplication.AppId, clientId, conversationId, sortedMemberIds, timestamp.ToString(), nonce, action);
string signature = GenerateSignature(LCInternalApplication.AppId, clientId, conversationId, sortedMemberIds, timestamp.ToString(), nonce, action);
return Task.FromResult(new LCIMSignature {
Signature = signature,
Timestamp = timestamp,

View File

@ -14,6 +14,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Realtime\Realtime\Realtime.csproj" />
<ProjectReference Include="..\Realtime\Realtime.csproj" />
<ProjectReference Include="..\..\Storage\Storage.Standard\Storage.Standard.csproj" />
</ItemGroup>
</Project>

View File

@ -6,7 +6,9 @@ namespace Realtime.Test {
public static class Utils {
internal static void SetUp() {
LCLogger.LogDelegate += Print;
LCApplication.Initialize("3zWMOXuO9iSdnjXM942i6DdI-gzGzoHsz", "bkwiNq4Tj417eUaHlTWS5sPm", "https://3zwmoxuo.lc-cn-n1-shared.com");
LCApplication.Initialize("3zWMOXuO9iSdnjXM942i6DdI-gzGzoHsz",
"bkwiNq4Tj417eUaHlTWS5sPm",
"https://3zwmoxuo.lc-cn-n1-shared.com");
}
internal static void TearDown() {

View File

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ReleaseVersion>0.7.2</ReleaseVersion>
<AssemblyName>Realtime.Unity</AssemblyName>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Realtime.AOT\Realtime.AOT.csproj" />
<ProjectReference Include="..\..\Storage\Storage.Unity\Storage.Unity.csproj" />
</ItemGroup>
</Project>

View File

@ -56,7 +56,7 @@ namespace LeanCloud.Realtime.Internal.Connection {
// 发送 ping 包
GenericCommand command = new GenericCommand {
Cmd = CommandType.Echo,
AppId = LCApplication.AppId,
AppId = LCInternalApplication.AppId,
PeerId = connection.id
};
try {

View File

@ -15,7 +15,7 @@ namespace LeanCloud.Realtime.Internal.Controller {
protected LCConnection Connection {
get {
return LCRealtime.GetConnection(LCApplication.AppId);
return LCRealtime.GetConnection(LCInternalApplication.AppId);
}
}
@ -28,7 +28,7 @@ namespace LeanCloud.Realtime.Internal.Controller {
protected GenericCommand NewCommand(CommandType cmd) {
return new GenericCommand {
Cmd = cmd,
AppId = LCApplication.AppId,
AppId = LCInternalApplication.AppId,
PeerId = Client.Id,
};
}

View File

@ -284,7 +284,7 @@ namespace LeanCloud.Realtime.Internal.Controller {
{ "client_id", Client.Id },
{ "cid", convId }
};
Dictionary<string, object> response = await LCApplication.HttpClient.Get<Dictionary<string, object>>(path,
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Get<Dictionary<string, object>>(path,
headers: headers, queryParams: queryParams);
List<object> results = response["results"] as List<object>;
return results.Select(item => {
@ -341,7 +341,7 @@ namespace LeanCloud.Realtime.Internal.Controller {
GenericCommand command = new GenericCommand {
Cmd = CommandType.Conv,
Op = OpType.Query,
AppId = LCApplication.AppId,
AppId = LCInternalApplication.AppId,
PeerId = Client.Id,
};
ConvCommand convMessage = new ConvCommand();

View File

@ -83,7 +83,7 @@ namespace LeanCloud.Realtime.Internal.Controller {
signature = await Client.SignatureFactory.CreateConnectSignature(Client.Id);
}
if (signature == null && !string.IsNullOrEmpty(Client.SessionToken)) {
Dictionary<string, object> ret = await LCApplication.HttpClient.Post<Dictionary<string, object>>("rtm/sign", data: new Dictionary<string, object> {
Dictionary<string, object> ret = await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>("rtm/sign", data: new Dictionary<string, object> {
{ "session_token", Client.SessionToken }
});
signature = new LCIMSignature {

View File

@ -22,8 +22,8 @@ namespace LeanCloud.Realtime.Internal.Router {
}
async Task<LCRTMServer> Fetch() {
string server = await LCApplication.AppRouter.GetRealtimeServer();
string url = $"{server}/v1/route?appId={LCApplication.AppId}&secure=1";
string server = await LCInternalApplication.AppRouter.GetRealtimeServer();
string url = $"{server}/v1/route?appId={LCInternalApplication.AppId}&secure=1";
HttpRequestMessage request = new HttpRequestMessage {
RequestUri = new Uri(url),

View File

@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\LiveQuery\LiveQuery\LiveQuery.csproj" />
<ProjectReference Include="..\..\LiveQuery\LiveQuery.Standard\LiveQuery.Standard.csproj" />
</ItemGroup>
</Project>

View File

@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Realtime\Realtime\Realtime.csproj" />
<ProjectReference Include="..\..\Realtime\Realtime.Standard\Realtime.Standard.csproj" />
</ItemGroup>
</Project>

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ReleaseVersion>0.7.1</ReleaseVersion>
<ReleaseVersion>0.7.2</ReleaseVersion>
<AssemblyName>Storage</AssemblyName>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
@ -41,8 +41,8 @@
<Compile Include="..\Storage\LCStatus.cs">
<Link>Storage\LCStatus.cs</Link>
</Compile>
<Compile Include="..\Storage\LCApplication.cs">
<Link>Storage\LCApplication.cs</Link>
<Compile Include="..\Storage\LCInternalApplication.cs">
<Link>Storage\LCInternalApplication.cs</Link>
</Compile>
<Compile Include="..\Storage\LCUser.cs">
<Link>Storage\LCUser.cs</Link>
@ -158,6 +158,12 @@
<Compile Include="..\Storage\Internal\Query\LCCompositionalCondition.cs">
<Link>Storage\Internal\Query\LCCompositionalCondition.cs</Link>
</Compile>
<Compile Include="..\Storage\Internal\Storage\StorageController.cs">
<Link>Storage\Internal\Storage\StorageController.cs</Link>
</Compile>
<Compile Include="..\Storage\Internal\Storage\IStorage.cs">
<Link>Storage\Internal\Storage\IStorage.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="..\Storage\Storage.csproj">

View File

@ -0,0 +1,16 @@
using LeanCloud.Storage.Internal.Storage;
namespace LeanCloud {
public class LCApplication {
public static void Initialize(string appId,
string appKey,
string server = null,
string masterKey = null) {
LCLogger.Debug("Application Initializes on Standard.");
LCInternalApplication.Initialize(appId, appKey, server, masterKey);
LCInternalApplication.StorageController = new StorageController(null);
}
}
}

View File

@ -0,0 +1,9 @@
using System;
namespace LeanCloud.Storage.Internal.Storage {
public class StandardStorage : IStorage {
public string GetStoragePath() {
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ReleaseVersion>0.7.2</ReleaseVersion>
<AssemblyName>Storage.Standard</AssemblyName>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Storage\Storage.csproj" />
</ItemGroup>
</Project>

View File

@ -8,13 +8,12 @@ namespace Storage.Test {
public class ACLTest {
[SetUp]
public void SetUp() {
LCLogger.LogDelegate += Utils.Print;
LCApplication.Initialize("ikGGdRE2YcVOemAaRbgp1xGJ-gzGzoHsz", "NUKmuRbdAhg1vrb2wexYo1jo", "https://ikggdre2.lc-cn-n1-shared.com");
Utils.SetUp();
}
[TearDown]
public void TearDown() {
LCLogger.LogDelegate -= Utils.Print;
Utils.TearDown();
}
[Test]

View File

@ -9,13 +9,12 @@ namespace Storage.Test {
public class CaptchaTest {
[SetUp]
public void SetUp() {
LCLogger.LogDelegate += Utils.Print;
LCApplication.Initialize(Utils.AppId, Utils.AppKey, Utils.AppServer);
Utils.SetUp();
}
[TearDown]
public void TearDown() {
LCLogger.LogDelegate -= Utils.Print;
Utils.TearDown();
}
//[Test]

View File

@ -12,13 +12,12 @@ namespace Storage.Test {
[SetUp]
public void SetUp() {
LCLogger.LogDelegate += Utils.Print;
LCApplication.Initialize("ikGGdRE2YcVOemAaRbgp1xGJ-gzGzoHsz", "NUKmuRbdAhg1vrb2wexYo1jo", "https://ikggdre2.lc-cn-n1-shared.com");
Utils.SetUp();
}
[TearDown]
public void TearDown() {
LCLogger.LogDelegate -= Utils.Print;
Utils.TearDown();
}
[Test]
@ -72,7 +71,7 @@ namespace Storage.Test {
[Test]
public async Task AWS() {
LCApplication.Initialize("UlCpyvLm8aMzQsW6KnP6W3Wt-MdYXbMMI", "PyCTYoNoxCVoKKg394PBeS4r");
LCInternalApplication.Initialize("UlCpyvLm8aMzQsW6KnP6W3Wt-MdYXbMMI", "PyCTYoNoxCVoKKg394PBeS4r");
LCFile file = new LCFile("avatar", AvatarFilePath);
await file.Save((count, total) => {
TestContext.WriteLine($"progress: {count}/{total}");

View File

@ -38,14 +38,12 @@ namespace Storage.Test {
[SetUp]
public void SetUp() {
LCLogger.LogDelegate += Utils.Print;
LCApplication.Initialize("ikGGdRE2YcVOemAaRbgp1xGJ-gzGzoHsz", "NUKmuRbdAhg1vrb2wexYo1jo",
"https://ikggdre2.lc-cn-n1-shared.com");
Utils.SetUp();
}
[TearDown]
public void TearDown() {
LCLogger.LogDelegate -= Utils.Print;
Utils.TearDown();
}
[Test]

View File

@ -14,16 +14,15 @@ namespace Storage.Test {
[SetUp]
public void SetUp() {
LCLogger.LogDelegate += Utils.Print;
LCApplication.Initialize(Utils.AppId, Utils.AppKey, Utils.AppServer, Utils.MasterKey);
LCApplication.UseMasterKey = true;
LCInternalApplication.UseMasterKey = true;
leaderboardName = $"Leaderboard_{DateTimeOffset.Now.DayOfYear}";
}
[TearDown]
public void TearDown() {
LCApplication.UseMasterKey = false;
LCLogger.LogDelegate -= Utils.Print;
LCInternalApplication.UseMasterKey = false;
Utils.TearDown();
}
[Test]

View File

@ -11,13 +11,12 @@ namespace Storage.Test {
public class ObjectTest {
[SetUp]
public void SetUp() {
LCLogger.LogDelegate += Utils.Print;
LCApplication.Initialize("ikGGdRE2YcVOemAaRbgp1xGJ-gzGzoHsz", "NUKmuRbdAhg1vrb2wexYo1jo", "https://ikggdre2.lc-cn-n1-shared.com");
Utils.SetUp();
}
[TearDown]
public void TearDown() {
LCLogger.LogDelegate -= Utils.Print;
Utils.TearDown();
}
[Test]

View File

@ -1,20 +1,18 @@
using NUnit.Framework;
using System.Collections.Generic;
using System.Threading.Tasks;
using LeanCloud;
using LeanCloud.Storage;
namespace Storage.Test {
public class OperationTest {
[SetUp]
public void SetUp() {
LCLogger.LogDelegate += Utils.Print;
LCApplication.Initialize("ikGGdRE2YcVOemAaRbgp1xGJ-gzGzoHsz", "NUKmuRbdAhg1vrb2wexYo1jo", "https://ikggdre2.lc-cn-n1-shared.com");
Utils.SetUp();
}
[TearDown]
public void TearDown() {
LCLogger.LogDelegate -= Utils.Print;
Utils.TearDown();
}
[Test]

View File

@ -2,20 +2,18 @@
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Threading.Tasks;
using LeanCloud;
using LeanCloud.Storage;
namespace Storage.Test {
public class QueryTest {
[SetUp]
public void SetUp() {
LCLogger.LogDelegate += Utils.Print;
LCApplication.Initialize("ikGGdRE2YcVOemAaRbgp1xGJ-gzGzoHsz", "NUKmuRbdAhg1vrb2wexYo1jo", "https://ikggdre2.lc-cn-n1-shared.com");
Utils.SetUp();
}
[TearDown]
public void TearDown() {
LCLogger.LogDelegate -= Utils.Print;
Utils.TearDown();
}
[Test]

View File

@ -1,20 +1,18 @@
using NUnit.Framework;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
using LeanCloud;
using LeanCloud.Storage;
namespace Storage.Test {
public class RelationTest {
[SetUp]
public void SetUp() {
LCLogger.LogDelegate += Utils.Print;
LCApplication.Initialize("ikGGdRE2YcVOemAaRbgp1xGJ-gzGzoHsz", "NUKmuRbdAhg1vrb2wexYo1jo", "https://ikggdre2.lc-cn-n1-shared.com");
Utils.SetUp();
}
[TearDown]
public void TearDown() {
LCLogger.LogDelegate -= Utils.Print;
Utils.TearDown();
}
[Test]

View File

@ -2,7 +2,6 @@
using System;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using LeanCloud;
using LeanCloud.Storage;
namespace Storage.Test {
@ -10,13 +9,12 @@ namespace Storage.Test {
public class RoleTest {
[SetUp]
public void SetUp() {
LCLogger.LogDelegate += Utils.Print;
LCApplication.Initialize("ikGGdRE2YcVOemAaRbgp1xGJ-gzGzoHsz", "NUKmuRbdAhg1vrb2wexYo1jo", "https://ikggdre2.lc-cn-n1-shared.com");
Utils.SetUp();
}
[TearDown]
public void TearDown() {
LCLogger.LogDelegate -= Utils.Print;
Utils.TearDown();
}
[Test]

View File

@ -1,20 +1,18 @@
using NUnit.Framework;
using System.Collections.Generic;
using System.Threading.Tasks;
using LeanCloud;
using LeanCloud.Storage;
namespace Storage.Test {
public class SMSTest {
[SetUp]
public void SetUp() {
LCLogger.LogDelegate += Utils.Print;
LCApplication.Initialize(Utils.AppId, Utils.AppKey, Utils.AppServer);
Utils.SetUp();
}
[TearDown]
public void TearDown() {
LCLogger.LogDelegate -= Utils.Print;
Utils.TearDown();
}
//[Test]

View File

@ -3,7 +3,6 @@ using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using LeanCloud;
using LeanCloud.Storage;
namespace Storage.Test {
@ -14,14 +13,12 @@ namespace Storage.Test {
[SetUp]
public void SetUp() {
LCLogger.LogDelegate += Utils.Print;
LCApplication.Initialize("ikGGdRE2YcVOemAaRbgp1xGJ-gzGzoHsz", "NUKmuRbdAhg1vrb2wexYo1jo",
"https://ikggdre2.lc-cn-n1-shared.com");
Utils.SetUp();
}
[TearDown]
public void TearDown() {
LCLogger.LogDelegate -= Utils.Print;
Utils.TearDown();
}
[Test]

View File

@ -17,6 +17,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Storage\Storage\Storage.csproj" />
<ProjectReference Include="..\Storage.Standard\Storage.Standard.csproj" />
</ItemGroup>
</Project>

View File

@ -39,13 +39,12 @@ namespace Storage.Test {
public class SubClassTest {
[SetUp]
public void SetUp() {
LCLogger.LogDelegate += Utils.Print;
LCApplication.Initialize("ikGGdRE2YcVOemAaRbgp1xGJ-gzGzoHsz", "NUKmuRbdAhg1vrb2wexYo1jo", "https://ikggdre2.lc-cn-n1-shared.com");
Utils.SetUp();
}
[TearDown]
public void TearDown() {
LCLogger.LogDelegate -= Utils.Print;
Utils.TearDown();
}
[Test]

View File

@ -10,13 +10,12 @@ namespace Storage.Test {
public class UserTest {
[SetUp]
public void SetUp() {
LCLogger.LogDelegate += Utils.Print;
LCApplication.Initialize("ikGGdRE2YcVOemAaRbgp1xGJ-gzGzoHsz", "NUKmuRbdAhg1vrb2wexYo1jo", "https://ikggdre2.lc-cn-n1-shared.com");
Utils.SetUp();
}
[TearDown]
public void TearDown() {
LCLogger.LogDelegate -= Utils.Print;
Utils.TearDown();
}
[Test]
@ -31,7 +30,7 @@ namespace Storage.Test {
string mobile = $"151{random.Next(10000000, 99999999)}";
user.Mobile = mobile;
await user.SignUp();
TestContext.WriteLine(user.Username);
TestContext.WriteLine(user.Password);
@ -48,7 +47,7 @@ namespace Storage.Test {
LCUser current = await LCUser.GetCurrent();
Assert.NotNull(current.ObjectId);
Assert.IsFalse(current.EmailVerified);
Assert.IsFalse(current.MobileVerified);
Assert.IsFalse(!current.MobileVerified);
Assert.AreEqual(current.Mobile, "15101006007");
}

View File

@ -24,5 +24,14 @@ namespace Storage.Test {
break;
}
}
internal static void SetUp() {
LCLogger.LogDelegate += Print;
LCApplication.Initialize(AppId, AppKey, AppServer);
}
internal static void TearDown() {
LCLogger.LogDelegate -= Print;
}
}
}

View File

@ -0,0 +1,16 @@
using LeanCloud.Storage.Internal.Storage;
namespace LeanCloud {
public class LCApplication {
public static void Initialize(string appId,
string appKey,
string server = null,
string masterKey = null) {
LCLogger.Debug("Application Initializes on Unity.");
LCInternalApplication.Initialize(appId, appKey, server, masterKey);
LCInternalApplication.StorageController = new StorageController(new UnityStorage());
}
}
}

View File

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ReleaseVersion>0.7.2</ReleaseVersion>
<AssemblyName>Storage.Unity</AssemblyName>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Storage.AOT\Storage.AOT.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="UnityEngine">
<HintPath>..\..\Unity\UnityEngine.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View File

@ -0,0 +1,9 @@
using UnityEngine;
namespace LeanCloud.Storage.Internal.Storage {
public class UnityStorage : IStorage {
public string GetStoragePath() {
return Application.persistentDataPath;
}
}
}

View File

@ -120,7 +120,7 @@ namespace LeanCloud.Storage.Internal.Http {
}
async Task<string> BuildUrl(string path, Dictionary<string, object> queryParams = null) {
string apiServer = await LCApplication.AppRouter.GetApiServer();
string apiServer = await LCInternalApplication.AppRouter.GetApiServer();
string url = $"{apiServer}/{apiVersion}/{path}";
if (queryParams != null) {
IEnumerable<string> queryPairs = queryParams.Select(kv => $"{kv.Key}={kv.Value}");
@ -137,9 +137,9 @@ namespace LeanCloud.Storage.Internal.Http {
headers.Add(kv.Key, kv.Value.ToString());
}
}
if (LCApplication.UseMasterKey && !string.IsNullOrEmpty(LCApplication.MasterKey)) {
if (LCInternalApplication.UseMasterKey && !string.IsNullOrEmpty(LCInternalApplication.MasterKey)) {
// Master Key
headers.Add("X-LC-Key", $"{LCApplication.MasterKey},master");
headers.Add("X-LC-Key", $"{LCInternalApplication.MasterKey},master");
} else {
// 签名
long timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
@ -148,8 +148,8 @@ namespace LeanCloud.Storage.Internal.Http {
string sign = $"{hash},{timestamp}";
headers.Add("X-LC-Sign", sign);
}
if (LCApplication.AdditionalHeaders.Count > 0) {
foreach (KeyValuePair<string, string> kv in LCApplication.AdditionalHeaders) {
if (LCInternalApplication.AdditionalHeaders.Count > 0) {
foreach (KeyValuePair<string, string> kv in LCInternalApplication.AdditionalHeaders) {
headers.Add(kv.Key, kv.Value);
}
}

View File

@ -0,0 +1,7 @@
using System;
namespace LeanCloud.Storage.Internal.Storage {
public interface IStorage {
string GetStoragePath();
}
}

View File

@ -0,0 +1,71 @@
using System;
using System.Reflection;
using System.Linq;
using System.Threading.Tasks;
using System.IO;
using System.Text;
using System.Collections.Generic;
using IOFile = System.IO.File;
namespace LeanCloud.Storage.Internal.Storage {
public class StorageController {
private readonly IStorage storage;
public StorageController(IStorage storage) {
this.storage = storage;
}
public async Task WriteText(string filename, string text) {
if (storage == null) {
return;
}
string path = GetFileFullPath(filename);
LCLogger.Debug($"WRITE: {path}");
LCLogger.Debug($"WRITE: {text}");
using (FileStream fs = IOFile.OpenWrite(path)) {
byte[] buffer = Encoding.UTF8.GetBytes(text);
await fs.WriteAsync(buffer, 0, buffer.Length);
}
}
public async Task<string> ReadText(string filename) {
if (storage == null) {
return null;
}
string path = GetFileFullPath(filename);
LCLogger.Debug($"READ: {path}");
if (IOFile.Exists(path)) {
string text;
using (FileStream fs = IOFile.OpenRead(path)) {
byte[] buffer = new byte[fs.Length];
await fs.ReadAsync(buffer, 0, (int)fs.Length);
text = Encoding.UTF8.GetString(buffer);
}
LCLogger.Debug($"READ: {text}");
return text;
}
return null;
}
public Task Delete(string filename) {
if (storage == null) {
return Task.CompletedTask;
}
string path = GetFileFullPath(filename);
return Task.Run(() => {
IOFile.Delete(path);
});
}
private string GetFileFullPath(string filename) {
if (storage == null) {
throw new Exception("no IStrorage.");
}
return Path.Combine(storage.GetStoragePath(), filename);
}
}
}

View File

@ -33,7 +33,7 @@ namespace LeanCloud.Storage {
{ "width", width },
{ "height", height }
};
Dictionary<string, object> response = await LCApplication.HttpClient.Get<Dictionary<string, object>>(path, queryParams: queryParams);
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Get<Dictionary<string, object>>(path, queryParams: queryParams);
return new LCCapture {
Url = response["captcha_url"] as string,
Token = response["captcha_token"] as string
@ -60,7 +60,7 @@ namespace LeanCloud.Storage {
{ "captcha_code", code },
{ "captcha_token", token }
};
await LCApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
}
}
}

View File

@ -30,7 +30,7 @@ namespace LeanCloud.Storage {
{ PRODUCTION_KEY, IsProduction ? 1 : 0 }
};
object encodeParams = LCEncoder.Encode(parameters);
Dictionary<string, object> response = await LCApplication.HttpClient.Post<Dictionary<string, object>>(path,
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path,
headers: headers,
data: encodeParams);
return response;
@ -57,7 +57,7 @@ namespace LeanCloud.Storage {
{ PRODUCTION_KEY, IsProduction ? 1 : 0 }
};
object encodeParams = Encode(parameters);
Dictionary<string, object> response = await LCApplication.HttpClient.Post<Dictionary<string, object>>(path,
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path,
headers: headers,
data: encodeParams);
return LCDecoder.Decode(response["result"]);

View File

@ -92,12 +92,12 @@ namespace LeanCloud.Storage {
}
LCObjectData objectData = LCObjectData.Decode(uploadToken);
Merge(objectData);
_ = LCApplication.HttpClient.Post<Dictionary<string, object>>("fileCallback", data: new Dictionary<string, object> {
_ = LCInternalApplication.HttpClient.Post<Dictionary<string, object>>("fileCallback", data: new Dictionary<string, object> {
{ "result", true },
{ "token", token }
});
} catch (Exception e) {
_ = LCApplication.HttpClient.Post<Dictionary<string, object>>("fileCallback", data: new Dictionary<string, object> {
_ = LCInternalApplication.HttpClient.Post<Dictionary<string, object>>("fileCallback", data: new Dictionary<string, object> {
{ "result", false },
{ "token", token }
});
@ -112,7 +112,7 @@ namespace LeanCloud.Storage {
return;
}
string path = $"files/{ObjectId}";
await LCApplication.HttpClient.Delete(path);
await LCInternalApplication.HttpClient.Delete(path);
}
public string GetThumbnailUrl(int width, int height, int quality = 100, bool scaleToFit = true, string format = "png") {
@ -128,7 +128,7 @@ namespace LeanCloud.Storage {
{ "mime_type", MimeType },
{ "metaData", MetaData }
};
return await LCApplication.HttpClient.Post<Dictionary<string, object>>("fileTokens", data: data);
return await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>("fileTokens", data: data);
}
public static LCQuery<LCFile> GetQuery() {

View File

@ -19,7 +19,7 @@ namespace LeanCloud.Storage {
if (attributes != null) {
data["friendship"] = attributes;
}
await LCApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
}
public static async Task AcceptRequest(LCFriendshipRequest request, Dictionary<string, object> attributes = null) {
@ -33,7 +33,7 @@ namespace LeanCloud.Storage {
{ "friendship", attributes }
};
}
await LCApplication.HttpClient.Put<Dictionary<string, object>>(path, data: data);
await LCInternalApplication.HttpClient.Put<Dictionary<string, object>>(path, data: data);
}
public static async Task DeclineRequest(LCFriendshipRequest request) {
@ -41,7 +41,7 @@ namespace LeanCloud.Storage {
throw new ArgumentNullException(nameof(request));
}
string path = $"users/friendshipRequests/{request.ObjectId}/decline";
await LCApplication.HttpClient.Put<Dictionary<string, object>>(path);
await LCInternalApplication.HttpClient.Put<Dictionary<string, object>>(path);
}
}
}

View File

@ -3,12 +3,13 @@ using System.Collections.Generic;
using LeanCloud.Common;
using LeanCloud.Storage;
using LeanCloud.Storage.Internal.Http;
using LeanCloud.Storage.Internal.Storage;
namespace LeanCloud {
/// <summary>
/// LeanCloud Application
/// </summary>
public class LCApplication {
public class LCInternalApplication {
// SDK 版本号,用于 User-Agent 统计
public const string SDKVersion = "0.7.2";
@ -43,6 +44,10 @@ namespace LeanCloud {
get; set;
}
public static StorageController StorageController {
get; set;
}
internal static Dictionary<string, string> AdditionalHeaders {
get;
} = new Dictionary<string, string>();

View File

@ -304,7 +304,7 @@ namespace LeanCloud.Storage {
{ "requests", LCEncoder.Encode(requestList) }
};
List<Dictionary<string, object>> results = await LCApplication.HttpClient.Post<List<Dictionary<string, object>>>("batch", data: data);
List<Dictionary<string, object>> results = await LCInternalApplication.HttpClient.Post<List<Dictionary<string, object>>>("batch", data: data);
List<LCObjectData> resultList = results.Select(item => {
if (item.TryGetValue("error", out object error)) {
Dictionary<string, object> err = error as Dictionary<string, object>;
@ -342,8 +342,8 @@ namespace LeanCloud.Storage {
queryParams["where"] = query.BuildWhere();
}
Dictionary<string, object> response = ObjectId == null ?
await LCApplication.HttpClient.Post<Dictionary<string, object>>(path, data: LCEncoder.Encode(operationDict) as Dictionary<string, object>, queryParams: queryParams) :
await LCApplication.HttpClient.Put<Dictionary<string, object>>(path, data: LCEncoder.Encode(operationDict) as Dictionary<string, object>, queryParams: queryParams);
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path, data: LCEncoder.Encode(operationDict) as Dictionary<string, object>, queryParams: queryParams) :
await LCInternalApplication.HttpClient.Put<Dictionary<string, object>>(path, data: LCEncoder.Encode(operationDict) as Dictionary<string, object>, queryParams: queryParams);
LCObjectData data = LCObjectData.Decode(response);
Merge(data);
return this;
@ -368,7 +368,7 @@ namespace LeanCloud.Storage {
return;
}
string path = $"classes/{ClassName}/{ObjectId}";
await LCApplication.HttpClient.Delete(path);
await LCInternalApplication.HttpClient.Delete(path);
}
public static async Task DeleteAll(IEnumerable<LCObject> objects) {
@ -377,7 +377,7 @@ namespace LeanCloud.Storage {
}
HashSet<LCObject> objectSet = new HashSet<LCObject>(objects.Where(item => item.ObjectId != null));
List<Dictionary<string, object>> requestList = objectSet.Select(item => {
string path = $"/{LCApplication.APIVersion}/classes/{item.ClassName}/{item.ObjectId}";
string path = $"/{LCInternalApplication.APIVersion}/classes/{item.ClassName}/{item.ObjectId}";
return new Dictionary<string, object> {
{ "path", path },
{ "method", "DELETE" }
@ -386,7 +386,7 @@ namespace LeanCloud.Storage {
Dictionary<string, object> data = new Dictionary<string, object> {
{ "requests", LCEncoder.Encode(requestList) }
};
await LCApplication.HttpClient.Post<List<object>>("batch", data: data);
await LCInternalApplication.HttpClient.Post<List<object>>("batch", data: data);
}
public async Task<LCObject> Fetch(IEnumerable<string> keys = null, IEnumerable<string> includes = null) {
@ -398,7 +398,7 @@ namespace LeanCloud.Storage {
queryParams["include"] = string.Join(",", includes);
}
string path = $"classes/{ClassName}/{ObjectId}";
Dictionary<string, object> response = await LCApplication.HttpClient.Get<Dictionary<string, object>>(path, queryParams: queryParams);
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Get<Dictionary<string, object>>(path, queryParams: queryParams);
LCObjectData objectData = LCObjectData.Decode(response);
Merge(objectData);
return this;
@ -411,7 +411,7 @@ namespace LeanCloud.Storage {
IEnumerable<LCObject> uniqueObjects = objects.Where(item => item.ObjectId != null);
List<Dictionary<string, object>> requestList = uniqueObjects.Select(item => {
string path = $"/{LCApplication.APIVersion}/classes/{item.ClassName}/{item.ObjectId}";
string path = $"/{LCInternalApplication.APIVersion}/classes/{item.ClassName}/{item.ObjectId}";
return new Dictionary<string, object> {
{ "path", path },
{ "method", "GET" }
@ -421,7 +421,7 @@ namespace LeanCloud.Storage {
Dictionary<string, object> data = new Dictionary<string, object> {
{ "requests", LCEncoder.Encode(requestList) }
};
List<Dictionary<string, object>> results = await LCApplication.HttpClient.Post<List<Dictionary<string, object>>>("batch",
List<Dictionary<string, object>> results = await LCInternalApplication.HttpClient.Post<List<Dictionary<string, object>>>("batch",
data: data);
Dictionary<string, LCObjectData> dict = new Dictionary<string, LCObjectData>();
foreach (Dictionary<string, object> item in results) {
@ -455,7 +455,7 @@ namespace LeanCloud.Storage {
public override string ToString() {
Dictionary<string, object> originalData = LCObjectData.Encode(data);
Dictionary<string, object> currentData = estimatedData.Union(originalData.Where(kv => !estimatedData.ContainsKey(kv.Key)))
.ToDictionary(k => k.Key, v => v.Value);
.ToDictionary(k => k.Key, v => LCEncoder.Encode(v.Value));
return JsonConvert.SerializeObject(currentData);
}

View File

@ -342,7 +342,7 @@ namespace LeanCloud.Storage {
Dictionary<string, object> parameters = BuildParams();
parameters["limit"] = 0;
parameters["count"] = 1;
Dictionary<string, object> ret = await LCApplication.HttpClient.Get<Dictionary<string, object>>(path, queryParams: parameters);
Dictionary<string, object> ret = await LCInternalApplication.HttpClient.Get<Dictionary<string, object>>(path, queryParams: parameters);
return (int)ret["count"];
}
@ -358,14 +358,14 @@ namespace LeanCloud.Storage {
{ "include", includes }
};
}
Dictionary<string, object> response = await LCApplication.HttpClient.Get<Dictionary<string, object>>(path, queryParams: queryParams);
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Get<Dictionary<string, object>>(path, queryParams: queryParams);
return DecodeLCObject(response);
}
public async Task<ReadOnlyCollection<T>> Find() {
string path = $"classes/{ClassName}";
Dictionary<string, object> parameters = BuildParams();
Dictionary<string, object> response = await LCApplication.HttpClient.Get<Dictionary<string, object>>(path, queryParams: parameters);
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Get<Dictionary<string, object>>(path, queryParams: parameters);
List<object> results = response["results"] as List<object>;
List<T> list = new List<T>();
foreach (object item in results) {

View File

@ -43,7 +43,7 @@ namespace LeanCloud.Storage {
data[kv.Key] = kv.Value;
}
}
await LCApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
}
/// <summary>
@ -57,7 +57,7 @@ namespace LeanCloud.Storage {
{ "mobilePhoneNumber", mobile },
{ "smsType", "voice" }
};
await LCApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
}
public static async Task VerifyMobilePhone(string mobile, string code) {
@ -65,7 +65,7 @@ namespace LeanCloud.Storage {
Dictionary<string, object> data = new Dictionary<string, object> {
{ "mobilePhoneNumber", mobile }
};
await LCApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
}
}
}

View File

@ -109,7 +109,7 @@ namespace LeanCloud.Storage {
}
formData["query"] = queryData;
}
Dictionary<string, object> response = await LCApplication.HttpClient.Post<Dictionary<string, object>>("statuses",
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>("statuses",
data: formData);
LCObjectData objectData = LCObjectData.Decode(response);
Merge(objectData);
@ -125,14 +125,14 @@ namespace LeanCloud.Storage {
LCUser source = (Data[SourceKey] ?? this[SourceKey]) as LCUser;
if (source != null && source.ObjectId == user.ObjectId) {
await LCApplication.HttpClient.Delete($"statuses/{ObjectId}");
await LCInternalApplication.HttpClient.Delete($"statuses/{ObjectId}");
} else {
Dictionary<string, object> data = new Dictionary<string, object> {
{ OwnerKey, JsonConvert.SerializeObject(LCEncoder.Encode(user)) },
{ InboxTypeKey, InboxType },
{ MessageIdKey, MessageId }
};
await LCApplication.HttpClient.Delete("subscribe/statuses/inbox", queryParams: data);
await LCInternalApplication.HttpClient.Delete("subscribe/statuses/inbox", queryParams: data);
}
}
@ -148,7 +148,7 @@ namespace LeanCloud.Storage {
if (!string.IsNullOrEmpty(inboxType)) {
queryParams[InboxTypeKey] = inboxType;
}
Dictionary<string, object> response = await LCApplication.HttpClient.Get<Dictionary<string, object>>("subscribe/statuses/count",
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Get<Dictionary<string, object>>("subscribe/statuses/count",
queryParams: queryParams);
LCStatusCount statusCount = new LCStatusCount {
Total = (int)response["total"],
@ -169,7 +169,7 @@ namespace LeanCloud.Storage {
if (!string.IsNullOrEmpty(inboxType)) {
queryParams[InboxTypeKey] = inboxType;
}
await LCApplication.HttpClient.Post<Dictionary<string, object>>("subscribe/statuses/resetUnreadCount",
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>("subscribe/statuses/resetUnreadCount",
queryParams:queryParams);
}
}

View File

@ -41,7 +41,7 @@ namespace LeanCloud.Storage {
{ "maxId", MaxId },
{ "limit", Condition.Limit }
};
Dictionary<string, object> response = await LCApplication.HttpClient.Get<Dictionary<string, object>>("subscribe/statuses",
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Get<Dictionary<string, object>>("subscribe/statuses",
queryParams: queryParams);
List<object> results = response["results"] as List<object>;
List<LCStatus> statuses = new List<LCStatus>();

View File

@ -8,6 +8,8 @@ namespace LeanCloud.Storage {
public class LCUser : LCObject {
public const string CLASS_NAME = "_User";
private const string USER_DATA = ".userdata";
public string Username {
get {
return this["username"] as string;
@ -76,10 +78,21 @@ namespace LeanCloud.Storage {
static LCUser currentUser;
public static Task<LCUser> GetCurrent() {
// TODO 加载持久化数据
public static async Task<LCUser> GetCurrent() {
if (currentUser != null) {
return currentUser;
}
return Task.FromResult(currentUser);
string data = await LCInternalApplication.StorageController.ReadText(USER_DATA);
if (!string.IsNullOrEmpty(data)) {
try {
currentUser = ParseObject(data) as LCUser;
} catch (Exception e) {
LCLogger.Error(e);
await LCInternalApplication.StorageController.Delete(USER_DATA);
}
}
return currentUser;
}
public LCUser() : base(CLASS_NAME) {
@ -106,7 +119,8 @@ namespace LeanCloud.Storage {
}
await Save();
currentUser = this;
// TODO Persistence
await SaveToLocal();
return this;
}
@ -123,7 +137,7 @@ namespace LeanCloud.Storage {
Dictionary<string, object> data = new Dictionary<string, object> {
{ "mobilePhoneNumber", mobile }
};
await LCApplication.HttpClient.Post<Dictionary<string, object>>("requestLoginSmsCode", data: data);
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>("requestLoginSmsCode", data: data);
}
/// <summary>
@ -143,9 +157,12 @@ namespace LeanCloud.Storage {
{ "mobilePhoneNumber", mobile },
{ "smsCode", code }
};
Dictionary<string, object> response = await LCApplication.HttpClient.Post<Dictionary<string, object>>("usersByMobilePhone", data: data);
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>("usersByMobilePhone", data: data);
LCObjectData objectData = LCObjectData.Decode(response);
currentUser = new LCUser(objectData);
await SaveToLocal();
return currentUser;
}
@ -353,7 +370,7 @@ namespace LeanCloud.Storage {
Dictionary<string, object> data = new Dictionary<string, object> {
{ "email", email }
};
await LCApplication.HttpClient.Post<Dictionary<string, object>>("requestEmailVerify", data: data);
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>("requestEmailVerify", data: data);
}
/// <summary>
@ -368,7 +385,7 @@ namespace LeanCloud.Storage {
Dictionary<string, object> data = new Dictionary<string, object> {
{ "mobilePhoneNumber", mobile }
};
await LCApplication.HttpClient.Post<Dictionary<string, object>>("requestMobilePhoneVerify", data: data);
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>("requestMobilePhoneVerify", data: data);
}
/// <summary>
@ -388,7 +405,7 @@ namespace LeanCloud.Storage {
Dictionary<string, object> data = new Dictionary<string, object> {
{ "mobilePhoneNumber", mobile }
};
await LCApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
}
/// <summary>
@ -403,7 +420,7 @@ namespace LeanCloud.Storage {
Dictionary<string, object> headers = new Dictionary<string, object> {
{ "X-LC-Session", sessionToken }
};
Dictionary<string, object> response = await LCApplication.HttpClient.Get<Dictionary<string, object>>("users/me",
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Get<Dictionary<string, object>>("users/me",
headers: headers);
LCObjectData objectData = LCObjectData.Decode(response);
currentUser = new LCUser(objectData);
@ -422,7 +439,7 @@ namespace LeanCloud.Storage {
Dictionary<string, object> data = new Dictionary<string, object> {
{ "email", email }
};
await LCApplication.HttpClient.Post<Dictionary<string, object>>("requestPasswordReset",
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>("requestPasswordReset",
data: data);
}
@ -438,7 +455,7 @@ namespace LeanCloud.Storage {
Dictionary<string, object> data = new Dictionary<string, object> {
{ "mobilePhoneNumber", mobile }
};
await LCApplication.HttpClient.Post<Dictionary<string, object>>("requestPasswordResetBySmsCode",
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>("requestPasswordResetBySmsCode",
data: data);
}
@ -463,7 +480,7 @@ namespace LeanCloud.Storage {
{ "mobilePhoneNumber", mobile },
{ "password", newPassword }
};
await LCApplication.HttpClient.Put<Dictionary<string, object>>($"resetPasswordBySmsCode/{code}",
await LCInternalApplication.HttpClient.Put<Dictionary<string, object>>($"resetPasswordBySmsCode/{code}",
data: data);
}
@ -484,7 +501,7 @@ namespace LeanCloud.Storage {
{ "old_password", oldPassword },
{ "new_password", newPassword }
};
Dictionary<string, object> response = await LCApplication.HttpClient.Put<Dictionary<string, object>>(
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Put<Dictionary<string, object>>(
$"users/{ObjectId}/updatePassword", data:data);
LCObjectData objectData = LCObjectData.Decode(response);
Merge(objectData);
@ -495,9 +512,8 @@ namespace LeanCloud.Storage {
/// </summary>
public static Task Logout() {
currentUser = null;
// TODO 清理持久化数据
return Task.FromResult<object>(null);
// 清理持久化数据
return LCInternalApplication.StorageController.Delete(USER_DATA);
}
/// <summary>
@ -509,7 +525,7 @@ namespace LeanCloud.Storage {
return false;
}
try {
await LCApplication.HttpClient.Get<Dictionary<string, object>>("users/me");
await LCInternalApplication.HttpClient.Get<Dictionary<string, object>>("users/me");
return true;
} catch (Exception) {
return false;
@ -532,7 +548,7 @@ namespace LeanCloud.Storage {
try {
await Save();
oriAuthData[authType] = data;
UpdateAuthData(oriAuthData);
await UpdateAuthData(oriAuthData);
} catch (Exception e) {
AuthData = oriAuthData;
throw e;
@ -547,23 +563,27 @@ namespace LeanCloud.Storage {
try {
await Save();
oriAuthData.Remove(authType);
UpdateAuthData(oriAuthData);
await UpdateAuthData(oriAuthData);
} catch (Exception e) {
AuthData = oriAuthData;
throw e;
}
}
private void UpdateAuthData(Dictionary<string, object> authData) {
private async Task UpdateAuthData(Dictionary<string, object> authData) {
LCObjectData objData = new LCObjectData();
objData.CustomPropertyDict["authData"] = authData;
Merge(objData);
await SaveToLocal();
}
static async Task<LCUser> Login(Dictionary<string, object> data) {
Dictionary<string, object> response = await LCApplication.HttpClient.Post<Dictionary<string, object>>("login", data: data);
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>("login", data: data);
LCObjectData objectData = LCObjectData.Decode(response);
currentUser = new LCUser(objectData);
await SaveToLocal();
return currentUser;
}
@ -572,11 +592,14 @@ namespace LeanCloud.Storage {
{ authType, data }
};
string path = failOnNotExist ? "users?failOnNotExist=true" : "users";
Dictionary<string, object> response = await LCApplication.HttpClient.Post<Dictionary<string, object>>(path, data: new Dictionary<string, object> {
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path, data: new Dictionary<string, object> {
{ "authData", authData }
});
LCObjectData objectData = LCObjectData.Decode(response);
currentUser = new LCUser(objectData);
await SaveToLocal();
return currentUser;
}
@ -586,6 +609,15 @@ namespace LeanCloud.Storage {
authData["unionid"] = unionId;
}
private static async Task SaveToLocal() {
try {
string json = currentUser.ToString();
await LCInternalApplication.StorageController.WriteText(USER_DATA, json);
} catch (Exception e) {
LCLogger.Error(e.Message);
}
}
/// <summary>
/// Requests an SMS code for updating phone number.
/// </summary>
@ -602,7 +634,7 @@ namespace LeanCloud.Storage {
if (!string.IsNullOrEmpty(captchaToken)) {
data["validate_token"] = captchaToken;
}
await LCApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
}
/// <summary>
@ -617,7 +649,7 @@ namespace LeanCloud.Storage {
{ "mobilePhoneNumber", mobile },
{ "code", code }
};
await LCApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path, data: data);
}
/// <summary>
@ -631,7 +663,7 @@ namespace LeanCloud.Storage {
throw new ArgumentNullException(nameof(targetId));
}
string path = $"users/self/friendship/{targetId}";
await LCApplication.HttpClient.Post<Dictionary<string, object>>(path, data: attrs);
await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path, data: attrs);
}
/// <summary>
@ -644,7 +676,7 @@ namespace LeanCloud.Storage {
throw new ArgumentNullException(nameof(targetId));
}
string path = $"users/self/friendship/{targetId}";
await LCApplication.HttpClient.Delete(path);
await LCInternalApplication.HttpClient.Delete(path);
}
/// <summary>
@ -684,7 +716,7 @@ namespace LeanCloud.Storage {
queryParams["include"] = string.Join(",", includes);
}
string path = $"users/{ObjectId}/followersAndFollowees";
Dictionary<string, object> response = await LCApplication.HttpClient.Get<Dictionary<string, object>>(path,
Dictionary<string, object> response = await LCInternalApplication.HttpClient.Get<Dictionary<string, object>>(path,
queryParams: queryParams);
LCFollowersAndFollowees result = new LCFollowersAndFollowees();
if (response.TryGetValue("followers", out object followersObj) &&

View File

@ -68,7 +68,7 @@ namespace LeanCloud.Storage {
{ "updateStrategy", updateStrategy.ToString().ToLower() },
};
string path = "leaderboard/leaderboards";
Dictionary<string, object> result = await LCApplication.HttpClient.Post<Dictionary<string, object>>(path,
Dictionary<string, object> result = await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path,
data:data);
LCLeaderboard leaderboard = new LCLeaderboard();
leaderboard.Merge(result);
@ -112,7 +112,7 @@ namespace LeanCloud.Storage {
if (overwrite) {
path = $"{path}?overwrite=1";
}
Dictionary<string, object> result = await LCApplication.HttpClient.Post<Dictionary<string, object>>(path,
Dictionary<string, object> result = await LCInternalApplication.HttpClient.Post<Dictionary<string, object>>(path,
data: data);
if (result.TryGetValue("results", out object results) &&
results is List<object> list) {
@ -137,7 +137,7 @@ namespace LeanCloud.Storage {
string names = string.Join(",", statisticNames);
path = $"{path}?statistics={names}";
}
Dictionary<string, object> result = await LCApplication.HttpClient.Get<Dictionary<string, object>>(path);
Dictionary<string, object> result = await LCInternalApplication.HttpClient.Get<Dictionary<string, object>>(path);
if (result.TryGetValue("results", out object results) &&
results is List<object> list) {
List<LCStatistic> statistics = new List<LCStatistic>();
@ -161,7 +161,7 @@ namespace LeanCloud.Storage {
}
string names = string.Join(",", statisticNames);
string path = $"leaderboard/users/{user.ObjectId}/statistics?statistics={names}";
await LCApplication.HttpClient.Delete(path);
await LCInternalApplication.HttpClient.Delete(path);
}
/// <summary>
@ -179,7 +179,7 @@ namespace LeanCloud.Storage {
throw new ArgumentOutOfRangeException(nameof(limit));
}
string path = $"leaderboard/leaderboards/{StatisticName}/archives?skip={skip}&limit={limit}";
Dictionary<string, object> result = await LCApplication.HttpClient.Get<Dictionary<string, object>>(path);
Dictionary<string, object> result = await LCInternalApplication.HttpClient.Get<Dictionary<string, object>>(path);
if (result.TryGetValue("results", out object results) &&
results is List<object> list) {
List<LCLeaderboardArchive> archives = new List<LCLeaderboardArchive>();
@ -235,7 +235,7 @@ namespace LeanCloud.Storage {
string statistics = string.Join(",", includeStatistics);
path = $"{path}&includeStatistics={statistics}";
}
Dictionary<string, object> result = await LCApplication.HttpClient.Get<Dictionary<string, object>>(path);
Dictionary<string, object> result = await LCInternalApplication.HttpClient.Get<Dictionary<string, object>>(path);
if (result.TryGetValue("results", out object results) &&
results is List<object> list) {
List<LCRanking> rankings = new List<LCRanking>();
@ -254,7 +254,7 @@ namespace LeanCloud.Storage {
{ "updateStrategy", updateStrategy.ToString().ToLower() }
};
string path = $"leaderboard/leaderboards/{StatisticName}";
Dictionary<string, object> result = await LCApplication.HttpClient.Put<Dictionary<string, object>>(path,
Dictionary<string, object> result = await LCInternalApplication.HttpClient.Put<Dictionary<string, object>>(path,
data: data);
if (result.TryGetValue("updateStrategy", out object strategy) &&
Enum.TryParse(strategy as string, true, out LCLeaderboardUpdateStrategy s)) {
@ -269,7 +269,7 @@ namespace LeanCloud.Storage {
{ "versionChangeInterval", versionChangeInterval.ToString().ToLower() }
};
string path = $"leaderboard/leaderboards/{StatisticName}";
Dictionary<string, object> result = await LCApplication.HttpClient.Put<Dictionary<string, object>>(path,
Dictionary<string, object> result = await LCInternalApplication.HttpClient.Put<Dictionary<string, object>>(path,
data: data);
if (result.TryGetValue("versionChangeInterval", out object interval) &&
Enum.TryParse(interval as string, true, out LCLeaderboardVersionChangeInterval i)) {
@ -284,7 +284,7 @@ namespace LeanCloud.Storage {
/// <returns></returns>
public async Task<LCLeaderboard> Fetch() {
string path = $"leaderboard/leaderboards/{StatisticName}";
Dictionary<string, object> result = await LCApplication.HttpClient.Get<Dictionary<string, object>>(path);
Dictionary<string, object> result = await LCInternalApplication.HttpClient.Get<Dictionary<string, object>>(path);
Merge(result);
return this;
}
@ -295,7 +295,7 @@ namespace LeanCloud.Storage {
/// <returns></returns>
public async Task<LCLeaderboard> Reset() {
string path = $"leaderboard/leaderboards/{StatisticName}/incrementVersion";
Dictionary<string, object> result = await LCApplication.HttpClient.Put<Dictionary<string, object>>(path);
Dictionary<string, object> result = await LCInternalApplication.HttpClient.Put<Dictionary<string, object>>(path);
Merge(result);
return this;
}
@ -306,7 +306,7 @@ namespace LeanCloud.Storage {
/// <returns></returns>
public async Task Destroy() {
string path = $"leaderboard/leaderboards/{StatisticName}";
await LCApplication.HttpClient.Delete(path);
await LCInternalApplication.HttpClient.Delete(path);
}
private void Merge(Dictionary<string, object> data) {

View File

@ -7,9 +7,6 @@
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Class1.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Internal\" />
<Folder Include="Internal\Codec\" />
@ -19,8 +16,10 @@
<Folder Include="Internal\Operation\" />
<Folder Include="Internal\Query\" />
<Folder Include="Leaderboard\" />
<Folder Include="Internal\Storage\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Common\Common\Common.csproj" />
<ProjectReference Include="..\..\Common\Common\Common.csproj">
</ProjectReference>
</ItemGroup>
</Project>

BIN
Unity/UnityEngine.dll Normal file

Binary file not shown.

View File

@ -3,4 +3,8 @@
<assembly fullname="Storage" preserve="all"/>
<assembly fullname="Realtime" preserve="all"/>
<assembly fullname="LiveQuery" preserve="all"/>
<assembly fullname="LC.Google.Protobuf" preserve="all"/>
<assembly fullname="LC.Newtonsoft.Json" preserve="all"/>
<assembly fullname="Realtime.Unity" preserve="all"/>
<assembly fullname="Storage.Unity" preserve="all"/>
</linker>

View File

@ -43,11 +43,23 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage.AOT", "Storage\Stor
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Realtime.AOT", "Realtime\Realtime.AOT\Realtime.AOT.csproj", "{C68C9392-5100-4614-B238-103905C12566}"
EndProject
Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "LC.Google.Protobuf", "Libs\Google.Protobuf\LC.Google.Protobuf.csproj", "{7F40B1C2-D8AF-4678-8F9B-18682C58D12A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage.Unity", "Storage\Storage.Unity\Storage.Unity.csproj", "{BEBBDE63-D215-4790-BA98-FC612EFC383C}"
EndProject
Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "LC.Newtonsoft.Json", "Libs\Newtonsoft.Json\LC.Newtonsoft.Json.csproj", "{5D01C4BB-F44D-4BD4-96BC-078616637CCE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage.Standard", "Storage\Storage.Standard\Storage.Standard.csproj", "{3C73FBA3-83BC-49D9-982D-93057978F203}"
EndProject
Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "LC.Newtonsoft.Json.AOT", "Libs\Newtonsoft.Json.AOT\LC.Newtonsoft.Json.AOT.csproj", "{A60FA5E1-673B-4269-B8D8-BEE0C653B8CA}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LC.Google.Protobuf", "Libs\Google.Protobuf\LC.Google.Protobuf.csproj", "{3D05DEDF-A256-4D3F-B5AE-FB643B8F82F7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LC.Newtonsoft.Json", "Libs\Newtonsoft.Json\LC.Newtonsoft.Json.csproj", "{577FD4B4-FE9C-4FF8-9D3D-C42F22C3A9EF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LC.Newtonsoft.Json.AOT", "Libs\Newtonsoft.Json.AOT\LC.Newtonsoft.Json.AOT.csproj", "{48FB2373-D0E5-45CA-A227-280DEAE4486F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Realtime.Unity", "Realtime\Realtime.Unity\Realtime.Unity.csproj", "{5BC77445-B0C9-4331-99EF-A623195AD4E5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Realtime.Standard", "Realtime\Realtime.Standard\Realtime.Standard.csproj", "{E7553E94-6424-4899-B9B7-5DC0ECD95C51}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiveQuery.Standard", "LiveQuery\LiveQuery.Standard\LiveQuery.Standard.csproj", "{0C0AE72C-1086-42CC-A415-40C001219B5F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiveQuery.Unity", "LiveQuery\LiveQuery.Unity\LiveQuery.Unity.csproj", "{A6CD4EB4-1696-4A70-BC9D-73DF1291250C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -111,18 +123,42 @@ Global
{C68C9392-5100-4614-B238-103905C12566}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C68C9392-5100-4614-B238-103905C12566}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C68C9392-5100-4614-B238-103905C12566}.Release|Any CPU.Build.0 = Release|Any CPU
{7F40B1C2-D8AF-4678-8F9B-18682C58D12A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F40B1C2-D8AF-4678-8F9B-18682C58D12A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F40B1C2-D8AF-4678-8F9B-18682C58D12A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F40B1C2-D8AF-4678-8F9B-18682C58D12A}.Release|Any CPU.Build.0 = Release|Any CPU
{5D01C4BB-F44D-4BD4-96BC-078616637CCE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5D01C4BB-F44D-4BD4-96BC-078616637CCE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D01C4BB-F44D-4BD4-96BC-078616637CCE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D01C4BB-F44D-4BD4-96BC-078616637CCE}.Release|Any CPU.Build.0 = Release|Any CPU
{A60FA5E1-673B-4269-B8D8-BEE0C653B8CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A60FA5E1-673B-4269-B8D8-BEE0C653B8CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A60FA5E1-673B-4269-B8D8-BEE0C653B8CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A60FA5E1-673B-4269-B8D8-BEE0C653B8CA}.Release|Any CPU.Build.0 = Release|Any CPU
{BEBBDE63-D215-4790-BA98-FC612EFC383C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BEBBDE63-D215-4790-BA98-FC612EFC383C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BEBBDE63-D215-4790-BA98-FC612EFC383C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BEBBDE63-D215-4790-BA98-FC612EFC383C}.Release|Any CPU.Build.0 = Release|Any CPU
{3C73FBA3-83BC-49D9-982D-93057978F203}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3C73FBA3-83BC-49D9-982D-93057978F203}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C73FBA3-83BC-49D9-982D-93057978F203}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C73FBA3-83BC-49D9-982D-93057978F203}.Release|Any CPU.Build.0 = Release|Any CPU
{3D05DEDF-A256-4D3F-B5AE-FB643B8F82F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3D05DEDF-A256-4D3F-B5AE-FB643B8F82F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D05DEDF-A256-4D3F-B5AE-FB643B8F82F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3D05DEDF-A256-4D3F-B5AE-FB643B8F82F7}.Release|Any CPU.Build.0 = Release|Any CPU
{577FD4B4-FE9C-4FF8-9D3D-C42F22C3A9EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{577FD4B4-FE9C-4FF8-9D3D-C42F22C3A9EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{577FD4B4-FE9C-4FF8-9D3D-C42F22C3A9EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{577FD4B4-FE9C-4FF8-9D3D-C42F22C3A9EF}.Release|Any CPU.Build.0 = Release|Any CPU
{48FB2373-D0E5-45CA-A227-280DEAE4486F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{48FB2373-D0E5-45CA-A227-280DEAE4486F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{48FB2373-D0E5-45CA-A227-280DEAE4486F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{48FB2373-D0E5-45CA-A227-280DEAE4486F}.Release|Any CPU.Build.0 = Release|Any CPU
{5BC77445-B0C9-4331-99EF-A623195AD4E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5BC77445-B0C9-4331-99EF-A623195AD4E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5BC77445-B0C9-4331-99EF-A623195AD4E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5BC77445-B0C9-4331-99EF-A623195AD4E5}.Release|Any CPU.Build.0 = Release|Any CPU
{E7553E94-6424-4899-B9B7-5DC0ECD95C51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E7553E94-6424-4899-B9B7-5DC0ECD95C51}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7553E94-6424-4899-B9B7-5DC0ECD95C51}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7553E94-6424-4899-B9B7-5DC0ECD95C51}.Release|Any CPU.Build.0 = Release|Any CPU
{0C0AE72C-1086-42CC-A415-40C001219B5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C0AE72C-1086-42CC-A415-40C001219B5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C0AE72C-1086-42CC-A415-40C001219B5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C0AE72C-1086-42CC-A415-40C001219B5F}.Release|Any CPU.Build.0 = Release|Any CPU
{A6CD4EB4-1696-4A70-BC9D-73DF1291250C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A6CD4EB4-1696-4A70-BC9D-73DF1291250C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6CD4EB4-1696-4A70-BC9D-73DF1291250C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6CD4EB4-1696-4A70-BC9D-73DF1291250C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{4194FE34-327C-42C2-971F-6B07904E20A5} = {076871D0-BE1F-4AF0-B83E-697C71C0C3B3}
@ -139,9 +175,15 @@ Global
{5BE8789B-56C6-444F-87BF-F9447EE1E128} = {A1A24E0F-6901-4A9A-9BB8-4F586BC7EE17}
{6695E495-CAF9-4CDB-9CB8-8CC867771CA1} = {076871D0-BE1F-4AF0-B83E-697C71C0C3B3}
{C68C9392-5100-4614-B238-103905C12566} = {319A9989-3B69-4AD0-9E43-F6D31C1D2A4A}
{7F40B1C2-D8AF-4678-8F9B-18682C58D12A} = {3B53EFFB-6962-4EED-88FD-F9D6E9650A2D}
{5D01C4BB-F44D-4BD4-96BC-078616637CCE} = {3B53EFFB-6962-4EED-88FD-F9D6E9650A2D}
{A60FA5E1-673B-4269-B8D8-BEE0C653B8CA} = {3B53EFFB-6962-4EED-88FD-F9D6E9650A2D}
{BEBBDE63-D215-4790-BA98-FC612EFC383C} = {076871D0-BE1F-4AF0-B83E-697C71C0C3B3}
{3C73FBA3-83BC-49D9-982D-93057978F203} = {076871D0-BE1F-4AF0-B83E-697C71C0C3B3}
{3D05DEDF-A256-4D3F-B5AE-FB643B8F82F7} = {3B53EFFB-6962-4EED-88FD-F9D6E9650A2D}
{577FD4B4-FE9C-4FF8-9D3D-C42F22C3A9EF} = {3B53EFFB-6962-4EED-88FD-F9D6E9650A2D}
{48FB2373-D0E5-45CA-A227-280DEAE4486F} = {3B53EFFB-6962-4EED-88FD-F9D6E9650A2D}
{5BC77445-B0C9-4331-99EF-A623195AD4E5} = {319A9989-3B69-4AD0-9E43-F6D31C1D2A4A}
{E7553E94-6424-4899-B9B7-5DC0ECD95C51} = {319A9989-3B69-4AD0-9E43-F6D31C1D2A4A}
{0C0AE72C-1086-42CC-A415-40C001219B5F} = {A1A24E0F-6901-4A9A-9BB8-4F586BC7EE17}
{A6CD4EB4-1696-4A70-BC9D-73DF1291250C} = {A1A24E0F-6901-4A9A-9BB8-4F586BC7EE17}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
version = 0.7.2

View File

@ -9,6 +9,7 @@ pack() {
rsync -avz $path $dir
if [ $copyLink == true ] ; then
cp ./Unity/link.xml $dir
rm $dir/UnityEngine.dll
fi
zip -r $output $dir
rm -r $dir