Jump to content


Plugin API


33 replies to this topic

#21 Guest_Toast_*

  • Guest

Posted 11 March 2008 - 05:27 AM

There isnt that much client side scripts for lua most good scripts are done on hubside it might be time to do something new on clientside instead of repeating the past

#22 Freebow

    Advanced

  • Member
  • PipPipPip
  • 73 posts

Posted 11 March 2008 - 08:33 AM

yes yes... very true. I have been modified some lua scripts so they can work on client side and that gave me a lot of fun. For example utmulti.lua script which react on certain keywords. You can kick, drop, warn people with it... clean main... watch when somebody play something with winamp and then make some effects with commands, ascii... (not talking about apex here)... Whatever i support that, lua or not lua... Plugins has always been good... Photoshop, winamp as software... and... PC became so popular because you can use "plugins" you want to make a configuration of your desire... Plugins - good solution!

#23 iceman50

    Asshole Extraordinaire

  • Member
  • PipPipPip
  • 56 posts

Posted 23 March 2008 - 07:06 AM

guess who's back ;-) 705 is fun for plugins i hate vista and ... you should look for some kind of new DC++ addons ...i guess it will be called DC++ Lamer Plugin mod? =p im drunk and im having fun mingw is fun and alcohol rox what can i say ... im thinking on a sourceforge proj and for anyone who didnt know... i guess you can say i died and raised again on easter sunday (usa -6 GMT haha) @ 2:06 AM bwahahah
DiCe!++

#24 Guest_Toast_*

  • Guest

Posted 03 April 2008 - 07:55 PM

Perhaps make a plugin that gives stats to a vista gadget is that a good or bad idea ?

Vista Gadget API

#25 Greg

    Supervisor

  • Member
  • PipPipPipPipPipPip
  • 1,139 posts

Posted 04 April 2008 - 10:52 AM

View PostToast, on Apr 3 2008, 08:55 PM, said:

Perhaps make a plugin that gives stats to a vista gadget is that a good or bad idea ?

Vista Gadget API

If it's within the scope of what the Apex plugin API can do then yes it's worth doing, if only as an example plug-in for people wanting to use the API. I don't know if it would be too confusing as an example plug-in due to having to deal with the whole VIsta sidebar API. I'm not a developer, so I guess I don't know what I'm talking about, but we should have a sample plug-in.

#26 Crise

    Developer

  • Management
  • 2,844 posts

Posted 04 April 2008 - 12:42 PM

View PostToast, on Apr 3 2008, 07:55 PM, said:

Perhaps make a plugin that gives stats to a vista gadget is that a good or bad idea ?

Vista Gadget API

Well I haven't looked into it much, but as the gadget api is markup language and jscript only it would need a way to access the plugin to get the information required and after quick look up I see no gadget access to stuff such as SendMessage or FindWindow etc. that would allow direct communication with application components...
Crise
ApexDC++ - Lead Developer

Proud Affiliates of: TechGeeks Online, PeerWeb

#27 Satan

    Senior

  • Support
  • 1,164 posts

Posted 04 April 2008 - 02:17 PM

That would be nice, i'd use it.
Posted Image

#28 vanessyca

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 26 June 2008 - 10:45 PM

View PostCrise, on Jan 26 2008, 03:31 AM, said:

Well hubsofts seldom do anything for one single client :)

Besides before I start to do anything extreme, I want to know if there is any need fir this.

Oh and just for the fun of it, here is something for you guys to look at...


#29 spktbl

    Newbie

  • Member
  • Pip
  • 5 posts

Posted 04 September 2010 - 11:57 AM

Hello all!

I like to use ApexDC++, because it's very light, simply and easy to use!
And want to thank all of the developers!

I have a question about plugin API.
I'm trying to write a plugin which send private message to user when he/she start to Upload something from me.

So, I have question: is there something like QUEUE_ADD for HOOK_QUEUE, but for Upload, not Download?

For example:

Bool DCAPI pluginProc(uint32_t eventId, dcptr_t pData) {
  switch(eventId) {
    /* default actions */
    case ON_INSTALL:
    case ON_LOAD:
      return onLoad(eventId, (DCCorePtr)pData);
    case ON_UNINSTALL:
    case ON_UNLOAD:
      return onUnload(eventId);

    case QUEUE_ADD_UPLOAD: /* <-- I need this action to hook! */
      BASE_HUB_SEND_PM(dcpp, ((UserDataPtr)pData)->object, "Hello world!", TRUE);
      return True;

    default: return False;
  }
}

Thanks in advance.

#30 Crise

    Developer

  • Management
  • 2,844 posts

Posted 05 September 2010 - 08:25 AM

No there isn't... but if there was it would be very unlikely that what you'd work with was UserData.

What would you want it for exactly anyways? And if it is for blocking uploads, that is a) not really something we want to encourage and b) already possible for a plugin to do, although it's a rather roundabout way.
Crise
ApexDC++ - Lead Developer

Proud Affiliates of: TechGeeks Online, PeerWeb

#31 spktbl

    Newbie

  • Member
  • Pip
  • 5 posts

Posted 05 September 2010 - 11:25 AM

Thank you for your answer!

View PostCrise, on 05 September 2010 - 08:25 AM, said:

No there isn't... but if there was it would be very unlikely that what you'd work with was UserData.
Oh, I see. Is there any chance that something like this would be added in future releases?


View PostCrise, on 05 September 2010 - 08:25 AM, said:

What would you want it for exactly anyways? And if it is for blocking uploads, that is a) not really something we want to encourage and B) already possible for a plugin to do, although it's a rather roundabout way.
No-no-no. It's not for blocking uploads.
The basic idea behind all of this: if someone trying to download something from me he / she recieve message about HTTP site where you can find description, screenshots and other infromation related to this files.

Algorithm (what I'm try to achieve):
1) Send message to user when he / she start uploading something.
2) Add user and current datetime to list.
3) If user not in list or time difference between now and datetime from list for current user more than 24 hours - user recieve this message again and list updated with current datetime.
4) Optionally user can send private command and this message won't be shown anymore.

#32 spktbl

    Newbie

  • Member
  • Pip
  • 5 posts

Posted 06 September 2010 - 11:35 AM

View PostCrise, on 05 September 2010 - 08:25 AM, said:

No there isn't... but if there was it would be very unlikely that what you'd work with was UserData.
Okey, I got it and download latest source code for plugins.

From old source:
BASE_HUB_SEND_PM(dcpp, user->object, result.c_str(), thirdPerson);

From latest (1.3.6):
BASE_HUB_SEND_PM(dcpp, ((UserDataPtr)cmd->object)->object, result.c_str(), thirdPerson)

1) What is structure of UserData->object?

From "PluginDefs.h" - it's just a pointer:
dcptr_t object;

dcptr_t declared as:
typedef void *hookHandle, *dcptr_t, *subsHandle;

2) Can I fill this structure manually and what I need if can?

If there is no API for algorithm from my post above - I can try to get current userlist with WinAPI, but only username and it's hard as hell to use EnumWindows() / SendMessage() to do that...

Any suggestions?

Thanks in advance.

#33 Crise

    Developer

  • Management
  • 2,844 posts

Posted 06 September 2010 - 03:40 PM

The object members of various structs the plugins use have no meaning to the plugin itself, they are just something the node that implements a certain callback function uses.

In other words they can be thought of as handles of sorts that the underlying implementation uses. The only exception being the object member of CommandData which is (as noted in PluginDefs.h) is either UserData or ClientData.

So to answer your question, to fill f.ex. UserData on your own is impossible.

So right now what you want to do is, while not impossible, extremely hard... because there is no API for querying users (mainly because a user cam go offline at any time yet and the plugin would not know about it).

I am very much aware that there is much room for improvement with the API still but there are number of factors that make making certain additions to the API difficult.
Crise
ApexDC++ - Lead Developer

Proud Affiliates of: TechGeeks Online, PeerWeb

#34 spktbl

    Newbie

  • Member
  • Pip
  • 5 posts

Posted 06 September 2010 - 06:36 PM

View PostCrise, on 06 September 2010 - 03:40 PM, said:

So right now what you want to do is, while not impossible, extremely hard...
Thank you for answering!
So, I think, there is only one way to do it now: full emulation through WinAPI user's action, like selecting user, "Send private command" and etc.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users