Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
老鱼er
et
提交
5811ca14
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,发现更多精彩内容 >>
提交
5811ca14
编写于
3月 01, 2021
作者:
T
tanghai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
网络调试通过,暂时外网内网全部使用TCP
上级
2a35bf6e
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
242 addition
and
127 deletion
+242
-127
Proto/InnerMessage.proto
Proto/InnerMessage.proto
+12
-0
Proto/OuterMessage.proto
Proto/OuterMessage.proto
+14
-3
Server/App/Program.cs
Server/App/Program.cs
+3
-1
Server/Hotfix/Handler/C2G_PingHandler.cs
Server/Hotfix/Handler/C2G_PingHandler.cs
+16
-0
Server/Model/Generate/InnerProtoOpcode.cs
Server/Model/Generate/InnerProtoOpcode.cs
+0
-29
Server/Model/Generate/Message/InnerMessage.cs
Server/Model/Generate/Message/InnerMessage.cs
+11
-0
Server/Model/Generate/Message/InnerOpcode.cs
Server/Model/Generate/Message/InnerOpcode.cs
+29
-0
Server/Model/Generate/Message/OuterMessage.cs
Server/Model/Generate/Message/OuterMessage.cs
+16
-4
Server/Model/Generate/Message/OuterOpcode.cs
Server/Model/Generate/Message/OuterOpcode.cs
+31
-0
Server/Model/Generate/OuterProtoOpcode.cs
Server/Model/Generate/OuterProtoOpcode.cs
+0
-31
Tools/Proto2CS/Program.cs
Tools/Proto2CS/Program.cs
+32
-7
Unity/Assets/Hotfix/Module/Message/NetKcpComponentSystem.cs
Unity/Assets/Hotfix/Module/Message/NetKcpComponentSystem.cs
+1
-1
Unity/Assets/Hotfix/Scene/LoginHelper.cs
Unity/Assets/Hotfix/Scene/LoginHelper.cs
+1
-0
Unity/Assets/Model/Core/Object/TimeInfo.cs
Unity/Assets/Model/Core/Object/TimeInfo.cs
+2
-2
Unity/Assets/Model/Generate/Message.meta
Unity/Assets/Model/Generate/Message.meta
+8
-0
Unity/Assets/Model/Generate/Message/OuterMessage.cs
Unity/Assets/Model/Generate/Message/OuterMessage.cs
+28
-9
Unity/Assets/Model/Generate/Message/OuterMessage.cs.meta
Unity/Assets/Model/Generate/Message/OuterMessage.cs.meta
+1
-1
Unity/Assets/Model/Generate/Message/OuterOpcode.cs
Unity/Assets/Model/Generate/Message/OuterOpcode.cs
+31
-0
Unity/Assets/Model/Generate/Message/OuterOpcode.cs.meta
Unity/Assets/Model/Generate/Message/OuterOpcode.cs.meta
+1
-1
Unity/Assets/Model/Generate/OuterProtoOpcode.cs
Unity/Assets/Model/Generate/OuterProtoOpcode.cs
+0
-31
Unity/Assets/Model/Module/Message/OpcodeTypeComponent.cs
Unity/Assets/Model/Module/Message/OpcodeTypeComponent.cs
+1
-3
Unity/Assets/Model/Module/NetworkTCP/TChannel.cs
Unity/Assets/Model/Module/NetworkTCP/TChannel.cs
+1
-1
Unity/Assets/Model/Module/Resource/ResourcesComponent.cs
Unity/Assets/Model/Module/Resource/ResourcesComponent.cs
+1
-1
Unity/Unity.Model.csproj
Unity/Unity.Model.csproj
+2
-2
未找到文件。
Proto/InnerMessage.proto
浏览文件 @
5811ca14
...
...
@@ -4,6 +4,7 @@ package ET;
/// <summary>
/// 传送unit
/// </summary>
//ResponseType M2M_TrasferUnitResponse
message
M2M_TrasferUnitRequest
// IActorRequest
{
int32
RpcId
=
90
;
...
...
@@ -20,6 +21,7 @@ message M2M_TrasferUnitResponse // IActorResponse
int64
InstanceId
=
1
;
}
//ResponseType A2M_Reload
message
M2A_Reload
// IActorRequest
{
int32
RpcId
=
90
;
...
...
@@ -33,6 +35,7 @@ message A2M_Reload // IActorResponse
string
Message
=
92
;
}
//ResponseType G2G_LockResponse
message
G2G_LockRequest
// IActorRequest
{
int32
RpcId
=
90
;
...
...
@@ -48,6 +51,7 @@ message G2G_LockResponse // IActorResponse
string
Message
=
92
;
}
//ResponseType G2G_LockReleaseResponse
message
G2G_LockReleaseRequest
// IActorRequest
{
int32
RpcId
=
90
;
...
...
@@ -63,6 +67,7 @@ message G2G_LockReleaseResponse // IActorResponse
string
Message
=
92
;
}
//ResponseType ObjectAddResponse
message
ObjectAddRequest
// IActorRequest
{
int32
RpcId
=
90
;
...
...
@@ -77,6 +82,8 @@ message ObjectAddResponse // IActorResponse
int32
Error
=
91
;
string
Message
=
92
;
}
//ResponseType ObjectLockResponse
message
ObjectLockRequest
// IActorRequest
{
int32
RpcId
=
90
;
...
...
@@ -92,6 +99,7 @@ message ObjectLockResponse // IActorResponse
string
Message
=
92
;
}
//ResponseType ObjectUnLockResponse
message
ObjectUnLockRequest
// IActorRequest
{
int32
RpcId
=
90
;
...
...
@@ -107,6 +115,7 @@ message ObjectUnLockResponse // IActorResponse
string
Message
=
92
;
}
//ResponseType ObjectRemoveResponse
message
ObjectRemoveRequest
// IActorRequest
{
int32
RpcId
=
90
;
...
...
@@ -120,6 +129,7 @@ message ObjectRemoveResponse // IActorResponse
string
Message
=
92
;
}
//ResponseType ObjectGetResponse
message
ObjectGetRequest
// IActorRequest
{
int32
RpcId
=
90
;
...
...
@@ -135,6 +145,7 @@ message ObjectGetResponse // IActorResponse
int64
InstanceId
=
1
;
}
//ResponseType G2R_GetLoginKey
message
R2G_GetLoginKey
// IActorRequest
{
int32
RpcId
=
90
;
...
...
@@ -152,6 +163,7 @@ message G2R_GetLoginKey // IActorResponse
int64
GateId
=
2
;
}
//ResponseType M2G_CreateUnit
message
G2M_CreateUnit
// IActorRequest
{
int32
RpcId
=
90
;
...
...
Proto/OuterMessage.proto
浏览文件 @
5811ca14
syntax
=
"proto3"
;
package
ET
;
//ResponseType M2C_TestResponse
message
C2M_TestRequest
// IActorLocationRequest
{
int32
RpcId
=
90
;
...
...
@@ -16,6 +17,7 @@ message M2C_TestResponse // IActorLocationResponse
string
response
=
1
;
}
//ResponseType Actor_TransferResponse
message
Actor_TransferRequest
// IActorLocationRequest
{
int32
RpcId
=
90
;
...
...
@@ -30,6 +32,7 @@ message Actor_TransferResponse // IActorLocationResponse
string
Message
=
92
;
}
//ResponseType G2C_EnterMap
message
C2G_EnterMap
// IRequest
{
int32
RpcId
=
90
;
...
...
@@ -88,23 +91,27 @@ message M2C_PathfindingResult // IActorMessage
repeated
float
Zs
=
7
;
}
message
C2
R
_Ping
// IRequest
//ResponseType G2C_Ping
message
C2
G
_Ping
// IRequest
{
int32
RpcId
=
90
;
}
message
R
2C_Ping
// IResponse
message
G
2C_Ping
// IResponse
{
int32
RpcId
=
90
;
int32
Error
=
91
;
string
Message
=
92
;
int64
Time
=
1
;
}
message
G2C_Test
// IMessage
{
}
//ResponseType M2C_Reload
message
C2M_Reload
// IRequest
{
int32
RpcId
=
90
;
...
...
@@ -119,6 +126,7 @@ message M2C_Reload // IResponse
string
Message
=
92
;
}
//ResponseType R2C_Login
message
C2R_Login
// IRequest
{
int32
RpcId
=
90
;
...
...
@@ -136,6 +144,7 @@ message R2C_Login // IResponse
int64
GateId
=
3
;
}
//ResponseType G2C_LoginGate
message
C2G_LoginGate
// IRequest
{
int32
RpcId
=
90
;
...
...
@@ -156,6 +165,7 @@ message G2C_TestHotfixMessage // IMessage
string
Info
=
1
;
}
//ResponseType M2C_TestActorResponse
message
C2M_TestActorRequest
// IActorLocationRequest
{
int32
RpcId
=
90
;
...
...
@@ -176,6 +186,7 @@ message PlayerInfo // IMessage
int32
RpcId
=
90
;
}
//ResponseType G2C_PlayerInfo
message
C2G_PlayerInfo
// IRequest
{
int32
RpcId
=
90
;
...
...
Server/App/Program.cs
浏览文件 @
5811ca14
...
...
@@ -42,7 +42,9 @@ namespace ET
{
Thread
.
Sleep
(
1
);
ThreadSynchronizationContext
.
Instance
.
Update
();
Game
.
EventSystem
.
Update
();
Game
.
Update
();
Game
.
LateUpdate
();
Game
.
FrameFinish
();
}
catch
(
Exception
e
)
{
...
...
Server/Hotfix/Handler/C2
R
_PingHandler.cs
→
Server/Hotfix/Handler/C2
G
_PingHandler.cs
浏览文件 @
5811ca14
...
...
@@ -4,10 +4,11 @@
namespace
ET
{
[
MessageHandler
]
public
class
C2
R_PingHandler
:
AMRpcHandler
<
C2R_Ping
,
R
2C_Ping
>
public
class
C2
G_PingHandler
:
AMRpcHandler
<
C2G_Ping
,
G
2C_Ping
>
{
protected
override
async
ETTask
Run
(
Session
session
,
C2
R_Ping
request
,
R
2C_Ping
response
,
Action
reply
)
protected
override
async
ETTask
Run
(
Session
session
,
C2
G_Ping
request
,
G
2C_Ping
response
,
Action
reply
)
{
response
.
Time
=
TimeHelper
.
ServerNow
();
reply
();
await
ETTask
.
CompletedTask
;
}
...
...
Server/Model/Generate/InnerProtoOpcode.cs
已删除
100644 → 0
浏览文件 @
2a35bf6e
namespace
ET
{
public
static
partial
class
InnerOpcode
{
public
const
ushort
M2M_TrasferUnitRequest
=
10001
;
public
const
ushort
M2M_TrasferUnitResponse
=
10002
;
public
const
ushort
M2A_Reload
=
10003
;
public
const
ushort
A2M_Reload
=
10004
;
public
const
ushort
G2G_LockRequest
=
10005
;
public
const
ushort
G2G_LockResponse
=
10006
;
public
const
ushort
G2G_LockReleaseRequest
=
10007
;
public
const
ushort
G2G_LockReleaseResponse
=
10008
;
public
const
ushort
ObjectAddRequest
=
10009
;
public
const
ushort
ObjectAddResponse
=
10010
;
public
const
ushort
ObjectLockRequest
=
10011
;
public
const
ushort
ObjectLockResponse
=
10012
;
public
const
ushort
ObjectUnLockRequest
=
10013
;
public
const
ushort
ObjectUnLockResponse
=
10014
;
public
const
ushort
ObjectRemoveRequest
=
10015
;
public
const
ushort
ObjectRemoveResponse
=
10016
;
public
const
ushort
ObjectGetRequest
=
10017
;
public
const
ushort
ObjectGetResponse
=
10018
;
public
const
ushort
R2G_GetLoginKey
=
10019
;
public
const
ushort
G2R_GetLoginKey
=
10020
;
public
const
ushort
G2M_CreateUnit
=
10021
;
public
const
ushort
M2G_CreateUnit
=
10022
;
public
const
ushort
G2M_SessionDisconnect
=
10023
;
}
}
\ No newline at end of file
Server/Model/Generate/
InnerProto
Message.cs
→
Server/Model/Generate/
Message/Inner
Message.cs
浏览文件 @
5811ca14
...
...
@@ -6,6 +6,7 @@ namespace ET
/// <summary>
/// 传送unit
/// </summary>
[
ResponseType
(
typeof
(
M2M_TrasferUnitResponse
))]
[
Message
(
InnerOpcode
.
M2M_TrasferUnitRequest
)]
[
ProtoContract
]
public
partial
class
M2M_TrasferUnitRequest
:
IActorRequest
...
...
@@ -39,6 +40,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
A2M_Reload
))]
[
Message
(
InnerOpcode
.
M2A_Reload
)]
[
ProtoContract
]
public
partial
class
M2A_Reload
:
IActorRequest
...
...
@@ -66,6 +68,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
G2G_LockResponse
))]
[
Message
(
InnerOpcode
.
G2G_LockRequest
)]
[
ProtoContract
]
public
partial
class
G2G_LockRequest
:
IActorRequest
...
...
@@ -99,6 +102,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
G2G_LockReleaseResponse
))]
[
Message
(
InnerOpcode
.
G2G_LockReleaseRequest
)]
[
ProtoContract
]
public
partial
class
G2G_LockReleaseRequest
:
IActorRequest
...
...
@@ -132,6 +136,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
ObjectAddResponse
))]
[
Message
(
InnerOpcode
.
ObjectAddRequest
)]
[
ProtoContract
]
public
partial
class
ObjectAddRequest
:
IActorRequest
...
...
@@ -165,6 +170,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
ObjectLockResponse
))]
[
Message
(
InnerOpcode
.
ObjectLockRequest
)]
[
ProtoContract
]
public
partial
class
ObjectLockRequest
:
IActorRequest
...
...
@@ -201,6 +207,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
ObjectUnLockResponse
))]
[
Message
(
InnerOpcode
.
ObjectUnLockRequest
)]
[
ProtoContract
]
public
partial
class
ObjectUnLockRequest
:
IActorRequest
...
...
@@ -237,6 +244,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
ObjectRemoveResponse
))]
[
Message
(
InnerOpcode
.
ObjectRemoveRequest
)]
[
ProtoContract
]
public
partial
class
ObjectRemoveRequest
:
IActorRequest
...
...
@@ -267,6 +275,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
ObjectGetResponse
))]
[
Message
(
InnerOpcode
.
ObjectGetRequest
)]
[
ProtoContract
]
public
partial
class
ObjectGetRequest
:
IActorRequest
...
...
@@ -300,6 +309,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
G2R_GetLoginKey
))]
[
Message
(
InnerOpcode
.
R2G_GetLoginKey
)]
[
ProtoContract
]
public
partial
class
R2G_GetLoginKey
:
IActorRequest
...
...
@@ -336,6 +346,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
M2G_CreateUnit
))]
[
Message
(
InnerOpcode
.
G2M_CreateUnit
)]
[
ProtoContract
]
public
partial
class
G2M_CreateUnit
:
IActorRequest
...
...
Server/Model/Generate/Message/InnerOpcode.cs
0 → 100644
浏览文件 @
5811ca14
namespace
ET
{
public
static
partial
class
InnerOpcode
{
public
const
ushort
M2M_TrasferUnitRequest
=
10001
;
public
const
ushort
M2M_TrasferUnitResponse
=
10002
;
public
const
ushort
M2A_Reload
=
10003
;
public
const
ushort
A2M_Reload
=
10004
;
public
const
ushort
G2G_LockRequest
=
10005
;
public
const
ushort
G2G_LockResponse
=
10006
;
public
const
ushort
G2G_LockReleaseRequest
=
10007
;
public
const
ushort
G2G_LockReleaseResponse
=
10008
;
public
const
ushort
ObjectAddRequest
=
10009
;
public
const
ushort
ObjectAddResponse
=
10010
;
public
const
ushort
ObjectLockRequest
=
10011
;
public
const
ushort
ObjectLockResponse
=
10012
;
public
const
ushort
ObjectUnLockRequest
=
10013
;
public
const
ushort
ObjectUnLockResponse
=
10014
;
public
const
ushort
ObjectRemoveRequest
=
10015
;
public
const
ushort
ObjectRemoveResponse
=
10016
;
public
const
ushort
ObjectGetRequest
=
10017
;
public
const
ushort
ObjectGetResponse
=
10018
;
public
const
ushort
R2G_GetLoginKey
=
10019
;
public
const
ushort
G2R_GetLoginKey
=
10020
;
public
const
ushort
G2M_CreateUnit
=
10021
;
public
const
ushort
M2G_CreateUnit
=
10022
;
public
const
ushort
G2M_SessionDisconnect
=
10023
;
}
}
Server/Model/Generate/
OuterProto
Message.cs
→
Server/Model/Generate/
Message/Outer
Message.cs
浏览文件 @
5811ca14
...
...
@@ -3,6 +3,7 @@ using ProtoBuf;
using
System.Collections.Generic
;
namespace
ET
{
[
ResponseType
(
typeof
(
M2C_TestResponse
))]
[
Message
(
OuterOpcode
.
C2M_TestRequest
)]
[
ProtoContract
]
public
partial
class
C2M_TestRequest
:
IActorLocationRequest
...
...
@@ -36,6 +37,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
Actor_TransferResponse
))]
[
Message
(
OuterOpcode
.
Actor_TransferRequest
)]
[
ProtoContract
]
public
partial
class
Actor_TransferRequest
:
IActorLocationRequest
...
...
@@ -66,6 +68,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
G2C_EnterMap
))]
[
Message
(
OuterOpcode
.
C2G_EnterMap
)]
[
ProtoContract
]
public
partial
class
C2G_EnterMap
:
IRequest
...
...
@@ -187,18 +190,19 @@ namespace ET
}
[
Message
(
OuterOpcode
.
C2R_Ping
)]
[
ResponseType
(
typeof
(
G2C_Ping
))]
[
Message
(
OuterOpcode
.
C2G_Ping
)]
[
ProtoContract
]
public
partial
class
C2
R
_Ping
:
IRequest
public
partial
class
C2
G
_Ping
:
IRequest
{
[
ProtoMember
(
90
)]
public
int
RpcId
{
get
;
set
;
}
}
[
Message
(
OuterOpcode
.
R
2C_Ping
)]
[
Message
(
OuterOpcode
.
G
2C_Ping
)]
[
ProtoContract
]
public
partial
class
R
2C_Ping
:
IResponse
public
partial
class
G
2C_Ping
:
IResponse
{
[
ProtoMember
(
90
)]
public
int
RpcId
{
get
;
set
;
}
...
...
@@ -209,6 +213,9 @@ namespace ET
[
ProtoMember
(
92
)]
public
string
Message
{
get
;
set
;
}
[
ProtoMember
(
1
)]
public
long
Time
{
get
;
set
;
}
}
[
Message
(
OuterOpcode
.
G2C_Test
)]
...
...
@@ -217,6 +224,7 @@ namespace ET
{
}
[
ResponseType
(
typeof
(
M2C_Reload
))]
[
Message
(
OuterOpcode
.
C2M_Reload
)]
[
ProtoContract
]
public
partial
class
C2M_Reload
:
IRequest
...
...
@@ -247,6 +255,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
R2C_Login
))]
[
Message
(
OuterOpcode
.
C2R_Login
)]
[
ProtoContract
]
public
partial
class
C2R_Login
:
IRequest
...
...
@@ -286,6 +295,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
G2C_LoginGate
))]
[
Message
(
OuterOpcode
.
C2G_LoginGate
)]
[
ProtoContract
]
public
partial
class
C2G_LoginGate
:
IRequest
...
...
@@ -328,6 +338,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
M2C_TestActorResponse
))]
[
Message
(
OuterOpcode
.
C2M_TestActorRequest
)]
[
ProtoContract
]
public
partial
class
C2M_TestActorRequest
:
IActorLocationRequest
...
...
@@ -370,6 +381,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
G2C_PlayerInfo
))]
[
Message
(
OuterOpcode
.
C2G_PlayerInfo
)]
[
ProtoContract
]
public
partial
class
C2G_PlayerInfo
:
IRequest
...
...
Server/Model/Generate/Message/OuterOpcode.cs
0 → 100644
浏览文件 @
5811ca14
namespace
ET
{
public
static
partial
class
OuterOpcode
{
public
const
ushort
C2M_TestRequest
=
20001
;
public
const
ushort
M2C_TestResponse
=
20002
;
public
const
ushort
Actor_TransferRequest
=
20003
;
public
const
ushort
Actor_TransferResponse
=
20004
;
public
const
ushort
C2G_EnterMap
=
20005
;
public
const
ushort
G2C_EnterMap
=
20006
;
public
const
ushort
UnitInfo
=
20007
;
public
const
ushort
M2C_CreateUnits
=
20008
;
public
const
ushort
Frame_ClickMap
=
20009
;
public
const
ushort
M2C_PathfindingResult
=
20010
;
public
const
ushort
C2G_Ping
=
20011
;
public
const
ushort
G2C_Ping
=
20012
;
public
const
ushort
G2C_Test
=
20013
;
public
const
ushort
C2M_Reload
=
20014
;
public
const
ushort
M2C_Reload
=
20015
;
public
const
ushort
C2R_Login
=
20016
;
public
const
ushort
R2C_Login
=
20017
;
public
const
ushort
C2G_LoginGate
=
20018
;
public
const
ushort
G2C_LoginGate
=
20019
;
public
const
ushort
G2C_TestHotfixMessage
=
20020
;
public
const
ushort
C2M_TestActorRequest
=
20021
;
public
const
ushort
M2C_TestActorResponse
=
20022
;
public
const
ushort
PlayerInfo
=
20023
;
public
const
ushort
C2G_PlayerInfo
=
20024
;
public
const
ushort
G2C_PlayerInfo
=
20025
;
}
}
Server/Model/Generate/OuterProtoOpcode.cs
已删除
100644 → 0
浏览文件 @
2a35bf6e
namespace
ET
{
public
static
partial
class
OuterOpcode
{
public
const
ushort
C2M_TestRequest
=
20001
;
public
const
ushort
M2C_TestResponse
=
20002
;
public
const
ushort
Actor_TransferRequest
=
20003
;
public
const
ushort
Actor_TransferResponse
=
20004
;
public
const
ushort
C2G_EnterMap
=
20005
;
public
const
ushort
G2C_EnterMap
=
20006
;
public
const
ushort
UnitInfo
=
20007
;
public
const
ushort
M2C_CreateUnits
=
20008
;
public
const
ushort
Frame_ClickMap
=
20009
;
public
const
ushort
M2C_PathfindingResult
=
20010
;
public
const
ushort
C2R_Ping
=
20011
;
public
const
ushort
R2C_Ping
=
20012
;
public
const
ushort
G2C_Test
=
20013
;
public
const
ushort
C2M_Reload
=
20014
;
public
const
ushort
M2C_Reload
=
20015
;
public
const
ushort
C2R_Login
=
20016
;
public
const
ushort
R2C_Login
=
20017
;
public
const
ushort
C2G_LoginGate
=
20018
;
public
const
ushort
G2C_LoginGate
=
20019
;
public
const
ushort
G2C_TestHotfixMessage
=
20020
;
public
const
ushort
C2M_TestActorRequest
=
20021
;
public
const
ushort
M2C_TestActorResponse
=
20022
;
public
const
ushort
PlayerInfo
=
20023
;
public
const
ushort
C2G_PlayerInfo
=
20024
;
public
const
ushort
G2C_PlayerInfo
=
20025
;
}
}
\ No newline at end of file
Tools/Proto2CS/Program.cs
浏览文件 @
5811ca14
...
...
@@ -25,23 +25,33 @@ namespace ET
public
static
class
InnerProto2CS
{
private
const
string
protoPath
=
"."
;
private
const
string
clientMessagePath
=
"../../
Unity/Assets/Model/Modul
e/Message/"
;
private
const
string
serverMessagePath
=
"../../
Server/Model/Modul
e/Message/"
;
private
const
string
clientMessagePath
=
"../../
../Unity/Assets/Model/Generat
e/Message/"
;
private
const
string
serverMessagePath
=
"../../
../Server/Model/Generat
e/Message/"
;
private
static
readonly
char
[]
splitChars
=
{
' '
,
'\t'
};
private
static
readonly
List
<
OpcodeInfo
>
msgOpcode
=
new
List
<
OpcodeInfo
>();
public
static
void
Proto2CS
()
{
msgOpcode
.
Clear
();
Proto2CS
(
"ET"
,
"InnerMessage.proto"
,
serverMessagePath
,
"InnerOpcode"
,
10000
);
Proto2CS
(
"ET"
,
"
../../../Proto/
InnerMessage.proto"
,
serverMessagePath
,
"InnerOpcode"
,
10000
);
GenerateOpcode
(
"ET"
,
"InnerOpcode"
,
serverMessagePath
);
Proto2CS
(
"ET"
,
"OuterMessage.proto"
,
clientMessagePath
,
"OuterOpcode"
,
20000
);
Proto2CS
(
"ET"
,
"../../../Proto/OuterMessage.proto"
,
serverMessagePath
,
"OuterOpcode"
,
20000
);
GenerateOpcode
(
"ET"
,
"OuterOpcode"
,
serverMessagePath
);
Proto2CS
(
"ET"
,
"../../../Proto/OuterMessage.proto"
,
clientMessagePath
,
"OuterOpcode"
,
20000
);
GenerateOpcode
(
"ET"
,
"OuterOpcode"
,
clientMessagePath
);
}
public
static
void
Proto2CS
(
string
ns
,
string
protoName
,
string
outputPath
,
string
opcodeClassName
,
int
startOpcode
)
{
if
(!
Directory
.
Exists
(
outputPath
))
{
Directory
.
CreateDirectory
(
outputPath
);
}
msgOpcode
.
Clear
();
string
proto
=
Path
.
Combine
(
protoPath
,
protoName
);
string
csPath
=
Path
.
Combine
(
outputPath
,
Path
.
GetFileNameWithoutExtension
(
proto
)
+
".cs"
);
...
...
@@ -65,6 +75,13 @@ namespace ET
{
continue
;
}
if
(
newline
.
StartsWith
(
"//ResponseType"
))
{
string
responseType
=
line
.
Split
(
" "
)[
1
];
sb
.
AppendLine
(
$"\t[ResponseType(typeof(
{
responseType
}
))]"
);
continue
;
}
if
(
newline
.
StartsWith
(
"//"
))
{
...
...
@@ -140,12 +157,17 @@ namespace ET
}
sb
.
Append
(
"}\n"
);
File
.
WriteAllText
(
csPath
,
sb
.
ToString
());
using
FileStream
txt
=
new
FileStream
(
csPath
,
FileMode
.
Create
,
FileAccess
.
ReadWrite
);
using
StreamWriter
sw
=
new
StreamWriter
(
txt
);
sw
.
Write
(
sb
.
ToString
());
}
private
static
void
GenerateOpcode
(
string
ns
,
string
outputFileName
,
string
outputPath
)
{
if
(!
Directory
.
Exists
(
outputPath
))
{
Directory
.
CreateDirectory
(
outputPath
);
}
StringBuilder
sb
=
new
StringBuilder
();
sb
.
AppendLine
(
$"namespace
{
ns
}
"
);
sb
.
AppendLine
(
"{"
);
...
...
@@ -160,7 +182,10 @@ namespace ET
sb
.
AppendLine
(
"}"
);
string
csPath
=
Path
.
Combine
(
outputPath
,
outputFileName
+
".cs"
);
File
.
WriteAllText
(
csPath
,
sb
.
ToString
());
using
FileStream
txt
=
new
FileStream
(
csPath
,
FileMode
.
Create
);
using
StreamWriter
sw
=
new
StreamWriter
(
txt
);
sw
.
Write
(
sb
.
ToString
());
}
private
static
void
Repeated
(
StringBuilder
sb
,
string
ns
,
string
newline
)
...
...
Unity/Assets/Hotfix/Module/Message/NetKcpComponentSystem.cs
浏览文件 @
5811ca14
...
...
@@ -103,7 +103,7 @@ namespace ET
Session
session
=
EntityFactory
.
CreateWithParentAndId
<
Session
,
AService
>(
self
,
channelId
,
self
.
Service
);
session
.
RemoteAddress
=
realIPEndPoint
;
session
.
AddComponent
<
SessionIdleCheckerComponent
,
int
>(
NetThreadComponent
.
checkInteral
);
self
.
Service
.
GetOrCreate
(
session
.
Id
,
realIPEndPoint
);
return
session
;
...
...
Unity/Assets/Hotfix/Scene/LoginHelper.cs
浏览文件 @
5811ca14
...
...
@@ -18,6 +18,7 @@ namespace ET
// 创建一个gate Session,并且保存到SessionComponent中
Session
gateSession
=
zoneScene
.
GetComponent
<
NetKcpComponent
>().
Create
(
NetworkHelper
.
ToIPEndPoint
(
r2CLogin
.
Address
));
gateSession
.
AddComponent
<
PingComponent
>();
zoneScene
.
AddComponent
<
SessionComponent
>().
Session
=
gateSession
;
G2C_LoginGate
g2CLoginGate
=
(
G2C_LoginGate
)
await
gateSession
.
Call
(
...
...
Unity/Assets/Model/Core/Object/TimeInfo.cs
浏览文件 @
5811ca14
...
...
@@ -28,7 +28,7 @@ namespace ET
public
long
FrameTime
;
p
ublic
TimeInfo
()
p
rivate
TimeInfo
()
{
this
.
FrameTime
=
this
.
ClientNow
();
}
...
...
@@ -49,7 +49,7 @@ namespace ET
// 线程安全
public
long
ClientNow
()
{
return
DateTime
.
Now
.
Ticks
-
this
.
dt1970
.
Ticks
;
return
(
DateTime
.
Now
.
Ticks
-
this
.
dt1970
.
Ticks
)
/
10000
;
}
public
long
ServerNow
()
...
...
Unity/Assets/Model/Generate/Message.meta
0 → 100644
浏览文件 @
5811ca14
fileFormatVersion: 2
guid: b78b87e70906a438ba5b820ca91d645f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Unity/Assets/Model/Generate/
OuterProto
Message.cs
→
Unity/Assets/Model/Generate/
Message/Outer
Message.cs
浏览文件 @
5811ca14
...
...
@@ -3,17 +3,25 @@ using ProtoBuf;
using
System.Collections.Generic
;
namespace
ET
{
[
Message
(
OuterOpcode
.
C2G_Ping
)]
[
ResponseType
(
typeof
(
M2C_TestResponse
))]
[
Message
(
OuterOpcode
.
C2M_TestRequest
)]
[
ProtoContract
]
public
partial
class
C2
G_Ping
:
I
Request
public
partial
class
C2
M_TestRequest
:
IActorLocation
Request
{
[
ProtoMember
(
90
)]
public
int
RpcId
{
get
;
set
;
}
[
ProtoMember
(
93
)]
public
long
ActorId
{
get
;
set
;
}
[
ProtoMember
(
1
)]
public
string
request
{
get
;
set
;
}
}
[
Message
(
OuterOpcode
.
G2C_Ping
)]
[
Message
(
OuterOpcode
.
M2C_TestResponse
)]
[
ProtoContract
]
public
partial
class
G2C_Ping
:
IActorLocationResponse
public
partial
class
M2C_TestResponse
:
IActorLocationResponse
{
[
ProtoMember
(
90
)]
public
int
RpcId
{
get
;
set
;
}
...
...
@@ -25,10 +33,11 @@ namespace ET
public
string
Message
{
get
;
set
;
}
[
ProtoMember
(
1
)]
public
long
Tim
e
{
get
;
set
;
}
public
string
respons
e
{
get
;
set
;
}
}
[
ResponseType
(
typeof
(
Actor_TransferResponse
))]
[
Message
(
OuterOpcode
.
Actor_TransferRequest
)]
[
ProtoContract
]
public
partial
class
Actor_TransferRequest
:
IActorLocationRequest
...
...
@@ -59,6 +68,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
G2C_EnterMap
))]
[
Message
(
OuterOpcode
.
C2G_EnterMap
)]
[
ProtoContract
]
public
partial
class
C2G_EnterMap
:
IRequest
...
...
@@ -180,18 +190,19 @@ namespace ET
}
[
Message
(
OuterOpcode
.
C2R_Ping
)]
[
ResponseType
(
typeof
(
G2C_Ping
))]
[
Message
(
OuterOpcode
.
C2G_Ping
)]
[
ProtoContract
]
public
partial
class
C2
R
_Ping
:
IRequest
public
partial
class
C2
G
_Ping
:
IRequest
{
[
ProtoMember
(
90
)]
public
int
RpcId
{
get
;
set
;
}
}
[
Message
(
OuterOpcode
.
R
2C_Ping
)]
[
Message
(
OuterOpcode
.
G
2C_Ping
)]
[
ProtoContract
]
public
partial
class
R
2C_Ping
:
IResponse
public
partial
class
G
2C_Ping
:
IResponse
{
[
ProtoMember
(
90
)]
public
int
RpcId
{
get
;
set
;
}
...
...
@@ -202,6 +213,9 @@ namespace ET
[
ProtoMember
(
92
)]
public
string
Message
{
get
;
set
;
}
[
ProtoMember
(
1
)]
public
long
Time
{
get
;
set
;
}
}
[
Message
(
OuterOpcode
.
G2C_Test
)]
...
...
@@ -210,6 +224,7 @@ namespace ET
{
}
[
ResponseType
(
typeof
(
M2C_Reload
))]
[
Message
(
OuterOpcode
.
C2M_Reload
)]
[
ProtoContract
]
public
partial
class
C2M_Reload
:
IRequest
...
...
@@ -240,6 +255,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
R2C_Login
))]
[
Message
(
OuterOpcode
.
C2R_Login
)]
[
ProtoContract
]
public
partial
class
C2R_Login
:
IRequest
...
...
@@ -279,6 +295,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
G2C_LoginGate
))]
[
Message
(
OuterOpcode
.
C2G_LoginGate
)]
[
ProtoContract
]
public
partial
class
C2G_LoginGate
:
IRequest
...
...
@@ -321,6 +338,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
M2C_TestActorResponse
))]
[
Message
(
OuterOpcode
.
C2M_TestActorRequest
)]
[
ProtoContract
]
public
partial
class
C2M_TestActorRequest
:
IActorLocationRequest
...
...
@@ -363,6 +381,7 @@ namespace ET
}
[
ResponseType
(
typeof
(
G2C_PlayerInfo
))]
[
Message
(
OuterOpcode
.
C2G_PlayerInfo
)]
[
ProtoContract
]
public
partial
class
C2G_PlayerInfo
:
IRequest
...
...
Unity/Assets/Model/Generate/
OuterProto
Message.cs.meta
→
Unity/Assets/Model/Generate/
Message/Outer
Message.cs.meta
浏览文件 @
5811ca14
fileFormatVersion: 2
guid:
b150ee0832ac9442ab93655b90a82caf
guid:
044fa867eb79745f4b119b77e4db9c41
MonoImporter:
externalObjects: {}
serializedVersion: 2
...
...
Unity/Assets/Model/Generate/Message/OuterOpcode.cs
0 → 100644
浏览文件 @
5811ca14
namespace
ET
{
public
static
partial
class
OuterOpcode
{
public
const
ushort
C2M_TestRequest
=
20001
;
public
const
ushort
M2C_TestResponse
=
20002
;
public
const
ushort
Actor_TransferRequest
=
20003
;
public
const
ushort
Actor_TransferResponse
=
20004
;
public
const
ushort
C2G_EnterMap
=
20005
;
public
const
ushort
G2C_EnterMap
=
20006
;
public
const
ushort
UnitInfo
=
20007
;
public
const
ushort
M2C_CreateUnits
=
20008
;
public
const
ushort
Frame_ClickMap
=
20009
;
public
const
ushort
M2C_PathfindingResult
=
20010
;
public
const
ushort
C2G_Ping
=
20011
;
public
const
ushort
G2C_Ping
=
20012
;
public
const
ushort
G2C_Test
=
20013
;
public
const
ushort
C2M_Reload
=
20014
;
public
const
ushort
M2C_Reload
=
20015
;
public
const
ushort
C2R_Login
=
20016
;
public
const
ushort
R2C_Login
=
20017
;
public
const
ushort
C2G_LoginGate
=
20018
;
public
const
ushort
G2C_LoginGate
=
20019
;
public
const
ushort
G2C_TestHotfixMessage
=
20020
;
public
const
ushort
C2M_TestActorRequest
=
20021
;
public
const
ushort
M2C_TestActorResponse
=
20022
;
public
const
ushort
PlayerInfo
=
20023
;
public
const
ushort
C2G_PlayerInfo
=
20024
;
public
const
ushort
G2C_PlayerInfo
=
20025
;
}
}
Unity/Assets/Model/Generate/
OuterProto
Opcode.cs.meta
→
Unity/Assets/Model/Generate/
Message/Outer
Opcode.cs.meta
浏览文件 @
5811ca14
fileFormatVersion: 2
guid:
c44825a92c0e84e4087e616edbdd0ac6
guid:
731471567040e43da827c2acfd5c2f7b
MonoImporter:
externalObjects: {}
serializedVersion: 2
...
...
Unity/Assets/Model/Generate/OuterProtoOpcode.cs
已删除
100644 → 0
浏览文件 @
2a35bf6e
namespace
ET
{
public
static
partial
class
OuterOpcode
{
public
const
ushort
C2G_Ping
=
20001
;
public
const
ushort
G2C_Ping
=
20002
;
public
const
ushort
Actor_TransferRequest
=
20003
;
public
const
ushort
Actor_TransferResponse
=
20004
;
public
const
ushort
C2G_EnterMap
=
20005
;
public
const
ushort
G2C_EnterMap
=
20006
;
public
const
ushort
UnitInfo
=
20007
;
public
const
ushort
M2C_CreateUnits
=
20008
;
public
const
ushort
Frame_ClickMap
=
20009
;
public
const
ushort
M2C_PathfindingResult
=
20010
;
public
const
ushort
C2R_Ping
=
20011
;
public
const
ushort
R2C_Ping
=
20012
;
public
const
ushort
G2C_Test
=
20013
;
public
const
ushort
C2M_Reload
=
20014
;
public
const
ushort
M2C_Reload
=
20015
;
public
const
ushort
C2R_Login
=
20016
;
public
const
ushort
R2C_Login
=
20017
;
public
const
ushort
C2G_LoginGate
=
20018
;
public
const
ushort
G2C_LoginGate
=
20019
;
public
const
ushort
G2C_TestHotfixMessage
=
20020
;
public
const
ushort
C2M_TestActorRequest
=
20021
;
public
const
ushort
M2C_TestActorResponse
=
20022
;
public
const
ushort
PlayerInfo
=
20023
;
public
const
ushort
C2G_PlayerInfo
=
20024
;
public
const
ushort
G2C_PlayerInfo
=
20025
;
}
}
\ No newline at end of file
Unity/Assets/Model/Module/Message/OpcodeTypeComponent.cs
浏览文件 @
5811ca14
...
...
@@ -63,7 +63,6 @@ namespace ET
this
.
outrActorMessage
.
Add
(
messageAttribute
.
Opcode
);
}
/*
// 检查request response
if
(
typeof
(
IRequest
).
IsAssignableFrom
(
type
))
{
...
...
@@ -83,7 +82,6 @@ namespace ET
ResponseTypeAttribute
responseTypeAttribute
=
attrs
[
0
]
as
ResponseTypeAttribute
;
this
.
requestResponse
.
Add
(
type
,
responseTypeAttribute
.
Type
);
}
*/
}
}
...
...
@@ -106,7 +104,7 @@ namespace ET
{
if
(!
this
.
requestResponse
.
TryGetValue
(
request
,
out
Type
response
))
{
throw
new
Exception
(
$"not found response type, request type:
{
request
.
GetType
()}
"
);
throw
new
Exception
(
$"not found response type, request type:
{
request
.
GetType
()
.
Name
}
"
);
}
return
response
;
}
...
...
Unity/Assets/Model/Module/NetworkTCP/TChannel.cs
浏览文件 @
5811ca14
...
...
@@ -392,7 +392,7 @@ namespace ET
private
void
OnError
(
int
error
)
{
Log
.
Debug
(
$"TChannel error:
{
error
}
{
this
.
RemoteAddress
}
"
);
Log
.
Error
(
$"TChannel error:
{
error
}
{
this
.
RemoteAddress
}
"
);
long
channelId
=
this
.
Id
;
...
...
Unity/Assets/Model/Module/Resource/ResourcesComponent.cs
浏览文件 @
5811ca14
...
...
@@ -489,7 +489,7 @@ namespace ET
if
(
isScene
)
{
p
=
Path
.
Combine
(
Application
.
dataPath
,
"../
../AssetBundles/Windows_Scen
e/"
,
assetBundleName
);
p
=
Path
.
Combine
(
Application
.
dataPath
,
"../
SceneBundl
e/"
,
assetBundleName
);
if
(
File
.
Exists
(
p
))
// 如果场景有预先打包
{
using
(
AssetsBundleLoaderAsync
assetsBundleLoaderAsync
=
EntityFactory
.
CreateWithParent
<
AssetsBundleLoaderAsync
>(
this
))
...
...
Unity/Unity.Model.csproj
浏览文件 @
5811ca14
...
...
@@ -101,7 +101,6 @@
<Compile
Include=
"Assets\Model\Core\Event\IEvent.cs"
/>
<Compile
Include=
"Assets\Model\Module\Message\SessionCallbackComponent.cs"
/>
<Compile
Include=
"Assets\Model\Module\Network\Circularbuffer.cs"
/>
<Compile
Include=
"Assets\Model\Generate\OuterProtoMessage.cs"
/>
<Compile
Include=
"Assets\Model\Module\ActorLocation\IActorLocationMessage.cs"
/>
<Compile
Include=
"Assets\Model\Core\Async\AsyncMethodBuilderAttribute.cs"
/>
<Compile
Include=
"Assets\Model\Core\MultiDictionary.cs"
/>
...
...
@@ -173,7 +172,6 @@
<Compile
Include=
"Assets\Model\Module\CoroutineLock\CoroutineLock.cs"
/>
<Compile
Include=
"Assets\Model\Module\Message\ErrorCode.cs"
/>
<Compile
Include=
"Assets\Model\Module\NetworkTCP\PacketParser.cs"
/>
<Compile
Include=
"Assets\Model\Generate\OuterProtoOpcode.cs"
/>
<Compile
Include=
"Assets\Model\Core\Object\ProtoObject.cs"
/>
<Compile
Include=
"Assets\Model\Module\Message\ProtobufHelper.cs"
/>
<Compile
Include=
"Assets\Model\Generate\Config\StartSceneConfig.cs"
/>
...
...
@@ -199,6 +197,8 @@
<Compile
Include=
"Assets\Model\Core\Async\ETTaskHelper.cs"
/>
<Compile
Include=
"Assets\Model\Module\NetworkTCP\TChannel.cs"
/>
<Compile
Include=
"Assets\Model\Module\Network\AChannel.cs"
/>
<Compile
Include=
"Assets\Model\Generate\Message\OuterOpcode.cs"
/>
<Compile
Include=
"Assets\Model\Generate\Message\OuterMessage.cs"
/>
<None
Include=
"Assets\Model\Unity.Model.asmdef"
/>
<Reference
Include=
"UnityEngine"
>
<HintPath>
/Applications/Unity/Hub/Editor/2020.2.2f1c1/Unity.app/Contents/Managed/UnityEngine/UnityEngine.dll
</HintPath>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录