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:
Georges-Antoine Assi
2026-07-23 16:48:21 -04:00
parent a144d117e8
commit 00fe9ccddb

View File

@@ -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(