Add private player metrics and alpha.2 package
This commit is contained in:
1 parent
b4980f0acd
commit
178a6bbc85
12 files changed
+199
-14
No files matched your search
@@ -85,6 +85,7 @@ func _authenticate_on(host: String, port: int, scheme: String) -> bool:
|
||||
|
||||
|
||||
func _after_authentication() -> void:
|
||||
await _record_activity()
|
||||
socket = Nakama.create_socket_from(client)
|
||||
_bind_socket_signals()
|
||||
var result = await socket.connect_async(session, true, 5)
|
||||
@@ -99,6 +100,16 @@ func _after_authentication() -> void:
|
||||
await flush_pending_scores()
|
||||
|
||||
|
||||
func _record_activity() -> void:
|
||||
if not is_authenticated():
|
||||
return
|
||||
var payload := {
|
||||
"platform": OS.get_name().to_lower(),
|
||||
"version": str(ProjectSettings.get_setting("application/config/version", "development"))
|
||||
}
|
||||
await client.rpc_async(session, "record_activity", JSON.stringify(payload))
|
||||
|
||||
|
||||
func _bind_socket_signals() -> void:
|
||||
socket.received_matchmaker_matched.connect(_on_matchmaker_matched)
|
||||
socket.received_match_state.connect(_on_match_state)
|
||||
|
||||
Reference in new issue
Block a user