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
b616e231
Commit
b616e231
authored
May 25, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add announceRace adapter
parent
4f431ae8
Pipeline
#21821
passed with stages
in 12 minutes and 19 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
0 deletions
+48
-0
src/api/ocgcore/ocgAdapter/protoDecl.ts
src/api/ocgcore/ocgAdapter/protoDecl.ts
+4
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/announceRace.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/announceRace.ts
+38
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
+6
-0
No files found.
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
b616e231
...
...
@@ -57,3 +57,7 @@ export const MSG_REMOVE_COUNTER = 102;
export
const
MSG_SELECT_COUNTER
=
22
;
export
const
MSG_SORT_CARD
=
25
;
export
const
MSG_ATTACK
=
110
;
export
const
MSG_ANNOUNCE_RACE
=
140
;
export
const
MSG_ANNOUNCE_ATTRIB
=
141
;
export
const
MSG_ANNOUNCE_CARD
=
142
;
export
const
MSG_ANNOUNCE_NUMBER
=
143
;
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/announceRace.ts
0 → 100644
View file @
b616e231
import
{
BufferReader
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
MsgAnnounce
=
ygopro
.
StocGameMessage
.
MsgAnnounce
;
/*
* Announce Race
*
* @param - TODO
* @usage - 声明种族
* */
export
default
(
data
:
Uint8Array
)
=>
{
const
reader
=
new
BufferReader
(
data
);
const
player
=
reader
.
readUint8
();
const
min
=
reader
.
readUint8
();
const
avaiable
=
reader
.
readUint32
();
const
options
=
[];
for
(
let
i
=
0
;
i
<
25
;
i
++
)
{
if
((
avaiable
&
(
1
<<
i
))
>
0
)
{
options
.
push
(
new
MsgAnnounce
.
Option
({
code
:
i
,
response
:
1
<<
i
,
})
);
}
}
return
new
MsgAnnounce
({
player
,
announce_type
:
MsgAnnounce
.
AnnounceType
.
RACE
,
min
,
options
,
});
};
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
b616e231
...
...
@@ -7,6 +7,7 @@ import { ygopro } from "../../../idl/ocgcore";
import
{
StocAdapter
,
YgoProPacket
}
from
"
../../packet
"
;
import
*
as
GAME_MSG
from
"
../../protoDecl
"
;
import
MsgAddCounter
from
"
./addCounter
"
;
import
MsgAnnounceRace
from
"
./announceRace
"
;
import
MsgAttack
from
"
./attack
"
;
import
MsgDamage
from
"
./damage
"
;
import
MsgDrawAdapter
from
"
./draw
"
;
...
...
@@ -196,6 +197,11 @@ export default class GameMsgAdapter implements StocAdapter {
break
;
}
case
GAME_MSG
.
MSG_ANNOUNCE_RACE
:
{
gameMsg
.
announceRace
=
MsgAnnounceRace
(
gameData
);
break
;
}
default
:
{
gameMsg
.
unimplemented
=
new
ygopro
.
StocGameMessage
.
MsgUnimplemented
({
command
:
func
,
...
...
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