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
e4a8fd43
Commit
e4a8fd43
authored
Jun 11, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix win
parent
1b7350d2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
32 deletions
+16
-32
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/win.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/win.ts
+4
-11
src/service/duel/win.ts
src/service/duel/win.ts
+6
-10
src/stores/matStore/store.ts
src/stores/matStore/store.ts
+0
-1
src/stores/matStore/types.ts
src/stores/matStore/types.ts
+4
-1
src/ui/Duel/Message/HintNotification.tsx
src/ui/Duel/Message/HintNotification.tsx
+2
-9
No files found.
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/win.ts
View file @
e4a8fd43
...
...
@@ -12,18 +12,11 @@ import MsgWin = ygopro.StocGameMessage.MsgWin;
export
default
(
data
:
Uint8Array
)
=>
{
const
reader
=
new
BufferReader
(
data
);
const
player
=
reader
.
readUint8
();
const
winType
=
reader
.
readUint8
();
const
type_
=
player
==
0
||
winType
==
4
?
MsgWin
.
ActionType
.
Win
:
player
==
1
?
MsgWin
.
ActionType
.
Defeated
:
MsgWin
.
ActionType
.
UNKNOWN
;
const
win_player
=
reader
.
readUint8
();
const
reason
=
reader
.
readUint8
();
return
new
MsgWin
({
player
,
type_
,
win_
player
,
reason
,
});
};
src/service/duel/win.ts
View file @
e4a8fd43
import
{
ygopro
}
from
"
@/api
"
;
import
{
fetchStrings
,
ygopro
}
from
"
@/api
"
;
import
{
matStore
}
from
"
@/stores
"
;
import
MsgWin
=
ygopro
.
StocGameMessage
.
MsgWin
;
export
default
(
win
:
MsgWin
)
=>
{
const
player
=
win
.
player
;
if
(
matStore
.
isMe
(
player
))
{
matStore
.
result
=
win
.
type_
;
}
else
{
matStore
.
result
=
win
.
type_
==
MsgWin
.
ActionType
.
Win
?
MsgWin
.
ActionType
.
Defeated
:
MsgWin
.
ActionType
.
Win
;
}
const
{
win_player
,
reason
}
=
win
;
matStore
.
result
=
{
isWin
:
matStore
.
isMe
(
win_player
),
reason
:
fetchStrings
(
"
!victory
"
,
reason
),
};
};
src/stores/matStore/store.ts
View file @
e4a8fd43
...
...
@@ -80,7 +80,6 @@ export const matStore: MatState = proxy<MatState>({
enableM2
:
false
,
// 允许进入M2阶段
enableEp
:
false
,
// 允许回合结束
},
result
:
ygopro
.
StocGameMessage
.
MsgWin
.
ActionType
.
UNKNOWN
,
waiting
:
false
,
unimplemented
:
0
,
// methods
...
...
src/stores/matStore/types.ts
View file @
e4a8fd43
...
...
@@ -28,7 +28,10 @@ export interface MatState {
phase
:
PhaseState
;
result
:
ygopro
.
StocGameMessage
.
MsgWin
.
ActionType
;
result
?:
{
isWin
:
boolean
;
reason
:
string
;
};
waiting
:
boolean
;
...
...
src/ui/Duel/Message/HintNotification.tsx
View file @
e4a8fd43
...
...
@@ -2,7 +2,7 @@ import { notification } from "antd";
import
React
,
{
useEffect
}
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
fetchStrings
,
ygopro
}
from
"
@/api
"
;
import
{
fetchStrings
}
from
"
@/api
"
;
import
{
Phase2StringCodeMap
}
from
"
@/common
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
matStore
}
from
"
@/stores
"
;
...
...
@@ -13,8 +13,6 @@ const style = {
backgroundColor
:
"
#303030
"
,
};
const
MsgWin
=
ygopro
.
StocGameMessage
.
MsgWin
;
const
NeosConfig
=
useConfig
();
export
const
HintNotification
=
()
=>
{
const
snap
=
useSnapshot
(
matStore
);
...
...
@@ -67,12 +65,7 @@ export const HintNotification = () => {
useEffect
(()
=>
{
if
(
result
)
{
const
message
=
result
==
MsgWin
.
ActionType
.
Win
?
"
胜利
"
:
MsgWin
.
ActionType
.
Defeated
?
"
失败
"
:
"
未知结果
"
;
const
message
=
result
.
isWin
?
"
胜利
"
:
"
失败
"
+
"
"
+
result
.
reason
;
api
.
open
({
message
,
placement
:
"
bottom
"
,
...
...
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