![]() |
Oops!
The name of the thread does not mean this is a mistake or error, its about an idea.
With metamod plugins you must write out ( or copy ) several exported functions, API tables, ect... Seems like overkill if you just want to write a chat filter plugin don't you think? This is where OOPS ( Object-Oriented Plugin System ) comes in. A plugin is created by inheriting from a base class called CPluginBase and overriding the methods they would like to hook. All plugins will have to export a function called "CreateInstance" which returns a CPluginBase pointer to an instance their plugin class. Information about the plugin like the title, author, date, ... would be setup by overriding the "GetInfo" method of your class rather than the host plugin ( metamod/oops ) having to lookup and execute a query function. This is just a small idea I came up with late last night and was wondering wether or not it's worth it to write something like this. Note: If this thread is in the wrong place I apologize, I figured it would be better here since the plugin loader would be a metamod plugin itself. |
Re: Oops!
It's a well known method of writing plugins and coding pattern used by professionals to implement plugins to their program. I don't see why it won't be worth it, I know how tedious it can be to have all these functions for metamod plugins and all the return metas etc..
|
Re: Oops!
I don't see the difference with metamod ... ? ???:(
Code:
C_DLLEXPORT int GetEntityAPI2 (DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) |
Re: Oops!
What we mean here is, i think, something like this
Code:
class CPluginBase |
Re: Oops!
Cheeseh is correct, if you want to hook a function it's as simple as overriding it in your class.
There will be similar stuff to metamod such as handling return values and preventing calls to the mod. To differentiate between pre and post calls a member variable in the CPluginBase class will be set accordingly. |
All times are GMT +2. The time now is 06:22. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.