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
89983f5a
Commit
89983f5a
authored
Oct 23, 2022
by
Chunchi Che
Committed by
WANG HE
Dec 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rerange ocgAdapter
parent
eb4a85ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
18 deletions
+18
-18
src/api/ocgcore/ocgAdapter/packet.ts
src/api/ocgcore/ocgAdapter/packet.ts
+2
-17
src/api/ocgcore/ocgAdapter/playerInfo.ts
src/api/ocgcore/ocgAdapter/playerInfo.ts
+15
-0
src/api/ocgcore/ocgHelper.ts
src/api/ocgcore/ocgHelper.ts
+1
-1
No files found.
src/api/ocgcore/ocgAdapter.ts
→
src/api/ocgcore/ocgAdapter
/packet
.ts
View file @
89983f5a
import
{
ygopro
}
from
"
./idl/ocgcore
"
;
const
PACKET_MIN_LEN
=
3
;
const
littleEndian
:
boolean
=
true
;
const
PACKET_MIN_LEN
=
3
;
const
CtosPlayerInfo
=
16
;
class
ygoProPacket
{
export
class
ygoProPacket
{
packetLen
:
number
;
proto
:
number
;
exData
:
Uint8Array
;
...
...
@@ -51,14 +47,3 @@ export class ygoArrayBuilder extends ygoProPacket {
}
}
}
export
class
playerInfoPacket
extends
ygoProPacket
{
constructor
(
pb
:
ygopro
.
YgoCtosMsg
)
{
const
encoder
=
new
TextEncoder
();
const
player
=
pb
.
ctos_player_info
.
name
;
const
exData
=
encoder
.
encode
(
player
);
super
(
exData
.
length
+
1
,
CtosPlayerInfo
,
exData
);
}
}
src/api/ocgcore/ocgAdapter/playerInfo.ts
0 → 100644
View file @
89983f5a
import
{
ygopro
}
from
"
../idl/ocgcore
"
;
import
{
ygoProPacket
}
from
"
./packet
"
;
const
CtosPlayerInfo
=
16
;
export
class
playerInfoPacket
extends
ygoProPacket
{
constructor
(
pb
:
ygopro
.
YgoCtosMsg
)
{
const
encoder
=
new
TextEncoder
();
const
player
=
pb
.
ctos_player_info
.
name
;
const
exData
=
encoder
.
encode
(
player
);
super
(
exData
.
length
+
1
,
CtosPlayerInfo
,
exData
);
}
}
src/api/ocgcore/ocgHelper.ts
View file @
89983f5a
import
{
ygopro
}
from
"
./idl/ocgcore
"
;
import
socketMiddleWare
,
{
socketCmd
}
from
"
../../middleware/socket
"
;
import
{
IDeck
}
from
"
../Card
"
;
import
{
playerInfoPacket
}
from
"
./ocgAdapter
"
;
import
{
playerInfoPacket
}
from
"
./ocgAdapter
/playerInfo
"
;
export
function
sendUpdateDeck
(
deck
:
IDeck
)
{
const
updateDeck
=
new
ygopro
.
YgoCtosMsg
({
...
...
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