mirror of
https://github.com/PretendoNetwork/miiverse-api.git
synced 2026-08-23 09:04:13 -05:00
Cleaned up old files from the repository. (hopefully) fixed the memory leak problem. Fixed pfp urls being incorrect
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"CTR_Platform_Tag": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAAAYCAMAAAAVmYlOAAAAYFBMVEXeAADeAADeAADeAADeAADeAADeAADeAADeAADeAADeAADeAADeAADeAADeAAAAAAD////iP0XrjI/76en99PTzt7ngIyrnam7um53qfH/eAADlVlvwqaz0xMb30dL53d79/Q8IAAAAEHRSTlP40fRty2/589AHbs8bBscAkjyqfwAAAXVJREFUeAG91ofuqyAAhXG6dz1sOa73f8tbIP7JzbKD+MvoUPncKprmcX2euILT8/poGtHcb1zN7d6Ix40rOl/EjqvaiSff4PoJ0NYzajMl56nS6ji14xue4shlnUGm+IKZdYx8mbpMCL5BA4P3FoBMQd22wwRgikVnAFumLnkn6IGBLxYIKTimf3X+EoA+7WkYXylI2co8JFQJpk3z6d/ANFmySrCYgK4ESQVYMqRdm1QMSu/VlPdsCTpgyhtqbKgcbBH1LMHIACQ7DcSmrB+E+j84AozUVKZWCSZOmXKWZoD5O600gFD5pOlSKgfL75kFhspBapgSTImWdDbMp5CuFOyNLkOWoAKMIw20K+dsleAAWJIu7bQ52FkAbd7OSX6wS4/v3bu1HQzmC3/Wpy2bAIyjBuC56PTW46nTSExgCWL0TNyIxKi3Hk9XviO0L8Ex8pkrU7s4VTm+4SouZ65oc1n3Jep8b+Jr4mG/5Qq2+8Ojaf4B1loD7JWMRIAAAAAASUVORK5CYII=",
|
||||
"Wii_U_Platform_Tag": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAAAYCAMAAAAVmYlOAAAAYFBMVEUAl84Al84Al84Al84Al84Al84Al84Al84Al84Al84Al84Al84Al84Al84Al84AAAD///8Al87R5/NottyazOY7p9QZn9Ho8/i22e16vd/0+fxTr9jc7PaKxeKo0+nD4O8ehbUvAAAAEHRSTlP40fRty2/589AHbs8bBscAkjyqfwAAAUZJREFUeAG9lgWCwjAURIN7MxOv3/+Wm/3ri0v7gM6PPqwFpfVhW6w4Aqtie9Ba6f2Oo7Hba3XYcUTWGzXjqMxUwYtY5ywzzjlPyZZe+qz0fPUJ0nWZQi2vCIEuRw3AfTWt1A6wFABDQbouoxQvE4AmRwvIrg4onxJS8QoNQLIDUOXsAc9grSe9tWEIYZJNDDI1GRF5xGuFLeBIIAItA5A48FvqgV4UQJIcWsgKkQ6oGzSSgwt7ICRUTDlzzcGFDigjDNucFczwQgt0gGMNpJzDCwlANqqQKU8KI4XuNUKDTPjJI2EE/FcRXiDsADQUAyKPhFI1IWcCDK+hlrxGCSCJR/JYGCJQGfN+rHmFlSp4jQARfOWxkN5AiFd9LNSWV7HWhl95dPHO1C5T8jpbtVlzRCabcf9ErfdaaX1YzKccgel8cdD6DVFutGn/B7MbAAAAAElFTkSuQmCC",
|
||||
"Both_Platform_Tag": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAAAYCAMAAAAVmYlOAAABWVBMVEXeAADeAADeAAAAl87eAADeAADeAADeAAAAl87eAADeAAAAl84Al87eAADeAAAAl87eAAAAl84Al84Al84Al84Al84Al84Al87eAAAAl87eAAAAAAD///+azOYAl87lVlv99PSKxeLnam7gIyr30dJottzum53qfH/zt7neAADrjI/R5/Pwqaz53d70xMa22e2o0+lTr9jiP0U7p9Tc7PbD4O/76en0+fwZn9Ho8/j//v7fAAB6vd8Amc8AndD1rbJkwuPtcXmN0er++fn509bvg4szsdr0+v3gAQDrXGah2e3ym6H98fLlMDzlMz02sdrd8fl6yub3wMTiGCTqWmRMud604fB4yeXb8Pn85eb8/v7vhY0AotP98PGj2u761dhhweKL0enH6fQZqdb++vrp9vruc3vgDBT1r7T1+/33wsbiGyfq9vvoSFJKuN7J6vUcqtbgCxLymJ7gw+6QAAAAHHRSTlPL8/htbc9v0G/R9PTLBxsbbtDzBm4H+c8Gx8cAm5Bs0wAAAqJJREFUeAGllgWP5DgUBnPMzJeyw5xmxmNmZmaG/y/p+nnUvszuZiBbUkyKvtJ77u4Zx3UfeviJB3U33oEXCmEjg1mYp4k9veHJ+x93Xce97zHdmbdZv1dcglvudZ2HrsP3FrxbXIrb7nFu0t35Et4vLsfNzhPdfftf+GJzSeGTzqP6SKICM6qJ1hOlzKMDlWjBnJ68Y3ka/i0MYR7HeSirMhWyqDCM6ziO06ghvNHRFgWHsYKtrBc6AdkqLYARKypt+QveKIQaQ31Yxhj8Us49H7MZN4wN4QhGksxQ6wEzPaoO4cMqaBP+Dc8Xggd5NM5hLMI8zOo5pMbeC4vMp3+10ABKrJI5RWlLi/BZeOakcXkuI4TiEFPUM3bIDpts7rUIKwY6ADD551W4+53n/mkkleCdCMWIzLa2FqFipYcMIElAn3eHH8BTNiZNa8gLKyz6xOZu57XXLkxgOSWYohTTc4Ufwh82BmAeNYQpsYy+nGdtwiUkMBoymzE8T/j5p3xSNCv08aMrhUVU9oG0RainVCx0wGpFcJ7wI/isaBL5pP8Le/b6xj1oEw6BSk8AJlcJt+YNK/yY9W/HEC+SMSa2whDKIqrNOoOwRRiA5C9goa8QLphJ01cMtOFF+PWY0aeWCufkR6Fn+lsak0xRi3CC6dwMZlcKFcy2wRRG2vAqvGIvEPpZ2YPQlJmmMfie6St5WPvEbS2V2pYmXDWFtt2wCLRh/xKvv2xD8qt+2mLxyfdfOP3Ff7QpHCWJNC5JlieTnEyO5SulAjkXvobXGileemBsVqFgW5gdzrOiwQ0d/zx9C28WXXjSebiL7zv4qujE/c4jD3QQfgM/dvLdcU+nf6J2P/D9T118t93ryr+Jt9991+WEf8LPl7fd6dz6uOv+B35/eN1IBt+CAAAAAElFTkSuQmCC",
|
||||
"No_Painting": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAIAAACQKrqGAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAECSURBVChTbZI9DoJAEIUfnkEbEyw8gr2oB4CEA8kh7C2MUStjAp2NLth4AivttFDPIL4dNutCfGHJ7MzHZH5A6eiSJHvf3wJ8aFymUxMQeTwAHlmmosgD+nHcnkzoeR8Ot93uA4zTtBuG9Ois9zRdAsfBQD6uqQiCBUCAtkbXwvH9Op0EqIn0SjKC9W3EIjcHnkoJUBMBYrr8cxxXrmee/6UJ7Hs93ex1NjM+S+e5uYsIEGvp1hx1hsNQqSwIXkVhXFZuAVaswc1tCrBtNVRVUs3EtEWLs+BEBKiJnJ0jr/pwwpzzX5oct1Ot4LfYYxSxx8ZiGRu5i7Vq/i5JYgJUWX4BvHp+Bl51PbYAAAAASUVORK5CYII=",
|
||||
"CDN_URL": "https://cnd.olv.pretendo.cc"
|
||||
}
|
||||
@@ -1,19 +1,21 @@
|
||||
const mongoose = require('mongoose');
|
||||
const { mongoose: mongooseConfig } = require('./config.json');
|
||||
const { TOPIC } = require('./models/topic');
|
||||
const { ENDPOINT } = require('./models/endpoint');
|
||||
const { COMMUNITY } = require('./models/communities');
|
||||
const { POST } = require('./models/post');
|
||||
const { USER } = require('./models/user');
|
||||
const { CONVERSATION } = require('./models/conversation');
|
||||
const { uri, database, options } = mongooseConfig;
|
||||
const logger = require('./logger');
|
||||
|
||||
let connection;
|
||||
|
||||
async function connect() {
|
||||
await mongoose.connect(`${uri}/${database}`, options);
|
||||
|
||||
connection = mongoose.connection;
|
||||
connection.on('connected', function () {
|
||||
logger.info(`MongoDB connected ${this.name}`);
|
||||
});
|
||||
connection.on('error', console.error.bind(console, 'connection error:'));
|
||||
connection.on('close', () => {
|
||||
connection.removeAllListeners();
|
||||
@@ -26,30 +28,6 @@ function verifyConnected() {
|
||||
}
|
||||
}
|
||||
|
||||
async function getTopicByName(topicName) {
|
||||
verifyConnected();
|
||||
|
||||
if (typeof topicName !== 'string') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return TOPIC.findOne({
|
||||
name: topicName
|
||||
});
|
||||
}
|
||||
|
||||
async function getTopicByCommunityID(communityID) {
|
||||
verifyConnected();
|
||||
|
||||
if (typeof communityID !== 'string') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return TOPIC.findOne({
|
||||
community_id: communityID
|
||||
});
|
||||
}
|
||||
|
||||
async function getCommunities(numberOfCommunities) {
|
||||
verifyConnected();
|
||||
if(numberOfCommunities === -1)
|
||||
@@ -160,21 +138,21 @@ async function getNumberNewCommunityPostsByID(community, number) {
|
||||
}).sort({ created_at: -1}).limit(number);
|
||||
}
|
||||
|
||||
async function getNumberPopularCommunityPostsByID(community, number) {
|
||||
async function getNumberPopularCommunityPostsByID(community, limit, offset) {
|
||||
verifyConnected();
|
||||
return POST.find({
|
||||
title_id: community.title_id,
|
||||
parent: null
|
||||
}).sort({ empathy_count: -1}).limit(number);
|
||||
}).sort({ empathy_count: -1}).skip(offset).limit(limit);
|
||||
}
|
||||
|
||||
async function getNumberVerifiedCommunityPostsByID(community, number) {
|
||||
async function getNumberVerifiedCommunityPostsByID(community, limit, offset) {
|
||||
verifyConnected();
|
||||
return POST.find({
|
||||
title_id: community.title_id,
|
||||
verified: true,
|
||||
parent: null
|
||||
}).sort({ created_at: -1}).limit(number);
|
||||
}).sort({ created_at: -1}).skip(offset).limit(limit);
|
||||
}
|
||||
|
||||
async function getPostsByCommunity(community, numberOfPosts) {
|
||||
@@ -194,12 +172,12 @@ async function getPostsByCommunityKey(community, numberOfPosts, search_key) {
|
||||
}).limit(numberOfPosts);
|
||||
}
|
||||
|
||||
async function getNewPostsByCommunity(community, numberOfPosts) {
|
||||
async function getNewPostsByCommunity(community, limit, offset) {
|
||||
verifyConnected();
|
||||
return POST.find({
|
||||
community_id: community.community_id,
|
||||
parent: null
|
||||
}).sort({ created_at: -1 }).limit(numberOfPosts);
|
||||
}).sort({ created_at: -1 }).skip(offset).limit(limit);
|
||||
}
|
||||
|
||||
async function getUserPostsAfterTimestamp(post, numberOfPosts) {
|
||||
@@ -211,6 +189,14 @@ async function getUserPostsAfterTimestamp(post, numberOfPosts) {
|
||||
}).limit(numberOfPosts);
|
||||
}
|
||||
|
||||
async function getUserPostsOffset(pid, limit, offset) {
|
||||
verifyConnected();
|
||||
return POST.find({
|
||||
pid: pid,
|
||||
parent: null
|
||||
}).sort({ created_at: -1}).skip(offset).limit(limit);
|
||||
}
|
||||
|
||||
async function getCommunityPostsAfterTimestamp(post, numberOfPosts) {
|
||||
verifyConnected();
|
||||
return POST.find({
|
||||
@@ -272,7 +258,7 @@ async function getUserByUsername(user_id) {
|
||||
verifyConnected();
|
||||
|
||||
return USER.findOne({
|
||||
user_id: new RegExp(`^${user_id}$`, 'i')
|
||||
pnid: new RegExp(`^${user_id}$`, 'i')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -304,6 +290,17 @@ async function getNewsFeedAfterTimestamp(user, numberOfPosts, post) {
|
||||
}).limit(numberOfPosts).sort({ created_at: -1});
|
||||
}
|
||||
|
||||
async function getNewsFeedOffset(user, limit, offset) {
|
||||
verifyConnected();
|
||||
return POST.find({
|
||||
$or: [
|
||||
{pid: user.followed_users},
|
||||
{pid: user.pid}
|
||||
],
|
||||
parent: null
|
||||
}).skip(offset).limit(limit).sort({ created_at: -1});
|
||||
}
|
||||
|
||||
async function getConversations(pid) {
|
||||
verifyConnected();
|
||||
return CONVERSATION.find({
|
||||
@@ -313,13 +310,24 @@ async function getConversations(pid) {
|
||||
|
||||
async function getConversation(pid, pid2) {
|
||||
verifyConnected();
|
||||
return CONVERSATION.findOne({
|
||||
pids: {
|
||||
$all: [pid, pid2]
|
||||
}
|
||||
return CONVERSATION.find({
|
||||
$and: [
|
||||
{pids: pid},
|
||||
{pids: pid2}
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
async function getLatestMessage(pid, pid2) {
|
||||
verifyConnected();
|
||||
return POST.findOne({
|
||||
$or: [
|
||||
{pid: pid, message_to_pid: pid2},
|
||||
{pid: pid2, message_to_pid: pid}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
connect,
|
||||
getCommunities,
|
||||
@@ -347,14 +355,17 @@ module.exports = {
|
||||
getUserByPID,
|
||||
getUserByUsername,
|
||||
getUserPostsAfterTimestamp,
|
||||
getUserPostsOffset,
|
||||
getCommunityPostsAfterTimestamp,
|
||||
getServerConfig,
|
||||
pushNewNotificationByPID,
|
||||
pushNewNotificationToAll,
|
||||
getNewsFeed,
|
||||
getNewsFeedAfterTimestamp,
|
||||
getNewsFeedOffset,
|
||||
getFollowingUsers,
|
||||
getFollowedUsers,
|
||||
getConversations,
|
||||
getConversation,
|
||||
};
|
||||
getLatestMessage,
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,95 +0,0 @@
|
||||
<title>Communities</title>
|
||||
<header id="header">
|
||||
<a id="header-favorites-button" href="/communities/favorites" data-pjax="#body">Favorite Communities</a>
|
||||
|
||||
<h1 id="page-title" class="left">Communities</h1>
|
||||
<div class="region dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" data-sound="SE_WAVE_BALLOON_OPEN" href="#">Americas</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a href="/communities?view_region_id=4"
|
||||
class="button checkbox-button" data-pjax="#body"
|
||||
data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Europe and Oceania</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/communities?view_region_id=1"
|
||||
class="button checkbox-button" data-pjax="#body"
|
||||
data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Japan</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/communities?view_region_id=2"
|
||||
class="button checkbox-button selected" onclick="return false;"
|
||||
data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Americas</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="body-content" id="community-top"
|
||||
data-region="USA">
|
||||
|
||||
|
||||
<div class="community-list community-list-wiiu">
|
||||
|
||||
<div class="banner-container">
|
||||
<a href="/identified_user_posts?view_region_id=2" data-pjax="#body" class="button identified-user-button">
|
||||
<span class="title">Get the latest news here!</span>
|
||||
<span class="text">Posts from Verified Users</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="headline with-filter headline-wiiu">
|
||||
<h2>New Communities</h2>
|
||||
|
||||
<div class="with-filter-right">
|
||||
<div class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" data-sound="SE_WAVE_BALLOON_OPEN" href="#">Filter</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a href="/communities/categories/wiiu_all"
|
||||
class="button" data-pjax="#body"
|
||||
data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>All Software</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/communities/categories/wiiu_game"
|
||||
class="button" data-pjax="#body"
|
||||
data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Wii U Games</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/communities/categories/wiiu_virtualconsole"
|
||||
class="button" data-pjax="#body"
|
||||
data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Virtual Console</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/communities/categories/wiiu_other"
|
||||
class="button" data-pjax="#body"
|
||||
data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Others</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
OLV_WIIU_NEW_COMMUNITIES
|
||||
<a href="/communities/categories/wiiu_all" data-pjax="#body" class="more-button scroll">Show More</a>
|
||||
|
||||
<h2 class="headline headline-special">Special</h2>
|
||||
<ul class="list-content-with-icon-column" id="community-top-content">
|
||||
</ul>
|
||||
|
||||
<div class="community-list-footer">
|
||||
<a href="/communities?view_platform=3ds" class="platform-button platform-button-3ds" data-pjax="#body">3DS Communities</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<span type="button" class="fixed-bottom-button search-button" id="community-search">Search<input name="query" class="title-search-query" minlength="2" maxlength="20" inputform="monospace" guidestring="Search Communities" data-pjax="#body"></span>
|
||||
</div>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,29 +0,0 @@
|
||||
<!--<div class="body-content post-list js-post-list" id="activity-feed">
|
||||
<div class="no-content-window content-loading-window">
|
||||
<div class="window">
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="no-content-window content-load-error-window none">
|
||||
<div class="window">
|
||||
<p>The activity feed could not be loaded. Check your Internet connection, wait a moment, and then try reloading.</p>
|
||||
<div class="window-bottom-buttons single-button">
|
||||
<a href="/" class="button" data-pjax="#body" data-pjax-replace="1">Reload</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<title>Messages</title>
|
||||
<header id="header">
|
||||
|
||||
<h1 id="page-title" class="">Messages</h1>
|
||||
|
||||
</header>
|
||||
|
||||
<div class="body-content" id="messages-list">
|
||||
<div class="no-content-window"><div class="window">
|
||||
<p>This would normally be loading the activity feed. But it has not been implemented yet. Check back later!</p>
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/wO2TLZ6Pqo4" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
</div></div>
|
||||
</div>
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<title>Messages</title>
|
||||
<header id="header">
|
||||
|
||||
<h1 id="page-title" class="">Messages</h1>
|
||||
|
||||
</header>
|
||||
|
||||
<div class="body-content" id="messages-list">
|
||||
<div class="no-content-window" id="messages"><div class="window">
|
||||
<p>In Messages, you can send messages to friends and view past messages. This isn't implemented yet. Check back later!</p>
|
||||
</div></div>
|
||||
</div>
|
||||
@@ -1,23 +0,0 @@
|
||||
<title>Notifications</title>
|
||||
<header id="header">
|
||||
|
||||
<h1 id="page-title" class="">Notifications</h1>
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
<div class="body-content tab2-content" id="news-page"><div class="tutorial-window">
|
||||
<p>Check Notifications to see how other people have reacted to your posts or comments and to see if you have any pending friend requests. If you have new notifications, an orange icon will appear to let you know.</p>
|
||||
<a href="#" class="button tutorial-close-button" data-tutorial-name="my_news">Close</a>
|
||||
</div><menu class="tab-header">
|
||||
<li id="tab-header-my-news" class="tab-button selected"><a href="/news/my_news" data-pjax=".tab-body" data-pjax-cache-container="#body" data-pjax-replace="1" data-sound="SE_WAVE_SELECT_TAB" class="tab-icon-my-news"><span>Updates</span></a></li>
|
||||
<li id="tab-header-friend-request" class="tab-button"><a href="/news/friend_requests" data-pjax=".tab-body" data-pjax-cache-container="#body" data-pjax-replace="1" data-sound="SE_WAVE_SELECT_TAB" class="tab-icon-friend-request"><span>Friend Requests</span></a></li>
|
||||
</menu>
|
||||
|
||||
<div class="tab-body">
|
||||
<div class="no-content-window"><div class="window">
|
||||
<p>No updates.</p>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,324 +0,0 @@
|
||||
<title>OLV_DISPLAY_NAME's post</title>
|
||||
<header id="header">
|
||||
<a id="header-reply-button" class="header-button reply-button" href="#" data-modal-open="#add-reply-page">Comment</a>
|
||||
|
||||
<h1 id="page-title" class="">OLV_DISPLAY_NAME's post</h1>
|
||||
|
||||
</header>
|
||||
|
||||
<div class="body-content post-subtype-default" id="post-permalink">
|
||||
<div id="post-permalink-content" class="no-empathy">
|
||||
<div id="post-permalink-header">
|
||||
|
||||
<a href="/titles/OLV_COMMUNITY_ID" data-pjax="#body" class="community"><img src="OLV_ICON_STANDIN" class="community-icon"> OLV_PAGE_TITLE_STANDIN Community</a>
|
||||
|
||||
|
||||
<a href="/titles/OLV_COMMUNITY_ID/in_game" data-pjax="#body" class="post-subtype-label post-subtype-label-via-api">In-Game</a>
|
||||
|
||||
</div>
|
||||
<div id="post-permalink-body">
|
||||
<a href="/users/OLV_DISPLAY_NAME" data-pjax="#body" class="user-icon-container"><img src="/img/OLV_USER_PFP" class="user-icon"></a>
|
||||
<p class="user-name">OLV_DISPLAY_NAME<span class="user-id"></span></p>
|
||||
<p class="timestamp">OLV_POST_TIMESTAMP
|
||||
<span class="spoiler-status">Spoilers</span><span class="played">Played</span></p>
|
||||
OLV_POST_CONTENT
|
||||
<div class="post-meta">
|
||||
<a href="#" role="button" class="report-button"
|
||||
data-modal-open="#report-violation-page"
|
||||
data-screen-name="OLV_DISPLAY_NAME"
|
||||
data-support-text="OLV_POST_ID"
|
||||
data-action="/posts/OLV_POST_ID/violations"
|
||||
data-is-post="1"
|
||||
data-is-permalink="1"
|
||||
data-can-report-spoiler="1"
|
||||
data-community-id="4490545270232728351" data-url-id="OLV_POST_ID" data-track-label="default" data-title-id="4490545270232728350" data-track-action="openReportModal" data-track-category="reportViolation"
|
||||
>Report Violation</a>
|
||||
|
||||
<div class="expression">
|
||||
<button type="button"
|
||||
class="submit miitoo-button"
|
||||
data-feeling="normal"
|
||||
data-action="/posts/OLV_POST_ID/empathies"
|
||||
data-other-empathy-count="0"
|
||||
data-sound="SE_WAVE_MII_ADD"
|
||||
data-community-id="4490545270232728351" data-url-id="OLV_POST_ID" data-track-label="default" data-title-id="4490545270232728350" data-track-action="yeah" data-track-category="empathy"
|
||||
>Yeah!</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="post-permalink-feeling">
|
||||
<p class="post-permalink-feeling-text"></p>
|
||||
<div class="post-permalink-feeling-icon-container"><a href="/users/milk-d1" data-pjax="#body"
|
||||
class="post-permalink-feeling-icon visitor" style="display: none;"
|
||||
><img src="http://game-dev-mii-images.account.nintendo.net/7106bms9fg0i_normal_face.png" class="user-icon"></a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="post-permalink-comments">
|
||||
|
||||
<ul class="post-permalink-reply">
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="add-reply-page"
|
||||
class="add-post-page none"
|
||||
data-modal-types="add-entry add-reply require-body preview-body"
|
||||
data-is-template="1">
|
||||
<header class="add-post-page-header">
|
||||
<div class="post-count-container count none js-post-count-container">
|
||||
<span class="count-description">Remaining Posts for Today</span>
|
||||
<span class="remaining-today-post-count">30</span>
|
||||
</div>
|
||||
<h1 class="page-title">Comment on OLV_DISPLAY_NAME's Post
|
||||
</h1>
|
||||
</header>
|
||||
<form method="post" action="/posts/OLV_POST_ID/replies" class="test-reply-form">
|
||||
|
||||
<div class="add-post-page-content">
|
||||
<div class="feeling-selector expression">
|
||||
<img src="http://game-dev-mii-images.account.nintendo.net/7106bms9fg0i_normal_face.png" class="icon">
|
||||
<ul class="buttons"><li
|
||||
><input type="radio" name="feeling_id" value="0" class="feeling-button-normal"
|
||||
data-mii-face-url="http://game-dev-mii-images.account.nintendo.net/7106bms9fg0i_normal_face.png" checked
|
||||
data-sound="SE_WAVE_MII_FACE_00"
|
||||
></li><li
|
||||
><input type="radio" name="feeling_id" value="1" class="feeling-button-happy"
|
||||
data-mii-face-url="http://game-dev-mii-images.account.nintendo.net/7106bms9fg0i_happy_face.png"
|
||||
data-sound="SE_WAVE_MII_FACE_01"
|
||||
></li><li
|
||||
><input type="radio" name="feeling_id" value="2" class="feeling-button-like"
|
||||
data-mii-face-url="http://game-dev-mii-images.account.nintendo.net/7106bms9fg0i_like_face.png"
|
||||
data-sound="SE_WAVE_MII_FACE_02"
|
||||
></li><li
|
||||
><input type="radio" name="feeling_id" value="3" class="feeling-button-surprised"
|
||||
data-mii-face-url="http://game-dev-mii-images.account.nintendo.net/7106bms9fg0i_surprised_face.png"
|
||||
data-sound="SE_WAVE_MII_FACE_03"
|
||||
></li><li
|
||||
><input type="radio" name="feeling_id" value="4" class="feeling-button-frustrated"
|
||||
data-mii-face-url="http://game-dev-mii-images.account.nintendo.net/7106bms9fg0i_frustrated_face.png"
|
||||
data-sound="SE_WAVE_MII_FACE_04"
|
||||
></li><li
|
||||
><input type="radio" name="feeling_id" value="5" class="feeling-button-puzzled"
|
||||
data-mii-face-url="http://game-dev-mii-images.account.nintendo.net/7106bms9fg0i_puzzled_face.png"
|
||||
data-sound="SE_WAVE_MII_FACE_05"
|
||||
></li> </ul>
|
||||
</div>
|
||||
|
||||
|
||||
<input type="hidden" name="album_image_id" value="">
|
||||
<div class="image-selector dropdown">
|
||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle" data-sound="SE_WAVE_BALLOON_OPEN"
|
||||
><img class="preview-image" src="/img/add-post-no-image.png"
|
||||
></a>
|
||||
<div class="image-selector-window dropdown-menu">
|
||||
<div class="image-selector-section-wrapper">
|
||||
<div class="image-selector-section-capture js-image-selector-section-capture">
|
||||
<label class="capture-button tv">
|
||||
<img src="/img/default-image.png" class="capture-image">
|
||||
<input type="radio" name="screenshot_type" value="tv" disabled data-sound="SE_WAVE_OK_SUB">
|
||||
</label>
|
||||
<label class="capture-button drc">
|
||||
<img src="/img/default-image.png" class="capture-image">
|
||||
<input type="radio" name="screenshot_type" value="drc" disabled data-sound="SE_WAVE_OK_SUB">
|
||||
</label>
|
||||
</div>
|
||||
<div class="image-selector-section-options">
|
||||
<div class="image-selector-section-options-content">
|
||||
<label class="image-selector-section-album-button js-select-from-album-button">
|
||||
<button type="button" data-modal-open="#album-image-selector" class="button test-select-album-image-button">Choose from Screenshot Album</button>
|
||||
<input type="radio" name="screenshot_type" value="js-album" data-value="" data-src="" class="none js-album-screenshot-type">
|
||||
</label>
|
||||
<label class="no-select-button">
|
||||
No Screenshot
|
||||
<input type="radio" name="screenshot_type" value="null" checked
|
||||
data-value="" data-src="/img/add-post-no-image.png" data-sound="SE_WAVE_CANCEL">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="screenshot" value="" disabled>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="textarea-container textarea-with-menu active-text">
|
||||
<menu class="textarea-menu">
|
||||
<li><label class="textarea-menu-text ">
|
||||
<input type="radio" name="_post_type" value="body" checked
|
||||
data-sound="">
|
||||
</label></li>
|
||||
|
||||
<li class="test-painting-tab"><label class="textarea-menu-memo">
|
||||
<input type="radio" name="_post_type" value="painting"
|
||||
data-sound="">
|
||||
</label></li>
|
||||
|
||||
</menu>
|
||||
<textarea
|
||||
type="text" name="body" class="textarea-text"
|
||||
value="" maxlength="400"
|
||||
placeholder="Add a comment here.
|
||||
*Please note that exchanging Nintendo Network IDs and friend codes is prohibited by the Miiverse Code of Conduct."></textarea>
|
||||
<div class="textarea-memo trigger" data-sound=""
|
||||
><div class="textarea-memo-preview"></div
|
||||
><input type="hidden" name="painting"></div>
|
||||
</div>
|
||||
|
||||
<label class="spoiler-button checkbox-button">
|
||||
Spoilers
|
||||
<input type="checkbox" name="is_spoiler" value="1">
|
||||
</label>
|
||||
</div>
|
||||
<input type="button" class="olv-modal-close-button fixed-bottom-button left" value="Cancel" data-sound="SE_WAVE_CANCEL">
|
||||
<input type="button" class="post-button fixed-bottom-button" value="Post"
|
||||
data-community-id="4490545270232728351" data-url-id="OLV_POST_ID" data-track-label="default" data-title-id="4490545270232728350" data-track-action="sendReply" data-track-category="reply"
|
||||
|
||||
data-post-content-type="text"
|
||||
|
||||
data-post-with-screenshot="nodata">
|
||||
</form>
|
||||
</div>
|
||||
<div id="album-image-selector"
|
||||
class="none album-image-select-page"
|
||||
data-modal-types="album-image-selector"
|
||||
data-is-template="1"
|
||||
>
|
||||
<header id="header">
|
||||
<h1 id="page-title">Your Screenshot Album</h1>
|
||||
</header>
|
||||
|
||||
<div class="body-content">
|
||||
<div class="album-content">
|
||||
<ul class="list-content-with-icon-and-text">
|
||||
<li>
|
||||
<span class="community-link">
|
||||
<span class="icon-container">
|
||||
<img src="/img/title-icon-default.png" class="icon">
|
||||
</span>
|
||||
<span class="title">GameName (UniqueID: 0x01769)</span>
|
||||
</span>
|
||||
<div class="album-list js-album-selector-page test-album-selector-page" data-page-number="1">
|
||||
<a href="#" class="album-image-link js-album-image-link test-album-images-link" data-album-image-preview-src="https://s3-ap-northeast-1.amazonaws.com/olv-d1/th/4lYWJAABqagix_NNoP"
|
||||
data-album-image-id="16309247444443572647"
|
||||
style="background-image:url(https://s3-ap-northeast-1.amazonaws.com/olv-d1/ss/4lYWJAABqagix_NNoP)">
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<input type="button" class="olv-modal-close-button fixed-bottom-button left" value="Cancel" data-sound="SE_WAVE_CANCEL">
|
||||
</div>
|
||||
<div id="report-violation-page"
|
||||
class="add-report-page window-page none"
|
||||
data-modal-types="report report-violation"
|
||||
data-is-template="1">
|
||||
<div class="window">
|
||||
<h1 class="window-title">Report Violation to Miiverse Administrators</h1>
|
||||
<form method="post" action="/posts/OLV_POST_ID/violations">
|
||||
<div class="window-body"><div class="window-body-inner message">
|
||||
<p class="description">
|
||||
You are about to report a post with content which violates the Miiverse Code of Conduct. This report will be sent to Nintendo's Miiverse administrators and not to the creator of the post. </p>
|
||||
<div class="select-content">
|
||||
<span class="select-button-label">Violation Type: </span>
|
||||
<div class="select-button"><span class="select-button-content">Please make a selection.</span>
|
||||
<select name="type" class="cannot-report-spoiler">
|
||||
<option value="" selected>Please make a selection.</option>
|
||||
<option value="1" data-track-action="Personal">Personal Information</option>
|
||||
<option value="2" data-track-action="Violent">Violent Content</option>
|
||||
<option value="3" data-track-action="Inappropriate">Inappropriate/Harmful</option>
|
||||
<option value="4" data-track-action="Hateful">Hateful/Bullying</option>
|
||||
<option value="6" data-track-action="Advertising">Advertising</option>
|
||||
<option value="5" data-track-action="Sexual">Sexually Explicit</option>
|
||||
<option value="7" data-track-action="Other">Other</option>
|
||||
</select>
|
||||
<select name="type" class="can-report-spoiler">
|
||||
<option value="" selected>Please make a selection.</option>
|
||||
<option value="spoiler" data-body-required="1" data-track-action="Spoiler">Spoiler</option>
|
||||
<option value="1" data-track-action="Personal">Personal Information</option>
|
||||
<option value="2" data-track-action="Violent">Violent Content</option>
|
||||
<option value="3" data-track-action="Inappropriate">Inappropriate/Harmful</option>
|
||||
<option value="4" data-track-action="Hateful">Hateful/Bullying</option>
|
||||
<option value="6" data-track-action="Advertising">Advertising</option>
|
||||
<option value="5" data-track-action="Sexual">Sexually Explicit</option>
|
||||
<option value="7" data-track-action="Other">Other</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<textarea name="body" class="textarea" maxlength="100" placeholder="Enter a reason for the report."></textarea>
|
||||
<p class="post-id">Post ID: 2G4-EJYR-Y38-L3W4-2M8-RRUD</p>
|
||||
</div></div>
|
||||
<div class="window-bottom-buttons">
|
||||
<input type="button" class="olv-modal-close-button button" value="Cancel" data-sound="SE_WAVE_CANCEL">
|
||||
<input type="submit" class="post-button button" value="Submit Report"
|
||||
data-community-id="4490545270232728351" data-url-id="OLV_POST_ID" data-track-label="default" data-title-id="4490545270232728350" data-track-action="openReportModal" data-track-category="reportViolation">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="edit-post-page"
|
||||
class="window-page none"
|
||||
data-modal-types="edit-post">
|
||||
<div class="window">
|
||||
<h1 class="window-title">Edit Post</h1>
|
||||
<form method="post" class="edit-post-form" action="">
|
||||
<div class="window-body"><div class="window-body-inner message">
|
||||
<div class="select-content">
|
||||
<span class="select-button-label">Select an action:</span>
|
||||
<div class="select-button"><span class="select-button-content">Select an option.</span>
|
||||
<select name="edit-type">
|
||||
<option value="" data-action="" selected>Select an option.</option>
|
||||
<option value="spoiler" data-action="/posts/OLV_POST_ID.set_spoiler" >Set as Spoiler</option>
|
||||
<option value="delete" data-action="/posts/OLV_POST_ID.delete"
|
||||
data-community-id="4490545270232728351" data-url-id="OLV_POST_ID" data-track-label="default" data-title-id="4490545270232728350" data-track-action="deletePost" data-track-category="post">
|
||||
Delete
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div></div>
|
||||
<div class="window-bottom-buttons">
|
||||
<input type="button" class="olv-modal-close-button button" value="Cancel" data-sound="SE_WAVE_CANCEL">
|
||||
<input type="submit" class="post-button button" value="Submit">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="confirm-url-page" class="window-page none" data-modal-types="confirm-url">
|
||||
<div class="window">
|
||||
<h1 class="window-title">Open Link</h1>
|
||||
<div class="window-body"><div class="window-body-inner">
|
||||
<p>This web page will be displayed in the Internet browser.<br />
|
||||
<br />
|
||||
Do you want to close Miiverse and view this web page?</p>
|
||||
<p class="link-url"></p>
|
||||
</div></div>
|
||||
<div class="window-bottom-buttons">
|
||||
<input type="button" class="olv-modal-close-button button" value="Back" data-sound="SE_WAVE_CANCEL">
|
||||
<input type="submit" class="post-button button" value="Open Link">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="disabled-report-violation-notice" class="window-page none">
|
||||
<div class="window">
|
||||
<h1 class="window-title">Report Violation to Miiverse Administrators</h1>
|
||||
<div class="window-body">
|
||||
<div class="window-body-inner">
|
||||
<p>You cannot report posts made automatically by a software title.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="window-bottom-buttons single-button">
|
||||
<input class="olv-modal-close-button button" type="button" value="Close" data-sound="SE_WAVE_CANCEL">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,411 +0,0 @@
|
||||
|
||||
|
||||
<title>Profile Settings</title>
|
||||
<header id="header">
|
||||
|
||||
<h1 id="page-title" class="">Profile Settings</h1>
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
<div class="body-content">
|
||||
<div class="settings-list-content">
|
||||
<ul class="settings-list">
|
||||
<li class="setting-profile-comment scroll">
|
||||
<p class="settings-label">Profile Comment</p>
|
||||
<form method="post" action="/settings/profile" id="profile-text-form">
|
||||
<textarea id="profile-text" name="profile_comment" maxlength="400" class="scroll-focus"
|
||||
placeholder="Write about yourself here.">
|
||||
</textarea>
|
||||
<p class="note-attention">Attention</p>
|
||||
<p class="note">Please refrain from including any of the following information:<br />
|
||||
- Your address, telephone number, e-mail address, the name of your school, or any other information that could personally identify you. <br />
|
||||
- Any information (such as a username or ID) related to an outside service, including social-network services and IDs for other game consoles.<br />
|
||||
- Links to external websites which could be used to contact you directly.<br />
|
||||
- Friend codes for systems in the Nintendo 3DS family or Nintendo Network IDs provided with the intention of registering an NNID mutually with other users.<br />
|
||||
- Any other content prohibited by the Miiverse Code of Conduct.<br />
|
||||
Posting such information is against the Miiverse Code of Conduct and may result in your profile being hidden from the public.</p>
|
||||
</form>
|
||||
</li>
|
||||
<li class="setting-profile-post scroll none-profile-post">
|
||||
<p class="settings-label">Favorite Post<span class="note">You can set one of your own handwritten posts as your favorite via the settings button of that post.</span></p>
|
||||
</li>
|
||||
<li data-name="profile_comment_visibility" class="scroll">
|
||||
<p class="settings-label">Who should be able to see your profile comment?</p>
|
||||
<a class="settings-button scroll-focus"
|
||||
href="#" data-modal-open=".settings-page[data-name='profile_comment_visibility']"
|
||||
>Wii U Friends Only
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li data-name="game_skill" class="scroll">
|
||||
<p class="settings-label">How would you describe your experience with games?</p>
|
||||
<a class="settings-button scroll-focus"
|
||||
href="#" data-modal-open=".settings-page[data-name='game_skill']"
|
||||
>Expert
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li data-name="game_skill_visibility" class="scroll">
|
||||
<p class="settings-label">Who should be able to see your experience with games?</p>
|
||||
<a class="settings-button scroll-focus"
|
||||
href="#" data-modal-open=".settings-page[data-name='game_skill_visibility']"
|
||||
>Everyone
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li data-name="birthday_visibility" class="scroll">
|
||||
<p class="settings-label">Who should be able to see your birthday?</p>
|
||||
<a class="settings-button scroll-focus"
|
||||
href="#" data-modal-open=".settings-page[data-name='birthday_visibility']"
|
||||
>Private
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li data-name="relationship_visibility" class="scroll">
|
||||
<p class="settings-label">Who should be able to see your friend list, followers, and followed users?</p>
|
||||
<a class="settings-button scroll-focus"
|
||||
href="#" data-modal-open=".settings-page[data-name='relationship_visibility']"
|
||||
>Everyone
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li data-name="profile.favorite_community_visibility" class="scroll">
|
||||
<p class="settings-label">Who do you want to be able to see your favorite communities?</p>
|
||||
<a class="settings-button scroll-focus"
|
||||
href="#" data-modal-open=".settings-page[data-name='profile.favorite_community_visibility']"
|
||||
>Everyone
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="favorite-game-genre" class="scroll">
|
||||
<p class="settings-label">What are your favorite game genres? Select up to three.</p>
|
||||
<form id="favorite-game-genre-form" action="/settings/profile" method="post">
|
||||
|
||||
<div class="select-content">
|
||||
<div class="select-button">
|
||||
<span class="select-button-content">(Leave blank)
|
||||
</span>
|
||||
<select class="scroll-focus" name="favorite_game_genre" id="favorite_game_genre_1">
|
||||
<option value="not_configured"
|
||||
selected
|
||||
|
||||
>(Leave blank)</option>
|
||||
<option value="action"
|
||||
|
||||
data-is-configurable
|
||||
>Action</option>
|
||||
<option value="adventure"
|
||||
|
||||
data-is-configurable
|
||||
>Adventure</option>
|
||||
<option value="fighting"
|
||||
|
||||
data-is-configurable
|
||||
>Fighting</option>
|
||||
<option value="puzzle"
|
||||
|
||||
data-is-configurable
|
||||
>Puzzle</option>
|
||||
<option value="racing"
|
||||
|
||||
data-is-configurable
|
||||
>Racing</option>
|
||||
<option value="rpg"
|
||||
|
||||
data-is-configurable
|
||||
>RPG</option>
|
||||
<option value="simulation"
|
||||
|
||||
data-is-configurable
|
||||
>Simulation</option>
|
||||
<option value="sports"
|
||||
|
||||
data-is-configurable
|
||||
>Sports</option>
|
||||
<option value="shooting"
|
||||
|
||||
data-is-configurable
|
||||
>Shooter</option>
|
||||
<option value="board_table"
|
||||
|
||||
data-is-configurable
|
||||
>Board Game</option>
|
||||
<option value="music"
|
||||
|
||||
data-is-configurable
|
||||
>Music</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="select-content">
|
||||
<div class="select-button">
|
||||
<span class="select-button-content">(Leave blank)
|
||||
</span>
|
||||
<select class="scroll-focus" name="favorite_game_genre" id="favorite_game_genre_2">
|
||||
<option value="not_configured"
|
||||
selected
|
||||
|
||||
>(Leave blank)</option>
|
||||
<option value="action"
|
||||
|
||||
data-is-configurable
|
||||
>Action</option>
|
||||
<option value="adventure"
|
||||
|
||||
data-is-configurable
|
||||
>Adventure</option>
|
||||
<option value="fighting"
|
||||
|
||||
data-is-configurable
|
||||
>Fighting</option>
|
||||
<option value="puzzle"
|
||||
|
||||
data-is-configurable
|
||||
>Puzzle</option>
|
||||
<option value="racing"
|
||||
|
||||
data-is-configurable
|
||||
>Racing</option>
|
||||
<option value="rpg"
|
||||
|
||||
data-is-configurable
|
||||
>RPG</option>
|
||||
<option value="simulation"
|
||||
|
||||
data-is-configurable
|
||||
>Simulation</option>
|
||||
<option value="sports"
|
||||
|
||||
data-is-configurable
|
||||
>Sports</option>
|
||||
<option value="shooting"
|
||||
|
||||
data-is-configurable
|
||||
>Shooter</option>
|
||||
<option value="board_table"
|
||||
|
||||
data-is-configurable
|
||||
>Board Game</option>
|
||||
<option value="music"
|
||||
|
||||
data-is-configurable
|
||||
>Music</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="select-content">
|
||||
<div class="select-button">
|
||||
<span class="select-button-content">(Leave blank)
|
||||
</span>
|
||||
<select class="scroll-focus" name="favorite_game_genre" id="favorite_game_genre_3">
|
||||
<option value="not_configured"
|
||||
selected
|
||||
|
||||
>(Leave blank)</option>
|
||||
<option value="action"
|
||||
|
||||
data-is-configurable
|
||||
>Action</option>
|
||||
<option value="adventure"
|
||||
|
||||
data-is-configurable
|
||||
>Adventure</option>
|
||||
<option value="fighting"
|
||||
|
||||
data-is-configurable
|
||||
>Fighting</option>
|
||||
<option value="puzzle"
|
||||
|
||||
data-is-configurable
|
||||
>Puzzle</option>
|
||||
<option value="racing"
|
||||
|
||||
data-is-configurable
|
||||
>Racing</option>
|
||||
<option value="rpg"
|
||||
|
||||
data-is-configurable
|
||||
>RPG</option>
|
||||
<option value="simulation"
|
||||
|
||||
data-is-configurable
|
||||
>Simulation</option>
|
||||
<option value="sports"
|
||||
|
||||
data-is-configurable
|
||||
>Sports</option>
|
||||
<option value="shooting"
|
||||
|
||||
data-is-configurable
|
||||
>Shooter</option>
|
||||
<option value="board_table"
|
||||
|
||||
data-is-configurable
|
||||
>Board Game</option>
|
||||
<option value="music"
|
||||
|
||||
data-is-configurable
|
||||
>Music</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-page window-page none"
|
||||
|
||||
data-modal-types="select-settings"
|
||||
data-action="/settings/profile"
|
||||
data-name="profile_comment_visibility">
|
||||
<div class="window">
|
||||
<h1 class="window-title">Profile Settings</h1>
|
||||
<div class="window-body"><div class="window-body-inner message">
|
||||
Who should be able to see your profile comment?
|
||||
</div></div>
|
||||
<div class="window-bottom-buttons scroll">
|
||||
<button class="checkbox-button post-button scroll-focus selected"
|
||||
value="1" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Everyone</button>
|
||||
<button class="checkbox-button post-button scroll-focus"
|
||||
value="2" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Wii U Friends Only</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-page window-page none"
|
||||
|
||||
data-modal-types="select-settings"
|
||||
data-action="/settings/profile"
|
||||
data-name="game_skill">
|
||||
<div class="window">
|
||||
<h1 class="window-title">Profile Settings</h1>
|
||||
<div class="window-body"><div class="window-body-inner message">
|
||||
How would you describe your experience with games?
|
||||
</div></div>
|
||||
<div class="window-bottom-buttons scroll">
|
||||
<button class="checkbox-button post-button scroll-focus"
|
||||
value="1" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Beginner</button>
|
||||
<button class="checkbox-button post-button scroll-focus"
|
||||
value="2" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Intermediate</button>
|
||||
<button class="checkbox-button post-button scroll-focus selected"
|
||||
value="3" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Expert</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-page window-page none"
|
||||
|
||||
data-modal-types="select-settings"
|
||||
data-action="/settings/profile"
|
||||
data-name="game_skill_visibility">
|
||||
<div class="window">
|
||||
<h1 class="window-title">Profile Settings</h1>
|
||||
<div class="window-body"><div class="window-body-inner message">
|
||||
Who should be able to see your experience with games?
|
||||
</div></div>
|
||||
<div class="window-bottom-buttons scroll">
|
||||
<button class="checkbox-button post-button scroll-focus selected"
|
||||
value="1" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Everyone</button>
|
||||
<button class="checkbox-button post-button scroll-focus"
|
||||
value="2" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Wii U Friends Only</button>
|
||||
<button class="checkbox-button post-button scroll-focus"
|
||||
value="3" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Private</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-page window-page none"
|
||||
|
||||
data-modal-types="select-settings"
|
||||
data-action="/settings/profile"
|
||||
data-name="birthday_visibility">
|
||||
<div class="window">
|
||||
<h1 class="window-title">Profile Settings</h1>
|
||||
<div class="window-body"><div class="window-body-inner message">
|
||||
Who should be able to see your birthday?
|
||||
</div></div>
|
||||
<div class="window-bottom-buttons scroll">
|
||||
<button class="checkbox-button post-button scroll-focus"
|
||||
value="1" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Everyone</button>
|
||||
<button class="checkbox-button post-button scroll-focus"
|
||||
value="2" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Wii U Friends Only</button>
|
||||
<button class="checkbox-button post-button scroll-focus selected"
|
||||
value="3" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Private</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-page window-page none"
|
||||
|
||||
data-modal-types="select-settings"
|
||||
data-action="/settings/profile"
|
||||
data-name="relationship_visibility">
|
||||
<div class="window">
|
||||
<h1 class="window-title">Profile Settings</h1>
|
||||
<div class="window-body"><div class="window-body-inner message">
|
||||
Who should be able to see your friend list, followers, and followed users?
|
||||
</div></div>
|
||||
<div class="window-bottom-buttons scroll">
|
||||
<button class="checkbox-button post-button scroll-focus selected"
|
||||
value="1" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Everyone</button>
|
||||
<button class="checkbox-button post-button scroll-focus"
|
||||
value="2" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Wii U Friends Only</button>
|
||||
<button class="checkbox-button post-button scroll-focus"
|
||||
value="3" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Private</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-page window-page none"
|
||||
|
||||
data-modal-types="select-settings"
|
||||
data-action="/settings/profile"
|
||||
data-name="profile_favorite_community_visibility">
|
||||
<div class="window">
|
||||
<h1 class="window-title">Profile Settings</h1>
|
||||
<div class="window-body"><div class="window-body-inner message">
|
||||
Who do you want to be able to see your favorite communities?
|
||||
</div></div>
|
||||
<div class="window-bottom-buttons scroll">
|
||||
<button class="checkbox-button post-button scroll-focus selected"
|
||||
value="1" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Everyone</button>
|
||||
<button class="checkbox-button post-button scroll-focus"
|
||||
value="2" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Wii U Friends Only</button>
|
||||
<button class="checkbox-button post-button scroll-focus"
|
||||
value="3" data-sound="SE_WAVE_TOGGLE_CHECK"
|
||||
>Private</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,200 +0,0 @@
|
||||
<div id="body">
|
||||
<header id="header">
|
||||
<h1 id="page-title" class="">User Page</h1>
|
||||
</header>
|
||||
<div class="body-content user-page is-visitor">
|
||||
<a id="header-mymenu-button" href="https://portal-us.olv.nintendo.net/my_menu" data-pjax="#body">User Menu</a>
|
||||
<div class="user-info info-content">
|
||||
<div class="user-profile-memo-container no-profile-memo">Your favorite post can be displayed here.</div>
|
||||
<span class="icon-container"><a href="/users/OLV_DISPLAY_NAME"><img src="/img/OLV_USER_PFP" class="icon"></a></span>
|
||||
|
||||
<p class="title">
|
||||
<span class="nick-name">OLV_DISPLAY_NAME</span>
|
||||
<span class="id-name"></span>
|
||||
</p>
|
||||
|
||||
<a href="/settings/profile" data-pjax="#body" class="button edit-button">Profile Settings</a>
|
||||
|
||||
</div>
|
||||
<div id="breakup-confirm-page" class="breakup-confirm-page window-page none" data-modal-types="confirm-relationship confirm-breakup" data-is-template="1">
|
||||
<div class="window user-window">
|
||||
<h1 class="window-title">Remove from Friends</h1>
|
||||
<div class="window-body"><div class="window-body-inner">
|
||||
<div class="user-container">
|
||||
<span class="icon-container"><img src="data:image/gif;base64,R0lGODlhEAAQAIAAAP%2F%2F%2FwAAACH5BAEAAAAALAAAAAAQABAAAAIOhI%2Bpy%2B0Po5y02ouzPgUAOw%3D%3D" class="icon"></span>
|
||||
<p class="nickname">
|
||||
<span class="screen-name"></span>
|
||||
<span class="id-name"></span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="message">
|
||||
<p>Remove this user from your friends? You will be removed from this user's list as well.</p>
|
||||
</div>
|
||||
</div></div>
|
||||
<div class="window-bottom-buttons">
|
||||
<input type="button" class="cancel-button button" value="Back" data-sound="SE_WAVE_CANCEL">
|
||||
<input type="button" class="post-button button" value="Yes" data-action="/users/breakup.json" data-done-msgid="olv.portal.breakup_succeeded_to">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="unfollow-confirm-page" class="unfollow-confirm-page window-page none" data-modal-types="confirm-relationship confirm-unfollow" data-is-template="1">
|
||||
<div class="window user-window">
|
||||
<h1 class="window-title">Unfollow</h1>
|
||||
<div class="window-body"><div class="window-body-inner">
|
||||
<div class="user-container">
|
||||
<span class="icon-container"><img src="data:image/gif;base64,R0lGODlhEAAQAIAAAP%2F%2F%2FwAAACH5BAEAAAAALAAAAAAQABAAAAIOhI%2Bpy%2B0Po5y02ouzPgUAOw%3D%3D" class="icon"></span>
|
||||
<p class="nickname">
|
||||
<span class="screen-name"></span>
|
||||
<span class="id-name"></span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="message">
|
||||
<p>Stop following this user?</p>
|
||||
</div>
|
||||
</div></div>
|
||||
<div class="window-bottom-buttons">
|
||||
<input type="button" class="cancel-button button" value="Back" data-sound="SE_WAVE_CANCEL">
|
||||
<input type="button" class="post-button button" value="Yes" data-done-msgid="olv.portal.unfollow_succeeded_to">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="sent-request-confirm-page" class="cancel-request-confirm-page window-page none" data-modal-types="confirm-relationship confirm-sent-request" data-is-template="1">
|
||||
<div class="window user-window">
|
||||
<h1 class="window-title">Check Friend Request</h1>
|
||||
<div class="window-body"><div class="window-body-inner">
|
||||
<div class="user-container">
|
||||
<span class="icon-container"><img src="data:image/gif;base64,R0lGODlhEAAQAIAAAP%2F%2F%2FwAAACH5BAEAAAAALAAAAAAQABAAAAIOhI%2Bpy%2B0Po5y02ouzPgUAOw%3D%3D" class="icon"></span>
|
||||
<p class="nickname">
|
||||
<span class="screen-name"></span>
|
||||
<span class="id-name"></span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="message">
|
||||
<div class="request-message">
|
||||
<p class="message-inner"></p>
|
||||
<p class="timestamp"></p>
|
||||
</div>
|
||||
<p>Cancel your friend request to this user?</p>
|
||||
</div>
|
||||
</div></div>
|
||||
<div class="window-bottom-buttons">
|
||||
<input type="button" class="cancel-button button" value="Back" data-sound="SE_WAVE_CANCEL">
|
||||
<input type="button" class="post-button button" value="Cancel Request" data-action="/users/friend_request.cancel.json" data-done-msgid="olv.portal.cancel_request_succeeded_to">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<menu class="user-menu tab-header">
|
||||
<li class="test-user-posts-count tab-button-profile"><a href="/users/OLV_USER_PID/posts" data-pjax="#body" data-sound="SE_WAVE_SELECT_TAB"><span class="label">Posts</span><span class="number">OLV_NUMBER_OF_POSTS</span></a></li>
|
||||
<li class="test-user-friends-count tab-button-activity"><a href="/users/OLV_USER_PID/friends" data-pjax="#body" data-sound="SE_WAVE_SELECT_TAB"><span class="label">Friends</span><span class="number">0 / 100</span></a></li>
|
||||
<li class="test-user-followings-count tab-button-activity"><a href="/users/OLV_USER_PID/following" data-pjax="#body" data-sound="SE_WAVE_SELECT_TAB"><span class="label">Following</span><span class="number"><span class="js-following-count">0</span> / 1000</span></a></li>
|
||||
<li class="test-user-followers-count tab-button-relationship"><a href="/users/OLV_USER_PID/followers" data-pjax="#body" data-sound="SE_WAVE_SELECT_TAB"><span class="label">Followers</span><span class="number">0</span></a></li>
|
||||
</menu>
|
||||
|
||||
<div class="tab-body">
|
||||
<div class="user-button-container with-album-button">
|
||||
<a href="/users/OLV_USER_PID/diary" data-pjax="#body" class="button scroll diary-button">View Play Journal</a>
|
||||
<a href="/users/OLV_USER_PID/album" data-pjax="#body" class="button scroll album-button">View Screenshot Album</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="profile-content">
|
||||
|
||||
<p class="text">OLV_PROFILE_COMMENT</p>
|
||||
|
||||
<div class="user-data"><table>
|
||||
<tbody><tr>
|
||||
<th><span>Country</span></th>
|
||||
<td><span>United States</span></td>
|
||||
<th class="birthday"><span>Birthday</span></th>
|
||||
<td>
|
||||
<span>01/12 </span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="game-skill">
|
||||
<th><span>Game Experience</span></th>
|
||||
<td>
|
||||
<span class="OLV_GAME_EXPERIENCE_TAG">OLV_GAME_EXPERIENCE_LABEL</span></td>
|
||||
</tr>
|
||||
<tr class="game">
|
||||
<th><span>Systems Owned</span></th>
|
||||
<td><span class="device-3ds">System in the Nintendo 3DS Family</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="favorite-game-genre">
|
||||
<th><span>Favorite Game Genres</span></th>
|
||||
<td>
|
||||
|
||||
|
||||
None selected.
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table></div>
|
||||
</div>
|
||||
<div class="favorite-communities scroll">
|
||||
<h2 class="headline">Favorite Communities</h2>
|
||||
<ul class="list-content-with-icon arrow-list">
|
||||
<li class="favorite-community empty">
|
||||
<a href="/titles/14938538520099231274/4490545270232473129" data-pjax="#body"><span class="icon-container"><img class="icon" src="https://s3-ap-northeast-1.amazonaws.com/olv-d1/cip/PlGfIaAEXikagBMY-0"></span></a>
|
||||
<span class="platform-tag platform-tag-wiiu"></span>
|
||||
|
||||
</li>
|
||||
<li class="favorite-community empty">
|
||||
<span class="icon-container"></span>
|
||||
</li>
|
||||
<li class="favorite-community empty">
|
||||
<span class="icon-container"></span>
|
||||
</li>
|
||||
<li class="favorite-community empty">
|
||||
<span class="icon-container"></span>
|
||||
</li>
|
||||
<li class="favorite-community empty">
|
||||
<span class="icon-container"></span>
|
||||
</li>
|
||||
<li class="favorite-community empty">
|
||||
<span class="icon-container"></span>
|
||||
</li>
|
||||
<li class="favorite-community empty">
|
||||
<span class="icon-container"></span>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://portal-us.olv.nintendo.net/communities/favorites" data-pjax="#body" class="arrow-button"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!--<div class="scroll test-diary-post-list" id="diary_post-post-list">
|
||||
<div class="headline"><h2>Recent Play Journal Entries</h2></div>
|
||||
<div class="no-content">
|
||||
<p>No Play Journal entries written yet.</p>
|
||||
</div>
|
||||
<a href="/users/OLV_USER_PID/diary" data-pjax="#body" class="more-button scroll">View Play Journal</a>
|
||||
</div>-->
|
||||
|
||||
<div class="scroll test-artwork-post-list" id="artwork_post-post-list">
|
||||
<div class="headline"><h2>Recent Drawings</h2></div>
|
||||
<div class="no-content">
|
||||
<p>No drawings posted yet.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<div class="js-post-list post-list scroll test-topic-post-list" id="topic_post">
|
||||
<div class="headline"><h2>Open Discussion</h2></div>
|
||||
<div class="no-content">
|
||||
<p>No open discussions.</p>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="scroll album-content test-album-images-section">
|
||||
<h2 class="headline">Recently Saved Screenshots</h2>
|
||||
<div class="no-content">
|
||||
<p>No screenshots saved yet.</p>
|
||||
</div>
|
||||
<a href="/users/OLV_USER_PID/album" data-pjax="#body" class="more-button scroll">View Screenshot Album</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,30 @@
|
||||
const { Schema, model } = require('mongoose');
|
||||
|
||||
const CommunitySchema = new Schema({
|
||||
platform_id: Number,
|
||||
name: String,
|
||||
description: String,
|
||||
open: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
/**
|
||||
* 0: Main Community
|
||||
* 1: Sub-Community
|
||||
* 2: Announcement Community
|
||||
*/
|
||||
type: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
parent: {
|
||||
type: Number,
|
||||
default: null
|
||||
},
|
||||
admins: {
|
||||
type: [String],
|
||||
default: undefined
|
||||
},
|
||||
created_at: {
|
||||
type: Date,
|
||||
default: new Date(),
|
||||
@@ -35,16 +59,10 @@ const CommunitySchema = new Schema({
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
platform_id: Number,
|
||||
name: String,
|
||||
browser_icon: String,
|
||||
browser_thumbnail: String,
|
||||
CTR_browser_header: String,
|
||||
WiiU_browser_header: String,
|
||||
description: String,
|
||||
parent: {
|
||||
type: Number,
|
||||
default: null
|
||||
}
|
||||
WiiU_browser_header: String
|
||||
});
|
||||
|
||||
CommunitySchema.methods.upEmpathy = async function() {
|
||||
@@ -80,4 +98,4 @@ const COMMUNITY = model('COMMUNITY', CommunitySchema);
|
||||
module.exports = {
|
||||
CommunitySchema,
|
||||
COMMUNITY
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,26 +1,58 @@
|
||||
const { Schema, model } = require('mongoose');
|
||||
const snowflake = require('node-snowflake').Snowflake;
|
||||
|
||||
const ConversationSchema = new Schema({
|
||||
id: {
|
||||
type: String,
|
||||
default: snowflake.nextId()
|
||||
},
|
||||
created_at: {
|
||||
type: Date,
|
||||
default: new Date(),
|
||||
},
|
||||
id: {
|
||||
type: String,
|
||||
default: 0
|
||||
last_message_sent: {
|
||||
type: Date,
|
||||
default: new Date(),
|
||||
},
|
||||
pids: [Number],
|
||||
message_preview: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
pid1: {
|
||||
pid: String,
|
||||
official: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
screen_name: String,
|
||||
read: Boolean
|
||||
},
|
||||
pid2: {
|
||||
pid: String,
|
||||
official: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
screen_name: String,
|
||||
read: Boolean
|
||||
}
|
||||
});
|
||||
|
||||
ConversationSchema.methods.addUser = async function(pid) {
|
||||
const conversation = this.get('pids');
|
||||
conversation.addToSet(pid);
|
||||
await this.save();
|
||||
}
|
||||
|
||||
ConversationSchema.methods.removeUser = async function(pid) {
|
||||
const conversation = this.get('pids');
|
||||
conversation.pull(pid);
|
||||
ConversationSchema.methods.newMessage = async function(message, fromPid) {
|
||||
const pid1 = this.get('pid1');
|
||||
const pid2 = this.get('pid2');
|
||||
if(pid1.pid === fromPid) {
|
||||
pid1.read = true
|
||||
pid2.read = false
|
||||
}
|
||||
else {
|
||||
pid1.read = false
|
||||
pid2.read = true
|
||||
}
|
||||
this.set('pid1', pid1);
|
||||
this.set('pid2', pid2);
|
||||
this.set('last_message_sent', new Date());
|
||||
this.set('message_preview', message);
|
||||
await this.save();
|
||||
}
|
||||
|
||||
@@ -29,4 +61,4 @@ const CONVERSATION = model('CONVERSATION', ConversationSchema);
|
||||
module.exports = {
|
||||
ConversationSchema: ConversationSchema,
|
||||
CONVERSATION: CONVERSATION
|
||||
};
|
||||
};
|
||||
|
||||
@@ -71,6 +71,10 @@ const PostSchema = new Schema({
|
||||
message_to_pid: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
conversation_id: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
});
|
||||
|
||||
@@ -108,4 +112,4 @@ const POST = model('POST', PostSchema);
|
||||
module.exports = {
|
||||
PostSchema,
|
||||
POST
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
const { Schema, model } = require('mongoose');
|
||||
const { PostSchema } = require('./post');
|
||||
|
||||
const titleIdsSchema = new Schema({
|
||||
title_id: String,
|
||||
});
|
||||
|
||||
const personSchema = new Schema({
|
||||
posts: {
|
||||
type: [PostSchema],
|
||||
default: undefined
|
||||
}
|
||||
});
|
||||
|
||||
const TopicSchema = new Schema({
|
||||
empathy_count: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
has_shop_page: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
icon: String,
|
||||
title_ids: {
|
||||
type: [titleIdsSchema],
|
||||
default: undefined
|
||||
},
|
||||
title_id: String,
|
||||
community_id: String,
|
||||
is_recommended: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
name: String,
|
||||
people: {
|
||||
type: [personSchema],
|
||||
default: undefined
|
||||
},
|
||||
});
|
||||
|
||||
TopicSchema.methods.upEmpathy = async function() {
|
||||
const empathy = this.get('empathy_count');
|
||||
this.set('empathy_count', empathy + 1);
|
||||
|
||||
await this.save();
|
||||
};
|
||||
|
||||
TopicSchema.methods.downEmpathy = async function() {
|
||||
const empathy = this.get('empathy_count');
|
||||
this.set('empathy_count', empathy - 1);
|
||||
|
||||
await this.save();
|
||||
};
|
||||
|
||||
TopicSchema.pre('save', async function(next) {
|
||||
if (!this.isModified('password')) {
|
||||
return next();
|
||||
}
|
||||
|
||||
this.set('usernameLower', this.get('username').toLowerCase());
|
||||
await this.generatePID();
|
||||
await this.generateNEXPassword();
|
||||
await this.generateEmailValidationCode();
|
||||
await this.generateEmailValidationToken();
|
||||
|
||||
const primaryHash = util.nintendoPasswordHash(this.get('password'), this.get('pid'));
|
||||
const hash = bcrypt.hashSync(primaryHash, 10);
|
||||
|
||||
this.set('password', hash);
|
||||
next();
|
||||
});
|
||||
|
||||
const MiiverseTopic = model('MiiverseTopic', PostSchema);
|
||||
|
||||
module.exports = {
|
||||
TopicSchema,
|
||||
MiiverseTopic
|
||||
};
|
||||
@@ -9,8 +9,9 @@ const notification = new Schema({
|
||||
|
||||
const UserSchema = new Schema({
|
||||
pid: Number,
|
||||
created_at: String,
|
||||
created_at: Date,
|
||||
user_id: String,
|
||||
pnid: String,
|
||||
birthday: Date,
|
||||
country: String,
|
||||
pfp_uri: String,
|
||||
@@ -70,19 +71,19 @@ const UserSchema = new Schema({
|
||||
default: false
|
||||
},
|
||||
likes: {
|
||||
type: [Number],
|
||||
type: [String],
|
||||
default: [0]
|
||||
},
|
||||
followed_communities: {
|
||||
type: [Number],
|
||||
type: [String],
|
||||
default: [0]
|
||||
},
|
||||
followed_users: {
|
||||
type: [Number],
|
||||
type: [String],
|
||||
default: [0]
|
||||
},
|
||||
following_users: {
|
||||
type: [Number],
|
||||
type: [String],
|
||||
default: [0]
|
||||
},
|
||||
followers: {
|
||||
@@ -250,8 +251,8 @@ UserSchema.methods.upFollower = async function() {
|
||||
|
||||
UserSchema.methods.downFollower = async function() {
|
||||
const followers = this.get('followers');
|
||||
this.set('followers', followers - 1);
|
||||
|
||||
if(followers > 0)
|
||||
this.set('followers', followers - 1);
|
||||
await this.save();
|
||||
};
|
||||
|
||||
@@ -264,8 +265,8 @@ UserSchema.methods.upFollowing = async function() {
|
||||
|
||||
UserSchema.methods.downFollowing = async function() {
|
||||
const following = this.get('following');
|
||||
this.set('following', following - 1);
|
||||
|
||||
if(following > 0)
|
||||
this.set('following', following - 1);
|
||||
await this.save();
|
||||
};
|
||||
|
||||
@@ -274,4 +275,4 @@ const USER = model('USER', UserSchema);
|
||||
module.exports = {
|
||||
UserSchema,
|
||||
USER
|
||||
};
|
||||
};
|
||||
|
||||
@@ -30,6 +30,5 @@ api.use('/v1/friend_messages', routes.MESSAGE);
|
||||
api.use('/v1/communities/', routes.COMMUNITY);
|
||||
api.use('/v1/people/', routes.PEOPLE);
|
||||
api.use('/v1/topics/', routes.TOPICS);
|
||||
discovery.use('/p01/', routes.POLICY);
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router;
|
||||
|
||||
@@ -2,55 +2,69 @@ var express = require('express');
|
||||
var router = express.Router();
|
||||
const database = require('../../../database');
|
||||
const comPostGen = require('../../../util/CommunityPostGen');
|
||||
const processHeaders = require('../../../util/authentication');
|
||||
const processHeaders = require('../../../util/util');
|
||||
|
||||
/* GET post titles. */
|
||||
router.get('/', function (req, res) {
|
||||
database.connect().then(async e => {
|
||||
const paramPack = processHeaders.data.decodeParamPack(req.headers["x-nintendo-parampack"]);
|
||||
let community = await database.getCommunityByTitleID(paramPack.title_id);
|
||||
if (community != null) {
|
||||
let response = await comPostGen.Communities(community);
|
||||
res.contentType("application/xml");
|
||||
res.send(response);
|
||||
} else {
|
||||
res.status(404);
|
||||
res.send();
|
||||
}
|
||||
|
||||
});
|
||||
router.get('/', async function (req, res) {
|
||||
const paramPack = processHeaders.data.decodeParamPack(req.headers["x-nintendo-parampack"]);
|
||||
let community = await database.getCommunityByTitleID(paramPack.title_id);
|
||||
if (community != null) {
|
||||
let response = await comPostGen.Communities(community);
|
||||
res.contentType("application/xml");
|
||||
res.send(response);
|
||||
} else {
|
||||
res.status(404);
|
||||
res.send();
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/0/posts', function (req, res) {
|
||||
database.connect().then(async e => {
|
||||
/* Parse out parameters from URL and headers */
|
||||
const paramPack = processHeaders.data.decodeParamPack(req.headers["x-nintendo-parampack"]);
|
||||
//"[0:1]=1407375153523200"
|
||||
let community = await database.getCommunityByTitleID(paramPack.title_id);
|
||||
if(community != null)
|
||||
{
|
||||
let posts;
|
||||
if(req.query.search_key)
|
||||
posts = await database.getPostsByCommunityKey(community, parseInt(req.query.limit), req.query.search_key);
|
||||
else
|
||||
posts = await database.getPostsByCommunity(community, parseInt(req.query.limit));
|
||||
router.get('/popular', async function (req, res) {
|
||||
let community = await database.getMostPopularCommunities(100);
|
||||
if (community != null) {
|
||||
res.contentType("application/json");
|
||||
res.send(community);
|
||||
} else {
|
||||
res.status(404);
|
||||
res.send();
|
||||
}
|
||||
});
|
||||
|
||||
/* Build formatted response and send it off. */
|
||||
let response;
|
||||
if(req.query.with_mii === 1)
|
||||
response = await comPostGen.PostsResponseWithMii(posts, community);
|
||||
else
|
||||
response = await comPostGen.PostsResponse(posts, community);
|
||||
res.contentType("application/xml");
|
||||
res.send(response);
|
||||
}
|
||||
router.get('/new', async function (req, res) {
|
||||
let community = await database.getNewCommunities(100);
|
||||
if (community != null) {
|
||||
res.contentType("application/json");
|
||||
res.send(community);
|
||||
} else {
|
||||
res.status(404);
|
||||
res.send();
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/0/posts', async function (req, res) {
|
||||
const paramPack = processHeaders.data.decodeParamPack(req.headers["x-nintendo-parampack"]);
|
||||
let community = await database.getCommunityByTitleID(paramPack.title_id);
|
||||
if(community != null)
|
||||
{
|
||||
let posts;
|
||||
if(req.query.search_key)
|
||||
posts = await database.getPostsByCommunityKey(community, parseInt(req.query.limit), req.query.search_key);
|
||||
else
|
||||
{
|
||||
res.status(404);
|
||||
res.send();
|
||||
}
|
||||
posts = await database.getPostsByCommunity(community, parseInt(req.query.limit));
|
||||
|
||||
});
|
||||
/* Build formatted response and send it off. */
|
||||
let response;
|
||||
if(req.query.with_mii === 1)
|
||||
response = await comPostGen.PostsResponseWithMii(posts, community);
|
||||
else
|
||||
response = await comPostGen.PostsResponse(posts, community);
|
||||
res.contentType("application/xml");
|
||||
res.send(response);
|
||||
}
|
||||
else
|
||||
{
|
||||
res.status(404);
|
||||
res.send();
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router;
|
||||
|
||||
@@ -1,83 +1,24 @@
|
||||
var express = require('express');
|
||||
var xml = require('object-to-xml');
|
||||
const database = require('../../../database');
|
||||
const util = require('../../../util/authentication');
|
||||
const util = require('../../../util/util');
|
||||
var router = express.Router();
|
||||
|
||||
/* GET discovery server. */
|
||||
router.get('/', function (req, res) {
|
||||
database.connect().then(async e => {
|
||||
const discovery = await database.getDiscoveryHosts();
|
||||
try
|
||||
router.get('/', async function (req, res) {
|
||||
const discovery = await database.getDiscoveryHosts();
|
||||
try
|
||||
{
|
||||
let pid = util.data.processServiceToken(req.headers["x-nintendo-servicetoken"]);
|
||||
let usrObj;
|
||||
if(pid == null)
|
||||
{
|
||||
let pid = util.data.processServiceToken(req.headers["x-nintendo-servicetoken"]);
|
||||
let usrObj;
|
||||
if(pid == null)
|
||||
{
|
||||
throw new Error('The User token was not valid');
|
||||
}
|
||||
else
|
||||
{
|
||||
usrObj = await util.data.processUser(pid);
|
||||
switch (usrObj.account_status) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 7,
|
||||
message: "POSTING_FROM_NNID"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error('The User token was not valid');
|
||||
}
|
||||
catch (e)
|
||||
else
|
||||
{
|
||||
console.error(e);
|
||||
}
|
||||
switch(discovery.has_error)
|
||||
{
|
||||
case 0 :
|
||||
res.set("Content-Type", "application/xml");
|
||||
response = {
|
||||
result: {
|
||||
has_error: 0,
|
||||
version: discovery.version,
|
||||
endpoint: {
|
||||
host: discovery.endpoint.host,
|
||||
api_host: discovery.endpoint.api_host,
|
||||
portal_host: discovery.endpoint.portal_host,
|
||||
n3ds_host: discovery.endpoint.n3ds_host
|
||||
}
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
case 1 :
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 1,
|
||||
message: "SYSTEM_UPDATE_REQUIRED"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
case 2 :
|
||||
usrObj = await util.data.processUser(pid);
|
||||
if(!usrObj) {
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
@@ -89,108 +30,165 @@ router.get('/', function (req, res) {
|
||||
message: "SETUP_NOT_COMPLETE"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
case 3 :
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 3,
|
||||
message: "SERVICE_MAINTENANCE"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
case 4:
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 4,
|
||||
message: "SERVICE_CLOSED"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
case 5 :
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 5,
|
||||
message: "PARENTAL_CONTROLS_ENABLED"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
case 6 :
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 6,
|
||||
message: "POSTING_LIMITED_PARENTAL_CONTROLS"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
case 7 :
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 7,
|
||||
message: "PNID_BANNED"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
default :
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 15,
|
||||
message: "SERVER_ERROR"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
return res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
}
|
||||
switch (usrObj.account_status) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 7,
|
||||
message: "POSTING_FROM_NNID"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
}
|
||||
}
|
||||
|
||||
}).catch(error => {
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 15,
|
||||
message: "SERVER_ERROR"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
});
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
console.error(e);
|
||||
}
|
||||
switch(discovery.has_error)
|
||||
{
|
||||
case 0 :
|
||||
res.set("Content-Type", "application/xml");
|
||||
response = {
|
||||
result: {
|
||||
has_error: 0,
|
||||
version: discovery.version,
|
||||
endpoint: {
|
||||
host: discovery.endpoint.host,
|
||||
api_host: discovery.endpoint.api_host,
|
||||
portal_host: discovery.endpoint.portal_host,
|
||||
n3ds_host: discovery.endpoint.n3ds_host
|
||||
}
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
case 1 :
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 1,
|
||||
message: "SYSTEM_UPDATE_REQUIRED"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
case 2 :
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 2,
|
||||
message: "SETUP_NOT_COMPLETE"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
case 3 :
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 3,
|
||||
message: "SERVICE_MAINTENANCE"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
case 4:
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 4,
|
||||
message: "SERVICE_CLOSED"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
case 5 :
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 5,
|
||||
message: "PARENTAL_CONTROLS_ENABLED"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
case 6 :
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 6,
|
||||
message: "POSTING_LIMITED_PARENTAL_CONTROLS"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
case 7 :
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 7,
|
||||
message: "PNID_BANNED"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
default :
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 15,
|
||||
message: "SERVER_ERROR"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
router.post('/posts', function (req, res) {
|
||||
|
||||
@@ -4,6 +4,5 @@ module.exports = {
|
||||
MESSAGE: require('./message'),
|
||||
COMMUNITY: require('./communities'),
|
||||
PEOPLE: require('./people'),
|
||||
POLICY: require('./policyLists'),
|
||||
TOPICS: require('./topics')
|
||||
};
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ const moment = require('moment');
|
||||
var xml = require('object-to-xml');
|
||||
const { POST } = require('../../../models/post');
|
||||
const { CONVERSATION } = require('../../../models/conversation');
|
||||
const util = require('../../../util/authentication');
|
||||
const util = require('../../../util/util');
|
||||
const database = require('../../../database');
|
||||
var multer = require('multer');
|
||||
const snowflake = require('node-snowflake').Snowflake;
|
||||
@@ -22,68 +22,116 @@ router.post('/', upload.none(), async function (req, res, next) {
|
||||
}
|
||||
else
|
||||
{
|
||||
database.connect().then(async fun => {
|
||||
let conversation = await database.getConversation(pid.toString(), req.body.message_to_pid.toString())
|
||||
if(!conversation) {
|
||||
let user = await database.getUserByPID(pid);
|
||||
let user2 = await database.getUserByPID(req.body.message_to_pid);
|
||||
if(!user || !user2)
|
||||
return res.sendStatus(422)
|
||||
let doc = {
|
||||
message_preview: req.body.body,
|
||||
pids: [
|
||||
{
|
||||
pid: user.pid.toString(),
|
||||
official: user.official,
|
||||
screen_name: user.user_id,
|
||||
read: true
|
||||
},
|
||||
{
|
||||
pid: user2.pid.toString(),
|
||||
official: user2.official,
|
||||
screen_name: user2.user_id,
|
||||
read: false
|
||||
}
|
||||
]
|
||||
}
|
||||
const newConversation = new CONVERSATION(doc);
|
||||
await newConversation.save();
|
||||
}
|
||||
else {
|
||||
let messageType = '';
|
||||
if(req.body.screenshot)
|
||||
messageType = '(Screenshot)';
|
||||
else if(req.body.painting)
|
||||
messageType = '(Drawing)';
|
||||
else
|
||||
messageType = req.body.body;
|
||||
await conversation.newMessage(messageType, req.pid.toString())
|
||||
}
|
||||
conversation = await database.getConversation(pid.toString(), req.body.message_to_pid.toString())
|
||||
let user = await util.data.processUser(pid);
|
||||
let appData = "";
|
||||
if (req.body.app_data) {
|
||||
appData = req.body.app_data.replace(/\0/g, "").trim();
|
||||
}
|
||||
let painting = "";
|
||||
if (req.body.painting) {
|
||||
painting = req.body.painting.replace(/\0/g, "").trim();
|
||||
}
|
||||
let paintingURI = "";
|
||||
if (req.body.painting) {
|
||||
paintingURI = await util.data.processPainting(painting);
|
||||
}
|
||||
let screenshot = "";
|
||||
if (req.body.screenshot) {
|
||||
screenshot = req.body.screenshot.replace(/\0/g, "").trim();
|
||||
}
|
||||
|
||||
let conversation = await database.getConversation(pid, req.body.message_to_pid)
|
||||
if(!conversation) {
|
||||
let doc = {
|
||||
created_at: new Date(),
|
||||
id: snowflake.nextId(),
|
||||
pids: [pid, req.body.message_to_pid]
|
||||
}
|
||||
const newConversation = new CONVERSATION(doc);
|
||||
newConversation.save();
|
||||
}
|
||||
let miiFace;
|
||||
console.log(parseInt(req.body.feeling_id))
|
||||
switch (parseInt(req.body.feeling_id)) {
|
||||
case 1:
|
||||
miiFace = 'smile_open_mouth.png';
|
||||
break;
|
||||
case 2:
|
||||
miiFace = 'wink_left.png';
|
||||
break;
|
||||
case 3:
|
||||
miiFace = 'surprise_open_mouth.png';
|
||||
break;
|
||||
case 4:
|
||||
miiFace = 'frustrated.png';
|
||||
break;
|
||||
case 5:
|
||||
miiFace = 'sorrow.png';
|
||||
break;
|
||||
default:
|
||||
miiFace = 'normal_face.png';
|
||||
break;
|
||||
}
|
||||
|
||||
let user = await util.data.processUser(pid);
|
||||
let appData = "";
|
||||
if (req.body.app_data) {
|
||||
appData = req.body.app_data.replace(/\0/g, "").trim();
|
||||
}
|
||||
let painting = "";
|
||||
if (req.body.painting) {
|
||||
painting = req.body.painting.replace(/\0/g, "").trim();
|
||||
}
|
||||
let paintingURI = "";
|
||||
if (req.body.painting) {
|
||||
paintingURI = await util.data.processPainting(painting);
|
||||
}
|
||||
let screenshot = "";
|
||||
if (req.body.screenshot) {
|
||||
screenshot = req.body.screenshot.replace(/\0/g, "").trim();
|
||||
}
|
||||
const document = {
|
||||
title_id: paramPackData.title_id,
|
||||
screen_name: user.user_id,
|
||||
body: req.body.body,
|
||||
app_data: appData,
|
||||
painting: painting,
|
||||
painting_uri: paintingURI,
|
||||
screenshot: screenshot,
|
||||
url: req.body.url,
|
||||
search_key: req.body.search_key,
|
||||
topic_tag: req.body.topic_tag,
|
||||
country_id: paramPackData.country_id,
|
||||
created_at: new Date(),
|
||||
feeling_id: req.body.feeling_id,
|
||||
id: snowflake.nextId(),
|
||||
is_autopost: req.body.is_autopost,
|
||||
is_spoiler: req.body.is_spoiler,
|
||||
is_app_jumpable: req.body.is_app_jumpable,
|
||||
language_id: req.body.language_id,
|
||||
mii: user.mii,
|
||||
mii_face_url: `https://mii-images.cdn.pretendo.cc/${user.pid}/normal_face.png`,
|
||||
pid: user.pid,
|
||||
verified: user.official,
|
||||
platform_id: paramPackData.platform_id,
|
||||
region_id: paramPackData.region_id,
|
||||
parent: null,
|
||||
message_to_pid: req.body.message_to_pid
|
||||
};
|
||||
const newPost = new POST(document);
|
||||
newPost.save();
|
||||
res.sendStatus(200);
|
||||
});
|
||||
const document = {
|
||||
title_id: paramPackData.title_id,
|
||||
screen_name: user.user_id,
|
||||
body: req.body.body,
|
||||
app_data: appData,
|
||||
painting: painting,
|
||||
painting_uri: paintingURI,
|
||||
screenshot: screenshot,
|
||||
url: req.body.url,
|
||||
search_key: req.body.search_key,
|
||||
topic_tag: req.body.topic_tag,
|
||||
country_id: paramPackData.country_id,
|
||||
created_at: new Date(),
|
||||
feeling_id: req.body.feeling_id,
|
||||
id: snowflake.nextId(),
|
||||
is_autopost: req.body.is_autopost,
|
||||
is_spoiler: req.body.is_spoiler,
|
||||
is_app_jumpable: req.body.is_app_jumpable,
|
||||
language_id: req.body.language_id,
|
||||
mii: user.mii,
|
||||
mii_face_url: `http://mii.olv.pretendo.cc/mii/${user.pid}/${miiFace}`,
|
||||
pid: user.pid,
|
||||
verified: user.official,
|
||||
platform_id: paramPackData.platform_id,
|
||||
region_id: paramPackData.region_id,
|
||||
parent: null,
|
||||
message_to_pid: req.body.message_to_pid,
|
||||
conversation_id: conversation.id
|
||||
};
|
||||
const newPost = new POST(document);
|
||||
newPost.save();
|
||||
res.sendStatus(200);
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
@@ -105,24 +153,22 @@ router.post('/', upload.none(), async function (req, res, next) {
|
||||
|
||||
});
|
||||
|
||||
router.post('/:post_id/empathies', upload.none(), function (req, res, next) {
|
||||
router.post('/:post_id/empathies', upload.none(), async function (req, res, next) {
|
||||
let pid = util.data.processServiceToken(req.headers["x-nintendo-servicetoken"]);
|
||||
database.connect().then(async emp => {
|
||||
const post = await database.getPostByID(req.params.post_id);
|
||||
if(pid === null) {
|
||||
res.sendStatus(403);
|
||||
return;
|
||||
}
|
||||
let user = await database.getUserByPID(pid);
|
||||
if(user.likes.indexOf(post.id) === -1 && user.id !== post.pid)
|
||||
{
|
||||
post.upEmpathy();
|
||||
user.addToLikes(post.id)
|
||||
res.sendStatus(200);
|
||||
}
|
||||
else
|
||||
res.sendStatus(403);
|
||||
});
|
||||
const post = await database.getPostByID(req.params.post_id);
|
||||
if(pid === null) {
|
||||
res.sendStatus(403);
|
||||
return;
|
||||
}
|
||||
let user = await database.getUserByPID(pid);
|
||||
if(user.likes.indexOf(post.id) === -1 && user.id !== post.pid)
|
||||
{
|
||||
post.upEmpathy();
|
||||
user.addToLikes(post.id)
|
||||
res.sendStatus(200);
|
||||
}
|
||||
else
|
||||
res.sendStatus(403);
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router;
|
||||
|
||||
@@ -2,39 +2,33 @@ var express = require('express');
|
||||
var router = express.Router();
|
||||
const database = require('../../../database');
|
||||
const pplPostGen = require('../../../util/peoplePostGen');
|
||||
const processHeaders = require('../../../util/authentication');
|
||||
const processHeaders = require('../../../util/util');
|
||||
|
||||
/* GET post titles. */
|
||||
router.get('/', function (req, res) {
|
||||
database.connect().then(async e => {
|
||||
/* Parse out parameters from URL and headers */
|
||||
//const paramPack = processHeaders.data.decodeParamPack(req.headers["x-nintendo-parampack"]);
|
||||
//"[0:1]=1407375153523200"
|
||||
let community = await database.getCommunityByTitleID(1407375153321472);
|
||||
if(community != null)
|
||||
{
|
||||
let posts;
|
||||
if(req.query.search_key)
|
||||
posts = await database.getPostsByCommunityKey(community, parseInt(req.query.limit), req.query.search_key);
|
||||
else
|
||||
posts = await database.getPostsByCommunity(community, parseInt(req.query.limit));
|
||||
|
||||
/* Build formatted response and send it off. */
|
||||
let response;
|
||||
if(req.query.with_mii === 1)
|
||||
response = await pplPostGen.PostsResponseWithMii(posts, community);
|
||||
else
|
||||
response = await pplPostGen.PostsResponse(posts, community);
|
||||
res.contentType("application/xml");
|
||||
res.send(response);
|
||||
}
|
||||
router.get('/', async function (req, res) {
|
||||
let community = await database.getCommunityByTitleID(1407375153321472);
|
||||
if(community != null)
|
||||
{
|
||||
let posts;
|
||||
if(req.query.search_key)
|
||||
posts = await database.getPostsByCommunityKey(community, parseInt(req.query.limit), req.query.search_key);
|
||||
else
|
||||
{
|
||||
res.status(404);
|
||||
res.send();
|
||||
}
|
||||
posts = await database.getPostsByCommunity(community, parseInt(req.query.limit));
|
||||
|
||||
});
|
||||
/* Build formatted response and send it off. */
|
||||
let response;
|
||||
if(req.query.with_mii === 1)
|
||||
response = await pplPostGen.PostsResponseWithMii(posts, community);
|
||||
else
|
||||
response = await pplPostGen.PostsResponse(posts, community);
|
||||
res.contentType("application/xml");
|
||||
res.send(response);
|
||||
}
|
||||
else
|
||||
{
|
||||
res.status(404);
|
||||
res.send();
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router;
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
var express = require('express');
|
||||
var router = express.Router();
|
||||
const xmlbuilder = require("xmlbuilder");
|
||||
var multer = require('multer');
|
||||
var upload = multer();
|
||||
|
||||
router.get('/policylist/1/1/US', upload.none(), async function (req, res, next) {
|
||||
let xml = xmlbuilder.create("result")
|
||||
.e("has_error", "0").up()
|
||||
.e("version", "1").up()
|
||||
.e("request_name", "posts").up()
|
||||
.e("topic")
|
||||
.e("community_id", community.community_id).up()
|
||||
.up()
|
||||
.e("posts");
|
||||
let response = {
|
||||
MajorVersion: 1,
|
||||
MinorVersion: 0,
|
||||
ListId: 1924,
|
||||
DefaultStop: false,
|
||||
ForceVersionUp: true,
|
||||
UpdateTime: '2020-03-03T02:51:02+0000',
|
||||
Priority: {
|
||||
TitleId: '0005003010016000',
|
||||
TaskId: 'olvinfo',
|
||||
Level: 'EXPEDITE',
|
||||
},
|
||||
Priority: {
|
||||
TitleId: '0005003010016100',
|
||||
TaskId: 'olvinfo',
|
||||
Level: 'EXPEDITE',
|
||||
},
|
||||
Priority: {
|
||||
TitleId: '0005003010016200',
|
||||
TaskId: 'olvinfo',
|
||||
Level: 'EXPEDITE',
|
||||
},
|
||||
Priority: {
|
||||
TitleId: '000500301001600a',
|
||||
TaskId: 'olv1',
|
||||
Level: 'EXPEDITE',
|
||||
},
|
||||
Priority: {
|
||||
TitleId: '000500301001610a',
|
||||
TaskId: 'olv1',
|
||||
Level: 'EXPEDITE',
|
||||
},
|
||||
Priority: {
|
||||
TitleId: '000500301001620a',
|
||||
TaskId: 'olv1',
|
||||
Level: 'EXPEDITE',
|
||||
},
|
||||
Priority: {
|
||||
TitleId: '0005001010040000',
|
||||
TaskId: 'oltopic',
|
||||
Level: 'EXPEDITE',
|
||||
},
|
||||
Priority: {
|
||||
TitleId: '0005001010040100',
|
||||
TaskId: 'oltopic',
|
||||
Level: 'EXPEDITE',
|
||||
},
|
||||
Priority: {
|
||||
TitleId: '0005001010040200',
|
||||
TaskId: 'oltopic',
|
||||
Level: 'EXPEDITE',
|
||||
},
|
||||
Priority: {
|
||||
TitleId: '000500101005a000',
|
||||
TaskId: 'Chat',
|
||||
Level: 'EXPEDITE',
|
||||
},
|
||||
Priority: {
|
||||
TitleId: '000500101005a100',
|
||||
TaskId: 'Chat',
|
||||
Level: 'EXPEDITE',
|
||||
},
|
||||
Priority: {
|
||||
TitleId: '000500101005a200',
|
||||
TaskId: 'Chat',
|
||||
Level: 'EXPEDITE',
|
||||
},
|
||||
Priority: {
|
||||
TitleId: '000500101004c100',
|
||||
TaskId: 'plog',
|
||||
Level: 'EXPEDITE',
|
||||
},
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
@@ -3,7 +3,7 @@ var router = express.Router();
|
||||
const moment = require('moment');
|
||||
var xml = require('object-to-xml');
|
||||
const { POST } = require('../../../models/post');
|
||||
const util = require('../../../util/authentication');
|
||||
const util = require('../../../util/util');
|
||||
const database = require('../../../database');
|
||||
var multer = require('multer');
|
||||
const snowflake = require('node-snowflake').Snowflake;
|
||||
@@ -21,57 +21,79 @@ router.post('/', upload.none(), async function (req, res, next) {
|
||||
}
|
||||
else
|
||||
{
|
||||
database.connect().then(async fun => {
|
||||
let user = await util.data.processUser(pid);
|
||||
let community = await database.getCommunityByTitleID(paramPackData.title_id)
|
||||
let appData = "";
|
||||
if (req.body.app_data) {
|
||||
appData = req.body.app_data.replace(/\0/g, "").replace(/\r?\n|\r/g, "").trim();
|
||||
}
|
||||
let painting = "";
|
||||
if (req.body.painting) {
|
||||
painting = req.body.painting.replace(/\0/g, "").replace(/\r?\n|\r/g, "").trim();
|
||||
}
|
||||
let paintingURI = "";
|
||||
if (req.body.painting) {
|
||||
paintingURI = await util.data.processPainting(painting);
|
||||
}
|
||||
let screenshot = "";
|
||||
if (req.body.screenshot) {
|
||||
screenshot = req.body.screenshot.replace(/\0/g, "").trim();
|
||||
}
|
||||
const document = {
|
||||
title_id: paramPackData.title_id,
|
||||
screen_name: user.user_id,
|
||||
body: req.body.body,
|
||||
app_data: appData,
|
||||
painting: painting,
|
||||
painting_uri: paintingURI,
|
||||
screenshot: screenshot,
|
||||
url: req.body.url,
|
||||
search_key: req.body.search_key,
|
||||
topic_tag: req.body.topic_tag,
|
||||
community_id: community.community_id,
|
||||
country_id: paramPackData.country_id,
|
||||
created_at: new Date(),
|
||||
feeling_id: req.body.feeling_id,
|
||||
id: snowflake.nextId(),
|
||||
is_autopost: req.body.is_autopost,
|
||||
is_spoiler: req.body.is_spoiler,
|
||||
is_app_jumpable: req.body.is_app_jumpable,
|
||||
language_id: req.body.language_id,
|
||||
mii: user.mii,
|
||||
mii_face_url: `https://mii-images.cdn.pretendo.cc/${user.pid}/normal_face.png`,
|
||||
pid: user.pid,
|
||||
verified: user.official,
|
||||
platform_id: paramPackData.platform_id,
|
||||
region_id: paramPackData.region_id,
|
||||
parent: null,
|
||||
};
|
||||
const newPost = new POST(document);
|
||||
newPost.save();
|
||||
res.sendStatus(200);
|
||||
});
|
||||
let user = await util.data.processUser(pid);
|
||||
let community = await database.getCommunityByTitleID(paramPackData.title_id)
|
||||
let appData = "";
|
||||
if (req.body.app_data) {
|
||||
appData = req.body.app_data.replace(/\0/g, "").replace(/\r?\n|\r/g, "").trim();
|
||||
}
|
||||
let painting = "";
|
||||
if (req.body.painting) {
|
||||
painting = req.body.painting.replace(/\0/g, "").replace(/\r?\n|\r/g, "").trim();
|
||||
}
|
||||
let paintingURI = "";
|
||||
if (req.body.painting) {
|
||||
paintingURI = await util.data.processPainting(painting);
|
||||
}
|
||||
let screenshot = "";
|
||||
if (req.body.screenshot) {
|
||||
screenshot = req.body.screenshot.replace(/\0/g, "").trim();
|
||||
}
|
||||
|
||||
let miiFace;
|
||||
console.log(parseInt(req.body.feeling_id))
|
||||
switch (parseInt(req.body.feeling_id)) {
|
||||
case 1:
|
||||
miiFace = 'smile_open_mouth.png';
|
||||
break;
|
||||
case 2:
|
||||
miiFace = 'wink_left.png';
|
||||
break;
|
||||
case 3:
|
||||
miiFace = 'surprise_open_mouth.png';
|
||||
break;
|
||||
case 4:
|
||||
miiFace = 'frustrated.png';
|
||||
break;
|
||||
case 5:
|
||||
miiFace = 'sorrow.png';
|
||||
break;
|
||||
default:
|
||||
miiFace = 'normal_face.png';
|
||||
break;
|
||||
}
|
||||
|
||||
const document = {
|
||||
title_id: paramPackData.title_id,
|
||||
screen_name: user.user_id,
|
||||
body: req.body.body,
|
||||
app_data: appData,
|
||||
painting: painting,
|
||||
painting_uri: paintingURI,
|
||||
screenshot: screenshot,
|
||||
url: req.body.url,
|
||||
search_key: req.body.search_key,
|
||||
topic_tag: req.body.topic_tag,
|
||||
community_id: community.community_id,
|
||||
country_id: paramPackData.country_id,
|
||||
created_at: new Date(),
|
||||
feeling_id: req.body.feeling_id,
|
||||
id: snowflake.nextId(),
|
||||
is_autopost: req.body.is_autopost,
|
||||
is_spoiler: req.body.is_spoiler,
|
||||
is_app_jumpable: req.body.is_app_jumpable,
|
||||
language_id: req.body.language_id,
|
||||
mii: user.mii,
|
||||
mii_face_url: `http://mii.olv.pretendo.cc/mii/${user.pid}/${miiFace}`,
|
||||
pid: user.pid,
|
||||
verified: user.official,
|
||||
platform_id: paramPackData.platform_id,
|
||||
region_id: paramPackData.region_id,
|
||||
parent: null,
|
||||
};
|
||||
const newPost = new POST(document);
|
||||
newPost.save();
|
||||
res.sendStatus(200);
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
@@ -90,27 +112,24 @@ router.post('/', upload.none(), async function (req, res, next) {
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
router.post('/:post_id/empathies', upload.none(), function (req, res, next) {
|
||||
router.post('/:post_id/empathies', upload.none(), async function (req, res, next) {
|
||||
let pid = util.data.processServiceToken(req.headers["x-nintendo-servicetoken"]);
|
||||
database.connect().then(async emp => {
|
||||
const post = await database.getPostByID(req.params.post_id);
|
||||
if(pid === null) {
|
||||
res.sendStatus(403);
|
||||
return;
|
||||
}
|
||||
let user = await database.getUserByPID(pid);
|
||||
if(user.likes.indexOf(post.id) === -1 && user.id !== post.pid)
|
||||
{
|
||||
post.upEmpathy();
|
||||
user.addToLikes(post.id)
|
||||
res.sendStatus(200);
|
||||
}
|
||||
else
|
||||
res.sendStatus(403);
|
||||
});
|
||||
const post = await database.getPostByID(req.params.post_id);
|
||||
if(pid === null) {
|
||||
res.sendStatus(403);
|
||||
return;
|
||||
}
|
||||
let user = await database.getUserByPID(pid);
|
||||
if(user.likes.indexOf(post.id) === -1 && user.id !== post.pid)
|
||||
{
|
||||
post.upEmpathy();
|
||||
user.addToLikes(post.id)
|
||||
res.sendStatus(200);
|
||||
}
|
||||
else
|
||||
res.sendStatus(403);
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router;
|
||||
|
||||
@@ -2,21 +2,18 @@ var express = require('express');
|
||||
var router = express.Router();
|
||||
const database = require('../../../database');
|
||||
const comPostGen = require('../../../util/CommunityPostGen');
|
||||
const processHeaders = require('../../../util/authentication');
|
||||
const processHeaders = require('../../../util/util');
|
||||
const xmlbuilder = require("xmlbuilder");
|
||||
const moment = require("moment");
|
||||
|
||||
/* GET post titles. */
|
||||
router.get('/', function (req, res) {
|
||||
database.connect().then(async e => {
|
||||
const paramPack = processHeaders.data.decodeParamPack(req.headers["x-nintendo-parampack"]);
|
||||
let communities = await database.getCommunities(10);
|
||||
if(communities === null)
|
||||
return res.sendStatus(404);
|
||||
let response = await comPostGen.topics(communities);
|
||||
res.contentType("application/xml");
|
||||
router.get('/', async function (req, res) {
|
||||
let communities = await database.getCommunities(10);
|
||||
if(communities === null)
|
||||
return res.sendStatus(404);
|
||||
let response = await comPostGen.topics(communities);
|
||||
res.contentType("application/xml");
|
||||
res.send(response);
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router;
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
const crypto = require('crypto');
|
||||
const NodeRSA = require('node-rsa');
|
||||
const fs = require('fs-extra');
|
||||
const config = require('./config.json');
|
||||
const util = require('./util/authentication');
|
||||
const database = require('./database');
|
||||
|
||||
let b = "eJzt222u2zYQhWG3v7KMLKXL6u5bGMFtb11JnI8z1FB8H6A/GosjkiKPaAd5vX5/ffnjtz9fP3/8" +
|
||||
"BQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0uv1+uc/" +
|
||||
"ANjF9+w7+g8AnmiUfWQggCc6yzcyEOiN/ZnjmTfmGNBQZBbf1XK8c8XcAnmqvOL3qhxV/jHXgJ0y" +
|
||||
"s47akYE2ivzzzjXPA7tTZpblt3scU8z3ar8f3n1/rE2xhpWZdZabHfZad4r5Xun3Q74XIEP5O1tl" +
|
||||
"BrLObWbmn+f6qucX7UNHnfv2RKOM8T6Lq+9R2XpkoE3H/Kt+fpa6mfNtNdb2PUbfMTtkFvnno3xu" +
|
||||
"3jbWuupnaKmbHd/RZ94+Wvv+xPXdcTzW9ZKpW7Xeceyu/PN+br2P5fOK/Lu6NnKGHNU5O4N4dM3N" +
|
||||
"rpnuWTPR2t//H3NEntvs/FN8ftbvWee/bJ2K+t1ypnPf3hRrEL2skn+ja7z178q/Ua1RnUi7s350" +
|
||||
"26/VfcqO+2r+Os7nl2796USRf4r7ZPIhWtvy54rcyo7PIlq/056dnX2Ktb9C9nXv451Wzz/vucdb" +
|
||||
"ryL/on0d8fRVdU8lxdgttbPZVZ0pqlrKMT+ZOsuurs/mw9G1lfk3am+9Jjo+jxnZWU2RRZ6a3fJA" +
|
||||
"2Q9r/t095g48c1GRf5nrVLl0dn1F/mVqXVk9A6Pr8Gp+lWuvkroPK+V+B1X7U332UWeJev9E7uHt" +
|
||||
"85Vo+w57IbJOzp6V+hlWq8gk77rc2eh9Gnk+kXbKtarIP0udO3K7W1uFineNta7nugrRPWatab3v" +
|
||||
"zjrk31E762dXdbz99NRR5ay331/XZtor2imp5iay9u6ct8w+y/aLDPy/bP5F38Fn9z/rk6cPmWuv" +
|
||||
"Pvfmn6Le1XWRtdxl/avfDZ41k523zPxl17q1ruW6Duugo2z2ZDOwMv++ro/WUr4PvHs1m3+d1r0y" +
|
||||
"p+7Kv04ZuPJa6GZG/o3yoCr7Rirew9H8Gs1HJD+7rPeq/LO0U+ZfZD4t64EMvE9l/o1qZ56hQkX+" +
|
||||
"nf25Zx4ye7zjOle+3zxzo8qszLxm9kem9uj6LmvjbpE5HNWo2osVz06RgaO6kfdApG3Xta3Kv7Mx" +
|
||||
"et5D0f6Sgc+kmIurvd45+z7rVteuzr+uPH20ZJn184pMidS2XK/Mak+bzutmBtU8VJ9Bqmpb6irf" +
|
||||
"DZbrFG07yZ5RrGtrRv4d3UdR03qNqh0Z+ItyDqrnsqq+da1Xy5xhOq9lxf601lDs64qsivRf2d+K" +
|
||||
"tk+w+/hHZs9P5vzS4Vke3Vtxrpk5poqsqsy/O9o9AWdgm9lzozq7dMmNFdeY+gw44yy/6jvzLuTf" +
|
||||
"M92VgVffWUd96bb+1Oe1qu/L2TaZdqsj/57rrudqzUBPNs7W5Vw3IzMVbVfUde1hfStn31tV7sw4" +
|
||||
"03EGtOu6/vAsn2usc/a9rZx/M9s8wa7jxjyrrbGq/JiZS2Sg3W7jxVwr7qsuZ8CZv+mt+JyAzjp/" +
|
||||
"z73SJf+ibSLtVnxOQHcr7qsn5J+37YrPCVjBanuq8uw0+1xWmc0Anqc6ozpk4OdvE2QfgC+dznSK" +
|
||||
"fDrLO7IPwKdo/nX4zmztJ9kH4Eh1Pt3197PkHQCL6r874O9nAXQ1M/+u2pJ9AGabkU+j3+L4nQ7A" +
|
||||
"XWadz/j7WQDdjDJImU9kH4BujrKoMqPIPQCd8N0UwM7IvnXwXAA9Mq8/3k0AdkYGAtgV+QdgV+Qf" +
|
||||
"gJ2RgQB2tWL+zerr9/usNkcAxlbLv8r+Wv595SrzBMBGtbezOTHKm8ocUmWf5d+CXrXtoEs/gFmy" +
|
||||
"uZI9K1lyZ3b2ff8s0/+ja67a36lLP4CZKs5tnnrW85d6byrqevveNf/4nj8H89tPdN0rvqtac6E6" +
|
||||
"/7LtP2t4+u7pR+XeqZxj67UVde82852e1bFP1RT5F63pyYbO+Xf12egekesqqOt7s390nafuZ5vZ" +
|
||||
"LJnXLQM79mmWyJhXzj9Fzar8s8xFhco5Hn1+Nf7PP+/wrrgyGteMnIncY9fs++Ide3a/qjIyQlXT" +
|
||||
"smd3zb+rmpZsGP2/Yt1Vv1e75W/Xd0YHK+RfxTqtqhMd3yr5F313WefMko/eMUSzweruZzQa353r" +
|
||||
"qztl/inne8f8y9SL8tS3PhNV/nnbWvq8SvZZ++wd/6z+ryKTf5F1VbHfrKpqRfYW+Xde1zoPnr1f" +
|
||||
"peIenrUVWW8zxrASdQaq7tU5/z7rRfraIf+894jknyenrPOwU/Zd3VPx7HbOP+XeVe2fyLUWd6xX" +
|
||||
"T7u71mZ1/o3aefMv2ge16vVkvcbaD/Lvv6IZlmn/tPxT9OVqDrvt40z2WPNtVFO9zjLuWKOR/MvM" +
|
||||
"/VNF3yNnNaztvPWVOj3rq6zLvJei/VDkSnSfefPPM6ZK5N+6FPm3mu5jnJ19Z/e0XDe6xvN5Zf5V" +
|
||||
"zucd+Xd0nWVeyb9/Rdfh6mbmSsbs/kXyL7p2Rtk02qNV94iorum5p2XM5N8vO8/HKhk4UzSDRucP" +
|
||||
"670i2dsxA1Us75jRZ0f5OKv/nXnW2lNV7YVVjebDet6I3s9z/Vl/PPdQPveqNZQ9y1n7s9se8K6d" +
|
||||
"p1KcZZ7gavye88bMPlrvf3UW6n4G/KxbOd+7rPnMO/eJIu/Yp4nm3/dr7+jnUV9H7Sqf76wMrLDD" +
|
||||
"eudcfG3X/Hsbne06zIP1HOrJwar+jd4Z3XR6zlXIv7HPM9DOuo0/+l3XU0PZx5W+V3Ttl0pkfJ2f" +
|
||||
"F/ZjWYtd1utK2ffWuW8K0fE9eU6wFusa7rZeu2ffW/f+ZT19fNgD67fGDvnw5LEByCEfAAAAAAAA" +
|
||||
"AAAA5vgbwDsbNA==";
|
||||
|
||||
console.log(util.data.processServiceToken('Lg8Ix5uzYLZ01ip/P3UMt4iEPVjJYjh41L5r+hndp30gzEGxgvx830MWvH7jhiNBIvJbCAwHSEKJF2RvHYL+xq3oCVON8e1yy/eZlWKKW3SOvVMRiXlEr66zPMqZSIIxtYLvn1+7MM3qJPIuTIzR/4/JGeAE6KxPJuFK7zkROEYu9LSfPKGY0O2Sv6rnrZze3NHwHtT70uI7FXbP0P3t8yVQLgtAbxktcS5+NeGSwpVwpnO54rMMZjgJ7l42VKPGhEzHBw=='));
|
||||
/*let B64token = 'C9EFfkLjs6/81whPNBXOEqDPGQiDykCDwS/B4KcQDcAJxyvnXEure4xfwS/GPQKbRqLoE/QCTPEHh2q9B6TgdWJYNvnNb3wpvwhHy5CJ0hqwYxVaKE0iZcxQVK7QyJlhya3sE3K0HTmP1DqVISxYkEyCF7ofSZMoRcbKUvxfYHbALnh+Hbdl5F3nEUIcmBPijsVzi8kJSe2aQYR8n1X3b0J0HFO5QzHAwMiwiZBOyHnIdHtpsoWalDDkjoQfufSP8LcNFA==';
|
||||
let token = Buffer.from(B64token, 'base64');
|
||||
console.log(B64token);
|
||||
console.log(config.secret);
|
||||
const cryptoPath = `${__dirname}/certs/access`;
|
||||
|
||||
const cryptoOptions = {
|
||||
private_key: fs.readFileSync(`${cryptoPath}/private.pem`),
|
||||
hmac_secret: config.secret
|
||||
};
|
||||
|
||||
const privateKey = new NodeRSA(cryptoOptions.private_key, 'pkcs1-private-pem', {
|
||||
environment: 'browser',
|
||||
encryptionScheme: {
|
||||
'hash': 'sha256',
|
||||
}
|
||||
});
|
||||
|
||||
const cryptoConfig = token.subarray(0, 0x90);
|
||||
const signature = token.subarray(0x90, 0xA4);
|
||||
const encryptedBody = token.subarray(0xA4);
|
||||
|
||||
const encryptedAESKey = cryptoConfig.subarray(0, 128);
|
||||
const iv = cryptoConfig.subarray(128);
|
||||
|
||||
const decryptedAESKey = privateKey.decrypt(encryptedAESKey);
|
||||
|
||||
const decipher = crypto.createDecipheriv('aes-128-cbc', decryptedAESKey, iv);
|
||||
|
||||
let decryptedBody = decipher.update(encryptedBody);
|
||||
decryptedBody = Buffer.concat([decryptedBody, decipher.final()]);
|
||||
const hmac = crypto.createHmac('sha1', cryptoOptions.hmac_secret).update(decryptedBody);
|
||||
|
||||
const calculatedSignature = hmac.digest();
|
||||
console.log(calculatedSignature);
|
||||
console.log(signature);
|
||||
//calculatedSignature is different than signature on ubuntu
|
||||
//but is the same on Windows?????
|
||||
//node wtf
|
||||
if (!calculatedSignature.equals(signature)) {
|
||||
console.log('Token signature did not match');
|
||||
console.log("fuck");
|
||||
}
|
||||
*/
|
||||
database.connect().then(async e => {
|
||||
console.log('running');
|
||||
console.log(await util.data.processUser(1566682802));
|
||||
});
|
||||
@@ -15,49 +15,42 @@ const path = require('path')
|
||||
|
||||
let methods = {
|
||||
processUser: function(pid) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
//console.log('running me');
|
||||
database.connect().then(async yeet => {
|
||||
let userObject = await database.getUserByPID(pid);
|
||||
//console.log(userObject);
|
||||
if(userObject != null)
|
||||
resolve(userObject);
|
||||
else
|
||||
{
|
||||
//console.log('else');
|
||||
await request({
|
||||
url: "http://" + config.account_server + "/v1/api/miis?pids=" + pid,
|
||||
headers: {
|
||||
'X-Nintendo-Client-ID': 'a2efa818a34fa16b8afbc8a74eba3eda',
|
||||
'X-Nintendo-Client-Secret': 'c91cdb5658bd4954ade78533a339cf9a'
|
||||
}
|
||||
}, function (error, response, body) {
|
||||
if (!error && response.statusCode === 200) {
|
||||
let xml = xmlParser.toJson(body, {object: true});
|
||||
const newUsr = {
|
||||
pid: pid,
|
||||
created_at: moment().format('YYYY-MM-DD HH:mm:SS'),
|
||||
user_id: xml.miis.mii.user_id,
|
||||
account_status: 0,
|
||||
mii: xml.miis.mii.data,
|
||||
official: false
|
||||
};
|
||||
const newUsrObj = new USER(newUsr);
|
||||
//console.log(newUsrObj);
|
||||
newUsrObj.save();
|
||||
resolve(newUsr);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log('fail');
|
||||
reject();
|
||||
}
|
||||
return new Promise(async function(resolve, reject) {
|
||||
let userObject = await database.getUserByPID(pid);
|
||||
if(userObject != null)
|
||||
resolve(userObject);
|
||||
else
|
||||
{
|
||||
await request({
|
||||
url: "http://" + config.account_server + "/v1/api/miis?pids=" + pid,
|
||||
headers: {
|
||||
'X-Nintendo-Client-ID': 'a2efa818a34fa16b8afbc8a74eba3eda',
|
||||
'X-Nintendo-Client-Secret': 'c91cdb5658bd4954ade78533a339cf9a'
|
||||
}
|
||||
}, function (error, response, body) {
|
||||
if (!error && response.statusCode === 200) {
|
||||
let xml = xmlParser.toJson(body, {object: true});
|
||||
const newUsr = {
|
||||
pid: pid,
|
||||
created_at: moment().format('YYYY-MM-DD HH:mm:SS'),
|
||||
user_id: xml.miis.mii.user_id,
|
||||
account_status: 0,
|
||||
mii: xml.miis.mii.data,
|
||||
official: false
|
||||
};
|
||||
const newUsrObj = new USER(newUsr);
|
||||
newUsrObj.save();
|
||||
resolve(newUsr);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log('fail');
|
||||
reject();
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
decodeParamPack: function (paramPack) {
|
||||
@@ -168,4 +161,4 @@ let methods = {
|
||||
return `data:image/png;base64,${pngBuffer.toString('base64')}`;
|
||||
},
|
||||
};
|
||||
exports.data = methods;
|
||||
exports.data = methods;
|
||||
Reference in New Issue
Block a user