2008-11-26 07:19:30 +01:00
|
|
|
/**
|
2009-11-23 06:54:55 +01:00
|
|
|
* vim: set ts=4 sw=4 tw=99 noet :
|
2008-11-26 07:19:30 +01:00
|
|
|
* ======================================================
|
|
|
|
* Metamod:Source
|
2009-11-23 06:54:55 +01:00
|
|
|
* Copyright (C) 2004-2009 AlliedModders LLC and authors.
|
2008-11-26 07:19:30 +01:00
|
|
|
* All rights reserved.
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* This software is provided 'as-is', without any express or implied warranty.
|
|
|
|
* In no event will the authors be held liable for any damages arising from
|
|
|
|
* the use of this software.
|
|
|
|
*
|
|
|
|
* Permission is granted to anyone to use this software for any purpose,
|
|
|
|
* including commercial applications, and to alter it and redistribute it
|
|
|
|
* freely, subject to the following restrictions:
|
|
|
|
*
|
|
|
|
* 1. The origin of this software must not be misrepresented; you must not
|
|
|
|
* claim that you wrote the original software. If you use this software in a
|
|
|
|
* product, an acknowledgment in the product documentation would be
|
|
|
|
* appreciated but is not required.
|
|
|
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
|
|
|
* misrepresented as being the original software.
|
|
|
|
* 3. This notice may not be removed or altered from any source distribution.
|
|
|
|
*/
|
|
|
|
|
2008-11-16 01:29:24 +01:00
|
|
|
#ifndef _INCLUDE_METAMOD_SOURCE_LOADER_BRIDGE_H_
|
|
|
|
#define _INCLUDE_METAMOD_SOURCE_LOADER_BRIDGE_H_
|
|
|
|
|
|
|
|
typedef void* (*QueryValveInterface)(const char *pName, int *pReturnCode);
|
|
|
|
class IServerPluginCallbacks;
|
|
|
|
|
|
|
|
struct vsp_bridge_info
|
|
|
|
{
|
|
|
|
QueryValveInterface engineFactory;
|
|
|
|
QueryValveInterface gsFactory;
|
|
|
|
IServerPluginCallbacks * vsp_callbacks;
|
|
|
|
unsigned int vsp_version;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IVspBridge
|
|
|
|
{
|
|
|
|
public:
|
2008-11-16 04:10:13 +01:00
|
|
|
virtual bool Load(const vsp_bridge_info *info, char *buffer, size_t maxlength) = 0;
|
2008-11-16 01:29:24 +01:00
|
|
|
virtual void Unload() = 0;
|
|
|
|
virtual const char *GetDescription() = 0;
|
|
|
|
};
|
|
|
|
|
2008-11-24 04:21:49 +01:00
|
|
|
struct gamedll_bridge_info
|
|
|
|
{
|
|
|
|
QueryValveInterface engineFactory;
|
|
|
|
QueryValveInterface fsFactory;
|
|
|
|
QueryValveInterface physicsFactory;
|
|
|
|
QueryValveInterface gsFactory;
|
|
|
|
void * pGlobals;
|
|
|
|
unsigned int dllVersion;
|
|
|
|
void * isgd;
|
2009-11-23 06:54:55 +01:00
|
|
|
const char * vsp_listener_path;
|
2008-11-24 04:21:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class IGameDllBridge
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual bool DLLInit_Pre(const gamedll_bridge_info *info, char *buffer, size_t maxlength) = 0;
|
2008-11-24 04:50:17 +01:00
|
|
|
virtual void DLLInit_Post(int *isgdUnload) = 0;
|
2008-11-24 04:21:49 +01:00
|
|
|
virtual void *QueryInterface(const char *name, int *ret) = 0;
|
|
|
|
virtual void Unload() = 0;
|
|
|
|
};
|
|
|
|
|
2008-11-16 01:29:24 +01:00
|
|
|
#endif /* _INCLUDE_METAMOD_SOURCE_LOADER_BRIDGE_H_ */
|
|
|
|
|