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
a669016d
Commit
a669016d
authored
Oct 07, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update small
parent
0509adc7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
+4
-12
src/WaitRoom.tsx
src/WaitRoom.tsx
+4
-12
No files found.
src/WaitRoom.tsx
View file @
a669016d
...
...
@@ -34,7 +34,7 @@ export default function WaitRoom() {
}
ws
.
current
.
onopen
=
()
=>
{
console
.
log
(
"
w
ebsocket open
"
);
console
.
log
(
"
W
ebsocket open
"
);
if
(
player
!=
null
&&
...
...
@@ -53,7 +53,7 @@ export default function WaitRoom() {
};
ws
.
current
.
onclose
=
()
=>
{
console
.
log
(
"
w
ebsocket closed
"
);
console
.
log
(
"
W
ebsocket closed
"
);
};
ws
.
current
.
onmessage
=
e
=>
{
...
...
@@ -103,8 +103,6 @@ export default function WaitRoom() {
break
;
}
case
ygopro
.
StocHsPlayerChange
.
State
.
READY
:
{
console
.
log
(
"
Player
"
+
change
.
pos
+
"
has ready
"
);
const
updateState
=
(
player
:
Player
)
=>
{
const
state
=
"
ready
"
;
player
.
state
=
state
;
...
...
@@ -114,13 +112,10 @@ export default function WaitRoom() {
change
.
pos
==
0
?
setPlayer0
(
updateState
)
:
setPlayer1
(
updateState
);
forceUpdate
();
break
;
}
case
ygopro
.
StocHsPlayerChange
.
State
.
NO_READY
:
{
console
.
log
(
"
Player
"
+
change
.
pos
+
"
not ready
"
);
const
updateState
=
(
player
:
Player
)
=>
{
const
state
=
"
not ready
"
;
player
.
state
=
state
;
...
...
@@ -130,20 +125,15 @@ export default function WaitRoom() {
change
.
pos
==
0
?
setPlayer0
(
updateState
)
:
setPlayer1
(
updateState
);
forceUpdate
();
break
;
}
case
ygopro
.
StocHsPlayerChange
.
State
.
LEAVE
:
{
console
.
log
(
"
Player
"
+
change
.
pos
+
"
has leave
"
);
change
.
pos
==
0
?
setPlayer0
({})
:
setPlayer1
({});
break
;
}
case
ygopro
.
StocHsPlayerChange
.
State
.
TO_OBSERVER
:
{
console
.
log
(
"
Player
"
+
change
.
pos
+
"
has moved to observer
"
);
change
.
pos
==
0
?
setPlayer0
({})
:
setPlayer1
({});
setObserverCount
(
observerCount
+
1
);
...
...
@@ -153,6 +143,8 @@ export default function WaitRoom() {
break
;
}
}
forceUpdate
();
}
break
;
...
...
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