Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro2
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
nanahira
srvpro2
Commits
88febb6f
Commit
88febb6f
authored
Feb 14, 2026
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change to include every message but filter for observe
parent
eb43a5c8
Pipeline
#43205
failed with stages
in 66 minutes and 33 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
14 deletions
+20
-14
src/feats/reconnect.ts
src/feats/reconnect.ts
+5
-5
src/room/duel-record.ts
src/room/duel-record.ts
+1
-1
src/room/room.ts
src/room/room.ts
+14
-8
No files found.
src/feats/reconnect.ts
View file @
88febb6f
...
@@ -525,7 +525,7 @@ export class Reconnect {
...
@@ -525,7 +525,7 @@ export class Reconnect {
this
.
isReconnectingPlayerOperating
(
newClient
,
room
);
// 重连玩家在操作
this
.
isReconnectingPlayerOperating
(
newClient
,
room
);
// 重连玩家在操作
if
(
needResendRequest
)
{
if
(
needResendRequest
)
{
// 重发 lastHintMsg(从
watchM
essages 找)
// 重发 lastHintMsg(从
m
essages 找)
const
lastHint
=
this
.
findLastHintForClient
(
newClient
,
room
);
const
lastHint
=
this
.
findLastHintForClient
(
newClient
,
room
);
if
(
lastHint
)
{
if
(
lastHint
)
{
await
newClient
.
send
(
await
newClient
.
send
(
...
@@ -714,8 +714,8 @@ export class Reconnect {
...
@@ -714,8 +714,8 @@ export class Reconnect {
client
:
Client
,
client
:
Client
,
room
:
Room
,
room
:
Room
,
):
YGOProMsgHint
|
undefined
{
):
YGOProMsgHint
|
undefined
{
const
watchMessages
=
room
.
lastDuelRecord
?.
watchM
essages
;
const
messages
=
room
.
lastDuelRecord
?.
m
essages
;
if
(
!
watchM
essages
)
{
if
(
!
m
essages
)
{
return
undefined
;
return
undefined
;
}
}
...
@@ -723,8 +723,8 @@ export class Reconnect {
...
@@ -723,8 +723,8 @@ export class Reconnect {
const
clientIngamePos
=
room
.
getIngameDuelPosByDuelPos
(
client
.
pos
);
const
clientIngamePos
=
room
.
getIngameDuelPosByDuelPos
(
client
.
pos
);
// 从后往前找
// 从后往前找
for
(
let
i
=
watchM
essages
.
length
-
1
;
i
>=
0
;
i
--
)
{
for
(
let
i
=
m
essages
.
length
-
1
;
i
>=
0
;
i
--
)
{
const
msg
=
watchM
essages
[
i
];
const
msg
=
m
essages
[
i
];
// 只找 Hint 消息
// 只找 Hint 消息
if
(
!
(
msg
instanceof
YGOProMsgHint
))
{
if
(
!
(
msg
instanceof
YGOProMsgHint
))
{
...
...
src/room/duel-record.ts
View file @
88febb6f
...
@@ -19,7 +19,7 @@ export class DuelRecord {
...
@@ -19,7 +19,7 @@ export class DuelRecord {
date
=
new
Date
();
date
=
new
Date
();
winPosition
?:
number
;
winPosition
?:
number
;
responses
:
Buffer
[]
=
[];
responses
:
Buffer
[]
=
[];
watchM
essages
:
YGOProMsgBase
[]
=
[];
m
essages
:
YGOProMsgBase
[]
=
[];
private
toReplayDeck
(
deck
:
YGOProDeck
|
null
|
undefined
)
{
private
toReplayDeck
(
deck
:
YGOProDeck
|
null
|
undefined
)
{
if
(
!
deck
)
{
if
(
!
deck
)
{
...
...
src/room/room.ts
View file @
88febb6f
...
@@ -311,11 +311,19 @@ export class Room {
...
@@ -311,11 +311,19 @@ export class Room {
client
.
send
(
new
YGOProStocWaitingSide
());
client
.
send
(
new
YGOProStocWaitingSide
());
}
else
if
(
this
.
duelStage
===
DuelStage
.
Dueling
)
{
}
else
if
(
this
.
duelStage
===
DuelStage
.
Dueling
)
{
// Dueling 阶段不发 DeckCount,直接发送观战消息
// Dueling 阶段不发 DeckCount,直接发送观战消息
this
.
lastDuelRecord
?.
watchMessages
.
forEach
((
message
)
=>
{
this
.
lastDuelRecord
?.
messages
client
.
send
(
.
filter
(
new
YGOProStocGameMsg
().
fromPartial
({
msg
:
message
.
observerView
()
}),
(
msg
)
=>
);
!
(
msg
instanceof
YGOProMsgResponseBase
)
&&
});
msg
.
getSendTargets
().
includes
(
NetPlayerType
.
OBSERVER
),
)
.
forEach
((
message
)
=>
{
client
.
send
(
new
YGOProStocGameMsg
().
fromPartial
({
msg
:
message
.
observerView
(),
}),
);
});
}
}
}
}
...
@@ -1549,9 +1557,7 @@ export class Room {
...
@@ -1549,9 +1557,7 @@ export class Room {
})
})
.
middleware
(
YGOProMsgBase
,
async
(
message
,
next
)
=>
{
.
middleware
(
YGOProMsgBase
,
async
(
message
,
next
)
=>
{
// record messages for replay
// record messages for replay
if
(
!
(
message
instanceof
YGOProMsgResponseBase
))
{
this
.
lastDuelRecord
.
messages
.
push
(
message
);
this
.
lastDuelRecord
.
watchMessages
.
push
(
message
);
}
return
next
();
return
next
();
})
})
.
middleware
(
YGOProMsgRetry
,
async
(
message
,
next
)
=>
{
.
middleware
(
YGOProMsgRetry
,
async
(
message
,
next
)
=>
{
...
...
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