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
3a76038f
Commit
3a76038f
authored
Jan 05, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add select_chain response adapter and helper
parent
435fedfd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
0 deletions
+30
-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/selectChain.ts
...cgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectChain.ts
+11
-0
src/api/ocgcore/ocgHelper.ts
src/api/ocgcore/ocgHelper.ts
+13
-0
No files found.
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
View file @
3a76038f
...
@@ -4,6 +4,7 @@ import { CTOS_RESPONSE } from "../../protoDecl";
...
@@ -4,6 +4,7 @@ import { CTOS_RESPONSE } from "../../protoDecl";
import
adaptSelectIdleCmdResponse
from
"
./selectIdleCmd
"
;
import
adaptSelectIdleCmdResponse
from
"
./selectIdleCmd
"
;
import
adaptSelectPlaceResponse
from
"
./selectPlace
"
;
import
adaptSelectPlaceResponse
from
"
./selectPlace
"
;
import
adaptSelectCardResponse
from
"
./selectCard
"
;
import
adaptSelectCardResponse
from
"
./selectCard
"
;
import
adaptSelectChainResponse
from
"
./selectChain
"
;
/*
/*
* CTOS CTOS_RESPONSE
* CTOS CTOS_RESPONSE
...
@@ -34,6 +35,11 @@ export default class CtosResponsePacket extends YgoProPacket {
...
@@ -34,6 +35,11 @@ export default class CtosResponsePacket extends YgoProPacket {
break
;
break
;
}
}
case
"
select_chain
"
:
{
extraData
=
adaptSelectChainResponse
(
response
.
select_chain
);
break
;
}
default
:
{
default
:
{
break
;
break
;
}
}
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectChain.ts
0 → 100644
View file @
3a76038f
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferWriter
}
from
"
../../bufferIO
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SelectChainResponse
)
=>
{
const
array
=
new
Uint8Array
(
4
);
const
writer
=
new
BufferWriter
(
array
,
true
);
writer
.
writeUint32
(
response
.
selected_ptr
);
return
array
;
};
src/api/ocgcore/ocgHelper.ts
View file @
3a76038f
...
@@ -163,3 +163,16 @@ export function sendSelectCardResponse(value: number[]) {
...
@@ -163,3 +163,16 @@ export function sendSelectCardResponse(value: number[]) {
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
}
}
export
function
sendSelectChainResponse
(
value
:
number
)
{
const
response
=
new
ygopro
.
YgoCtosMsg
({
ctos_response
:
new
ygopro
.
CtosGameMsgResponse
({
select_chain
:
new
ygopro
.
CtosGameMsgResponse
.
SelectChainResponse
({
selected_ptr
:
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