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
7205bc14
Commit
7205bc14
authored
Jan 05, 2026
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix MSG_SELECT_CHAIN, MSG_SELECT_SUM and MSG_CONFIRM_CARDS
parent
977849d7
Pipeline
#42400
passed with stages
in 1 minute and 52 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
136 additions
and
65 deletions
+136
-65
src/api/ocgcore/ocgAdapter/protoDecl.ts
src/api/ocgcore/ocgAdapter/protoDecl.ts
+2
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/confirmCards.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/confirmCards.ts
+27
-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/penetrate.json
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.json
+1
-28
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.ts
+0
-1
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectChain.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectChain.ts
+18
-12
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectSum.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectSum.ts
+24
-4
src/service/duel/selectChain.ts
src/service/duel/selectChain.ts
+58
-20
No files found.
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
7205bc14
...
@@ -78,3 +78,5 @@ export const MSG_HAND_RES = 133;
...
@@ -78,3 +78,5 @@ export const MSG_HAND_RES = 133;
export
const
MSG_SHUFFLE_HAND
=
33
;
export
const
MSG_SHUFFLE_HAND
=
33
;
export
const
MSG_SHUFFLE_EXTRA
=
39
;
export
const
MSG_SHUFFLE_EXTRA
=
39
;
export
const
MSG_SIBYL_NAME
=
235
;
export
const
MSG_SIBYL_NAME
=
235
;
export
const
MSG_CONFIRM_CARDS
=
30
;
export
const
MSG_CONFIRM_DECKTOP
=
31
;
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/confirmCards.ts
0 → 100644
View file @
7205bc14
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReaderExt
}
from
"
../../bufferIO
"
;
import
MsgConfirmCards
=
ygopro
.
StocGameMessage
.
MsgConfirmCards
;
/*
* Msg Confirm Cards
*
* @usage - 确认卡片(展示手牌、确认盖卡等)
* */
export
default
(
data
:
Uint8Array
)
=>
{
const
reader
=
new
BufferReaderExt
(
data
);
const
player
=
reader
.
inner
.
readUint8
();
// 新协议在 player 和 count 之间增加了一个字节
reader
.
inner
.
readUint8
();
const
count
=
reader
.
inner
.
readUint8
();
const
cards
:
ygopro
.
CardInfo
[]
=
[];
for
(
let
i
=
0
;
i
<
count
;
i
++
)
{
cards
.
push
(
reader
.
readCardInfo
());
}
return
new
MsgConfirmCards
({
player
,
cards
,
});
};
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
7205bc14
...
@@ -12,6 +12,7 @@ import MsgAnnounceCard from "./announceCard";
...
@@ -12,6 +12,7 @@ import MsgAnnounceCard from "./announceCard";
import
MsgAnnounceNumber
from
"
./announceNumber
"
;
import
MsgAnnounceNumber
from
"
./announceNumber
"
;
import
MsgAnnounceRace
from
"
./announceRace
"
;
import
MsgAnnounceRace
from
"
./announceRace
"
;
import
MsgAttack
from
"
./attack
"
;
import
MsgAttack
from
"
./attack
"
;
import
MsgConfirmCardsAdapter
from
"
./confirmCards
"
;
import
MsgDamage
from
"
./damage
"
;
import
MsgDamage
from
"
./damage
"
;
import
MsgDrawAdapter
from
"
./draw
"
;
import
MsgDrawAdapter
from
"
./draw
"
;
import
MsgFieldDisabledAdapter
from
"
./fieldDisabled
"
;
import
MsgFieldDisabledAdapter
from
"
./fieldDisabled
"
;
...
@@ -245,6 +246,11 @@ export default class GameMsgAdapter implements StocAdapter {
...
@@ -245,6 +246,11 @@ export default class GameMsgAdapter implements StocAdapter {
gameMsg
.
sibyl_name
=
MsgSibylNameAdapter
(
gameData
);
gameMsg
.
sibyl_name
=
MsgSibylNameAdapter
(
gameData
);
break
;
break
;
}
}
case
GAME_MSG
.
MSG_CONFIRM_CARDS
:
case
GAME_MSG
.
MSG_CONFIRM_DECKTOP
:
{
gameMsg
.
confirm_cards
=
MsgConfirmCardsAdapter
(
gameData
);
break
;
}
default
:
{
default
:
{
gameMsg
.
unimplemented
=
new
ygopro
.
StocGameMessage
.
MsgUnimplemented
({
gameMsg
.
unimplemented
=
new
ygopro
.
StocGameMessage
.
MsgUnimplemented
({
command
:
func
,
command
:
func
,
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.json
View file @
7205bc14
...
@@ -161,34 +161,7 @@
...
@@ -161,34 +161,7 @@
}
}
]
]
},
},
"30"
:
{
"protoType"
:
"confirm_cards"
,
"fields"
:
[
{
"fieldName"
:
"player"
,
"fieldType"
:
"uint8"
},
{
"fieldName"
:
"cards"
,
"fieldType"
:
"repeated"
,
"repeatedType"
:
"CardInfo"
}
]
},
"31"
:
{
"protoType"
:
"confirm_cards"
,
"fields"
:
[
{
"fieldName"
:
"player"
,
"fieldType"
:
"uint8"
},
{
"fieldName"
:
"cards"
,
"fieldType"
:
"repeated"
,
"repeatedType"
:
"CardInfo"
}
]
},
"83"
:
{
"83"
:
{
"protoType"
:
"become_target"
,
"protoType"
:
"become_target"
,
"fields"
:
[
"fields"
:
[
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.ts
View file @
7205bc14
...
@@ -32,7 +32,6 @@ const MsgConstructorMap: Map<string, Constructor> = new Map([
...
@@ -32,7 +32,6 @@ const MsgConstructorMap: Map<string, Constructor> = new Map([
[
"
chain_solved
"
,
ygopro
.
StocGameMessage
.
MsgChainSolved
],
[
"
chain_solved
"
,
ygopro
.
StocGameMessage
.
MsgChainSolved
],
[
"
chain_end
"
,
ygopro
.
StocGameMessage
.
MsgChainEnd
],
[
"
chain_end
"
,
ygopro
.
StocGameMessage
.
MsgChainEnd
],
[
"
lp_update
"
,
ygopro
.
StocGameMessage
.
MsgLpUpdate
],
[
"
lp_update
"
,
ygopro
.
StocGameMessage
.
MsgLpUpdate
],
[
"
confirm_cards
"
,
ygopro
.
StocGameMessage
.
MsgConfirmCards
],
[
"
become_target
"
,
ygopro
.
StocGameMessage
.
MsgBecomeTarget
],
[
"
become_target
"
,
ygopro
.
StocGameMessage
.
MsgBecomeTarget
],
[
"
shuffle_deck
"
,
ygopro
.
StocGameMessage
.
MsgShuffleDeck
],
[
"
shuffle_deck
"
,
ygopro
.
StocGameMessage
.
MsgShuffleDeck
],
[
"
rock_paper_scissors
"
,
ygopro
.
StocGameMessage
.
MsgRockPaperScissors
],
[
"
rock_paper_scissors
"
,
ygopro
.
StocGameMessage
.
MsgRockPaperScissors
],
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectChain.ts
View file @
7205bc14
...
@@ -17,35 +17,41 @@ export default (data: Uint8Array) => {
...
@@ -17,35 +17,41 @@ export default (data: Uint8Array) => {
const
player
=
reader
.
inner
.
readUint8
();
const
player
=
reader
.
inner
.
readUint8
();
const
count
=
reader
.
inner
.
readUint8
();
const
count
=
reader
.
inner
.
readUint8
();
const
spCount
=
reader
.
inner
.
readUint8
();
const
spCount
=
reader
.
inner
.
readUint8
();
const
forced
=
reader
.
inner
.
readUint8
()
!==
0
;
const
hint0
=
reader
.
inner
.
readUint32
();
const
hint0
=
reader
.
inner
.
readUint32
();
const
hint1
=
reader
.
inner
.
readUint32
();
const
hint1
=
reader
.
inner
.
readUint32
();
const
msg
=
new
MsgSelectChain
({
const
msg
=
new
MsgSelectChain
({
player
,
player
,
special_count
:
spCount
,
special_count
:
spCount
,
forced
,
forced
:
false
,
hint0
,
hint0
,
hint1
,
hint1
,
chains
:
[],
chains
:
[],
});
});
let
forceCount
=
0
;
for
(
let
i
=
0
;
i
<
count
;
i
++
)
{
for
(
let
i
=
0
;
i
<
count
;
i
++
)
{
const
flag
=
reader
.
inner
.
readUint8
();
const
flag
=
reader
.
inner
.
readUint8
();
const
code
=
reader
.
inner
.
readUint32
();
const
forced
=
reader
.
inner
.
readUint8
();
forceCount
+=
forced
;
const
code
=
reader
.
inner
.
readUint32
()
%
1000000000
;
const
location
=
reader
.
readCardLocation
();
const
location
=
reader
.
readCardLocation
();
const
effect_desc
=
reader
.
inner
.
readUint32
();
const
effect_desc
=
reader
.
inner
.
readUint32
();
msg
.
chains
.
push
(
const
chain
=
new
MsgSelectChain
.
Chain
({
new
MsgSelectChain
.
Chain
({
flag
:
numberToChainFlag
(
flag
),
flag
:
numberToChainFlag
(
flag
),
code
,
code
,
location
,
location
,
effect_description
:
effect_desc
,
effect_description
:
effect_desc
,
response
:
i
,
response
:
i
,
});
}),
// 由于 protobuf 定义中 Chain 没有 forced 字段,使用类型扩展
);
(
chain
as
any
).
forced
=
forced
>
0
;
msg
.
chains
.
push
(
chain
);
}
}
msg
.
forced
=
forceCount
>
0
;
return
msg
;
return
msg
;
};
};
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectSum.ts
View file @
7205bc14
...
@@ -34,12 +34,23 @@ export default (data: Uint8Array) => {
...
@@ -34,12 +34,23 @@ export default (data: Uint8Array) => {
const
location
=
reader
.
readCardShortLocation
();
const
location
=
reader
.
readCardShortLocation
();
const
para
=
reader
.
inner
.
readInt32
();
const
para
=
reader
.
inner
.
readInt32
();
let
level1
=
para
&
0xffff
;
let
level2
=
para
>>
16
;
// 检查 0x80000000 标志位
if
((
para
&
0x80000000
)
!==
0
)
{
level1
=
para
&
0x7fffffff
;
level2
=
level1
;
}
if
(
level2
===
0
)
{
level2
=
level1
;
}
msg
.
must_select_cards
.
push
(
msg
.
must_select_cards
.
push
(
new
MsgSelectSum
.
Info
({
new
MsgSelectSum
.
Info
({
code
,
code
,
location
,
location
,
level1
:
para
&
0xffff
,
level1
,
level2
:
para
>>
16
,
level2
,
response
:
i
,
response
:
i
,
}),
}),
);
);
...
@@ -50,8 +61,17 @@ export default (data: Uint8Array) => {
...
@@ -50,8 +61,17 @@ export default (data: Uint8Array) => {
const
code
=
reader
.
inner
.
readInt32
();
const
code
=
reader
.
inner
.
readInt32
();
const
location
=
reader
.
readCardShortLocation
();
const
location
=
reader
.
readCardShortLocation
();
const
para
=
reader
.
inner
.
readInt32
();
const
para
=
reader
.
inner
.
readInt32
();
const
level1
=
para
&
0xffff
;
const
level2
=
para
>>
16
>
0
?
para
>>
16
:
level1
;
let
level1
=
para
&
0xffff
;
let
level2
=
para
>>
16
;
// 检查 0x80000000 标志位
if
((
para
&
0x80000000
)
!==
0
)
{
level1
=
para
&
0x7fffffff
;
level2
=
level1
;
}
if
(
level2
===
0
)
{
level2
=
level1
;
}
msg
.
selectable_cards
.
push
(
msg
.
selectable_cards
.
push
(
new
MsgSelectSum
.
Info
({
new
MsgSelectSum
.
Info
({
...
...
src/service/duel/selectChain.ts
View file @
7205bc14
...
@@ -10,20 +10,22 @@ export default async (container: Container, selectChain: MsgSelectChain) => {
...
@@ -10,20 +10,22 @@ export default async (container: Container, selectChain: MsgSelectChain) => {
const
conn
=
container
.
conn
;
const
conn
=
container
.
conn
;
const
context
=
container
.
context
;
const
context
=
container
.
context
;
const
spCount
=
selectChain
.
special_count
;
const
spCount
=
selectChain
.
special_count
;
const
forced
=
selectChain
.
forced
;
const
_hint0
=
selectChain
.
hint0
;
const
_hint0
=
selectChain
.
hint0
;
const
_hint1
=
selectChain
.
hint1
;
const
_hint1
=
selectChain
.
hint1
;
const
chains
=
selectChain
.
chains
;
const
chains
=
selectChain
.
chains
;
const
chainSetting
=
context
.
matStore
.
chainSetting
;
const
chainSetting
=
context
.
matStore
.
chainSetting
;
if
(
chainSetting
===
ChainSetting
.
CHAIN_IGNORE
)
{
// 计算强制发动的卡片数量
// 如果玩家配置了忽略连锁,直接回应后端并返回
const
forceCount
=
chains
.
filter
((
chain
)
=>
(
chain
as
any
).
forced
).
length
;
if
(
chainSetting
===
ChainSetting
.
CHAIN_IGNORE
&&
forceCount
===
0
)
{
// 如果玩家配置了忽略连锁,且没有强制发动的卡,直接回应后端并返回
sendSelectSingleResponse
(
conn
,
-
1
);
sendSelectSingleResponse
(
conn
,
-
1
);
return
;
return
;
}
}
let
handle_flag
=
0
;
let
handle_flag
=
0
;
if
(
!
forced
)
{
if
(
forceCount
===
0
)
{
// 无强制发动的卡
// 无强制发动的卡
if
(
spCount
===
0
)
{
if
(
spCount
===
0
)
{
// 无关键卡
// 无关键卡
...
@@ -32,8 +34,12 @@ export default async (container: Container, selectChain: MsgSelectChain) => {
...
@@ -32,8 +34,12 @@ export default async (container: Container, selectChain: MsgSelectChain) => {
handle_flag
=
0
;
handle_flag
=
0
;
}
else
{
}
else
{
if
(
chainSetting
===
ChainSetting
.
CHAIN_ALL
)
{
if
(
chainSetting
===
ChainSetting
.
CHAIN_ALL
)
{
// 配置了全部连锁,则处理多张
// 配置了全部连锁,则处理
handle_flag
=
2
;
if
(
chains
.
length
===
1
)
{
handle_flag
=
1
;
}
else
{
handle_flag
=
2
;
}
}
else
{
}
else
{
// 否则不连锁
// 否则不连锁
handle_flag
=
0
;
handle_flag
=
0
;
...
@@ -44,32 +50,45 @@ export default async (container: Container, selectChain: MsgSelectChain) => {
...
@@ -44,32 +50,45 @@ export default async (container: Container, selectChain: MsgSelectChain) => {
if
(
chains
.
length
===
0
)
{
if
(
chains
.
length
===
0
)
{
// 根本没卡,直接回答
// 根本没卡,直接回答
handle_flag
=
0
;
handle_flag
=
0
;
}
else
if
(
chainSetting
===
ChainSetting
.
CHAIN_IGNORE
)
{
// 配置了忽略连锁
handle_flag
=
0
;
}
else
{
}
else
{
// 处理多张
// 处理
handle_flag
=
2
;
if
(
chains
.
length
===
1
)
{
handle_flag
=
1
;
}
else
{
handle_flag
=
2
;
}
}
}
}
}
}
else
{
}
else
{
// 有强制发动的卡
// 有强制发动的卡
if
(
chains
.
length
===
1
)
{
if
(
chains
.
length
===
1
)
{
// 只有一个强制发动的连锁项,直接回应
// 只有一张卡需要处理(强制发动)
handle_flag
=
4
;
}
else
{
// 处理强制发动的卡
handle_flag
=
3
;
handle_flag
=
3
;
}
else
{
// 多张卡需要处理(强制发动)
handle_flag
=
4
;
}
}
}
}
// handle_flag:
// 0 - 无卡,直接回应
// 1 - 一张卡需要处理
// 2 - 多张卡需要处理
// 3 - 一张卡需要处理(强制发动)
// 4 - 多张卡需要处理(强制发动)
switch
(
handle_flag
)
{
switch
(
handle_flag
)
{
case
0
:
{
case
0
:
{
// 直接回答
// 直接回答
sendSelectSingleResponse
(
conn
,
-
1
);
sendSelectSingleResponse
(
conn
,
-
1
);
break
;
break
;
}
}
case
2
:
// 处理多张
case
1
:
case
3
:
{
case
2
:
{
// 处理
强制发动的卡
// 处理
可选连锁
fetchSelectHintMeta
({
fetchSelectHintMeta
({
selectHintData
:
203
,
selectHintData
:
203
,
});
});
...
@@ -79,7 +98,7 @@ export default async (container: Container, selectChain: MsgSelectChain) => {
...
@@ -79,7 +98,7 @@ export default async (container: Container, selectChain: MsgSelectChain) => {
);
);
await
displaySelectActionsModal
({
await
displaySelectActionsModal
({
isChain
:
true
,
isChain
:
true
,
cancelable
:
!
forced
,
cancelable
:
true
,
min
:
1
,
min
:
1
,
max
:
1
,
max
:
1
,
selecteds
,
selecteds
,
...
@@ -88,10 +107,29 @@ export default async (container: Container, selectChain: MsgSelectChain) => {
...
@@ -88,10 +107,29 @@ export default async (container: Container, selectChain: MsgSelectChain) => {
});
});
break
;
break
;
}
}
case
4
:
{
case
3
:
{
//
有
一张强制发动的卡,直接回应
// 一张强制发动的卡,直接回应
sendSelectSingleResponse
(
conn
,
chains
[
0
].
response
);
sendSelectSingleResponse
(
conn
,
chains
[
0
].
response
);
break
;
}
case
4
:
{
// 多张强制发动的卡,弹窗选择
fetchSelectHintMeta
({
selectHintData
:
203
,
});
const
{
selecteds
,
mustSelects
,
selectables
}
=
await
fetchCheckCardMeta
(
context
,
chains
,
);
await
displaySelectActionsModal
({
isChain
:
true
,
cancelable
:
false
,
min
:
1
,
max
:
1
,
selecteds
,
mustSelects
,
selectables
,
});
break
;
break
;
}
}
default
:
{
default
:
{
...
...
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