mirror of
https://github.com/rommapp/romm.git
synced 2026-12-04 12:52:19 +01:00
Default EmulatorJS netplay username to the RomM account
EmulatorJS keeps the netplay player name in memory only and shows its name popup whenever netplay.name is unset, forcing users to retype a name every session. Preset it from the logged-in RomM username in the existing netplay override block, so the popup is skipped and the account name is used automatically. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -393,6 +393,11 @@ window.EJS_onGameStart = async () => {
|
||||
// are in place before room polling or a Create/Join action can start.
|
||||
const netplay = window.EJS_emulator?.netplay;
|
||||
if (netplay) {
|
||||
// EmulatorJS only prompts for a player name when netplay.name is unset,
|
||||
// so presetting it adopts the RomM account username automatically.
|
||||
if (!netplay.name && authStore.user?.username) {
|
||||
netplay.name = authStore.user.username;
|
||||
}
|
||||
netplay.getOpenRooms = async () => {
|
||||
try {
|
||||
const response = await fetch(
|
||||
|
||||
Reference in New Issue
Block a user