Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
guo450212436
et
提交
83bd33bc
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,发现更多精彩内容 >>
提交
83bd33bc
编写于
10月 24, 2016
作者:
T
tanghai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加ServerType枚举,简化了代码
上级
58c9772c
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
54 addition
and
10 deletion
+54
-10
Server/Controller/Message/C2M_ReloadHandler.cs
Server/Controller/Message/C2M_ReloadHandler.cs
+1
-1
Server/Controller/Message/M2A_ReloadHandler.cs
Server/Controller/Message/M2A_ReloadHandler.cs
+1
-1
Server/Model/Server.Model.csproj
Server/Model/Server.Model.csproj
+3
-0
Server/Run.sh
Server/Run.sh
+1
-1
Server/Start.sh
Server/Start.sh
+1
-1
Unity/Assets/Editor/ServerManagerEditor/ServerManagerEditor.cs
.../Assets/Editor/ServerManagerEditor/ServerManagerEditor.cs
+7
-6
Unity/Assets/Scripts/Other/Options.cs
Unity/Assets/Scripts/Other/Options.cs
+18
-0
Unity/Assets/Scripts/Other/ServerType.cs
Unity/Assets/Scripts/Other/ServerType.cs
+9
-0
Unity/Assets/Scripts/Other/ServerType.cs.meta
Unity/Assets/Scripts/Other/ServerType.cs.meta
+12
-0
Unity/Unity.CSharp.csproj
Unity/Unity.CSharp.csproj
+1
-0
未找到文件。
Server/Controller/Message/C2M_ReloadHandler.cs
浏览文件 @
83bd33bc
...
@@ -21,7 +21,7 @@ namespace Controller
...
@@ -21,7 +21,7 @@ namespace Controller
continue
;
continue
;
}
}
InnerConfig
innerConfig
=
startConfig
.
Config
.
GetComponent
<
InnerConfig
>();
InnerConfig
innerConfig
=
startConfig
.
Config
.
GetComponent
<
InnerConfig
>();
Entity
serverSession
=
netInnerComponent
.
Get
(
$"
{
innerConfig
.
Host
}
:
{
innerConfig
.
Port
}
"
);
Entity
serverSession
=
netInnerComponent
.
Get
(
innerConfig
.
Address
);
await
serverSession
.
GetComponent
<
MessageComponent
>().
Call
<
M2A_Reload
,
A2M_Reload
>(
new
M2A_Reload
());
await
serverSession
.
GetComponent
<
MessageComponent
>().
Call
<
M2A_Reload
,
A2M_Reload
>(
new
M2A_Reload
());
}
}
}
}
...
...
Server/Controller/Message/M2A_ReloadHandler.cs
浏览文件 @
83bd33bc
...
@@ -20,7 +20,7 @@ namespace Controller
...
@@ -20,7 +20,7 @@ namespace Controller
a2MReload
.
Error
=
ErrorCode
.
ERR_ReloadFail
;
a2MReload
.
Error
=
ErrorCode
.
ERR_ReloadFail
;
StartConfig
myStartConfig
=
Game
.
Scene
.
GetComponent
<
StartConfigComponent
>().
MyConfig
;
StartConfig
myStartConfig
=
Game
.
Scene
.
GetComponent
<
StartConfigComponent
>().
MyConfig
;
InnerConfig
innerConfig
=
myStartConfig
.
Config
.
GetComponent
<
InnerConfig
>();
InnerConfig
innerConfig
=
myStartConfig
.
Config
.
GetComponent
<
InnerConfig
>();
a2MReload
.
Message
=
$"
{
innerConfig
.
Host
}
:
{
innerConfig
.
Port
}
reload fail,
{
e
}
"
;
a2MReload
.
Message
=
$"
{
innerConfig
.
Address
}
reload fail,
{
e
}
"
;
}
}
reply
(
a2MReload
);
reply
(
a2MReload
);
}
}
...
...
Server/Model/Server.Model.csproj
浏览文件 @
83bd33bc
...
@@ -86,6 +86,9 @@
...
@@ -86,6 +86,9 @@
<Compile
Include=
"..\..\Unity\Assets\Scripts\Other\Options.cs"
>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Other\Options.cs"
>
<Link>
Other\Options.cs
</Link>
<Link>
Other\Options.cs
</Link>
</Compile>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Other\ServerType.cs"
>
<Link>
Other\ServerType.cs
</Link>
</Compile>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Other\StartConfig.cs"
>
<Compile
Include=
"..\..\Unity\Assets\Scripts\Other\StartConfig.cs"
>
<Link>
Other\StartConfig.cs
</Link>
<Link>
Other\StartConfig.cs
</Link>
</Compile>
</Compile>
...
...
Server/Run.sh
浏览文件 @
83bd33bc
...
@@ -5,5 +5,5 @@ cd Bin/Debug/
...
@@ -5,5 +5,5 @@ cd Bin/Debug/
cmake ../..
cmake ../..
make
make
p
kill App.exe
p
s
-ef
|
grep
App.exe |
awk
'{print $2}'
| xargs
kill
-9
mono
--debug
App.exe
--id
=
1
--appType
=
Manager
mono
--debug
App.exe
--id
=
1
--appType
=
Manager
\ No newline at end of file
Server/Start.sh
浏览文件 @
83bd33bc
#!/bin/bash
#!/bin/bash
cd
Bin/Debug/
cd
Bin/Debug/
p
kill App.exe
p
s
-ef
|
grep
App.exe |
awk
'{print $2}'
| xargs
kill
-9
mono
--debug
App.exe
--id
=
1
--appType
=
Manager
mono
--debug
App.exe
--id
=
1
--appType
=
Manager
\ No newline at end of file
Unity/Assets/Editor/ServerManagerEditor/ServerManagerEditor.cs
浏览文件 @
83bd33bc
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
Base
;
using
Base
;
using
Model
;
using
Model
;
using
UnityEditor
;
using
UnityEditor
;
...
@@ -14,8 +13,8 @@ namespace MyEditor
...
@@ -14,8 +13,8 @@ namespace MyEditor
private
bool
isAll
;
private
bool
isAll
;
private
string
[]
appTypes
=
{
"Manager"
,
"Realm"
,
"Gate"
}
;
private
readonly
string
[]
serverTypes
=
Enum
.
GetNames
(
typeof
(
ServerType
))
;
private
bool
[]
isCheck
=
{
false
,
false
,
false
}
;
private
bool
[]
isCheck
;
[
MenuItem
(
"Tools/服务器管理"
)]
[
MenuItem
(
"Tools/服务器管理"
)]
private
static
void
ShowWindow
()
private
static
void
ShowWindow
()
...
@@ -25,6 +24,7 @@ namespace MyEditor
...
@@ -25,6 +24,7 @@ namespace MyEditor
private
void
OnEnable
()
private
void
OnEnable
()
{
{
this
.
isCheck
=
new
bool
[
this
.
serverTypes
.
Length
];
}
}
private
void
OnGUI
()
private
void
OnGUI
()
...
@@ -35,6 +35,7 @@ namespace MyEditor
...
@@ -35,6 +35,7 @@ namespace MyEditor
return
;
return
;
}
}
List
<
string
>
selected
=
new
List
<
string
>();
List
<
string
>
selected
=
new
List
<
string
>();
this
.
isAll
=
GUILayout
.
Toggle
(
this
.
isAll
,
"All"
);
this
.
isAll
=
GUILayout
.
Toggle
(
this
.
isAll
,
"All"
);
if
(
this
.
isAll
)
if
(
this
.
isAll
)
...
@@ -45,9 +46,9 @@ namespace MyEditor
...
@@ -45,9 +46,9 @@ namespace MyEditor
}
}
}
}
for
(
int
i
=
0
;
i
<
this
.
app
Types
.
Length
;
++
i
)
for
(
int
i
=
0
;
i
<
this
.
server
Types
.
Length
;
++
i
)
{
{
this
.
isCheck
[
i
]
=
GUILayout
.
Toggle
(
this
.
isCheck
[
i
],
this
.
app
Types
[
i
]);
this
.
isCheck
[
i
]
=
GUILayout
.
Toggle
(
this
.
isCheck
[
i
],
this
.
server
Types
[
i
]);
if
(!
this
.
isCheck
[
i
])
if
(!
this
.
isCheck
[
i
])
{
{
this
.
isAll
=
false
;
this
.
isAll
=
false
;
...
@@ -62,7 +63,7 @@ namespace MyEditor
...
@@ -62,7 +63,7 @@ namespace MyEditor
{
{
if
(
this
.
isCheck
[
i
])
if
(
this
.
isCheck
[
i
])
{
{
selected
.
Add
(
this
.
app
Types
[
i
]);
selected
.
Add
(
this
.
server
Types
[
i
]);
}
}
}
}
NetworkComponent
networkComponent
=
Game
.
Scene
.
GetComponent
<
NetOuterComponent
>();
NetworkComponent
networkComponent
=
Game
.
Scene
.
GetComponent
<
NetOuterComponent
>();
...
...
Unity/Assets/Scripts/Other/Options.cs
浏览文件 @
83bd33bc
...
@@ -43,6 +43,15 @@ namespace Model
...
@@ -43,6 +43,15 @@ namespace Model
{
{
public
string
Host
{
get
;
set
;
}
public
string
Host
{
get
;
set
;
}
public
int
Port
{
get
;
set
;
}
public
int
Port
{
get
;
set
;
}
[
BsonIgnore
]
public
string
Address
{
get
{
return
$"
{
this
.
Host
}
:
{
this
.
Port
}
"
;
}
}
}
}
[
BsonIgnoreExtraElements
]
[
BsonIgnoreExtraElements
]
...
@@ -50,5 +59,14 @@ namespace Model
...
@@ -50,5 +59,14 @@ namespace Model
{
{
public
string
Host
{
get
;
set
;
}
public
string
Host
{
get
;
set
;
}
public
int
Port
{
get
;
set
;
}
public
int
Port
{
get
;
set
;
}
[
BsonIgnore
]
public
string
Address
{
get
{
return
$"
{
this
.
Host
}
:
{
this
.
Port
}
"
;
}
}
}
}
}
}
\ No newline at end of file
Unity/Assets/Scripts/Other/ServerType.cs
0 → 100644
浏览文件 @
83bd33bc
namespace
Model
{
public
enum
ServerType
{
Manager
,
Realm
,
Gate
,
}
}
Unity/Assets/Scripts/Other/ServerType.cs.meta
0 → 100644
浏览文件 @
83bd33bc
fileFormatVersion: 2
guid: fc81138bdc09d7143ba9a3510635f70a
timeCreated: 1477322119
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Unity/Unity.CSharp.csproj
浏览文件 @
83bd33bc
...
@@ -107,6 +107,7 @@
...
@@ -107,6 +107,7 @@
<Compile
Include=
"Assets\Scripts\Message\OpcodeHelper.cs"
/>
<Compile
Include=
"Assets\Scripts\Message\OpcodeHelper.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\BsonClassMapRegister.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\BsonClassMapRegister.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\ClientConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\ClientConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\ServerType.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\StartConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\StartConfig.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\EntityType.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\EntityType.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\GameException.cs"
/>
<Compile
Include=
"Assets\Scripts\Other\GameException.cs"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录