AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=7)
-   -   Explicitly mark old pdata API as deprecated (https://forums.alliedmods.net/showthread.php?t=318217)

Solokiller 08-20-2019 10:47

Explicitly mark old pdata API as deprecated
 
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.

fysiks 08-20-2019 22:49

Re: Explicitly mark old pdata API as deprecated
 
Does there already exist "safe variants" for everything that those functions can do?

Solokiller 08-21-2019 02:33

Re: Explicitly mark old pdata API as deprecated
 
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.

Arkshine 08-24-2019 04:50

Re: Explicitly mark old pdata API as deprecated
 
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.

Solokiller 08-24-2019 08:13

Re: Explicitly mark old pdata API as deprecated
 
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.


All times are GMT -4. The time now is 04:31.

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