Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hs.GetActionsByInterface(plugin.Id) returns empty list #145

Closed
alexbk66 opened this issue Jan 22, 2021 · 6 comments
Closed

hs.GetActionsByInterface(plugin.Id) returns empty list #145

alexbk66 opened this issue Jan 22, 2021 · 6 comments
Labels
Bug A problem which impairs or prevents the functions of the product

Comments

@alexbk66
Copy link

alexbk66 commented Jan 22, 2021

hs.GetActionsByInterface(plugin.Id) returns empty list
hs.GetAllEvents() does something weird - doesn't return, but try/catch don't catch any exception
hs.GetEventByRef() too

/// PLEASE NOTE: This was ported directly from the legacy HS3 API and has not been fully reviewed to ensure
/// proper compatibility and support through this SDK. This may undergo significant change in the near future.
/// Please use with caution.

This comment probably means it wasn't tested at all?

[EDIT]

I also tried the old HS3 way:

IPlugInAPI.strTrigActInfo[] acts1 = hs3Callback.GetActions(plugin.Id);
IPlugInAPI.strTrigActInfo[] acts2 = hs3Callback.GetActions(plugin.Name);

The first call returns empty list, the second one works. So I changed to

hs.GetActionsByInterface(plugin.Name) 

And it works

@spudwebb
Copy link
Collaborator

For GetActionsByInterface(), you're right you need to pass the plugin name, this is the same problem as #141

I will have a look at GetAllEvents() and GetEventByRef()

@spudwebb spudwebb added Bug A problem which impairs or prevents the functions of the product In Review and removed Feedback labels Jan 22, 2021
@spudwebb
Copy link
Collaborator

GetAllEvents and GetEventByRef do not work because the EventData struct is not marked as Serializable. This will be fixed in next plugin SDK. (PSDK-122)

@alexbk66
Copy link
Author

For GetActionsByInterface(), you're right you need to pass the plugin name

I realised that - hard way - wasting a day of my life!

I think this should be changed to plugin ID? And the function argument and comments says pluginID:

/// <param name="pluginId">The ID of the plugin</param>
/// <returns>A list of all of the actions managed by the plugin</returns>
List<TrigActInfo> GetActionsByInterface(string pluginId);

@alexbk66
Copy link
Author

Also

 /// <param name="**pluginName**">The **ID of the plugin** that owns the trigger type</param>
 /// <param name="trigId">The ID of the trigger type</param>
 /// <returns>An array of trigger data</returns>
 TrigActInfo[] GetTriggersByType(string pluginName, int trigId);

Mess

@mnsandler
Copy link

there is definitely a problem. see me other post
#148 (comment)

@spudwebb
Copy link
Collaborator

The following methods have been fixed in Plugin SDK version 1.2.2

EventGroupData GetEventGroupById(int groupRef);
List<EventGroupData> GetAllEventGroups();
List<EventData> GetAllEvents();
EventData GetEventByRef(int eventRef);
List<EventData> GetEventsByGroup(int groupId);

For the other problems related to the mix up between plugin ID and plugin name, please use issues #141 and #148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A problem which impairs or prevents the functions of the product
Projects
None yet
Development

No branches or pull requests

3 participants