Added support for changing the PNID country on Wii U

This commit is contained in:
Jemma
2024-04-21 20:32:56 -05:00
parent 37fa5abd83
commit ccfc0589b8
2 changed files with 18 additions and 3 deletions

View File

@@ -22,6 +22,7 @@ const accountSettingsSchema = z.object({
gender: z.enum(['M', 'F']),
tz_name: z.string(),
region: z.coerce.number(),
country: z.string(),
email: z.string().email(),
server_selection: z.enum(['prod', 'test', 'dev']),
marketing_flag: z.enum(['true', 'false']).transform((value) => value === 'true'),
@@ -74,7 +75,8 @@ router.get('/ui/profile', async function (request: express.Request, response: ex
face,
notice,
accountLevel,
regions: region ? region.regions: []
regions: region ? region.regions: [],
regionsList
});
}
catch (error: any) {
@@ -160,6 +162,7 @@ router.post('/update', async function (request: express.Request, response: expre
pnid.gender = person.data.gender;
pnid.region = region;
pnid.country = person.data.country;
pnid.timezone.name = timezoneName;
pnid.timezone.offset = Number(timezone.utc_offset);
pnid.flags.marketing = person.data.marketing_flag;

View File

@@ -41,7 +41,11 @@
</div>
<div class="group">
<h2>Country</h2>
<p class="content" id="country"><%= PNID.country %></p>
<select name="country" id="country" onclick="warning()">
<% for (let region of regionsList) { %>
<option value="<%= region.iso_code %>" <% if (PNID.country === region.iso_code) { %>selected<% } %>><%= region.name %></option>
<% } %>
</select>
</div>
<div class="group">
<h2>Region</h2>
@@ -138,9 +142,17 @@
</form>
<% if (notice) { %>
<script>
alert('<%= notice %>');
wiiuDialog.alert('<%= notice %>', 'OK');
</script>
<% } %>
<script>
var seen = false;
function warning() {
if(seen) return;
seen = true;
wiiuDialog.alert('Warning: Changing your country may cause unexpected results. You may need to re-link your PNID for the changes to apply. \n\nFor more information, see:\nhttps://pretendo.network/docs/errors/PAS-727-0001', 'I Understand');
}
</script>
</body>
</html>