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
7340e81b
Commit
7340e81b
authored
Aug 18, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize service
parent
89404ad6
Pipeline
#23188
passed with stages
in 9 minutes and 51 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+3
-7
src/service/onSocketMessage.ts
src/service/onSocketMessage.ts
+8
-0
No files found.
src/service/duel/gameMsg.ts
View file @
7340e81b
...
@@ -88,13 +88,9 @@ const ReplayIgnoreMsg = [
...
@@ -88,13 +88,9 @@ const ReplayIgnoreMsg = [
"
announce
"
,
"
announce
"
,
];
];
let
animation
:
Promise
<
unknown
>
=
new
Promise
<
void
>
((
rs
)
=>
rs
());
export
default
async
function
handleGameMsg
(
pb
:
ygopro
.
YgoStocMsg
,
export
default
async
function
handleGameMsg
(
pb
:
ygopro
.
YgoStocMsg
)
{
):
Promise
<
void
>
{
animation
=
animation
.
then
(()
=>
_handleGameMsg
(
pb
));
}
async
function
_handleGameMsg
(
pb
:
ygopro
.
YgoStocMsg
)
{
const
msg
=
pb
.
stoc_game_msg
;
const
msg
=
pb
.
stoc_game_msg
;
if
(
ActiveList
.
includes
(
msg
.
gameMsg
))
{
if
(
ActiveList
.
includes
(
msg
.
gameMsg
))
{
...
...
src/service/onSocketMessage.ts
View file @
7340e81b
...
@@ -28,7 +28,15 @@ import { handleWaitingSide } from "./side/waitingSide";
...
@@ -28,7 +28,15 @@ import { handleWaitingSide } from "./side/waitingSide";
* 然后再分发到各个处理函数中去处理。
* 然后再分发到各个处理函数中去处理。
*
*
* */
* */
let
animation
:
Promise
<
void
>
=
Promise
.
resolve
();
export
default
async
function
handleSocketMessage
(
e
:
MessageEvent
)
{
export
default
async
function
handleSocketMessage
(
e
:
MessageEvent
)
{
// 确保按序执行
animation
=
animation
.
then
(()
=>
_handle
(
e
));
}
async
function
_handle
(
e
:
MessageEvent
)
{
const
packet
=
YgoProPacket
.
deserialize
(
e
.
data
);
const
packet
=
YgoProPacket
.
deserialize
(
e
.
data
);
const
pb
=
adaptStoc
(
packet
);
const
pb
=
adaptStoc
(
packet
);
...
...
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