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

AnyMAL — rapid development suite


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Technical/Development       
Shadows In Rain
Senior Member
Join Date: Apr 2010
Location: Russia::Siberia
Old 03-04-2011 , 10:35   AnyMAL — rapid development suite
Reply With Quote #1


AnyMAL: Any-Mod Abstraction Layer
Last update: v0.1.02, 2011/03/10.

Tools for realizing things, that was already exist in many mods.
In other words, this suite pretends to be a copy-paste killer for novice (and not so) developers.

Quote:
Originally Posted by Shadows In Rain View Post
Project abandoned. I plan to develop better solution — AnyMAL module.


Warning
It is not gameplay stuff, it is development suite!
Most of these plugins does nothing on it's own!


Features
  • Plugin initialization order manager.
  • Enchanced user authorization method.
  • Indirect abstract database acces via drivers.
  • Indirect data sharing helps to avoid plugin conflicts.
  • Menu builder for sharing menus with other plugins.
  • Collection of speciall effects.

Benefits
  • Abstraction and polymorphism.
  • Flexibility and extensibility.
  • Architectural guidelines
  • Most of things that you need already done.
  • Gradually growing bunch of plugins.

Details and tuts
Notice
Excuse me, i have some problems with English, so any detailed documentation and examples will be posted with time. Currently, you can see descriptions in *.inс-files, but i'm unsure that they are 100% correct and easy to understand. You can see also Blood Hunt 0.6 sources for examples of use.
  • IPM — initialization priority manager (read this first).
  • (doc. not ready) Auth — auth drivers rack
  • (doc. not ready) DB — abstract database interface
  • (doc. not ready) IDS — indirect data sharing
  • MB — guidelined menu builder
  • MM — shared Main Menu
  • (doc. not ready) SFX — collection of effects
  • Addons that enabled by default
  • ... (more items coming soon)

Requirements
  • CS / CZ
  • AMXX version 1.8.1 or later.

Related plugins
List of plugins that can be attached to or based on AnyMAL:
Hall of fame
  • Scripting: Shadows In Rain
  • Banner art: Shadows In Rain
  • Contributors: a.aqua.

Notes
  • In future, i will develop AnyMAL as module, if it will be really useful.
  • You don't need to download resources if you won't plan to use SFX subsystem.

Like?
If you want me to develop this further or just like, you may help me:
  • Donate. Webmoney: Z496050821504, R114787104894.
  • Support latest version on your server and send me related error logs.
  • Create and publish sublugins, send me resposnes about API.
    I will be glad of any help. Thanx.

P.S.:
  • I never studied English. Forgive my ignorance.
  • Contact me, if you want add your plugin to this (default) package.
Attached Files
File Type: zip anymal_v0.1_resources.zip (136.8 KB, 347 views)
File Type: zip anymal_v0.1.02.zip (137.1 KB, 291 views)
__________________
I'm using Google translator, yarrr. |.◕‿‿◕.|

Last edited by Shadows In Rain; 05-24-2011 at 17:58.
Shadows In Rain is offline
Send a message via ICQ to Shadows In Rain
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 03-04-2011 , 12:51   Re: AnyMAL — rapid development suite
Reply With Quote #2

I doubt any user, who would resort to "copy-paste", is going to use this until you post some tutorials.

Some issues:
-you should use threaded queries
-you didn't set any primary/unique keys in database table
-prethink is not for resetting player speed, there are better ways to do that.
__________________
Impossible is Nothing
Sylwester is offline
Shadows In Rain
Senior Member
Join Date: Apr 2010
Location: Russia::Siberia
Old 03-04-2011 , 14:07   Re: AnyMAL — rapid development suite
Reply With Quote #3

@Sylwester
1. Current AnyMAL/DB API not designed for delayed queries. May be later, in further versions.
2. I think that unique keys are useless for this concept. And will decrease DB perfomance.
3. May be suggested way is better, but patch status is still 'unconfirmed'. I want this addon to work 'from the box'.

Don't panic, i'm working on documentation.
__________________
I'm using Google translator, yarrr. |.◕‿‿◕.|
Shadows In Rain is offline
Send a message via ICQ to Shadows In Rain
Shadows In Rain
Senior Member
Join Date: Apr 2010
Location: Russia::Siberia
Old 03-04-2011 , 15:02   Re: AnyMAL — rapid development suite
Reply With Quote #4

AnyMAL IPM.

What is it?
It is plugin, that manages your plugins initialization order. For example, if you want to be sure that your plugin will be initialized only after 'Blood Hunt', without using tricks and delayed initialization, so you can use BH API just after it ready to be used.

How to use.

1. Indepedent plugins, that provides depedencies for other plugins.
If any plugins may depend on initialization of your plugin, provide API that contains tag for your depedency. Tag string must be unique.

Code:
#define IPM_BLOODHUNT "bloodhunt/core"
Register depedency tag during plugin_init.
Code:
#include <amxmodx>
#include <anymal>
#include <bloodhunt>
...

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	...
	anymal_ipm_register(IPM_BLOODHUNT)
}
2. Depedent plugins, that uses provided depedency tags.
Register tag for depedent plugin; i recommend you to use 'PLUGIN' macro as tag string. Add depedencies then, and hook your initialization queue.

Code:
#include <amxmodx>
#include <anymal>
#include <bloodhunt>

#define PLUGIN "My IPM test plugin"
...

new IPMH:ipmh

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	...
	ipmh = anymal_ipm_register(PLUGIN)

	anymal_ipm_add_depedency(ipmh, IPM_BLOODHUNT)
	anymal_ipm_add_depedency(ipmh, IPM_OTHER_ONE)
	anymal_ipm_add_depedency(ipmh, IPM_OTHER_TWO)
	anymal_ipm_add_depedency(ipmh, IPM_OTHER_THREE)
	...
}

public anymal_ipm_init(IPMH:handle)
{
	if(handle != ipmh)
		return
	
	// add your initialization here
}
Related files.
anymal_ipm*

Notes.
  • Initialization management will be launched when AMXX enters plugin_cfg() in anymal_ipm.amxx.
  • I do not recommend you to initialize typical things via AnyMAL IPM (events hooks, arrays, tasks, etc.).
  • All plugins from AnyMAL suite provides or uses IPM tags.
__________________
I'm using Google translator, yarrr. |.◕‿‿◕.|

Last edited by Shadows In Rain; 03-06-2011 at 01:12.
Shadows In Rain is offline
Send a message via ICQ to Shadows In Rain
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 03-04-2011 , 16:27   Re: AnyMAL — rapid development suite
Reply With Quote #5

Quote:
Originally Posted by Shadows In Rain View Post
2. I think that unique keys are useless for this concept. And will decrease DB perfomance.
If you don't set keys, then every time you execute "INSERT INTO `%s` (`owner`, `key`, `value`) VALUES ('%s', '%s', '%s')" there will be another row added to the table whether user data was previously saved or not. You will have to remove them manually every time you save player data (unnecessary "DELETE FROM..." query) or after some time your database will be full of useless entries.
__________________
Impossible is Nothing
Sylwester is offline
Shadows In Rain
Senior Member
Join Date: Apr 2010
Location: Russia::Siberia
Old 03-04-2011 , 17:07   Re: AnyMAL — rapid development suite
Reply With Quote #6

@Sylwester
Rly? I have a completely opposite view.

Inserting one record twice gives one row. But if table designed with unikey, any subsequent insertions of same record gives different rows, because unikey generated on the fly.
Compare this:
Quote:
insert bla bla bla 'alpha', 'beta', 'gamma'
insert bla bla bla 'alpha', 'beta', 'gamma'
insert bla bla bla 'alpha', 'beta', 'gamma'
insert bla bla bla 'alpha', 'beta', 'gamma'
with this:
Quote:
insert bla bla bla '1', 'alpha', 'beta', 'gamma'
insert bla bla bla '2', 'alpha', 'beta', 'gamma'
insert bla bla bla '3', 'alpha', 'beta', 'gamma'
insert bla bla bla '4', 'alpha', 'beta', 'gamma'
Thus, tables designed with unikeys increases chances for duplicated rows to appear.

Next. Before writing new values, old data must be removed (if 'overwrite' argument is true), because records with non-equivivalent fields leads to different rows, so previous record is yet another row, that is outdated and must be removed. Any call to 'Update' really leads to 'Remove' and then 'Insert', if you don't know. So there is no difference between tables with unikeys and without them, when overwriting old records. But keep in mind that old data must be removed in most cases — it's easer and faster to query 'Remove' [before insert] rather than check: record exist or not. MySQL can operate with their own data faster, than remote client, right?

But it's only theory, i never readed MySQL manuals about unikeys. D:<
Anyway, practically this works 100% as i expect.

And, just for case: don't forget, AnyMAL MySQL driver is just conrete implementation of abstract database driver (prototype). Other [future] drivers may store they their data in files, nVault, / fVault, remote ftp server, etc, and AnyMAL DB API must not rely on MySQL specifics.

*unikey = unique key
__________________
I'm using Google translator, yarrr. |.◕‿‿◕.|

Last edited by Shadows In Rain; 03-04-2011 at 18:09.
Shadows In Rain is offline
Send a message via ICQ to Shadows In Rain
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 03-05-2011 , 04:05   Re: AnyMAL — rapid development suite
Reply With Quote #7

Quote:
Originally Posted by Shadows In Rain View Post
Inserting one record twice gives one row.
If you insert the same thing 2 times, then you will definitely get 2 rows if there are no primary/unique keys defined.

If you want to allow users to choose whether to overwrite old entries or not, then it's fine, but in xp mods you will always want to overwrite old player data and in that case your current solution will send 2 queries while it could be done with just one if you used "REPLACE INTO ..." and table with primary/unique keys .

If you want to stick with this way then instead of deleting (if overwrite is true) and then inserting you could send 1 query that will delete and insert - "DELETE FROM ... WHERE ...; INSERT INTO ... (...)VALUES(...);" (if overwrite is true) or just insert (if overwrite is false).
__________________
Impossible is Nothing
Sylwester is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-05-2011 , 07:12   Re: AnyMAL — rapid development suite
Reply With Quote #8

Removes .zip that contains .amxx files, you are not allowed to attach such files.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Shadows In Rain
Senior Member
Join Date: Apr 2010
Location: Russia::Siberia
Old 03-05-2011 , 08:09   Re: AnyMAL — rapid development suite
Reply With Quote #9

@Sylwester
I just tested. We both are wrong. Rows may be duplicated for tables with and without primary key, there is no difference for AnyMAL DB client. D: But it's is good idea to merge two queries into one, thank you. :]

@ConnorMcLeod
No problem, Arkshine allowed. :D
__________________
I'm using Google translator, yarrr. |.◕‿‿◕.|

Last edited by Shadows In Rain; 03-05-2011 at 08:45.
Shadows In Rain is offline
Send a message via ICQ to Shadows In Rain
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-05-2011 , 09:40   Re: AnyMAL — rapid development suite
Reply With Quote #10

Files back
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 19:20.


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