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
1aad1af3
Commit
1aad1af3
authored
Oct 23, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix chat display
parent
9e6565a6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
src/api/ocgcore/ocgAdapter/stoc/stocChat.ts
src/api/ocgcore/ocgAdapter/stoc/stocChat.ts
+3
-2
src/api/ocgcore/ocgAdapter/util.ts
src/api/ocgcore/ocgAdapter/util.ts
+1
-0
src/service/room/joinGame.ts
src/service/room/joinGame.ts
+0
-2
No files found.
src/api/ocgcore/ocgAdapter/stoc/stocChat.ts
View file @
1aad1af3
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygoProPacket
,
ygoProtobuf
}
from
"
../packet
"
;
import
{
utf8ArrayToStr
}
from
"
../util
"
;
export
default
class
StocChatPB
implements
ygoProtobuf
{
packet
:
ygoProPacket
;
...
...
@@ -11,7 +10,9 @@ export default class StocChatPB implements ygoProtobuf {
adapt
():
ygopro
.
YgoStocMsg
{
const
player
=
new
DataView
(
this
.
packet
.
exData
.
buffer
).
getInt16
(
0
,
true
);
const
msg
=
utf8ArrayToStr
(
this
.
packet
.
exData
.
slice
(
2
));
const
decoder
=
new
TextDecoder
(
"
utf-16
"
);
const
msg
=
decoder
.
decode
(
this
.
packet
.
exData
.
slice
(
2
));
return
new
ygopro
.
YgoStocMsg
({
stoc_chat
:
new
ygopro
.
StocChat
({
...
...
src/api/ocgcore/ocgAdapter/util.ts
View file @
1aad1af3
...
...
@@ -20,6 +20,7 @@ export function strEncodeUTF16(str: string) {
return
new
Uint8Array
(
buf
);
}
// currently not used, but remain.
export
function
utf8ArrayToStr
(
array
:
Uint8Array
)
{
let
out
,
i
,
len
,
c
;
let
char2
,
char3
;
...
...
src/service/room/joinGame.ts
View file @
1aad1af3
...
...
@@ -3,8 +3,6 @@ import { store } from "../../store";
import
{
setJoined
}
from
"
../../reducers/joinSlice
"
;
export
default
function
handleJoinGame
(
pb
:
ygopro
.
YgoStocMsg
)
{
console
.
log
(
"
Game joined!
"
);
const
dispatch
=
store
.
dispatch
;
const
msg
=
pb
.
stoc_join_game
;
...
...
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