mirror of
https://github.com/gogcom/galaxy-integrations-python-api.git
synced 2026-02-20 08:08:06 -05:00
SDK-2524: Fix achievement notification
This commit is contained in:
@@ -207,8 +207,12 @@ class Plugin():
|
||||
params = {"owned_game" : game}
|
||||
self._notification_client.notify("owned_game_updated", params)
|
||||
|
||||
def unlock_achievement(self, achievement):
|
||||
self._notification_client.notify("achievement_unlocked", achievement)
|
||||
def unlock_achievement(self, game_id, achievement):
|
||||
params = {
|
||||
"game_id": game_id,
|
||||
"achievement": achievement
|
||||
}
|
||||
self._notification_client.notify("achievement_unlocked", params)
|
||||
|
||||
def update_local_game_status(self, local_game):
|
||||
params = {"local_game" : local_game}
|
||||
|
||||
@@ -70,7 +70,7 @@ def test_unlock_achievement(plugin, write):
|
||||
achievement = Achievement("lvl20", 1548422395)
|
||||
|
||||
async def couritine():
|
||||
plugin.unlock_achievement(achievement)
|
||||
plugin.unlock_achievement("14", achievement)
|
||||
|
||||
asyncio.run(couritine())
|
||||
response = json.loads(write.call_args[0][0])
|
||||
@@ -79,7 +79,10 @@ def test_unlock_achievement(plugin, write):
|
||||
"jsonrpc": "2.0",
|
||||
"method": "achievement_unlocked",
|
||||
"params": {
|
||||
"achievement_id": "lvl20",
|
||||
"unlock_time": 1548422395
|
||||
"game_id": "14",
|
||||
"achievement": {
|
||||
"achievement_id": "lvl20",
|
||||
"unlock_time": 1548422395
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user