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
ffead879
Commit
ffead879
authored
Oct 23, 2022
by
Chunchi Che
Committed by
WANG HE
Dec 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix and succeed in joining room
parent
610fcd05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
src/api/ocgcore/ocgAdapter/ctos/ctosJoinGame.ts
src/api/ocgcore/ocgAdapter/ctos/ctosJoinGame.ts
+10
-9
src/api/ocgcore/ocgAdapter/packet.ts
src/api/ocgcore/ocgAdapter/packet.ts
+1
-1
No files found.
src/api/ocgcore/ocgAdapter/ctos/ctosJoinGame.ts
View file @
ffead879
...
...
@@ -3,8 +3,6 @@ import { ygoProPacket } from "../packet";
import
{
CTOS_JOIN_GAME
}
from
"
../protoDecl
"
;
import
{
strEncodeUTF16
}
from
"
../util
"
;
const
littleEndian
:
boolean
=
true
;
export
default
class
CtosJoinGamePacket
extends
ygoProPacket
{
constructor
(
pb
:
ygopro
.
YgoCtosMsg
)
{
const
joinGame
=
pb
.
ctos_join_game
;
...
...
@@ -13,16 +11,19 @@ export default class CtosJoinGamePacket extends ygoProPacket {
const
gameId
=
joinGame
.
gameid
;
const
passWd
=
strEncodeUTF16
(
joinGame
.
passwd
);
const
exDataLen
=
2
+
4
+
passWd
.
length
;
const
exDataLen
=
4
+
4
+
passWd
.
length
;
const
exData
=
new
Uint8Array
(
exDataLen
);
const
dataView
=
new
DataView
(
exData
.
buffer
);
dataView
.
setUint16
(
0
,
version
,
littleEndian
);
dataView
.
setUint8
(
2
,
gameId
&
0xff
);
dataView
.
setUint8
(
3
,
(
gameId
>>
8
)
&
0xff
);
dataView
.
setUint8
(
4
,
(
gameId
>>
16
)
&
0xff
);
dataView
.
setUint8
(
5
,
(
gameId
>>
32
)
&
0xff
);
exData
.
slice
(
6
,
exDataLen
).
set
(
passWd
);
dataView
.
setUint8
(
0
,
version
&
0xff
);
dataView
.
setUint8
(
1
,
(
version
>>
8
)
&
0xff
);
dataView
.
setUint8
(
2
,
0
);
dataView
.
setUint8
(
3
,
0
);
dataView
.
setUint8
(
4
,
gameId
&
0xff
);
dataView
.
setUint8
(
5
,
(
gameId
>>
8
)
&
0xff
);
dataView
.
setUint8
(
6
,
(
gameId
>>
16
)
&
0xff
);
dataView
.
setUint8
(
7
,
(
gameId
>>
32
)
&
0xff
);
exData
.
set
(
passWd
,
3
);
super
(
exData
.
length
+
1
,
CTOS_JOIN_GAME
,
exData
);
}
...
...
src/api/ocgcore/ocgAdapter/packet.ts
View file @
ffead879
...
...
@@ -20,7 +20,7 @@ export class ygoProPacket {
dataView
.
setUint16
(
0
,
this
.
packetLen
,
littleEndian
);
dataView
.
setUint8
(
2
,
this
.
proto
);
array
.
s
lice
(
3
,
this
.
packetLen
+
2
).
set
(
this
.
exData
);
array
.
s
et
(
this
.
exData
,
3
);
return
array
;
}
...
...
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