mirror of https://github.com/bra1n/townsquare.git
Merge branch 'main' into dependabot/npm_and_yarn/lodash-4.17.19
This commit is contained in:
commit
7c89306264
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "townsquare",
|
"name": "townsquare",
|
||||||
"version": "1.4.0",
|
"version": "1.5.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "townsquare",
|
"name": "townsquare",
|
||||||
"version": "1.4.0",
|
"version": "1.5.0",
|
||||||
"description": "Blood on the Clocktower Town Square",
|
"description": "Blood on the Clocktower Town Square",
|
||||||
"author": "Steffen Baumgart",
|
"author": "Steffen Baumgart",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -9,7 +9,9 @@ const server = https.createServer({
|
||||||
const wss = new WebSocket.Server({
|
const wss = new WebSocket.Server({
|
||||||
...(process.env.NODE_ENV === "development" ? { port: 8081 } : { server }),
|
...(process.env.NODE_ENV === "development" ? { port: 8081 } : { server }),
|
||||||
verifyClient: info =>
|
verifyClient: info =>
|
||||||
!!info.origin.match(/^https?:\/\/(bra1n\.github\.io|localhost)/i)
|
!!info.origin.match(
|
||||||
|
/^https?:\/\/(bra1n\.github\.io|localhost|eddbra1nprivatetownsquare\.xyz)/i
|
||||||
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
function noop() {}
|
function noop() {}
|
||||||
|
|
|
@ -806,7 +806,8 @@ li.move:not(.from) .player .overlay svg.move {
|
||||||
}
|
}
|
||||||
|
|
||||||
.player.dead .night em {
|
.player.dead .night em {
|
||||||
opacity: 0;
|
color: #ddd;
|
||||||
|
background: linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, gray 100%) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Reminder token *****/
|
/***** Reminder token *****/
|
||||||
|
|
|
@ -82,6 +82,8 @@ export default {
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
background-size: 100%;
|
background-size: 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center 30%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
|
@ -25,8 +25,8 @@ const getters = {
|
||||||
nightOrder({ players }) {
|
nightOrder({ players }) {
|
||||||
const firstNight = [0];
|
const firstNight = [0];
|
||||||
const otherNight = [0];
|
const otherNight = [0];
|
||||||
players.forEach(({ role, isDead }) => {
|
players.forEach(({ role }) => {
|
||||||
if (isDead) return;
|
// if (isDead) return;
|
||||||
if (role.firstNight && !firstNight.includes(role.firstNight)) {
|
if (role.firstNight && !firstNight.includes(role.firstNight)) {
|
||||||
firstNight.push(role.firstNight);
|
firstNight.push(role.firstNight);
|
||||||
}
|
}
|
||||||
|
@ -102,6 +102,8 @@ const mutations = {
|
||||||
state.players[to],
|
state.players[to],
|
||||||
state.players[from]
|
state.players[from]
|
||||||
];
|
];
|
||||||
|
// hack: "modify" the array so that Vue notices something changed
|
||||||
|
state.players.splice(0, 0);
|
||||||
},
|
},
|
||||||
move(state, [from, to]) {
|
move(state, [from, to]) {
|
||||||
state.players.splice(to, 0, state.players.splice(from, 1)[0]);
|
state.players.splice(to, 0, state.players.splice(from, 1)[0]);
|
||||||
|
|
|
@ -105,9 +105,19 @@ class LiveSession {
|
||||||
this._handlePing(params);
|
this._handlePing(params);
|
||||||
break;
|
break;
|
||||||
case "nomination":
|
case "nomination":
|
||||||
|
if (!this._isSpectator) return;
|
||||||
this._store.commit("session/nomination", { nomination: params });
|
this._store.commit("session/nomination", { nomination: params });
|
||||||
break;
|
break;
|
||||||
|
case "swap":
|
||||||
|
if (!this._isSpectator) return;
|
||||||
|
this._store.commit("players/swap", params);
|
||||||
|
break;
|
||||||
|
case "move":
|
||||||
|
if (!this._isSpectator) return;
|
||||||
|
this._store.commit("players/move", params);
|
||||||
|
break;
|
||||||
case "votingSpeed":
|
case "votingSpeed":
|
||||||
|
if (!this._isSpectator) return;
|
||||||
this._store.commit("session/setVotingSpeed", params);
|
this._store.commit("session/setVotingSpeed", params);
|
||||||
break;
|
break;
|
||||||
case "vote":
|
case "vote":
|
||||||
|
@ -495,6 +505,24 @@ class LiveSession {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Swap two player seats. ST only
|
||||||
|
* @param payload
|
||||||
|
*/
|
||||||
|
swapPlayer(payload) {
|
||||||
|
if (this._isSpectator) return;
|
||||||
|
this._send("swap", payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Move a player to another seat. ST only
|
||||||
|
* @param payload
|
||||||
|
*/
|
||||||
|
movePlayer(payload) {
|
||||||
|
if (this._isSpectator) return;
|
||||||
|
this._send("move", payload);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default store => {
|
export default store => {
|
||||||
|
@ -530,9 +558,13 @@ export default store => {
|
||||||
case "setEdition":
|
case "setEdition":
|
||||||
session.sendEdition();
|
session.sendEdition();
|
||||||
break;
|
break;
|
||||||
case "players/set":
|
|
||||||
case "players/swap":
|
case "players/swap":
|
||||||
|
session.swapPlayer(payload);
|
||||||
|
break;
|
||||||
case "players/move":
|
case "players/move":
|
||||||
|
session.movePlayer(payload);
|
||||||
|
break;
|
||||||
|
case "players/set":
|
||||||
case "players/clear":
|
case "players/clear":
|
||||||
case "players/remove":
|
case "players/remove":
|
||||||
case "players/add":
|
case "players/add":
|
||||||
|
|
Loading…
Reference in New Issue