Skip to content

Commit

Permalink
改进KOOK独立接口调用模式
Browse files Browse the repository at this point in the history
  • Loading branch information
lunzhiPenxil committed Oct 17, 2023
1 parent 8270942 commit 6c1512d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions OlivOS/API.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def __init__(self, sdk_event=None, log_func=None, Proc=None):
self.do_init_log()

def __init_inde_interface(self):
self.indeAPI = inde_interface_T(self, self.platform['platform'])
if self.platform['sdk'] == 'kaiheila_link':
self.indeAPI = OlivOS.kaiheilaSDK.inde_interface(self, self.platform['platform'])

Expand Down
26 changes: 23 additions & 3 deletions OlivOS/kaiheilaSDK.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,8 @@ def set_playgame_activity_game(target_event, game_id):
if raw_obj is not None:
if type(raw_obj) is dict:
res_data['active'] = True
res_data['data'] = {}
res_data['data']['id'] = game_id
except:
res_data['active'] = False
return res_data
Expand All @@ -810,12 +812,30 @@ def set_playgame_activity_music(target_event, music_name, singer, software):
if raw_obj is not None:
if type(raw_obj) is dict:
res_data['active'] = True
res_data['data'] = {}
res_data['data']['music_name'] = music_name
res_data['data']['singer'] = singer
res_data['data']['software'] = software
except:
res_data['active'] = False
return res_data

class inde_interface(OlivOS.API.inde_interface_T):
@OlivOS.API.Event.callbackLogger('kaiheila:set_playgame_activity_game')
@OlivOS.API.Event.callbackLogger('kaiheila:set_playgame_delete_activity_all')
def __set_playgame_delete_activity_all(target_event, flag_log=True):
res_data = None
res_data = OlivOS.kaiheilaSDK.event_action.set_playgame_delete_activity_all(target_event)
return res_data

def set_playgame_delete_activity_all(self, flag_log: bool = True, remote: bool = False):
res_data = None
if remote:
pass
else:
res_data = inde_interface.__set_playgame_delete_activity_all(self.event, flag_log=True)
return res_data

@OlivOS.API.Event.callbackLogger('kaiheila:set_playgame_activity_game', ['id'])
def __set_playgame_activity_game(target_event, game_id, flag_log=True):
res_data = None
res_data = OlivOS.kaiheilaSDK.event_action.set_playgame_activity_game(target_event, game_id)
Expand All @@ -828,8 +848,8 @@ def set_playgame_activity_game(self, game_id:int, flag_log: bool = True, remote:
else:
res_data = inde_interface.__set_playgame_activity_game(self.event, game_id, flag_log=True)
return res_data
@OlivOS.API.Event.callbackLogger('kaiheila:set_playgame_activity_music')

@OlivOS.API.Event.callbackLogger('kaiheila:set_playgame_activity_music', ['music_name', 'singer', 'software'])
def __set_playgame_activity_music(target_event, music_name, singer, software, flag_log=True):
res_data = None
res_data = OlivOS.kaiheilaSDK.event_action.set_playgame_activity_music(target_event, music_name, singer, software)
Expand Down

0 comments on commit 6c1512d

Please sign in to comment.