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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
MyCard
Neos
Commits
abe4c3af
Commit
abe4c3af
authored
Oct 05, 2022
by
Chunchi Che
Committed by
GitHub
Oct 05, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11 from DarkNeos/dev
Dev
parents
0472f9eb
31664f9f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
19 deletions
+111
-19
neos-protobuf
neos-protobuf
+1
-1
src/WaitRoom.tsx
src/WaitRoom.tsx
+39
-3
src/api/idl/ocgcore.ts
src/api/idl/ocgcore.ts
+71
-15
No files found.
neos-protobuf
@
b76a7b64
Subproject commit
27613d3f1ebddafc11739501100d8f5973aa0e7b
Subproject commit
b76a7b646366e85d3a1d7652525790e08c1be39d
src/WaitRoom.tsx
View file @
abe4c3af
...
@@ -62,10 +62,46 @@ export default function WaitRoom() {
...
@@ -62,10 +62,46 @@ export default function WaitRoom() {
break
;
break
;
}
}
case
"
stoc_hs_player_change
"
:
{
case
"
stoc_hs_player_change
"
:
{
// todo: rerange neos-protobuf, design better API for neos-ts
const
change
=
pb
.
stoc_hs_player_change
;
const
status
=
pb
.
stoc_hs_player_change
.
status
;
switch
(
change
.
state
)
{
case
ygopro
.
StocHsPlayerChange
.
State
.
UNKNOWN
:
{
console
.
log
(
"
Unknown HsPlayerChange State
"
);
break
;
}
case
ygopro
.
StocHsPlayerChange
.
State
.
MOVE
:
{
console
.
log
(
"
Player
"
+
change
.
pos
+
"
moved to
"
+
change
.
moved_pos
);
break
;
}
case
ygopro
.
StocHsPlayerChange
.
State
.
READY
:
{
console
.
log
(
"
Player
"
+
change
.
pos
+
"
has ready
"
);
break
;
}
case
ygopro
.
StocHsPlayerChange
.
State
.
NO_READY
:
{
console
.
log
(
"
Player
"
+
change
.
pos
+
"
not ready
"
);
break
;
}
case
ygopro
.
StocHsPlayerChange
.
State
.
LEAVE
:
{
console
.
log
(
"
Player
"
+
change
.
pos
+
"
has leave
"
);
break
;
}
case
ygopro
.
StocHsPlayerChange
.
State
.
TO_OBSERVER
:
{
console
.
log
(
"
Player
"
+
change
.
pos
+
"
has moved to observer
"
);
break
;
}
default
:
{
break
;
}
}
console
.
log
(
"
Hs player changed, status=
"
+
status
);
break
;
break
;
}
}
default
:
{
default
:
{
...
...
src/api/idl/ocgcore.ts
View file @
abe4c3af
...
@@ -1248,37 +1248,73 @@ export namespace ygopro {
...
@@ -1248,37 +1248,73 @@ export namespace ygopro {
export
class
StocHsPlayerChange
extends
pb_1
.
Message
{
export
class
StocHsPlayerChange
extends
pb_1
.
Message
{
#
one_of_decls
:
number
[][]
=
[];
#
one_of_decls
:
number
[][]
=
[];
constructor
(
data
?:
any
[]
|
{
constructor
(
data
?:
any
[]
|
{
status
?:
number
;
state
?:
StocHsPlayerChange
.
State
;
pos
?:
number
;
moved_pos
?:
number
;
})
{
})
{
super
();
super
();
pb_1
.
Message
.
initialize
(
this
,
Array
.
isArray
(
data
)
?
data
:
[],
0
,
-
1
,
[],
this
.
#
one_of_decls
);
pb_1
.
Message
.
initialize
(
this
,
Array
.
isArray
(
data
)
?
data
:
[],
0
,
-
1
,
[],
this
.
#
one_of_decls
);
if
(
!
Array
.
isArray
(
data
)
&&
typeof
data
==
"
object
"
)
{
if
(
!
Array
.
isArray
(
data
)
&&
typeof
data
==
"
object
"
)
{
if
(
"
status
"
in
data
&&
data
.
status
!=
undefined
)
{
if
(
"
state
"
in
data
&&
data
.
state
!=
undefined
)
{
this
.
status
=
data
.
status
;
this
.
state
=
data
.
state
;
}
if
(
"
pos
"
in
data
&&
data
.
pos
!=
undefined
)
{
this
.
pos
=
data
.
pos
;
}
if
(
"
moved_pos
"
in
data
&&
data
.
moved_pos
!=
undefined
)
{
this
.
moved_pos
=
data
.
moved_pos
;
}
}
}
}
}
}
get
stat
us
()
{
get
stat
e
()
{
return
pb_1
.
Message
.
getFieldWithDefault
(
this
,
1
,
0
)
as
number
;
return
pb_1
.
Message
.
getFieldWithDefault
(
this
,
1
,
StocHsPlayerChange
.
State
.
UNKNOWN
)
as
StocHsPlayerChange
.
State
;
}
}
set
stat
us
(
value
:
number
)
{
set
stat
e
(
value
:
StocHsPlayerChange
.
State
)
{
pb_1
.
Message
.
setField
(
this
,
1
,
value
);
pb_1
.
Message
.
setField
(
this
,
1
,
value
);
}
}
get
pos
()
{
return
pb_1
.
Message
.
getFieldWithDefault
(
this
,
2
,
0
)
as
number
;
}
set
pos
(
value
:
number
)
{
pb_1
.
Message
.
setField
(
this
,
2
,
value
);
}
get
moved_pos
()
{
return
pb_1
.
Message
.
getFieldWithDefault
(
this
,
3
,
0
)
as
number
;
}
set
moved_pos
(
value
:
number
)
{
pb_1
.
Message
.
setField
(
this
,
3
,
value
);
}
static
fromObject
(
data
:
{
static
fromObject
(
data
:
{
status
?:
number
;
state
?:
StocHsPlayerChange
.
State
;
pos
?:
number
;
moved_pos
?:
number
;
}):
StocHsPlayerChange
{
}):
StocHsPlayerChange
{
const
message
=
new
StocHsPlayerChange
({});
const
message
=
new
StocHsPlayerChange
({});
if
(
data
.
status
!=
null
)
{
if
(
data
.
state
!=
null
)
{
message
.
status
=
data
.
status
;
message
.
state
=
data
.
state
;
}
if
(
data
.
pos
!=
null
)
{
message
.
pos
=
data
.
pos
;
}
if
(
data
.
moved_pos
!=
null
)
{
message
.
moved_pos
=
data
.
moved_pos
;
}
}
return
message
;
return
message
;
}
}
toObject
()
{
toObject
()
{
const
data
:
{
const
data
:
{
status
?:
number
;
state
?:
StocHsPlayerChange
.
State
;
pos
?:
number
;
moved_pos
?:
number
;
}
=
{};
}
=
{};
if
(
this
.
status
!=
null
)
{
if
(
this
.
state
!=
null
)
{
data
.
status
=
this
.
status
;
data
.
state
=
this
.
state
;
}
if
(
this
.
pos
!=
null
)
{
data
.
pos
=
this
.
pos
;
}
if
(
this
.
moved_pos
!=
null
)
{
data
.
moved_pos
=
this
.
moved_pos
;
}
}
return
data
;
return
data
;
}
}
...
@@ -1286,8 +1322,12 @@ export namespace ygopro {
...
@@ -1286,8 +1322,12 @@ export namespace ygopro {
serialize
(
w
:
pb_1
.
BinaryWriter
):
void
;
serialize
(
w
:
pb_1
.
BinaryWriter
):
void
;
serialize
(
w
?:
pb_1
.
BinaryWriter
):
Uint8Array
|
void
{
serialize
(
w
?:
pb_1
.
BinaryWriter
):
Uint8Array
|
void
{
const
writer
=
w
||
new
pb_1
.
BinaryWriter
();
const
writer
=
w
||
new
pb_1
.
BinaryWriter
();
if
(
this
.
status
!=
0
)
if
(
this
.
state
!=
StocHsPlayerChange
.
State
.
UNKNOWN
)
writer
.
writeInt32
(
1
,
this
.
status
);
writer
.
writeEnum
(
1
,
this
.
state
);
if
(
this
.
pos
!=
0
)
writer
.
writeInt32
(
2
,
this
.
pos
);
if
(
this
.
moved_pos
!=
0
)
writer
.
writeInt32
(
3
,
this
.
moved_pos
);
if
(
!
w
)
if
(
!
w
)
return
writer
.
getResultBuffer
();
return
writer
.
getResultBuffer
();
}
}
...
@@ -1298,7 +1338,13 @@ export namespace ygopro {
...
@@ -1298,7 +1338,13 @@ export namespace ygopro {
break
;
break
;
switch
(
reader
.
getFieldNumber
())
{
switch
(
reader
.
getFieldNumber
())
{
case
1
:
case
1
:
message
.
status
=
reader
.
readInt32
();
message
.
state
=
reader
.
readEnum
();
break
;
case
2
:
message
.
pos
=
reader
.
readInt32
();
break
;
case
3
:
message
.
moved_pos
=
reader
.
readInt32
();
break
;
break
;
default
:
reader
.
skipField
();
default
:
reader
.
skipField
();
}
}
...
@@ -1312,4 +1358,14 @@ export namespace ygopro {
...
@@ -1312,4 +1358,14 @@ export namespace ygopro {
return
StocHsPlayerChange
.
deserialize
(
bytes
);
return
StocHsPlayerChange
.
deserialize
(
bytes
);
}
}
}
}
export
namespace
StocHsPlayerChange
{
export
enum
State
{
UNKNOWN
=
0
,
MOVE
=
1
,
READY
=
2
,
NO_READY
=
3
,
LEAVE
=
4
,
TO_OBSERVER
=
5
}
}
}
}
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