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
baichixing
Neos
Commits
50a9dc97
Commit
50a9dc97
authored
Jan 04, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add MsgSelectChainAdapter and service
parent
e6d01903
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
0 deletions
+72
-0
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/selectChain.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectChain.ts
+50
-0
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+8
-0
src/service/duel/selectChain.ts
src/service/duel/selectChain.ts
+7
-0
No files found.
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
50a9dc97
...
...
@@ -35,3 +35,4 @@ export const MSG_SELECT_IDLE_CMD = 11;
export
const
MSG_SELECT_PLACE
=
18
;
export
const
MSG_MOVE
=
50
;
export
const
MSG_SELECT_CARD
=
15
;
export
const
MSG_SELECT_CHAIN
=
16
;
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
50a9dc97
...
...
@@ -15,6 +15,7 @@ import MsgSelectIdleCmdAdapter from "./selectIdleCmd";
import
MsgSelectPlaceAdapter
from
"
./selectPlace
"
;
import
MsgMoveAdapter
from
"
./move
"
;
import
MsgSelectCardAdapter
from
"
./selectCard
"
;
import
MsgSelectChainAdapter
from
"
./selectChain
"
;
/*
* STOC GameMsg
...
...
@@ -85,6 +86,11 @@ export default class GameMsgAdapter implements StocAdapter {
break
;
}
case
GAME_MSG
.
MSG_SELECT_CHAIN
:
{
gameMsg
.
select_chain
=
MsgSelectChainAdapter
(
gameData
);
break
;
}
default
:
{
console
.
log
(
"
Unhandled GameMessage function=
"
,
func
);
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectChain.ts
0 → 100644
View file @
50a9dc97
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
../../bufferIO
"
;
import
MsgSelectChain
=
ygopro
.
StocGameMessage
.
MsgSelectChain
;
/*
* Msg Select Chain
*
* @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
count
=
reader
.
readUint8
();
const
spCount
=
reader
.
readUint8
();
const
forced
=
reader
.
readUint8
()
==
0
;
const
hint0
=
reader
.
readUint32
();
const
hint1
=
reader
.
readUint32
();
const
msg
=
new
MsgSelectChain
({
player
,
special_count
:
spCount
,
forced
,
hint0
,
hint1
,
chains
:
[],
});
for
(
let
i
=
0
;
i
<
count
;
i
++
)
{
const
flag
=
reader
.
readUint8
();
const
code
=
reader
.
readUint32
();
const
location
=
reader
.
readCardLocation
();
const
effect_desc
=
reader
.
readUint32
();
msg
.
chains
.
push
(
new
MsgSelectChain
.
Chain
({
flag
,
code
,
location
,
effect_description
:
effect_desc
,
response
:
i
,
})
);
}
return
msg
;
};
src/service/duel/gameMsg.ts
View file @
50a9dc97
...
...
@@ -9,6 +9,7 @@ import onMsgSelectIdleCmd from "./selectIdleCmd";
import
onMsgSelectPlace
from
"
./selectPlace
"
;
import
onMsgMove
from
"
./move
"
;
import
onMsgSelectCard
from
"
./selectCard
"
;
import
onMsgSelectChain
from
"
./selectChain
"
;
export
default
function
handleGameMsg
(
pb
:
ygopro
.
YgoStocMsg
)
{
const
dispatch
=
store
.
dispatch
;
...
...
@@ -78,6 +79,13 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
break
;
}
case
"
select_chain
"
:
{
const
selectChain
=
msg
.
select_chain
;
onMsgSelectChain
(
selectChain
,
dispatch
);
break
;
}
default
:
{
break
;
}
...
...
src/service/duel/selectChain.ts
0 → 100644
View file @
50a9dc97
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
../../store
"
;
import
MsgSelectChain
=
ygopro
.
StocGameMessage
.
MsgSelectChain
;
export
default
(
selectChain
:
MsgSelectChain
,
dispatch
:
AppDispatch
)
=>
{
console
.
log
(
selectChain
);
};
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