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
575de548
Commit
575de548
authored
Feb 17, 2026
by
purerosefallen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
join roomlist
parent
a2db3519
Pipeline
#43279
passed with stages
in 1 minute and 53 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
1 deletion
+71
-1
config.example.yaml
config.example.yaml
+2
-0
src/client/client-handler.ts
src/client/client-handler.ts
+3
-1
src/config.ts
src/config.ts
+6
-0
src/join-handlers/cloud-replay-join-handler.ts
src/join-handlers/cloud-replay-join-handler.ts
+5
-0
src/join-handlers/join-handler-module.ts
src/join-handlers/join-handler-module.ts
+2
-0
src/join-handlers/join-roomlist.ts
src/join-handlers/join-roomlist.ts
+53
-0
No files found.
config.example.yaml
View file @
575de548
...
@@ -61,6 +61,8 @@ chatgptSystemPrompt: 你是{{windbot}},一名与{{player}}实时互动的游
...
@@ -61,6 +61,8 @@ chatgptSystemPrompt: 你是{{windbot}},一名与{{player}}实时互动的游
chatgptTokenLimit
:
12000
chatgptTokenLimit
:
12000
chatgptExtraOpts
:
{}
chatgptExtraOpts
:
{}
enableReconnect
:
1
enableReconnect
:
1
enableCloudReplay
:
1
enableRoomlist
:
1
reconnectTimeout
:
180000
reconnectTimeout
:
180000
hidePlayerName
:
0
hidePlayerName
:
0
enableRandomDuel
:
1
enableRandomDuel
:
1
...
...
src/client/client-handler.ts
View file @
575de548
...
@@ -46,7 +46,9 @@ export class ClientHandler {
...
@@ -46,7 +46,9 @@ export class ClientHandler {
return
next
();
return
next
();
})
})
.
middleware
(
YGOProCtosJoinGame
,
async
(
msg
,
client
,
next
)
=>
{
.
middleware
(
YGOProCtosJoinGame
,
async
(
msg
,
client
,
next
)
=>
{
client
.
roompass
=
msg
.
pass
||
''
;
if
(
!
msg
.
bypassEstablished
)
{
client
.
roompass
=
msg
.
pass
||
''
;
}
return
next
();
return
next
();
})
})
.
middleware
(
.
middleware
(
...
...
src/config.ts
View file @
575de548
...
@@ -139,6 +139,12 @@ export const defaultConfig = {
...
@@ -139,6 +139,12 @@ export const defaultConfig = {
// Boolean parse rule (default true): only '0'/'false'/'null' => false, otherwise true.
// Boolean parse rule (default true): only '0'/'false'/'null' => false, otherwise true.
// Note: with default-true parsing, empty string is treated as true.
// Note: with default-true parsing, empty string is treated as true.
ENABLE_RECONNECT
:
'
1
'
,
ENABLE_RECONNECT
:
'
1
'
,
// Enable cloud replay menu entry (R/W pass handling).
// Boolean parse rule (default true): only '0'/'false'/'null' => false, otherwise true.
ENABLE_CLOUD_REPLAY
:
'
1
'
,
// Enable room list menu entry (L pass handling).
// Boolean parse rule (default true): only '0'/'false'/'null' => false, otherwise true.
ENABLE_ROOMLIST
:
'
1
'
,
// Reconnect timeout after disconnect. Format: integer string in milliseconds (ms).
// Reconnect timeout after disconnect. Format: integer string in milliseconds (ms).
RECONNECT_TIMEOUT
:
'
180000
'
,
RECONNECT_TIMEOUT
:
'
180000
'
,
// Hide player name mode in random duel rooms.
// Hide player name mode in random duel rooms.
...
...
src/join-handlers/cloud-replay-join-handler.ts
View file @
575de548
...
@@ -4,9 +4,14 @@ import { CloudReplayService } from '../feats';
...
@@ -4,9 +4,14 @@ import { CloudReplayService } from '../feats';
export
class
CloudReplayJoinHandler
{
export
class
CloudReplayJoinHandler
{
private
cloudReplayService
=
this
.
ctx
.
get
(()
=>
CloudReplayService
);
private
cloudReplayService
=
this
.
ctx
.
get
(()
=>
CloudReplayService
);
private
enabled
=
this
.
ctx
.
config
.
getBoolean
(
'
ENABLE_CLOUD_REPLAY
'
)
&&
!!
this
.
ctx
.
database
;
constructor
(
private
ctx
:
Context
)
{
constructor
(
private
ctx
:
Context
)
{
this
.
ctx
.
middleware
(
YGOProCtosJoinGame
,
async
(
msg
,
client
,
next
)
=>
{
this
.
ctx
.
middleware
(
YGOProCtosJoinGame
,
async
(
msg
,
client
,
next
)
=>
{
if
(
!
this
.
enabled
)
{
return
next
();
}
const
pass
=
(
msg
.
pass
||
''
).
trim
();
const
pass
=
(
msg
.
pass
||
''
).
trim
();
if
(
!
pass
)
{
if
(
!
pass
)
{
return
next
();
return
next
();
...
...
src/join-handlers/join-handler-module.ts
View file @
575de548
...
@@ -12,6 +12,7 @@ import { BadwordPlayerInfoChecker } from './badword-player-info-checker';
...
@@ -12,6 +12,7 @@ import { BadwordPlayerInfoChecker } from './badword-player-info-checker';
import
{
JoinBlankPassRandomDuel
}
from
'
./join-blank-pass-random-duel
'
;
import
{
JoinBlankPassRandomDuel
}
from
'
./join-blank-pass-random-duel
'
;
import
{
JoinBlankPassWindbotAi
}
from
'
./join-blank-pass-windbot-ai
'
;
import
{
JoinBlankPassWindbotAi
}
from
'
./join-blank-pass-windbot-ai
'
;
import
{
JoinBlankPassMenu
}
from
'
./join-blank-pass-menu
'
;
import
{
JoinBlankPassMenu
}
from
'
./join-blank-pass-menu
'
;
import
{
JoinRoomlist
}
from
'
./join-roomlist
'
;
export
const
JoinHandlerModule
=
createAppContext
<
ContextState
>
()
export
const
JoinHandlerModule
=
createAppContext
<
ContextState
>
()
.
provide
(
ClientVersionCheck
)
.
provide
(
ClientVersionCheck
)
...
@@ -22,6 +23,7 @@ export const JoinHandlerModule = createAppContext<ContextState>()
...
@@ -22,6 +23,7 @@ export const JoinHandlerModule = createAppContext<ContextState>()
.
provide
(
JoinWindbotAi
)
.
provide
(
JoinWindbotAi
)
.
provide
(
JoinRoomIp
)
.
provide
(
JoinRoomIp
)
.
provide
(
CloudReplayJoinHandler
)
.
provide
(
CloudReplayJoinHandler
)
.
provide
(
JoinRoomlist
)
.
provide
(
JoinRoom
)
.
provide
(
JoinRoom
)
.
provide
(
JoinBlankPassMenu
)
.
provide
(
JoinBlankPassMenu
)
.
provide
(
JoinBlankPassRandomDuel
)
.
provide
(
JoinBlankPassRandomDuel
)
...
...
src/join-handlers/join-roomlist.ts
0 → 100644
View file @
575de548
import
{
YGOProCtosJoinGame
}
from
'
ygopro-msg-encode
'
;
import
{
Context
}
from
'
../app
'
;
import
{
Client
}
from
'
../client
'
;
import
{
MenuEntry
,
MenuManager
}
from
'
../feats
'
;
import
{
RoomManager
}
from
'
../room
'
;
export
class
JoinRoomlist
{
private
logger
=
this
.
ctx
.
createLogger
(
this
.
constructor
.
name
);
private
menuManager
=
this
.
ctx
.
get
(()
=>
MenuManager
);
private
roomManager
=
this
.
ctx
.
get
(()
=>
RoomManager
);
private
enabled
=
this
.
ctx
.
config
.
getBoolean
(
'
ENABLE_ROOMLIST
'
);
constructor
(
private
ctx
:
Context
)
{
this
.
ctx
.
middleware
(
YGOProCtosJoinGame
,
async
(
msg
,
client
,
next
)
=>
{
if
(
!
this
.
enabled
)
{
return
next
();
}
const
pass
=
(
msg
.
pass
||
''
).
trim
();
if
(
!
pass
||
pass
.
toUpperCase
()
!==
'
L
'
)
{
return
next
();
}
await
this
.
openRoomListMenu
(
client
);
return
msg
;
});
}
private
async
openRoomListMenu
(
client
:
Client
)
{
const
roomNames
=
this
.
roomManager
.
allRooms
()
.
filter
((
room
)
=>
room
.
native
)
.
map
((
room
)
=>
room
.
name
);
// .sort((a, b) => a.localeCompare(b));
const
menu
:
MenuEntry
[]
=
roomNames
.
map
((
roomName
)
=>
({
title
:
roomName
,
callback
:
async
(
menuClient
)
=>
{
const
room
=
this
.
roomManager
.
findByName
(
roomName
);
if
(
!
room
||
!
room
.
native
)
{
this
.
logger
.
debug
(
{
roomName
},
'
Roomlist target room no longer exists
'
,
);
await
this
.
openRoomListMenu
(
menuClient
);
return
;
}
await
room
.
join
(
menuClient
);
},
}));
await
this
.
menuManager
.
launchMenu
(
client
,
menu
);
}
}
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