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

Explicitly mark old pdata API as deprecated


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Solokiller
Senior Member
Join Date: Sep 2015
Old 08-20-2019 , 10:47   Explicitly mark old pdata API as deprecated
Reply With Quote #1

The old pdata API, which takes hardcoded offsets, should be marked as deprecated in the documentation to discourage its use. Since Valve is updating the games again any plugins that use it can end up breaking.

The APIs involved in this are located in FakeMeta and HamSandwich:
https://www.amxmodx.org/api/fakemeta
https://www.amxmodx.org/api/hamsandwich/get_pdata_cbase

Other modules may also contain similar APIs that require users to be directed to a safe variant.
Solokiller is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-20-2019 , 22:49   Re: Explicitly mark old pdata API as deprecated
Reply With Quote #2

Does there already exist "safe variants" for everything that those functions can do?
__________________
fysiks is offline
Solokiller
Senior Member
Join Date: Sep 2015
Old 08-21-2019 , 02:33   Re: Explicitly mark old pdata API as deprecated
Reply With Quote #3

Based on the API documentation i'd say so. The new API internally handles different data types so it looks like you can get even more data types than before.
Solokiller is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-24-2019 , 04:50   Re: Explicitly mark old pdata API as deprecated
Reply With Quote #4

The get|set_pdata_* API should not be deprecated because it's not broken and still useful for games which don't have a gamedata file. However I do agree updating the documentation to encourage the use of the new get|set_ent_data*, get|set_gamerules* API for the supported games would be welcomed.
[Edit: well, I would not mind to deprecate them for the supported games, but I don't think we can do conditional with #pragma deprecated. I guess it will be worth to say a word about it in the next news].

It reminds me we don't have an automatic system to extract and update the new offsets in the gamedata files.
If i remember, I used a semi-automatic way such as dumping dwarf infos from latest .so and using some plugin to generate the files. I'm not sure I still have this plugin. Would be nice if someone could help in making a robust & automatic system for that.
__________________

Last edited by Arkshine; 08-24-2019 at 05:06.
Arkshine is offline
Solokiller
Senior Member
Join Date: Sep 2015
Old 08-24-2019 , 08:13   Re: Explicitly mark old pdata API as deprecated
Reply With Quote #5

If you have anything left from that i could take a look and maybe put something together to fully automate the process. I'll also need the spec for the config files that need to be generated.

Edit: i found this: https://github.com/eliben/pyelftools

Could be a good starting point.

Last edited by Solokiller; 08-24-2019 at 08:41.
Solokiller is offline
Reply


Thread Tools
Display Modes

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 11:45.


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