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
love_飞影
Neos
Commits
6ef76a9e
Commit
6ef76a9e
authored
Mar 19, 2024
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
第N次修复娱乐匹配更换卡组问题
parent
d9831588
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
25 deletions
+33
-25
src/service/room/errorMsg.ts
src/service/room/errorMsg.ts
+1
-1
src/ui/WaitRoom/index.tsx
src/ui/WaitRoom/index.tsx
+32
-24
No files found.
src/service/room/errorMsg.ts
View file @
6ef76a9e
...
@@ -23,7 +23,7 @@ export default async function handleErrorMsg(errorMsg: ygopro.StocErrorMsg) {
...
@@ -23,7 +23,7 @@ export default async function handleErrorMsg(errorMsg: ygopro.StocErrorMsg) {
}
}
case
ErrorType
.
DECKERROR
:
{
case
ErrorType
.
DECKERROR
:
{
const
flag
=
error_code
>>
28
;
const
flag
=
error_code
>>
28
;
const
code
=
error_code
&
&
0xfffffff
;
const
code
=
error_code
&
0xfffffff
;
const
card
=
fetchCard
(
code
);
const
card
=
fetchCard
(
code
);
const
baseMsg
=
`卡组非法,请检查:
${
card
.
text
.
name
}
`
;
const
baseMsg
=
`卡组非法,请检查:
${
card
.
text
.
name
}
`
;
switch
(
flag
)
{
switch
(
flag
)
{
...
...
src/ui/WaitRoom/index.tsx
View file @
6ef76a9e
...
@@ -53,6 +53,36 @@ export const Component: React.FC = () => {
...
@@ -53,6 +53,36 @@ export const Component: React.FC = () => {
const
op
=
room
.
getOpPlayer
();
const
op
=
room
.
getOpPlayer
();
const
navigate
=
useNavigate
();
const
navigate
=
useNavigate
();
const
updateDeck
=
(
deck
:
IDeck
)
=>
{
sendUpdateDeck
(
deck
);
// 设置side里面的卡组
sideStore
.
deck
=
deck
;
};
const
onDeckSelected
=
(
deckName
:
string
)
=>
{
const
newDeck
=
deckStore
.
get
(
deckName
);
if
(
newDeck
)
{
sendHsNotReady
();
updateDeck
(
newDeck
);
setDeck
(
newDeck
);
}
else
{
message
.
error
(
`Deck
${
deckName
}
not found`
);
}
};
const
onReady
=
()
=>
{
if
(
me
?.
state
===
PlayerState
.
NO_READY
)
{
if
(
deck
)
{
updateDeck
(
deck
);
sendHsReady
();
}
else
{
message
.
error
(
"
请先选择卡组
"
);
}
}
else
{
sendHsNotReady
();
}
};
useEffect
(()
=>
{
useEffect
(()
=>
{
// 组件初始化时发一次更新卡组的包
// 组件初始化时发一次更新卡组的包
//
//
...
@@ -90,16 +120,7 @@ export const Component: React.FC = () => {
...
@@ -90,16 +120,7 @@ export const Component: React.FC = () => {
switchCollapse=
{
()
=>
setCollapsed
(
!
collapsed
)
}
switchCollapse=
{
()
=>
setCollapsed
(
!
collapsed
)
}
/>
/>
<
div
className=
{
styles
.
wrap
}
>
<
div
className=
{
styles
.
wrap
}
>
<
Controller
<
Controller
onDeckChange=
{
onDeckSelected
}
/>
onDeckChange=
{
(
deckName
:
string
)
=>
{
const
deck
=
deckStore
.
get
(
deckName
);
if
(
deck
)
{
setDeck
(
deck
);
}
else
{
message
.
error
(
`Deck ${deckName} not found`
);
}
}
}
/>
<
div
className=
{
styles
[
"
both-side-container
"
]
}
>
<
div
className=
{
styles
[
"
both-side-container
"
]
}
>
<
PlayerZone
<
PlayerZone
who=
{
Who
.
Me
}
who=
{
Who
.
Me
}
...
@@ -111,20 +132,7 @@ export const Component: React.FC = () => {
...
@@ -111,20 +132,7 @@ export const Component: React.FC = () => {
<
Button
<
Button
size=
"large"
size=
"large"
className=
{
styles
[
"
btn-join
"
]
}
className=
{
styles
[
"
btn-join
"
]
}
onClick=
{
()
=>
{
onClick=
{
onReady
}
if
(
me
?.
state
===
PlayerState
.
NO_READY
)
{
if
(
deck
)
{
sendUpdateDeck
(
deck
);
// 设置side里面的卡组
sideStore
.
deck
=
deck
;
sendHsReady
();
}
else
{
message
.
error
(
"
请先选择卡组
"
);
}
}
else
{
sendHsNotReady
();
}
}
}
>
>
{
me
?.
state
===
PlayerState
.
NO_READY
{
me
?.
state
===
PlayerState
.
NO_READY
?
"
决斗准备
"
?
"
决斗准备
"
...
...
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