Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
guo450212436
et
提交
e45f2a48
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,发现更多精彩内容 >>
提交
e45f2a48
编写于
9月 05, 2018
作者:
T
tanghai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复protobuf生成器repeated string int不能生成的问题
上级
6cff2b39
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
53 addition
and
3 deletion
+53
-3
Proto/HotfixMessage.proto
Proto/HotfixMessage.proto
+3
-0
Unity/Assets/Scripts/Module/FrameSync/FrameMessage.cs
Unity/Assets/Scripts/Module/FrameSync/FrameMessage.cs
+1
-1
Unity/Assets/Scripts/Module/Message/OuterMessage.cs
Unity/Assets/Scripts/Module/Message/OuterMessage.cs
+1
-1
Unity/Hotfix/Module/Message/HotfixMessage.cs
Unity/Hotfix/Module/Message/HotfixMessage.cs
+48
-1
Unity/protoc.exe
Unity/protoc.exe
+0
-0
未找到文件。
Proto/HotfixMessage.proto
浏览文件 @
e45f2a48
...
...
@@ -68,4 +68,7 @@ message G2C_PlayerInfo // IResponse
string
Message
=
92
;
PlayerInfo
PlayerInfo
=
1
;
repeated
PlayerInfo
PlayerInfos
=
2
;
repeated
string
TestRepeatedString
=
3
;
repeated
int32
TestRepeatedInt32
=
4
;
repeated
int64
TestRepeatedInt64
=
5
;
}
\ No newline at end of file
Unity/Assets/Scripts/Module/FrameSync/FrameMessage.cs
浏览文件 @
e45f2a48
...
...
@@ -182,7 +182,7 @@ namespace ETModel {
public
void
MergeFrom
(
pb
::
CodedInputStream
input
)
{
frame_
=
0
;
if
(
typeof
(
global
::
ETModel
.
OneFrameMessage
).
IsClass
)
{
for
(
int
i
=
0
;
i
<
message_
.
Count
;
i
++)
{
MessagePool
.
Instance
.
Recycle
(
message_
[
i
]);
}
}
for
(
int
i
=
0
;
i
<
message_
.
Count
;
i
++)
{
MessagePool
.
Instance
.
Recycle
(
message_
[
i
]);
}
message_
.
Clear
();
rpcId_
=
0
;
actorId_
=
0
;
...
...
Unity/Assets/Scripts/Module/Message/OuterMessage.cs
浏览文件 @
e45f2a48
...
...
@@ -762,7 +762,7 @@ namespace ETModel {
}
public
void
MergeFrom
(
pb
::
CodedInputStream
input
)
{
if
(
typeof
(
global
::
ETModel
.
UnitInfo
).
IsClass
)
{
for
(
int
i
=
0
;
i
<
units_
.
Count
;
i
++)
{
MessagePool
.
Instance
.
Recycle
(
units_
[
i
]);
}
}
for
(
int
i
=
0
;
i
<
units_
.
Count
;
i
++)
{
MessagePool
.
Instance
.
Recycle
(
units_
[
i
]);
}
units_
.
Clear
();
rpcId_
=
0
;
actorId_
=
0
;
...
...
Unity/Hotfix/Module/Message/HotfixMessage.cs
浏览文件 @
e45f2a48
...
...
@@ -767,12 +767,39 @@ namespace ETHotfix {
set
{
playerInfos_
=
value
;
}
}
private
static
readonly
pb
::
FieldCodec
<
string
>
_repeated_testRepeatedString_codec
=
pb
::
FieldCodec
.
ForString
(
26
);
private
pbc
::
RepeatedField
<
string
>
testRepeatedString_
=
new
pbc
::
RepeatedField
<
string
>();
public
pbc
::
RepeatedField
<
string
>
TestRepeatedString
{
get
{
return
testRepeatedString_
;
}
set
{
testRepeatedString_
=
value
;
}
}
private
static
readonly
pb
::
FieldCodec
<
int
>
_repeated_testRepeatedInt32_codec
=
pb
::
FieldCodec
.
ForInt32
(
34
);
private
pbc
::
RepeatedField
<
int
>
testRepeatedInt32_
=
new
pbc
::
RepeatedField
<
int
>();
public
pbc
::
RepeatedField
<
int
>
TestRepeatedInt32
{
get
{
return
testRepeatedInt32_
;
}
set
{
testRepeatedInt32_
=
value
;
}
}
private
static
readonly
pb
::
FieldCodec
<
long
>
_repeated_testRepeatedInt64_codec
=
pb
::
FieldCodec
.
ForInt64
(
42
);
private
pbc
::
RepeatedField
<
long
>
testRepeatedInt64_
=
new
pbc
::
RepeatedField
<
long
>();
public
pbc
::
RepeatedField
<
long
>
TestRepeatedInt64
{
get
{
return
testRepeatedInt64_
;
}
set
{
testRepeatedInt64_
=
value
;
}
}
public
void
WriteTo
(
pb
::
CodedOutputStream
output
)
{
if
(
playerInfo_
!=
null
)
{
output
.
WriteRawTag
(
10
);
output
.
WriteMessage
(
PlayerInfo
);
}
playerInfos_
.
WriteTo
(
output
,
_repeated_playerInfos_codec
);
testRepeatedString_
.
WriteTo
(
output
,
_repeated_testRepeatedString_codec
);
testRepeatedInt32_
.
WriteTo
(
output
,
_repeated_testRepeatedInt32_codec
);
testRepeatedInt64_
.
WriteTo
(
output
,
_repeated_testRepeatedInt64_codec
);
if
(
RpcId
!=
0
)
{
output
.
WriteRawTag
(
208
,
5
);
output
.
WriteInt32
(
RpcId
);
...
...
@@ -802,13 +829,19 @@ namespace ETHotfix {
size
+=
1
+
pb
::
CodedOutputStream
.
ComputeMessageSize
(
PlayerInfo
);
}
size
+=
playerInfos_
.
CalculateSize
(
_repeated_playerInfos_codec
);
size
+=
testRepeatedString_
.
CalculateSize
(
_repeated_testRepeatedString_codec
);
size
+=
testRepeatedInt32_
.
CalculateSize
(
_repeated_testRepeatedInt32_codec
);
size
+=
testRepeatedInt64_
.
CalculateSize
(
_repeated_testRepeatedInt64_codec
);
return
size
;
}
public
void
MergeFrom
(
pb
::
CodedInputStream
input
)
{
if
(
playerInfo_
!=
null
)
MessagePool
.
Instance
.
Recycle
(
playerInfo_
);
playerInfo_
=
null
;
if
(
typeof
(
global
::
ETHotfix
.
PlayerInfo
).
IsClass
)
{
for
(
int
i
=
0
;
i
<
playerInfos_
.
Count
;
i
++)
{
MessagePool
.
Instance
.
Recycle
(
playerInfos_
[
i
]);
}
}
for
(
int
i
=
0
;
i
<
playerInfos_
.
Count
;
i
++)
{
MessagePool
.
Instance
.
Recycle
(
playerInfos_
[
i
]);
}
playerInfos_
.
Clear
();
testRepeatedString_
.
Clear
();
testRepeatedInt32_
.
Clear
();
testRepeatedInt64_
.
Clear
();
rpcId_
=
0
;
error_
=
0
;
message_
=
""
;
...
...
@@ -829,6 +862,20 @@ namespace ETHotfix {
playerInfos_
.
AddEntriesFrom
(
input
,
_repeated_playerInfos_codec
);
break
;
}
case
26
:
{
testRepeatedString_
.
AddEntriesFrom
(
input
,
_repeated_testRepeatedString_codec
);
break
;
}
case
34
:
case
32
:
{
testRepeatedInt32_
.
AddEntriesFrom
(
input
,
_repeated_testRepeatedInt32_codec
);
break
;
}
case
42
:
case
40
:
{
testRepeatedInt64_
.
AddEntriesFrom
(
input
,
_repeated_testRepeatedInt64_codec
);
break
;
}
case
720
:
{
RpcId
=
input
.
ReadInt32
();
break
;
...
...
Unity/protoc.exe
浏览文件 @
e45f2a48
无法预览此类型文件
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录