diff --git a/migrations/users/20181002_username_email.js b/migrations/archive/2018/20181002_username_email.js similarity index 100% rename from migrations/users/20181002_username_email.js rename to migrations/archive/2018/20181002_username_email.js diff --git a/migrations/users/20181023_veteran_pet_ladder.js b/migrations/users/20181023_veteran_pet_ladder.js new file mode 100644 index 0000000000..c8cf9a094a --- /dev/null +++ b/migrations/users/20181023_veteran_pet_ladder.js @@ -0,0 +1,93 @@ +/* eslint-disable no-console */ +const MIGRATION_NAME = '20181023_veteran_pet_ladder'; +import { model as User } from '../../website/server/models/user'; + +function processUsers (lastId) { + let query = { + migration: {$ne: MIGRATION_NAME}, + 'flags.verifiedUsername': true, + }; + + let fields = { + 'items.pets': 1, + }; + + if (lastId) { + query._id = { + $gt: lastId, + }; + } + + return User.find(query) + .limit(250) + .sort({_id: 1}) + .select(fields) + .then(updateUsers) + .catch((err) => { + console.log(err); + return exiting(1, `ERROR! ${err}`); + }); +} + +let progressCount = 1000; +let count = 0; + +function updateUsers (users) { + if (!users || users.length === 0) { + console.warn('All appropriate users found and modified.'); + displayData(); + return; + } + + let userPromises = users.map(updateUser); + let lastUser = users[users.length - 1]; + + return Promise.all(userPromises) + .then(() => { + processUsers(lastUser._id); + }); +} + +function updateUser (user) { + count++; + + let set = {migration: MIGRATION_NAME}; + + if (user.items.pets['Bear-Veteran']) { + set['items.pets.Fox-Veteran'] = 5; + } else if (user.items.pets['Lion-Veteran']) { + set['items.pets.Bear-Veteran'] = 5; + } else if (user.items.pets['Tiger-Veteran']) { + set['items.pets.Lion-Veteran'] = 5; + } else if (user.items.pets['Wolf-Veteran']) { + set['items.pets.Tiger-Veteran'] = 5; + } else { + set['items.pets.Wolf-Veteran'] = 5; + } + + if (count % progressCount === 0) console.warn(`${count} ${user._id}`); + + return user.update({_id: user._id}, {$set: set}).exec(); +} + +function displayData () { + console.warn(`\n${count} users processed\n`); + return exiting(0); +} + +function exiting (code, msg) { + code = code || 0; // 0 = success + if (code && !msg) { + msg = 'ERROR!'; + } + if (msg) { + if (code) { + console.error(msg); + } else { + console.log(msg); + } + } + process.exit(code); +} + +module.exports = processUsers; diff --git a/website/client/libs/staffList.js b/website/client/libs/staffList.js index 96eb262fc3..918fb38f2a 100644 --- a/website/client/libs/staffList.js +++ b/website/client/libs/staffList.js @@ -1,44 +1,44 @@ export default [ - { - name: 'beffymaroo', - type: 'Staff', - uuid: '9fe7183a-4b79-4c15-9629-a1aee3873390', - }, - // { - // name: 'lefnire', - // type: 'Staff', - // uuid: '00000000-0000-4000-9000-000000000000', - // }, { name: 'Lemoness', type: 'Staff', uuid: '7bde7864-ebc5-4ee2-a4b7-1070d464cdb0', }, - { - name: 'paglias', - type: 'Staff', - uuid: 'ed4c688c-6652-4a92-9d03-a5a79844174a', - }, { name: 'redphoenix', type: 'Staff', uuid: 'cb46ad54-8c78-4dbc-a8ed-4e3185b2b3ff', }, + { + name: 'paglias', + type: 'Staff', + uuid: 'ed4c688c-6652-4a92-9d03-a5a79844174a', + }, { name: 'SabreCat', type: 'Staff', uuid: '7f14ed62-5408-4e1b-be83-ada62d504931', }, - { - name: 'TheHollidayInn', - type: 'Staff', - uuid: '206039c6-24e4-4b9f-8a31-61cbb9aa3f66', - }, { name: 'viirus', type: 'Staff', uuid: 'a327d7e0-1c2e-41be-9193-7b30b484413f', }, + { + name: 'beffymaroo', + type: 'Staff', + uuid: '9fe7183a-4b79-4c15-9629-a1aee3873390', + }, + { + name: 'Apollo', + type: 'Staff', + uuid: '9b2f4123-f749-4f74-85e2-ce31ce778435', + }, + { + name: 'Piyo', + type: 'Staff', + uuid: '61b2c855-0a30-444c-bcc6-1cac876460b0', + }, { name: 'It\'s Bailey', type: 'Moderator', @@ -64,11 +64,6 @@ export default [ type: 'Moderator', uuid: '28771972-ca6d-4c03-8261-e1734aa7d21d', }, - // { - // name: 'Daniel the Bard', - // type: 'Moderator', - // uuid: '1f7c4a74-03a3-4b2c-b015-112d0acbd593', - // }, { name: 'deilann 5.0.5b', type: 'Moderator', diff --git a/website/common/locales/en/pets.json b/website/common/locales/en/pets.json index 2298efc77f..15d21f403c 100644 --- a/website/common/locales/en/pets.json +++ b/website/common/locales/en/pets.json @@ -19,6 +19,7 @@ "veteranTiger": "Veteran Tiger", "veteranLion": "Veteran Lion", "veteranBear": "Veteran Bear", + "veteranFox": "Veteran Fox", "cerberusPup": "Cerberus Pup", "hydra": "Hydra", "mantisShrimp": "Mantis Shrimp", diff --git a/website/common/script/content/stable.js b/website/common/script/content/stable.js index 72507a0049..2b788813cf 100644 --- a/website/common/script/content/stable.js +++ b/website/common/script/content/stable.js @@ -71,6 +71,7 @@ let specialPets = { 'Orca-Base': 'orca', 'Bear-Veteran': 'veteranBear', 'Hippogriff-Hopeful': 'hopefulHippogriffPet', + 'Fox-Veteran': 'veteranFox', }; let specialMounts = { diff --git a/website/raw_sprites/spritesmith/npcs/npc_apollo.png b/website/raw_sprites/spritesmith/npcs/npc_apollo.png new file mode 100644 index 0000000000..16d0c64848 Binary files /dev/null and b/website/raw_sprites/spritesmith/npcs/npc_apollo.png differ diff --git a/website/raw_sprites/spritesmith/npcs/npc_piyo.png b/website/raw_sprites/spritesmith/npcs/npc_piyo.png new file mode 100644 index 0000000000..fad8a20ef0 Binary files /dev/null and b/website/raw_sprites/spritesmith/npcs/npc_piyo.png differ diff --git a/website/raw_sprites/spritesmith/npcs/npc_sabe.png b/website/raw_sprites/spritesmith/npcs/npc_sabe.png deleted file mode 100755 index 5419eeb075..0000000000 Binary files a/website/raw_sprites/spritesmith/npcs/npc_sabe.png and /dev/null differ diff --git a/website/raw_sprites/spritesmith/stable/pets/Pet-Fox-Veteran.png b/website/raw_sprites/spritesmith/stable/pets/Pet-Fox-Veteran.png new file mode 100644 index 0000000000..0677ba3afb Binary files /dev/null and b/website/raw_sprites/spritesmith/stable/pets/Pet-Fox-Veteran.png differ diff --git a/website/raw_sprites/spritesmith_large/promo_veteran_pets.png b/website/raw_sprites/spritesmith_large/promo_veteran_pets.png new file mode 100644 index 0000000000..0f2db4bddf Binary files /dev/null and b/website/raw_sprites/spritesmith_large/promo_veteran_pets.png differ diff --git a/website/server/controllers/api-v3/news.js b/website/server/controllers/api-v3/news.js index 77af70e4a8..2f822ada63 100644 --- a/website/server/controllers/api-v3/news.js +++ b/website/server/controllers/api-v3/news.js @@ -3,7 +3,7 @@ import { authWithHeaders } from '../../middlewares/auth'; let api = {}; // @TODO export this const, cannot export it from here because only routes are exported from controllers -const LAST_ANNOUNCEMENT_TITLE = 'HABITICA BLOG: WIKI, USE CASE, AND GUILD SPOTLIGHTS'; +const LAST_ANNOUNCEMENT_TITLE = 'VETERAN PETS AND NEW STAFF MEMBERS'; const worldDmg = { // @TODO bailey: false, }; @@ -30,19 +30,25 @@ api.getNews = {

${res.t('newStuff')}

-

10/18/2018 - ${LAST_ANNOUNCEMENT_TITLE}

+

10/23/2018 - ${LAST_ANNOUNCEMENT_TITLE}


-
-

Blog Post: Grand Galas

-

This month's featured Wiki article is about Habitica's Grand Galas! We hope that it will help you as you enjoy Fall Festival and look forward to our other exciting galas. Be sure to check it out, and let us know what you think by reaching out on Twitter, Tumblr, and Facebook.

-
by shanaqui and the Wiki Wizards
-
-

Use Case Spotlight and Guild Spotlight on Celebrating Yourself

-

We've got new posts on the blog all about ways to use Habitica to help with celebrating yourself and your accomplishments ! First, there's a Guild Spotlight that highlights the Guilds that can help you as you explore ways to share your triumphs. We've also posted a Use Case Spotlight featuring a number of great suggestions for using Habitica's task system and other areas to share your pride in your victories! These suggestions were submitted by Habiticans in the Use Case Spotlights Guild.

-

Plus, we're collecting user submissions for the next Use Case Spotlight! How do you use Habitica to manage healthy habits for sleep and rest? We’ll be featuring player-submitted examples in Use Case Spotlights on the Habitica Blog next month, so post your suggestions in the Use Case Spotlight Guild now. We look forward to learning more about how you use Habitica to improve your life and get things done!

-
by shanaqui
+
+

New Veteran Pet!

+

Hello Habiticans! Everyone is doing really well with the transition to our new unique username system!

+

As a reward for confirming your username, you've been granted a veteran pet! If you haven't confimed yet, your new pet will appear in your Stable as soon as you do. Which pet? That depends on how many major changes to Habitica you've been around for.

+

Enjoy, and thank you for being part of our community- it means a lot to us! <3

+
by Beffymaroo, SabreCat, Apollo, Piyo, viirus, Paglias, and TheHollidayInn
+
+
+
+

New Staff Members: Apollo and Piyo

+

We're thrilled to announce that our long-time designers Apollo and Piyo will be coming onboard as staff members! They've done a lot of beautiful work on the site and the mobile apps and we couldn't be happier to welcome them aboard. Go congratulate them in the Tavern!

+
by the Habitica Team
+
+
+
`, }); diff --git a/website/server/controllers/api-v4/auth.js b/website/server/controllers/api-v4/auth.js index 607562aca4..5b8d8540ad 100644 --- a/website/server/controllers/api-v4/auth.js +++ b/website/server/controllers/api-v4/auth.js @@ -62,7 +62,20 @@ api.updateUsername = { // save username user.auth.local.lowerCaseUsername = newUsername.toLowerCase(); user.auth.local.username = newUsername; - user.flags.verifiedUsername = true; + if (!user.flags.verifiedUsername) { + user.flags.verifiedUsername = true; + if (user.items.pets['Bear-Veteran']) { + user.items.pets['Fox-Veteran'] = 5; + } else if (user.items.pets['Lion-Veteran']) { + user.items.pets['Bear-Veteran'] = 5; + } else if (user.items.pets['Tiger-Veteran']) { + user.items.pets['Lion-Veteran'] = 5; + } else if (user.items.pets['Wolf-Veteran']) { + user.items.pets['Tiger-Veteran'] = 5; + } else { + user.items.pets['Wolf-Veteran'] = 5; + } + } await user.save(); res.respond(200, { username: req.body.username }); diff --git a/website/server/models/user/hooks.js b/website/server/models/user/hooks.js index 020dd59ebe..f85972d227 100644 --- a/website/server/models/user/hooks.js +++ b/website/server/models/user/hooks.js @@ -125,6 +125,7 @@ function _setUpNewUser (user) { let iterableFlags = user.flags.toObject(); user.items.quests.dustbunnies = 1; + user.items.pets['Wolf-Veteran'] = 5; // Thank-you for users joining during username upheaval user.purchased.background.violet = true; user.preferences.background = 'violet';