mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-09-11 04:46:45 -05:00
Updated Mii data in account creation
This commit is contained in:
@@ -207,7 +207,7 @@ PNIDSchema.methods.updateMii = async function({name, primary, data}) {
|
||||
const miiStudioNormalFaceImageData = await got(miiStudioUrl).buffer();
|
||||
const pngData = await imagePixels(miiStudioNormalFaceImageData);
|
||||
const tga = TGA.createTgaBuffer(pngData.width, pngData.height, pngData.data);
|
||||
|
||||
|
||||
const userMiiPath = path.normalize(`${__dirname}/../../cdn/${this.get('pid')}/miis`);
|
||||
fs.ensureDirSync(userMiiPath);
|
||||
fs.writeFileSync(`${userMiiPath}/standard.tga`, tga);
|
||||
|
||||
@@ -14,6 +14,7 @@ router.get('/agreements/:type/:region/:version', clientHeaderCheck, (request, re
|
||||
response.set('X-Nintendo-Date', new Date().getTime());
|
||||
|
||||
// Registration process has started
|
||||
// eslint-disable-next-line require-atomic-updates
|
||||
request.session.registration_status = 0;
|
||||
|
||||
response.send(xmlbuilder.create({
|
||||
@@ -149,6 +150,7 @@ router.get('/time_zones/:countryCode/:language', clientHeaderCheck, (request, re
|
||||
const regionTimezones = regionLanguages[language] ? regionLanguages[language] : Object.values(regionLanguages)[0];
|
||||
|
||||
// Bump status to allow access to next endpoint
|
||||
// eslint-disable-next-line require-atomic-updates
|
||||
request.session.registration_status = 1;
|
||||
|
||||
response.send(xmlbuilder.create({
|
||||
|
||||
@@ -40,6 +40,7 @@ router.get('/:username', clientHeaderCheck, async (request, response) => {
|
||||
}
|
||||
|
||||
// Bump status to allow access to next endpoint
|
||||
// eslint-disable-next-line require-atomic-updates
|
||||
request.session.registration_status = 2;
|
||||
|
||||
response.status(200);
|
||||
@@ -95,7 +96,7 @@ router.post('/', clientHeaderCheck, async (request, response) => {
|
||||
parent: person.get('email').get('parent') === 'Y',
|
||||
reachable: false,
|
||||
validated: person.get('email').get('validated') === 'Y',
|
||||
id: Math.floor(Math.random(10000000000)*10000000000)
|
||||
id: crypto.randomBytes(4).readUInt32LE()
|
||||
},
|
||||
region: person.get('region'),
|
||||
timezone: {
|
||||
@@ -106,10 +107,10 @@ router.post('/', clientHeaderCheck, async (request, response) => {
|
||||
name: person.get('mii').get('name'),
|
||||
primary: person.get('mii').get('name') === 'Y',
|
||||
data: person.get('mii').get('data'),
|
||||
id: Math.floor(Math.random(10000000000)*10000000000),
|
||||
hash: crypto.createHash('md5').update(person.get('mii').get('data')).digest('hex'),
|
||||
image_url: 'https://mii-secure.account.nintendo.net/2rtgf01lztoqo_standard.tga',
|
||||
image_id: Math.floor(Math.random(10000000000)*10000000000)
|
||||
id: crypto.randomBytes(4).readUInt32LE(),
|
||||
hash: crypto.randomBytes(7).toString('hex'),
|
||||
image_url: '', // deprecated, will be removed in the future
|
||||
image_id: crypto.randomBytes(4).readUInt32LE()
|
||||
},
|
||||
flags: {
|
||||
active: true,
|
||||
@@ -154,7 +155,7 @@ router.post('/', clientHeaderCheck, async (request, response) => {
|
||||
);
|
||||
|
||||
delete request.session.registration_status;
|
||||
|
||||
|
||||
response.send(xmlbuilder.create({
|
||||
person: {
|
||||
pid: newUser.get('pid')
|
||||
|
||||
@@ -45,6 +45,7 @@ router.post('/validate/email', clientHeaderCheck, async (request, response) => {
|
||||
}).end());
|
||||
}
|
||||
|
||||
// eslint-disable-next-line require-atomic-updates
|
||||
request.session.registration_status = 3;
|
||||
|
||||
response.status(200);
|
||||
|
||||
Reference in New Issue
Block a user