Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ default_env.tres
.import/
export.cfg
export_presets.cfg
override.cfg

#
# Mono-specific ignores
Expand Down
16 changes: 8 additions & 8 deletions addons/godot-firebase/auth/auth.gd
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func _set_config(config_json : Dictionary) -> void:
# If false it will print an error
func _is_ready() -> bool:
if is_busy:
printerr("Firebase Auth is currently busy and cannot process this request")
Firebase._printerr("Firebase Auth is currently busy and cannot process this request")
return false
else:
return true
Expand Down Expand Up @@ -242,7 +242,7 @@ func _on_FirebaseAuth_request_completed(result : int, response_code : int, heade
var bod = body.get_string_from_utf8()
var json_result = JSON.parse(bod)
if json_result.error != OK:
print_debug("Error while parsing body json")
Firebase._printerr("Error while parsing body json")
return

var res = json_result.result
Expand Down Expand Up @@ -285,12 +285,12 @@ func save_auth(auth : Dictionary) -> void:
var encrypted_file = File.new()
var err = encrypted_file.open_encrypted_with_pass("user://user.auth", File.WRITE, OS.get_unique_id())
if err != OK:
printerr("Error Opening File. Error Code: ", err)
Firebase._printerr("Error Opening File. Error Code: "+ err)
else:
encrypted_file.store_line(to_json(auth))
encrypted_file.close()
else:
printerr("OS Not supported for saving auth data")
Firebase._printerr("OS Not supported for saving auth data")

# Function used to load the auth data file that has been stored locally
# Note this does not work in HTML5 or UWP
Expand All @@ -299,20 +299,20 @@ func load_auth() -> void:
var encrypted_file = File.new()
var err = encrypted_file.open_encrypted_with_pass("user://user.auth", File.READ, OS.get_unique_id())
if err != OK:
printerr("Error Opening File. Error Code: ", err)
Firebase._printerr("Error Opening File. Error Code: "+ err)
else:
var encrypted_file_data = parse_json(encrypted_file.get_line())
manual_token_refresh(encrypted_file_data)
else:
printerr("OS Not supported for loading auth data")
Firebase._printerr("OS Not supported for loading auth data")

# Function used to remove the local encrypted auth file
func remove_auth() -> void:
var dir = Directory.new()
if (dir.file_exists("user://user.auth")):
dir.remove("user://user.auth")
else:
printerr("No encrypted auth file exists")
Firebase._printerr("No encrypted auth file exists")

# Function to check if there is an encrypted auth data file
# If there is, the game will load it and refresh the token
Expand All @@ -321,7 +321,7 @@ func check_auth_file() -> void:
if (dir.file_exists("user://user.auth")):
load_auth()
else:
printerr("No encrypted auth file exists")
Firebase._printerr("No encrypted auth file exists")

# Function used to change the email account for the currently logged in user
func change_user_email(email : String) -> void:
Expand Down
10 changes: 7 additions & 3 deletions addons/godot-firebase/firebase/firebase.gd
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ onready var DynamicLinks : FirebaseDynamicLinks = $DynamicLinks
var _config : Dictionary = {
"apiKey": "",
"authDomain": "",
"databaseURL":"",
"databaseURL": "",
"projectId": "",
"storageBucket": "",
"messagingSenderId": "",
"appId": "",
"measurementId": "",
"clientId": "",
"clientSecret": "",
"domainUriPrefix": "",
Expand All @@ -69,7 +70,10 @@ func _load_config() -> void:
_config[key] = ProjectSettings.get_setting(env_var)
else:
if _config[key] == "":
printerr("Configuration key '{key}' not found!".format({key = key}))
_printerr("Configuration key '{key}' not found!".format({key = key}))
else:
printerr("No configuration settings found, add them in override.cfg file.")
_printerr("No configuration settings found, add them in override.cfg file.")
print("")

func _printerr(error : String) -> void:
print("[Firebase Error] >> "+error)
16 changes: 8 additions & 8 deletions addons/godot-firebase/firestore/firestore.gd
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func _set_offline(value: bool) -> void:
else:
collection.update(document_id, FirestoreDocument.fields2dict(JSON.parse(content).result))
else:
printerr("Failed to retrieve cache %s! Error code: %d" % [cache, file.get_error()])
Firebase._printerr("Failed to retrieve cache %s! Error code: %d" % [cache, file.get_error()])
file.close()
if deleted:
cache_dir.remove(cache)
Expand Down Expand Up @@ -301,12 +301,12 @@ func _pooled_request(task : FirestoreTask) -> void:
return

if not auth:
printerr("Unauthenticated request issued...")
Firebase._printerr("Unauthenticated request issued...")
Firebase.Auth.login_anonymous()
var result : Array = yield(Firebase.Auth, "auth_request")
if result[0] != 1:
_check_auth_error(result[0], result[1])
printerr("Client connected as Anonymous")
Firebase._printerr("Client connected as Anonymous")

task._headers = PoolStringArray([_AUTHORIZATION_HEADER + auth.idtoken])

Expand Down Expand Up @@ -342,19 +342,19 @@ func _on_result_query(result : Array):

func _on_error(code : int, status : int, message : String):
emit_signal("error", code, status, message)
printerr(message)
Firebase._printerr(message)

func _on_task_error(code : int, status : String, message : String):
emit_signal("task_error", code, status, message)
printerr(message)
Firebase._printerr(message)

func _on_task_list_error(code : int, status : String, message : String):
emit_signal("task_error", code, status, message)
printerr(message)
Firebase._printerr(message)

func _on_task_query_error(code : int, status : String, message : String):
emit_signal("task_error", code, status, message)
printerr(message)
Firebase._printerr(message)

func _on_FirebaseAuth_login_succeeded(auth_result : Dictionary) -> void:
auth = auth_result
Expand Down Expand Up @@ -385,4 +385,4 @@ func _check_auth_error(code : int, message : String) -> void:
var err : String
match code:
400: err = "Please, enable Anonymous Sign-in method or Authenticate the Client before issuing a request (best option)"
printerr(err)
Firebase._printerr(err)
6 changes: 3 additions & 3 deletions addons/godot-firebase/firestore/firestore_collection.gd
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ func _process_request(task : FirestoreTask, document_id : String, url : String,
task.connect("task_error", self, "_on_error")

if not auth:
printerr("Unauthenticated request issued...")
Firebase._printerr("Unauthenticated request issued...")
Firebase.Auth.login_anonymous()
var result : Array = yield(Firebase.Auth, "auth_request")
if result[0] != 1:
Firebase.Firestore._check_auth_error(result[0], result[1])
return null
printerr("Client authenticated as Anonymous User.")
Firebase._printerr("Client authenticated as Anonymous User.")

task._url = url
task._fields = fields
Expand Down Expand Up @@ -141,4 +141,4 @@ func _on_delete_document():

func _on_error(code, status, message):
emit_signal("error", code, status, message)
printerr(message)
Firebase._printerr(message)
14 changes: 7 additions & 7 deletions addons/godot-firebase/firestore/firestore_task.gd
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func _handle_cache(offline : bool, data, encrypt_key : String, cache_path : Stri
file.store_line(JSON.print(save))
body_return = save
else:
printerr("Error saving cache file! Error code: %d" % file.get_error())
Firebase._printerr("Error saving cache file! Error code: %d" % file.get_error())
file.close()

Task.TASK_PATCH:
Expand All @@ -225,7 +225,7 @@ func _handle_cache(offline : bool, data, encrypt_key : String, cache_path : Stri
if content != "--deleted--":
save = JSON.parse(content).result
else:
printerr("Error updating cache file! Error code: %d" % file.get_error())
Firebase._printerr("Error updating cache file! Error code: %d" % file.get_error())
file.close()

save.fields = FirestoreDocument.dict2fields(_merge_dict(
Expand All @@ -245,7 +245,7 @@ func _handle_cache(offline : bool, data, encrypt_key : String, cache_path : Stri
file.store_line(JSON.print(save))
body_return = save
else:
printerr("Error updating cache file! Error code: %d" % file.get_error())
Firebase._printerr("Error updating cache file! Error code: %d" % file.get_error())
file.close()

Task.TASK_GET:
Expand All @@ -256,7 +256,7 @@ func _handle_cache(offline : bool, data, encrypt_key : String, cache_path : Stri
if content != "--deleted--":
body_return = JSON.parse(content).result
else:
printerr("Error reading cache file! Error code: %d" % file.get_error())
Firebase._printerr("Error reading cache file! Error code: %d" % file.get_error())
file.close()

Task.TASK_DELETE:
Expand All @@ -266,7 +266,7 @@ func _handle_cache(offline : bool, data, encrypt_key : String, cache_path : Stri
file.store_line("--deleted--")
body_return = {"deleted": true}
else:
printerr("Error \"deleting\" cache file! Error code: %d" % file.get_error())
Firebase._printerr("Error \"deleting\" cache file! Error code: %d" % file.get_error())
file.close()
else:
dir.remove(cache_path)
Expand All @@ -293,14 +293,14 @@ func _handle_cache(offline : bool, data, encrypt_key : String, cache_path : Stri
if file.get_line().begins_with(data[0]):
body_return.documents.append(JSON.parse(file.get_line()).result)
else:
printerr("Error opening cache file for listing! Error code: %d" % file.get_error())
Firebase._printerr("Error opening cache file for listing! Error code: %d" % file.get_error())
file.close()
body_return.documents.resize(min(data[1], body_return.documents.size()))
body_return.nextPageToken = ""

Task.TASK_QUERY:
if offline:
printerr("Offline queries are currently unsupported!")
Firebase._printerr("Offline queries are currently unsupported!")

if not offline:
return body
Expand Down
34 changes: 0 additions & 34 deletions addons/gut/icon.png.import

This file was deleted.

34 changes: 0 additions & 34 deletions addons/http-sse-client/icon.png.import

This file was deleted.

Loading