Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to Install and Rules pages #47

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2d9226d
Updates to Install and Rules pages , compiled from edenxi.com and dis…
JasonHoku May 24, 2020
14a9893
main pr: updates to install and rules
JasonHoku May 24, 2020
e815f00
applied npm run format *
JasonHoku May 24, 2020
e6bd8cf
Don't use /public as static path for serving files
InoUno May 24, 2020
9dece20
Revert "applied npm run format *"
JasonHoku May 25, 2020
f54e697
resolved overformatting issue from previous commit
JasonHoku May 25, 2020
42a3add
Temporarily hide the login/register tools.
danny-vvv May 25, 2020
de9b674
fixed install page that was reverted in last commit ^^;
JasonHoku May 27, 2020
3529749
Restore original package files
InoUno May 27, 2020
a7cd5d6
Merge commit 'e6bd8cf2b47959fcaea3444f13524275a577fd77' into disable-…
danny-vvv May 27, 2020
d215936
Add features config with account features disabled, and use config to…
danny-vvv May 27, 2020
a44293a
Use features config to dynamically show/hide login and registration c…
danny-vvv May 27, 2020
5c0dccf
Merge remote-tracking branch 'origin/fix/prod-path' into PR-Install-&…
JasonHoku May 28, 2020
e209c3c
Merge branch 'develop' into PR-Install-&-Rules-info-updates
JasonHoku May 28, 2020
30fd728
Revert "fixed install page that was reverted in last commit ^^;"
JasonHoku May 28, 2020
caa550d
[x]I like the last updated timestamp on terms and conditions. Maybe w…
JasonHoku May 28, 2020
5fe4333
ran prettier :P
JasonHoku May 28, 2020
370a6cc
Merge remote-tracking branch 'origin/disable-login' into PR-Install-&…
JasonHoku May 28, 2020
e8efe24
fix for install/rules pr
JasonHoku May 29, 2020
0ef8104
Restored quote formatting error caused by overzealous vscode plugin.
JasonHoku May 29, 2020
10618bc
Fixed formatting errors caused by overzealous vsc addon.
JasonHoku May 29, 2020
a5e6265
Merge remote-tracking branch 'origin/Branch_30fd728e' into PR-Install…
JasonHoku May 29, 2020
3827d23
Merge branch 'develop' into PR-Install-&-Rules-info-updates
JasonHoku May 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
},
"[javascriptreact]": {
"editor.formatOnSave": true
}
},
"typescript.tsdk": "node_modules\\typescript\\lib"
}
26 changes: 26 additions & 0 deletions api/v1/accounts.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { features } from './config';

const jwt = require('jsonwebtoken');
const request = require('request');
const { Router } = require('express');
Expand Down Expand Up @@ -53,6 +55,12 @@ router.get('/profile', validate, async (req, res) => {
});

router.post('/register', (req, res) => {
if (!features.registration) {
return res
.status(403)
.send({ message: 'This action is currently disabled in server config.' });
}

const disallowedIP = [];

const {
Expand Down Expand Up @@ -188,6 +196,12 @@ router.post('/register', (req, res) => {
});

router.put('/email', validate, async (req, res) => {
if (!features.changeEmail) {
return res
.status(403)
.send({ message: 'This action is currently disabled in server config.' });
}

try {
const statement = 'UPDATE accounts SET `email` = ? WHERE id = ?;';
const result = await req.app.locals.query(statement, [
Expand All @@ -204,6 +218,12 @@ router.put('/email', validate, async (req, res) => {
});

router.put('/password', validate, async (req, res) => {
if (!features.changePassword) {
return res
.status(403)
.send({ message: 'This action is currently disabled in server config.' });
}

try {
const statement =
'UPDATE accounts SET `password` = PASSWORD(?) WHERE id = ?;';
Expand All @@ -221,6 +241,12 @@ router.put('/password', validate, async (req, res) => {
});

router.post('/login', async (req, res) => {
if (!features.login) {
return res
.status(403)
.send({ message: 'This action is currently disabled in server config.' });
}

try {
const { user, pass } = req.headers;
const statement =
Expand Down
56 changes: 33 additions & 23 deletions api/v1/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
module.exports = {
features: {
login: false,
registration: false,
changePassword: false,
changeEmail: false,
},
posts: [
{
date: '2020-02-19T23:27:48.649Z',
Expand All @@ -20,29 +26,33 @@ module.exports = {
'You acknowledge that Eden has no ownership over or affiliation with any of the content, images, registered trademarks or any other rights reserved by SQUARE ENIX CO., LTD.',
],
rules: [
'Using a non-Eden bootloader--including using a modified version of the Eden bootloader--is NOT allowed. The bootloader must be downloaded from the official site or #annoucements channel in our official Discord otherwise there are no guarantees it is official.',
'Until a technical solution is implemented, no more than 8 monsters may be intentionally gathered to kill at the same time.',
'If something feels like it is broken, either not like it was on era retail or a potential exploit or too overpowered. (read: if something seems like it was not intentional from the development team) report it. Knowingly taking advantage of these activities is NOT allowed.',
'Each player is only allowed to have 2 characters logged in and active, with an additional third character confined to a city and idle. This character may only be used to bazaar or mule items while your other characters are logged in. (This will not be locked down by IP, but it will be actively patrolled.) Tri-boxing 3 or more active characters is NOT allowed.',
'Claim bots, modifying dats to claim, any type of targeting using mob id (such as /target 12345678) or using any other third party tools such as Shorthand or its Windower equivalent to claim is NOT allowed.',
"Any scripts, bots, or addons that automate actions are NOT allowed. Macros using the /wait or <wait> feature within the game are OK. (Such as /lastsynth macros up to the game's maximum of 6 lines.)",
"Account sharing is strongly discouraged and may be disallowed in the future. If one or more of your accounts are linked to a player that is caught cheating by either logging into an offending player's account or by that player logging into one of your accounts you will share the same punishment as the cheater--which is 9 out of 10 times a permanent ban.",
'Not really a rule but be aware that players may be limited in the future to 3 characters. So create new ones at your own risk. It is undecided how additional characters would be handled if we imposed these limits.',
'Using known bugs (including terrain) or unpatched exploits to your advantage in a way that would not be possible in retail. For example: purposefully crawling on walls to avoid aggro using the current navmesh’s bugs is NOT allowed. (Note: this does not mean people are exploiting because they are standing on walls. It is a normal reaction to be on a wall. But climbing through tight spaces without oils and powders without aggro is obviously a bug and you will be banned for it.)',
'Testing known or possible exploits on the live server is not allowed unless permission is given from Godmode first. Like every other rule this includes GMs and developers too.',
"Holding a monster for the purpose of grieving other players or monopolizing the time it spawns is NOT allowed (note that since determining a player's intent is highly subjective to the GM addressing the ticket, if asked to begin damage by a GM you must start fighting the monster within a reasonable amount of time or you will forfeit the claim)",
"Reasonable is up to the GM team's discretion.",
'Holding to recover from a wipe is allowed.',
"Intention to kill with reinforcements on the way isn't holding.",
"Not so much a rule either but if you are aware of any non-era item/NM/recipe/et cetera please report it. And do expect the rewards obtained from it to be removed. I can't find every non-era thing at once but as I find them I will be removing them.",
'Creating characters for the purpose of market manipulation is NOT allowed.',
'Gardening is only allowed on up to 3 characters. (30 total plants.)',
'Hacking/exploiting/cheating of any kind including but not limited to buying items and selling back for more than you paid for is NOT allowed.',
'Spamming any public chat. (Linkshells and tells are the exception as they will only be subject to harassment reports.)',
'Harassment of any kind including offensive character or linkshell names is NOT allowed.',
'Character names that depict cheating, could be considered sexually explicit, or any names that could be disallowed on retail are NOT allowed.',
'Use of or advertisement of any cheat program/addon or a non-approved addon/program on Eden or its media. There will be an allowed list and a non-allowed list. Those not in the approved list are discouraged from use as you may be penalized for using them. Use at your own risk. Those that are similar to a forbidden program are most likely forbidden as well.',
'GM interaction is limited here but if a GM messages you in game and you are active, respond within a reasonable time. Ignoring a GM is likely to get you jailed as we will likely think you are afk botting.',
/*
'Using a non-Eden bootloader--including using a modified version of the Eden bootloader--is NOT allowed. The bootloader must be downloaded from the official site or #annoucements channel in our official Discord otherwise there are no guarantees it is official.',
'Until a technical solution is implemented, no more than 8 monsters may be intentionally gathered to kill at the same time.',
'If something feels like it is broken, either not like it was on era retail or a potential exploit or too overpowered. (read: if something seems like it was not intentional from the development team) report it. Knowingly taking advantage of these activities is NOT allowed.',
'Each player is only allowed to have 2 characters logged in and active, with an additional third character confined to a city and idle. This character may only be used to bazaar or mule items while your other characters are logged in. (This will not be locked down by IP, but it will be actively patrolled.) Tri-boxing 3 or more active characters is NOT allowed.',
'Claim bots, modifying dats to claim, any type of targeting using mob id (such as /target 12345678) or using any other third party tools such as Shorthand or its Windower equivalent to claim is NOT allowed.',
"Any scripts, bots, or addons that automate actions are NOT allowed. Macros using the /wait or <wait> feature within the game are OK. (Such as /lastsynth macros up to the game's maximum of 6 lines.)",
"Account sharing is strongly discouraged and may be disallowed in the future. If one or more of your accounts are linked to a player that is caught cheating by either logging into an offending player's account or by that player logging into one of your accounts you will share the same punishment as the cheater--which is 9 out of 10 times a permanent ban.",
'Not really a rule but be aware that players may be limited in the future to 3 characters. So create new ones at your own risk. It is undecided how additional characters would be handled if we imposed these limits.',
'Using known bugs (including terrain) or unpatched exploits to your advantage in a way that would not be possible in retail. For example: purposefully crawling on walls to avoid aggro using the current navmesh’s bugs is NOT allowed. (Note: this does not mean people are exploiting because they are standing on walls. It is a normal reaction to be on a wall. But climbing through tight spaces without oils and powders without aggro is obviously a bug and you will be banned for it.)',
'Testing known or possible exploits on the live server is not allowed unless permission is given from Godmode first. Like every other rule this includes GMs and developers too.',
"Holding a monster for the purpose of grieving other players or monopolizing the time it spawns is NOT allowed (note that since determining a player's intent is highly subjective to the GM addressing the ticket, if asked to begin damage by a GM you must start fighting the monster within a reasonable amount of time or you will forfeit the claim)",
"Reasonable is up to the GM team's discretion.",
' ^Holding to recover from a wipe is allowed.',
"Darters in Dragon's Aery may be held alive 5 minutes from time of claim. Period. Please see #announcements or ask a GM for more information if you need it.",
" ^Intention to kill with reinforcements on the way isn't holding.",
"Not so much a rule either but if you are aware of any non-era item/NM/recipe/et cetera please report it. And do expect the rewards obtained from it to be removed. I can't find every non-era thing at once but as I find them I will be removing them.",
'Creating characters for the purpose of market manipulation is NOT allowed.',
'Gardening is only allowed on up to 3 characters. (30 total plants.)',
'Hacking/exploiting/cheating of any kind including but not limited to buying items and selling back for more than you paid for is NOT allowed.',
'Spamming any public chat. (Linkshells and tells are the exception as they will only be subject to harassment reports.)',
'Harassment of any kind including offensive character or linkshell names is NOT allowed.',
'Character names that depict cheating, could be considered sexually explicit, or any names that could be disallowed on retail are NOT allowed.',
'Use of or advertisement of any cheat program/addon or a non-approved addon/program on Eden or its media. There will be an allowed list and a non-allowed list. Those not in the approved list are discouraged from use as you may be penalized for using them. Use at your own risk. Those that are similar to a forbidden program are most likely forbidden as well.',
'GM interaction is limited here but if a GM messages you in game and you are active, respond within a reasonable time. Ignoring a GM is likely to get you jailed as we will likely think you are afk botting.',
added directly to rules page for formatting
*/
],
disallowed: [
'Any modified bootloader or a bootloader downloaded from any source other than edenxi.com',
Expand Down
18 changes: 18 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions client/src/components/accounts/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { createHistory } from '@reach/router';
import PropTypes from 'prop-types';
import Login from './login';
import Register from './register';
import Profile from './profile';
Expand Down Expand Up @@ -170,6 +171,7 @@ class Account extends React.Component {

render() {
const { error, profile, loading, signup, verify } = this.state;
const { features } = this.props;
const authorized = !!profile.id;

if (loading) {
Expand All @@ -193,6 +195,7 @@ class Account extends React.Component {
login={this.login}
error={Object.keys(error).length > 0}
changePage={this.changePage}
features={features}
/>
);
}
Expand All @@ -203,4 +206,18 @@ class Account extends React.Component {
}
}

Account.propTypes = {
features: PropTypes.shape({
login: PropTypes.bool,
registration: PropTypes.bool,
}),
};

Account.defaultProps = {
features: {
login: true,
registration: true,
},
};

export default Account;
68 changes: 38 additions & 30 deletions client/src/components/accounts/login.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Form, Button, Message } from 'semantic-ui-react';

export default ({ error, login, changePage }) => {
export default ({ error, login, changePage, features }) => {
const [username, setUsername] = React.useState('');
const [password, setPassword] = React.useState('');
return (
Expand All @@ -11,36 +11,44 @@ export default ({ error, login, changePage }) => {
header="Invalid Credentials"
content="Check your username and password and try again."
/>
<Form.Field error={error}>
<label>Username</label>
<input
placeholder="Username"
name="username"
value={username}
onChange={e => setUsername(e.target.value)}
/>
</Form.Field>
<Form.Field error={error}>
<label>Password</label>
<input
placeholder="Password"
type="password"
name="password"
value={password}
onChange={e => setPassword(e.target.value)}
/>
</Form.Field>
{features.login && (
<>
<Form.Field error={error}>
<label>Username</label>
<input
placeholder="Username"
name="username"
value={username}
onChange={e => setUsername(e.target.value)}
/>
</Form.Field>
<Form.Field error={error}>
<label>Password</label>
<input
placeholder="Password"
type="password"
name="password"
value={password}
onChange={e => setPassword(e.target.value)}
/>
</Form.Field>
</>
)}
<Form.Field>
<Button
floated="right"
primary
onClick={() => login(username, password)}
>
Login
</Button>
<Button size="mini" basic onClick={changePage}>
New Account
</Button>
{features.login && (
<Button
floated="right"
primary
onClick={() => login(username, password)}
>
Login
</Button>
)}
{features.registration && (
<Button size="mini" basic onClick={changePage}>
New Account
</Button>
)}
</Form.Field>
</Form>
);
Expand Down
Loading