Ejemplo n.º 1
0
/*
* CL_GameModule_Init
*/
void CL_GameModule_Init( void )
{
	int apiversion, oldState;
	unsigned int start;
	cgame_import_t import;
	void *( *builtinAPIfunc )(void *) = NULL;
#ifdef CGAME_HARD_LINKED
	builtinAPIfunc = GetCGameAPI;
#endif

	// stop all playing sounds
	CL_SoundModule_StopAllSounds();

	CL_GameModule_Shutdown();

	// disable reading of client game module chat cvars
	Cvar_ForceSet( "con_chatCGame", "0" );

	cl_gamemodulepool = _Mem_AllocPool( NULL, "Client Game Progs", MEMPOOL_CLIENTGAME, __FILE__, __LINE__ );

	import.Error = CL_GameModule_Error;
	import.Print = CL_GameModule_Print;
	import.PrintToLog = CL_GameModule_PrintToLog;

	import.Dynvar_Create = Dynvar_Create;
	import.Dynvar_Destroy = Dynvar_Destroy;
	import.Dynvar_Lookup = Dynvar_Lookup;
	import.Dynvar_GetName = Dynvar_GetName;
	import.Dynvar_GetValue = Dynvar_GetValue;
	import.Dynvar_SetValue = Dynvar_SetValue;
	import.Dynvar_AddListener = Dynvar_AddListener;
	import.Dynvar_RemoveListener = Dynvar_RemoveListener;

	import.Cvar_Get = Cvar_Get;
	import.Cvar_Set = Cvar_Set;
	import.Cvar_SetValue = Cvar_SetValue;
	import.Cvar_ForceSet = Cvar_ForceSet;
	import.Cvar_String = Cvar_String;
	import.Cvar_Value = Cvar_Value;

	import.Cmd_TokenizeString = Cmd_TokenizeString;
	import.Cmd_Argc = Cmd_Argc;
	import.Cmd_Argv = Cmd_Argv;
	import.Cmd_Args = Cmd_Args;

	import.Cmd_AddCommand = Cmd_AddCommand;
	import.Cmd_RemoveCommand = Cmd_RemoveCommand;
	import.Cmd_ExecuteText = Cbuf_ExecuteText;
	import.Cmd_Execute = Cbuf_Execute;
	import.Cmd_SetCompletionFunc = Cmd_SetCompletionFunc;

	import.FS_FOpenFile = FS_FOpenFile;
	import.FS_Read = FS_Read;
	import.FS_Write = FS_Write;

	import.FS_Print = FS_Print;
	import.FS_Tell = FS_Tell;
	import.FS_Seek = FS_Seek;
	import.FS_Eof = FS_Eof;
	import.FS_Flush = FS_Flush;
	import.FS_FCloseFile = FS_FCloseFile;
	import.FS_RemoveFile = FS_RemoveFile;
	import.FS_GetFileList = FS_GetFileList;
	import.FS_FirstExtension = FS_FirstExtension;
	import.FS_IsPureFile = FS_IsPureFile;
	import.FS_MoveFile = FS_MoveFile;
	import.FS_IsUrl = FS_IsUrl;
	import.FS_FileMTime = FS_BaseFileMTime;
	import.FS_RemoveDirectory = FS_RemoveDirectory;

	import.Key_GetBindingBuf = Key_GetBindingBuf;
	import.Key_KeynumToString = Key_KeynumToString;

	import.GetConfigString = CL_GameModule_GetConfigString;
	import.Milliseconds = Sys_Milliseconds;
	import.DownloadRequest = CL_DownloadRequest;

	import.Hash_BlockChecksum = Com_MD5Digest32;
	import.Hash_SuperFastHash = Com_SuperFastHash;

	import.NET_GetUserCmd = CL_GameModule_NET_GetUserCmd;
	import.NET_GetCurrentUserCmdNum = CL_GameModule_NET_GetCurrentUserCmdNum;
	import.NET_GetCurrentState = CL_GameModule_NET_GetCurrentState;
	import.RefreshMouseAngles = CL_GameModule_RefreshMouseAngles;

	import.R_UpdateScreen = SCR_UpdateScreen;
	import.R_GetClippedFragments = R_GetClippedFragments;
	import.R_ClearScene = R_ClearScene;
	import.R_AddEntityToScene = R_AddEntityToScene;
	import.R_AddLightToScene = R_AddLightToScene;
	import.R_AddPolyToScene = R_AddPolyToScene;
	import.R_AddLightStyleToScene = R_AddLightStyleToScene;
	import.R_RenderScene = R_RenderScene;
	import.R_SpeedsMessage = R_SpeedsMessage;
	import.R_RegisterWorldModel = CL_GameModule_R_RegisterWorldModel;
	import.R_ModelBounds = R_ModelBounds;
	import.R_ModelFrameBounds = R_ModelFrameBounds;
	import.R_RegisterModel = R_RegisterModel;
	import.R_RegisterPic = R_RegisterPic;
	import.R_RegisterRawPic = R_RegisterRawPic;
	import.R_RegisterLevelshot = R_RegisterLevelshot;
	import.R_RegisterSkin = R_RegisterSkin;
	import.R_RegisterSkinFile = R_RegisterSkinFile;
	import.R_LerpTag = R_LerpTag;
	import.R_LightForOrigin = R_LightForOrigin;
	import.R_SetCustomColor = R_SetCustomColor;
	import.R_DrawStretchPic = R_DrawStretchPic;
	import.R_DrawStretchPoly = R_DrawStretchPoly;
	import.R_DrawRotatedStretchPic = R_DrawRotatedStretchPic;
	import.R_SetScissorRegion = R_SetScissorRegion;
	import.R_GetShaderDimensions = R_GetShaderDimensions;
	import.R_TransformVectorToScreen = R_TransformVectorToScreen;
	import.R_SkeletalGetNumBones = R_SkeletalGetNumBones;
	import.R_SkeletalGetBoneInfo = R_SkeletalGetBoneInfo;
	import.R_SkeletalGetBonePose = R_SkeletalGetBonePose;

	import.VID_FlashWindow = VID_FlashWindow;

	import.CM_NumInlineModels = CL_GameModule_CM_NumInlineModels;
	import.CM_InlineModel = CL_GameModule_CM_InlineModel;
	import.CM_TransformedBoxTrace = CL_GameModule_CM_TransformedBoxTrace;
	import.CM_RoundUpToHullSize = CL_GameModule_CM_RoundUpToHullSize;
	import.CM_TransformedPointContents = CL_GameModule_CM_TransformedPointContents;
	import.CM_ModelForBBox = CL_GameModule_CM_ModelForBBox;
	import.CM_OctagonModelForBBox = CL_GameModule_CM_OctagonModelForBBox;
	import.CM_InlineModelBounds = CL_GameModule_CM_InlineModelBounds;

	import.S_RegisterSound = CL_SoundModule_RegisterSound;
	import.S_StartFixedSound = CL_SoundModule_StartFixedSound;
	import.S_StartRelativeSound = CL_SoundModule_StartRelativeSound;
	import.S_StartGlobalSound = CL_SoundModule_StartGlobalSound;
	import.S_Update = CL_GameModule_SoundUpdate;
	import.S_AddLoopSound = CL_SoundModule_AddLoopSound;
	import.S_StartBackgroundTrack = CL_SoundModule_StartBackgroundTrack;
	import.S_StopBackgroundTrack = CL_SoundModule_StopBackgroundTrack;

	import.SCR_RegisterFont = SCR_RegisterFont;
	import.SCR_DrawString = SCR_DrawString;
	import.SCR_DrawStringWidth = SCR_DrawStringWidth;
	import.SCR_DrawClampString = SCR_DrawClampString;
	import.SCR_strHeight = SCR_strHeight;
	import.SCR_strWidth = SCR_strWidth;
	import.SCR_StrlenForWidth = SCR_StrlenForWidth;

	import.Mem_Alloc = CL_GameModule_MemAlloc;
	import.Mem_Free = CL_GameModule_MemFree;

	cge = (cgame_export_t *)Com_LoadGameLibrary( "cgame", "GetCGameAPI", &module_handle, &import, builtinAPIfunc, cls.sv_pure, NULL );
	if( !cge )
		Com_Error( ERR_DROP, "Failed to load client game DLL" );

	AC_LoadLibrary( (void *) &import, (void *) cge, ANTICHEAT_CLIENT );	// impulZ: Refire AC Init

	apiversion = cge->API();
	if( apiversion != CGAME_API_VERSION )
	{
		Com_UnloadGameLibrary( &module_handle );
		Mem_FreePool( &cl_gamemodulepool );
		cge = NULL;
		Com_Error( ERR_DROP, "Client game is version %i, not %i", apiversion, CGAME_API_VERSION );
	}

	oldState = cls.state;
	cls.state = CA_LOADING;

	start = Sys_Milliseconds();
	cge->Init( cl.playernum, viddef.width, viddef.height, cls.demo.playing, cls.sv_pure, cl.snapFrameTime, APP_PROTOCOL_VERSION, cls.mediaRandomSeed );
	Com_DPrintf( "CL_GameModule_Init: %.2f seconds\n", (float)( Sys_Milliseconds() - start ) * 0.001f );

	cls.state = oldState;
	cls.cgameActive = qtrue;

	// check memory integrity
	Mem_CheckSentinelsGlobal();

	Sys_SendKeyEvents(); // pump message loop
}
Ejemplo n.º 2
0
/*
* CL_GameModule_Init
*/
void CL_GameModule_Init( void )
{
	int apiversion;
	unsigned int start;
	cgame_import_t import;
	void *( *builtinAPIfunc )(void *) = NULL;
#ifdef CGAME_HARD_LINKED
	builtinAPIfunc = GetCGameAPI;
#endif

	// stop all playing sounds
	CL_SoundModule_StopAllSounds( true, true );

	CL_GameModule_Shutdown();

	// disable reading of client game module chat cvars
	Cvar_ForceSet( "con_chatCGame", "0" );

	cl_gamemodulepool = _Mem_AllocPool( NULL, "Client Game Progs", MEMPOOL_CLIENTGAME, __FILE__, __LINE__ );

	import.Error = CL_GameModule_Error;
	import.Print = CL_GameModule_Print;
	import.PrintToLog = CL_GameModule_PrintToLog;

	import.Dynvar_Create = Dynvar_Create;
	import.Dynvar_Destroy = Dynvar_Destroy;
	import.Dynvar_Lookup = Dynvar_Lookup;
	import.Dynvar_GetName = Dynvar_GetName;
	import.Dynvar_GetValue = Dynvar_GetValue;
	import.Dynvar_SetValue = Dynvar_SetValue;
	import.Dynvar_AddListener = Dynvar_AddListener;
	import.Dynvar_RemoveListener = Dynvar_RemoveListener;

	import.Cvar_Get = Cvar_Get;
	import.Cvar_Set = Cvar_Set;
	import.Cvar_SetValue = Cvar_SetValue;
	import.Cvar_ForceSet = Cvar_ForceSet;
	import.Cvar_String = Cvar_String;
	import.Cvar_Value = Cvar_Value;

	import.Cmd_TokenizeString = Cmd_TokenizeString;
	import.Cmd_Argc = Cmd_Argc;
	import.Cmd_Argv = Cmd_Argv;
	import.Cmd_Args = Cmd_Args;

	import.Cmd_AddCommand = Cmd_AddCommand;
	import.Cmd_RemoveCommand = Cmd_RemoveCommand;
	import.Cmd_ExecuteText = Cbuf_ExecuteText;
	import.Cmd_Execute = Cbuf_Execute;
	import.Cmd_SetCompletionFunc = Cmd_SetCompletionFunc;

	import.FS_FOpenFile = FS_FOpenFile;
	import.FS_Read = FS_Read;
	import.FS_Write = FS_Write;

	import.FS_Print = FS_Print;
	import.FS_Tell = FS_Tell;
	import.FS_Seek = FS_Seek;
	import.FS_Eof = FS_Eof;
	import.FS_Flush = FS_Flush;
	import.FS_FCloseFile = FS_FCloseFile;
	import.FS_RemoveFile = FS_RemoveFile;
	import.FS_GetFileList = FS_GetFileList;
	import.FS_FirstExtension = FS_FirstExtension;
	import.FS_IsPureFile = FS_IsPureFile;
	import.FS_MoveFile = FS_MoveFile;
	import.FS_IsUrl = FS_IsUrl;
	import.FS_FileMTime = FS_BaseFileMTime;
	import.FS_RemoveDirectory = FS_RemoveDirectory;

	import.Key_GetBindingBuf = Key_GetBindingBuf;
	import.Key_KeynumToString = Key_KeynumToString;

	import.GetConfigString = CL_GameModule_GetConfigString;
	import.Milliseconds = Sys_Milliseconds;
	import.DownloadRequest = CL_DownloadRequest;

	import.NET_GetUserCmd = CL_GameModule_NET_GetUserCmd;
	import.NET_GetCurrentUserCmdNum = CL_GameModule_NET_GetCurrentUserCmdNum;
	import.NET_GetCurrentState = CL_GameModule_NET_GetCurrentState;
	import.RefreshMouseAngles = CL_GameModule_RefreshMouseAngles;

	import.R_UpdateScreen = SCR_UpdateScreen;
	import.R_GetClippedFragments = re.GetClippedFragments;
	import.R_ClearScene = re.ClearScene;
	import.R_AddEntityToScene = re.AddEntityToScene;
	import.R_AddLightToScene = re.AddLightToScene;
	import.R_AddPolyToScene = re.AddPolyToScene;
	import.R_AddLightStyleToScene = re.AddLightStyleToScene;
	import.R_RenderScene = re.RenderScene;
	import.R_SpeedsMessage = re.SpeedsMessage;
	import.R_RegisterWorldModel = CL_GameModule_R_RegisterWorldModel;
	import.R_ModelBounds = re.ModelBounds;
	import.R_ModelFrameBounds = re.ModelFrameBounds;
	import.R_RegisterModel = re.RegisterModel;
	import.R_RegisterPic = re.RegisterPic;
	import.R_RegisterRawPic = re.RegisterRawPic;
	import.R_RegisterLevelshot = re.RegisterLevelshot;
	import.R_RegisterSkin = re.RegisterSkin;
	import.R_RegisterSkinFile = re.RegisterSkinFile;
	import.R_LerpTag = re.LerpTag;
	import.R_LightForOrigin = re.LightForOrigin;
	import.R_SetCustomColor = re.SetCustomColor;
	import.R_DrawStretchPic = re.DrawStretchPic;
	import.R_DrawStretchPoly = re.DrawStretchPoly;
	import.R_DrawRotatedStretchPic = re.DrawRotatedStretchPic;
	import.R_Scissor = re.Scissor;
	import.R_GetScissor = re.GetScissor;
	import.R_ResetScissor = re.ResetScissor;
	import.R_GetShaderDimensions = re.GetShaderDimensions;
	import.R_TransformVectorToScreen = re.TransformVectorToScreen;
	import.R_SkeletalGetNumBones = re.SkeletalGetNumBones;
	import.R_SkeletalGetBoneInfo = re.SkeletalGetBoneInfo;
	import.R_SkeletalGetBonePose = re.SkeletalGetBonePose;

	import.R_GetShaderForOrigin = re.GetShaderForOrigin;
	import.R_GetShaderCinematic = re.GetShaderCinematic;

	import.VID_FlashWindow = VID_FlashWindow;

	import.CM_NumInlineModels = CL_GameModule_CM_NumInlineModels;
	import.CM_InlineModel = CL_GameModule_CM_InlineModel;
	import.CM_TransformedBoxTrace = CL_GameModule_CM_TransformedBoxTrace;
	import.CM_RoundUpToHullSize = CL_GameModule_CM_RoundUpToHullSize;
	import.CM_TransformedPointContents = CL_GameModule_CM_TransformedPointContents;
	import.CM_ModelForBBox = CL_GameModule_CM_ModelForBBox;
	import.CM_OctagonModelForBBox = CL_GameModule_CM_OctagonModelForBBox;
	import.CM_InlineModelBounds = CL_GameModule_CM_InlineModelBounds;
	import.CM_InPVS = CL_GameModule_CM_InPVS;

	import.S_RegisterSound = CL_SoundModule_RegisterSound;
	import.S_StartFixedSound = CL_SoundModule_StartFixedSound;
	import.S_StartRelativeSound = CL_SoundModule_StartRelativeSound;
	import.S_StartGlobalSound = CL_SoundModule_StartGlobalSound;
	import.S_Update = CL_GameModule_SoundUpdate;
	import.S_AddLoopSound = CL_SoundModule_AddLoopSound;
	import.S_StartBackgroundTrack = CL_SoundModule_StartBackgroundTrack;
	import.S_StopBackgroundTrack = CL_SoundModule_StopBackgroundTrack;
	import.S_RawSamples = CL_GameModule_S_RawSamples;
	import.S_PositionedRawSamples = CL_SoundModule_PositionedRawSamples;
	import.S_GetRawSamplesLength = CL_SoundModule_GetRawSamplesLength;
	import.S_GetPositionedRawSamplesLength = CL_SoundModule_GetPositionedRawSamplesLength;
	import.S_SetEntitySpatilization = CL_SoundModule_SetEntitySpatilization;

	import.SCR_RegisterFont = SCR_RegisterFont;
	import.SCR_RegisterSpecialFont = SCR_RegisterSpecialFont;
	import.SCR_DrawString = SCR_DrawString;
	import.SCR_DrawStringWidth = SCR_DrawStringWidth;
	import.SCR_DrawClampString = SCR_DrawClampString;
	import.SCR_DrawMultilineString = SCR_DrawMultilineString;
	import.SCR_DrawRawChar = SCR_DrawRawChar;
	import.SCR_DrawClampChar = SCR_DrawClampChar;
	import.SCR_FontSize = SCR_FontSize;
	import.SCR_FontHeight = SCR_FontHeight;
	import.SCR_FontUnderline = SCR_FontUnderline;
	import.SCR_FontAdvance = SCR_FontAdvance;
	import.SCR_FontXHeight = SCR_FontXHeight;
	import.SCR_SetDrawCharIntercept = SCR_SetDrawCharIntercept;
	import.SCR_strWidth = SCR_strWidth;
	import.SCR_StrlenForWidth = SCR_StrlenForWidth;

	import.AsyncStream_UrlEncode = AsyncStream_UrlEncode;
	import.AsyncStream_UrlDecode = AsyncStream_UrlDecode;
	import.AsyncStream_PerformRequest = CL_GameModule_AsyncStream_PerformRequest;
	import.GetBaseServerURL = CL_GetBaseServerURL;

	import.Mem_Alloc = CL_GameModule_MemAlloc;
	import.Mem_Free = CL_GameModule_MemFree;

	import.L10n_LoadLangPOFile = &CL_GameModule_L10n_LoadLangPOFile;
	import.L10n_TranslateString = &CL_GameModule_L10n_TranslateString;
	import.L10n_ClearDomain = &CL_GameModule_L10n_ClearDomain;

	import.CIN_AddRawSamplesListener = &CL_GameModule_AddRawSamplesListener;

	import.IN_GetThumbsticks = IN_GetThumbsticks;
	import.IN_IME_GetCandidates = IN_IME_GetCandidates;
	import.IN_SupportedDevices = IN_SupportedDevices;

	if( builtinAPIfunc ) {
		cge = builtinAPIfunc( &import );
	}
	else {
		cge = (cgame_export_t *)Com_LoadGameLibrary( "cgame", "GetCGameAPI", &module_handle, &import, cls.sv_pure, NULL );
	}
	if( !cge )
		Com_Error( ERR_DROP, "Failed to load client game DLL" );

	AC_LoadLibrary( (void *) &import, (void *) cge, ANTICHEAT_CLIENT );	// impulZ: Refire AC Init

	apiversion = cge->API();
	if( apiversion != CGAME_API_VERSION )
	{
		Com_UnloadGameLibrary( &module_handle );
		Mem_FreePool( &cl_gamemodulepool );
		cge = NULL;
		Com_Error( ERR_DROP, "Client game is version %i, not %i", apiversion, CGAME_API_VERSION );
	}

	CL_GameModule_AsyncStream_Init();

	start = Sys_Milliseconds();
	cge->Init( cls.servername, cl.playernum,
		viddef.width, viddef.height, VID_GetPixelRatio(),
		cls.demo.playing, cls.demo.playing ? cls.demo.filename : "",
		cls.sv_pure, cl.snapFrameTime, APP_PROTOCOL_VERSION, APP_DEMO_EXTENSION_STR,
		cls.mediaRandomSeed, cl.gamestart );

	Com_DPrintf( "CL_GameModule_Init: %.2f seconds\n", (float)( Sys_Milliseconds() - start ) * 0.001f );

	cl.gamestart = false;
	cls.cgameActive = true;
}
Ejemplo n.º 3
0
/*
* SV_InitGameProgs
*
* Init the game subsystem for a new map
*/
void SV_InitGameProgs( void )
{
	int apiversion;
	game_import_t import;
	void *( *builtinAPIfunc )(void *) = NULL;
	char manifest[MAX_INFO_STRING];

#ifdef GAME_HARD_LINKED
	builtinAPIfunc = GetGameAPI;
#endif

	// unload anything we have now
	if( ge )
		SV_ShutdownGameProgs();

	sv_gameprogspool = _Mem_AllocPool( NULL, "Game Progs", MEMPOOL_GAMEPROGS, __FILE__, __LINE__ );

	// load a new game dll
	import.Print = PF_dprint;
	import.Error = PF_error;
	import.GameCmd = PF_GameCmd;

	import.inPVS = PF_inPVS;

	import.CM_TransformedPointContents = PF_CM_TransformedPointContents;
	import.CM_TransformedBoxTrace = PF_CM_TransformedBoxTrace;
	import.CM_RoundUpToHullSize = PF_CM_RoundUpToHullSize;
	import.CM_NumInlineModels = PF_CM_NumInlineModels;
	import.CM_InlineModel = PF_CM_InlineModel;
	import.CM_InlineModelBounds = PF_CM_InlineModelBounds;
	import.CM_ModelForBBox = PF_CM_ModelForBBox;
	import.CM_OctagonModelForBBox = PF_CM_OctagonModelForBBox;
	import.CM_AreasConnected = PF_CM_AreasConnected;
	import.CM_SetAreaPortalState = PF_CM_SetAreaPortalState;
	import.CM_BoxLeafnums = PF_CM_BoxLeafnums;
	import.CM_LeafCluster = PF_CM_LeafCluster;
	import.CM_LeafArea = PF_CM_LeafArea;

	import.Milliseconds = Sys_Milliseconds;

	import.ModelIndex = SV_ModelIndex;
	import.SoundIndex = SV_SoundIndex;
	import.ImageIndex = SV_ImageIndex;
	import.SkinIndex = SV_SkinIndex;

	import.ConfigString = PF_ConfigString;
	import.GetConfigString = PF_GetConfigString;
	import.PureSound = PF_PureSound;
	import.PureModel = PF_PureModel;

	import.FS_FOpenFile = FS_FOpenFile;
	import.FS_Read = FS_Read;
	import.FS_Write = FS_Write;
	import.FS_Print = FS_Print;
	import.FS_Tell = FS_Tell;
	import.FS_Seek = FS_Seek;
	import.FS_Eof = FS_Eof;
	import.FS_Flush = FS_Flush;
	import.FS_FCloseFile = FS_FCloseFile;
	import.FS_RemoveFile = FS_RemoveFile;
	import.FS_GetFileList = FS_GetFileList;
	import.FS_FirstExtension = FS_FirstExtension;
	import.FS_MoveFile = FS_MoveFile;
	import.FS_IsUrl = FS_IsUrl;
	import.FS_FileMTime = FS_BaseFileMTime;
	import.FS_RemoveDirectory = FS_RemoveDirectory;

	import.Mem_Alloc = PF_MemAlloc;
	import.Mem_Free = PF_MemFree;

	import.Dynvar_Create = Dynvar_Create;
	import.Dynvar_Destroy = Dynvar_Destroy;
	import.Dynvar_Lookup = Dynvar_Lookup;
	import.Dynvar_GetName = Dynvar_GetName;
	import.Dynvar_GetValue = Dynvar_GetValue;
	import.Dynvar_SetValue = Dynvar_SetValue;
	import.Dynvar_AddListener = Dynvar_AddListener;
	import.Dynvar_RemoveListener = Dynvar_RemoveListener;

	import.Cvar_Get = Cvar_Get;
	import.Cvar_Set = Cvar_Set;
	import.Cvar_SetValue = Cvar_SetValue;
	import.Cvar_ForceSet = Cvar_ForceSet;
	import.Cvar_Value = Cvar_Value;
	import.Cvar_String = Cvar_String;

	import.Cmd_Argc = Cmd_Argc;
	import.Cmd_Argv = Cmd_Argv;
	import.Cmd_Args = Cmd_Args;
	import.Cmd_AddCommand = Cmd_AddCommand;
	import.Cmd_RemoveCommand = Cmd_RemoveCommand;

	import.ML_Update = ML_Update;
	import.ML_GetMapByNum = ML_GetMapByNum;
	import.ML_FilenameExists = ML_FilenameExists;
	import.ML_GetFullname = ML_GetFullname;

	import.Cmd_ExecuteText = Cbuf_ExecuteText;
	import.Cbuf_Execute = Cbuf_Execute;

	import.FakeClientConnect = SVC_FakeConnect;
	import.DropClient = PF_DropClient;
	import.GetClientState = PF_GetClientState;
	import.ExecuteClientThinks = SV_ExecuteClientThinks;

	import.LocateEntities = SV_LocateEntities;

	import.asGetAngelExport = Com_asGetAngelExport;

	import.GetStatQueryAPI = PF_StatQuery_GetAPI;
	import.MM_SendQuery = SV_MM_SendQuery;
	import.MM_GameState = SV_MM_GameState;

	// clear module manifest string
	assert( sizeof( manifest ) >= MAX_INFO_STRING );
	memset( manifest, 0, sizeof( manifest ) );

	if( builtinAPIfunc ) {
		ge = builtinAPIfunc( &import );
	}
	else {
		ge = (game_export_t *)Com_LoadGameLibrary( "game", "GetGameAPI", &module_handle, &import, false, manifest );
	}
	if( !ge )
		Com_Error( ERR_DROP, "Failed to load game DLL" );

	AC_LoadLibrary( (void *) &import, (void *) ge, ANTICHEAT_SERVER );	// impulZ: Refire AC Init

	apiversion = ge->API();
	if( apiversion != GAME_API_VERSION )
	{
		Com_UnloadGameLibrary( &module_handle );
		Mem_FreePool( &sv_gameprogspool );
		ge = NULL;
		Com_Error( ERR_DROP, "Game is version %i, not %i", apiversion, GAME_API_VERSION );
	}

	Cvar_ForceSet( "sv_modmanifest", manifest );

	SV_SetServerConfigStrings();

	ge->Init( time( NULL ), svc.snapFrameTime, APP_PROTOCOL_VERSION, APP_DEMO_EXTENSION_STR );
}