fix things

This commit is contained in:
HF 2022-09-11 01:18:10 +02:00
parent de1729d56b
commit bd83a66052
6 changed files with 9 additions and 4 deletions

View File

@ -13,7 +13,8 @@ import { IoReloadCircleSharp } from 'react-icons/io5';
import { shardOrigin } from '../store/actions/fetch';
async function getUrlAndId() {
const url = `${shardOrigin}/captcha.svg`;
// const url = `${shardOrigin}/captcha.svg`;
const url = '/captcha.svg';
const resp = await fetch(url, {
cache: 'no-cache',
});

View File

@ -73,7 +73,7 @@ function LanguageSelect() {
host = `.${host}`;
}
// eslint-disable-next-line max-len
document.cookie = `lang=${langSel};expires=${d.toUTCString()};path=/;domain=${host}`;
document.cookie = `plang=${langSel};expires=${d.toUTCString()};path=/;domain=${host}`;
window.location.reload();
}}
>

View File

@ -70,7 +70,7 @@ export const TILE_SIZE = 256;
// how much to scale for a new tiled zoomlevel
export const TILE_ZOOM_LEVEL = 2;
export const COOKIE_SESSION_NAME = 'pixelplanet.session';
export const COOKIE_SESSION_NAME = 'ppfun.session';
export const SECOND = 1000;
export const MINUTE = 60 * SECOND;

View File

@ -37,7 +37,7 @@ export function getTTag(lang) {
*/
export function expressTTag(req, res, next) {
const cookies = cookie.parse(req.headers.cookie || '');
const language = cookies.lang || req.headers['accept-language'];
const language = cookies.plang || req.headers['accept-language'];
req.lang = languageFromLocalisation(language);
req.ttag = getTTag(req.lang);
next();

View File

@ -8,6 +8,7 @@ import { setCaptchaSolution } from '../data/redis/captcha';
export default (req, res) => {
res.set({
'Access-Control-Expose-Headers': 'captcha-id',
'Cache-Control': 'no-cache, no-store, must-revalidate',
});

View File

@ -182,6 +182,9 @@ class MessageBroker extends SocketEvents {
emit(key, ...args) {
super.emit(key, ...args);
if (key === 'recvChatMessage') {
return;
}
const msg = `${this.thisShard}:${key},${JSON.stringify(args)}`;
this.publisher.publish('bc', msg);
}