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
b8660288
Commit
b8660288
authored
Jan 07, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add select_position stoc adapter and service
parent
0117975b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
0 deletions
+51
-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/selectPosition.ts
...api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectPosition.ts
+37
-0
src/service/duel/selectPosition.ts
src/service/duel/selectPosition.ts
+7
-0
No files found.
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
b8660288
...
@@ -37,3 +37,4 @@ export const MSG_MOVE = 50;
...
@@ -37,3 +37,4 @@ 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
;
export
const
MSG_SELECT_EFFECTYN
=
12
;
export
const
MSG_SELECT_POSITION
=
19
;
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
b8660288
...
@@ -17,6 +17,7 @@ import MsgMoveAdapter from "./move";
...
@@ -17,6 +17,7 @@ import MsgMoveAdapter from "./move";
import
MsgSelectCardAdapter
from
"
./selectCard
"
;
import
MsgSelectCardAdapter
from
"
./selectCard
"
;
import
MsgSelectChainAdapter
from
"
./selectChain
"
;
import
MsgSelectChainAdapter
from
"
./selectChain
"
;
import
MsgSelectEffectYnAdapter
from
"
./selectEffectYn
"
;
import
MsgSelectEffectYnAdapter
from
"
./selectEffectYn
"
;
import
MsgSelectPositionAdapter
from
"
./selectPosition
"
;
/*
/*
* STOC GameMsg
* STOC GameMsg
...
@@ -97,6 +98,11 @@ export default class GameMsgAdapter implements StocAdapter {
...
@@ -97,6 +98,11 @@ export default class GameMsgAdapter implements StocAdapter {
break
;
break
;
}
}
case
GAME_MSG
.
MSG_SELECT_POSITION
:
{
gameMsg
.
select_position
=
MsgSelectPositionAdapter
(
gameData
);
break
;
}
default
:
{
default
:
{
console
.
log
(
"
Unhandled GameMessage function=
"
,
func
);
console
.
log
(
"
Unhandled GameMessage function=
"
,
func
);
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectPosition.ts
0 → 100644
View file @
b8660288
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
../../bufferIO
"
;
import
MsgSelectPosition
=
ygopro
.
StocGameMessage
.
MsgSelectPosition
;
/*
* Msg Select Position
*
* @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
positions
=
reader
.
readUint8
();
const
msg
=
new
MsgSelectPosition
({
player
,
code
,
positions
:
[],
});
if
((
positions
&
0x1
)
>
0
)
{
msg
.
positions
.
push
(
ygopro
.
CardPosition
.
FACEUP_ATTACK
);
}
else
if
((
positions
&
0x2
)
>
0
)
{
msg
.
positions
.
push
(
ygopro
.
CardPosition
.
FACEDOWN_ATTACK
);
}
else
if
((
positions
&
0x4
)
>
0
)
{
msg
.
positions
.
push
(
ygopro
.
CardPosition
.
FACEUP_DEFENSE
);
}
else
if
((
positions
&
0x8
)
>
0
)
{
msg
.
positions
.
push
(
ygopro
.
CardPosition
.
FACEDOWN_DEFENSE
);
}
return
msg
;
};
src/service/duel/selectPosition.ts
0 → 100644
View file @
b8660288
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
../../store
"
;
import
MsgSelectPosition
=
ygopro
.
StocGameMessage
.
MsgSelectPosition
;
export
default
(
selectPosition
:
MsgSelectPosition
,
dispatch
:
AppDispatch
)
=>
{
console
.
log
(
selectPosition
);
};
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