@@ -7,12 +7,11 @@ extends Node2D
7
7
@onready var request : HTTPRequest = $ HTTPRequest
8
8
@onready var timer : Timer = $ Timer
9
9
@onready var api2 : PraxisEndpoints = $ PraxisEndpoints
10
- # TODO: move passkey to a variable and change it.
10
+ var passkey = "UniquePasskeyGoesHere"
11
11
12
12
# Called when the node enters the scene tree for the first time.
13
13
func _ready ():
14
- # TODO: check for saved credentials, set into textboxes if found.
15
- var lastData = FileAccess .open_encrypted_with_pass ("user://savedData.access" , FileAccess .READ , "passkeyGoesHere" )
14
+ var lastData = FileAccess .open_encrypted_with_pass ("user://savedData.access" , FileAccess .READ , passkey )
16
15
if (lastData != null ):
17
16
var data = lastData .get_as_text ().split ("|" )
18
17
if (data [2 ].ends_with ('/' )):
@@ -28,7 +27,7 @@ func _on_btn_login_pressed():
28
27
print ("login pressed" )
29
28
lblError .text = "Logging in...."
30
29
31
- PraxisMapper .serverURL = txtServer .text
30
+ PraxisServer .serverURL = txtServer .text
32
31
api2 .response_data .connect (login_completed )
33
32
api2 .Login ('' , txtUsername .text , txtPassword .text )
34
33
@@ -42,22 +41,22 @@ func login_completed(result):
42
41
json .parse (result .get_string_from_utf8 ())
43
42
var data = json .get_data ()
44
43
print (data )
45
- # if successful, save name/pwd/server to file to load as auto-login next time. #NOTE: may use ConfigFile for this specifically.
44
+ # if successful, save name/pwd/server to file to load as auto-login next time.
46
45
var authData = FileAccess .open_encrypted_with_pass ("user://savedData.access" , FileAccess .WRITE , "passkeyGoesHere" )
47
46
authData .store_string (txtUsername .text + "|" + txtPassword .text + "|" + txtServer .text )
48
47
authData .close ()
49
48
50
- PraxisMapper .username = txtUsername .text
51
- PraxisMapper .password = txtPassword .text
52
- PraxisMapper .serverURL = txtServer .text
53
- PraxisMapper .authKey = data .authToken
49
+ PraxisServer .username = txtUsername .text
50
+ PraxisServer .password = txtPassword .text
51
+ PraxisServer .serverURL = txtServer .text
52
+ PraxisServer .authKey = data .authToken
54
53
55
54
get_tree ().change_scene_to_file ("res://Scenes/OverheadView.tscn" )
56
55
57
56
func _on_btn_create_acct_pressed ():
58
57
print ("create pressed" )
59
58
lblError .text = "Creating account...."
60
- PraxisMapper .serverURL = txtServer .text
59
+ PraxisServer .serverURL = txtServer .text
61
60
api2 .response_data .connect (createCompleted )
62
61
api2 .CreateAccount (txtUsername .text , txtPassword .text )
63
62
0 commit comments