Skip to content

Commit 4df1a40

Browse files
Merge pull request #308 from aaronfranke/format
Format GDScript files using Razoric's formatter + manual review
2 parents a165c7a + 9b196bb commit 4df1a40

33 files changed

+582
-488
lines changed

addons/godot-firebase/auth/auth.gd

Lines changed: 117 additions & 115 deletions
Large diffs are not rendered by default.

addons/godot-firebase/auth/auth_provider.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ tool
22
class_name AuthProvider
33
extends Reference
44

5+
56
var redirect_uri: String = ""
67
var access_token_uri: String = ""
78
var provider_id: String = ""
@@ -19,14 +20,18 @@ var should_exchange: bool = false
1920
func set_client_id(client_id: String) -> void:
2021
self.params.client_id = client_id
2122

23+
2224
func set_client_secret(client_secret: String) -> void:
2325
self.client_secret = client_secret
2426

27+
2528
func get_client_id() -> String:
2629
return self.params.client_id
2730

31+
2832
func get_client_secret() -> String:
2933
return self.client_secret
3034

35+
3136
func get_oauth_params() -> String:
3237
return ""
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
class_name FacebookProvider
1+
class_name FacebookProvider
22
extends AuthProvider
33

4+
45
func _init(client_id: String, client_secret: String) -> void:
56
randomize()
67
set_client_id(client_id)
78
set_client_secret(client_secret)
8-
9+
910
self.redirect_uri = "https://www.facebook.com/v13.0/dialog/oauth?"
1011
self.access_token_uri = "https://graph.facebook.com/v13.0/oauth/access_token"
1112
self.provider_id = "facebook.com"
@@ -17,5 +18,3 @@ func _init(client_id: String, client_secret: String) -> void:
1718
else:
1819
self.should_exchange = true
1920
self.params.response_type = "code"
20-
21-

addons/godot-firebase/auth/providers/github.gd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
class_name GitHubProvider
1+
class_name GitHubProvider
22
extends AuthProvider
33

4+
45
func _init(client_id: String, client_secret: String) -> void:
56
randomize()
67
set_client_id(client_id)

addons/godot-firebase/auth/providers/google.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class_name GoogleProvider
22
extends AuthProvider
33

4+
45
func _init(client_id: String, client_secret: String) -> void:
56
set_client_id(client_id)
67
set_client_secret(client_secret)
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1-
class_name TwitterProvider
1+
class_name TwitterProvider
22
extends AuthProvider
33

4+
45
var request_token_endpoint: String = "https://api.twitter.com/oauth/access_token?oauth_callback="
56

67
var oauth_header: Dictionary = {
7-
oauth_callback="",
8-
oauth_consumer_key="",
9-
oauth_nonce="",
10-
oauth_signature="",
11-
oauth_signature_method="HMAC-SHA1",
12-
oauth_timestamp="",
13-
oauth_version="1.0"
8+
oauth_callback = "",
9+
oauth_consumer_key = "",
10+
oauth_nonce = "",
11+
oauth_signature = "",
12+
oauth_signature_method = "HMAC-SHA1",
13+
oauth_timestamp = "",
14+
oauth_version = "1.0"
1415
}
1516

17+
1618
func _init(client_id: String, client_secret: String) -> void:
1719
randomize()
1820
set_client_id(client_id)
1921
set_client_secret(client_secret)
20-
22+
2123
self.oauth_header.oauth_consumer_key = client_id
2224
self.oauth_header.oauth_nonce = OS.get_ticks_usec()
2325
self.oauth_header.oauth_timestamp = OS.get_ticks_msec()
24-
25-
26+
2627
self.should_exchange = true
2728
self.redirect_uri = "https://twitter.com/i/oauth2/authorize?"
2829
self.access_token_uri = "https://api.twitter.com/2/oauth2/token"
@@ -32,8 +33,9 @@ func _init(client_id: String, client_secret: String) -> void:
3233
self.params.scope = "users.read"
3334
self.params.state = str(rand_range(0, 1))
3435

36+
3537
func get_oauth_params() -> String:
3638
var params: PoolStringArray = []
3739
for key in self.oauth.keys():
38-
params.append(key+"="+self.oauth.get(key))
40+
params.append(key + "=" + self.oauth.get(key))
3941
return params.join("&")

addons/godot-firebase/auth/user_data.gd

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,21 @@ tool
66
class_name FirebaseUserData
77
extends Reference
88

9-
var local_id : String = "" # The uid of the current user.
10-
var email : String = ""
11-
var email_verified := false # Whether or not the account's email has been verified.
12-
var password_updated_at : float = 0 # The timestamp, in milliseconds, that the account password was last changed.
13-
var last_login_at : float = 0 # The timestamp, in milliseconds, that the account last logged in at.
14-
var created_at : float = 0 # The timestamp, in milliseconds, that the account was created at.
15-
var provider_user_info : Array = []
16-
17-
var provider_id : String = ""
18-
var display_name : String = ""
19-
var photo_url : String = ""
20-
21-
func _init(p_userdata : Dictionary) -> void:
9+
10+
var local_id: String = "" # The uid of the current user.
11+
var email: String = ""
12+
var email_verified := false # Whether or not the account's email has been verified.
13+
var password_updated_at: float = 0 # The timestamp, in milliseconds, that the account password was last changed.
14+
var last_login_at: float = 0 # The timestamp, in milliseconds, that the account last logged in at.
15+
var created_at: float = 0 # The timestamp, in milliseconds, that the account was created at.
16+
var provider_user_info: Array = []
17+
18+
var provider_id: String = ""
19+
var display_name: String = ""
20+
var photo_url: String = ""
21+
22+
23+
func _init(p_userdata: Dictionary) -> void:
2224
local_id = p_userdata.get("localId", "")
2325
email = p_userdata.get("email", "")
2426
email_verified = p_userdata.get("emailVerified", false)
@@ -32,9 +34,11 @@ func _init(p_userdata : Dictionary) -> void:
3234
photo_url = provider_user_info[0].get("photoUrl", "")
3335
display_name = provider_user_info[0].get("displayName", "")
3436

37+
3538
func as_text() -> String:
3639
return _to_string()
3740

41+
3842
func _to_string() -> String:
3943
var txt = "local_id : %s\n" % local_id
4044
txt += "email : %s\n" % email

addons/godot-firebase/database/database.gd

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,49 @@ tool
66
class_name FirebaseDatabase
77
extends Node
88

9-
var _base_url : String = ""
109

11-
var _config : Dictionary = {}
10+
var _base_url: String = ""
1211

13-
var _auth : Dictionary = {}
12+
var _config: Dictionary = {}
1413

15-
func _set_config(config_json : Dictionary) -> void:
14+
var _auth: Dictionary = {}
15+
16+
17+
func _set_config(config_json: Dictionary) -> void:
1618
_config = config_json
1719
_check_emulating()
1820

1921

20-
func _check_emulating() -> void :
22+
func _check_emulating() -> void:
2123
## Check emulating
2224
if not Firebase.emulating:
2325
_base_url = _config.databaseURL
2426
else:
25-
var port : String = _config.emulators.ports.realtimeDatabase
27+
var port: String = _config.emulators.ports.realtimeDatabase
2628
if port == "":
2729
Firebase._printerr("You are in 'emulated' mode, but the port for Realtime Database has not been configured.")
2830
else:
2931
_base_url = "http://localhost"
3032

3133

32-
33-
func _on_FirebaseAuth_login_succeeded(auth_result : Dictionary) -> void:
34+
func _on_FirebaseAuth_login_succeeded(auth_result: Dictionary) -> void:
3435
_auth = auth_result
3536

36-
func _on_FirebaseAuth_token_refresh_succeeded(auth_result : Dictionary) -> void:
37+
38+
func _on_FirebaseAuth_token_refresh_succeeded(auth_result: Dictionary) -> void:
3739
_auth = auth_result
3840

41+
3942
func _on_FirebaseAuth_logout() -> void:
4043
_auth = {}
4144

42-
func get_database_reference(path : String, filter : Dictionary = {}) -> FirebaseDatabaseReference:
43-
var firebase_reference : FirebaseDatabaseReference = FirebaseDatabaseReference.new()
44-
var pusher : HTTPRequest = HTTPRequest.new()
45-
var listener : Node = Node.new()
45+
46+
func get_database_reference(path: String, filter: Dictionary = {}) -> FirebaseDatabaseReference:
47+
var firebase_reference: FirebaseDatabaseReference = FirebaseDatabaseReference.new()
48+
var pusher: HTTPRequest = HTTPRequest.new()
49+
var listener: Node = Node.new()
4650
listener.set_script(load("res://addons/http-sse-client/HTTPSSEClient.gd"))
47-
var store : FirebaseDatabaseStore = FirebaseDatabaseStore.new()
51+
var store: FirebaseDatabaseStore = FirebaseDatabaseStore.new()
4852
firebase_reference.set_db_path(path, filter)
4953
firebase_reference.set_auth_and_config(_auth, _config)
5054
firebase_reference.set_pusher(pusher)

0 commit comments

Comments
 (0)