Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
guo450212436
et
提交
d4a1ee58
E
et
项目概览
guo450212436
/
et
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
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,体验更适合开发者的 AI 搜索 >>
提交
d4a1ee58
编写于
11月 03, 2016
作者:
T
tanghai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
配置文件都改成了组件式
上级
730f54dd
变更
25
隐藏空白更改
内联
并排
Showing
25 changed file
with
141 addition
and
80 deletion
+141
-80
Server/Model/Server.Model.csproj
Server/Model/Server.Model.csproj
+18
-12
Unity/Assets/Editor/ClientConfigEditor/ClientConfigEditor.cs
Unity/Assets/Editor/ClientConfigEditor/ClientConfigEditor.cs
+12
-13
Unity/Assets/Scripts/Component/ClientConfigComponent.cs
Unity/Assets/Scripts/Component/ClientConfigComponent.cs
+15
-3
Unity/Assets/Scripts/Component/Config.meta
Unity/Assets/Scripts/Component/Config.meta
+2
-2
Unity/Assets/Scripts/Component/Config/ClientConfig.cs
Unity/Assets/Scripts/Component/Config/ClientConfig.cs
+0
-0
Unity/Assets/Scripts/Component/Config/ClientConfig.cs.meta
Unity/Assets/Scripts/Component/Config/ClientConfig.cs.meta
+2
-2
Unity/Assets/Scripts/Component/Config/InnerConfig.cs
Unity/Assets/Scripts/Component/Config/InnerConfig.cs
+21
-0
Unity/Assets/Scripts/Component/Config/InnerConfig.cs.meta
Unity/Assets/Scripts/Component/Config/InnerConfig.cs.meta
+12
-0
Unity/Assets/Scripts/Component/Config/OuterConfig.cs
Unity/Assets/Scripts/Component/Config/OuterConfig.cs
+21
-0
Unity/Assets/Scripts/Component/Config/OuterConfig.cs.meta
Unity/Assets/Scripts/Component/Config/OuterConfig.cs.meta
+12
-0
Unity/Assets/Scripts/Config/AConfig.cs
Unity/Assets/Scripts/Config/AConfig.cs
+4
-8
Unity/Assets/Scripts/Entity/Config.meta
Unity/Assets/Scripts/Entity/Config.meta
+0
-0
Unity/Assets/Scripts/Entity/Config/BuffConfig.cs
Unity/Assets/Scripts/Entity/Config/BuffConfig.cs
+9
-1
Unity/Assets/Scripts/Entity/Config/BuffConfig.cs.meta
Unity/Assets/Scripts/Entity/Config/BuffConfig.cs.meta
+0
-0
Unity/Assets/Scripts/Entity/Config/StartConfig.cs
Unity/Assets/Scripts/Entity/Config/StartConfig.cs
+1
-1
Unity/Assets/Scripts/Entity/Config/StartConfig.cs.meta
Unity/Assets/Scripts/Entity/Config/StartConfig.cs.meta
+0
-0
Unity/Assets/Scripts/Entity/Message.meta
Unity/Assets/Scripts/Entity/Message.meta
+0
-0
Unity/Assets/Scripts/Entity/Message/Message.cs
Unity/Assets/Scripts/Entity/Message/Message.cs
+0
-0
Unity/Assets/Scripts/Entity/Message/Message.cs.meta
Unity/Assets/Scripts/Entity/Message/Message.cs.meta
+0
-0
Unity/Assets/Scripts/Other/EntityType.cs
Unity/Assets/Scripts/Other/EntityType.cs
+3
-0
Unity/Assets/Scripts/Other/Options.cs
Unity/Assets/Scripts/Other/Options.cs
+0
-32
Unity/ClientConfig.txt
Unity/ClientConfig.txt
+0
-1
Unity/Controller/Event/InitSceneStartEvent_InitGame.cs
Unity/Controller/Event/InitSceneStartEvent_InitGame.cs
+1
-1
Unity/StartConfig.txt
Unity/StartConfig.txt
+1
-0
Unity/Unity.CSharp.csproj
Unity/Unity.CSharp.csproj
+7
-4
未找到文件。
Server/Model/Server.Model.csproj
浏览文件 @
d4a1ee58
...
...
@@ -47,6 +47,15 @@
<Compile
Include=
"..\..\Unity\Assets\Scripts\Component\ConfigComponent.cs"
>
<Link>
Component\ConfigComponent.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Component\Config\ClientConfig.cs"
>
<Link>
Component\Config\ClientConfig.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Component\Config\InnerConfig.cs"
>
<Link>
Component\Config\InnerConfig.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Component\Config\OuterConfig.cs"
>
<Link>
Component\Config\OuterConfig.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Component\EventComponent.cs"
>
<Link>
Component\EventComponent.cs
</Link>
</Compile>
...
...
@@ -83,9 +92,18 @@
<Compile
Include=
"..\..\Unity\Assets\Scripts\Config\ICategory.cs"
>
<Link>
Config\ICategory.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Entity\Config\BuffConfig.cs"
>
<Link>
Entity\Config\BuffConfig.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Entity\Config\StartConfig.cs"
>
<Link>
Entity\Config\StartConfig.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Entity\Game.cs"
>
<Link>
Entity\Game.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Entity\Message\Message.cs"
>
<Link>
Entity\Message\Message.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Entity\Scene.cs"
>
<Link>
Entity\Scene.cs
</Link>
</Compile>
...
...
@@ -137,27 +155,15 @@
<Compile
Include=
"..\..\Unity\Assets\Scripts\Message\RpcException.cs"
>
<Link>
Message\RpcException.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Model\Config\BuffConfig.cs"
>
<Link>
Model\Config\BuffConfig.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Model\Message\Message.cs"
>
<Link>
Model\Message\Message.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Other\BsonClassMapRegister.cs"
>
<Link>
Other\BsonClassMapRegister.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Other\ClientConfig.cs"
>
<Link>
Other\ClientConfig.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Other\EntityType.cs"
>
<Link>
Other\EntityType.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Other\Options.cs"
>
<Link>
Other\Options.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Other\StartConfig.cs"
>
<Link>
Other\StartConfig.cs
</Link>
</Compile>
<Compile
Include=
"Component\AppManagerComponent.cs"
/>
<Compile
Include=
"Component\LogToClientComponent.cs"
/>
<Compile
Include=
"Component\GateSessionKeyComponent.cs"
/>
...
...
Unity/Assets/Editor/ClientConfigEditor/ClientConfigEditor.cs
浏览文件 @
d4a1ee58
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.IO
;
using
System.IO
;
using
Base
;
using
Model
;
using
UnityEditor
;
...
...
@@ -11,9 +8,9 @@ namespace MyEditor
{
public
class
ClientConfigEditor
:
EditorWindow
{
private
const
string
Path
=
"./
Clien
tConfig.txt"
;
private
const
string
Path
=
"./
Star
tConfig.txt"
;
private
Clien
tConfig
config
;
private
Star
tConfig
config
;
[
MenuItem
(
"Tools/客户端配置"
)]
private
static
void
ShowWindow
()
...
...
@@ -25,21 +22,23 @@ namespace MyEditor
{
if
(!
File
.
Exists
(
Path
))
{
this
.
config
=
new
ClientConfig
();
this
.
config
=
new
StartConfig
();
this
.
config
.
AppType
=
AppType
.
Client
;
this
.
config
.
ServerIP
=
"*"
;
this
.
config
.
AddComponent
<
ClientConfig
>();
return
;
}
string
s
=
File
.
ReadAllText
(
Path
);
this
.
config
=
MongoHelper
.
FromJson
<
Clien
tConfig
>(
s
);
this
.
config
=
MongoHelper
.
FromJson
<
Star
tConfig
>(
s
);
}
private
void
OnGUI
()
{
this
.
config
.
Host
=
EditorGUILayout
.
TextField
(
"地址: "
,
this
.
config
.
Host
);
this
.
config
.
Port
=
EditorGUILayout
.
IntField
(
"端口: "
,
this
.
config
.
Port
);
GUILayout
.
BeginHorizontal
();
ClientConfig
clientConfig
=
this
.
config
.
GetComponent
<
ClientConfig
>();
clientConfig
.
Host
=
EditorGUILayout
.
TextField
(
"地址: "
,
clientConfig
.
Host
);
clientConfig
.
Port
=
EditorGUILayout
.
IntField
(
"端口: "
,
clientConfig
.
Port
);
if
(
GUILayout
.
Button
(
"保存"
))
{
using
(
StreamWriter
sw
=
new
StreamWriter
(
new
FileStream
(
Path
,
FileMode
.
Create
)))
...
...
Unity/Assets/Scripts/Component/ClientConfigComponent.cs
浏览文件 @
d4a1ee58
...
...
@@ -14,12 +14,24 @@ namespace Model
public
class
ClientConfigComponent
:
Component
{
public
Clien
tConfig
Config
{
get
;
private
set
;
}
public
Star
tConfig
Config
{
get
;
private
set
;
}
public
void
Awake
()
{
string
s
=
File
.
ReadAllText
(
"./ClientConfig.txt"
);
this
.
Config
=
MongoHelper
.
FromJson
<
ClientConfig
>(
s
);
string
s
=
File
.
ReadAllText
(
"./StartConfig.txt"
);
this
.
Config
=
MongoHelper
.
FromJson
<
StartConfig
>(
s
);
}
public
override
void
Dispose
()
{
if
(
this
.
Id
==
0
)
{
return
;
}
base
.
Dispose
();
this
.
Config
.
Dispose
();
}
}
}
\ No newline at end of file
Unity/Assets/Scripts/
Model
.meta
→
Unity/Assets/Scripts/
Component/Config
.meta
浏览文件 @
d4a1ee58
fileFormatVersion: 2
guid:
a7ca76f312d51e7469f7578030024db0
guid:
e98bd4118f88e1c428e3af0983722aa8
folderAsset: yes
timeCreated: 147
790504
1
timeCreated: 147
814428
1
licenseType: Pro
DefaultImporter:
userData:
...
...
Unity/Assets/Scripts/
Other
/ClientConfig.cs
→
Unity/Assets/Scripts/
Component/Config
/ClientConfig.cs
浏览文件 @
d4a1ee58
文件已移动
Unity/Assets/Scripts/
Other
/ClientConfig.cs.meta
→
Unity/Assets/Scripts/
Component/Config
/ClientConfig.cs.meta
浏览文件 @
d4a1ee58
fileFormatVersion: 2
guid:
500eb7f5c0a52e045a339f55912f8a2b
timeCreated: 147
7315494
guid:
befeb8cfbdbfc5b4ea5f967c200d4751
timeCreated: 147
8144281
licenseType: Pro
MonoImporter:
serializedVersion: 2
...
...
Unity/Assets/Scripts/Component/Config/InnerConfig.cs
0 → 100644
浏览文件 @
d4a1ee58
using
Base
;
using
MongoDB.Bson.Serialization.Attributes
;
namespace
Model
{
[
BsonIgnoreExtraElements
]
public
class
InnerConfig
:
Component
{
public
string
Host
{
get
;
set
;
}
public
int
Port
{
get
;
set
;
}
[
BsonIgnore
]
public
string
Address
{
get
{
return
$"
{
this
.
Host
}
:
{
this
.
Port
}
"
;
}
}
}
}
Unity/Assets/Scripts/Component/Config/InnerConfig.cs.meta
0 → 100644
浏览文件 @
d4a1ee58
fileFormatVersion: 2
guid: 35f166fd86ee5e44aaec9326bb0a5454
timeCreated: 1478144281
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Unity/Assets/Scripts/Component/Config/OuterConfig.cs
0 → 100644
浏览文件 @
d4a1ee58
using
Base
;
using
MongoDB.Bson.Serialization.Attributes
;
namespace
Model
{
[
BsonIgnoreExtraElements
]
public
class
OuterConfig
:
Component
{
public
string
Host
{
get
;
set
;
}
public
int
Port
{
get
;
set
;
}
[
BsonIgnore
]
public
string
Address
{
get
{
return
$"
{
this
.
Host
}
:
{
this
.
Port
}
"
;
}
}
}
}
Unity/Assets/Scripts/Component/Config/OuterConfig.cs.meta
0 → 100644
浏览文件 @
d4a1ee58
fileFormatVersion: 2
guid: 31224cfdac2f28c42bd641d5a2e80fe8
timeCreated: 1478144281
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Unity/Assets/Scripts/Config/AConfig.cs
浏览文件 @
d4a1ee58
using
System.ComponentModel
;
using
MongoDB.Bson.Serialization.Attributes
;
using
Base
;
namespace
Model
{
/// <summary>
/// 每个Config的基类
/// </summary>
public
abstract
class
AConfig
:
ISupportInitialize
public
abstract
class
AConfig
:
Entity
{
[
BsonId
]
public
long
Id
{
get
;
set
;
}
public
virtual
void
BeginInit
()
public
AConfig
(
string
entityType
):
base
(
entityType
)
{
}
public
virtual
void
EndInit
(
)
public
AConfig
(
long
id
,
string
entityType
):
base
(
id
,
entityType
)
{
}
}
...
...
Unity/Assets/Scripts/
Model
/Config.meta
→
Unity/Assets/Scripts/
Entity
/Config.meta
浏览文件 @
d4a1ee58
文件已移动
Unity/Assets/Scripts/
Model
/Config/BuffConfig.cs
→
Unity/Assets/Scripts/
Entity
/Config/BuffConfig.cs
浏览文件 @
d4a1ee58
...
...
@@ -7,7 +7,15 @@ namespace Model
{
public
string
Name
{
get
;
set
;
}
public
int
Time
{
get
;
set
;
}
}
public
BuffConfig
():
base
(
EntityType
.
BuffConfig
)
{
}
public
BuffConfig
(
long
id
):
base
(
id
,
EntityType
.
BuffConfig
)
{
}
}
[
Config
(
AppType
.
Client
|
AppType
.
Gate
)]
public
class
BuffCategory
:
ACategory
<
BuffConfig
>
...
...
Unity/Assets/Scripts/
Model
/Config/BuffConfig.cs.meta
→
Unity/Assets/Scripts/
Entity
/Config/BuffConfig.cs.meta
浏览文件 @
d4a1ee58
文件已移动
Unity/Assets/Scripts/
Other
/StartConfig.cs
→
Unity/Assets/Scripts/
Entity/Config
/StartConfig.cs
浏览文件 @
d4a1ee58
...
...
@@ -4,7 +4,7 @@ using MongoDB.Bson.Serialization.Attributes;
namespace
Model
{
public
class
StartConfig
:
Entity
public
class
StartConfig
:
AConfig
{
public
int
AppId
{
get
;
set
;
}
...
...
Unity/Assets/Scripts/
Other
/StartConfig.cs.meta
→
Unity/Assets/Scripts/
Entity/Config
/StartConfig.cs.meta
浏览文件 @
d4a1ee58
文件已移动
Unity/Assets/Scripts/
Model
/Message.meta
→
Unity/Assets/Scripts/
Entity
/Message.meta
浏览文件 @
d4a1ee58
文件已移动
Unity/Assets/Scripts/
Model
/Message/Message.cs
→
Unity/Assets/Scripts/
Entity
/Message/Message.cs
浏览文件 @
d4a1ee58
文件已移动
Unity/Assets/Scripts/
Model
/Message/Message.cs.meta
→
Unity/Assets/Scripts/
Entity
/Message/Message.cs.meta
浏览文件 @
d4a1ee58
文件已移动
Unity/Assets/Scripts/Other/EntityType.cs
浏览文件 @
d4a1ee58
...
...
@@ -8,5 +8,8 @@
public
const
string
UI
=
"UI"
;
public
const
string
Config
=
"Config"
;
public
const
string
Network
=
"Network"
;
// Config
public
const
string
BuffConfig
=
"BuffConfig"
;
}
}
\ No newline at end of file
Unity/Assets/Scripts/Other/Options.cs
浏览文件 @
d4a1ee58
...
...
@@ -29,36 +29,4 @@ namespace Model
return
MongoHelper
.
FromBson
<
Options
>(
MongoHelper
.
ToBson
(
this
));
}
}
[
BsonIgnoreExtraElements
]
public
class
InnerConfig
:
Component
{
public
string
Host
{
get
;
set
;
}
public
int
Port
{
get
;
set
;
}
[
BsonIgnore
]
public
string
Address
{
get
{
return
$"
{
this
.
Host
}
:
{
this
.
Port
}
"
;
}
}
}
[
BsonIgnoreExtraElements
]
public
class
OuterConfig
:
Component
{
public
string
Host
{
get
;
set
;
}
public
int
Port
{
get
;
set
;
}
[
BsonIgnore
]
public
string
Address
{
get
{
return
$"
{
this
.
Host
}
:
{
this
.
Port
}
"
;
}
}
}
}
\ No newline at end of file
Unity/ClientConfig.txt
已删除
100644 → 0
浏览文件 @
730f54dd
{ "_t" : "ClientConfig", "Host" : "127.0.0.1", "Port" : 10000 }
\ No newline at end of file
Unity/Controller/Event/InitSceneStartEvent_InitGame.cs
浏览文件 @
d4a1ee58
...
...
@@ -13,7 +13,7 @@ namespace Controller
public
async
void
Run
()
{
Game
.
Scene
.
AddComponent
<
MessageDispatherComponent
,
AppType
>(
AppType
.
Client
);
ClientConfig
clientConfig
=
Game
.
Scene
.
AddComponent
<
ClientConfigComponent
>().
Config
;
ClientConfig
clientConfig
=
Game
.
Scene
.
AddComponent
<
ClientConfigComponent
>().
Config
.
GetComponent
<
ClientConfig
>()
;
NetOuterComponent
networkComponent
=
Game
.
Scene
.
AddComponent
<
NetOuterComponent
>();
using
(
Session
session
=
networkComponent
.
Create
(
clientConfig
.
Address
))
{
...
...
Unity/StartConfig.txt
0 → 100644
浏览文件 @
d4a1ee58
{ "_t" : "StartConfig", "_id" : NumberLong("96871590002689"), "Type" : "Config", "components" : [{ "_t" : "ClientConfig", "_id" : NumberLong("96871590002690"), "Host" : "127.0.0.1", "Port" : 10000 }], "AppId" : 0, "AppType" : "None", "ServerIP" : null }
\ No newline at end of file
Unity/Unity.CSharp.csproj
浏览文件 @
d4a1ee58
...
...
@@ -83,6 +83,9 @@
<Compile
Include=
"Assets\Scripts\Component\ChildrenComponent.cs"
/>
<Compile
Include=
"Assets\Scripts\Component\ClientConfigComponent.cs"
/>
<Compile
Include=
"Assets\Scripts\Component\ConfigComponent.cs"
/>
<Compile
Include=
"Assets\Scripts\Component\Config\OuterConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\Component\Config\InnerConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\Component\Config\ClientConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\Component\EventComponent.cs"
/>
<Compile
Include=
"Assets\Scripts\Component\GameObjectComponent.cs"
/>
<Compile
Include=
"Assets\Scripts\Component\KVComponent.cs"
/>
...
...
@@ -120,14 +123,13 @@
<Compile
Include=
"Assets\Scripts\Message\MessageHandlerAttribute.cs"
/>
<Compile
Include=
"Assets\Scripts\Message\OpcodeHelper.cs"
/>
<Compile
Include=
"Assets\Scripts\Message\RpcException.cs"
/>
<Compile
Include=
"Assets\Scripts\
Model
\Config\BuffConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\
Model
\Message\Message.cs"
/>
<Compile
Include=
"Assets\Scripts\
Entity
\Config\BuffConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\
Entity
\Message\Message.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\BsonClassMapRegister.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\ClientConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\EntityType.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\GameException.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\Options.cs"
/>
<Compile
Include=
"Assets\Scripts\
Other
\StartConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\
Entity\Config
\StartConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\UIType.cs"
/>
<Compile
Include=
"Assets\Scripts\ReferenceCollector.cs"
/>
</ItemGroup>
...
...
@@ -135,5 +137,6 @@
<None
Include=
"Assets\CSharp 6.0 Support\AsyncTools\Plugins\AsyncBridge.Net35.xml"
/>
<None
Include=
"Assets\CSharp 6.0 Support\AsyncTools\Plugins\System.Threading.xml"
/>
</ItemGroup>
<ItemGroup
/>
<Import
Project=
"$(MSBuildExtensionsPath)\SyntaxTree\UnityVS\2015\UnityVS.CSharp.targets"
/>
</Project>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录