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
823793b9
Commit
823793b9
authored
Mar 19, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle unimplemented
parent
4b49e6d1
Changes
6
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 @@
...
@@ -70,5 +70,6 @@
"hint"
:
{
"hint"
:
{
"waitingDuration"
:
1.5
"waitingDuration"
:
1.5
}
}
}
},
"unimplementedWhiteList"
:
[
1
,
6
]
}
}
neos.config.prod.json
View file @
823793b9
...
@@ -70,5 +70,6 @@
...
@@ -70,5 +70,6 @@
"hint"
:
{
"hint"
:
{
"waitingDuration"
:
1.5
"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 {
...
@@ -149,7 +149,11 @@ export default class GameMsgAdapter implements StocAdapter {
break
;
break
;
}
}
default
:
{
default
:
{
console
.
log
(
"
Unhandled GameMessage function=
"
,
func
);
gameMsg
.
unimplemented
=
new
ygopro
.
StocGameMessage
({
unimplemented
:
new
ygopro
.
StocGameMessage
.
MsgUnimplemented
({
command
:
func
,
}),
});
break
;
break
;
}
}
...
...
src/reducers/duel/mod.ts
View file @
823793b9
...
@@ -144,6 +144,8 @@ export interface DuelState {
...
@@ -144,6 +144,8 @@ export interface DuelState {
waiting
?:
boolean
;
waiting
?:
boolean
;
unimplemented
?:
number
;
// 未处理的`Message`
// UI相关
// UI相关
modalState
:
ModalState
;
modalState
:
ModalState
;
}
}
...
@@ -264,6 +266,11 @@ const duelSlice = createSlice({
...
@@ -264,6 +266,11 @@ const duelSlice = createSlice({
setWaiting
:
(
state
,
action
:
PayloadAction
<
boolean
>
)
=>
{
setWaiting
:
(
state
,
action
:
PayloadAction
<
boolean
>
)
=>
{
state
.
waiting
=
action
.
payload
;
state
.
waiting
=
action
.
payload
;
},
},
// 未处理状态`Reducer`
setUnimplemented
:
(
state
,
action
:
PayloadAction
<
number
>
)
=>
{
state
.
unimplemented
=
action
.
payload
;
},
},
},
extraReducers
(
builder
)
{
extraReducers
(
builder
)
{
handsCase
(
builder
);
handsCase
(
builder
);
...
@@ -344,6 +351,7 @@ export const {
...
@@ -344,6 +351,7 @@ export const {
clearAllPlaceInteractivities
,
clearAllPlaceInteractivities
,
setResult
,
setResult
,
setWaiting
,
setWaiting
,
setUnimplemented
,
}
=
duelSlice
.
actions
;
}
=
duelSlice
.
actions
;
export
const
selectDuelHsStart
=
(
state
:
RootState
)
=>
{
export
const
selectDuelHsStart
=
(
state
:
RootState
)
=>
{
return
state
.
duel
.
meInitInfo
!=
null
;
return
state
.
duel
.
meInitInfo
!=
null
;
...
@@ -354,4 +362,7 @@ export const selectDuelResult = (state: RootState) => {
...
@@ -354,4 +362,7 @@ export const selectDuelResult = (state: RootState) => {
export
const
selectWaiting
=
(
state
:
RootState
)
=>
{
export
const
selectWaiting
=
(
state
:
RootState
)
=>
{
return
state
.
duel
.
waiting
;
return
state
.
duel
.
waiting
;
};
};
export
const
selectUnimplemented
=
(
state
:
RootState
)
=>
{
return
state
.
duel
.
unimplemented
;
};
export
default
duelSlice
.
reducer
;
export
default
duelSlice
.
reducer
;
src/service/duel/gameMsg.ts
View file @
823793b9
...
@@ -21,6 +21,7 @@ import onMsgSelectYesNo from "./selectYesNo";
...
@@ -21,6 +21,7 @@ import onMsgSelectYesNo from "./selectYesNo";
import
onMsgUpdateHp
from
"
./updateHp
"
;
import
onMsgUpdateHp
from
"
./updateHp
"
;
import
onMsgWin
from
"
./win
"
;
import
onMsgWin
from
"
./win
"
;
import
onMsgWait
from
"
./wait
"
;
import
onMsgWait
from
"
./wait
"
;
import
onUnimplemented
from
"
./unimplemented
"
;
import
{
setWaiting
}
from
"
../../reducers/duel/mod
"
;
import
{
setWaiting
}
from
"
../../reducers/duel/mod
"
;
const
ActiveList
=
[
const
ActiveList
=
[
...
@@ -150,6 +151,11 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
...
@@ -150,6 +151,11 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
break
;
break
;
}
}
case
"
unimplemented
"
:
{
onUnimplemented
(
msg
.
unimplemented
,
dispatch
);
break
;
}
default
:
{
default
:
{
break
;
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