+
+
{saw(pingColour(ping))}
{ping}ms
-
-
-
-
-
-
+
+
);
}
diff --git a/client/src/components/controls.jsx b/client/src/components/controls.jsx
index 0fb9c396..68caa887 100644
--- a/client/src/components/controls.jsx
+++ b/client/src/components/controls.jsx
@@ -34,7 +34,7 @@ function Controls(args) {
if (game) return
;
if (instance) return
;
if (nav === 'play' || !nav) return
- if (nav === 'team' || !nav) return
+ if (nav === 'team' || nav === 'account') return
return false;
}
diff --git a/client/src/components/inventory.jsx b/client/src/components/inventory.jsx
index 4f074240..4bb2b0a2 100644
--- a/client/src/components/inventory.jsx
+++ b/client/src/components/inventory.jsx
@@ -1,8 +1,11 @@
const { connect } = require('preact-redux');
+const { Elements } = require('react-stripe-elements');
+
const preact = require('preact');
const toast = require('izitoast');
const actions = require('./../actions');
+const StripeBtns = require('./stripe.buttons');
const addState = connect(
function receiveState(state) {
@@ -63,15 +66,18 @@ function Inventory(args) {
return (
-
¤ {account.balance}
+
Shop
+
+
+
- {shop.owned.map(useMtx)}
+ {shop.available.map(availableMtx)}
-
Shop
+
¤ {account.balance}
- {shop.available.map(availableMtx)}
+ {shop.owned.map(useMtx)}
diff --git a/client/src/components/main.jsx b/client/src/components/main.jsx
index 09805b55..44948fe2 100644
--- a/client/src/components/main.jsx
+++ b/client/src/components/main.jsx
@@ -7,6 +7,7 @@ const Game = require('./game');
const Instance = require('./instance.component');
const Team = require('./team');
const Play = require('./play');
+const Account = require('./account.page');
const addState = connect(
state => {
@@ -38,6 +39,7 @@ function Main(props) {
if (nav === 'transition') return false;
if (nav === 'play') return
;
if (nav === 'team') return
;
+ if (nav === 'account') return
;
return (
diff --git a/client/src/components/stripe.buttons.jsx b/client/src/components/stripe.buttons.jsx
new file mode 100644
index 00000000..e660e4a9
--- /dev/null
+++ b/client/src/components/stripe.buttons.jsx
@@ -0,0 +1,54 @@
+const preact = require('preact');
+const { injectStripe } = require('react-stripe-elements');
+
+function BitsBtn(args) {
+ const {
+ stripe,
+ account,
+ } = args;
+ function subscribeClick() {
+ stripe.redirectToCheckout({
+ items: [{ plan: 'plan_FGmRwawcOJJ7Nv', quantity: 1 }],
+ successUrl: 'http://localhost',
+ cancelUrl: 'http://localhost',
+ clientReferenceId: account.id,
+ });
+ }
+
+ function bitsClick() {
+ stripe.redirectToCheckout({
+ items: [{ sku: 'sku_FHUfNEhWQaVDaT', quantity: 1 }],
+ successUrl: 'http://localhost',
+ cancelUrl: 'http://localhost',
+ clientReferenceId: account.id,
+ });
+ }
+
+ const subscription = account.subscribed
+ ?
+ :
;
+
+ return (
+
+ {subscription}
+
+
+
+ );
+}
+
+module.exports = injectStripe(BitsBtn);
diff --git a/client/src/components/team.jsx b/client/src/components/team.jsx
index fa44db67..b15980b1 100644
--- a/client/src/components/team.jsx
+++ b/client/src/components/team.jsx
@@ -89,10 +89,10 @@ function Team(args) {
.map(i =>
sendConstructSpawn()} />);
return (
-
+
{constructPanels}
{spawnButtons}
-
+
);
}
diff --git a/etc/nginx/sites-available/mnml.gg.STAGING.SAMPLE.nginx.conf b/etc/nginx/sites-available/mnml.gg.STAGING.SAMPLE.nginx.conf
index 349950ef..1d1d2bbf 100644
--- a/etc/nginx/sites-available/mnml.gg.STAGING.SAMPLE.nginx.conf
+++ b/etc/nginx/sites-available/mnml.gg.STAGING.SAMPLE.nginx.conf
@@ -2,6 +2,17 @@ upstream mnml_dev {
server 0.0.0.0:41337;
}
+error_log /var/log/mnml/nginx.log;
+
+upstream mnml_http {
+ server 127.0.0.1:40000;
+}
+
+upstream mnml_ws {
+ server 127.0.0.1:40055;
+}
+
+
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
@@ -9,25 +20,19 @@ map $http_upgrade $connection_upgrade {
# DEV
server {
- root /var/lib/mnml/public/;
- index index.html;
-
- server_name dev.mnml.gg; # managed by Certbot
-
location / {
+ root /var/lib/mnml/public/current;
+ index index.html;
+ try_files $uri $uri/ index.html;
+ }
+
+ location /imgs/ {
+ root /var/lib/mnml/public/;
try_files $uri $uri/ =404;
}
- listen [::]:443;
- ssl on;
- listen 443 ssl; # managed by Certbot
- ssl_certificate /etc/letsencrypt/live/dev.mnml.gg/fullchain.pem; # managed by Certbot
- ssl_certificate_key /etc/letsencrypt/live/dev.mnml.gg/privkey.pem; # managed by Certbot
- include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
- ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
-
location /api/ws {
- proxy_pass http://mnml_dev;
+ proxy_pass http://mnml_ws;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
@@ -35,13 +40,34 @@ server {
}
location /api/ {
- proxy_pass http://mnml_dev;
+ proxy_pass http://mnml_http;
proxy_read_timeout 600s;
}
+ listen [::]:443 ssl ipv6only=on; # managed by Certbot
+ listen 443 ssl; # managed by Certbot
+ ssl_certificate /etc/letsencrypt/live/mnml.gg/fullchain.pem; # managed by Certbot
+ ssl_certificate_key /etc/letsencrypt/live/mnml.gg/privkey.pem; # managed by Certbot
+ include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
+ ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
# http -> https
+server {
+ server_name mnml.gg;
+ return 301 https://$host$request_uri;
+}
+
+server {
+ server_name minimal.gg;
+ return 301 https://mnml.gg$request_uri;
+}
+
+server {
+ server_name cryps.gg;
+ return 301 https://mnml.gg$request_uri;
+}
+
server {
server_name dev.mnml.gg;
return 301 https://$host$request_uri;
diff --git a/server/src/names.rs b/server/src/names.rs
index 49849d2c..e5ff7943 100644
--- a/server/src/names.rs
+++ b/server/src/names.rs
@@ -1,7 +1,7 @@
use rand::prelude::*;
use rand::{thread_rng};
-const FIRSTS: [&'static str; 47] = [
+const FIRSTS: [&'static str; 50] = [
"artificial",
"ambient",
"borean",
@@ -20,10 +20,13 @@ const FIRSTS: [&'static str; 47] = [
"fierce",
"fossilised",
"frozen",
+ "gravitational",
+ "jovian",
"inverted",
"leafy",
"lurking",
"limitless",
+ "magnetic",
"metallic",
"mossy",
"mighty",
@@ -37,6 +40,7 @@ const FIRSTS: [&'static str; 47] = [
"oxygenated",
"oscillating",
"ossified",
+ "orbiting",
"piscine",
"purified",
"recalcitrant",
@@ -46,18 +50,18 @@ const FIRSTS: [&'static str; 47] = [
"supercooled",
"subsonic",
"synthetic",
- "sweet",
"terrestrial",
"weary",
];
-const LASTS: [&'static str; 52] = [
+const LASTS: [&'static str; 55] = [
"artifact",
"assembly",
"carbon",
"console",
"construct",
"craft",
+ "core",
"design",
"drone",
"distortion",
@@ -77,6 +81,8 @@ const LASTS: [&'static str; 52] = [
"lifeform",
"landmass",
"lens",
+ "mantle",
+ "magnetism",
"mechanism",
"mountain",
"nectar",