Skip to content

Commit 20f6fa0

Browse files
authored
Merge pull request #153 from TaloDev/develop
Release 0.35.0
2 parents 958e135 + 9a9a337 commit 20f6fa0

File tree

15 files changed

+131
-15
lines changed

15 files changed

+131
-15
lines changed

.github/workflows/claude-code-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ jobs:
5555
5656
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
5757
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
58-
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
58+
claude_args: '--model sonnet --allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
5959
use_sticky_comment: true

addons/talo/apis/channels_api.gd

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,30 @@ func get_storage_prop(channel_id: int, prop_key: String, bust_cache: bool = fals
277277
_:
278278
return null
279279

280+
## Get many storage props for a channel. Optionally, ensure the latest versions of the props are returned.
281+
func list_storage_props(channel_id: int, prop_keys: Array[String], bust_cache: bool = false) -> Array[TaloChannelStorageProp]:
282+
if Talo.identity_check() != OK:
283+
return []
284+
285+
if not bust_cache:
286+
return await _storage_manager.list_props(channel_id, prop_keys)
287+
288+
var url := "/%s/storage/list" % channel_id
289+
if prop_keys.size() > 0:
290+
url += "?" + ("&".join(prop_keys.map(func(key): return "propKeys=%s" % key)))
291+
var res := await client.make_request(HTTPClient.METHOD_GET, url)
292+
293+
match res.status:
294+
200:
295+
var props: Array[TaloChannelStorageProp] = []
296+
for prop_data in res.body.props:
297+
var prop := TaloChannelStorageProp.new(prop_data)
298+
_storage_manager.upsert_prop(channel_id, prop)
299+
props.append(prop)
300+
return props
301+
_:
302+
return []
303+
280304
## Set storage props for a channel.
281305
func set_storage_props(channel_id: int, props: Dictionary[String, Variant]) -> void:
282306
if Talo.identity_check() != OK:

addons/talo/apis/leaderboards_api.gd

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func get_cached_entries_for_current_player(internal_name: String) -> Array[TaloL
2121
return entry.player_alias.id == Talo.current_alias.id
2222
)
2323

24-
## Get a list of entries for a leaderboard. The options include "page", "alias_id", "include_archived", "prop_key" and "prop_value" for additional filtering.
24+
## Get a list of entries for a leaderboard. The options include "page", "alias_id", "include_archived", "prop_key", "prop_value", "start_date" and "end_date" for additional filtering.
2525
func get_entries(internal_name: String, options := GetEntriesOptions.new()) -> EntriesPage:
2626
var url := "/%s/entries?page=%s"
2727
var url_data := [internal_name, options.page]
@@ -41,6 +41,14 @@ func get_entries(internal_name: String, options := GetEntriesOptions.new()) -> E
4141
url += "&propValue=%s"
4242
url_data.append(options.prop_value)
4343

44+
if options.start_date != "":
45+
url += "&startDate=%s"
46+
url_data.append(options.start_date)
47+
48+
if options.end_date != "":
49+
url += "&endDate=%s"
50+
url_data.append(options.end_date)
51+
4452
var res := await client.make_request(HTTPClient.METHOD_GET, url % url_data)
4553

4654
match res.status:
@@ -109,3 +117,5 @@ class GetEntriesOptions:
109117
var include_archived: bool = false
110118
var prop_key: String = ""
111119
var prop_value: String = ""
120+
var start_date: String = ""
121+
var end_date: String = ""

addons/talo/apis/players_api.gd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ func identify_offline(service: String, identifier: String) -> TaloPlayer:
112112

113113
## Search for players by IDs, prop values and alias identifiers.
114114
func search(query: String, page: int = 0) -> SearchPage:
115-
var res := await client.make_request(HTTPClient.METHOD_GET, "/search?query=%s&page=%s" % [query, page])
115+
var encoded_query := query.strip_edges().uri_encode()
116+
var res := await client.make_request(HTTPClient.METHOD_GET, "/search?query=%s&page=%s" % [encoded_query, page])
116117
match res.status:
117118
200:
118119
var players: Array[TaloPlayer] = []

addons/talo/entities/leaderboard_entry.gd

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
class_name TaloLeaderboardEntry extends TaloEntityWithProps
22

3+
enum LeaderboardSortMode {
4+
ASC,
5+
DESC
6+
}
7+
38
var id: int
49
var position: int
510
var score: float
611
var player_alias: TaloPlayerAlias
12+
var leaderboard_name: String
13+
var leaderboard_internal_name: String
14+
var leaderboard_sort_mode: LeaderboardSortMode
715
var created_at: String
816
var updated_at: String
917
var deleted_at: String
@@ -15,6 +23,11 @@ func _init(data: Dictionary):
1523
position = data.position
1624
score = data.score
1725
player_alias = TaloPlayerAlias.new(data.playerAlias)
26+
27+
leaderboard_name = data.leaderboardName
28+
leaderboard_internal_name = data.leaderboardInternalName
29+
leaderboard_sort_mode = LeaderboardSortMode.ASC if data.leaderboardSortMode.to_lower() == 'asc' else LeaderboardSortMode.DESC
30+
1831
created_at = data.createdAt
1932
updated_at = data.updatedAt
2033
if data.deletedAt:

addons/talo/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="Talo Game Services"
44
description="Talo (https://trytalo.com) is an open-source game backend. Talo's Godot plugin is the easiest way to add leaderboards, player authentication, socket-based multiplayer and more to your game."
55
author="trytalo"
6-
version="0.34.1"
6+
version="0.35.0"
77
script="talo_autoload.gd"

addons/talo/samples/leaderboards/leaderboard.tscn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ theme_override_constants/separation = 24
4141

4242
[node name="LeaderboardName" type="Label" parent="UI/MarginContainer/VBoxContainer"]
4343
unique_name_in_owner = true
44+
custom_minimum_size = Vector2(1000, 0)
4445
layout_mode = 2
4546
size_flags_vertical = 0
4647
theme = ExtResource("2_aw1ey")
4748
text = "{leaderboard} entries"
4849
horizontal_alignment = 1
50+
autowrap_mode = 2
4951

5052
[node name="InfoLabel" type="Label" parent="UI/MarginContainer/VBoxContainer"]
5153
unique_name_in_owner = true

addons/talo/samples/leaderboards/scripts/leaderboard.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extends Node2D
22

33
var entry_scene = preload("res://addons/talo/samples/leaderboards/entry.tscn")
44

5-
@export var leaderboard_internal_name: String
5+
@export var leaderboard_internal_name: String = ""
66
@export var include_archived: bool
77

88
@onready var leaderboard_name: Label = %LeaderboardName

addons/talo/talo_autoload.gd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
@tool
22
extends EditorPlugin
33

4+
var export_plugin := TaloExportPlugin.new()
5+
46
func _enter_tree():
57
add_autoload_singleton("Talo", "res://addons/talo/talo_manager.gd")
8+
add_export_plugin(export_plugin)
69

710
func _exit_tree():
811
remove_autoload_singleton("Talo")
12+
remove_export_plugin(export_plugin)

addons/talo/talo_client.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class_name TaloClient extends Node
22

33
# automatically updated with a pre-commit hook
4-
const TALO_CLIENT_VERSION = "0.34.1"
4+
const TALO_CLIENT_VERSION = "0.35.0"
55

66
var _base_url: String
77

0 commit comments

Comments
 (0)