Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
老鱼er
et
提交
651e410e
E
et
项目概览
老鱼er
/
et
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
et
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
651e410e
编写于
3月 01, 2018
作者:
T
tanghai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Unity自带的同步上下文timescale为0的时候不会某些await不会回调,用OneThreadSynchronizationContenx替换
上级
b5d55d7b
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
28 addition
and
2 deletion
+28
-2
Config/StartConfig/LocalAllServer.txt
Config/StartConfig/LocalAllServer.txt
+1
-1
Server/Model/Server.Model.csproj
Server/Model/Server.Model.csproj
+1
-0
Unity/Assets/Scripts/Base/OneThreadSynchronizationContext.cs
Unity/Assets/Scripts/Base/OneThreadSynchronizationContext.cs
+0
-0
Unity/Assets/Scripts/Base/OneThreadSynchronizationContext.cs.meta
...sets/Scripts/Base/OneThreadSynchronizationContext.cs.meta
+12
-0
Unity/Assets/Scripts/Init.cs
Unity/Assets/Scripts/Init.cs
+6
-0
Unity/Assets/Scripts/Module/Message/Network/TCP/TChannel.cs
Unity/Assets/Scripts/Module/Message/Network/TCP/TChannel.cs
+7
-1
Unity/Unity.csproj
Unity/Unity.csproj
+1
-0
未找到文件。
Config/StartConfig/LocalAllServer.txt
浏览文件 @
651e410e
{ "_t" : "StartConfig", "_id" : NumberLong("98547768819754"), "components" : [{ "_t" : "OuterConfig", "Host" : "127.0.0.1", "Port" : 10002, "Host2" :
null
}, { "_t" : "InnerConfig", "Host" : "127.0.0.1", "Port" : 20000 }, { "_t" : "HttpConfig", "Url" : "", "AppId" : 0, "AppKey" : "", "ManagerSystemUrl" : "" }, { "_t" : "DBConfig", "ConnectionString" : null, "DBName" : null }], "AppId" : 1, "AppType" : "AllServer", "ServerIP" : "*" }
{ "_t" : "StartConfig", "_id" : NumberLong("98547768819754"), "components" : [{ "_t" : "OuterConfig", "Host" : "127.0.0.1", "Port" : 10002, "Host2" :
"127.0.0.1"
}, { "_t" : "InnerConfig", "Host" : "127.0.0.1", "Port" : 20000 }, { "_t" : "HttpConfig", "Url" : "", "AppId" : 0, "AppKey" : "", "ManagerSystemUrl" : "" }, { "_t" : "DBConfig", "ConnectionString" : null, "DBName" : null }], "AppId" : 1, "AppType" : "AllServer", "ServerIP" : "*" }
Server/Model/Server.Model.csproj
浏览文件 @
651e410e
...
@@ -56,6 +56,7 @@
...
@@ -56,6 +56,7 @@
<Compile Include="..\..\Unity\Assets\Scripts\Base\Object\Object.cs" Link="Base\Object\Object.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Base\Object\Object.cs" Link="Base\Object\Object.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Base\Object\ObjectPool.cs" Link="Base\Object\ObjectPool.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Base\Object\ObjectPool.cs" Link="Base\Object\ObjectPool.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Base\Object\ObjectSystemAttribute.cs" Link="Base\Object\ObjectSystemAttribute.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Base\Object\ObjectSystemAttribute.cs" Link="Base\Object\ObjectSystemAttribute.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Base\OneThreadSynchronizationContext.cs" Link="Base\OneThreadSynchronizationContext.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Base\QueueDictionary.cs" Link="Base\QueueDictionary.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Base\QueueDictionary.cs" Link="Base\QueueDictionary.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Base\TryLocker.cs" Link="Base\TryLocker.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Base\TryLocker.cs" Link="Base\TryLocker.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Base\UnOrderMultiMap.cs" Link="Base\UnOrderMultiMap.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Base\UnOrderMultiMap.cs" Link="Base\UnOrderMultiMap.cs" />
...
...
Server/Model/Other
/OneThreadSynchronizationContext.cs
→
Unity/Assets/Scripts/Base
/OneThreadSynchronizationContext.cs
浏览文件 @
651e410e
文件已移动
Unity/Assets/Scripts/Base/OneThreadSynchronizationContext.cs.meta
0 → 100644
浏览文件 @
651e410e
fileFormatVersion: 2
guid: fcb4a65fef4e05448a17ace64a0658dd
timeCreated: 1519875927
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Unity/Assets/Scripts/Init.cs
浏览文件 @
651e410e
using
System
;
using
System
;
using
System.Threading
;
using
UnityEngine
;
using
UnityEngine
;
namespace
Model
namespace
Model
{
{
public
class
Init
:
MonoBehaviour
public
class
Init
:
MonoBehaviour
{
{
private
readonly
OneThreadSynchronizationContext
contex
=
new
OneThreadSynchronizationContext
();
private
async
void
Start
()
private
async
void
Start
()
{
{
try
try
...
@@ -14,6 +17,8 @@ namespace Model
...
@@ -14,6 +17,8 @@ namespace Model
Log
.
Warning
(
$"当前版本:
{
Application
.
unityVersion
}
, 最好使用运行指南推荐版本!"
);
Log
.
Warning
(
$"当前版本:
{
Application
.
unityVersion
}
, 最好使用运行指南推荐版本!"
);
}
}
SynchronizationContext
.
SetSynchronizationContext
(
this
.
contex
);
DontDestroyOnLoad
(
gameObject
);
DontDestroyOnLoad
(
gameObject
);
Game
.
EventSystem
.
Add
(
DLLType
.
Model
,
typeof
(
Init
).
Assembly
);
Game
.
EventSystem
.
Add
(
DLLType
.
Model
,
typeof
(
Init
).
Assembly
);
...
@@ -50,6 +55,7 @@ namespace Model
...
@@ -50,6 +55,7 @@ namespace Model
private
void
Update
()
private
void
Update
()
{
{
this
.
contex
.
Update
();
Game
.
Hotfix
.
Update
?.
Invoke
();
Game
.
Hotfix
.
Update
?.
Invoke
();
Game
.
EventSystem
.
Update
();
Game
.
EventSystem
.
Update
();
}
}
...
...
Unity/Assets/Scripts/Module/Message/Network/TCP/TChannel.cs
浏览文件 @
651e410e
...
@@ -161,6 +161,9 @@ namespace Model
...
@@ -161,6 +161,9 @@ namespace Model
await
this
.
sendBuffer
.
ReadAsync
(
stream
);
await
this
.
sendBuffer
.
ReadAsync
(
stream
);
}
}
}
}
catch
(
ObjectDisposedException
)
{
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
Log
.
Error
(
e
.
ToString
());
Log
.
Error
(
e
.
ToString
());
...
@@ -207,6 +210,9 @@ namespace Model
...
@@ -207,6 +210,9 @@ namespace Model
}
}
}
}
}
}
catch
(
ObjectDisposedException
)
{
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
Log
.
Error
(
e
.
ToString
());
Log
.
Error
(
e
.
ToString
());
...
...
Unity/Unity.csproj
浏览文件 @
651e410e
...
@@ -175,6 +175,7 @@
...
@@ -175,6 +175,7 @@
<Compile
Include=
"Assets\Scripts\Base\Object\Object.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\Object\Object.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\Object\ObjectPool.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\Object\ObjectPool.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\Object\ObjectSystemAttribute.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\Object\ObjectSystemAttribute.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\OneThreadSynchronizationContext.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\QueueDictionary.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\QueueDictionary.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\TryLocker.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\TryLocker.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\UnOrderMultiMap.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\UnOrderMultiMap.cs"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录