Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
deft
Neos
Commits
8998827a
Commit
8998827a
authored
Jan 07, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix protobuf bug
parent
a5b413eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
151 additions
and
18 deletions
+151
-18
neos-protobuf
neos-protobuf
+1
-1
src/api/ocgcore/idl/ocgcore.ts
src/api/ocgcore/idl/ocgcore.ts
+130
-13
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectPosition.ts
...api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectPosition.ts
+20
-4
No files found.
neos-protobuf
@
836412c2
Subproject commit
a8e6ba24566c83ad03ac09110e6dd67672c8b411
Subproject commit
836412c292c4351ea9b7d499b31472672157e0dd
src/api/ocgcore/idl/ocgcore.ts
View file @
8998827a
...
@@ -7985,7 +7985,7 @@ export namespace ygopro {
...
@@ -7985,7 +7985,7 @@ export namespace ygopro {
|
{
|
{
player
?:
number
;
player
?:
number
;
code
?:
number
;
code
?:
number
;
positions?:
Card
Position[];
positions
?:
StocGameMessage
.
MsgSelectPosition
.
SelectAble
Position
[];
}
}
)
{
)
{
super
();
super
();
...
@@ -8022,19 +8022,23 @@ export namespace ygopro {
...
@@ -8022,19 +8022,23 @@ export namespace ygopro {
pb_1
.
Message
.
setField
(
this
,
2
,
value
);
pb_1
.
Message
.
setField
(
this
,
2
,
value
);
}
}
get
positions
()
{
get
positions
()
{
return pb_1.Message.get
FieldWithDefault
(
return
pb_1
.
Message
.
get
RepeatedWrapperField
(
this
,
this
,
3
,
StocGameMessage
.
MsgSelectPosition
.
SelectAblePosition
,
CardPosition.FACEUP_ATTACK
3
) as
Card
Position[];
)
as
StocGameMessage
.
MsgSelectPosition
.
SelectAble
Position
[];
}
}
set positions(value: CardPosition[]) {
set
positions
(
pb_1.Message.setField(this, 3, value);
value
:
StocGameMessage
.
MsgSelectPosition
.
SelectAblePosition
[]
)
{
pb_1
.
Message
.
setRepeatedWrapperField
(
this
,
3
,
value
);
}
}
static
fromObject
(
data
:
{
static
fromObject
(
data
:
{
player
?:
number
;
player
?:
number
;
code
?:
number
;
code
?:
number
;
positions?: CardPosition[];
positions
?:
ReturnType
<
typeof
StocGameMessage
.
MsgSelectPosition
.
SelectAblePosition
.
prototype
.
toObject
>
[];
}):
MsgSelectPosition
{
}):
MsgSelectPosition
{
const
message
=
new
MsgSelectPosition
({});
const
message
=
new
MsgSelectPosition
({});
if
(
data
.
player
!=
null
)
{
if
(
data
.
player
!=
null
)
{
...
@@ -8044,7 +8048,11 @@ export namespace ygopro {
...
@@ -8044,7 +8048,11 @@ export namespace ygopro {
message
.
code
=
data
.
code
;
message
.
code
=
data
.
code
;
}
}
if
(
data
.
positions
!=
null
)
{
if
(
data
.
positions
!=
null
)
{
message.positions = data.positions;
message
.
positions
=
data
.
positions
.
map
((
item
)
=>
StocGameMessage
.
MsgSelectPosition
.
SelectAblePosition
.
fromObject
(
item
)
);
}
}
return
message
;
return
message
;
}
}
...
@@ -8052,7 +8060,9 @@ export namespace ygopro {
...
@@ -8052,7 +8060,9 @@ export namespace ygopro {
const
data
:
{
const
data
:
{
player
?:
number
;
player
?:
number
;
code
?:
number
;
code
?:
number
;
positions?: CardPosition[];
positions
?:
ReturnType
<
typeof
StocGameMessage
.
MsgSelectPosition
.
SelectAblePosition
.
prototype
.
toObject
>
[];
}
=
{};
}
=
{};
if
(
this
.
player
!=
null
)
{
if
(
this
.
player
!=
null
)
{
data
.
player
=
this
.
player
;
data
.
player
=
this
.
player
;
...
@@ -8061,7 +8071,10 @@ export namespace ygopro {
...
@@ -8061,7 +8071,10 @@ export namespace ygopro {
data
.
code
=
this
.
code
;
data
.
code
=
this
.
code
;
}
}
if
(
this
.
positions
!=
null
)
{
if
(
this
.
positions
!=
null
)
{
data.positions = this.positions;
data
.
positions
=
this
.
positions
.
map
(
(
item
:
StocGameMessage
.
MsgSelectPosition
.
SelectAblePosition
)
=>
item
.
toObject
()
);
}
}
return
data
;
return
data
;
}
}
...
@@ -8071,7 +8084,13 @@ export namespace ygopro {
...
@@ -8071,7 +8084,13 @@ export namespace ygopro {
const
writer
=
w
||
new
pb_1
.
BinaryWriter
();
const
writer
=
w
||
new
pb_1
.
BinaryWriter
();
if
(
this
.
player
!=
0
)
writer
.
writeInt32
(
1
,
this
.
player
);
if
(
this
.
player
!=
0
)
writer
.
writeInt32
(
1
,
this
.
player
);
if
(
this
.
code
!=
0
)
writer
.
writeInt32
(
2
,
this
.
code
);
if
(
this
.
code
!=
0
)
writer
.
writeInt32
(
2
,
this
.
code
);
if (this.positions.length) writer.writePackedEnum(3, this.positions);
if
(
this
.
positions
.
length
)
writer
.
writeRepeatedMessage
(
3
,
this
.
positions
,
(
item
:
StocGameMessage
.
MsgSelectPosition
.
SelectAblePosition
)
=>
item
.
serialize
(
writer
)
);
if
(
!
w
)
return
writer
.
getResultBuffer
();
if
(
!
w
)
return
writer
.
getResultBuffer
();
}
}
static
deserialize
(
static
deserialize
(
...
@@ -8092,7 +8111,16 @@ export namespace ygopro {
...
@@ -8092,7 +8111,16 @@ export namespace ygopro {
message
.
code
=
reader
.
readInt32
();
message
.
code
=
reader
.
readInt32
();
break
;
break
;
case
3
:
case
3
:
message.positions = reader.readPackedEnum();
reader
.
readMessage
(
message
.
positions
,
()
=>
pb_1
.
Message
.
addToRepeatedWrapperField
(
message
,
3
,
StocGameMessage
.
MsgSelectPosition
.
SelectAblePosition
.
deserialize
(
reader
),
StocGameMessage
.
MsgSelectPosition
.
SelectAblePosition
)
);
break
;
break
;
default
:
default
:
reader
.
skipField
();
reader
.
skipField
();
...
@@ -8107,5 +8135,94 @@ export namespace ygopro {
...
@@ -8107,5 +8135,94 @@ export namespace ygopro {
return
MsgSelectPosition
.
deserialize
(
bytes
);
return
MsgSelectPosition
.
deserialize
(
bytes
);
}
}
}
}
export
namespace
MsgSelectPosition
{
export
class
SelectAblePosition
extends
pb_1
.
Message
{
#
one_of_decls
:
number
[][]
=
[];
constructor
(
data
?:
|
any
[]
|
{
position
?:
CardPosition
;
}
)
{
super
();
pb_1
.
Message
.
initialize
(
this
,
Array
.
isArray
(
data
)
?
data
:
[],
0
,
-
1
,
[],
this
.
#
one_of_decls
);
if
(
!
Array
.
isArray
(
data
)
&&
typeof
data
==
"
object
"
)
{
if
(
"
position
"
in
data
&&
data
.
position
!=
undefined
)
{
this
.
position
=
data
.
position
;
}
}
}
get
position
()
{
return
pb_1
.
Message
.
getFieldWithDefault
(
this
,
1
,
CardPosition
.
FACEUP_ATTACK
)
as
CardPosition
;
}
set
position
(
value
:
CardPosition
)
{
pb_1
.
Message
.
setField
(
this
,
1
,
value
);
}
static
fromObject
(
data
:
{
position
?:
CardPosition
;
}):
SelectAblePosition
{
const
message
=
new
SelectAblePosition
({});
if
(
data
.
position
!=
null
)
{
message
.
position
=
data
.
position
;
}
return
message
;
}
toObject
()
{
const
data
:
{
position
?:
CardPosition
;
}
=
{};
if
(
this
.
position
!=
null
)
{
data
.
position
=
this
.
position
;
}
return
data
;
}
serialize
():
Uint8Array
;
serialize
(
w
:
pb_1
.
BinaryWriter
):
void
;
serialize
(
w
?:
pb_1
.
BinaryWriter
):
Uint8Array
|
void
{
const
writer
=
w
||
new
pb_1
.
BinaryWriter
();
if
(
this
.
position
!=
CardPosition
.
FACEUP_ATTACK
)
writer
.
writeEnum
(
1
,
this
.
position
);
if
(
!
w
)
return
writer
.
getResultBuffer
();
}
static
deserialize
(
bytes
:
Uint8Array
|
pb_1
.
BinaryReader
):
SelectAblePosition
{
const
reader
=
bytes
instanceof
pb_1
.
BinaryReader
?
bytes
:
new
pb_1
.
BinaryReader
(
bytes
),
message
=
new
SelectAblePosition
();
while
(
reader
.
nextField
())
{
if
(
reader
.
isEndGroup
())
break
;
switch
(
reader
.
getFieldNumber
())
{
case
1
:
message
.
position
=
reader
.
readEnum
();
break
;
default
:
reader
.
skipField
();
}
}
return
message
;
}
serializeBinary
():
Uint8Array
{
return
this
.
serialize
();
}
static
deserializeBinary
(
bytes
:
Uint8Array
):
SelectAblePosition
{
return
SelectAblePosition
.
deserialize
(
bytes
);
}
}
}
}
}
}
}
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectPosition.ts
View file @
8998827a
...
@@ -24,16 +24,32 @@ export default (data: Uint8Array) => {
...
@@ -24,16 +24,32 @@ export default (data: Uint8Array) => {
});
});
if
((
positions
&
0x1
)
>
0
)
{
if
((
positions
&
0x1
)
>
0
)
{
msg
.
positions
.
push
(
ygopro
.
CardPosition
.
FACEUP_ATTACK
);
msg
.
positions
.
push
(
new
MsgSelectPosition
.
SelectAblePosition
({
position
:
ygopro
.
CardPosition
.
FACEUP_ATTACK
,
})
);
}
}
if
((
positions
&
0x2
)
>
0
)
{
if
((
positions
&
0x2
)
>
0
)
{
msg
.
positions
.
push
(
ygopro
.
CardPosition
.
FACEDOWN_ATTACK
);
msg
.
positions
.
push
(
new
MsgSelectPosition
.
SelectAblePosition
({
position
:
ygopro
.
CardPosition
.
FACEDOWN_ATTACK
,
})
);
}
}
if
((
positions
&
0x4
)
>
0
)
{
if
((
positions
&
0x4
)
>
0
)
{
msg
.
positions
.
push
(
ygopro
.
CardPosition
.
FACEUP_DEFENSE
);
msg
.
positions
.
push
(
new
MsgSelectPosition
.
SelectAblePosition
({
position
:
ygopro
.
CardPosition
.
FACEUP_DEFENSE
,
})
);
}
}
if
((
positions
&
0x8
)
>
0
)
{
if
((
positions
&
0x8
)
>
0
)
{
msg
.
positions
.
push
(
ygopro
.
CardPosition
.
FACEDOWN_DEFENSE
);
msg
.
positions
.
push
(
new
MsgSelectPosition
.
SelectAblePosition
({
position
:
ygopro
.
CardPosition
.
FACEDOWN_DEFENSE
,
})
);
}
}
return
msg
;
return
msg
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment