aboutsummaryrefslogtreecommitdiff
path: root/webAO
diff options
context:
space:
mode:
Diffstat (limited to 'webAO')
-rw-r--r--webAO/client.ts19
-rw-r--r--webAO/styles/client.css11
2 files changed, 24 insertions, 6 deletions
diff --git a/webAO/client.ts b/webAO/client.ts
index 8ced37a..508a844 100644
--- a/webAO/client.ts
+++ b/webAO/client.ts
@@ -75,6 +75,7 @@ let hdid: string;
declare global {
interface Window {
+ handleCredentialResponse: (response: any) => void;
toggleShout: (shout: number) => void;
toggleMenu: (menu: number) => void;
updateBackgroundPreview: () => void;
@@ -237,7 +238,7 @@ class Client extends EventEmitter {
this.on('FM', this.handleFM.bind(this));
this.on('FA', this.handleFA.bind(this));
this.on('SM', this.handleSM.bind(this));
- this.on('MM', this.handleMM.bind(this));
+ this.on('2F', this.handle2F.bind(this));
this.on('BD', this.handleBD.bind(this));
this.on('BB', this.handleBB.bind(this));
this.on('KB', this.handleKB.bind(this));
@@ -493,8 +494,8 @@ class Client extends EventEmitter {
* to the server.
*/
joinServer() {
- this.sendServer(`HI#${hdid}#%`);
this.sendServer('ID#webAO#webAO#%');
+ this.sendServer(`HI#${hdid}#%`);
if (mode !== 'replay') { this.checkUpdater = setInterval(() => this.sendCheck(), 5000); }
}
@@ -1303,11 +1304,11 @@ class Client extends EventEmitter {
}
/**
- * Handles the "MusicMode" packet
+ * Handles 2 factor auth
* @param {Array} args packet arguments
*/
- handleMM(_args: string[]) {
- // It's unused nowadays, as preventing people from changing the music is now serverside
+ handle2F(_args: string[]) {
+ document.getElementById('client_secondfactor').style.display = 'block';
}
/**
@@ -3391,4 +3392,10 @@ export function toggleShout(shout: number) {
}
}
window.toggleShout = toggleShout;
-export default Client
+
+function handleCredentialResponse(response: any) {
+ client.sendServer(`2T#${response.credential}#%`);
+}
+window.handleCredentialResponse = handleCredentialResponse;
+
+export default Client \ No newline at end of file
diff --git a/webAO/styles/client.css b/webAO/styles/client.css
index 7f72eb1..e31a8e8 100644
--- a/webAO/styles/client.css
+++ b/webAO/styles/client.css
@@ -68,6 +68,17 @@
animation: error_blink 3s ease-in-out infinite;
}
+#client_secondfactor {
+ display: block;
+ flex-direction: column;
+ justify-content: center;
+ text-align: center;
+ align-items: center;
+ background: black;
+ color: lightgreen;
+ font-size: large;
+}
+
#client_waiting {
display: block;
flex-direction: column;