update ctrls and add try catch for socket send
This commit is contained in:
parent
c111cfe2b8
commit
2a14fbd3f5
@ -144,6 +144,12 @@ aside {
|
||||
}
|
||||
}
|
||||
|
||||
.play-ctrl {
|
||||
.controls {
|
||||
grid-template-rows: 1fr 1fr 1fr 3fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.abandon:not([disabled]) {
|
||||
&:hover {
|
||||
color: @red;
|
||||
|
||||
@ -130,8 +130,6 @@ function JoinButtons(args) {
|
||||
<aside class='play-ctrl'>
|
||||
<div class="timer-container"></div>
|
||||
<div class="controls">
|
||||
{discordBtn}
|
||||
<div class="flex">
|
||||
<button
|
||||
class='practice ready'
|
||||
onClick={() => sendInstancePractice()}
|
||||
@ -139,7 +137,7 @@ function JoinButtons(args) {
|
||||
Learn
|
||||
</button>
|
||||
{inviteBtn()}
|
||||
</div>
|
||||
{discordBtn}
|
||||
<AccountBox />
|
||||
<div class="instance-ctrl-btns">
|
||||
<button disabled={true} >Chat</button>
|
||||
|
||||
@ -93,18 +93,18 @@ function Play(args) {
|
||||
return (
|
||||
<section class="top">
|
||||
<div class="news">
|
||||
<h1>v{VERSION}</h1>
|
||||
<h2>v{VERSION}</h2>
|
||||
<p class="play-p">Use the buttons on the right to join an instance.</p>
|
||||
<p>
|
||||
Select <b>PVP</b> to play against other players.<br />
|
||||
Select <b>INVITE</b> then click <b>COPY LINK</b> to generate an instance invitation for a friend.<br />
|
||||
Click <b>LEARN</b> to practice the game without time controls.
|
||||
</p>
|
||||
<p>Join our Discord server to find opponents, message @ntr or @mashy for some credits to get started.</p>
|
||||
<p>
|
||||
If you enjoy the game please support its development by <b>subscribing</b> or purchasing <b>credits</b>.<br />
|
||||
glhf
|
||||
</p>
|
||||
<p>--ntr & mashy</p>
|
||||
</div>
|
||||
<div>
|
||||
<h1 class="credits">¤ {account.balance}</h1>
|
||||
|
||||
@ -30,7 +30,12 @@ function createSocket(events) {
|
||||
// -------------
|
||||
function send(msg) {
|
||||
if (msg[0] !== 'Ping') console.log('outgoing msg', msg);
|
||||
try {
|
||||
ws.send(cbor.encode(msg));
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
return connect();
|
||||
}
|
||||
}
|
||||
|
||||
let ping;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user