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
71871e17
Commit
71871e17
authored
May 07, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync neos-protobuf
parent
5a6f4933
Pipeline
#21526
passed with stages
in 14 minutes
Changes
9
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
119 additions
and
344 deletions
+119
-344
neos-protobuf
neos-protobuf
+1
-1
src/api/ocgcore/idl/ocgcore.ts
src/api/ocgcore/idl/ocgcore.ts
+97
-279
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
+6
-14
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectMulti.ts
...cgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectMulti.ts
+1
-1
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectSingle.ts
...gcore/ocgAdapter/ctos/ctosGameMsgResponse/selectSingle.ts
+1
-1
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectUnselectCard.ts
...ocgAdapter/ctos/ctosGameMsgResponse/selectUnselectCard.ts
+0
-17
src/api/ocgcore/ocgHelper.ts
src/api/ocgcore/ocgHelper.ts
+4
-22
src/service/duel/selectChain.ts
src/service/duel/selectChain.ts
+3
-3
src/ui/Duel/Message/CheckCardModal.tsx
src/ui/Duel/Message/CheckCardModal.tsx
+6
-6
No files found.
neos-protobuf
@
be66d514
Subproject commit
1648b05d2e0bf0fc84c9e98104b8d9ca6a014c1
a
Subproject commit
be66d514be6d1224163f55bca85dc361d0c9fe6
a
src/api/ocgcore/idl/ocgcore.ts
View file @
71871e17
This diff is collapsed.
Click to expand it.
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
View file @
71871e17
...
...
@@ -2,15 +2,14 @@ import { ygopro } from "../../../idl/ocgcore";
import
{
YgoProPacket
}
from
"
../../packet
"
;
import
{
CTOS_RESPONSE
}
from
"
../../protoDecl
"
;
import
adaptSelectBattleCmdResponse
from
"
./selectBattleCmd
"
;
import
adaptSelectCardResponse
from
"
./selectCard
"
;
import
adaptSelectChainResponse
from
"
./selectChain
"
;
import
adaptSelectCounterResponse
from
"
./selectCounter
"
;
import
adaptSelectEffectYnResponse
from
"
./selectEffectYn
"
;
import
adaptSelectIdleCmdResponse
from
"
./selectIdleCmd
"
;
import
adaptSelectMultiResponse
from
"
./selectMulti
"
;
import
adaptSelectOptionResponse
from
"
./selectOption
"
;
import
adaptSelectPlaceResponse
from
"
./selectPlace
"
;
import
adaptSelectPositionResponse
from
"
./selectPosition
"
;
import
adaptSelect
UnselectCardResponse
from
"
./selectUnselectCard
"
;
import
adaptSelect
SingleResponse
from
"
./selectSingle
"
;
import
adaptSortCardResponse
from
"
./sortCard
"
;
/*
...
...
@@ -37,13 +36,13 @@ export default class CtosResponsePacket extends YgoProPacket {
break
;
}
case
"
select_
card
"
:
{
extraData
=
adaptSelect
CardResponse
(
response
.
select_card
);
case
"
select_
multi
"
:
{
extraData
=
adaptSelect
MultiResponse
(
response
.
select_multi
);
break
;
}
case
"
select_
chain
"
:
{
extraData
=
adaptSelect
ChainResponse
(
response
.
select_chain
);
case
"
select_
single
"
:
{
extraData
=
adaptSelect
SingleResponse
(
response
.
select_single
);
break
;
}
...
...
@@ -67,13 +66,6 @@ export default class CtosResponsePacket extends YgoProPacket {
break
;
}
case
"
select_unselect_card
"
:
{
extraData
=
adaptSelectUnselectCardResponse
(
response
.
select_unselect_card
);
break
;
}
case
"
select_counter_response
"
:
{
extraData
=
adaptSelectCounterResponse
(
response
.
select_counter_response
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/select
Card
.ts
→
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/select
Multi
.ts
View file @
71871e17
...
...
@@ -2,7 +2,7 @@ import { BufferWriter } from "rust-src";
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
Select
Card
Response
)
=>
{
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
Select
Multi
Response
)
=>
{
const
writer
=
new
BufferWriter
();
writer
.
writeUint8
(
response
.
selected_ptrs
.
length
);
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/select
Chain
.ts
→
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/select
Single
.ts
View file @
71871e17
...
...
@@ -2,7 +2,7 @@ import { BufferWriter } from "rust-src";
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
Select
Chain
Response
)
=>
{
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
Select
Single
Response
)
=>
{
const
writer
=
new
BufferWriter
();
writer
.
writeInt32
(
response
.
selected_ptr
);
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectUnselectCard.ts
deleted
100644 → 0
View file @
5a6f4933
import
{
BufferWriter
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SelectUnselectCardResponse
)
=>
{
const
writer
=
new
BufferWriter
();
if
(
response
.
cancel_or_finish
)
{
writer
.
writeInt32
(
-
1
);
}
else
{
writer
.
writeUint8
(
1
);
writer
.
writeUint8
(
response
.
selected_ptr
);
}
return
writer
.
toArray
();
};
src/api/ocgcore/ocgHelper.ts
View file @
71871e17
...
...
@@ -172,10 +172,10 @@ export function sendSelectPlaceResponse(value: {
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
}
export
function
sendSelect
Card
Response
(
value
:
number
[])
{
export
function
sendSelect
Multi
Response
(
value
:
number
[])
{
const
response
=
new
ygopro
.
YgoCtosMsg
({
ctos_response
:
new
ygopro
.
CtosGameMsgResponse
({
select_
card
:
new
ygopro
.
CtosGameMsgResponse
.
SelectCard
Response
({
select_
multi
:
new
ygopro
.
CtosGameMsgResponse
.
SelectMulti
Response
({
selected_ptrs
:
value
,
}),
}),
...
...
@@ -185,10 +185,10 @@ export function sendSelectCardResponse(value: number[]) {
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
}
export
function
sendSelect
Chain
Response
(
value
:
number
)
{
export
function
sendSelect
Single
Response
(
value
:
number
)
{
const
response
=
new
ygopro
.
YgoCtosMsg
({
ctos_response
:
new
ygopro
.
CtosGameMsgResponse
({
select_
chain
:
new
ygopro
.
CtosGameMsgResponse
.
SelectChain
Response
({
select_
single
:
new
ygopro
.
CtosGameMsgResponse
.
SelectSingle
Response
({
selected_ptr
:
value
,
}),
}),
...
...
@@ -252,24 +252,6 @@ export function sendSelectBattleCmdResponse(value: number) {
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
}
export
function
sendSelectUnselectCardResponse
(
value
:
{
cancel_or_finish
?:
boolean
;
selected_ptr
?:
number
;
})
{
const
response
=
new
ygopro
.
YgoCtosMsg
({
ctos_response
:
new
ygopro
.
CtosGameMsgResponse
({
select_unselect_card
:
new
ygopro
.
CtosGameMsgResponse
.
SelectUnselectCardResponse
({
selected_ptr
:
value
.
selected_ptr
,
cancel_or_finish
:
value
.
cancel_or_finish
,
}),
}),
});
const
payload
=
new
GameMsgResponse
(
response
).
serialize
();
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
}
export
function
sendSelectCounterResponse
(
counts
:
number
[])
{
const
response
=
new
ygopro
.
YgoCtosMsg
({
ctos_response
:
new
ygopro
.
CtosGameMsgResponse
({
...
...
src/service/duel/selectChain.ts
View file @
71871e17
import
{
sendSelect
Chain
Response
,
ygopro
}
from
"
@/api
"
;
import
{
sendSelect
Single
Response
,
ygopro
}
from
"
@/api
"
;
import
{
fetchCheckCardMeta
,
fetchSelectHintMeta
,
...
...
@@ -49,7 +49,7 @@ export default (selectChain: MsgSelectChain) => {
switch
(
handle_flag
)
{
case
0
:
{
// 直接回答
sendSelect
Chain
Response
(
-
1
);
sendSelect
Single
Response
(
-
1
);
break
;
}
...
...
@@ -79,7 +79,7 @@ export default (selectChain: MsgSelectChain) => {
}
case
4
:
{
// 有一张强制发动的卡,直接回应
sendSelect
Chain
Response
(
chains
[
0
].
response
);
sendSelect
Single
Response
(
chains
[
0
].
response
);
break
;
}
...
...
src/ui/Duel/Message/CheckCardModal.tsx
View file @
71871e17
...
...
@@ -6,8 +6,8 @@ import { useSnapshot } from "valtio";
import
{
fetchStrings
,
sendSelect
Card
Response
,
sendSelect
Chain
Response
,
sendSelect
Multi
Response
,
sendSelect
Single
Response
,
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
matStore
,
messageStore
}
from
"
@/stores
"
;
...
...
@@ -85,9 +85,9 @@ export const CheckCardModal = () => {
.
map
((
option
)
=>
option
.
response
);
if
(
isChain
)
{
sendSelect
Chain
Response
(
values
[
0
]);
sendSelect
Single
Response
(
values
[
0
]);
}
else
{
sendSelect
Card
Response
(
values
);
sendSelect
Multi
Response
(
values
);
}
resetCheckCardModal
();
}
}
...
...
@@ -99,7 +99,7 @@ export const CheckCardModal = () => {
<
Button
disabled=
{
!
finishable
}
onClick=
{
()
=>
{
sendSelect
CardResponse
([
FINISH_RESPONSE
]
);
sendSelect
SingleResponse
(
FINISH_RESPONSE
);
resetCheckCardModal
();
}
}
onFocus=
{
()
=>
{}
}
...
...
@@ -111,7 +111,7 @@ export const CheckCardModal = () => {
<
Button
disabled=
{
!
cancelable
}
onClick=
{
()
=>
{
sendSelect
Chain
Response
(
CANCEL_RESPONSE
);
sendSelect
Single
Response
(
CANCEL_RESPONSE
);
resetCheckCardModal
();
}
}
onFocus=
{
()
=>
{}
}
...
...
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