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
66b1e942
Commit
66b1e942
authored
Nov 19, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add GameMsg Draw adapter
parent
58f5178e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/draw.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/draw.ts
+7
-3
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
+2
-1
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+6
-0
No files found.
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/draw.ts
View file @
66b1e942
...
@@ -16,10 +16,14 @@ export default (data: Uint8Array) => {
...
@@ -16,10 +16,14 @@ export default (data: Uint8Array) => {
const
player
=
reader
.
readUint8
();
const
player
=
reader
.
readUint8
();
const
count
=
reader
.
readUint8
();
const
count
=
reader
.
readUint8
();
let
han
ds
:
number
[]
=
[];
let
car
ds
:
number
[]
=
[];
for
(
let
i
=
0
;
i
<
count
;
i
++
)
{
for
(
let
i
=
0
;
i
<
count
;
i
++
)
{
han
ds
.
push
(
reader
.
readUint32
());
car
ds
.
push
(
reader
.
readUint32
());
}
}
// TODO
return
new
ygopro
.
StocGameMessage
.
MsgDraw
({
player
,
count
,
cards
,
});
};
};
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
66b1e942
...
@@ -7,6 +7,7 @@ import { ygopro } from "../../../idl/ocgcore";
...
@@ -7,6 +7,7 @@ import { ygopro } from "../../../idl/ocgcore";
import
{
YgoProPacket
,
StocAdapter
}
from
"
../../packet
"
;
import
{
YgoProPacket
,
StocAdapter
}
from
"
../../packet
"
;
import
*
as
GAME_MSG
from
"
../../protoDecl
"
;
import
*
as
GAME_MSG
from
"
../../protoDecl
"
;
import
MsgStartAdapter
from
"
./start
"
;
import
MsgStartAdapter
from
"
./start
"
;
import
MsgDrawAdapter
from
"
./draw
"
;
/*
/*
* STOC GameMsg
* STOC GameMsg
...
@@ -38,7 +39,7 @@ export default class GameMsgAdapter implements StocAdapter {
...
@@ -38,7 +39,7 @@ export default class GameMsgAdapter implements StocAdapter {
break
;
break
;
}
}
case
GAME_MSG
.
MSG_DRAW
:
{
case
GAME_MSG
.
MSG_DRAW
:
{
// TODO
gameMsg
.
draw
=
MsgDrawAdapter
(
gameData
);
break
;
break
;
}
}
...
...
src/service/duel/gameMsg.ts
View file @
66b1e942
...
@@ -10,6 +10,12 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
...
@@ -10,6 +10,12 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
break
;
break
;
}
}
case
"
draw
"
:
{
// TODO
console
.
log
(
msg
.
draw
);
break
;
}
default
:
{
default
:
{
console
.
log
(
"
Unhandled GameMsg=
"
+
msg
.
gameMsg
);
console
.
log
(
"
Unhandled GameMsg=
"
+
msg
.
gameMsg
);
...
...
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