diff --git a/galaxy/api/plugin.py b/galaxy/api/plugin.py index 273ff69..ce09698 100644 --- a/galaxy/api/plugin.py +++ b/galaxy/api/plugin.py @@ -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} diff --git a/tests/test_achievements.py b/tests/test_achievements.py index 72d4693..eb5d441 100644 --- a/tests/test_achievements.py +++ b/tests/test_achievements.py @@ -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 + } } }