Browse Source

doc(game): apple game center authentication

Bryan Lee 1 year ago
parent
commit
e93842fdcf
1 changed files with 18 additions and 5 deletions
  1. 18 5
      project/services/apple_game_center_service.gd

+ 18 - 5
project/services/apple_game_center_service.gd

@@ -28,13 +28,26 @@ func _process(_delta: float) -> void:
 
 
 ## [codeblock]
-## @returns Promise<{
+## AuthenticationSuccess {
 ##   type: "authentication"
 ##   result: "ok"
 ##   alias: String
-##   displayName: String;
-##   player_id: String;
-## }, String>
+##   displayName: String
+##   player_id: String
+## }
+##
+## AuthenticationError {
+##   type: "authentication"
+##   result: "error"
+##   error_code: int
+##   error_description: String
+## }
+##
+## AuthenticationResult = |
+##   | AuthenticationSuccess
+##   | AuthenticatoinError
+##
+## @returns Promise<AuthenticationResult, String>
 ## [/codeblock]
 func authenticate() -> Promise:
 	game_center.authenticate()
@@ -50,4 +63,4 @@ func authenticate() -> Promise:
 		
 		# Auto-disconnected when `response_handler` is deallocated.
 		pending_event.connect(response_handler)
-		)
+	)