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
db791535
Commit
db791535
authored
Feb 14, 2026
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
just a bit sort
parent
029e8bb2
Pipeline
#43192
failed with stages
in 1 minute and 9 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
14 deletions
+16
-14
src/room/duel-record.ts
src/room/duel-record.ts
+2
-1
src/room/room.ts
src/room/room.ts
+12
-8
src/utility/calculate-duel-options.ts
src/utility/calculate-duel-options.ts
+2
-5
No files found.
src/room/duel-record.ts
View file @
db791535
...
...
@@ -2,6 +2,7 @@ import YGOProDeck from 'ygopro-deck-encode';
import
{
YGOProYrp
,
ReplayHeader
}
from
'
ygopro-yrp-encode
'
;
import
{
Room
}
from
'
./room
'
;
import
{
YGOProMsgBase
}
from
'
ygopro-msg-encode
'
;
import
{
calculateDuelOptions
}
from
'
../utility/calculate-duel-options
'
;
// Constants from ygopro
const
REPLAY_COMPRESSED
=
0x1
;
...
...
@@ -68,7 +69,7 @@ export class DuelRecord {
startLp
:
room
.
hostinfo
.
start_lp
,
startHand
:
room
.
hostinfo
.
start_hand
,
drawCount
:
room
.
hostinfo
.
draw_count
,
opt
:
room
.
opt
,
opt
:
calculateDuelOptions
(
room
.
hostinfo
)
,
hostDeck
:
this
.
toReplayDeck
(
this
.
players
[
0
]?.
deck
),
clientDeck
:
isTag
?
this
.
toReplayDeck
(
this
.
players
[
2
]?.
deck
)
...
...
src/room/room.ts
View file @
db791535
...
...
@@ -119,10 +119,6 @@ export class Room {
return
this
.
hostinfo
.
mode
===
2
;
}
get
opt
()
{
return
calculateDuelOptions
(
this
.
hostinfo
,
this
.
isTag
);
}
players
=
new
Array
<
Client
|
undefined
>
(
this
.
hostinfo
.
mode
===
2
?
4
:
2
);
watchers
=
new
Set
<
Client
>
();
get
playingPlayers
()
{
...
...
@@ -215,7 +211,7 @@ export class Room {
}
}
get
joinGameMessage
()
{
private
get
joinGameMessage
()
{
return
new
YGOProStocJoinGame
().
fromPartial
({
info
:
{
...
this
.
hostinfo
,
...
...
@@ -224,7 +220,7 @@ export class Room {
});
}
get
watcherSizeMessage
()
{
private
get
watcherSizeMessage
()
{
return
new
YGOProStocHsWatchChange
().
fromPartial
({
watch_count
:
this
.
watchers
.
size
,
});
...
...
@@ -354,7 +350,7 @@ export class Room {
);
}
async
sendReplays
(
client
:
Client
)
{
private
async
sendReplays
(
client
:
Client
)
{
for
(
let
i
=
0
;
i
<
this
.
duelRecords
.
length
;
i
++
)
{
const
duelRecord
=
this
.
duelRecords
[
i
];
await
client
.
sendChat
(
...
...
@@ -927,7 +923,7 @@ export class Room {
return
true
;
}
private
ocgcore
?:
OcgcoreWorker
;
ocgcore
?:
OcgcoreWorker
;
private
registry
:
Record
<
string
,
string
>
=
{};
turnCount
=
0
;
turnIngamePos
=
0
;
...
...
@@ -1592,4 +1588,12 @@ export class Room {
// TODO: teammate surrender in tag duel
return
this
.
win
({
player
:
1
-
this
.
getIngameDuelPos
(
client
),
type
:
0x0
});
}
async
getLP
(
player
:
number
):
Promise
<
number
|
undefined
>
{
if
(
!
this
.
ocgcore
)
{
return
undefined
;
}
const
info
=
await
this
.
ocgcore
.
queryFieldInfo
();
return
info
.
field
.
players
[
this
.
getIngameDuelPosByDuelPos
(
player
)].
lp
;
}
}
src/utility/calculate-duel-options.ts
View file @
db791535
...
...
@@ -7,10 +7,7 @@ import { OcgcoreDuelOptionFlag } from 'koishipro-core.js';
* @param isTag Whether this is a tag duel
* @returns Duel options number
*/
export
function
calculateDuelOptions
(
hostinfo
:
HostInfo
,
isTag
:
boolean
=
false
,
):
number
{
export
function
calculateDuelOptions
(
hostinfo
:
HostInfo
):
number
{
// duel_rule is stored in high 16 bits
let
opt
=
hostinfo
.
duel_rule
<<
16
;
...
...
@@ -18,7 +15,7 @@ export function calculateDuelOptions(
opt
|=
OcgcoreDuelOptionFlag
.
PseudoShuffle
;
}
if
(
isTag
)
{
if
(
hostinfo
.
mode
&
0x2
)
{
opt
|=
OcgcoreDuelOptionFlag
.
TagMode
;
}
...
...
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