Didn't fysh just externally link to
te in his linux code and add the server_i486.so lib into his makefile ?
My version for both linux (Bailopan deserves some credit for this as I'd got it slightly wrong initially) and windows (Lance VOrgin):-
I've sent this to a few people but it should probably be posted as public too. The class ManiGameType corresponds to the gametypes.txt file that I use for compatibilty across different source games.
The gpManiGameType->GetLinuxBin() function returns "./cstrike/bin/server_i486.so" for CSS. It should be different for each mod that it runs on.
Code:
if (effects && gpManiGameType->GetAdvancedEffectsAllowed())
{
#ifdef __linux__
void *handle;
void *var_address;
handle = dlopen(gpManiGameType->GetLinuxBin(), RTLD_NOW);
if (handle == NULL)
{
Msg("Failed to open server image, error [%s]\n", dlerror());
gpManiGameType->SetAdvancedEffectsAllowed(false);
}
else
{
Msg("Program Start at [%p]\n", handle);
var_address = dlsym(handle, "te");
if (var_address == NULL)
{
Msg("dlsym failure : Error [%s]\n", dlerror());
gpManiGameType->SetAdvancedEffectsAllowed(false);
}
else
{
Msg("var_address = %p\n", var_address);
temp_ents = *(ITempEntsSystem **) var_address;
}
dlclose(handle);
}
#else
temp_ents = **(ITempEntsSystem***)(VFN2(effects, gpManiGameType->GetAdvancedEffectsVFuncOffset()) + (gpManiGameType->GetAdvancedEffectsCodeOffset()));
#endif
}
Mani
__________________