Browse Source

Merge branch 'master' into 'release'

bug #1845

See merge request Isleward/isleward!569
tags/v0.10.5
Big Bad Waffle 2 years ago
parent
commit
fbea76626a
7 changed files with 45 additions and 10 deletions
  1. +1
    -1
      src/client/package.json
  2. +2
    -2
      src/client/ui/templates/login/template.html
  3. +16
    -0
      src/server/components/particles.js
  4. +1
    -1
      src/server/config/serverConfig.js
  5. +1
    -1
      src/server/package.json
  6. +15
    -5
      src/server/security/router.js
  7. +9
    -0
      src/server/security/routerConfig.js

+ 1
- 1
src/client/package.json View File

@@ -1,6 +1,6 @@
{
"name": "isleward_client",
"version": "0.10.4",
"version": "0.10.5",
"description": "isleward",
"dependencies": {
},


+ 2
- 2
src/client/ui/templates/login/template.html View File

@@ -11,11 +11,11 @@
</div>
<div class="message"></div>
</div>
<div class="news" location="https://gitlab.com/Isleward/play.isleward.com/-/wikis/v0.10.4-Release-Notes">[ Latest Release Notes ]</div>
<div class="news" location="https://gitlab.com/Isleward/play.isleward.com/-/wikis/v0.10.5-Release-Notes">[ Latest Release Notes ]</div>
<div class="extra">
<div class="el btn btnPatreon monetization" location="https://patreon.com/bigbadwaffle">Pledge on Patreon</div>
<div class="el btn btnPaypal monetization" location="https://www.paypal.com/donate?hosted_button_id=NEQAV3NG9PWXA">Donate on Paypal</div>
<div class="el btn btnWiki" location="http://wiki.isleward.com/Main_Page">Access the Wiki</div>
</div>
<div class="version" location="https://gitlab.com/Isleward/play.isleward.com/-/wikis/v0.10.4-Release-Notes">v0.10.4</div>
<div class="version" location="https://gitlab.com/Isleward/play.isleward.com/-/wikis/v0.10.5-Release-Notes">v0.10.5</div>
</div>

+ 16
- 0
src/server/components/particles.js View File

@@ -0,0 +1,16 @@
module.exports = {
type: 'particles',

blueprint: null,

simplify: function (self) {
const { blueprint } = this;

const result = {
type: 'particles',
blueprint
};

return result;
}
};

+ 1
- 1
src/server/config/serverConfig.js View File

@@ -1,5 +1,5 @@
module.exports = {
version: '0.10.4',
version: '0.10.5',
port: 4000,
startupMessage: 'Server: ready',
defaultZone: 'fjolarok',


+ 1
- 1
src/server/package.json View File

@@ -1,6 +1,6 @@
{
"name": "isleward_server",
"version": "0.10.4",
"version": "0.10.5",
"description": "isleward",
"dependencies": {
"axios": "^0.22.0",


+ 15
- 5
src/server/security/router.js View File

@@ -1,17 +1,27 @@
const { routerConfig: { allowed, secondaryAllowed, globalAllowed } } = require('./routerConfig');
const { routerConfig: { allowed, secondaryAllowed, globalAllowed, allowTargetId } } = require('./routerConfig');

module.exports = {
allowedCpn: function (msg) {
let valid = allowed[msg.cpn] && allowed[msg.cpn].includes(msg.method);
const { cpn, method, data: { cpn: secondaryCpn, method: secondaryMethod, targetId } } = msg;

const valid = allowed[cpn] && allowed[cpn].includes(method);
if (!valid)
return false;

if (!msg.data.cpn)
if (!secondaryCpn)
return true;

const result = secondaryAllowed[msg.data.cpn] && secondaryAllowed[msg.data.cpn].includes(msg.data.method);
const secondaryValid = secondaryAllowed?.[secondaryCpn]?.includes(secondaryMethod);
if (!secondaryValid)
return false;

if (targetId !== undefined) {
const canHaveTargetId = allowTargetId?.[secondaryCpn]?.includes(secondaryMethod);
if (!canHaveTargetId)
return false;
}

return result;
return true;
},

allowedGlobal: function (msg) {


+ 9
- 0
src/server/security/routerConfig.js View File

@@ -25,6 +25,15 @@ const routerConfig = {
clientConfig: ['getClientConfig'],
leaderboard: ['requestList'],
cons: ['unzone']
},
allowTargetId: {
door: ['lock', 'unlock'],
gatherer: ['gather'],
equipment: ['inspect'],
stash: ['open'],
social: ['declineInvite'],
wardrobe: ['open', 'apply'],
workbench: ['open', 'craft', 'getRecipe']
}
};



Loading…
Cancel
Save