Raised This Month: $51 Target: $400
 12% 

Intelligent use of forwards or nonsense?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 03-02-2012 , 19:39   Intelligent use of forwards or nonsense?
Reply With Quote #1

You maybe also know this, you write a plugin and notice that you are constantly repeate your code.
Some people use their their own include files, or use packages available in the community to compensate that.

Well, but what if you have many plugins that are based on events or chathooks?.
You create an Commandlistener, Hookevent etc in all your plugins.
You again write the same structures and callbacks again and again for any plugin you use.

Many of you may know the wonderful Smlib.
This package tries to fix the first problem mentioned, but what is with the second?

I begun to write a Basehook - plugin for myself which "hooks" often used functions like: chat, round-events, death-events, teamjoin, and other things which can be useful.
The advantage of this is a better structure in my plugins.
Take a look at this theoretical example.

Before



After




For larger scripts with a lot of events that can mean a huge difference in lines.

The disadvantages are that i always must run two plugins.
Whether it has a major impact on performance, well i have not tested extensively yet.
Maybe one of you knows more about whether the above makes sense, and if so how.
It must indeed have a good reason why not everyone implements this basic idea for himself.


Yours sincerely
Impact
__________________

Last edited by Impact123; 03-02-2012 at 19:43.
Impact123 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode