MM:S API Differences

From AlliedModders Wiki
Revision as of 14:10, 9 October 2007 by BAILOPAN (talk | contribs) (New page: Metamod:Source 1.6.0 makes several API changes which may affect plugins. These changes are fully documented below. =Renamed Calls= ==Transparent== The following functions have received s...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Metamod:Source 1.6.0 makes several API changes which may affect plugins. These changes are fully documented below.

Renamed Calls

Transparent

The following functions have received simple renamings, which should be transparent from the META_REGCMD and META_REGCVAR macros.

  • RegisterConCmdBase -> RegisterConCommandBase
  • UnregisterConCmdBase -> UnregisterConCommandBase

Breaking

The following functions have received simple renamings, however, old code will be affected.

  • pGlobals() -> GetCClobals
  • engineFactory -> GetEngineFactory
  • serverFactory -> GetServerFactory
  • physicsFactory -> GetPhysicsFactory
  • fileSystemFactory -> GetFileSystemFactory

For example, GET_V_IFACE_CURRENT would change from this:

GET_V_IFACE_CURRENT(engineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);

To this:

GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);


Removed Calls

A few API calls have been completely removed.

  • RemotePrintingAvailable() - Unused, no purpose.
  • GetCvarBaseAccessor() - Unused, no purpose.
  • SetLastMetaReturn() - Did nothing.
  • GetLastMetaReturn() - Did nothing.


Changed Calls

  • IPluginManager::Query() and IPluginManager::QueryHandle() now store return values using optional pointers instead of references. This change was requested by a few people.


Miscellaneous

PLAPI_VERSION has been renamed to METAMOD_PLAPI_VERSION. The version numbers for 1.1 to 1.4 can be described as:

  • API Major: 1
  • API Minor: 0, 1, 2, 3, 4, 5, or 6
  • Plugin API: 7, 8, 9, 10, 11, or 12
  • Plugin API Minimum: 7
  • SourceHook Interface: 4
  • SourceHook Implementation: 3 or 4
  • SourceHook Version: 4.3 or 4.4

Version 1.6.0 has the following version numbers:

  • API Major: 2
  • API Minor: 0
  • Plugin API: 14
  • Plugin API Minimum: 14
  • SourceHook Interface: 5
  • SourceHook Implementation: 5
  • SourceHook Version: 5.0


Additions

  • IMetamodListener now has a new OnUnlinkConCommandBase callback.
  • ISmmAPI::Format and ISmmAPI::FormatArgs are new platform-safe replacements for snprintf and vsnprintf.
  • ISmmAPI::GetSourceEngineBuild() returns a constant describing the Source engine version.
  • ISmmAPI::GetVSPInfo() returns information about Valve Server Plugin interface, if enabled through Metamod:Source.

SourceHook has many new changes, the greatest of which is "global hooks," which can hook a function on any number of instances of that derived class. See SourceHook Development for more information.