Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
老鱼er
et
提交
366e59bc
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,发现更多精彩内容 >>
提交
366e59bc
编写于
2月 23, 2018
作者:
T
tanghai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Config相关功能放到Config模块中
上级
a8efa551
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
22 addition
and
145 deletion
+22
-145
Server/Model/Base/Config/ACategory.cs
Server/Model/Base/Config/ACategory.cs
+0
-83
Server/Model/Module/Config/AConfigComponent.cs
Server/Model/Module/Config/AConfigComponent.cs
+0
-0
Server/Model/Module/Config/ConfigHelper.cs
Server/Model/Module/Config/ConfigHelper.cs
+0
-0
Server/Model/Server.Model.csproj
Server/Model/Server.Model.csproj
+5
-1
Unity/Assets/Scripts/Base/Config.meta
Unity/Assets/Scripts/Base/Config.meta
+0
-9
Unity/Assets/Scripts/Base/Config/AConfig.cs
Unity/Assets/Scripts/Base/Config/AConfig.cs
+0
-16
Unity/Assets/Scripts/Base/Config/ConfigAttribute.cs
Unity/Assets/Scripts/Base/Config/ConfigAttribute.cs
+0
-15
Unity/Assets/Scripts/Base/Config/ICategory.cs
Unity/Assets/Scripts/Base/Config/ICategory.cs
+0
-10
Unity/Assets/Scripts/Module/Config.meta
Unity/Assets/Scripts/Module/Config.meta
+3
-0
Unity/Assets/Scripts/Module/Config/ACategory.cs
Unity/Assets/Scripts/Module/Config/ACategory.cs
+0
-0
Unity/Assets/Scripts/Module/Config/ACategory.cs.meta
Unity/Assets/Scripts/Module/Config/ACategory.cs.meta
+0
-0
Unity/Assets/Scripts/Module/Config/AConfig.cs
Unity/Assets/Scripts/Module/Config/AConfig.cs
+0
-0
Unity/Assets/Scripts/Module/Config/AConfig.cs.meta
Unity/Assets/Scripts/Module/Config/AConfig.cs.meta
+0
-0
Unity/Assets/Scripts/Module/Config/AConfigComponent.cs
Unity/Assets/Scripts/Module/Config/AConfigComponent.cs
+0
-0
Unity/Assets/Scripts/Module/Config/AConfigComponent.cs.meta
Unity/Assets/Scripts/Module/Config/AConfigComponent.cs.meta
+0
-0
Unity/Assets/Scripts/Module/Config/ConfigAttribute.cs
Unity/Assets/Scripts/Module/Config/ConfigAttribute.cs
+0
-0
Unity/Assets/Scripts/Module/Config/ConfigAttribute.cs.meta
Unity/Assets/Scripts/Module/Config/ConfigAttribute.cs.meta
+0
-0
Unity/Assets/Scripts/Module/Config/ConfigComponent.cs
Unity/Assets/Scripts/Module/Config/ConfigComponent.cs
+0
-0
Unity/Assets/Scripts/Module/Config/ConfigComponent.cs.meta
Unity/Assets/Scripts/Module/Config/ConfigComponent.cs.meta
+0
-0
Unity/Assets/Scripts/Module/Config/ConfigHelper.cs
Unity/Assets/Scripts/Module/Config/ConfigHelper.cs
+0
-0
Unity/Assets/Scripts/Module/Config/ConfigHelper.cs.meta
Unity/Assets/Scripts/Module/Config/ConfigHelper.cs.meta
+0
-0
Unity/Assets/Scripts/Module/Config/ICategory.cs
Unity/Assets/Scripts/Module/Config/ICategory.cs
+0
-0
Unity/Assets/Scripts/Module/Config/ICategory.cs.meta
Unity/Assets/Scripts/Module/Config/ICategory.cs.meta
+0
-0
Unity/Unity.csproj
Unity/Unity.csproj
+14
-11
未找到文件。
Server/Model/Base/Config/ACategory.cs
已删除
100644 → 0
浏览文件 @
a8efa551
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
namespace
Model
{
/// <summary>
/// 管理该所有的配置
/// </summary>
/// <typeparam name="T"></typeparam>
public
abstract
class
ACategory
<
T
>:
ICategory
where
T
:
AConfig
{
protected
Dictionary
<
long
,
T
>
dict
;
public
virtual
void
BeginInit
()
{
this
.
dict
=
new
Dictionary
<
long
,
T
>();
string
configStr
=
ConfigHelper
.
GetText
(
typeof
(
T
).
Name
);
foreach
(
string
str
in
configStr
.
Split
(
new
[]
{
"\n"
},
StringSplitOptions
.
None
))
{
try
{
string
str2
=
str
.
Trim
();
if
(
str2
==
""
)
{
continue
;
}
T
t
=
MongoHelper
.
FromJson
<
T
>(
str2
);
this
.
dict
.
Add
(
t
.
Id
,
t
);
}
catch
(
Exception
e
)
{
throw
new
Exception
(
$"parser json fail:
{
str
}
"
,
e
);
}
}
}
public
Type
ConfigType
{
get
{
return
typeof
(
T
);
}
}
public
virtual
void
EndInit
()
{
}
public
T
this
[
long
type
]
{
get
{
if
(!
this
.
dict
.
TryGetValue
(
type
,
out
T
t
))
{
throw
new
KeyNotFoundException
(
$"
{
typeof
(
T
)}
没有找到配置, key:
{
type
}
"
);
}
return
t
;
}
}
public
T
TryGet
(
int
type
)
{
if
(!
this
.
dict
.
TryGetValue
(
type
,
out
T
t
))
{
return
null
;
}
return
t
;
}
public
T
[]
GetAll
()
{
return
this
.
dict
.
Values
.
ToArray
();
}
public
T
GetOne
()
{
return
this
.
dict
.
Values
.
First
();
}
}
}
\ No newline at end of file
Server/Model/
Bas
e/Config/AConfigComponent.cs
→
Server/Model/
Modul
e/Config/AConfigComponent.cs
浏览文件 @
366e59bc
文件已移动
Server/Model/
Bas
e/Config/ConfigHelper.cs
→
Server/Model/
Modul
e/Config/ConfigHelper.cs
浏览文件 @
366e59bc
文件已移动
Server/Model/Server.Model.csproj
浏览文件 @
366e59bc
...
...
@@ -59,7 +59,6 @@
<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\UnOrderMultiMap.cs" Link="Base\UnOrderMultiMap.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Component\ConfigComponent.cs" Link="Component\ConfigComponent.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Component\Config\ClientConfig.cs" Link="Component\Config\ClientConfig.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Component\Config\DBConfig.cs" Link="Module\DB\DBConfig.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Component\Config\HttpConfig.cs" Link="Module\Http\HttpConfig.cs" />
...
...
@@ -70,6 +69,11 @@
<Compile Include="..\..\Unity\Assets\Scripts\Helper\SessionHelper.cs" Link="Base\Helper\SessionHelper.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Message\OuterMessage.cs" Link="Message\OuterMessage.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Message\OuterOpcode.cs" Link="Message\OuterOpcode.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Module\Config\ACategory.cs" Link="Module\Config\ACategory.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Module\Config\AConfig.cs" Link="Module\Config\AConfig.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Module\Config\ConfigAttribute.cs" Link="Module\Config\ConfigAttribute.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Module\Config\ConfigComponent.cs" Link="Module\Config\ConfigComponent.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Module\Config\ICategory.cs" Link="Module\Config\ICategory.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Module\Message\AMHandler.cs" Link="Module\Message\AMHandler.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Module\Message\ErrorCode.cs" Link="Module\Message\ErrorCode.cs" />
<Compile Include="..\..\Unity\Assets\Scripts\Module\Message\IActorMessage.cs" Link="Module\Message\IActorMessage.cs" />
...
...
Unity/Assets/Scripts/Base/Config.meta
已删除
100644 → 0
浏览文件 @
a8efa551
fileFormatVersion: 2
guid: d574f09c5596d2440b51164c43606464
folderAsset: yes
timeCreated: 1498118203
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
Unity/Assets/Scripts/Base/Config/AConfig.cs
已删除
100644 → 0
浏览文件 @
a8efa551
namespace
Model
{
/// <summary>
/// 每个Config的基类
/// </summary>
public
abstract
class
AConfig
:
Entity
{
protected
AConfig
()
{
}
protected
AConfig
(
long
id
):
base
(
id
)
{
}
}
}
\ No newline at end of file
Unity/Assets/Scripts/Base/Config/ConfigAttribute.cs
已删除
100644 → 0
浏览文件 @
a8efa551
using
System
;
namespace
Model
{
[
AttributeUsage
(
AttributeTargets
.
Class
)]
public
class
ConfigAttribute
:
Attribute
{
public
AppType
Type
{
get
;
}
public
ConfigAttribute
(
AppType
type
)
{
this
.
Type
=
type
;
}
}
}
\ No newline at end of file
Unity/Assets/Scripts/Base/Config/ICategory.cs
已删除
100644 → 0
浏览文件 @
a8efa551
using
System
;
using
System.ComponentModel
;
namespace
Model
{
public
interface
ICategory
:
ISupportInitialize
{
Type
ConfigType
{
get
;
}
}
}
\ No newline at end of file
Unity/Assets/Scripts/Module/Config.meta
0 → 100644
浏览文件 @
366e59bc
fileFormatVersion: 2
guid: 79cf86d179ba4eda88b3bd3708dab066
timeCreated: 1519369141
\ No newline at end of file
Unity/Assets/Scripts/
Bas
e/Config/ACategory.cs
→
Unity/Assets/Scripts/
Modul
e/Config/ACategory.cs
浏览文件 @
366e59bc
文件已移动
Unity/Assets/Scripts/
Bas
e/Config/ACategory.cs.meta
→
Unity/Assets/Scripts/
Modul
e/Config/ACategory.cs.meta
浏览文件 @
366e59bc
文件已移动
Server/Model/Bas
e/Config/AConfig.cs
→
Unity/Assets/Scripts/Modul
e/Config/AConfig.cs
浏览文件 @
366e59bc
文件已移动
Unity/Assets/Scripts/
Bas
e/Config/AConfig.cs.meta
→
Unity/Assets/Scripts/
Modul
e/Config/AConfig.cs.meta
浏览文件 @
366e59bc
文件已移动
Unity/Assets/Scripts/
Bas
e/Config/AConfigComponent.cs
→
Unity/Assets/Scripts/
Modul
e/Config/AConfigComponent.cs
浏览文件 @
366e59bc
文件已移动
Unity/Assets/Scripts/
Bas
e/Config/AConfigComponent.cs.meta
→
Unity/Assets/Scripts/
Modul
e/Config/AConfigComponent.cs.meta
浏览文件 @
366e59bc
文件已移动
Server/Model/Bas
e/Config/ConfigAttribute.cs
→
Unity/Assets/Scripts/Modul
e/Config/ConfigAttribute.cs
浏览文件 @
366e59bc
文件已移动
Unity/Assets/Scripts/
Bas
e/Config/ConfigAttribute.cs.meta
→
Unity/Assets/Scripts/
Modul
e/Config/ConfigAttribute.cs.meta
浏览文件 @
366e59bc
文件已移动
Unity/Assets/Scripts/
Component
/ConfigComponent.cs
→
Unity/Assets/Scripts/
Module/Config
/ConfigComponent.cs
浏览文件 @
366e59bc
文件已移动
Unity/Assets/Scripts/
Component
/ConfigComponent.cs.meta
→
Unity/Assets/Scripts/
Module/Config
/ConfigComponent.cs.meta
浏览文件 @
366e59bc
文件已移动
Unity/Assets/Scripts/
Bas
e/Config/ConfigHelper.cs
→
Unity/Assets/Scripts/
Modul
e/Config/ConfigHelper.cs
浏览文件 @
366e59bc
文件已移动
Unity/Assets/Scripts/
Bas
e/Config/ConfigHelper.cs.meta
→
Unity/Assets/Scripts/
Modul
e/Config/ConfigHelper.cs.meta
浏览文件 @
366e59bc
文件已移动
Server/Model/Bas
e/Config/ICategory.cs
→
Unity/Assets/Scripts/Modul
e/Config/ICategory.cs
浏览文件 @
366e59bc
文件已移动
Unity/Assets/Scripts/
Bas
e/Config/ICategory.cs.meta
→
Unity/Assets/Scripts/
Modul
e/Config/ICategory.cs.meta
浏览文件 @
366e59bc
文件已移动
Unity/Unity.csproj
浏览文件 @
366e59bc
...
...
@@ -12,12 +12,15 @@
<ProjectTypeGuids>
{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
</ProjectTypeGuids>
<TargetFrameworkIdentifier>
.NETFramework
</TargetFrameworkIdentifier>
<TargetFrameworkVersion>
v4.6
</TargetFrameworkVersion>
<TargetFrameworkProfile></TargetFrameworkProfile>
<CompilerResponseFile></CompilerResponseFile>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<CompilerResponseFile>
</CompilerResponseFile>
<UnityProjectType>
Game:1
</UnityProjectType>
<UnityBuildTarget>
StandaloneWindows64:19
</UnityBuildTarget>
<UnityVersion>
2017.1.1p4
</UnityVersion>
<RootNamespace></RootNamespace>
<RootNamespace>
</RootNamespace>
<LangVersion>
6
</LangVersion>
</PropertyGroup>
<PropertyGroup>
...
...
@@ -114,12 +117,6 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"Assets\Scripts\Base\Config\ACategory.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\Config\AConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\Config\AConfigComponent.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\Config\ConfigAttribute.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\Config\ConfigHelper.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\Config\ICategory.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\DoubleMap.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\Event\AEventAttribute.cs"
/>
<Compile
Include=
"Assets\Scripts\Base\Event\CrossEventAttribute.cs"
/>
...
...
@@ -202,7 +199,7 @@
<Compile
Include=
"Assets\Scripts\Component\Config\RunServerConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\Component\Config\StartConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\Component\Config\VersionConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\
Component
\ConfigComponent.cs"
/>
<Compile
Include=
"Assets\Scripts\
Module\Config
\ConfigComponent.cs"
/>
<Compile
Include=
"Assets\Scripts\Component\GlobalConfigComponent.cs"
/>
<Compile
Include=
"Assets\Scripts\Component\MoveComponent.cs"
/>
<Compile
Include=
"Assets\Scripts\Component\PlayerComponent.cs"
/>
...
...
@@ -291,6 +288,12 @@
<Compile
Include=
"Assets\Scripts\Module\BehaviorTree\NodePropAttribute.cs"
/>
<Compile
Include=
"Assets\Scripts\Module\BehaviorTree\NodeProto.cs"
/>
<Compile
Include=
"Assets\Scripts\Module\BehaviorTree\TypeHelper.cs"
/>
<Compile
Include=
"Assets\Scripts\Module\Config\ACategory.cs"
/>
<Compile
Include=
"Assets\Scripts\Module\Config\AConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\Module\Config\AConfigComponent.cs"
/>
<Compile
Include=
"Assets\Scripts\Module\Config\ConfigAttribute.cs"
/>
<Compile
Include=
"Assets\Scripts\Module\Config\ConfigHelper.cs"
/>
<Compile
Include=
"Assets\Scripts\Module\Config\ICategory.cs"
/>
<Compile
Include=
"Assets\Scripts\Module\Message\AMHandler.cs"
/>
<Compile
Include=
"Assets\Scripts\Module\Message\ClientDispatcher.cs"
/>
<Compile
Include=
"Assets\Scripts\Module\Message\ErrorCode.cs"
/>
...
...
@@ -775,4 +778,4 @@
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
<Target
Name=
"GenerateTargetFrameworkMonikerAttribute"
/>
</Project>
</Project>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录