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
c34e2a38
Commit
c34e2a38
authored
Mar 30, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle select_counter_response
parent
2984f1c7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
0 deletions
+43
-0
rust-src/src/buffer.rs
rust-src/src/buffer.rs
+8
-0
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
+8
-0
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectCounter.ts
...core/ocgAdapter/ctos/ctosGameMsgResponse/selectCounter.ts
+13
-0
src/api/ocgcore/ocgHelper.ts
src/api/ocgcore/ocgHelper.ts
+14
-0
No files found.
rust-src/src/buffer.rs
View file @
c34e2a38
...
@@ -102,6 +102,14 @@ impl BufferWriter {
...
@@ -102,6 +102,14 @@ impl BufferWriter {
self
.array
.extend
(
value
.to_le_bytes
());
self
.array
.extend
(
value
.to_le_bytes
());
}
}
pub
fn
writeUint16
(
&
mut
self
,
value
:
u16
)
{
self
.array
.extend
(
value
.to_le_bytes
());
}
pub
fn
writeInt16
(
&
mut
self
,
value
:
i16
)
{
self
.array
.extend
(
value
.to_le_bytes
());
}
pub
fn
writeUint32
(
&
mut
self
,
value
:
u32
)
{
pub
fn
writeUint32
(
&
mut
self
,
value
:
u32
)
{
self
.array
.extend
(
value
.to_le_bytes
());
self
.array
.extend
(
value
.to_le_bytes
());
}
}
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
View file @
c34e2a38
...
@@ -10,6 +10,7 @@ import adaptSelectPositionResponse from "./selectPosition";
...
@@ -10,6 +10,7 @@ import adaptSelectPositionResponse from "./selectPosition";
import
adaptSelectOptionResponse
from
"
./selectOption
"
;
import
adaptSelectOptionResponse
from
"
./selectOption
"
;
import
adaptSelectBattleCmdResponse
from
"
./selectBattleCmd
"
;
import
adaptSelectBattleCmdResponse
from
"
./selectBattleCmd
"
;
import
adaptSelectUnselectCardResponse
from
"
./selectUnselectCard
"
;
import
adaptSelectUnselectCardResponse
from
"
./selectUnselectCard
"
;
import
adaptSelectCounterResponse
from
"
./selectCounter
"
;
/*
/*
* CTOS CTOS_RESPONSE
* CTOS CTOS_RESPONSE
...
@@ -72,6 +73,13 @@ export default class CtosResponsePacket extends YgoProPacket {
...
@@ -72,6 +73,13 @@ export default class CtosResponsePacket extends YgoProPacket {
break
;
break
;
}
}
case
"
select_counter_response
"
:
{
extraData
=
adaptSelectCounterResponse
(
response
.
select_counter_response
);
break
;
}
default
:
{
default
:
{
break
;
break
;
}
}
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectCounter.ts
0 → 100644
View file @
c34e2a38
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
// @ts-ignore
import
{
BufferWriter
}
from
"
rust-src
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SelectCounterResponse
)
=>
{
const
writer
=
new
BufferWriter
();
for
(
const
count
of
response
.
selected_count
)
{
writer
.
writeInt16
(
count
);
}
return
writer
.
toArray
();
};
src/api/ocgcore/ocgHelper.ts
View file @
c34e2a38
...
@@ -268,3 +268,17 @@ export function sendSelectUnselectCardResponse(value: {
...
@@ -268,3 +268,17 @@ export function sendSelectUnselectCardResponse(value: {
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
}
}
export
function
sendSelectCounterResponse
(
counts
:
number
[])
{
const
response
=
new
ygopro
.
YgoCtosMsg
({
ctos_response
:
new
ygopro
.
CtosGameMsgResponse
({
select_counter_response
:
new
ygopro
.
CtosGameMsgResponse
.
SelectCounterResponse
({
selected_count
:
counts
,
}),
}),
});
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