@PM: the comment I added is "what is this ;(semicolon) ?", not "what is this ?"
Code:
// test file, if found = STEAM Linux/Win32 dedicated server
fp = fopen ("valve/steam.inf", "rb");
if (fp != NULL)
{
fclose (fp); // test was successful, close it
counterstrike = 1; // its cs 1.6
}
// test file, if found = STEAM Win32 listenserver
fp = fopen ("FileSystem_Steam.dll", "rb");
if (fp != NULL)
{
fclose (fp); // test was successful, close it
counterstrike = 1; // its cs 1.6
}
...If someone is using old versions like CS 1.3 in Steam this check won't care about it and believe he is using CS 1.6

So I am using a check like this:
Code:
// Check which version of Counter-Strike we're running
void VersionCheck(void)
{
// see if we are running Counter-Strike v1.6...
unsigned char *tempbuf;
int i;
// only CS v1.6 has this file
// use HL Engine function so that it would not be affected by Steam...
tempbuf = LOAD_FILE_FOR_ME("sprites/weapon_famas.txt", &i);
if (tempbuf)
{
g_bIsVersion16 = TRUE;
FREE_FILE(tempbuf);
}
}
also why are you doing this ? in this way all the functions will just be called twice:
Code:
C_DLLEXPORT int
GetEntityAPI2 (DLL_FUNCTIONS * pFunctionTable, int *interfaceVersion)
{
gFunctionTable.pfnGameInit = GameDLLInit;
gFunctionTable.pfnSpawn = Spawn;
gFunctionTable.pfnClientConnect = ClientConnect;
gFunctionTable.pfnClientDisconnect = ClientDisconnect;
gFunctionTable.pfnClientPutInServer = ClientPutInServer;
gFunctionTable.pfnClientCommand = ClientCommand;
gFunctionTable.pfnStartFrame = StartFrame;
memcpy (pFunctionTable, &gFunctionTable, sizeof (DLL_FUNCTIONS));
return (TRUE);
}
C_DLLEXPORT int
GetEntityAPI2_Post (DLL_FUNCTIONS * pFunctionTable, int *interfaceVersion)
{
gFunctionTable.pfnGameInit = GameDLLInit;
gFunctionTable.pfnSpawn = Spawn_Post;
gFunctionTable.pfnClientConnect = ClientConnect;
gFunctionTable.pfnClientDisconnect = ClientDisconnect;
gFunctionTable.pfnClientPutInServer = ClientPutInServer;
gFunctionTable.pfnClientCommand = ClientCommand;
gFunctionTable.pfnStartFrame = StartFrame;
memcpy (pFunctionTable, &gFunctionTable, sizeof (DLL_FUNCTIONS));
return (TRUE);
}
also...
Code:
* Source code is (c) copyrighted by Stefan Hendriks unless stated otherwise.
* Source code may never be redistributed without explicit permission of the
* author.
* <snipped>
* This project is open-source, it is protected under the GPL license;
* By using this source-code you agree that you will ALWAYS release the
* source-code with your project.
...I'm afraid there's something wrong with the 1st paragraph. The GNU GPL has clause that makes it free to redistribute the software...
Quote:
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
...so it will automatically give licensee "permission" to redistribute the code. If you don't want others redistribute your software you can't apply the GNU GPL (anyway, all metamod plugins have to be GPL so if you want to do it you'll have to convert the bot back to botman's hook DLL style)