From 1a4ae14242218da07dc891aa2f4420d5f89cb52d Mon Sep 17 00:00:00 2001 From: jsrobson10 Date: Wed, 10 Apr 2019 20:24:41 +1000 Subject: [PATCH] Got authentication between the server and the client --- .gitignore | 1 + scripts/communications.js | 18 +++++++----------- 2 files changed, 8 insertions(+), 11 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..971f95c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +profiles.json diff --git a/scripts/communications.js b/scripts/communications.js index b275033..cd9a286 100644 --- a/scripts/communications.js +++ b/scripts/communications.js @@ -371,17 +371,13 @@ function connect(profile, connection_id) //console.log("Sending 1:", data['out']); - // Send status - socket_write(client, g.encryption, 1); - - console.log("Trying to get login data"); - - // Create a variable - var userdata_filename = "servers/"+hostname+":"+port.toString()+".json"; - console.log(userdata_filename); - - // Try and get the users login data - //var userdata = readFile() + // Send login + console.log("Sending login") + socket_write(client, g.encryption, { + mode: "login", + username: profile.username, + password: profile.password + }); } });