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
6c82ffbb
Commit
6c82ffbb
authored
Jan 16, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add select battle cmd ctos response adapter and helper
parent
7307fd14
Pipeline
#19623
passed with stages
in 6 minutes and 29 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
+34
-0
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
+6
-0
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectBattleCmd.ts
...re/ocgAdapter/ctos/ctosGameMsgResponse/selectBattleCmd.ts
+13
-0
src/api/ocgcore/ocgHelper.ts
src/api/ocgcore/ocgHelper.ts
+15
-0
No files found.
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
View file @
6c82ffbb
...
...
@@ -8,6 +8,7 @@ import adaptSelectChainResponse from "./selectChain";
import
adaptSelectEffectYnResponse
from
"
./selectEffectYn
"
;
import
adaptSelectPositionResponse
from
"
./selectPosition
"
;
import
adaptSelectOptionResponse
from
"
./selectOption
"
;
import
adaptSelectBattleCmdResponse
from
"
./selectBattleCmd
"
;
/*
* CTOS CTOS_RESPONSE
...
...
@@ -58,6 +59,11 @@ export default class CtosResponsePacket extends YgoProPacket {
break
;
}
case
"
select_battle_cmd
"
:
{
extraData
=
adaptSelectBattleCmdResponse
(
response
.
select_battle_cmd
);
break
;
}
default
:
{
break
;
}
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectBattleCmd.ts
0 → 100644
View file @
6c82ffbb
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferWriter
}
from
"
../../bufferIO
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SelectBattleCmdResponse
)
=>
{
const
array
=
new
Uint8Array
(
4
);
const
writer
=
new
BufferWriter
(
array
,
true
);
writer
.
writeUint32
(
response
.
selected_cmd
);
return
array
;
};
src/api/ocgcore/ocgHelper.ts
View file @
6c82ffbb
...
...
@@ -215,3 +215,18 @@ export function sendSelectOptionResponse(value: number) {
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
}
export
function
sendSelectBattleCmdResponse
(
value
:
number
)
{
const
response
=
new
ygopro
.
YgoCtosMsg
({
ctos_response
:
new
ygopro
.
CtosGameMsgResponse
({
select_battle_cmd
:
new
ygopro
.
CtosGameMsgResponse
.
SelectBattleCmdResponse
(
{
selected_cmd
:
value
,
}
),
}),
});
const
payload
=
new
GameMsgResponse
(
response
).
serialize
();
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
}
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