* csharp-sdk.sln:
* Program.cs: * RealtimeApp.csproj: * SingleThreadSynchronizationContext.cs: chore: rtm 测试 app
parent
08449aea6b
commit
ea09941439
|
@ -1,9 +1,39 @@
|
||||||
using System;
|
using System;
|
||||||
|
using LeanCloud;
|
||||||
|
using LeanCloud.Realtime;
|
||||||
|
|
||||||
|
using static System.Console;
|
||||||
|
|
||||||
namespace RealtimeApp {
|
namespace RealtimeApp {
|
||||||
class Program {
|
class Program {
|
||||||
static void Main(string[] args) {
|
static void Main(string[] args) {
|
||||||
Console.WriteLine("Hello World!");
|
Console.WriteLine("Hello World!");
|
||||||
|
|
||||||
|
SingleThreadSynchronizationContext.Run(async () => {
|
||||||
|
LCLogger.LogDelegate += Print;
|
||||||
|
LCApplication.Initialize("ikGGdRE2YcVOemAaRbgp1xGJ-gzGzoHsz", "NUKmuRbdAhg1vrb2wexYo1jo", "https://ikggdre2.lc-cn-n1-shared.com");
|
||||||
|
|
||||||
|
LCIMClient client = new LCIMClient("lean");
|
||||||
|
await client.Open();
|
||||||
|
//await client.Close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Print(LCLogLevel level, string info) {
|
||||||
|
switch (level) {
|
||||||
|
case LCLogLevel.Debug:
|
||||||
|
WriteLine($"[DEBUG] {DateTime.Now} {info}\n");
|
||||||
|
break;
|
||||||
|
case LCLogLevel.Warn:
|
||||||
|
WriteLine($"[WARNING] {DateTime.Now} {info}\n");
|
||||||
|
break;
|
||||||
|
case LCLogLevel.Error:
|
||||||
|
WriteLine($"[ERROR] {DateTime.Now} {info}\n");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
WriteLine(info);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,4 +5,9 @@
|
||||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\Common\Common.csproj" />
|
||||||
|
<ProjectReference Include="..\..\Realtime\Realtime.csproj" />
|
||||||
|
<ProjectReference Include="..\..\Storage\Storage.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -4,7 +4,7 @@ using System.Threading.Tasks;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace LeanCloud.Common {
|
namespace RealtimeApp {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单线程环境,用于控制台应用 await 返回
|
/// 单线程环境,用于控制台应用 await 返回
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Realtime", "Realtime\Realti
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Realtime.Test", "Test\Realtime.Test\Realtime.Test.csproj", "{746B0DE6-C504-4568-BA6D-4A08A91A5E35}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Realtime.Test", "Test\Realtime.Test\Realtime.Test.csproj", "{746B0DE6-C504-4568-BA6D-4A08A91A5E35}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RealtimeApp", "Test\RealtimeApp\RealtimeApp.csproj", "{4CB5E8C3-B1FC-45C3-B882-A9A43DFC6B1C}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
@ -39,10 +41,15 @@ Global
|
||||||
{746B0DE6-C504-4568-BA6D-4A08A91A5E35}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{746B0DE6-C504-4568-BA6D-4A08A91A5E35}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{746B0DE6-C504-4568-BA6D-4A08A91A5E35}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{746B0DE6-C504-4568-BA6D-4A08A91A5E35}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{746B0DE6-C504-4568-BA6D-4A08A91A5E35}.Release|Any CPU.Build.0 = Release|Any CPU
|
{746B0DE6-C504-4568-BA6D-4A08A91A5E35}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{4CB5E8C3-B1FC-45C3-B882-A9A43DFC6B1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{4CB5E8C3-B1FC-45C3-B882-A9A43DFC6B1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{4CB5E8C3-B1FC-45C3-B882-A9A43DFC6B1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{4CB5E8C3-B1FC-45C3-B882-A9A43DFC6B1C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(NestedProjects) = preSolution
|
GlobalSection(NestedProjects) = preSolution
|
||||||
{531F8181-FFE0-476E-9D0A-93F13CAD1183} = {C827DA2F-6AB4-48D8-AB5B-6DAB925F8933}
|
{531F8181-FFE0-476E-9D0A-93F13CAD1183} = {C827DA2F-6AB4-48D8-AB5B-6DAB925F8933}
|
||||||
{746B0DE6-C504-4568-BA6D-4A08A91A5E35} = {C827DA2F-6AB4-48D8-AB5B-6DAB925F8933}
|
{746B0DE6-C504-4568-BA6D-4A08A91A5E35} = {C827DA2F-6AB4-48D8-AB5B-6DAB925F8933}
|
||||||
|
{4CB5E8C3-B1FC-45C3-B882-A9A43DFC6B1C} = {C827DA2F-6AB4-48D8-AB5B-6DAB925F8933}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(MonoDevelopProperties) = preSolution
|
GlobalSection(MonoDevelopProperties) = preSolution
|
||||||
version = 0.1.0
|
version = 0.1.0
|
||||||
|
|
Loading…
Reference in New Issue