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
deft
Neos
Commits
2801e6de
Commit
2801e6de
authored
Jan 07, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add selectEffectYn stoc adapter and service
parent
e97750fd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
10 deletions
+48
-10
src/api/ocgcore/ocgAdapter/protoDecl.ts
src/api/ocgcore/ocgAdapter/protoDecl.ts
+1
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
+6
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectEffectYn.ts
...api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectEffectYn.ts
+27
-0
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+7
-10
src/service/duel/selectEffectYn.ts
src/service/duel/selectEffectYn.ts
+7
-0
No files found.
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
2801e6de
...
@@ -36,3 +36,4 @@ export const MSG_SELECT_PLACE = 18;
...
@@ -36,3 +36,4 @@ export const MSG_SELECT_PLACE = 18;
export
const
MSG_MOVE
=
50
;
export
const
MSG_MOVE
=
50
;
export
const
MSG_SELECT_CARD
=
15
;
export
const
MSG_SELECT_CARD
=
15
;
export
const
MSG_SELECT_CHAIN
=
16
;
export
const
MSG_SELECT_CHAIN
=
16
;
export
const
MSG_SELECT_EFFECTYN
=
12
;
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
2801e6de
...
@@ -16,6 +16,7 @@ import MsgSelectPlaceAdapter from "./selectPlace";
...
@@ -16,6 +16,7 @@ import MsgSelectPlaceAdapter from "./selectPlace";
import
MsgMoveAdapter
from
"
./move
"
;
import
MsgMoveAdapter
from
"
./move
"
;
import
MsgSelectCardAdapter
from
"
./selectCard
"
;
import
MsgSelectCardAdapter
from
"
./selectCard
"
;
import
MsgSelectChainAdapter
from
"
./selectChain
"
;
import
MsgSelectChainAdapter
from
"
./selectChain
"
;
import
MsgSelectEffectYnAdapter
from
"
./selectEffectYn
"
;
/*
/*
* STOC GameMsg
* STOC GameMsg
...
@@ -91,6 +92,11 @@ export default class GameMsgAdapter implements StocAdapter {
...
@@ -91,6 +92,11 @@ export default class GameMsgAdapter implements StocAdapter {
break
;
break
;
}
}
case
GAME_MSG
.
MSG_SELECT_EFFECTYN
:
{
gameMsg
.
select_effect_yn
=
MsgSelectEffectYnAdapter
(
gameData
);
break
;
}
default
:
{
default
:
{
console
.
log
(
"
Unhandled GameMessage function=
"
,
func
);
console
.
log
(
"
Unhandled GameMessage function=
"
,
func
);
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectEffectYn.ts
0 → 100644
View file @
2801e6de
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
../../bufferIO
"
;
import
MsgSelectEffectYn
=
ygopro
.
StocGameMessage
.
MsgSelectEffectYn
;
/*
* Msg Select EffectYn
*
* @param - see: https://code.mycard.moe/mycard/neos-protobuf/-/blob/main/idl/ocgcore.neos-protobuf
* @usage - 玩家选择是否发动效果
*
* */
export
default
(
data
:
Uint8Array
)
=>
{
const
reader
=
new
BufferReader
(
data
,
true
);
const
player
=
reader
.
readUint8
();
const
code
=
reader
.
readUint32
();
const
location
=
reader
.
readCardLocation
();
const
effect_description
=
reader
.
readUint32
();
return
new
MsgSelectEffectYn
({
player
,
code
,
location
,
effect_description
,
});
};
src/service/duel/gameMsg.ts
View file @
2801e6de
...
@@ -10,6 +10,7 @@ import onMsgSelectPlace from "./selectPlace";
...
@@ -10,6 +10,7 @@ import onMsgSelectPlace from "./selectPlace";
import
onMsgMove
from
"
./move
"
;
import
onMsgMove
from
"
./move
"
;
import
onMsgSelectCard
from
"
./selectCard
"
;
import
onMsgSelectCard
from
"
./selectCard
"
;
import
onMsgSelectChain
from
"
./selectChain
"
;
import
onMsgSelectChain
from
"
./selectChain
"
;
import
onMsgSelectEffectYn
from
"
./selectEffectYn
"
;
export
default
function
handleGameMsg
(
pb
:
ygopro
.
YgoStocMsg
)
{
export
default
function
handleGameMsg
(
pb
:
ygopro
.
YgoStocMsg
)
{
const
dispatch
=
store
.
dispatch
;
const
dispatch
=
store
.
dispatch
;
...
@@ -18,74 +19,70 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
...
@@ -18,74 +19,70 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
switch
(
msg
.
gameMsg
)
{
switch
(
msg
.
gameMsg
)
{
case
"
start
"
:
{
case
"
start
"
:
{
const
start
=
msg
.
start
;
const
start
=
msg
.
start
;
onMsgStart
(
start
,
dispatch
);
onMsgStart
(
start
,
dispatch
);
break
;
break
;
}
}
case
"
draw
"
:
{
case
"
draw
"
:
{
const
draw
=
msg
.
draw
;
const
draw
=
msg
.
draw
;
onMsgDraw
(
draw
,
dispatch
);
onMsgDraw
(
draw
,
dispatch
);
break
;
break
;
}
}
case
"
new_turn
"
:
{
case
"
new_turn
"
:
{
const
newTurn
=
msg
.
new_turn
;
const
newTurn
=
msg
.
new_turn
;
onMsgNewTurn
(
newTurn
,
dispatch
);
onMsgNewTurn
(
newTurn
,
dispatch
);
break
;
break
;
}
}
case
"
new_phase
"
:
{
case
"
new_phase
"
:
{
const
newPhase
=
msg
.
new_phase
;
const
newPhase
=
msg
.
new_phase
;
onMsgNewPhase
(
newPhase
,
dispatch
);
onMsgNewPhase
(
newPhase
,
dispatch
);
break
;
break
;
}
}
case
"
hint
"
:
{
case
"
hint
"
:
{
const
hint
=
msg
.
hint
;
const
hint
=
msg
.
hint
;
onMsgHint
(
hint
,
dispatch
);
onMsgHint
(
hint
,
dispatch
);
break
;
break
;
}
}
case
"
select_idle_cmd
"
:
{
case
"
select_idle_cmd
"
:
{
const
selectIdleCmd
=
msg
.
select_idle_cmd
;
const
selectIdleCmd
=
msg
.
select_idle_cmd
;
onMsgSelectIdleCmd
(
selectIdleCmd
,
dispatch
);
onMsgSelectIdleCmd
(
selectIdleCmd
,
dispatch
);
break
;
break
;
}
}
case
"
select_place
"
:
{
case
"
select_place
"
:
{
const
selectPlace
=
msg
.
select_place
;
const
selectPlace
=
msg
.
select_place
;
onMsgSelectPlace
(
selectPlace
,
dispatch
);
onMsgSelectPlace
(
selectPlace
,
dispatch
);
break
;
break
;
}
}
case
"
move
"
:
{
case
"
move
"
:
{
const
move
=
msg
.
move
;
const
move
=
msg
.
move
;
onMsgMove
(
move
,
dispatch
);
onMsgMove
(
move
,
dispatch
);
break
;
break
;
}
}
case
"
select_card
"
:
{
case
"
select_card
"
:
{
const
selectCard
=
msg
.
select_card
;
const
selectCard
=
msg
.
select_card
;
onMsgSelectCard
(
selectCard
,
dispatch
);
onMsgSelectCard
(
selectCard
,
dispatch
);
break
;
break
;
}
}
case
"
select_chain
"
:
{
case
"
select_chain
"
:
{
const
selectChain
=
msg
.
select_chain
;
const
selectChain
=
msg
.
select_chain
;
onMsgSelectChain
(
selectChain
,
dispatch
);
onMsgSelectChain
(
selectChain
,
dispatch
);
break
;
break
;
}
}
case
"
select_effect_yn
"
:
{
const
selectEffectYn
=
msg
.
select_effect_yn
;
onMsgSelectEffectYn
(
selectEffectYn
,
dispatch
);
break
;
}
default
:
{
default
:
{
break
;
break
;
}
}
...
...
src/service/duel/selectEffectYn.ts
0 → 100644
View file @
2801e6de
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
../../store
"
;
import
MsgSelectEffectYn
=
ygopro
.
StocGameMessage
.
MsgSelectEffectYn
;
export
default
(
selectEffectYn
:
MsgSelectEffectYn
,
dispatch
:
AppDispatch
)
=>
{
console
.
log
(
selectEffectYn
);
};
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