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
823793b9
Commit
823793b9
authored
Mar 19, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle unimplemented
parent
4b49e6d1
Pipeline
#20787
passed with stages
in 13 minutes and 51 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
3 deletions
+39
-3
neos.config.json
neos.config.json
+2
-1
neos.config.prod.json
neos.config.prod.json
+2
-1
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
+5
-1
src/reducers/duel/mod.ts
src/reducers/duel/mod.ts
+11
-0
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+6
-0
src/service/duel/unimplemented.ts
src/service/duel/unimplemented.ts
+13
-0
No files found.
neos.config.json
View file @
823793b9
...
...
@@ -70,5 +70,6 @@
"hint"
:
{
"waitingDuration"
:
1.5
}
}
},
"unimplementedWhiteList"
:
[
1
,
6
]
}
neos.config.prod.json
View file @
823793b9
...
...
@@ -70,5 +70,6 @@
"hint"
:
{
"waitingDuration"
:
1.5
}
}
},
"unimplementedWhiteList"
:
[
1
,
6
]
}
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
823793b9
...
...
@@ -149,7 +149,11 @@ export default class GameMsgAdapter implements StocAdapter {
break
;
}
default
:
{
console
.
log
(
"
Unhandled GameMessage function=
"
,
func
);
gameMsg
.
unimplemented
=
new
ygopro
.
StocGameMessage
({
unimplemented
:
new
ygopro
.
StocGameMessage
.
MsgUnimplemented
({
command
:
func
,
}),
});
break
;
}
...
...
src/reducers/duel/mod.ts
View file @
823793b9
...
...
@@ -144,6 +144,8 @@ export interface DuelState {
waiting
?:
boolean
;
unimplemented
?:
number
;
// 未处理的`Message`
// UI相关
modalState
:
ModalState
;
}
...
...
@@ -264,6 +266,11 @@ const duelSlice = createSlice({
setWaiting
:
(
state
,
action
:
PayloadAction
<
boolean
>
)
=>
{
state
.
waiting
=
action
.
payload
;
},
// 未处理状态`Reducer`
setUnimplemented
:
(
state
,
action
:
PayloadAction
<
number
>
)
=>
{
state
.
unimplemented
=
action
.
payload
;
},
},
extraReducers
(
builder
)
{
handsCase
(
builder
);
...
...
@@ -344,6 +351,7 @@ export const {
clearAllPlaceInteractivities
,
setResult
,
setWaiting
,
setUnimplemented
,
}
=
duelSlice
.
actions
;
export
const
selectDuelHsStart
=
(
state
:
RootState
)
=>
{
return
state
.
duel
.
meInitInfo
!=
null
;
...
...
@@ -354,4 +362,7 @@ export const selectDuelResult = (state: RootState) => {
export
const
selectWaiting
=
(
state
:
RootState
)
=>
{
return
state
.
duel
.
waiting
;
};
export
const
selectUnimplemented
=
(
state
:
RootState
)
=>
{
return
state
.
duel
.
unimplemented
;
};
export
default
duelSlice
.
reducer
;
src/service/duel/gameMsg.ts
View file @
823793b9
...
...
@@ -21,6 +21,7 @@ import onMsgSelectYesNo from "./selectYesNo";
import
onMsgUpdateHp
from
"
./updateHp
"
;
import
onMsgWin
from
"
./win
"
;
import
onMsgWait
from
"
./wait
"
;
import
onUnimplemented
from
"
./unimplemented
"
;
import
{
setWaiting
}
from
"
../../reducers/duel/mod
"
;
const
ActiveList
=
[
...
...
@@ -150,6 +151,11 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
break
;
}
case
"
unimplemented
"
:
{
onUnimplemented
(
msg
.
unimplemented
,
dispatch
);
break
;
}
default
:
{
break
;
}
...
...
src/service/duel/unimplemented.ts
0 → 100644
View file @
823793b9
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
setUnimplemented
}
from
"
../../reducers/duel/mod
"
;
import
{
AppDispatch
}
from
"
../../store
"
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
export
default
(
unimplemented
:
ygopro
.
StocGameMessage
.
MsgUnimplemented
,
dispatch
:
AppDispatch
)
=>
{
if
(
!
NeosConfig
.
unimplementedWhiteList
.
includes
(
unimplemented
.
command
))
{
dispatch
(
setUnimplemented
(
unimplemented
.
command
));
}
};
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