Fix typos
This commit is contained in:
parent
2bf784b4d2
commit
18af3b2130
|
@ -63,7 +63,7 @@ const BanInfo = ({ close }) => {
|
|||
return (
|
||||
<div style={{ userSelect: 'text' }}>
|
||||
<p>
|
||||
{t`You are banned. You think it is unjustifed? Check out the `}
|
||||
{t`You are banned. You think it is unjustified? Check out the `}
|
||||
<span
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
|
|
|
@ -25,7 +25,7 @@ const MdLink = ({ href, title, refEmbed }) => {
|
|||
|
||||
const desc = getLinkDesc(href);
|
||||
|
||||
// treat pixelplanet links seperately
|
||||
// treat pixelplanet links separately
|
||||
if (desc === window.location.hostname && href.includes('/#')) {
|
||||
const coords = href.substring(href.indexOf('/#') + 1);
|
||||
if (isPopUp() && window.opener && !window.opener.closed) {
|
||||
|
|
|
@ -40,7 +40,7 @@ function getStylesByWindowSize(
|
|||
paletteCols = 5;
|
||||
flexDirection = 'row';
|
||||
} else {
|
||||
// ordinary palette (one or two colums)
|
||||
// ordinary palette (one or two columns)
|
||||
spanSize = 24;
|
||||
paletteCols = (windowHeight < 801) ? 2 : 1;
|
||||
flexDirection = 'column';
|
||||
|
|
|
@ -59,7 +59,7 @@ const UserAreaContent = () => {
|
|||
<div className="content">
|
||||
<UserMessages />
|
||||
<Stat
|
||||
text={t`Todays Placed Pixels`}
|
||||
text={t`Today Placed Pixels`}
|
||||
value={stats.dailyTotalPixels}
|
||||
/>
|
||||
<Stat
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
} from '../../store/actions/windows';
|
||||
|
||||
/*
|
||||
* return [ chatOpen, chatHiden ]
|
||||
* return [ chatOpen, chatHidden ]
|
||||
* chatOpen: if any chat window or modal is open
|
||||
* chatHidden: if any chat windows are hidden
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* espand menu / show other menu buttons
|
||||
* expand menu / show other menu buttons
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ const ChannelDropDown = ({
|
|||
}
|
||||
// latest lastTs first
|
||||
sortChansNew.sort((c1, c2) => {
|
||||
// determins if default channels get sorted too
|
||||
// determines if default channels get sorted too
|
||||
if (c1[3] === 0 || c2[3] === 0) return 0;
|
||||
if (c1[4] > c2[4]) return -1;
|
||||
if (c2[4] > c1[4]) return 1;
|
||||
|
|
|
@ -10,7 +10,7 @@ import { useEffect, useLayoutEffect, useCallback } from 'react';
|
|||
* Keeps listening to outside clicks or window resize
|
||||
* as long as active is true
|
||||
* @param insideRefs references to elements that are considered inside
|
||||
* @param calback function that gets fired on click outside
|
||||
* @param callback function that gets fired on click outside
|
||||
* @param active boolean if we should listen or not
|
||||
*/
|
||||
export function useConditionalClickOutside(insideRefs, active, callback) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* mouse draging
|
||||
* mouse dragging
|
||||
*/
|
||||
|
||||
/* eslint-disable consistent-return */
|
||||
|
@ -9,7 +9,7 @@ import { useEffect, useCallback } from 'react';
|
|||
/*
|
||||
* @param elRef element reference from useRef
|
||||
* @param startHandler function called on start of drag
|
||||
* @param diffHandler functio that is called with dragged distance
|
||||
* @param diffHandler function that is called with dragged distance
|
||||
*/
|
||||
function useDrag(elRef, startHandler, diffHandler) {
|
||||
const startDrag = useCallback((event) => {
|
||||
|
|
|
@ -23,6 +23,6 @@ export default {
|
|||
|
||||
/*
|
||||
* NOTE:
|
||||
* set windows that should be accessable via popup / url
|
||||
* set windows that should be accessible via popup / url
|
||||
* also in ./popUpAvailable.js
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Buffer for chatMessages for the server
|
||||
* it just buffers the msot recent 200 messages for each channel
|
||||
* it just buffers the most recent 200 messages for each channel
|
||||
*
|
||||
*/
|
||||
import Sequelize from 'sequelize';
|
||||
|
|
|
@ -16,7 +16,7 @@ import Palette from './Palette';
|
|||
|
||||
|
||||
/*
|
||||
* Load iamge from ABGR buffer onto canvas
|
||||
* Load image from ABGR buffer onto canvas
|
||||
* (be aware that tis function does no validation of arguments)
|
||||
* @param canvasId numerical ID of canvas
|
||||
* @param x X coordinate on canvas
|
||||
|
@ -103,7 +103,7 @@ export async function imageABGR2Canvas(
|
|||
|
||||
|
||||
/*
|
||||
* Load iamgemask from ABGR buffer and execute function for each black pixel
|
||||
* Load imagemask from ABGR buffer and execute function for each black pixel
|
||||
* (be aware that tis function does no validation of arguments)
|
||||
* @param canvasId numerical ID of canvas
|
||||
* @param x X coordinate on canvas
|
||||
|
|
|
@ -63,10 +63,10 @@ export class MailProvider {
|
|||
const { t } = getTTag(lang);
|
||||
logger.info(`Sending verification mail to ${to} / ${name}`);
|
||||
const verifyUrl = `${host}/api/auth/verify?token=${code}&email=${encodeURIComponent(to)}`;
|
||||
const subject = t`Welcome ${name} to PixelPlanet, plese verify your mail`;
|
||||
const subject = t`Welcome ${name} to PixelPlanet, please verify your mail`;
|
||||
const html = `<em>${t`Hello ${name}`}</em>,<br />
|
||||
${t`welcome to our little community of pixelplacers, to use your account, you have to verify your mail. You can do that here: `} <a href="${verifyUrl}">${t`Click to Verify`}</a>. ${t`Or by copying following url:`}<br />${verifyUrl}\n<br />
|
||||
${t`Have fun and don't hesitate to contact us if you encouter any problems :)`}<br />
|
||||
${t`Have fun and don't hesitate to contact us if you encounter any problems :)`}<br />
|
||||
${t`Thanks`}<br /><br />
|
||||
<img alt="" src="https://assets.pixelplanet.fun/tile.png" style="height:64px; width:64px" />`;
|
||||
this.sendMail(to, subject, html);
|
||||
|
@ -132,7 +132,7 @@ export class MailProvider {
|
|||
|
||||
/*
|
||||
* not sure if this is needed yet
|
||||
* does it matter if spaming password reset mails or verifications mails?
|
||||
* does it matter if spamming password reset mails or verifications mails?
|
||||
*
|
||||
if(!reguser.verified) {
|
||||
logger.info(`Password reset mail for ${to} requested by ${ip} - mail not verified`);
|
||||
|
@ -169,7 +169,7 @@ export class MailProvider {
|
|||
/*
|
||||
* we do not use this right now
|
||||
static cleanUsers() {
|
||||
// delete users that requier verification for more than 4 days
|
||||
// delete users that require verification for more than 4 days
|
||||
RegUser.destroy({
|
||||
where: {
|
||||
verificationReqAt: {
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*
|
||||
* We do not support all markdown, but do additionally parse extra
|
||||
* stuff like pixelplanet coords and usernames and bare links.
|
||||
* This code is written in preparation for a possible imporementation in
|
||||
* WebAssambly, so it's all in a big loop
|
||||
* This code is written in preparation for a possible implementation in
|
||||
* WebAssembly, so it's all in a big loop
|
||||
*/
|
||||
|
||||
import MString from './MString';
|
||||
|
@ -142,7 +142,7 @@ function parseMParagraph(text, opts, breakChar) {
|
|||
/*
|
||||
* parse Code Block
|
||||
* start is first character after the initializing ```
|
||||
* we just parse till the ending occures
|
||||
* we just parse till the ending occurs
|
||||
*/
|
||||
function parseCodeBlock(text) {
|
||||
text.skipSpaces(false);
|
||||
|
@ -183,7 +183,7 @@ function parseQuote(text, opts) {
|
|||
* parses Section (contains paragraphs, lists, etc. but no headings or quotes)
|
||||
* @param text MString
|
||||
* @param headingLevel the number of heading headingLevels we are in
|
||||
* @param indent ndentation that should be considered (when inside list)
|
||||
* @param indent indentation that should be considered (when inside list)
|
||||
* returns when encountering heading of <= headingLevel (iter is at # position)
|
||||
* or heading-cancel with three spaces (iter is past newlines)
|
||||
* or ident is smaller than given
|
||||
|
@ -264,7 +264,7 @@ function parseMSection(
|
|||
curIndent + 1,
|
||||
);
|
||||
childMdArray = ['-', childMdArray];
|
||||
// lists are encapsuled
|
||||
// lists are encapsulated
|
||||
const capsule = (isUnorderedList) ? 'ul' : 'ol';
|
||||
if (!mdArray.length || mdArray[mdArray.length - 1][0] !== capsule) {
|
||||
mdArray.push([capsule, [childMdArray]]);
|
||||
|
|
|
@ -167,7 +167,7 @@ class RpgEvent {
|
|||
// make sure that its the center of a 3x3 area
|
||||
const i = Math.floor(Math.random() * (canvasSize / TILE_SIZE - 2)) + 1;
|
||||
const j = Math.floor(Math.random() * (canvasSize / TILE_SIZE - 2)) + 1;
|
||||
// backup it and schedul next event in 1h
|
||||
// backup it and schedule next event in 1h
|
||||
await setNextEvent(EVENT_GAP_MIN, i, j);
|
||||
const timestamp = await nextEvent();
|
||||
const x = i * TILE_SIZE - canvasSize / 2;
|
||||
|
@ -194,7 +194,7 @@ class RpgEvent {
|
|||
async runEventLoop() {
|
||||
/*
|
||||
* if we aren't the main shard, we just wait and regularly check,
|
||||
* re-intilializing if we become it
|
||||
* re-initializing if we become it
|
||||
*/
|
||||
if (!socketEvents.amIImportant()) {
|
||||
this.iAmNotImportant = true;
|
||||
|
@ -281,7 +281,7 @@ class RpgEvent {
|
|||
}
|
||||
setTimeout(this.runEventLoop, 1000);
|
||||
} else if (eventMinutes > STEPS[4]) {
|
||||
// 1min till Event: blinking solid cross red small fase
|
||||
// 1min till Event: blinking solid cross red small faze
|
||||
if (eventState !== 9 && eventState !== 10) {
|
||||
this.eventState = 9;
|
||||
RpgEvent.broadcastChatMessage(
|
||||
|
|
|
@ -29,7 +29,7 @@ class Void {
|
|||
// Uint8Array to log pixels in area
|
||||
area;
|
||||
userArea;
|
||||
// current numberical data
|
||||
// current numerical data
|
||||
curRadius;
|
||||
curAngle;
|
||||
curAngleDelta;
|
||||
|
@ -129,7 +129,7 @@ class Void {
|
|||
while (true) {
|
||||
this.curAngle += this.curAngleDelta;
|
||||
if (this.curAngle > 2 * Math.PI) {
|
||||
// it does skip some pixel, but thats ok
|
||||
// it does skip some pixel, but that's ok
|
||||
this.curRadius += 1;
|
||||
if (this.curRadius > TARGET_RADIUS) {
|
||||
this.cancel();
|
||||
|
|
|
@ -48,7 +48,7 @@ import rollbackCanvasArea from './rollback';
|
|||
/*
|
||||
* Execute IP based actions (banning, whitelist, etc.)
|
||||
* @param action what to do with the ip
|
||||
* @param ip already sanizized ip
|
||||
* @param ip already sanitized ip
|
||||
* @return text of success
|
||||
*/
|
||||
export async function executeIPAction(action, ips, logger = null) {
|
||||
|
@ -79,7 +79,7 @@ export async function executeIPAction(action, ips, logger = null) {
|
|||
/*
|
||||
* Execute IID based actions
|
||||
* @param action what to do with the iid
|
||||
* @param iid already sanizized iid
|
||||
* @param iid already sanitized iid
|
||||
* @return text of success
|
||||
*/
|
||||
export async function executeIIDAction(
|
||||
|
@ -265,7 +265,7 @@ export async function executeImageAction(
|
|||
}
|
||||
|
||||
/*
|
||||
* retgister responses on socket for Watch Actions
|
||||
* register responses on socket for Watch Actions
|
||||
*/
|
||||
socketEvents.onReq('watch', (action, ...args) => {
|
||||
if (action === 'getIIDSummary') {
|
||||
|
@ -466,7 +466,7 @@ export async function executeProtAction(
|
|||
const width = u - x + 1;
|
||||
const height = v - y + 1;
|
||||
if (width * height > 10000000) {
|
||||
return [403, 'Can not set protection to more than 10m pixels at onec'];
|
||||
return [403, 'Can not set protection to more than 10m pixels at once'];
|
||||
}
|
||||
const protect = action === 'protect';
|
||||
const pxlCount = await protectCanvasArea(
|
||||
|
|
|
@ -51,7 +51,7 @@ export const HOURLY_EVENT = parseInt(process.env.HOURLY_EVENT, 10) || false;
|
|||
|
||||
// Accounts
|
||||
export const APISOCKET_KEY = process.env.APISOCKET_KEY || null;
|
||||
// Comma seperated list of user ids of Admins
|
||||
// Comma separated list of user ids of Admins
|
||||
export const ADMIN_IDS = (process.env.ADMIN_IDS)
|
||||
? process.env.ADMIN_IDS.split(',').map((z) => parseInt(z, 10)) : [];
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*/
|
||||
|
||||
// canvas size (width and height) MUST be 256 * 4^n to be able to stick
|
||||
// to established tiling convetions.
|
||||
// to established tiling conventions.
|
||||
// (basically by sticking to that, we keep ourself many options open for the future)
|
||||
// see OSM tiling: https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
|
||||
export const MAX_SCALE = 40; // 52 in log2
|
||||
|
|
|
@ -43,13 +43,13 @@ setInterval(() => {
|
|||
|
||||
/**
|
||||
*
|
||||
* By Offset is prefered on server side
|
||||
* By Offset is preferred on server side
|
||||
* This gets used by websocket pixel placing requests
|
||||
* @param user user that can be registered, but doesn't have to
|
||||
* @param canvasId
|
||||
* @param i Chunk coordinates
|
||||
* @param j
|
||||
* @param pixels Array of indiviual pixels within the chunk, with:
|
||||
* @param pixels Array of individual pixels within the chunk, with:
|
||||
* [[offset, color], [offset2, color2],...]
|
||||
* Offset is the offset of the pixel within the chunk
|
||||
* @return Promise<Object>
|
||||
|
@ -74,7 +74,7 @@ export default async function drawByOffsets(
|
|||
if (curReqIPs.has(ip)) {
|
||||
// already setting a pixel somewhere
|
||||
logger.warn(
|
||||
`Got simultanious requests from ${user.ip}`,
|
||||
`Got simultaneous requests from ${user.ip}`,
|
||||
);
|
||||
throw new Error(13);
|
||||
}
|
||||
|
@ -95,12 +95,12 @@ export default async function drawByOffsets(
|
|||
*/
|
||||
if (i >= canvasSize / tileSize) {
|
||||
// x out of bounds
|
||||
// (we don't have to check for <0 becaue it is received as uint)
|
||||
// (we don't have to check for <0 because it is received as uint)
|
||||
throw new Error(2);
|
||||
}
|
||||
if (j >= canvasSize / tileSize) {
|
||||
// y out of bounds
|
||||
// (we don't have to check for <0 becaue it is received as uint)
|
||||
// (we don't have to check for <0 because it is received as uint)
|
||||
throw new Error(3);
|
||||
}
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ export default function checkIfAllowed(ip, disableCache = false) {
|
|||
* check if email is disposable
|
||||
* @param email
|
||||
* @return Promise
|
||||
* null: some error occured
|
||||
* null: some error occurred
|
||||
* false: legit provider
|
||||
* true: disposable
|
||||
*/
|
||||
|
|
|
@ -40,7 +40,7 @@ passport.use(new JsonStrategy({
|
|||
usernameProp: 'nameoremail',
|
||||
passwordProp: 'password',
|
||||
}, async (nameoremail, password, done) => {
|
||||
// Decide if email or name by the occurance of @
|
||||
// Decide if email or name by the occurrence of @
|
||||
// this is why we don't allow @ in usernames
|
||||
// NOTE: could allow @ in the future by making an OR query,
|
||||
// but i guess nobody really cares.
|
||||
|
|
|
@ -13,8 +13,9 @@ import canvases from './canvases';
|
|||
|
||||
/**
|
||||
*
|
||||
* By Offset is prefered on server side
|
||||
* By Offset is preferred on server side
|
||||
* @param canvasId
|
||||
* @param color Pixel color
|
||||
* @param i Chunk coordinates
|
||||
* @param j
|
||||
* @param offset Offset of pixel withing chunk
|
||||
|
|
|
@ -120,7 +120,7 @@ class CanvasUpdater {
|
|||
}
|
||||
|
||||
/*
|
||||
* register changed chunk, queue corespongind tile to reload
|
||||
* register changed chunk, queue corresponding tile to reload
|
||||
* @param chunk Chunk coordinates
|
||||
*/
|
||||
registerChunkChange(chunk) {
|
||||
|
|
|
@ -33,7 +33,7 @@ export function getTTag(lang) {
|
|||
/*
|
||||
* express middleware for getting language
|
||||
* It checks the lang cookie, and if not present,
|
||||
* the Accept-Lanuage header
|
||||
* the Accept-Language header
|
||||
*/
|
||||
export function expressTTag(req, res, next) {
|
||||
const cookies = cookie.parse(req.headers.cookie || '');
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* .vox file exporter for 3D canvas
|
||||
* .vox is the Magica Voxel file format that is also compatible with
|
||||
* other vodel editors like Goxel.
|
||||
* other voxel editors like Goxel.
|
||||
* A object in a .vox file can have a max dimension of 128x128 and 256 height
|
||||
* As of the latest release with 0.99.5 4/5/2020 this limit is now 256x256x256,
|
||||
* however, lets keep with the old restreints for support of other software.
|
||||
* however, lets keep with the old restraints for support of other software.
|
||||
* In .vox, 0,0 is the corner of the model and coordinates are unsigned int,
|
||||
* the z dimension is the height, contrarian to pixelplanet with y.
|
||||
*
|
||||
|
@ -15,7 +15,7 @@
|
|||
|
||||
/*
|
||||
* THIS IS JUST THE START, I WONT CONTINUE IT ANYTIME SOON SO ITS ALREADY
|
||||
* COMMITED AS A REFERENCE AND IDEA
|
||||
* COMMITTED AS A REFERENCE AND IDEA
|
||||
* The idea is to export a 128x128 area around the focal point of where the user
|
||||
* is currently looking at as .vox. The file should just have one model.
|
||||
*/
|
||||
|
@ -101,12 +101,12 @@ async function exportVox(
|
|||
// Main Chunk
|
||||
// 4 bytes MAIN
|
||||
// 4 bytes size (0)
|
||||
// 4 bythes size children chnks
|
||||
// 4 bytes size children chunks
|
||||
const mainChildrenChunkSize = sizeChunkLength
|
||||
+ xyziChunkLength + rgbaChunkLength;
|
||||
const mainChunkLength = 4 + 4 + 4 + mainChildrenChunkSize;
|
||||
// 4 bytes 'VOX '
|
||||
// 4 bythes version number
|
||||
// 4 bytes version number
|
||||
const fileLength = 4 + 4 + mainChunkLength;
|
||||
|
||||
const voxFile = new ArrayBuffer(fileLength);
|
||||
|
@ -164,7 +164,7 @@ async function exportVox(
|
|||
|
||||
return voxFile;
|
||||
// can then be saved from the UI with react-file-downloader
|
||||
// aka js-file-doanloader
|
||||
// aka js-file-downloader
|
||||
}
|
||||
|
||||
export default exportVox;
|
||||
|
|
|
@ -159,7 +159,7 @@ export async function needCaptcha(ip) {
|
|||
* force ip to get captcha
|
||||
* @param ip
|
||||
* @return true if we triggered captcha
|
||||
* false if user would have gotton one anyway
|
||||
* false if user would have gotten one anyway
|
||||
*/
|
||||
export async function forceCaptcha(ip) {
|
||||
if (CAPTCHA_TIME < 0) {
|
||||
|
|
|
@ -22,7 +22,7 @@ const PREFIX = 'cd';
|
|||
* @param ip ip of request
|
||||
* @param id userId
|
||||
* @param ranked boolean if increasing rank
|
||||
* @param clrIgnore, bcd, pcd, cds incormations about canvas
|
||||
* @param clrIgnore, bcd, pcd, cds information about canvas
|
||||
* @param i, j chunk coordinates
|
||||
* @param pxls Array with offsets of pixels
|
||||
* @return see lua/placePixel.lua
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
-- Checking requirements for placing pixels, calculating cooldown
|
||||
-- of user and incrementing pixel counts wthin redis itself.
|
||||
-- of user and incrementing pixel counts within redis itself.
|
||||
-- Does not set pixels directly. Pixels are set in batches
|
||||
-- in RedisCanvas.js
|
||||
-- Keys:
|
||||
-- isAlloweed: 'isal:ip' (proxycheck, blacklist, whitelist)
|
||||
-- Keys:
|
||||
-- isAllowed: 'isal:ip' (proxycheck, blacklist, whitelist)
|
||||
-- isHuman 'human:ip' captcha needed when expired,
|
||||
-- 'nope' if no captcha should be checked
|
||||
-- ipCD: 'cd:canvasId:ip:ip'
|
||||
|
@ -17,16 +17,16 @@
|
|||
-- prevTop: sorted set of yesterdays top 10
|
||||
-- Args:
|
||||
-- clrIgnore: integer number of what colors are considered unset
|
||||
-- bcd: number baseColldown (fixed to cdFactor and 0 if admin)
|
||||
-- bcd: number baseCooldown (fixed to cdFactor and 0 if admin)
|
||||
-- pcd: number set pixel cooldown (fixed to cdFactor and 0 if admin)
|
||||
-- cds: max cooldown of canvas
|
||||
-- userId: '0' if not logged in
|
||||
-- cc country code
|
||||
-- req: requirements of canvas
|
||||
-- 'nope', unsigned integer or 'top'
|
||||
-- off1, chonk offset of first pixel
|
||||
-- off2, chonk offset of second pixel
|
||||
-- ..., infinie pixels possible
|
||||
-- off1, chunk offset of first pixel
|
||||
-- off2, chunk offset of second pixel
|
||||
-- ..., infinite pixels possible
|
||||
-- Returns:
|
||||
-- {
|
||||
-- 1: pixel return status code (check ui/placePixel.js)
|
||||
|
|
|
@ -18,7 +18,7 @@ const Ban = sequelize.define('Ban', {
|
|||
},
|
||||
|
||||
/*
|
||||
* wpiration time,
|
||||
* expiration time,
|
||||
* NULL if infinite
|
||||
*/
|
||||
expires: {
|
||||
|
|
|
@ -38,7 +38,7 @@ const RegUser = sequelize.define('User', {
|
|||
defaultValue: false,
|
||||
},
|
||||
|
||||
// null if external oauth authentification
|
||||
// null if external oauth authentication
|
||||
password: {
|
||||
type: DataTypes.CHAR(60),
|
||||
allowNull: true,
|
||||
|
@ -193,7 +193,7 @@ export async function getNamesToIds(ids) {
|
|||
|
||||
/*
|
||||
* take array of {id: useId, ...} object and resolve
|
||||
* user informations
|
||||
* user information
|
||||
*/
|
||||
export async function populateRanking(rawRanks) {
|
||||
if (!rawRanks.length) {
|
||||
|
|
|
@ -85,7 +85,7 @@ router.post('/checklogin', async (req, res) => {
|
|||
|
||||
if (!compareToHash(password, reguser.password)) {
|
||||
logger.info(
|
||||
`ADMINAPI: User ${reguser.name} / ${reguser.id} entered wronng password`,
|
||||
`ADMINAPI: User ${reguser.name} / ${reguser.id} entered wrong password`,
|
||||
);
|
||||
res.json({
|
||||
success: false,
|
||||
|
|
|
@ -63,9 +63,9 @@ router.get('/reddit/return', passport.authenticate('reddit', {
|
|||
// eslint-disable-next-line no-unused-vars
|
||||
router.use((err, req, res, next) => {
|
||||
const host = getHostFromRequest(req);
|
||||
logger.info(`Authentification error: ${err.message}`);
|
||||
logger.info(`Authentication error: ${err.message}`);
|
||||
const index = getHtml(
|
||||
'OAuth Authentification',
|
||||
'OAuth Authentication',
|
||||
err.message, host, req.lang,
|
||||
);
|
||||
res.status(400).send(index);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* request passowrd reset mail
|
||||
* request password reset mail
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ export default async (req, res) => {
|
|||
if (!error) {
|
||||
const name = await MailProvider.verify(email, token);
|
||||
if (name) {
|
||||
// notify websoecket to reconnect user
|
||||
// thats a bit counter productive because it directly links to the websocket
|
||||
// notify websocket to reconnect user
|
||||
// that's a bit counter productive because it directly links to the websocket
|
||||
socketEvents.reloadUser(name);
|
||||
// ---
|
||||
const index = getHtml(
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* report that user shouldbe banned
|
||||
* report that user should be banned
|
||||
*/
|
||||
|
||||
import logger from '../../core/logger';
|
||||
|
|
|
@ -60,7 +60,7 @@ router.use(session);
|
|||
|
||||
/*
|
||||
* passport authenticate
|
||||
* and deserlialize
|
||||
* and deserialize
|
||||
* (makes that sql request to map req.user.regUser)
|
||||
* After this point it is assumes that user.regUser is set if user.id is too
|
||||
*/
|
||||
|
|
|
@ -81,12 +81,12 @@ router.post('/', async (req, res) => {
|
|||
}
|
||||
await reguser.update({ password: pass });
|
||||
|
||||
logger.info(`Changed password of ${email} via passowrd reset form`);
|
||||
logger.info(`Changed password of ${email} via password reset form`);
|
||||
const html = getPasswordResetHtml(
|
||||
null,
|
||||
null,
|
||||
lang,
|
||||
t`Passowrd successfully changed.`,
|
||||
t`Password successfully changed.`,
|
||||
);
|
||||
res.status(200).send(html);
|
||||
});
|
||||
|
|
|
@ -58,8 +58,9 @@ server.on('upgrade', wsupgrade);
|
|||
|
||||
/*
|
||||
* use gzip compression for following calls
|
||||
/* level from -1 (default, 6) to 0 (no) from 1 (fastest) to 9 (best)
|
||||
* Set custon filter to make sure that .bmp files get compressed
|
||||
* level from -1 (default, 6) to 0 (no) from 1 (fastest) to 9 (best)
|
||||
*
|
||||
* Set custom filter to make sure that .bmp files get compressed
|
||||
*/
|
||||
app.use(compression({
|
||||
level: 3,
|
||||
|
@ -99,7 +100,7 @@ sequelize.sync({ alter: { drop: false } })
|
|||
// catch errors of server
|
||||
server.on('error', (e) => {
|
||||
logger.error(
|
||||
`HTTP Server Error ${e.code} occured, trying again in 5s...`,
|
||||
`HTTP Server Error ${e.code} occurred, trying again in 5s...`,
|
||||
);
|
||||
setTimeout(() => {
|
||||
server.close();
|
||||
|
|
|
@ -222,7 +222,7 @@ class APISocketServer {
|
|||
} else if (even === 'online') {
|
||||
ws.subOnline = true;
|
||||
} else {
|
||||
logger.info(`APISocket wanted to sub to unexisting ${even}`);
|
||||
logger.info(`APISocket wanted to sub to nonexistent ${even}`);
|
||||
}
|
||||
logger.info(`APISocket client subscribed to ${even}`);
|
||||
return;
|
||||
|
|
|
@ -141,7 +141,7 @@ class MessageBroker extends SocketEvents {
|
|||
(buffer) => this.onShardBinaryMessage(buffer, message),
|
||||
true,
|
||||
);
|
||||
// immediately give new shards informations
|
||||
// immediately give new shards information
|
||||
this.publisher.publish(BROADCAST_CHAN, this.thisShard);
|
||||
return;
|
||||
}
|
||||
|
@ -285,7 +285,7 @@ class MessageBroker extends SocketEvents {
|
|||
}
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line max-len
|
||||
console.error(`CLUSTER: Error on binery message of shard ${shard}: ${err.message}`);
|
||||
console.error(`CLUSTER: Error on binary message of shard ${shard}: ${err.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ class SocketEvents extends EventEmitter {
|
|||
/*
|
||||
* requests that expect a response
|
||||
* req(type, args) can be awaited
|
||||
* it will return a response from whatever listenes on onReq(type, cb(args))
|
||||
* it will return a response from whatever listens on onReq(type, cb(args))
|
||||
* Keep the arguments serializable for shard support
|
||||
*/
|
||||
req(type, ...args) {
|
||||
|
@ -104,7 +104,7 @@ class SocketEvents extends EventEmitter {
|
|||
|
||||
/*
|
||||
* chunk updates from event, image upload, etc.
|
||||
* everything thats not a pixelUpdate and changes chunks
|
||||
* everything that's not a pixelUpdate and changes chunks
|
||||
* @param canvasId
|
||||
* @param chunk [i,j] chunk coordinates
|
||||
*/
|
||||
|
@ -152,8 +152,8 @@ class SocketEvents extends EventEmitter {
|
|||
* broadcast chat message to all users in channel
|
||||
* @param name chatname
|
||||
* @param message Message to send
|
||||
* @param sendapi If chat message should get boradcasted to api websockets
|
||||
* (usefull if the api is supposed to not answer to its own messages)
|
||||
* @param sendapi If chat message should get broadcasted to api websockets
|
||||
* (useful if the api is supposed to not answer to its own messages)
|
||||
*/
|
||||
broadcastChatMessage(
|
||||
name,
|
||||
|
@ -228,15 +228,6 @@ class SocketEvents extends EventEmitter {
|
|||
this.emit('remChatChannel', userId, channelId);
|
||||
}
|
||||
|
||||
/*
|
||||
* trigger rate limit of ip
|
||||
* @param ip
|
||||
* @param blockTime in ms
|
||||
*/
|
||||
broadcastRateLimitTrigger(ip, blockTime) {
|
||||
this.emit('rateLimitTrigger', ip, blockTime);
|
||||
}
|
||||
|
||||
/*
|
||||
* broadcast ranking list updates
|
||||
* @param {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Binary Websocket Packages
|
||||
|
||||
Note that the node Server receives and sends in [Buffer](https://nodejs.org/api/buffer.html), while the client receives [DataViews](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) and sends ArrayBuffers.
|
||||
Therefor the server can't share the same code with the client for hydrate / dehydrate and it's split in two files.
|
||||
Therefore, the server can't share the same code with the client for hydrate / dehydrate, and it's split in two files.
|
||||
|
|
|
@ -25,7 +25,7 @@ export const shardOrigin = shardHost
|
|||
&& `${window.location.protocol}//${shardHost}`;
|
||||
|
||||
/*
|
||||
* Adds customizeable timeout to fetch
|
||||
* Adds customizable timeout to fetch
|
||||
* defaults to 8s
|
||||
*/
|
||||
async function fetchWithTimeout(url, options = {}) {
|
||||
|
@ -152,7 +152,7 @@ export async function requestBlock(userId, block) {
|
|||
}
|
||||
|
||||
/*
|
||||
* set / unset provile as private
|
||||
* set / unset profile as private
|
||||
* @param priv
|
||||
* @return error string or null if successful
|
||||
*/
|
||||
|
@ -210,7 +210,7 @@ export async function requestBlockDm(block) {
|
|||
|
||||
/*
|
||||
* leaving Chat Channel (i.e. DM channel)
|
||||
* @param channelId 8nteger id of channel
|
||||
* @param channelId integer id of channel
|
||||
* @return error string or null if successful
|
||||
*/
|
||||
export async function requestLeaveChan(channelId) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Actions taht are used only within popup
|
||||
* Actions that are used only within popup
|
||||
*/
|
||||
|
||||
export function setWindowArgs(args) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* play sounds using the HTML5 AudoContext
|
||||
* play sounds using the HTML5 AudioContext
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* set URL in adress bar, theme-color and title
|
||||
* set URL in address bar, theme-color and title
|
||||
*/
|
||||
|
||||
import {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* set URL and querys in pupup window
|
||||
* set URL and queries in popup window
|
||||
*/
|
||||
import { buildPopUpUrl } from '../../components/windows/popUpAvailable';
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ export type CanvasState = {
|
|||
historicalDate: string,
|
||||
historicalTime: string,
|
||||
hover: Array,
|
||||
// object with all canvas informations from all canvases like colors and size
|
||||
// object with all canvas information from all canvases like colors and size
|
||||
canvases: Object,
|
||||
// last canvas view, scale, selectedColor and viewscale
|
||||
// just used to get back to the previous coordinates when switching
|
||||
|
@ -46,7 +46,7 @@ export type CanvasState = {
|
|||
|
||||
/*
|
||||
* parse url hash and sets view to coordinates
|
||||
* @param canvases Object with all canvas informations
|
||||
* @param canvases Object with all canvas information
|
||||
* @return view, viewscale and scale for state
|
||||
*/
|
||||
function getViewFromURL(canvases) {
|
||||
|
@ -331,7 +331,7 @@ export default function canvasReducer(
|
|||
scale,
|
||||
isHistoricalView,
|
||||
historicalCanvasSize,
|
||||
// rember view, scale and viewscale
|
||||
// remember view, scale and viewscale
|
||||
prevCanvasCoords: {
|
||||
...state.prevCanvasCoords,
|
||||
[prevCanvasId]: {
|
||||
|
|
|
@ -9,7 +9,7 @@ const initialState = {
|
|||
mailreg: false,
|
||||
// blocking all Dms
|
||||
blockDm: false,
|
||||
// privile is private
|
||||
// profile is private
|
||||
priv: false,
|
||||
// if user is using touchscreen
|
||||
isOnMobile: false,
|
||||
|
|
|
@ -69,7 +69,7 @@ function clampPos(prefXPos, prefYPos, width, height) {
|
|||
}
|
||||
|
||||
/*
|
||||
* correct window positions according to screensize
|
||||
* correct window positions according to screen size
|
||||
* to make sure that none if off-screen
|
||||
*/
|
||||
function correctPositions(state) {
|
||||
|
@ -189,7 +189,7 @@ export default function windows(
|
|||
switch (action.type) {
|
||||
case 'OPEN_WIN': {
|
||||
/*
|
||||
* prefered xPos, yPos, height adn width
|
||||
* preferred xPos, yPos, height adn width
|
||||
* can be given in action (but doesn't have to)
|
||||
*/
|
||||
const {
|
||||
|
|
|
@ -61,7 +61,7 @@ const store = createStore(
|
|||
);
|
||||
|
||||
/*
|
||||
* persistStore of redix-persist is called in client.js
|
||||
* persistStore of redux-persist is called in client.js
|
||||
*/
|
||||
|
||||
export default store;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Control in- and outcomming pixels,
|
||||
* Control incoming and outgoing pixels,
|
||||
* do client prediction, send to draw on renderer
|
||||
*/
|
||||
import { t } from 'ttag';
|
||||
|
@ -132,7 +132,7 @@ class PixelTransferController {
|
|||
store.dispatch(notify(t`Pixel protected!`));
|
||||
break;
|
||||
case 9:
|
||||
// pixestack used up
|
||||
// pixelstack used up
|
||||
break;
|
||||
case 10:
|
||||
errorTitle = 'Captcha';
|
||||
|
|
|
@ -79,7 +79,7 @@ Sky.SkyShader = {
|
|||
|
||||
// wavelength of used primaries, according to preetham
|
||||
const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );
|
||||
// this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function:
|
||||
// this pre-calculation replaces older TotalRayleigh(vec3 lambda) function:
|
||||
// (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn))
|
||||
const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );
|
||||
|
||||
|
@ -122,7 +122,7 @@ Sky.SkyShader = {
|
|||
|
||||
float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );
|
||||
|
||||
// extinction (absorbtion + out scattering)
|
||||
// extinction (absorption + out scattering)
|
||||
// rayleigh coefficients
|
||||
vBetaR = totalRayleigh * rayleighCoefficient;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* placeholder that shows underneach cursor
|
||||
* placeholder that shows underneath cursor
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -11,13 +11,13 @@ import { HourlyCron } from './cron';
|
|||
const HYSTERESIS = 60;
|
||||
|
||||
/*
|
||||
* class to serve proxyckec.io key
|
||||
* class to serve proxycheck.io key
|
||||
* One paid account is allowed to have one additional free account,
|
||||
* which is good for fallback, if something goes wrong
|
||||
*/
|
||||
class PcKeyProvider {
|
||||
/*
|
||||
* @param pcKeys comma seperated list of keys
|
||||
* @param pcKeys comma separated list of keys
|
||||
*/
|
||||
constructor(pcKeys, logger) {
|
||||
const keys = (pcKeys)
|
||||
|
@ -86,7 +86,7 @@ class PcKeyProvider {
|
|||
}
|
||||
|
||||
/*
|
||||
* get usage data of array of keys and put them into available / diabledKeys
|
||||
* get usage data of array of keys and put them into available / disabledKeys
|
||||
* @param keys Array of key strings
|
||||
*/
|
||||
async getKeysUsage(keys) {
|
||||
|
@ -346,7 +346,7 @@ class ProxyCheck {
|
|||
try {
|
||||
res = await this.reqProxyCheck(values);
|
||||
} catch (err) {
|
||||
this.logger.error(`Eroor: ${err.message}`);
|
||||
this.logger.error(`Error: ${err.message}`);
|
||||
}
|
||||
for (let i = 0; i < tasks.length; i += 1) {
|
||||
const task = tasks[i];
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* as well, there is no chance for this to be merged upstream
|
||||
*
|
||||
* Links:
|
||||
* express-session readmy with Session Store Implementation section:
|
||||
* express-session readme with Session Store Implementation section:
|
||||
* https://github.com/expressjs/session#readme
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -94,7 +94,7 @@ export function validateCoorRange(ulcoor, brcoor, canvasSize) {
|
|||
} else if (Number.isNaN(v)) {
|
||||
error = 'y of bottom-right corner is not a valid number';
|
||||
} else if (u < x || v < y) {
|
||||
error = 'Corner coordinates are alligned wrong';
|
||||
error = 'Corner coordinates are aligned wrong';
|
||||
}
|
||||
if (error !== null) {
|
||||
return error;
|
||||
|
|
|
@ -170,7 +170,7 @@ function singleWhoisQuery(
|
|||
}
|
||||
|
||||
/*
|
||||
* check if whois result is refering us to
|
||||
* check if whois result is referring us to
|
||||
* a different whois server
|
||||
*/
|
||||
const referralKeys = [
|
||||
|
@ -219,8 +219,8 @@ export default async function whoisIp(
|
|||
queryPrefix = '+ n';
|
||||
} else if (useHost === 'whois.ripe.net') {
|
||||
/*
|
||||
* flag to not return personal informations, otherwise
|
||||
* RIPE is gonne rate limit and ban
|
||||
* flag to not return personal information, otherwise
|
||||
* RIPE is gonna rate limit and ban
|
||||
*/
|
||||
queryPrefix = '-r';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user