Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e47703ee83 | ||
|
|
0c3cc85f6d | ||
|
|
467663bff5 | ||
|
|
ac862954f1 | ||
|
|
a12f61d463 | ||
|
|
7d372ceedc | ||
|
|
bba7ff1c37 | ||
|
|
6f8fad7784 | ||
|
|
22f96dd195 | ||
|
|
423ad68a6f | ||
|
|
f522c531fb | ||
|
|
fe71d6a5ab | ||
|
|
2352b11b18 | ||
|
|
d140bfa8af | ||
|
|
a41c004d1c | ||
|
|
9009c115a5 | ||
|
|
b637ab794b | ||
|
|
4be098c694 |
+7
-22
@@ -1,16 +1,14 @@
|
|||||||
We now use svn:keywords "Id" on all .c/.cpp/.h/.inc/.sp/ files.
|
We now use svn:keywords "Id" on all .c/.cpp/.h/.sp/.inc files. Please make sure your client is configured properly.
|
||||||
Please make sure your client is configured properly.
|
|
||||||
|
|
||||||
WINDOWS:
|
WINDOWS:
|
||||||
- Open your Application Data directory.
|
Open your Application Data folder.
|
||||||
Windows XP/2000: C:\Documents and Settings\<user>\Application Data
|
Windows XP/2000: C:\Documents and Settings\<user>\Application Data
|
||||||
Windows Vista: C:\Users\<user>\AppData\Roaming
|
Windows Vista: C:\Users\<user>\AppData\Roaming
|
||||||
|
|
||||||
- Now go to the Subversion directory.
|
Now go to Subversion. Open the "config" file with a text editor.
|
||||||
- Open the "config" file with a text editor.
|
|
||||||
|
|
||||||
LINUX:
|
LINUX:
|
||||||
- Open ~/.subversion/config with your favorite text editor.
|
Open ~/.subversion/config with your favorite text editor.
|
||||||
|
|
||||||
Under [miscellany], uncomment this line:
|
Under [miscellany], uncomment this line:
|
||||||
# enable-auto-props = yes
|
# enable-auto-props = yes
|
||||||
@@ -19,18 +17,5 @@ Under [auto-props], add these lines:
|
|||||||
*.c = svn:keywords=Id
|
*.c = svn:keywords=Id
|
||||||
*.cpp = svn:keywords=Id
|
*.cpp = svn:keywords=Id
|
||||||
*.h = svn:keywords=Id
|
*.h = svn:keywords=Id
|
||||||
*.inc = svn:keywords=Id
|
|
||||||
*.sp = svn:keywords=Id
|
*.sp = svn:keywords=Id
|
||||||
|
*.inc = svn:keywords=Id
|
||||||
|
|
||||||
If you find a file with one of the above extensions that does not have the svn:keywords property...
|
|
||||||
|
|
||||||
TORTOISE SVN:
|
|
||||||
- Right click on the file(s) that do not have the property.
|
|
||||||
- In the context menu that appears, select TortoiseSVN -> Properties.
|
|
||||||
- A properties window should appear. Click the Add button.
|
|
||||||
- Select "svn:keywords" from the "Property name" combo box and type "Id" in the "Property value" text area.
|
|
||||||
- Click OK on both windows and commit the change(s).
|
|
||||||
|
|
||||||
CLI SVN CLIENT:
|
|
||||||
- Execute the following command: svn propset svn:keywords Id <files>
|
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
// Custom admin menu commands.
|
|
||||||
// For more information:
|
|
||||||
//
|
|
||||||
// http://wiki.alliedmods.net/Custom_Admin_Menu_%28SourceMod%29
|
|
||||||
//
|
|
||||||
// Note: This file must be in Valve KeyValues format (no multiline comments)
|
|
||||||
//
|
|
||||||
|
|
||||||
"Commands"
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
/* Add group options to be added to 'group' or 'groupplayer' type submenus
|
|
||||||
* The left side is the name that will show in the menu, right is the command that will be fired
|
|
||||||
*
|
|
||||||
* For more information: http://wiki.alliedmods.net/Custom_Admin_Menu_%28SourceMod%29
|
|
||||||
*/
|
|
||||||
|
|
||||||
Groups
|
|
||||||
{
|
|
||||||
"All" "@all"
|
|
||||||
"Bots" "@bots"
|
|
||||||
"Alive" "@alive"
|
|
||||||
"Dead" "@dead"
|
|
||||||
"Humans" "@humans"
|
|
||||||
"Current aim" "@aim"
|
|
||||||
|
|
||||||
/* You can enable these if you are using Counter-Strike Source and running the cstrike extension */
|
|
||||||
// "Terrorists" "@t"
|
|
||||||
// "Counter-Terrorists" "@ct"
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
"target" "default"
|
"target" "default"
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For the "rockthevote" plugin */
|
/* For the "randomcycle" plugin */
|
||||||
"rockthevote"
|
"rockthevote"
|
||||||
{
|
{
|
||||||
"target" "default"
|
"target" "default"
|
||||||
|
|||||||
+4
-355
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod
|
* SourceMod
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -41,14 +41,12 @@
|
|||||||
#include "sourcemod.h"
|
#include "sourcemod.h"
|
||||||
#include "sm_stringutil.h"
|
#include "sm_stringutil.h"
|
||||||
#include "sourcemm_api.h"
|
#include "sourcemm_api.h"
|
||||||
#include "sm_srvcmds.h"
|
|
||||||
|
|
||||||
#define LEVEL_STATE_NONE 0
|
#define LEVEL_STATE_NONE 0
|
||||||
#define LEVEL_STATE_LEVELS 1
|
#define LEVEL_STATE_LEVELS 1
|
||||||
#define LEVEL_STATE_FLAGS 2
|
#define LEVEL_STATE_FLAGS 2
|
||||||
|
|
||||||
AdminCache g_Admins;
|
AdminCache g_Admins;
|
||||||
char g_ReverseFlags[26];
|
|
||||||
AdminFlag g_FlagLetters[26];
|
AdminFlag g_FlagLetters[26];
|
||||||
bool g_FlagSet[26];
|
bool g_FlagSet[26];
|
||||||
|
|
||||||
@@ -301,23 +299,8 @@ void AdminCache::OnSourceModAllInitialized()
|
|||||||
|
|
||||||
void AdminCache::OnSourceModLevelChange(const char *mapName)
|
void AdminCache::OnSourceModLevelChange(const char *mapName)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
AdminFlag flag;
|
|
||||||
|
|
||||||
/* For now, we only read these once per level. */
|
/* For now, we only read these once per level. */
|
||||||
s_FlagReader.LoadLevels();
|
s_FlagReader.LoadLevels();
|
||||||
|
|
||||||
for (i = 0; i < 26; i++)
|
|
||||||
{
|
|
||||||
if (FindFlag('a' + i, &flag))
|
|
||||||
{
|
|
||||||
g_ReverseFlags[flag] = 'a' + i;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_ReverseFlags[flag] = '?';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdminCache::OnSourceModShutdown()
|
void AdminCache::OnSourceModShutdown()
|
||||||
@@ -451,9 +434,7 @@ AdminId AdminCache::CreateAdmin(const char *name)
|
|||||||
assert(pUser->magic == USR_MAGIC_UNSET);
|
assert(pUser->magic == USR_MAGIC_UNSET);
|
||||||
id = m_FreeUserList;
|
id = m_FreeUserList;
|
||||||
m_FreeUserList = pUser->next_user;
|
m_FreeUserList = pUser->next_user;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
id = m_pMemory->CreateMem(sizeof(AdminUser), (void **)&pUser);
|
id = m_pMemory->CreateMem(sizeof(AdminUser), (void **)&pUser);
|
||||||
pUser->grp_size = 0;
|
pUser->grp_size = 0;
|
||||||
pUser->grp_table = -1;
|
pUser->grp_table = -1;
|
||||||
@@ -473,28 +454,19 @@ AdminId AdminCache::CreateAdmin(const char *name)
|
|||||||
{
|
{
|
||||||
m_FirstUser = id;
|
m_FirstUser = id;
|
||||||
m_LastUser = id;
|
m_LastUser = id;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
AdminUser *pPrev = (AdminUser *)m_pMemory->GetAddress(m_LastUser);
|
AdminUser *pPrev = (AdminUser *)m_pMemory->GetAddress(m_LastUser);
|
||||||
pPrev->next_user = id;
|
pPrev->next_user = id;
|
||||||
pUser->prev_user = m_LastUser;
|
pUser->prev_user = m_LastUser;
|
||||||
m_LastUser = id;
|
m_LastUser = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Since we always append to the tail, we should invalidate their next */
|
|
||||||
pUser->next_user = -1;
|
|
||||||
|
|
||||||
if (name && name[0] != '\0')
|
if (name && name[0] != '\0')
|
||||||
{
|
{
|
||||||
int nameidx = m_pStrings->AddString(name);
|
int nameidx = m_pStrings->AddString(name);
|
||||||
pUser = (AdminUser *)m_pMemory->GetAddress(id);
|
pUser = (AdminUser *)m_pMemory->GetAddress(id);
|
||||||
pUser->nameidx = nameidx;
|
pUser->nameidx = nameidx;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
pUser->nameidx = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@@ -1440,12 +1412,6 @@ void AdminCache::SetAdminPassword(AdminId id, const char *password)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (password[0] == '\0')
|
|
||||||
{
|
|
||||||
pUser->password = -1;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int i_password = m_pStrings->AddString(password);
|
int i_password = m_pStrings->AddString(password);
|
||||||
pUser = (AdminUser *)m_pMemory->GetAddress(id);
|
pUser = (AdminUser *)m_pMemory->GetAddress(id);
|
||||||
pUser->password = i_password;
|
pUser->password = i_password;
|
||||||
@@ -1621,9 +1587,7 @@ bool AdminCache::CanAdminTarget(AdminId id, AdminId target)
|
|||||||
|
|
||||||
bool AdminCache::FindFlag(char c, AdminFlag *pAdmFlag)
|
bool AdminCache::FindFlag(char c, AdminFlag *pAdmFlag)
|
||||||
{
|
{
|
||||||
if (c < 'a'
|
if (c < 'a' || c > 'z')
|
||||||
|| c > 'z'
|
|
||||||
|| !g_FlagSet[(unsigned)c - (unsigned)'a'])
|
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1636,21 +1600,6 @@ bool AdminCache::FindFlag(char c, AdminFlag *pAdmFlag)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AdminCache::FindFlagChar(AdminFlag flag, char *c)
|
|
||||||
{
|
|
||||||
if (!g_FlagSet[flag])
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (c)
|
|
||||||
{
|
|
||||||
*c = g_ReverseFlags[flag];
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
FlagBits AdminCache::ReadFlagString(const char *flags, const char **end)
|
FlagBits AdminCache::ReadFlagString(const char *flags, const char **end)
|
||||||
{
|
{
|
||||||
FlagBits bits = 0;
|
FlagBits bits = 0;
|
||||||
@@ -1781,303 +1730,3 @@ bool AdminCache::CheckAccess(int client, const char *cmd, FlagBits flags, bool o
|
|||||||
|
|
||||||
return g_ConCmds.CheckCommandAccess(client, cmd, bits) ? 1 : 0;
|
return g_ConCmds.CheckCommandAccess(client, cmd, bits) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void iterator_glob_basic_override(Trie *pTrie, const char *key, void **value, void *data)
|
|
||||||
{
|
|
||||||
FILE *fp;
|
|
||||||
int flags;
|
|
||||||
char flagstr[64];
|
|
||||||
|
|
||||||
fp = (FILE *)data;
|
|
||||||
flags = (int)*value;
|
|
||||||
g_Admins.FillFlagString(flags, flagstr, sizeof(flagstr));
|
|
||||||
|
|
||||||
fprintf(fp, "\t\"%s\"\t\t\"%s\"\n", key, flagstr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void iterator_glob_grp_override(Trie *pTrie, const char *key, void **value, void *data)
|
|
||||||
{
|
|
||||||
FILE *fp;
|
|
||||||
int flags;
|
|
||||||
char flagstr[64];
|
|
||||||
|
|
||||||
fp = (FILE *)data;
|
|
||||||
flags = (int)*value;
|
|
||||||
g_Admins.FillFlagString(flags, flagstr, sizeof(flagstr));
|
|
||||||
|
|
||||||
fprintf(fp, "\t\"@%s\"\t\t\"%s\"\n", key, flagstr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void iterator_group_basic_override(Trie *pTrie, const char *key, void **value, void *data)
|
|
||||||
{
|
|
||||||
FILE *fp;
|
|
||||||
int flags;
|
|
||||||
char flagstr[64];
|
|
||||||
|
|
||||||
fp = (FILE *)data;
|
|
||||||
flags = (int)*value;
|
|
||||||
g_Admins.FillFlagString(flags, flagstr, sizeof(flagstr));
|
|
||||||
|
|
||||||
fprintf(fp, "\t\t\t\"%s\"\t\t\"%s\"\n", key, flagstr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void iterator_group_grp_override(Trie *pTrie, const char *key, void **value, void *data)
|
|
||||||
{
|
|
||||||
FILE *fp;
|
|
||||||
int flags;
|
|
||||||
char flagstr[64];
|
|
||||||
|
|
||||||
fp = (FILE *)data;
|
|
||||||
flags = (int)*value;
|
|
||||||
g_Admins.FillFlagString(flags, flagstr, sizeof(flagstr));
|
|
||||||
|
|
||||||
fprintf(fp, "\t\t\t\"@%s\"\t\t\"%s\"\n", key, flagstr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AdminCache::DumpCache(FILE *fp)
|
|
||||||
{
|
|
||||||
int *itable;
|
|
||||||
AdminId aid;
|
|
||||||
GroupId gid;
|
|
||||||
char flagstr[64];
|
|
||||||
unsigned int num;
|
|
||||||
AdminUser *pAdmin;
|
|
||||||
AdminGroup *pGroup;
|
|
||||||
char name_buffer[512];
|
|
||||||
|
|
||||||
fprintf(fp, "\"Groups\"\n{\n");
|
|
||||||
|
|
||||||
num = 0;
|
|
||||||
gid = m_FirstGroup;
|
|
||||||
while (gid != INVALID_GROUP_ID
|
|
||||||
&& (pGroup = GetGroup(gid)) != NULL)
|
|
||||||
{
|
|
||||||
num++;
|
|
||||||
FillFlagString(pGroup->addflags, flagstr, sizeof(flagstr));
|
|
||||||
|
|
||||||
fprintf(fp, "\t/* num = %d, gid = 0x%X */\n", num, gid);
|
|
||||||
fprintf(fp, "\t\"%s\"\n\t{\n", GetString(pGroup->nameidx));
|
|
||||||
fprintf(fp, "\t\t\"flags\"\t\t\t\"%s\"\n", flagstr);
|
|
||||||
fprintf(fp, "\t\t\"immunity\"\t\t\"%d\"\n", pGroup->immunity_level);
|
|
||||||
|
|
||||||
if (pGroup->immune_table != -1
|
|
||||||
&& (itable = (int *)m_pMemory->GetAddress(pGroup->immune_table)) != NULL)
|
|
||||||
{
|
|
||||||
AdminGroup *pAltGroup;
|
|
||||||
const char *gname, *mod;
|
|
||||||
|
|
||||||
for (int i = 1; i <= itable[0]; i++)
|
|
||||||
{
|
|
||||||
if ((pAltGroup = GetGroup(itable[i])) == NULL)
|
|
||||||
{
|
|
||||||
/* Assume the rest of the table is corrupt */
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
gname = GetString(pAltGroup->nameidx);
|
|
||||||
if (atoi(gname) != 0)
|
|
||||||
{
|
|
||||||
mod = "@";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mod = "";
|
|
||||||
}
|
|
||||||
fprintf(fp, "\t\t\"immunity\"\t\t\"%s%s\"\n", mod, gname);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf(fp, "\n\t\t\"Overrides\"\n\t\t{\n");
|
|
||||||
if (pGroup->pCmdGrpTable != NULL)
|
|
||||||
{
|
|
||||||
sm_trie_bad_iterator(pGroup->pCmdGrpTable,
|
|
||||||
name_buffer,
|
|
||||||
sizeof(name_buffer),
|
|
||||||
iterator_group_grp_override,
|
|
||||||
fp);
|
|
||||||
}
|
|
||||||
if (pGroup->pCmdTable != NULL)
|
|
||||||
{
|
|
||||||
sm_trie_bad_iterator(pGroup->pCmdTable,
|
|
||||||
name_buffer,
|
|
||||||
sizeof(name_buffer),
|
|
||||||
iterator_group_basic_override,
|
|
||||||
fp);
|
|
||||||
}
|
|
||||||
fprintf(fp, "\t\t}\n");
|
|
||||||
|
|
||||||
fprintf(fp, "\t}\n");
|
|
||||||
|
|
||||||
if ((gid = pGroup->next_grp) != INVALID_GROUP_ID)
|
|
||||||
{
|
|
||||||
fprintf(fp, "\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf(fp, "}\n\n");
|
|
||||||
fprintf(fp, "\"Admins\"\n{\n");
|
|
||||||
|
|
||||||
num = 0;
|
|
||||||
aid = m_FirstUser;
|
|
||||||
while (aid != INVALID_ADMIN_ID
|
|
||||||
&& (pAdmin = GetUser(aid)) != NULL)
|
|
||||||
{
|
|
||||||
num++;
|
|
||||||
FillFlagString(pAdmin->flags, flagstr, sizeof(flagstr));
|
|
||||||
|
|
||||||
fprintf(fp, "\t/* num = %d, aid = 0x%X, serialno = 0x%X*/\n", num, aid, pAdmin->serialchange);
|
|
||||||
|
|
||||||
if (pAdmin->nameidx != -1)
|
|
||||||
{
|
|
||||||
fprintf(fp, "\t\"%s\"\n\t{\n", GetString(pAdmin->nameidx));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fprintf(fp, "\t\"\"\n\t{\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pAdmin->auth.identidx != -1)
|
|
||||||
{
|
|
||||||
fprintf(fp, "\t\t\"auth\"\t\t\t\"%s\"\n", GetMethodName(pAdmin->auth.index));
|
|
||||||
fprintf(fp, "\t\t\"identity\"\t\t\"%s\"\n", GetString(pAdmin->auth.identidx));
|
|
||||||
}
|
|
||||||
if (pAdmin->password != -1)
|
|
||||||
{
|
|
||||||
fprintf(fp, "\t\t\"password\"\t\t\"%s\"\n", GetString(pAdmin->password));
|
|
||||||
}
|
|
||||||
fprintf(fp, "\t\t\"flags\"\t\t\t\"%s\"\n", flagstr);
|
|
||||||
fprintf(fp, "\t\t\"immunity\"\t\t\"%d\"\n", pAdmin->immunity_level);
|
|
||||||
|
|
||||||
if (pAdmin->grp_count != 0
|
|
||||||
&& pAdmin->grp_table != -1
|
|
||||||
&& (itable = (int *)m_pMemory->GetAddress(pAdmin->grp_table)) != NULL)
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
for (i = 0; i < pAdmin->grp_count; i++)
|
|
||||||
{
|
|
||||||
if ((pGroup = GetGroup(itable[i])) == NULL)
|
|
||||||
{
|
|
||||||
/* Assume the rest of the table is corrupt */
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
fprintf(fp, "\t\t\"group\"\t\t\t\"%s\"\n", GetString(pGroup->nameidx));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf(fp, "\t}\n");
|
|
||||||
|
|
||||||
if ((aid = pAdmin->next_user) != INVALID_ADMIN_ID)
|
|
||||||
{
|
|
||||||
fprintf(fp, "\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf(fp, "}\n\n");
|
|
||||||
|
|
||||||
fprintf(fp, "\"Overrides\"\n{\n");
|
|
||||||
if (m_pCmdGrpOverrides != NULL)
|
|
||||||
{
|
|
||||||
sm_trie_bad_iterator(m_pCmdGrpOverrides,
|
|
||||||
name_buffer,
|
|
||||||
sizeof(name_buffer),
|
|
||||||
iterator_glob_grp_override,
|
|
||||||
fp);
|
|
||||||
}
|
|
||||||
if (m_pCmdOverrides != NULL)
|
|
||||||
{
|
|
||||||
sm_trie_bad_iterator(m_pCmdOverrides,
|
|
||||||
name_buffer,
|
|
||||||
sizeof(name_buffer),
|
|
||||||
iterator_glob_basic_override,
|
|
||||||
fp);
|
|
||||||
}
|
|
||||||
fprintf(fp, "}\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
AdminGroup *AdminCache::GetGroup(GroupId gid)
|
|
||||||
{
|
|
||||||
AdminGroup *pGroup;
|
|
||||||
|
|
||||||
pGroup = (AdminGroup *)m_pMemory->GetAddress(gid);
|
|
||||||
if (!pGroup || pGroup->magic != GRP_MAGIC_SET)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return pGroup;
|
|
||||||
}
|
|
||||||
|
|
||||||
AdminUser *AdminCache::GetUser(AdminId aid)
|
|
||||||
{
|
|
||||||
AdminUser *pAdmin;
|
|
||||||
|
|
||||||
pAdmin = (AdminUser *)m_pMemory->GetAddress(aid);
|
|
||||||
if (!pAdmin || pAdmin->magic != USR_MAGIC_SET)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return pAdmin;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *AdminCache::GetMethodName(unsigned int index)
|
|
||||||
{
|
|
||||||
List<AuthMethod>::iterator iter;
|
|
||||||
for (iter=m_AuthMethods.begin();
|
|
||||||
iter!=m_AuthMethods.end();
|
|
||||||
iter++)
|
|
||||||
{
|
|
||||||
if (index-- == 0)
|
|
||||||
{
|
|
||||||
return (*iter).name.c_str();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *AdminCache::GetString(int idx)
|
|
||||||
{
|
|
||||||
return m_pStrings->GetString(idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t AdminCache::FillFlagString(FlagBits bits, char *buffer, size_t maxlen)
|
|
||||||
{
|
|
||||||
size_t pos;
|
|
||||||
unsigned int i, num_flags;
|
|
||||||
AdminFlag flags[AdminFlags_TOTAL];
|
|
||||||
|
|
||||||
num_flags = FlagBitsToArray(bits, flags, AdminFlags_TOTAL);
|
|
||||||
|
|
||||||
pos = 0;
|
|
||||||
for (i = 0; pos < maxlen && i < num_flags; i++)
|
|
||||||
{
|
|
||||||
if (FindFlagChar(flags[i], &buffer[pos]))
|
|
||||||
{
|
|
||||||
pos++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
buffer[pos] = '\0';
|
|
||||||
|
|
||||||
return pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
CON_COMMAND(sm_dump_admcache, "Dumps the admin cache for debugging")
|
|
||||||
{
|
|
||||||
FILE *fp;
|
|
||||||
char buffer[PLATFORM_MAX_PATH];
|
|
||||||
|
|
||||||
g_SourceMod.BuildPath(Path_SM, buffer, sizeof(buffer), "data/admin_cache_dump.txt");
|
|
||||||
|
|
||||||
if ((fp = fopen(buffer, "wt")) == NULL)
|
|
||||||
{
|
|
||||||
g_RootMenu.ConsolePrint("Could not open file for writing: %s", buffer);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_Admins.DumpCache(fp);
|
|
||||||
|
|
||||||
g_RootMenu.ConsolePrint("Admin cache dumped to: %s", buffer);
|
|
||||||
|
|
||||||
fclose(fp);
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-8
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod
|
* SourceMod
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -153,7 +153,6 @@ public: //IAdminSystem
|
|||||||
bool FindFlag(const char *str, AdminFlag *pFlag);
|
bool FindFlag(const char *str, AdminFlag *pFlag);
|
||||||
bool FindFlag(char c, AdminFlag *pAdmFlag);
|
bool FindFlag(char c, AdminFlag *pAdmFlag);
|
||||||
FlagBits ReadFlagString(const char *flags, const char **end);
|
FlagBits ReadFlagString(const char *flags, const char **end);
|
||||||
size_t FillFlagString(FlagBits bits, char *buffer, size_t maxlen);
|
|
||||||
unsigned int GetAdminSerialChange(AdminId id);
|
unsigned int GetAdminSerialChange(AdminId id);
|
||||||
bool CanAdminUseCommand(int client, const char *cmd);
|
bool CanAdminUseCommand(int client, const char *cmd);
|
||||||
const char *GetGroupName(GroupId gid);
|
const char *GetGroupName(GroupId gid);
|
||||||
@@ -165,13 +164,8 @@ public: //IAdminSystem
|
|||||||
const char *cmd,
|
const char *cmd,
|
||||||
FlagBits flags,
|
FlagBits flags,
|
||||||
bool override_only);
|
bool override_only);
|
||||||
bool FindFlagChar(AdminFlag flag, char *c);
|
|
||||||
public:
|
public:
|
||||||
bool IsValidAdmin(AdminId id);
|
bool IsValidAdmin(AdminId id);
|
||||||
void DumpCache(FILE *fp);
|
|
||||||
AdminGroup *GetGroup(GroupId gid);
|
|
||||||
AdminUser *GetUser(AdminId id);
|
|
||||||
const char *GetString(int idx);
|
|
||||||
private:
|
private:
|
||||||
void _UnsetCommandOverride(const char *cmd);
|
void _UnsetCommandOverride(const char *cmd);
|
||||||
void _UnsetCommandGroupOverride(const char *group);
|
void _UnsetCommandGroupOverride(const char *group);
|
||||||
@@ -180,7 +174,6 @@ private:
|
|||||||
void DumpCommandOverrideCache(OverrideType type);
|
void DumpCommandOverrideCache(OverrideType type);
|
||||||
Trie *GetMethodByIndex(unsigned int index);
|
Trie *GetMethodByIndex(unsigned int index);
|
||||||
bool GetMethodIndex(const char *name, unsigned int *_index);
|
bool GetMethodIndex(const char *name, unsigned int *_index);
|
||||||
const char *GetMethodName(unsigned int index);
|
|
||||||
void NameFlag(const char *str, AdminFlag flag);
|
void NameFlag(const char *str, AdminFlag flag);
|
||||||
public:
|
public:
|
||||||
BaseStringTable *m_pStrings;
|
BaseStringTable *m_pStrings;
|
||||||
|
|||||||
@@ -386,7 +386,6 @@ void ConCmdManager::InternalDispatch(const CCommand &command)
|
|||||||
|
|
||||||
pHook->pf->PushCell(client);
|
pHook->pf->PushCell(client);
|
||||||
pHook->pf->PushCell(args);
|
pHook->pf->PushCell(args);
|
||||||
|
|
||||||
if (pHook->pf->Execute(&tempres) == SP_ERROR_NONE)
|
if (pHook->pf->Execute(&tempres) == SP_ERROR_NONE)
|
||||||
{
|
{
|
||||||
if (tempres > result)
|
if (tempres > result)
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ ConVar sm_corecfgfile("sm_corecfgfile", "addons/sourcemod/configs/core.cfg", 0,
|
|||||||
|
|
||||||
IForward *g_pOnServerCfg = NULL;
|
IForward *g_pOnServerCfg = NULL;
|
||||||
IForward *g_pOnConfigsExecuted = NULL;
|
IForward *g_pOnConfigsExecuted = NULL;
|
||||||
IForward *g_pOnAutoConfigsBuffered = NULL;
|
|
||||||
CoreConfig g_CoreConfig;
|
CoreConfig g_CoreConfig;
|
||||||
bool g_bConfigsExecd = false;
|
bool g_bConfigsExecd = false;
|
||||||
|
|
||||||
@@ -58,7 +57,6 @@ void CoreConfig::OnSourceModAllInitialized()
|
|||||||
g_RootMenu.AddRootConsoleCommand("config", "Set core configuration options", this);
|
g_RootMenu.AddRootConsoleCommand("config", "Set core configuration options", this);
|
||||||
g_pOnServerCfg = g_Forwards.CreateForward("OnServerCfg", ET_Ignore, 0, NULL);
|
g_pOnServerCfg = g_Forwards.CreateForward("OnServerCfg", ET_Ignore, 0, NULL);
|
||||||
g_pOnConfigsExecuted = g_Forwards.CreateForward("OnConfigsExecuted", ET_Ignore, 0, NULL);
|
g_pOnConfigsExecuted = g_Forwards.CreateForward("OnConfigsExecuted", ET_Ignore, 0, NULL);
|
||||||
g_pOnAutoConfigsBuffered = g_Forwards.CreateForward("OnAutoConfigsBuffered", ET_Ignore, 0, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreConfig::OnSourceModShutdown()
|
void CoreConfig::OnSourceModShutdown()
|
||||||
@@ -66,7 +64,6 @@ void CoreConfig::OnSourceModShutdown()
|
|||||||
g_RootMenu.RemoveRootConsoleCommand("config", this);
|
g_RootMenu.RemoveRootConsoleCommand("config", this);
|
||||||
g_Forwards.ReleaseForward(g_pOnServerCfg);
|
g_Forwards.ReleaseForward(g_pOnServerCfg);
|
||||||
g_Forwards.ReleaseForward(g_pOnConfigsExecuted);
|
g_Forwards.ReleaseForward(g_pOnConfigsExecuted);
|
||||||
g_Forwards.ReleaseForward(g_pOnAutoConfigsBuffered);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreConfig::OnSourceModLevelChange(const char *mapName)
|
void CoreConfig::OnSourceModLevelChange(const char *mapName)
|
||||||
@@ -406,8 +403,6 @@ void SM_ExecuteAllConfigs()
|
|||||||
}
|
}
|
||||||
iter->Release();
|
iter->Release();
|
||||||
|
|
||||||
g_pOnAutoConfigsBuffered->Execute(NULL);
|
|
||||||
|
|
||||||
engine->ServerCommand("sm internal 1\n");
|
engine->ServerCommand("sm internal 1\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,7 +168,9 @@ public:
|
|||||||
}
|
}
|
||||||
else if (strcasecmp(me32.szModule, "steam.dll") == 0)
|
else if (strcasecmp(me32.szModule, "steam.dll") == 0)
|
||||||
{
|
{
|
||||||
|
/* Steam.dll is loaded by engine.dll, so we can exit the loop here */
|
||||||
steam = me32.modBaseAddr;
|
steam = me32.modBaseAddr;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} while (Module32Next(hModuleList, &me32));
|
} while (Module32Next(hModuleList, &me32));
|
||||||
|
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ void GameConfigManager::OnSourceModStartup(bool late)
|
|||||||
strncopy(g_GameDesc + 1, SERVER_CALL(GetGameDescription)(), sizeof(g_GameDesc) - 1);
|
strncopy(g_GameDesc + 1, SERVER_CALL(GetGameDescription)(), sizeof(g_GameDesc) - 1);
|
||||||
|
|
||||||
KeyValues *pGameInfo = new KeyValues("GameInfo");
|
KeyValues *pGameInfo = new KeyValues("GameInfo");
|
||||||
if (g_HL2.KVLoadFromFile(pGameInfo, basefilesystem, "gameinfo.txt"))
|
if (pGameInfo->LoadFromFile(basefilesystem, "gameinfo.txt"))
|
||||||
{
|
{
|
||||||
const char *str;
|
const char *str;
|
||||||
if ((str = pGameInfo->GetString("game", NULL)) != NULL)
|
if ((str = pGameInfo->GetString("game", NULL)) != NULL)
|
||||||
|
|||||||
+2
-41
@@ -114,6 +114,8 @@ void CHalfLife2::OnSourceModAllInitialized()
|
|||||||
m_HinTextMsg = g_UserMsgs.GetMessageIndex("HintText");
|
m_HinTextMsg = g_UserMsgs.GetMessageIndex("HintText");
|
||||||
m_VGUIMenu = g_UserMsgs.GetMessageIndex("VGUIMenu");
|
m_VGUIMenu = g_UserMsgs.GetMessageIndex("VGUIMenu");
|
||||||
g_ShareSys.AddInterface(NULL, this);
|
g_ShareSys.AddInterface(NULL, this);
|
||||||
|
|
||||||
|
FindInSendTable("CTFPlayer", "m_nDisguiseClass");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined METAMOD_PLAPI_VERSION
|
#if !defined METAMOD_PLAPI_VERSION
|
||||||
@@ -435,47 +437,6 @@ bool CHalfLife2::IsLANServer()
|
|||||||
return (sv_lan->GetInt() != 0);
|
return (sv_lan->GetInt() != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CHalfLife2::KVLoadFromFile(KeyValues *kv, IBaseFileSystem *filesystem, const char *resourceName, const char *pathID)
|
|
||||||
{
|
|
||||||
#if defined METAMOD_PLAPI_VERSION
|
|
||||||
if (g_SMAPI->GetSourceEngineBuild() == SOURCE_ENGINE_ORIGINAL)
|
|
||||||
#else
|
|
||||||
if (strcasecmp(g_SourceMod.GetGameFolderName(), "ship") == 0)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
Assert(filesystem);
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
Assert(_heapchk() == _HEAPOK);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
FileHandle_t f = filesystem->Open(resourceName, "rb", pathID);
|
|
||||||
if (!f)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// load file into a null-terminated buffer
|
|
||||||
int fileSize = filesystem->Size(f);
|
|
||||||
char *buffer = (char *)MemAllocScratch(fileSize + 1);
|
|
||||||
|
|
||||||
Assert(buffer);
|
|
||||||
|
|
||||||
filesystem->Read(buffer, fileSize, f); // read into local buffer
|
|
||||||
|
|
||||||
buffer[fileSize] = 0; // null terminate file as EOF
|
|
||||||
|
|
||||||
filesystem->Close( f ); // close file after reading
|
|
||||||
|
|
||||||
bool retOK = kv->LoadFromBuffer( resourceName, buffer, filesystem );
|
|
||||||
|
|
||||||
MemFreeScratch();
|
|
||||||
|
|
||||||
return retOK;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return kv->LoadFromFile(filesystem, resourceName, pathID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CHalfLife2::PushCommandStack(const CCommand *cmd)
|
void CHalfLife2::PushCommandStack(const CCommand *cmd)
|
||||||
{
|
{
|
||||||
CachedCommandInfo info;
|
CachedCommandInfo info;
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ public: //IGameHelpers
|
|||||||
bool HintTextMsg(int client, const char *msg);
|
bool HintTextMsg(int client, const char *msg);
|
||||||
bool ShowVGUIMenu(int client, const char *name, KeyValues *data, bool show);
|
bool ShowVGUIMenu(int client, const char *name, KeyValues *data, bool show);
|
||||||
bool IsLANServer();
|
bool IsLANServer();
|
||||||
bool KVLoadFromFile(KeyValues *kv, IBaseFileSystem *filesystem, const char *resourceName, const char *pathID = NULL);
|
|
||||||
public:
|
public:
|
||||||
void AddToFakeCliCmdQueue(int client, int userid, const char *cmd);
|
void AddToFakeCliCmdQueue(int client, int userid, const char *cmd);
|
||||||
void ProcessFakeCliCmdQueue();
|
void ProcessFakeCliCmdQueue();
|
||||||
|
|||||||
+58
-72
@@ -1,16 +1,21 @@
|
|||||||
# (C)2004-2008 SourceMod Development Team
|
#(C)2004-2008 Metamod:Source Development Team
|
||||||
# Makefile written by David "BAILOPAN" Anderson
|
# Makefile written by David "BAILOPAN" Anderson
|
||||||
|
|
||||||
SMSDK = ..
|
#Local paths
|
||||||
SRCDS_BASE = ~/srcds
|
|
||||||
HL2SDK_ORIG = ../../hl2sdk
|
HL2SDK_ORIG = ../../hl2sdk
|
||||||
HL2SDK_OB = ../../hl2sdk-ob
|
HL2SDK_OB = ../../hl2sdk-ob
|
||||||
SOURCEMM14 = ../../sourcemm-1.4
|
SOURCEMM14 = ../../sourcemm-1.4
|
||||||
SOURCEMM16 = ../../sourcemm-1.6
|
SOURCEMM16 = ../../sourcemm-1.6
|
||||||
|
SRCDS_BASE = ~/srcds
|
||||||
|
SMSDK = ..
|
||||||
|
|
||||||
|
#Project options
|
||||||
|
OPT_FLAGS = -O3 -funroll-loops -pipe -fno-strict-aliasing
|
||||||
|
GCC4_FLAGS = -fvisibility=hidden
|
||||||
|
GCC4_CPP_FLAGS = -fvisibility-inlines-hidden
|
||||||
|
DEBUG_FLAGS = -g -ggdb3
|
||||||
|
CPP = gcc-4.1
|
||||||
|
|
||||||
#####################################
|
|
||||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
|
||||||
#####################################
|
|
||||||
|
|
||||||
OBJECTS = AdminCache.cpp CDataPack.cpp ConCmdManager.cpp ConVarManager.cpp CoreConfig.cpp \
|
OBJECTS = AdminCache.cpp CDataPack.cpp ConCmdManager.cpp ConVarManager.cpp CoreConfig.cpp \
|
||||||
Database.cpp DebugReporter.cpp EventManager.cpp GameConfigs.cpp HalfLife2.cpp Logger.cpp \
|
Database.cpp DebugReporter.cpp EventManager.cpp GameConfigs.cpp HalfLife2.cpp Logger.cpp \
|
||||||
@@ -28,120 +33,101 @@ OBJECTS += smn_admin.cpp smn_bitbuffer.cpp smn_console.cpp smn_core.cpp \
|
|||||||
smn_adt_trie.cpp smn_hudtext.cpp
|
smn_adt_trie.cpp smn_hudtext.cpp
|
||||||
OBJECTS += systems/ExtensionSys.cpp systems/ForwardSys.cpp systems/HandleSys.cpp \
|
OBJECTS += systems/ExtensionSys.cpp systems/ForwardSys.cpp systems/HandleSys.cpp \
|
||||||
systems/LibrarySys.cpp systems/PluginInfoDatabase.cpp systems/PluginSys.cpp \
|
systems/LibrarySys.cpp systems/PluginInfoDatabase.cpp systems/PluginSys.cpp \
|
||||||
systems/ShareSys.cpp vm/sp_vm_basecontext.cpp vm/sp_vm_engine.cpp \
|
systems/ShareSys.cpp vm/sp_vm_basecontext.cpp vm/sp_vm_function.cpp
|
||||||
vm/sp_vm_function.cpp
|
|
||||||
OBJECTS += thread/ThreadWorker.cpp thread/BaseWorker.cpp thread/PosixThreads.cpp ThreadSupport.cpp
|
OBJECTS += thread/ThreadWorker.cpp thread/BaseWorker.cpp thread/PosixThreads.cpp ThreadSupport.cpp
|
||||||
OBJECTS += zlib/adler32.c zlib/compress.c zlib/crc32.c zlib/deflate.c zlib/gzio.c \
|
OBJECTS_C = zlib/adler32.c zlib/compress.c zlib/crc32.c zlib/deflate.c zlib/gzio.c \
|
||||||
zlib/infback.c zlib/inffast.c zlib/inflate.c zlib/inftrees.c zlib/trees.c \
|
zlib/infback.c zlib/inffast.c zlib/inflate.c zlib/inftrees.c zlib/trees.c \
|
||||||
zlib/uncompr.c zlib/zutil.c
|
zlib/uncompr.c zlib/zutil.c
|
||||||
|
OBJECTS_SM16 = vm/sp_vm_engine.cpp
|
||||||
|
|
||||||
##############################################
|
|
||||||
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
|
|
||||||
##############################################
|
|
||||||
|
|
||||||
C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
|
|
||||||
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
|
|
||||||
C_GCC4_FLAGS = -fvisibility=hidden
|
|
||||||
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
|
|
||||||
CPP = gcc-4.1
|
|
||||||
|
|
||||||
override ENGSET = false
|
|
||||||
ifeq "$(ENGINE)" "original"
|
ifeq "$(ENGINE)" "original"
|
||||||
HL2SDK = $(HL2SDK_ORIG)
|
HL2SDK = $(HL2SDK_ORIG)
|
||||||
HL2PUB = $(HL2SDK_ORIG)/public
|
HL2PUB = $(HL2SDK_ORIG)/public
|
||||||
HL2LIB = $(HL2SDK_ORIG)/linux_sdk
|
HL2LIB = $(HL2SDK)/linux_sdk
|
||||||
METAMOD = $(SOURCEMM14)
|
METAMOD = $(SOURCEMM14)
|
||||||
INCLUDE += -I$(HL2SDK)/public/dlls
|
INCLUDE += -I$(HL2PUB)/dlls
|
||||||
SRCDS = $(SRCDS_BASE)
|
SRCDS = $(SRCDS_BASE)
|
||||||
BINARY = sourcemod.1.ep1.so
|
BINARY = sourcemod.1.ep1.so
|
||||||
override ENGSET = true
|
|
||||||
endif
|
endif
|
||||||
ifeq "$(ENGINE)" "orangebox"
|
ifeq "$(ENGINE)" "orangebox"
|
||||||
HL2SDK = $(HL2SDK_OB)
|
HL2SDK = $(HL2SDK_OB)
|
||||||
HL2PUB = $(HL2SDK_OB)/public
|
HL2PUB = $(HL2SDK_OB)/public
|
||||||
HL2LIB = $(HL2SDK_OB)/linux_sdk
|
HL2LIB = $(HL2SDK)/linux_sdk
|
||||||
CFLAGS += -DORANGEBOX_BUILD
|
CFLAGS += -DORANGEBOX_BUILD
|
||||||
METAMOD = $(SOURCEMM16)
|
METAMOD = $(SOURCEMM16)
|
||||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
INCLUDE += -I$(HL2PUB)/game/server
|
||||||
SRCDS = $(SRCDS_BASE)/orangebox
|
SRCDS = $(SRCDS_BASE)/orangebox
|
||||||
BINARY = sourcemod.2.ep2.so
|
BINARY = sourcemod.2.ep2.so
|
||||||
override ENGSET = true
|
endif
|
||||||
|
ifeq "$(BINARY)" ""
|
||||||
|
echo "You must supply ENGINE=orangebox or ENGINE=original"
|
||||||
|
false
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LINK += $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_i486.so \
|
LINK += $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_i486.so \
|
||||||
tier0_i486.so -lpthread -static-libgcc
|
tier0_i486.so -lpthread -static-libgcc
|
||||||
|
|
||||||
INCLUDE_SMSDK = -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
|
INCLUDE_SMSDK = -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn -I$(SMSDK)/public/extensions
|
||||||
|
|
||||||
INCLUDE_SM16 = -I. -I.. -I$(SOURCEMM16)/sourcehook $(INCLUDE_SMSDK)
|
INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/dlls -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
||||||
|
-I$(HL2PUB)/vstdlib -I$(HL2SDK)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook -I$(METAMOD)/sourcemm \
|
||||||
|
-I$(HL2PUB)/mathlib -Isystems $(INCLUDE_SMSDK)
|
||||||
|
|
||||||
INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/vstdlib \
|
SM16_INCLUDE = -I. -I.. -I$(SOURCEMM16)/sourcehook $(INCLUDE_SMSDK)
|
||||||
-I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook \
|
|
||||||
-I$(METAMOD)/sourcemm -Isystems $(INCLUDE_SMSDK)
|
|
||||||
|
|
||||||
CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
|
|
||||||
-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror \
|
|
||||||
-Wno-uninitialized -mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -DSM_DEFAULT_THREADER -m32
|
|
||||||
CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
|
|
||||||
|
|
||||||
################################################
|
|
||||||
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
|
|
||||||
################################################
|
|
||||||
|
|
||||||
ifeq "$(DEBUG)" "true"
|
ifeq "$(DEBUG)" "true"
|
||||||
BIN_DIR = Debug.$(ENGINE)
|
BIN_DIR = Debug.$(ENGINE)
|
||||||
CFLAGS += $(C_DEBUG_FLAGS)
|
CFLAGS += $(DEBUG_FLAGS)
|
||||||
else
|
else
|
||||||
BIN_DIR = Release.$(ENGINE)
|
BIN_DIR = Release.$(ENGINE)
|
||||||
CFLAGS += $(C_OPT_FLAGS)
|
CFLAGS += $(OPT_FLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
||||||
|
|
||||||
|
CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp \
|
||||||
|
-Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca \
|
||||||
|
-Dstrcmpi=strcasecmp -Wall -Wno-uninitialized -Werror -mfpmath=sse -msse \
|
||||||
|
-DSOURCEMOD_BUILD -DSM_DEFAULT_THREADER -m32
|
||||||
|
CPPFLAGS = -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
|
||||||
|
|
||||||
ifeq "$(GCC_VERSION)" "4"
|
ifeq "$(GCC_VERSION)" "4"
|
||||||
CFLAGS += $(C_GCC4_FLAGS)
|
CFLAGS += $(GCC4_FLAGS)
|
||||||
CPPFLAGS += $(CPP_GCC4_FLAGS)
|
CPPFLAGS += $(GCC4_CPP_FLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OBJ_LINUX := $(OBJECTS:%vm_engine.cpp=$(BIN_DIR)/%vm_engine.o)
|
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.ox)
|
||||||
OBJ_LINUX := $(OBJ_LINUX:%.cpp=$(BIN_DIR)/%.o)
|
OBJ_LINUX_C := $(OBJECTS_C:%.c=$(BIN_DIR)/%.oc)
|
||||||
OBJ_LINUX := $(OBJ_LINUX:%.c=$(BIN_DIR)/%.o)
|
OBJ_LINUX_SM16 := $(OBJECTS_SM16:%.cpp=$(BIN_DIR)/%.ok)
|
||||||
|
|
||||||
$(BIN_DIR)/%vm_engine.o: %vm_engine.cpp
|
$(BIN_DIR)/%.ox: %.cpp
|
||||||
$(CPP) $(INCLUDE_SM16) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
|
||||||
|
|
||||||
$(BIN_DIR)/%.o: %.cpp
|
|
||||||
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
$(BIN_DIR)/%.o: %.c
|
$(BIN_DIR)/%.oc: %.c
|
||||||
$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
|
$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
all: check
|
$(BIN_DIR)/%.ok: %.cpp
|
||||||
|
$(CPP) $(SM16_INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
|
all:
|
||||||
mkdir -p $(BIN_DIR)/systems
|
mkdir -p $(BIN_DIR)/systems
|
||||||
mkdir -p $(BIN_DIR)/vm
|
mkdir -p $(BIN_DIR)/vm
|
||||||
mkdir -p $(BIN_DIR)/zlib
|
mkdir -p $(BIN_DIR)/zlib
|
||||||
mkdir -p $(BIN_DIR)/thread
|
mkdir -p $(BIN_DIR)/thread
|
||||||
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so;
|
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so
|
||||||
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so;
|
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so
|
||||||
$(MAKE) -f Makefile sourcemod
|
$(MAKE) -f Makefile sourcemod
|
||||||
|
|
||||||
check:
|
sourcemod: $(OBJ_LINUX) $(OBJ_LINUX_C) $(OBJ_LINUX_SM16)
|
||||||
if [ "$(ENGSET)" == "false" ]; then \
|
$(CPP) $(OBJ_LINUX) $(OBJ_LINUX_C) $(OBJ_LINUX_SM16) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
||||||
echo "You must supply ENGINE=orangebox or ENGINE=original"; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
sourcemod: check $(OBJ_LINUX)
|
|
||||||
$(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
|
||||||
|
|
||||||
debug:
|
|
||||||
$(MAKE) -f Makefile all DEBUG=true
|
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
clean: check
|
clean:
|
||||||
rm -rf $(BIN_DIR)/*.o
|
rm -rf $(BIN_DIR)/*.ox
|
||||||
rm -rf $(BIN_DIR)/systems/*.o
|
rm -rf $(BIN_DIR)/systems/*.ox
|
||||||
rm -rf $(BIN_DIR)/zlib/*.o
|
rm -rf $(BIN_DIR)/zlib/*.oc
|
||||||
rm -rf $(BIN_DIR)/vm/*.o
|
rm -rf $(BIN_DIR)/vm/*.ox
|
||||||
rm -rf $(BIN_DIR)/thread/*.o
|
rm -rf $(BIN_DIR)/thread/*.ox
|
||||||
rm -rf $(BIN_DIR)/$(BINARY)
|
rm -rf $(BIN_DIR)/$(BINARY)
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod
|
* SourceMod
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -134,7 +134,6 @@ void PlayerManager::OnSourceModAllInitialized()
|
|||||||
PreAdminCheck = g_Forwards.CreateForward("OnClientPreAdminCheck", ET_Event, 1, p1);
|
PreAdminCheck = g_Forwards.CreateForward("OnClientPreAdminCheck", ET_Event, 1, p1);
|
||||||
PostAdminCheck = g_Forwards.CreateForward("OnClientPostAdminCheck", ET_Ignore, 1, p1);
|
PostAdminCheck = g_Forwards.CreateForward("OnClientPostAdminCheck", ET_Ignore, 1, p1);
|
||||||
PostAdminFilter = g_Forwards.CreateForward("OnClientPostAdminFilter", ET_Ignore, 1, p1);
|
PostAdminFilter = g_Forwards.CreateForward("OnClientPostAdminFilter", ET_Ignore, 1, p1);
|
||||||
|
|
||||||
m_bIsListenServer = !engine->IsDedicatedServer();
|
m_bIsListenServer = !engine->IsDedicatedServer();
|
||||||
m_ListenClient = 0;
|
m_ListenClient = 0;
|
||||||
}
|
}
|
||||||
@@ -579,7 +578,6 @@ void PlayerManager::OnClientDisconnect(edict_t *pEntity)
|
|||||||
|
|
||||||
m_Players[client].Disconnect();
|
m_Players[client].Disconnect();
|
||||||
m_UserIdLookUp[engine->GetPlayerUserId(pEntity)] = 0;
|
m_UserIdLookUp[engine->GetPlayerUserId(pEntity)] = 0;
|
||||||
|
|
||||||
if (m_ListenClient == client)
|
if (m_ListenClient == client)
|
||||||
{
|
{
|
||||||
m_ListenClient = 0;
|
m_ListenClient = 0;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod
|
* SourceMod
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalOptions="/MP"
|
AdditionalOptions="/MP"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(SOURCEMM14)";"$(SOURCEMM14)\sourcemm";"$(SOURCEMM14)\sourcehook""
|
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(HL2SDK)\tier1";"$(SOURCEMM14)";"$(SOURCEMM14)\sourcemm";"$(SOURCEMM14)\sourcehook""
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib" dbghelp.lib"
|
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib" dbghelp.lib"
|
||||||
OutputFile="$(OutDir)\sourcemod.1.ep1.dll"
|
OutputFile="$(OutDir)\sourcemod.1.ep1.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
IgnoreDefaultLibraryNames="LIBCMT"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalOptions="/MP"
|
AdditionalOptions="/MP"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(SOURCEMM14)";"$(SOURCEMM14)\sourcemm";"$(SOURCEMM14)\sourcehook""
|
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(HL2SDK)\tier1";"$(SOURCEMM14)";"$(SOURCEMM14)\sourcemm";"$(SOURCEMM14)\sourcehook""
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
||||||
OutputFile="$(OutDir)\sourcemod.1.ep1.dll"
|
OutputFile="$(OutDir)\sourcemod.1.ep1.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
IgnoreDefaultLibraryNames="LIBCMT"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
@@ -206,7 +206,7 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalOptions="/MP"
|
AdditionalOptions="/MP"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(SOURCEMM14)";"$(SOURCEMM14)\sourcemm";"$(SOURCEMM14)\sourcehook""
|
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(HL2SDK)\tier1";"$(SOURCEMM14)";"$(SOURCEMM14)\sourcemm";"$(SOURCEMM14)\sourcehook""
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
EnableEnhancedInstructionSet="0"
|
EnableEnhancedInstructionSet="0"
|
||||||
@@ -230,7 +230,6 @@
|
|||||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
||||||
OutputFile="$(OutDir)\sourcemod.1.ep1.dll"
|
OutputFile="$(OutDir)\sourcemod.1.ep1.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
|
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
@@ -288,7 +287,7 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalOptions="/MP"
|
AdditionalOptions="/MP"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDKOB)\public";"$(HL2SDKOB)\public\engine";"$(HL2SDKOB)\public\game\server";"$(HL2SDKOB)\public\mathlib";"$(HL2SDKOB)\public\tier0";"$(HL2SDKOB)\public\tier1";"$(HL2SDKOB)\public\vstdlib";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDKOB)\public";"$(HL2SDKOB)\public\engine";"$(HL2SDKOB)\public\game\server";"$(HL2SDKOB)\public\mathlib";"$(HL2SDKOB)\public\tier0";"$(HL2SDKOB)\public\tier1";"$(HL2SDKOB)\public\vstdlib";"$(HL2SDKOB)\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER;ORANGEBOX_BUILD"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER;ORANGEBOX_BUILD"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
@@ -314,7 +313,7 @@
|
|||||||
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib" "$(HL2SDKOB)\lib\public\vstdlib.lib" "$(HL2SDKOB)\lib\public\mathlib.lib" dbghelp.lib"
|
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib" "$(HL2SDKOB)\lib\public\vstdlib.lib" "$(HL2SDKOB)\lib\public\mathlib.lib" dbghelp.lib"
|
||||||
OutputFile="$(OutDir)\sourcemod.2.ep2.dll"
|
OutputFile="$(OutDir)\sourcemod.2.ep2.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
IgnoreDefaultLibraryNames="LIBCMT"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
@@ -370,7 +369,7 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalOptions="/MP"
|
AdditionalOptions="/MP"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDKOB)\public";"$(HL2SDKOB)\public\engine";"$(HL2SDKOB)\public\game\server";"$(HL2SDKOB)\public\mathlib";"$(HL2SDKOB)\public\tier0";"$(HL2SDKOB)\public\tier1";"$(HL2SDKOB)\public\vstdlib";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDKOB)\public";"$(HL2SDKOB)\public\engine";"$(HL2SDKOB)\public\game\server";"$(HL2SDKOB)\public\mathlib";"$(HL2SDKOB)\public\tier0";"$(HL2SDKOB)\public\tier1";"$(HL2SDKOB)\public\vstdlib";"$(HL2SDKOB)\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER;ORANGEBOX_BUILD"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER;ORANGEBOX_BUILD"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
@@ -396,7 +395,7 @@
|
|||||||
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib" "$(HL2SDKOB)\lib\public\vstdlib.lib" "$(HL2SDKOB)\lib\public\mathlib.lib""
|
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib" "$(HL2SDKOB)\lib\public\vstdlib.lib" "$(HL2SDKOB)\lib\public\mathlib.lib""
|
||||||
OutputFile="$(OutDir)\sourcemod.2.ep2.dll"
|
OutputFile="$(OutDir)\sourcemod.2.ep2.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
IgnoreDefaultLibraryNames="LIBCMT"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
@@ -453,8 +452,8 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalOptions="/MP"
|
AdditionalOptions="/MP"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDKOB)\public";"$(HL2SDKOB)\public\engine";"$(HL2SDKOB)\public\game\server";"$(HL2SDKOB)\public\mathlib";"$(HL2SDKOB)\public\tier0";"$(HL2SDKOB)\public\tier1";"$(HL2SDKOB)\public\vstdlib";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDKOB)\public";"$(HL2SDKOB)\public\engine";"$(HL2SDKOB)\public\game\server";"$(HL2SDKOB)\public\mathlib";"$(HL2SDKOB)\public\tier0";"$(HL2SDKOB)\public\tier1";"$(HL2SDKOB)\public\vstdlib";"$(HL2SDKOB)\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER;ORANGEBOX_BUILD;ENABLE_CRAZYDEBUGGING"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER;ORANGEBOX_BUILD"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
EnableEnhancedInstructionSet="0"
|
EnableEnhancedInstructionSet="0"
|
||||||
RuntimeTypeInfo="false"
|
RuntimeTypeInfo="false"
|
||||||
@@ -477,7 +476,6 @@
|
|||||||
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib" "$(HL2SDKOB)\lib\public\vstdlib.lib" "$(HL2SDKOB)\lib\public\mathlib.lib""
|
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib" "$(HL2SDKOB)\lib\public\vstdlib.lib" "$(HL2SDKOB)\lib\public\mathlib.lib""
|
||||||
OutputFile="$(OutDir)\sourcemod.2.ep2.dll"
|
OutputFile="$(OutDir)\sourcemod.2.ep2.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
|
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
@@ -535,7 +533,7 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalOptions="/MP"
|
AdditionalOptions="/MP"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(HL2SDK)\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
@@ -561,7 +559,7 @@
|
|||||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib" dbghelp.lib"
|
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib" dbghelp.lib"
|
||||||
OutputFile="$(OutDir)\sourcemod.2.ep1.dll"
|
OutputFile="$(OutDir)\sourcemod.2.ep1.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
IgnoreDefaultLibraryNames="LIBCMT"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
@@ -617,7 +615,7 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalOptions="/MP"
|
AdditionalOptions="/MP"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(HL2SDK)\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
@@ -643,7 +641,7 @@
|
|||||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
||||||
OutputFile="$(OutDir)\sourcemod.2.ep1.dll"
|
OutputFile="$(OutDir)\sourcemod.2.ep1.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
IgnoreDefaultLibraryNames="LIBCMT"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
@@ -700,7 +698,7 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalOptions="/MP"
|
AdditionalOptions="/MP"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
AdditionalIncludeDirectories="..\;..\systems;..\..\public;..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(HL2SDK)\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SOURCEMOD_MM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;SOURCEMOD_BUILD;SM_DEFAULT_THREADER"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
EnableEnhancedInstructionSet="0"
|
EnableEnhancedInstructionSet="0"
|
||||||
@@ -724,7 +722,6 @@
|
|||||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
||||||
OutputFile="$(OutDir)\sourcemod.2.ep1.dll"
|
OutputFile="$(OutDir)\sourcemod.2.ep1.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
|
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
@@ -1368,6 +1365,30 @@
|
|||||||
AdditionalIncludeDirectories=""$(SOURCEMM16)\sourcehook""
|
AdditionalIncludeDirectories=""$(SOURCEMM16)\sourcehook""
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="CrazyDebug - Episode 1|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug - Episode 1|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release - Episode 1|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
Name="CrazyDebug|Win32"
|
Name="CrazyDebug|Win32"
|
||||||
>
|
>
|
||||||
|
|||||||
+1
-68
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod
|
* SourceMod
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -357,57 +357,6 @@ void AddFloat(char **buf_p, size_t &maxlen, double fval, int width, int prec, in
|
|||||||
*buf_p = buf;
|
*buf_p = buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddBinary(char **buf_p, size_t &maxlen, unsigned int val, int width, int flags)
|
|
||||||
{
|
|
||||||
char text[32];
|
|
||||||
int digits;
|
|
||||||
char *buf;
|
|
||||||
|
|
||||||
digits = 0;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (val & 1)
|
|
||||||
{
|
|
||||||
text[digits++] = '1';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
text[digits++] = '0';
|
|
||||||
}
|
|
||||||
val >>= 1;
|
|
||||||
} while (val);
|
|
||||||
|
|
||||||
buf = *buf_p;
|
|
||||||
|
|
||||||
if (!(flags & LADJUST))
|
|
||||||
{
|
|
||||||
while (digits < width && maxlen)
|
|
||||||
{
|
|
||||||
*buf++ = (flags & ZEROPAD) ? '0' : ' ';
|
|
||||||
width--;
|
|
||||||
maxlen--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (digits-- && maxlen)
|
|
||||||
{
|
|
||||||
*buf++ = text[digits];
|
|
||||||
width--;
|
|
||||||
maxlen--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flags & LADJUST)
|
|
||||||
{
|
|
||||||
while (width-- && maxlen)
|
|
||||||
{
|
|
||||||
*buf++ = (flags & ZEROPAD) ? '0' : ' ';
|
|
||||||
maxlen--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*buf_p = buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AddUInt(char **buf_p, size_t &maxlen, unsigned int val, int width, int flags)
|
void AddUInt(char **buf_p, size_t &maxlen, unsigned int val, int width, int flags)
|
||||||
{
|
{
|
||||||
char text[32];
|
char text[32];
|
||||||
@@ -674,13 +623,6 @@ reswitch:
|
|||||||
arg++;
|
arg++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'b':
|
|
||||||
{
|
|
||||||
int *value = (int *)args[arg];
|
|
||||||
AddBinary(&buf_p, llen, *value, width, flags);
|
|
||||||
arg++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'd':
|
case 'd':
|
||||||
case 'i':
|
case 'i':
|
||||||
{
|
{
|
||||||
@@ -867,15 +809,6 @@ reswitch:
|
|||||||
arg++;
|
arg++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'b':
|
|
||||||
{
|
|
||||||
CHECK_ARGS(0);
|
|
||||||
cell_t *value;
|
|
||||||
pCtx->LocalToPhysAddr(params[arg], &value);
|
|
||||||
AddBinary(&buf_p, llen, *value, width, flags);
|
|
||||||
arg++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'd':
|
case 'd':
|
||||||
case 'i':
|
case 'i':
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-30
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod
|
* SourceMod
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -90,32 +90,3 @@ size_t sm_trie_mem_usage(Trie *trie)
|
|||||||
{
|
{
|
||||||
return trie->k.mem_usage();
|
return trie->k.mem_usage();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct trie_iter_data
|
|
||||||
{
|
|
||||||
SM_TRIE_BAD_ITERATOR iter;
|
|
||||||
void *ptr;
|
|
||||||
Trie *pTrie;
|
|
||||||
};
|
|
||||||
|
|
||||||
void our_trie_iterator(KTrie<void *> *pTrie, const char *name, void *& obj, void *data)
|
|
||||||
{
|
|
||||||
trie_iter_data *our_iter;
|
|
||||||
|
|
||||||
our_iter = (trie_iter_data *)data;
|
|
||||||
our_iter->iter(our_iter->pTrie, name, &obj, our_iter->ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void sm_trie_bad_iterator(Trie *trie,
|
|
||||||
char *buffer,
|
|
||||||
size_t maxlength,
|
|
||||||
SM_TRIE_BAD_ITERATOR iter,
|
|
||||||
void *data)
|
|
||||||
{
|
|
||||||
trie_iter_data our_iter;
|
|
||||||
|
|
||||||
our_iter.iter = iter;
|
|
||||||
our_iter.ptr = data;
|
|
||||||
our_iter.pTrie = trie;
|
|
||||||
trie->k.bad_iterator(buffer, maxlength, &our_iter, our_trie_iterator);
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-8
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod
|
* SourceMod
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -34,8 +34,6 @@
|
|||||||
|
|
||||||
struct Trie;
|
struct Trie;
|
||||||
|
|
||||||
typedef void (*SM_TRIE_BAD_ITERATOR)(Trie *pTrie, const char *key, void **value, void *data);
|
|
||||||
|
|
||||||
Trie *sm_trie_create();
|
Trie *sm_trie_create();
|
||||||
void sm_trie_destroy(Trie *trie);
|
void sm_trie_destroy(Trie *trie);
|
||||||
bool sm_trie_insert(Trie *trie, const char *key, void *value);
|
bool sm_trie_insert(Trie *trie, const char *key, void *value);
|
||||||
@@ -44,10 +42,5 @@ bool sm_trie_retrieve(Trie *trie, const char *key, void **value);
|
|||||||
bool sm_trie_delete(Trie *trie, const char *key);
|
bool sm_trie_delete(Trie *trie, const char *key);
|
||||||
void sm_trie_clear(Trie *trie);
|
void sm_trie_clear(Trie *trie);
|
||||||
size_t sm_trie_mem_usage(Trie *trie);
|
size_t sm_trie_mem_usage(Trie *trie);
|
||||||
void sm_trie_bad_iterator(Trie *trie,
|
|
||||||
char *buffer,
|
|
||||||
size_t maxlength,
|
|
||||||
SM_TRIE_BAD_ITERATOR iter,
|
|
||||||
void *data);
|
|
||||||
|
|
||||||
#endif //_INCLUDE_SOURCEMOD_SIMPLE_TRIE_H_
|
#endif //_INCLUDE_SOURCEMOD_SIMPLE_TRIE_H_
|
||||||
|
|||||||
+3
-3
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod
|
* SourceMod
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
* @file Contains SourceMod version information.
|
* @file Contains SourceMod version information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define SVN_FULL_VERSION "1.0.2.2236"
|
#define SVN_FULL_VERSION "1.0.1.2166"
|
||||||
#define SVN_FILE_VERSION 1,0,2,2236
|
#define SVN_FILE_VERSION 1,0,1,2166
|
||||||
|
|
||||||
#endif //_INCLUDE_SOURCEMOD_VERSION_H_
|
#endif //_INCLUDE_SOURCEMOD_VERSION_H_
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod
|
* SourceMod
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
#include "sourcemm_api.h"
|
#include "sourcemm_api.h"
|
||||||
#include "sm_stringutil.h"
|
#include "sm_stringutil.h"
|
||||||
#include "HandleSys.h"
|
#include "HandleSys.h"
|
||||||
#include "HalfLife2.h"
|
|
||||||
#include <KeyValues.h>
|
#include <KeyValues.h>
|
||||||
#include "utlbuffer.h"
|
#include "utlbuffer.h"
|
||||||
|
|
||||||
@@ -783,7 +782,6 @@ static cell_t smn_FileToKeyValues(IPluginContext *pCtx, const cell_t *params)
|
|||||||
HandleSecurity sec;
|
HandleSecurity sec;
|
||||||
char *path;
|
char *path;
|
||||||
KeyValueStack *pStk;
|
KeyValueStack *pStk;
|
||||||
KeyValues *kv;
|
|
||||||
|
|
||||||
sec.pOwner = NULL;
|
sec.pOwner = NULL;
|
||||||
sec.pIdentity = g_pCoreIdent;
|
sec.pIdentity = g_pCoreIdent;
|
||||||
@@ -799,8 +797,7 @@ static cell_t smn_FileToKeyValues(IPluginContext *pCtx, const cell_t *params)
|
|||||||
char realpath[PLATFORM_MAX_PATH];
|
char realpath[PLATFORM_MAX_PATH];
|
||||||
g_SourceMod.BuildPath(Path_Game, realpath, sizeof(realpath), "%s", path);
|
g_SourceMod.BuildPath(Path_Game, realpath, sizeof(realpath), "%s", path);
|
||||||
|
|
||||||
kv = pStk->pCurRoot.front();
|
return pStk->pCurRoot.front()->LoadFromFile(basefilesystem, realpath);
|
||||||
return g_HL2.KVLoadFromFile(kv, basefilesystem, realpath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell_t smn_KvSetEscapeSequences(IPluginContext *pCtx, const cell_t *params)
|
static cell_t smn_KvSetEscapeSequences(IPluginContext *pCtx, const cell_t *params)
|
||||||
|
|||||||
+2
-33
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod
|
* SourceMod
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -460,12 +460,8 @@ static cell_t ReplaceString(IPluginContext *pContext, const cell_t *params)
|
|||||||
pContext->LocalToString(params[4], &replace);
|
pContext->LocalToString(params[4], &replace);
|
||||||
maxlength = (size_t)params[2];
|
maxlength = (size_t)params[2];
|
||||||
|
|
||||||
if (search[0] == '\0')
|
|
||||||
{
|
|
||||||
return pContext->ThrowNativeError("Cannot replace searches of empty strings");
|
|
||||||
}
|
|
||||||
|
|
||||||
return UTIL_ReplaceAll(text, maxlength, search, replace);
|
return UTIL_ReplaceAll(text, maxlength, search, replace);
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell_t ReplaceStringEx(IPluginContext *pContext, const cell_t *params)
|
static cell_t ReplaceStringEx(IPluginContext *pContext, const cell_t *params)
|
||||||
@@ -481,11 +477,6 @@ static cell_t ReplaceStringEx(IPluginContext *pContext, const cell_t *params)
|
|||||||
size_t searchLen = (params[5] == -1) ? strlen(search) : (size_t)params[5];
|
size_t searchLen = (params[5] == -1) ? strlen(search) : (size_t)params[5];
|
||||||
size_t replaceLen = (params[6] == -1) ? strlen(replace) : (size_t)params[6];
|
size_t replaceLen = (params[6] == -1) ? strlen(replace) : (size_t)params[6];
|
||||||
|
|
||||||
if (searchLen == 0)
|
|
||||||
{
|
|
||||||
return pContext->ThrowNativeError("Cannot replace searches of empty strings");
|
|
||||||
}
|
|
||||||
|
|
||||||
char *ptr = UTIL_ReplaceEx(text, maxlength, search, searchLen, replace, replaceLen);
|
char *ptr = UTIL_ReplaceEx(text, maxlength, search, searchLen, replace, replaceLen);
|
||||||
|
|
||||||
if (ptr == NULL)
|
if (ptr == NULL)
|
||||||
@@ -569,27 +560,6 @@ static cell_t SplitString(IPluginContext *pContext, const cell_t *params)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell_t StripQuotes(IPluginContext *pContext, const cell_t *params)
|
|
||||||
{
|
|
||||||
char *text;
|
|
||||||
size_t length;
|
|
||||||
|
|
||||||
pContext->LocalToString(params[1], &text);
|
|
||||||
length = strlen(text);
|
|
||||||
|
|
||||||
if (text[0] == '"' && text[length-1] == '"')
|
|
||||||
{
|
|
||||||
/* Null-terminate */
|
|
||||||
text[--length] = '\0';
|
|
||||||
/* Move the remaining bytes (including null terminator) down by one */
|
|
||||||
memmove(&text[0], &text[1], length);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
REGISTER_NATIVES(basicStrings)
|
REGISTER_NATIVES(basicStrings)
|
||||||
{
|
{
|
||||||
{"BreakString", BreakString},
|
{"BreakString", BreakString},
|
||||||
@@ -616,7 +586,6 @@ REGISTER_NATIVES(basicStrings)
|
|||||||
{"StringToIntEx", StringToIntEx},
|
{"StringToIntEx", StringToIntEx},
|
||||||
{"StringToFloat", sm_strtofloat},
|
{"StringToFloat", sm_strtofloat},
|
||||||
{"StringToFloatEx", StringToFloatEx},
|
{"StringToFloatEx", StringToFloatEx},
|
||||||
{"StripQuotes", StripQuotes},
|
|
||||||
{"TrimString", TrimString},
|
{"TrimString", TrimString},
|
||||||
{"VFormat", sm_vformat},
|
{"VFormat", sm_vformat},
|
||||||
{NULL, NULL},
|
{NULL, NULL},
|
||||||
|
|||||||
+1
-8
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod
|
* SourceMod
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -325,11 +325,6 @@ static cell_t smn_IsServerProcessing(IPluginContext *pContext, const cell_t *par
|
|||||||
return (gpGlobals->frametime > 0.0f) ? 1 : 0;
|
return (gpGlobals->frametime > 0.0f) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell_t smn_GetTickInterval(IPluginContext *pContext, const cell_t *params)
|
|
||||||
{
|
|
||||||
return sp_ftoc(gpGlobals->interval_per_tick);
|
|
||||||
}
|
|
||||||
|
|
||||||
REGISTER_NATIVES(timernatives)
|
REGISTER_NATIVES(timernatives)
|
||||||
{
|
{
|
||||||
{"CreateTimer", smn_CreateTimer},
|
{"CreateTimer", smn_CreateTimer},
|
||||||
@@ -340,7 +335,5 @@ REGISTER_NATIVES(timernatives)
|
|||||||
{"GetMapTimeLimit", smn_GetMapTimeLimit},
|
{"GetMapTimeLimit", smn_GetMapTimeLimit},
|
||||||
{"ExtendMapTimeLimit", smn_ExtendMapTimeLimit},
|
{"ExtendMapTimeLimit", smn_ExtendMapTimeLimit},
|
||||||
{"IsServerProcessing", smn_IsServerProcessing},
|
{"IsServerProcessing", smn_IsServerProcessing},
|
||||||
{"GetTickInterval", smn_GetTickInterval},
|
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+18
-31
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod
|
* SourceMod
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -286,23 +286,11 @@ void LibrarySystem::GetPlatformError(char *error, size_t maxlength)
|
|||||||
maxlength,
|
maxlength,
|
||||||
NULL);
|
NULL);
|
||||||
#elif defined PLATFORM_POSIX
|
#elif defined PLATFORM_POSIX
|
||||||
UTIL_Format(error, maxlength, "%s", strerror(errno));
|
snprintf(error, maxlength, "%s", strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LibrarySystem::GetLoaderError(char *buffer, size_t maxlength)
|
|
||||||
{
|
|
||||||
#if defined PLATFORM_WINDOWS
|
|
||||||
GetPlatformError(buffer, maxlength);
|
|
||||||
#elif defined PLATFORM_POSIX
|
|
||||||
if (buffer != NULL && maxlength)
|
|
||||||
{
|
|
||||||
strncopy(buffer, dlerror(), maxlength);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void LibrarySystem::CloseDirectory(IDirectory *dir)
|
void LibrarySystem::CloseDirectory(IDirectory *dir)
|
||||||
{
|
{
|
||||||
delete dir;
|
delete dir;
|
||||||
@@ -313,15 +301,19 @@ ILibrary *LibrarySystem::OpenLibrary(const char *path, char *error, size_t maxle
|
|||||||
LibraryHandle lib;
|
LibraryHandle lib;
|
||||||
#if defined PLATFORM_WINDOWS
|
#if defined PLATFORM_WINDOWS
|
||||||
lib = LoadLibraryA(path);
|
lib = LoadLibraryA(path);
|
||||||
|
if (!lib)
|
||||||
|
{
|
||||||
|
GetPlatformError(error, maxlength);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
#elif defined PLATFORM_POSIX
|
#elif defined PLATFORM_POSIX
|
||||||
lib = dlopen(path, RTLD_NOW);
|
lib = dlopen(path, RTLD_NOW);
|
||||||
#endif
|
if (!lib)
|
||||||
|
|
||||||
if (lib == NULL)
|
|
||||||
{
|
{
|
||||||
GetLoaderError(error, maxlength);
|
GetPlatformError(error, maxlength);
|
||||||
return NULL;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return new CLibrary(lib);
|
return new CLibrary(lib);
|
||||||
}
|
}
|
||||||
@@ -352,26 +344,21 @@ size_t LibrarySystem::PathFormat(char *buffer, size_t len, const char *fmt, ...)
|
|||||||
|
|
||||||
const char *LibrarySystem::GetFileExtension(const char *filename)
|
const char *LibrarySystem::GetFileExtension(const char *filename)
|
||||||
{
|
{
|
||||||
size_t len, end;
|
size_t end = strlen(filename) - 1;
|
||||||
|
|
||||||
len = strlen(filename);
|
for (size_t i = end; i >= 0; i--)
|
||||||
|
|
||||||
/* Minimum string length for filename with ext would be 3; example: a.a */
|
|
||||||
if (len < 3)
|
|
||||||
{
|
{
|
||||||
return NULL;
|
if (i > end)
|
||||||
}
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
end = len - 1;
|
|
||||||
|
|
||||||
for (size_t i = end; i <= end; i--)
|
|
||||||
{
|
|
||||||
if (filename[i] == PLATFORM_SEP_CHAR || filename[i] == PLATFORM_SEP_ALTCHAR)
|
if (filename[i] == PLATFORM_SEP_CHAR || filename[i] == PLATFORM_SEP_ALTCHAR)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filename[i] == '.' && i != end && i != 0)
|
if (filename[i] == '.' && i != end)
|
||||||
{
|
{
|
||||||
return &filename[++i];
|
return &filename[++i];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ public:
|
|||||||
bool CreateFolder(const char *path);
|
bool CreateFolder(const char *path);
|
||||||
size_t GetFileFromPath(char *buffer, size_t maxlength, const char *path);
|
size_t GetFileFromPath(char *buffer, size_t maxlength, const char *path);
|
||||||
bool FileTime(const char *path, FileTimeType type, time_t *pTime);
|
bool FileTime(const char *path, FileTimeType type, time_t *pTime);
|
||||||
void GetLoaderError(char *buffer, size_t maxlength);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern LibrarySystem g_LibSys;
|
extern LibrarySystem g_LibSys;
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,7 @@ BEGIN
|
|||||||
VALUE "FileDescription", "SourceMod Core"
|
VALUE "FileDescription", "SourceMod Core"
|
||||||
VALUE "FileVersion", SVN_FULL_VERSION
|
VALUE "FileVersion", SVN_FULL_VERSION
|
||||||
VALUE "InternalName", "sourcemod"
|
VALUE "InternalName", "sourcemod"
|
||||||
VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC"
|
VALUE "LegalCopyright", "Copyright (c) 2004-2007, AlliedModders LLC"
|
||||||
VALUE "OriginalFilename", "sourcemod_mm.dll"
|
VALUE "OriginalFilename", "sourcemod_mm.dll"
|
||||||
VALUE "ProductName", "SourceMod"
|
VALUE "ProductName", "SourceMod"
|
||||||
VALUE "ProductVersion", SVN_FULL_VERSION
|
VALUE "ProductVersion", SVN_FULL_VERSION
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ cellsof chars sizeof tagof
|
|||||||
|
|
||||||
# Predefined constants
|
# Predefined constants
|
||||||
false true cellbits cellmax cellmin charbits charmax charmin myinfo INVALID_HANDLE
|
false true cellbits cellmax cellmin charbits charmax charmin myinfo INVALID_HANDLE
|
||||||
__version NULL_VECTOR NULL_STRING
|
__version
|
||||||
|
|
||||||
# Predefined tag names
|
# Predefined tag names
|
||||||
bool Float Handle String
|
bool Float Handle String
|
||||||
|
|||||||
Binary file not shown.
@@ -1,12 +1,9 @@
|
|||||||
# (C)2004-2008 SourceMod Development Team
|
#(C)2004-2006 SourceMM Development Team
|
||||||
# Makefile written by David "BAILOPAN" Anderson
|
# Makefile written by David "BAILOPAN" Anderson
|
||||||
|
|
||||||
SMSDK = ../..
|
SMSDK = ../..
|
||||||
SRCDS_BASE = ~/srcds
|
SRCDS = ~/srcds
|
||||||
HL2SDK_ORIG = ../../../hl2sdk
|
SOURCEMM = ../../../sourcemm
|
||||||
HL2SDK_OB = ../../../hl2sdk-ob
|
|
||||||
SOURCEMM14 = ../../../sourcemm-1.4
|
|
||||||
SOURCEMM16 = ../../../sourcemm-1.6
|
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
### EDIT BELOW FOR OTHER PROJECTS ###
|
||||||
@@ -14,8 +11,8 @@ SOURCEMM16 = ../../../sourcemm-1.6
|
|||||||
|
|
||||||
PROJECT = bintools
|
PROJECT = bintools
|
||||||
|
|
||||||
#Uncomment for Metamod: Source enabled extension
|
#Uncomment for SourceMM-enabled extensions
|
||||||
#USEMETA = true
|
#LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so
|
||||||
|
|
||||||
OBJECTS = sdk/smsdk_ext.cpp extension.cpp jit_call.cpp CallWrapper.cpp CallMaker.cpp
|
OBJECTS = sdk/smsdk_ext.cpp extension.cpp jit_call.cpp CallWrapper.cpp CallMaker.cpp
|
||||||
|
|
||||||
@@ -23,52 +20,28 @@ OBJECTS = sdk/smsdk_ext.cpp extension.cpp jit_call.cpp CallWrapper.cpp CallMaker
|
|||||||
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
|
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
|
||||||
##############################################
|
##############################################
|
||||||
|
|
||||||
C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
|
C_OPT_FLAGS = -O3 -funroll-loops -pipe -fno-strict-aliasing
|
||||||
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
|
C_DEBUG_FLAGS = -g -ggdb3
|
||||||
C_GCC4_FLAGS = -fvisibility=hidden
|
CPP_GCC4_FLAGS = -fvisibility=hidden -fvisibility-inlines-hidden
|
||||||
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
|
|
||||||
CPP = gcc-4.1
|
CPP = gcc-4.1
|
||||||
|
|
||||||
override ENGSET = false
|
HL2PUB = $(HL2SDK)/public
|
||||||
ifeq "$(ENGINE)" "original"
|
HL2LIB = $(HL2SDK)/linux_sdk
|
||||||
HL2SDK = $(HL2SDK_ORIG)
|
HL2SDK = $(SOURCEMM)/hl2sdk
|
||||||
HL2PUB = $(HL2SDK_ORIG)/public
|
SMM_TRUNK = $(SOURCEMM)/trunk
|
||||||
HL2LIB = $(HL2SDK_ORIG)/linux_sdk
|
|
||||||
METAMOD = $(SOURCEMM14)
|
|
||||||
INCLUDE += -I$(HL2SDK)/public/dlls
|
|
||||||
SRCDS = $(SRCDS_BASE)
|
|
||||||
override ENGSET = true
|
|
||||||
endif
|
|
||||||
ifeq "$(ENGINE)" "orangebox"
|
|
||||||
HL2SDK = $(HL2SDK_OB)
|
|
||||||
HL2PUB = $(HL2SDK_OB)/public
|
|
||||||
HL2LIB = $(HL2SDK_OB)/linux_sdk
|
|
||||||
CFLAGS += -DORANGEBOX_BUILD
|
|
||||||
METAMOD = $(SOURCEMM16)
|
|
||||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
|
||||||
SRCDS = $(SRCDS_BASE)/orangebox
|
|
||||||
override ENGSET = true
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq "$(USEMETA)" "true"
|
LINK = $(LINK_HL2) -static-libgcc
|
||||||
LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so
|
|
||||||
|
|
||||||
LINK += $(LINK_HL2)
|
INCLUDE = -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/dlls -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
||||||
|
-I$(HL2PUB)/vstdlib -I$(HL2SDK)/tier1 -I$(SMM_TRUNK) -I$(SMM_TRUNK)/sourcehook -I$(SMM_TRUNK)/sourcemm \
|
||||||
|
-I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn -I$(SMSDK)/public/extensions -I$(SMSDK)/public/jit \
|
||||||
|
-I$(SMSDK)/public/jit/x86
|
||||||
|
|
||||||
INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
CFLAGS = -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp \
|
||||||
-I$(METAMOD) -I$(METAMOD)/sourcehook -I$(METAMOD)/sourcemm -I$(SMSDK)/public \
|
-Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca \
|
||||||
-I$(SMSDK)/public/sourcepawn
|
-Dstrcmpi=strcasecmp -Wall -Werror -mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H \
|
||||||
else
|
-m32
|
||||||
INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/extensions -I$(SMSDK)/public/jit \
|
CPPFLAGS = -Wno-non-virtual-dtor -fno-exceptions -fno-rtti -m32
|
||||||
-I$(SMSDK)/public/jit/x86 -I$(SMSDK)/public/sourcepawn
|
|
||||||
endif
|
|
||||||
|
|
||||||
LINK += -static-libgcc
|
|
||||||
|
|
||||||
CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
|
|
||||||
-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror -mfpmath=sse \
|
|
||||||
-msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -m32
|
|
||||||
CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
|
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
|
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
|
||||||
@@ -82,13 +55,9 @@ else
|
|||||||
CFLAGS += $(C_OPT_FLAGS)
|
CFLAGS += $(C_OPT_FLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(USEMETA)" "true"
|
|
||||||
BIN_DIR := $(BIN_DIR).$(ENGINE)
|
|
||||||
endif
|
|
||||||
|
|
||||||
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
||||||
ifeq "$(GCC_VERSION)" "4"
|
ifeq "$(GCC_VERSION)" "4"
|
||||||
CFLAGS += $(C_GCC4_FLAGS)
|
|
||||||
CPPFLAGS += $(CPP_GCC4_FLAGS)
|
CPPFLAGS += $(CPP_GCC4_FLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -99,29 +68,24 @@ OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
|||||||
$(BIN_DIR)/%.o: %.cpp
|
$(BIN_DIR)/%.o: %.cpp
|
||||||
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
all: check
|
all:
|
||||||
mkdir -p $(BIN_DIR)/sdk
|
mkdir -p $(BIN_DIR)/sdk
|
||||||
if [ "$(USEMETA)" == "true" ]; then \
|
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so
|
||||||
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so; \
|
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so
|
||||||
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \
|
$(MAKE) extension
|
||||||
fi
|
|
||||||
$(MAKE) -f Makefile extension
|
|
||||||
|
|
||||||
check:
|
extension: $(OBJ_LINUX)
|
||||||
if [ "$(USEMETA)" == "true" ] && [ "$(ENGSET)" == "false" ]; then \
|
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
||||||
echo "You must supply ENGINE=orangebox or ENGINE=original"; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
extension: check $(OBJ_LINUX)
|
|
||||||
$(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
$(MAKE) -f Makefile all DEBUG=true
|
$(MAKE) all DEBUG=true
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
clean: check
|
clean:
|
||||||
rm -rf $(BIN_DIR)/*.o
|
rm -rf Release/*.o
|
||||||
rm -rf $(BIN_DIR)/sdk/*.o
|
rm -rf Release/sdk/*.o
|
||||||
rm -rf $(BIN_DIR)/$(BINARY)
|
rm -rf Release/$(BINARY)
|
||||||
|
rm -rf Debug/*.o
|
||||||
|
rm -rf Debug/sdk/*.o
|
||||||
|
rm -rf Debug/$(BINARY)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="8.00"
|
Version="8,00"
|
||||||
Name="bintools"
|
Name="bintools"
|
||||||
ProjectGUID="{E38F65D9-74B2-4373-B46A-DBB76F579F98}"
|
ProjectGUID="{E38F65D9-74B2-4373-B46A-DBB76F579F98}"
|
||||||
RootNamespace="bintools"
|
RootNamespace="bintools"
|
||||||
@@ -65,7 +65,6 @@
|
|||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
OutputFile="$(OutDir)\bintools.ext.dll"
|
OutputFile="$(OutDir)\bintools.ext.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
@@ -144,7 +143,6 @@
|
|||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
OutputFile="$(OutDir)\bintools.ext.dll"
|
OutputFile="$(OutDir)\bintools.ext.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
|
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod BinTools Extension
|
* SourceMod BinTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod Base Extension Code
|
* SourceMod Base Extension Code
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod Base Extension Code
|
* SourceMod Base Extension Code
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod BinTools Extension
|
* SourceMod BinTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
#ifndef _INCLUDE_BINTOOLS_VERSION_H_
|
#ifndef _INCLUDE_BINTOOLS_VERSION_H_
|
||||||
#define _INCLUDE_BINTOOLS_VERSION_H_
|
#define _INCLUDE_BINTOOLS_VERSION_H_
|
||||||
|
|
||||||
#define SVN_FULL_VERSION "1.0.2.2236"
|
#define SVN_FULL_VERSION "1.0.1.2166"
|
||||||
#define SVN_FILE_VERSION 1,0,2,2236
|
#define SVN_FILE_VERSION 1,0,1,2166
|
||||||
|
|
||||||
#endif //_INCLUDE_BINTOOLS_VERSION_H_
|
#endif //_INCLUDE_BINTOOLS_VERSION_H_
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod BinTools Extension
|
* SourceMod BinTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
#ifndef _INCLUDE_BINTOOLS_VERSION_H_
|
#ifndef _INCLUDE_BINTOOLS_VERSION_H_
|
||||||
#define _INCLUDE_BINTOOLS_VERSION_H_
|
#define _INCLUDE_BINTOOLS_VERSION_H_
|
||||||
|
|
||||||
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
|
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$LOCAL_BUILD$"
|
||||||
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
|
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$LOCAL_BUILD$
|
||||||
|
|
||||||
#endif //_INCLUDE_BINTOOLS_VERSION_H_
|
#endif //_INCLUDE_BINTOOLS_VERSION_H_
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ BEGIN
|
|||||||
VALUE "FileDescription", "SourceMod BinTools Extension"
|
VALUE "FileDescription", "SourceMod BinTools Extension"
|
||||||
VALUE "FileVersion", SVN_FULL_VERSION
|
VALUE "FileVersion", SVN_FULL_VERSION
|
||||||
VALUE "InternalName", "SourceMod BinTools Extension"
|
VALUE "InternalName", "SourceMod BinTools Extension"
|
||||||
VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC"
|
VALUE "LegalCopyright", "Copyright (c) 2004-2007, AlliedModders LLC"
|
||||||
VALUE "OriginalFilename", "bintools.ext.dll"
|
VALUE "OriginalFilename", "bintools.ext.dll"
|
||||||
VALUE "ProductName", "SourceMod BinTools Extension"
|
VALUE "ProductName", "SourceMod BinTools Extension"
|
||||||
VALUE "ProductVersion", SVN_FULL_VERSION
|
VALUE "ProductVersion", SVN_FULL_VERSION
|
||||||
|
|||||||
+27
-49
@@ -1,12 +1,12 @@
|
|||||||
# (C)2004-2008 SourceMod Development Team
|
#(C)2004-2008 Metamod:Source Development Team
|
||||||
# Makefile written by David "BAILOPAN" Anderson
|
# Makefile written by David "BAILOPAN" Anderson
|
||||||
|
|
||||||
SMSDK = ../..
|
|
||||||
SRCDS_BASE = ~/srcds
|
|
||||||
HL2SDK_ORIG = ../../../hl2sdk
|
HL2SDK_ORIG = ../../../hl2sdk
|
||||||
HL2SDK_OB = ../../../hl2sdk-ob
|
HL2SDK_OB = ../../../hl2sdk-ob
|
||||||
SOURCEMM14 = ../../../sourcemm-1.4
|
SOURCEMM14 = ../../../sourcemm-1.4
|
||||||
SOURCEMM16 = ../../../sourcemm-1.6
|
SOURCEMM16 = ../../../sourcemm-1.6
|
||||||
|
SRCDS_BASE = ~/srcds
|
||||||
|
SMSDK = ../..
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
### EDIT BELOW FOR OTHER PROJECTS ###
|
||||||
@@ -14,22 +14,17 @@ SOURCEMM16 = ../../../sourcemm-1.6
|
|||||||
|
|
||||||
PROJECT = game.cstrike
|
PROJECT = game.cstrike
|
||||||
|
|
||||||
#Uncomment for Metamod: Source enabled extension
|
|
||||||
USEMETA = true
|
|
||||||
|
|
||||||
OBJECTS = sdk/smsdk_ext.cpp extension.cpp natives.cpp RegNatives.cpp timeleft.cpp
|
OBJECTS = sdk/smsdk_ext.cpp extension.cpp natives.cpp RegNatives.cpp timeleft.cpp
|
||||||
|
|
||||||
##############################################
|
##############################################
|
||||||
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
|
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
|
||||||
##############################################
|
##############################################
|
||||||
|
|
||||||
C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
|
C_OPT_FLAGS = -O3 -funroll-loops -pipe -fno-strict-aliasing
|
||||||
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
|
C_DEBUG_FLAGS = -g -ggdb3
|
||||||
C_GCC4_FLAGS = -fvisibility=hidden
|
CPP_GCC4_FLAGS = -fvisibility=hidden -fvisibility-inlines-hidden
|
||||||
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
|
|
||||||
CPP = gcc-4.1
|
CPP = gcc-4.1
|
||||||
|
|
||||||
override ENGSET = false
|
|
||||||
ifeq "$(ENGINE)" "original"
|
ifeq "$(ENGINE)" "original"
|
||||||
HL2SDK = $(HL2SDK_ORIG)
|
HL2SDK = $(HL2SDK_ORIG)
|
||||||
HL2PUB = $(HL2SDK_ORIG)/public
|
HL2PUB = $(HL2SDK_ORIG)/public
|
||||||
@@ -37,7 +32,6 @@ ifeq "$(ENGINE)" "original"
|
|||||||
METAMOD = $(SOURCEMM14)
|
METAMOD = $(SOURCEMM14)
|
||||||
INCLUDE += -I$(HL2SDK)/public/dlls
|
INCLUDE += -I$(HL2SDK)/public/dlls
|
||||||
SRCDS = $(SRCDS_BASE)
|
SRCDS = $(SRCDS_BASE)
|
||||||
override ENGSET = true
|
|
||||||
endif
|
endif
|
||||||
ifeq "$(ENGINE)" "orangebox"
|
ifeq "$(ENGINE)" "orangebox"
|
||||||
HL2SDK = $(HL2SDK_OB)
|
HL2SDK = $(HL2SDK_OB)
|
||||||
@@ -47,26 +41,23 @@ ifeq "$(ENGINE)" "orangebox"
|
|||||||
METAMOD = $(SOURCEMM16)
|
METAMOD = $(SOURCEMM16)
|
||||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
INCLUDE += -I$(HL2SDK)/public/game/server
|
||||||
SRCDS = $(SRCDS_BASE)/orangebox
|
SRCDS = $(SRCDS_BASE)/orangebox
|
||||||
override ENGSET = true
|
endif
|
||||||
|
ifeq "$(ENGINE)" ""
|
||||||
|
echo "You must supply ENGINE=orangebox or ENGINE=original"
|
||||||
|
false
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(USEMETA)" "true"
|
LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so
|
||||||
LINK_HL2 = $(HL2LIB)/tier1_i486.a tier0_i486.so
|
|
||||||
|
|
||||||
LINK += $(LINK_HL2)
|
LINK += $(LINK_HL2) -static-libgcc
|
||||||
|
|
||||||
INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
||||||
-I$(METAMOD) -I$(METAMOD)/sourcehook -I$(METAMOD)/sourcemm -I$(SMSDK)/public \
|
-I$(HL2PUB)/vstdlib -I$(HL2SDK)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook -I$(METAMOD)/sourcemm \
|
||||||
-I$(SMSDK)/public/extensions -I$(SMSDK)/public/sourcepawn
|
-I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn -I$(SMSDK)/public/extensions
|
||||||
else
|
|
||||||
INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
|
|
||||||
endif
|
|
||||||
|
|
||||||
LINK += -static-libgcc
|
CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp \
|
||||||
|
-Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp \
|
||||||
CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
|
-Wall -Werror -mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -m32
|
||||||
-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror -mfpmath=sse \
|
|
||||||
-msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -m32
|
|
||||||
CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
|
CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
@@ -74,20 +65,16 @@ CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
|
|||||||
################################################
|
################################################
|
||||||
|
|
||||||
ifeq "$(DEBUG)" "true"
|
ifeq "$(DEBUG)" "true"
|
||||||
BIN_DIR = Debug
|
BIN_DIR = Debug.$(ENGINE)
|
||||||
CFLAGS += $(C_DEBUG_FLAGS)
|
CFLAGS += $(C_DEBUG_FLAGS)
|
||||||
else
|
else
|
||||||
BIN_DIR = Release
|
BIN_DIR = Release.$(ENGINE)
|
||||||
CFLAGS += $(C_OPT_FLAGS)
|
CFLAGS += $(C_OPT_FLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(USEMETA)" "true"
|
|
||||||
BIN_DIR := $(BIN_DIR).$(ENGINE)
|
|
||||||
endif
|
|
||||||
|
|
||||||
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
||||||
ifeq "$(GCC_VERSION)" "4"
|
ifeq "$(GCC_VERSION)" "4"
|
||||||
CFLAGS += $(C_GCC4_FLAGS)
|
|
||||||
CPPFLAGS += $(CPP_GCC4_FLAGS)
|
CPPFLAGS += $(CPP_GCC4_FLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -98,28 +85,19 @@ OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
|||||||
$(BIN_DIR)/%.o: %.cpp
|
$(BIN_DIR)/%.o: %.cpp
|
||||||
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
all: check
|
all:
|
||||||
mkdir -p $(BIN_DIR)/sdk
|
mkdir -p $(BIN_DIR)/sdk
|
||||||
if [ "$(USEMETA)" == "true" ]; then \
|
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so
|
||||||
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \
|
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so
|
||||||
fi
|
|
||||||
$(MAKE) -f Makefile extension
|
$(MAKE) -f Makefile extension
|
||||||
|
|
||||||
check:
|
extension: $(OBJ_LINUX)
|
||||||
if [ "$(USEMETA)" == "true" ] && [ "$(ENGSET)" == "false" ]; then \
|
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
||||||
echo "You must supply ENGINE=orangebox or ENGINE=original"; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
extension: check $(OBJ_LINUX)
|
|
||||||
$(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
|
||||||
|
|
||||||
debug:
|
|
||||||
$(MAKE) -f Makefile all DEBUG=true
|
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
clean: check
|
clean:
|
||||||
rm -rf $(BIN_DIR)/*.o
|
rm -rf $(BIN_DIR)/*.o
|
||||||
rm -rf $(BIN_DIR)/sdk/*.o
|
rm -rf $(BIN_DIR)/sdk/*.o
|
||||||
rm -rf $(BIN_DIR)/$(BINARY)
|
rm -rf $(BIN_DIR)/$(BINARY)
|
||||||
|
|
||||||
|
|||||||
@@ -54,12 +54,6 @@ extern sp_nativeinfo_t g_CSNatives[];
|
|||||||
|
|
||||||
bool CStrike::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
bool CStrike::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
||||||
{
|
{
|
||||||
if (strcmp(g_pSM->GetGameFolderName(), "cstrike") != 0)
|
|
||||||
{
|
|
||||||
snprintf(error, maxlength, "Cannot Load Cstrike Extension on mods other than CS:S");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
sharesys->AddDependency(myself, "bintools.ext", true, true);
|
sharesys->AddDependency(myself, "bintools.ext", true, true);
|
||||||
|
|
||||||
char conf_error[255];
|
char conf_error[255];
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
</ToolFiles>
|
</ToolFiles>
|
||||||
<Configurations>
|
<Configurations>
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="Debug - Old Metamod|Win32"
|
Name="Debug|Win32"
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
IntermediateDirectory="$(ConfigurationName)"
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
ConfigurationType="2"
|
ConfigurationType="2"
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(SOURCEMM14)";"$(SOURCEMM14)\sourcemm";"$(SOURCEMM14)\sourcehook""
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
@@ -63,10 +63,9 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib""
|
AdditionalDependencies="tier0.lib"
|
||||||
OutputFile="$(OutDir)\game.cstrike.ext.dll"
|
OutputFile="$(OutDir)\game.cstrike.ext.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
@@ -97,7 +96,7 @@
|
|||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="Release - Old Metamod|Win32"
|
Name="Release|Win32"
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
IntermediateDirectory="$(ConfigurationName)"
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
ConfigurationType="2"
|
ConfigurationType="2"
|
||||||
@@ -122,7 +121,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(SOURCEMM14)";"$(SOURCEMM14)\sourcemm";"$(SOURCEMM14)\sourcehook""
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
EnableEnhancedInstructionSet="1"
|
EnableEnhancedInstructionSet="1"
|
||||||
@@ -143,173 +142,8 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib""
|
|
||||||
OutputFile="$(OutDir)\game.cstrike.ext.dll"
|
OutputFile="$(OutDir)\game.cstrike.ext.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
|
|
||||||
GenerateDebugInformation="true"
|
|
||||||
SubSystem="2"
|
|
||||||
OptimizeReferences="2"
|
|
||||||
EnableCOMDATFolding="2"
|
|
||||||
TargetMachine="1"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCALinkTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManifestTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXDCMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCBscMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCFxCopTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCAppVerifierTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebDeploymentTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPostBuildEventTool"
|
|
||||||
/>
|
|
||||||
</Configuration>
|
|
||||||
<Configuration
|
|
||||||
Name="Debug - Orange Box|Win32"
|
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
|
||||||
IntermediateDirectory="$(ConfigurationName)"
|
|
||||||
ConfigurationType="2"
|
|
||||||
CharacterSet="2"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreBuildEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCustomBuildTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXMLDataGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCMIDLTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="0"
|
|
||||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;"$(HL2SDKOB)\public";"$(HL2SDKOB)\public\engine";"$(HL2SDKOB)\public\game\server";"$(HL2SDKOB)\public\tier0";"$(HL2SDKOB)\public\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
|
||||||
MinimalRebuild="true"
|
|
||||||
BasicRuntimeChecks="3"
|
|
||||||
RuntimeLibrary="1"
|
|
||||||
EnableEnhancedInstructionSet="1"
|
|
||||||
RuntimeTypeInfo="false"
|
|
||||||
UsePrecompiledHeader="0"
|
|
||||||
WarningLevel="3"
|
|
||||||
Detect64BitPortabilityProblems="false"
|
|
||||||
DebugInformationFormat="4"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManagedResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreLinkEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCLinkerTool"
|
|
||||||
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib""
|
|
||||||
OutputFile="$(OutDir)\game.cstrike.ext.dll"
|
|
||||||
LinkIncremental="2"
|
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
|
||||||
GenerateDebugInformation="true"
|
|
||||||
SubSystem="2"
|
|
||||||
TargetMachine="1"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCALinkTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManifestTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXDCMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCBscMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCFxCopTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCAppVerifierTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebDeploymentTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPostBuildEventTool"
|
|
||||||
/>
|
|
||||||
</Configuration>
|
|
||||||
<Configuration
|
|
||||||
Name="Release - Orange Box|Win32"
|
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
|
||||||
IntermediateDirectory="$(ConfigurationName)"
|
|
||||||
ConfigurationType="2"
|
|
||||||
CharacterSet="2"
|
|
||||||
WholeProgramOptimization="1"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreBuildEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCustomBuildTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXMLDataGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCMIDLTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
FavorSizeOrSpeed="1"
|
|
||||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;"$(HL2SDKOB)\public";"$(HL2SDKOB)\public\engine";"$(HL2SDKOB)\public\game\server";"$(HL2SDKOB)\public\tier0";"$(HL2SDKOB)\public\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
|
||||||
RuntimeLibrary="0"
|
|
||||||
EnableEnhancedInstructionSet="1"
|
|
||||||
RuntimeTypeInfo="false"
|
|
||||||
UsePrecompiledHeader="0"
|
|
||||||
WarningLevel="3"
|
|
||||||
Detect64BitPortabilityProblems="false"
|
|
||||||
DebugInformationFormat="3"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManagedResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreLinkEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCLinkerTool"
|
|
||||||
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib""
|
|
||||||
OutputFile="$(OutDir)\game.cstrike.ext.dll"
|
|
||||||
LinkIncremental="1"
|
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
|
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
@@ -366,7 +200,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;$(HL2SDK)\public;$(HL2SDK)\public\dlls;$(HL2SDK)\public\engine;$(HL2SDK)\public\tier0;$(HL2SDK)\public\tier1;$(HL2SDK)\public\vstdlib;$(HL2SDK)\tier1;$(SOURCEMM16);$(SOURCEMM16)\sourcemm;$(SOURCEMM16)\sourcehook"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
@@ -389,10 +223,9 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib""
|
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
||||||
OutputFile="$(OutDir)\game.cstrike.ext.dll"
|
OutputFile="$(OutDir)\game.cstrike.ext.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
@@ -422,6 +255,328 @@
|
|||||||
Name="VCPostBuildEventTool"
|
Name="VCPostBuildEventTool"
|
||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug - Orange Box|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="2"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;$(HL2SDKOB)\public;$(HL2SDKOB)\public\dlls;$(HL2SDKOB)\public\engine;$(HL2SDKOB)\public\tier0;$(HL2SDKOB)\public\tier1;$(HL2SDKOB)\public\vstdlib;$(HL2SDKOB)\tier1;$(SOURCEMM16);$(SOURCEMM16)\sourcemm;$(SOURCEMM16)\sourcehook"
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="1"
|
||||||
|
EnableEnhancedInstructionSet="1"
|
||||||
|
RuntimeTypeInfo="false"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="false"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib" "$(HL2SDKOB)\lib\public\vstdlib.lib" "$(HL2SDKOB)\lib\public\mathlib.lib""
|
||||||
|
OutputFile="$(OutDir)\game.cstrike.ext.dll"
|
||||||
|
LinkIncremental="2"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
SubSystem="2"
|
||||||
|
TargetMachine="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug - Old Metamod|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="2"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;$(HL2SDK)\public;$(HL2SDK)\public\dlls;$(HL2SDK)\public\engine;$(HL2SDK)\public\tier0;$(HL2SDK)\public\tier1;$(HL2SDK)\public\vstdlib;$(HL2SDK)\tier1;$(SOURCEMM14);$(SOURCEMM14)\sourcemm;$(SOURCEMM14)\sourcehook"
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="1"
|
||||||
|
EnableEnhancedInstructionSet="1"
|
||||||
|
RuntimeTypeInfo="false"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="false"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
||||||
|
OutputFile="$(OutDir)\game.cstrike.ext.dll"
|
||||||
|
LinkIncremental="2"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
SubSystem="2"
|
||||||
|
TargetMachine="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Release - Old Metamod|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="2"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
FavorSizeOrSpeed="1"
|
||||||
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;$(HL2SDK)\public;$(HL2SDK)\public\dlls;$(HL2SDK)\public\engine;$(HL2SDK)\public\tier0;$(HL2SDK)\public\tier1;$(HL2SDK)\public\vstdlib;$(HL2SDK)\tier1;$(SOURCEMM14);$(SOURCEMM14)\sourcemm;$(SOURCEMM14)\sourcehook"
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||||
|
RuntimeLibrary="0"
|
||||||
|
EnableEnhancedInstructionSet="1"
|
||||||
|
RuntimeTypeInfo="false"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="false"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
||||||
|
OutputFile="$(OutDir)\game.cstrike.ext.dll"
|
||||||
|
LinkIncremental="1"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
SubSystem="2"
|
||||||
|
OptimizeReferences="2"
|
||||||
|
EnableCOMDATFolding="2"
|
||||||
|
TargetMachine="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Release - Orange Box|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="2"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
FavorSizeOrSpeed="1"
|
||||||
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;$(HL2SDKOB)\public;$(HL2SDKOB)\public\dlls;$(HL2SDKOB)\public\engine;$(HL2SDKOB)\public\tier0;$(HL2SDKOB)\public\tier1;$(HL2SDKOB)\public\vstdlib;$(HL2SDKOB)\tier1;$(SOURCEMM16);$(SOURCEMM16)\sourcemm;$(SOURCEMM16)\sourcehook"
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||||
|
RuntimeLibrary="0"
|
||||||
|
EnableEnhancedInstructionSet="1"
|
||||||
|
RuntimeTypeInfo="false"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="false"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib" "$(HL2SDKOB)\lib\public\vstdlib.lib" "$(HL2SDKOB)\lib\public\mathlib.lib""
|
||||||
|
OutputFile="$(OutDir)\game.cstrike.ext.dll"
|
||||||
|
LinkIncremental="1"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
SubSystem="2"
|
||||||
|
OptimizeReferences="2"
|
||||||
|
EnableCOMDATFolding="2"
|
||||||
|
TargetMachine="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="Release - Episode 1|Win32"
|
Name="Release - Episode 1|Win32"
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
@@ -448,7 +603,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;$(HL2SDK)\public;$(HL2SDK)\public\dlls;$(HL2SDK)\public\engine;$(HL2SDK)\public\tier0;$(HL2SDK)\public\tier1;$(HL2SDK)\public\vstdlib;$(HL2SDK)\tier1;$(SOURCEMM16);$(SOURCEMM16)\sourcemm;$(SOURCEMM16)\sourcehook"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
EnableEnhancedInstructionSet="1"
|
EnableEnhancedInstructionSet="1"
|
||||||
@@ -469,10 +624,9 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib""
|
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
||||||
OutputFile="$(OutDir)\game.cstrike.ext.dll"
|
OutputFile="$(OutDir)\game.cstrike.ext.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
|
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod Counter-Strike:Source Extension
|
* SourceMod Counter-Strike:Source Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod Base Extension Code
|
* SourceMod Base Extension Code
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod Base Extension Code
|
* SourceMod Base Extension Code
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod Counter-Strike:Source Extension
|
* SourceMod SDKTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
|
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
|
||||||
#define _INCLUDE_SDKTOOLS_VERSION_H_
|
#define _INCLUDE_SDKTOOLS_VERSION_H_
|
||||||
|
|
||||||
#define SVN_FULL_VERSION "1.0.2.2236"
|
#define SVN_FULL_VERSION "1.0.1.2166"
|
||||||
#define SVN_FILE_VERSION 1,0,2,2236
|
#define SVN_FILE_VERSION 1,0,1,2166
|
||||||
|
|
||||||
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
|
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod Counter-Strike:Source Extension
|
* SourceMod SDKTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
|
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
|
||||||
#define _INCLUDE_SDKTOOLS_VERSION_H_
|
#define _INCLUDE_SDKTOOLS_VERSION_H_
|
||||||
|
|
||||||
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
|
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$LOCAL_BUILD$"
|
||||||
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
|
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$LOCAL_BUILD$
|
||||||
|
|
||||||
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
|
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ BEGIN
|
|||||||
VALUE "FileDescription", "SourceMod CS:S Extension"
|
VALUE "FileDescription", "SourceMod CS:S Extension"
|
||||||
VALUE "FileVersion", SVN_FULL_VERSION
|
VALUE "FileVersion", SVN_FULL_VERSION
|
||||||
VALUE "InternalName", "SourceMod CS:S Extension"
|
VALUE "InternalName", "SourceMod CS:S Extension"
|
||||||
VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC"
|
VALUE "LegalCopyright", "Copyright (c) 2004-2007, AlliedModders LLC"
|
||||||
VALUE "OriginalFilename", "game.cstrike.ext.dll"
|
VALUE "OriginalFilename", "game.cstrike.ext.dll"
|
||||||
VALUE "ProductName", "SourceMod CS:S Extension"
|
VALUE "ProductName", "SourceMod CS:S Extension"
|
||||||
VALUE "ProductVersion", SVN_FULL_VERSION
|
VALUE "ProductVersion", SVN_FULL_VERSION
|
||||||
|
|||||||
+39
-71
@@ -1,12 +1,9 @@
|
|||||||
# (C)2004-2008 SourceMod Development Team
|
#(C)2004-2006 SourceMM Development Team
|
||||||
# Makefile written by David "BAILOPAN" Anderson
|
# Makefile written by David "BAILOPAN" Anderson
|
||||||
|
|
||||||
SMSDK = ../..
|
SMSDK = ../..
|
||||||
SRCDS_BASE = ~/srcds
|
SRCDS = ~/srcds
|
||||||
HL2SDK_ORIG = ../../../hl2sdk
|
SOURCEMM = ../../../sourcemm-1.6
|
||||||
HL2SDK_OB = ../../../hl2sdk-ob
|
|
||||||
SOURCEMM14 = ../../../sourcemm-1.4
|
|
||||||
SOURCEMM16 = ../../../sourcemm-1.6
|
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
### EDIT BELOW FOR OTHER PROJECTS ###
|
||||||
@@ -14,8 +11,8 @@ SOURCEMM16 = ../../../sourcemm-1.6
|
|||||||
|
|
||||||
PROJECT = geoip
|
PROJECT = geoip
|
||||||
|
|
||||||
#Uncomment for Metamod: Source enabled extension
|
#Uncomment for SourceMM-enabled extensions
|
||||||
#USEMETA = true
|
#LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so
|
||||||
|
|
||||||
OBJECTS = sdk/smsdk_ext.cpp extension.cpp GeoIP.c
|
OBJECTS = sdk/smsdk_ext.cpp extension.cpp GeoIP.c
|
||||||
|
|
||||||
@@ -23,51 +20,27 @@ OBJECTS = sdk/smsdk_ext.cpp extension.cpp GeoIP.c
|
|||||||
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
|
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
|
||||||
##############################################
|
##############################################
|
||||||
|
|
||||||
C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
|
C_OPT_FLAGS = -O3 -funroll-loops -pipe -fno-strict-aliasing
|
||||||
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
|
C_DEBUG_FLAGS = -g -ggdb3
|
||||||
C_GCC4_FLAGS = -fvisibility=hidden
|
CPP_GCC4_FLAGS = -fvisibility=hidden -fvisibility-inlines-hidden
|
||||||
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
|
|
||||||
CPP = gcc-4.1
|
CPP = gcc-4.1
|
||||||
|
|
||||||
override ENGSET = false
|
HL2PUB = $(HL2SDK)/public
|
||||||
ifeq "$(ENGINE)" "original"
|
HL2LIB = $(HL2SDK)/linux_sdk
|
||||||
HL2SDK = $(HL2SDK_ORIG)
|
HL2SDK = $(SOURCEMM)/hl2sdk
|
||||||
HL2PUB = $(HL2SDK_ORIG)/public
|
SMM_TRUNK = $(SOURCEMM)/trunk
|
||||||
HL2LIB = $(HL2SDK_ORIG)/linux_sdk
|
|
||||||
METAMOD = $(SOURCEMM14)
|
|
||||||
INCLUDE += -I$(HL2SDK)/public/dlls
|
|
||||||
SRCDS = $(SRCDS_BASE)
|
|
||||||
override ENGSET = true
|
|
||||||
endif
|
|
||||||
ifeq "$(ENGINE)" "orangebox"
|
|
||||||
HL2SDK = $(HL2SDK_OB)
|
|
||||||
HL2PUB = $(HL2SDK_OB)/public
|
|
||||||
HL2LIB = $(HL2SDK_OB)/linux_sdk
|
|
||||||
CFLAGS += -DORANGEBOX_BUILD
|
|
||||||
METAMOD = $(SOURCEMM16)
|
|
||||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
|
||||||
SRCDS = $(SRCDS_BASE)/orangebox
|
|
||||||
override ENGSET = true
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq "$(USEMETA)" "true"
|
LINK = $(LINK_HL2) -static-libgcc
|
||||||
LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so
|
|
||||||
|
|
||||||
LINK += $(LINK_HL2)
|
INCLUDE = -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/dlls -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
||||||
|
-I$(HL2PUB)/vstdlib -I$(HL2SDK)/tier1 -I$(SMM_TRUNK) -I$(SMM_TRUNK)/sourcehook -I$(SMM_TRUNK)/sourcemm \
|
||||||
|
-I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn -I$(SMSDK)/public/extensions \
|
||||||
|
|
||||||
INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
CFLAGS = -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp \
|
||||||
-I$(METAMOD) -I$(METAMOD)/sourcehook -I$(METAMOD)/sourcemm -I$(SMSDK)/public \
|
-Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca \
|
||||||
-I$(SMSDK)/public/sourcepawn
|
-Dstrcmpi=strcasecmp -Wall -Werror -mfpmath=sse -msse -DSOURCEMOD_BUILD \
|
||||||
else
|
-m32
|
||||||
INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
|
CPPFLAGS = -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
|
||||||
endif
|
|
||||||
|
|
||||||
LINK += -static-libgcc
|
|
||||||
|
|
||||||
CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
|
|
||||||
-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror -mfpmath=sse \
|
|
||||||
-msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -m32
|
|
||||||
CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
|
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
|
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
|
||||||
@@ -81,46 +54,41 @@ else
|
|||||||
CFLAGS += $(C_OPT_FLAGS)
|
CFLAGS += $(C_OPT_FLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(USEMETA)" "true"
|
|
||||||
BIN_DIR := $(BIN_DIR).$(ENGINE)
|
|
||||||
endif
|
|
||||||
|
|
||||||
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
||||||
ifeq "$(GCC_VERSION)" "4"
|
ifeq "$(GCC_VERSION)" "4"
|
||||||
CFLAGS += $(C_GCC4_FLAGS)
|
|
||||||
CPPFLAGS += $(CPP_GCC4_FLAGS)
|
CPPFLAGS += $(CPP_GCC4_FLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
BINARY = $(PROJECT).ext.so
|
BINARY = $(PROJECT).ext.so
|
||||||
|
|
||||||
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
||||||
|
OBJ_LINUX := $(OBJ_LINUX:%.c=$(BIN_DIR)/%.o)
|
||||||
|
|
||||||
$(BIN_DIR)/%.o: %.cpp
|
$(BIN_DIR)/%.o: %.cpp
|
||||||
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
all: check
|
$(BIN_DIR)/%.o: %.c
|
||||||
|
$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
|
all:
|
||||||
mkdir -p $(BIN_DIR)/sdk
|
mkdir -p $(BIN_DIR)/sdk
|
||||||
if [ "$(USEMETA)" == "true" ]; then \
|
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so
|
||||||
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so; \
|
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so
|
||||||
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \
|
$(MAKE) extension
|
||||||
fi
|
|
||||||
$(MAKE) -f Makefile extension
|
|
||||||
|
|
||||||
check:
|
extension: $(OBJ_LINUX)
|
||||||
if [ "$(USEMETA)" == "true" ] && [ "$(ENGSET)" == "false" ]; then \
|
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
||||||
echo "You must supply ENGINE=orangebox or ENGINE=original"; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
extension: check $(OBJ_LINUX)
|
|
||||||
$(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
$(MAKE) -f Makefile all DEBUG=true
|
$(MAKE) all DEBUG=true
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
clean: check
|
clean:
|
||||||
rm -rf $(BIN_DIR)/*.o
|
rm -rf Release/*.o
|
||||||
rm -rf $(BIN_DIR)/sdk/*.o
|
rm -rf Release/sdk/*.o
|
||||||
rm -rf $(BIN_DIR)/$(BINARY)
|
rm -rf Release/$(BINARY)
|
||||||
|
rm -rf Debug/*.o
|
||||||
|
rm -rf Debug/sdk/*.o
|
||||||
|
rm -rf Debug/$(BINARY)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="8.00"
|
Version="8,00"
|
||||||
Name="geoip"
|
Name="geoip"
|
||||||
ProjectGUID="{698EAEE7-0EFC-4017-9B88-ECCAAF42FD5F}"
|
ProjectGUID="{698EAEE7-0EFC-4017-9B88-ECCAAF42FD5F}"
|
||||||
RootNamespace="geoip"
|
RootNamespace="geoip"
|
||||||
@@ -66,7 +66,6 @@
|
|||||||
AdditionalDependencies="ws2_32.lib"
|
AdditionalDependencies="ws2_32.lib"
|
||||||
OutputFile="$(OutDir)\geoip.ext.dll"
|
OutputFile="$(OutDir)\geoip.ext.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
@@ -146,7 +145,6 @@
|
|||||||
AdditionalDependencies="ws2_32.lib"
|
AdditionalDependencies="ws2_32.lib"
|
||||||
OutputFile="$(OutDir)\geoip.ext.dll"
|
OutputFile="$(OutDir)\geoip.ext.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
|
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod GeoIP Extension
|
* SourceMod GeoIP Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod Base Extension Code
|
* SourceMod Base Extension Code
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod Base Extension Code
|
* SourceMod Base Extension Code
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod GeoIP Extension
|
* SourceMod GeoIP Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
#ifndef _INCLUDE_GEOIP_VERSION_H_
|
#ifndef _INCLUDE_GEOIP_VERSION_H_
|
||||||
#define _INCLUDE_GEOIP_VERSION_H_
|
#define _INCLUDE_GEOIP_VERSION_H_
|
||||||
|
|
||||||
#define SVN_FULL_VERSION "1.0.2.2236"
|
#define SVN_FULL_VERSION "1.0.1.2166"
|
||||||
#define SVN_FILE_VERSION 1,0,2,2236
|
#define SVN_FILE_VERSION 1,0,1,2166
|
||||||
|
|
||||||
#endif //_INCLUDE_GEOIP_VERSION_H_
|
#endif //_INCLUDE_GEOIP_VERSION_H_
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod GeoIP Extension
|
* SourceMod GeoIP Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
#ifndef _INCLUDE_GEOIP_VERSION_H_
|
#ifndef _INCLUDE_GEOIP_VERSION_H_
|
||||||
#define _INCLUDE_GEOIP_VERSION_H_
|
#define _INCLUDE_GEOIP_VERSION_H_
|
||||||
|
|
||||||
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
|
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$LOCAL_BUILD$"
|
||||||
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
|
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$LOCAL_BUILD$
|
||||||
|
|
||||||
#endif //_INCLUDE_GEOIP_VERSION_H_
|
#endif //_INCLUDE_GEOIP_VERSION_H_
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ BEGIN
|
|||||||
VALUE "FileDescription", "SourceMod GeoIP Extension"
|
VALUE "FileDescription", "SourceMod GeoIP Extension"
|
||||||
VALUE "FileVersion", SVN_FULL_VERSION
|
VALUE "FileVersion", SVN_FULL_VERSION
|
||||||
VALUE "InternalName", "SourceMod GeoIP Extension"
|
VALUE "InternalName", "SourceMod GeoIP Extension"
|
||||||
VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC"
|
VALUE "LegalCopyright", "Copyright (c) 2004-2007, AlliedModders LLC"
|
||||||
VALUE "OriginalFilename", "geoip.ext.dll"
|
VALUE "OriginalFilename", "geoip.ext.dll"
|
||||||
VALUE "ProductName", "SourceMod GeoIP Extension"
|
VALUE "ProductName", "SourceMod GeoIP Extension"
|
||||||
VALUE "ProductVersion", SVN_FULL_VERSION
|
VALUE "ProductVersion", SVN_FULL_VERSION
|
||||||
|
|||||||
+39
-73
@@ -1,12 +1,9 @@
|
|||||||
# (C)2004-2008 SourceMod Development Team
|
#(C)2004-2006 SourceMM Development Team
|
||||||
# Makefile written by David "BAILOPAN" Anderson
|
# Makefile written by David "BAILOPAN" Anderson
|
||||||
|
|
||||||
SMSDK = ../..
|
SMSDK = ../..
|
||||||
SRCDS_BASE = ~/srcds
|
SRCDS = ~/srcds
|
||||||
HL2SDK_ORIG = ../../../hl2sdk
|
SOURCEMM = ../../../sourcemm-1.6
|
||||||
HL2SDK_OB = ../../../hl2sdk-ob
|
|
||||||
SOURCEMM14 = ../../../sourcemm-1.4
|
|
||||||
SOURCEMM16 = ../../../sourcemm-1.6
|
|
||||||
MYSQL = ../../../mysql-5.0
|
MYSQL = ../../../mysql-5.0
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
@@ -15,8 +12,8 @@ MYSQL = ../../../mysql-5.0
|
|||||||
|
|
||||||
PROJECT = dbi.mysql
|
PROJECT = dbi.mysql
|
||||||
|
|
||||||
#Uncomment for Metamod: Source enabled extension
|
#Uncomment for SourceMM-enabled extensions
|
||||||
#USEMETA = true
|
#LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so
|
||||||
|
|
||||||
OBJECTS = sdk/smsdk_ext.cpp extension.cpp \
|
OBJECTS = sdk/smsdk_ext.cpp extension.cpp \
|
||||||
mysql/MyBasicResults.cpp mysql/MyDatabase.cpp \
|
mysql/MyBasicResults.cpp mysql/MyDatabase.cpp \
|
||||||
@@ -27,52 +24,28 @@ OBJECTS = sdk/smsdk_ext.cpp extension.cpp \
|
|||||||
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
|
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
|
||||||
##############################################
|
##############################################
|
||||||
|
|
||||||
C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
|
C_OPT_FLAGS = -O3 -funroll-loops -pipe -fno-strict-aliasing
|
||||||
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
|
C_DEBUG_FLAGS = -g -ggdb3
|
||||||
C_GCC4_FLAGS = -fvisibility=hidden
|
CPP_GCC4_FLAGS = -fvisibility=hidden -fvisibility-inlines-hidden
|
||||||
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
|
|
||||||
CPP = gcc-4.1
|
CPP = gcc-4.1
|
||||||
|
|
||||||
override ENGSET = false
|
HL2PUB = $(HL2SDK)/public
|
||||||
ifeq "$(ENGINE)" "original"
|
HL2LIB = $(HL2SDK)/linux_sdk
|
||||||
HL2SDK = $(HL2SDK_ORIG)
|
HL2SDK = $(SOURCEMM)/hl2sdk
|
||||||
HL2PUB = $(HL2SDK_ORIG)/public
|
|
||||||
HL2LIB = $(HL2SDK_ORIG)/linux_sdk
|
|
||||||
METAMOD = $(SOURCEMM14)
|
|
||||||
INCLUDE += -I$(HL2SDK)/public/dlls
|
|
||||||
SRCDS = $(SRCDS_BASE)
|
|
||||||
override ENGSET = true
|
|
||||||
endif
|
|
||||||
ifeq "$(ENGINE)" "orangebox"
|
|
||||||
HL2SDK = $(HL2SDK_OB)
|
|
||||||
HL2PUB = $(HL2SDK_OB)/public
|
|
||||||
HL2LIB = $(HL2SDK_OB)/linux_sdk
|
|
||||||
CFLAGS += -DORANGEBOX_BUILD
|
|
||||||
METAMOD = $(SOURCEMM16)
|
|
||||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
|
||||||
SRCDS = $(SRCDS_BASE)/orangebox
|
|
||||||
override ENGSET = true
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq "$(USEMETA)" "true"
|
LINK = $(LINK_HL2) $(MYSQL)/lib/libmysqlclient_r.a -lz -static-libgcc -lpthread
|
||||||
LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so
|
|
||||||
|
|
||||||
LINK += $(LINK_HL2)
|
INCLUDE = -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/dlls -I$(HL2PUB)/engine \
|
||||||
|
-I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I$(HL2PUB)/vstdlib -I$(HL2SDK)/tier1 \
|
||||||
|
-I$(SOURCEMM) -I$(SOURCEMM)/sourcehook -I$(SOURCEMM)/sourcemm \
|
||||||
|
-I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn -I$(SMSDK)/public/extensions \
|
||||||
|
-I$(MYSQL)/include
|
||||||
|
|
||||||
INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
CFLAGS = -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp \
|
||||||
-I$(METAMOD) -I$(METAMOD)/sourcehook -I$(METAMOD)/sourcemm -I$(SMSDK)/public \
|
-Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca \
|
||||||
-I$(SMSDK)/public/sourcepawn
|
-Dstrcmpi=strcasecmp -Wall -Werror -mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H \
|
||||||
else
|
-Wno-switch -m32
|
||||||
INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn -I$(SOURCEMM16)/sourcehook \
|
CPPFLAGS = -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
|
||||||
-I$(MYSQL)/include
|
|
||||||
endif
|
|
||||||
|
|
||||||
LINK += $(MYSQL)/lib/libmysqlclient_r.a -lz -static-libgcc -lpthread
|
|
||||||
|
|
||||||
CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
|
|
||||||
-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror -Wno-switch \
|
|
||||||
-mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -m32
|
|
||||||
CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
|
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
|
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
|
||||||
@@ -86,13 +59,9 @@ else
|
|||||||
CFLAGS += $(C_OPT_FLAGS)
|
CFLAGS += $(C_OPT_FLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(USEMETA)" "true"
|
|
||||||
BIN_DIR := $(BIN_DIR).$(ENGINE)
|
|
||||||
endif
|
|
||||||
|
|
||||||
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
||||||
ifeq "$(GCC_VERSION)" "4"
|
ifeq "$(GCC_VERSION)" "4"
|
||||||
CFLAGS += $(C_GCC4_FLAGS)
|
|
||||||
CPPFLAGS += $(CPP_GCC4_FLAGS)
|
CPPFLAGS += $(CPP_GCC4_FLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -103,31 +72,28 @@ OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
|||||||
$(BIN_DIR)/%.o: %.cpp
|
$(BIN_DIR)/%.o: %.cpp
|
||||||
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
all: check
|
all:
|
||||||
mkdir -p $(BIN_DIR)/sdk
|
mkdir -p $(BIN_DIR)/sdk
|
||||||
mkdir -p $(BIN_DIR)/mysql
|
mkdir -p $(BIN_DIR)/mysql
|
||||||
if [ "$(USEMETA)" == "true" ]; then \
|
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so
|
||||||
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so; \
|
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so
|
||||||
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \
|
$(MAKE) extension
|
||||||
fi
|
|
||||||
$(MAKE) -f Makefile extension
|
|
||||||
|
|
||||||
check:
|
extension: $(OBJ_LINUX)
|
||||||
if [ "$(USEMETA)" == "true" ] && [ "$(ENGSET)" == "false" ]; then \
|
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
||||||
echo "You must supply ENGINE=orangebox or ENGINE=original"; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
extension: check $(OBJ_LINUX)
|
|
||||||
$(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
$(MAKE) -f Makefile all DEBUG=true
|
$(MAKE) all DEBUG=true
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
clean: check
|
clean:
|
||||||
rm -rf $(BIN_DIR)/*.o
|
rm -rf Release/*.o
|
||||||
rm -rf $(BIN_DIR)/sdk/*.o
|
rm -rf Release/sdk/*.o
|
||||||
rm -rf $(BIN_DIR)/mysql/*.o
|
rm -rf Release/mysql/*.o
|
||||||
rm -rf $(BIN_DIR)/$(BINARY)
|
rm -rf Release/$(BINARY)
|
||||||
|
rm -rf Debug/*.o
|
||||||
|
rm -rf Debug/sdk/*.o
|
||||||
|
rm -rf Debug/mysql/*.o
|
||||||
|
rm -rf Debug/$(BINARY)
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
AdditionalDependencies="wsock32.lib mysqlclient.lib zlib.lib"
|
AdditionalDependencies="wsock32.lib mysqlclient.lib zlib.lib"
|
||||||
OutputFile="$(OutDir)\dbi.mysql.ext.dll"
|
OutputFile="$(OutDir)\dbi.mysql.ext.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
IgnoreDefaultLibraryNames="LIBCMT"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
@@ -148,7 +148,6 @@
|
|||||||
AdditionalDependencies="wsock32.lib mysqlclient.lib"
|
AdditionalDependencies="wsock32.lib mysqlclient.lib"
|
||||||
OutputFile="$(OutDir)\dbi.mysql.ext.dll"
|
OutputFile="$(OutDir)\dbi.mysql.ext.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
|
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod MySQL Extension
|
* SourceMod MySQL Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod MySQL Extension
|
* SourceMod MySQL Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -89,8 +89,6 @@ MyBoundResults::MyBoundResults(MYSQL_STMT *stmt, MYSQL_RES *res)
|
|||||||
/* Zero data */
|
/* Zero data */
|
||||||
memset(m_bind, 0, sizeof(MYSQL_BIND) * m_ColCount);
|
memset(m_bind, 0, sizeof(MYSQL_BIND) * m_ColCount);
|
||||||
memset(m_pull, 0, sizeof(ResultBind) * m_ColCount);
|
memset(m_pull, 0, sizeof(ResultBind) * m_ColCount);
|
||||||
|
|
||||||
m_bUpdatedBinds = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MyBoundResults::~MyBoundResults()
|
MyBoundResults::~MyBoundResults()
|
||||||
@@ -213,15 +211,6 @@ IResultRow *MyBoundResults::FetchRow()
|
|||||||
|
|
||||||
m_CurRow++;
|
m_CurRow++;
|
||||||
|
|
||||||
if (m_bUpdatedBinds)
|
|
||||||
{
|
|
||||||
if (mysql_stmt_bind_result(m_stmt, m_bind) != 0)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
m_bUpdatedBinds = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* We should be able to get another row */
|
/* We should be able to get another row */
|
||||||
int err = mysql_stmt_fetch(m_stmt);
|
int err = mysql_stmt_fetch(m_stmt);
|
||||||
if (err == 0 || err == MYSQL_DATA_TRUNCATED)
|
if (err == 0 || err == MYSQL_DATA_TRUNCATED)
|
||||||
@@ -277,29 +266,22 @@ void ResizeBuffer(ResultBind *bind, size_t len)
|
|||||||
{
|
{
|
||||||
bind->blob = new unsigned char[len];
|
bind->blob = new unsigned char[len];
|
||||||
bind->length = len;
|
bind->length = len;
|
||||||
}
|
} else if (bind->length < len) {
|
||||||
else if (bind->length < len)
|
|
||||||
{
|
|
||||||
delete [] bind->blob;
|
delete [] bind->blob;
|
||||||
bind->blob = new unsigned char[len];
|
bind->blob = new unsigned char[len];
|
||||||
bind->length = len;
|
bind->length = len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MyBoundResults::RefetchField(MYSQL_STMT *stmt,
|
bool RefetchField(MYSQL_STMT *stmt,
|
||||||
|
ResultBind *rbind,
|
||||||
unsigned int id,
|
unsigned int id,
|
||||||
size_t initSize,
|
size_t initSize,
|
||||||
enum_field_types type)
|
enum_field_types type)
|
||||||
{
|
{
|
||||||
ResultBind *rbind = &m_pull[id];
|
|
||||||
|
|
||||||
/* Make sure there is a buffer to pull into */
|
/* Make sure there is a buffer to pull into */
|
||||||
ResizeBuffer(rbind, initSize);
|
ResizeBuffer(rbind, initSize);
|
||||||
|
|
||||||
/* Update the bind with the buffer size */
|
|
||||||
m_bind[id].buffer_length = (unsigned long)rbind->length;
|
|
||||||
m_bUpdatedBinds = true;
|
|
||||||
|
|
||||||
MYSQL_BIND bind;
|
MYSQL_BIND bind;
|
||||||
|
|
||||||
/* Initialize bind info */
|
/* Initialize bind info */
|
||||||
@@ -415,7 +397,7 @@ DBResult MyBoundResults::GetString(unsigned int id, const char **pString, size_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Attempt to refetch the string */
|
/* Attempt to refetch the string */
|
||||||
if (!RefetchField(m_stmt, id, 128, MYSQL_TYPE_STRING))
|
if (!RefetchField(m_stmt, &m_pull[id], id, 128, MYSQL_TYPE_STRING))
|
||||||
{
|
{
|
||||||
return DBVal_TypeMismatch;
|
return DBVal_TypeMismatch;
|
||||||
}
|
}
|
||||||
@@ -436,7 +418,7 @@ DBResult MyBoundResults::GetString(unsigned int id, const char **pString, size_t
|
|||||||
if ((size_t)(m_pull[id].my_length) >= m_pull[id].length)
|
if ((size_t)(m_pull[id].my_length) >= m_pull[id].length)
|
||||||
{
|
{
|
||||||
/* Yes, we need to refetch. */
|
/* Yes, we need to refetch. */
|
||||||
if (!RefetchField(m_stmt, id, m_pull[id].my_length + 1, MYSQL_TYPE_STRING))
|
if (!RefetchField(m_stmt, &m_pull[id], id, m_pull[id].my_length + 1, MYSQL_TYPE_STRING))
|
||||||
{
|
{
|
||||||
return DBVal_Error;
|
return DBVal_Error;
|
||||||
}
|
}
|
||||||
@@ -609,7 +591,7 @@ DBResult MyBoundResults::GetBlob(unsigned int id, const void **pData, size_t *le
|
|||||||
|
|
||||||
if ((size_t)m_pull[id].my_length > m_pull[id].length)
|
if ((size_t)m_pull[id].my_length > m_pull[id].length)
|
||||||
{
|
{
|
||||||
if (!RefetchField(m_stmt, id, m_pull[id].my_length, MYSQL_TYPE_BLOB))
|
if (!RefetchField(m_stmt, &m_pull[id], id, m_pull[id].my_length, MYSQL_TYPE_BLOB))
|
||||||
{
|
{
|
||||||
return DBVal_TypeMismatch;
|
return DBVal_TypeMismatch;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,11 +83,6 @@ public: //IResultRow
|
|||||||
public:
|
public:
|
||||||
bool Initialize();
|
bool Initialize();
|
||||||
void Update();
|
void Update();
|
||||||
private:
|
|
||||||
bool RefetchField(MYSQL_STMT *stmt,
|
|
||||||
unsigned int id,
|
|
||||||
size_t initSize,
|
|
||||||
enum_field_types type);
|
|
||||||
private:
|
private:
|
||||||
MYSQL_STMT *m_stmt;
|
MYSQL_STMT *m_stmt;
|
||||||
MYSQL_RES *m_pRes;
|
MYSQL_RES *m_pRes;
|
||||||
@@ -97,7 +92,6 @@ private:
|
|||||||
bool m_Initialized;
|
bool m_Initialized;
|
||||||
unsigned int m_RowCount;
|
unsigned int m_RowCount;
|
||||||
unsigned int m_CurRow;
|
unsigned int m_CurRow;
|
||||||
bool m_bUpdatedBinds;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //_INCLUDE_SM_MYSQL_BOUND_RESULTS_H_
|
#endif //_INCLUDE_SM_MYSQL_BOUND_RESULTS_H_
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod MySQL Extension
|
* SourceMod MySQL Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod Base Extension Code
|
* SourceMod Base Extension Code
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod Base Extension Code
|
* SourceMod Base Extension Code
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod MySQL Extension
|
* SourceMod MySQL Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
#ifndef _INCLUDE_MYSQLEXT_VERSION_H_
|
#ifndef _INCLUDE_MYSQLEXT_VERSION_H_
|
||||||
#define _INCLUDE_MYSQLEXT_VERSION_H_
|
#define _INCLUDE_MYSQLEXT_VERSION_H_
|
||||||
|
|
||||||
#define SVN_FULL_VERSION "1.0.2.2236"
|
#define SVN_FULL_VERSION "1.0.1.2166"
|
||||||
#define SVN_FILE_VERSION 1,0,2,2236
|
#define SVN_FILE_VERSION 1,0,1,2166
|
||||||
|
|
||||||
#endif //_INCLUDE_MYSQLEXT_VERSION_H_
|
#endif //_INCLUDE_MYSQLEXT_VERSION_H_
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod MySQL Extension
|
* SourceMod MySQL Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
#ifndef _INCLUDE_MYSQLEXT_VERSION_H_
|
#ifndef _INCLUDE_MYSQLEXT_VERSION_H_
|
||||||
#define _INCLUDE_MYSQLEXT_VERSION_H_
|
#define _INCLUDE_MYSQLEXT_VERSION_H_
|
||||||
|
|
||||||
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
|
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$LOCAL_BUILD$"
|
||||||
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
|
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$LOCAL_BUILD$
|
||||||
|
|
||||||
#endif //_INCLUDE_MYSQLEXT_VERSION_H_
|
#endif //_INCLUDE_MYSQLEXT_VERSION_H_
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ BEGIN
|
|||||||
VALUE "FileDescription", "SourceMod MySQL Extension"
|
VALUE "FileDescription", "SourceMod MySQL Extension"
|
||||||
VALUE "FileVersion", SVN_FULL_VERSION
|
VALUE "FileVersion", SVN_FULL_VERSION
|
||||||
VALUE "InternalName", "SourceMod MySQL Extension"
|
VALUE "InternalName", "SourceMod MySQL Extension"
|
||||||
VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC"
|
VALUE "LegalCopyright", "Copyright (c) 2004-2007, AlliedModders LLC"
|
||||||
VALUE "OriginalFilename", "dbi.mysql.ext.dll"
|
VALUE "OriginalFilename", "dbi.mysql.ext.dll"
|
||||||
VALUE "ProductName", "SourceMod MySQL Extension"
|
VALUE "ProductName", "SourceMod MySQL Extension"
|
||||||
VALUE "ProductVersion", SVN_FULL_VERSION
|
VALUE "ProductVersion", SVN_FULL_VERSION
|
||||||
|
|||||||
@@ -1,155 +0,0 @@
|
|||||||
/**
|
|
||||||
* vim: set ts=4 :
|
|
||||||
* =============================================================================
|
|
||||||
* SourceMod Regular Expressions Extension
|
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
|
||||||
* =============================================================================
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
|
||||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
||||||
* Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
* details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
||||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
||||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
||||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
||||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
||||||
* this exception to all derivative works. AlliedModders LLC defines further
|
|
||||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
||||||
* or <http://www.sourcemod.net/license.php>.
|
|
||||||
*
|
|
||||||
* Version: $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "pcre.h"
|
|
||||||
#include "CRegEx.h"
|
|
||||||
#include <sh_string.h>
|
|
||||||
#include "extension.h"
|
|
||||||
|
|
||||||
RegEx::RegEx()
|
|
||||||
{
|
|
||||||
mErrorOffset = 0;
|
|
||||||
mError = NULL;
|
|
||||||
re = NULL;
|
|
||||||
mFree = true;
|
|
||||||
subject = NULL;
|
|
||||||
mSubStrings = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RegEx::Clear ()
|
|
||||||
{
|
|
||||||
mErrorOffset = 0;
|
|
||||||
mError = NULL;
|
|
||||||
if (re)
|
|
||||||
pcre_free(re);
|
|
||||||
re = NULL;
|
|
||||||
mFree = true;
|
|
||||||
if (subject)
|
|
||||||
delete [] subject;
|
|
||||||
subject = NULL;
|
|
||||||
mSubStrings = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
RegEx::~RegEx()
|
|
||||||
{
|
|
||||||
Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RegEx::isFree(bool set, bool val)
|
|
||||||
{
|
|
||||||
if (set)
|
|
||||||
{
|
|
||||||
mFree = val;
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return mFree;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int RegEx::Compile(const char *pattern, int iFlags)
|
|
||||||
{
|
|
||||||
if (!mFree)
|
|
||||||
Clear();
|
|
||||||
|
|
||||||
re = pcre_compile(pattern, iFlags, &mError, &mErrorOffset, NULL);
|
|
||||||
|
|
||||||
if (re == NULL)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
mFree = false;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int RegEx::Match(const char *str)
|
|
||||||
{
|
|
||||||
int rc = 0;
|
|
||||||
|
|
||||||
if (mFree || re == NULL)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
this->ClearMatch();
|
|
||||||
|
|
||||||
//save str
|
|
||||||
subject = new char[strlen(str)+1];
|
|
||||||
strcpy(subject, str);
|
|
||||||
|
|
||||||
rc = pcre_exec(re, NULL, subject, (int)strlen(subject), 0, 0, ovector, 30);
|
|
||||||
|
|
||||||
if (rc < 0)
|
|
||||||
{
|
|
||||||
if (rc == PCRE_ERROR_NOMATCH)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
mErrorOffset = rc;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mSubStrings = rc;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
void RegEx::ClearMatch()
|
|
||||||
{
|
|
||||||
// Clears match results
|
|
||||||
mErrorOffset = 0;
|
|
||||||
mError = NULL;
|
|
||||||
if (subject)
|
|
||||||
delete [] subject;
|
|
||||||
subject = NULL;
|
|
||||||
mSubStrings = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *RegEx::GetSubstring(int s, char buffer[], int max)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
if (s >= mSubStrings || s < 0)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
char *substr_a = subject + ovector[2*s];
|
|
||||||
int substr_l = ovector[2*s+1] - ovector[2*s];
|
|
||||||
|
|
||||||
for (i = 0; i<substr_l; i++)
|
|
||||||
{
|
|
||||||
if (i >= max)
|
|
||||||
break;
|
|
||||||
buffer[i] = substr_a[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
buffer[i] = '\0';
|
|
||||||
|
|
||||||
return buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
/**
|
|
||||||
* vim: set ts=4 :
|
|
||||||
* =============================================================================
|
|
||||||
* SourceMod Regular Expressions Extension
|
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
|
||||||
* =============================================================================
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
|
||||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
||||||
* Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
* details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
||||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
||||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
||||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
||||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
||||||
* this exception to all derivative works. AlliedModders LLC defines further
|
|
||||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
||||||
* or <http://www.sourcemod.net/license.php>.
|
|
||||||
*
|
|
||||||
* Version: $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _INCLUDE_CREGEX_H
|
|
||||||
#define _INCLUDE_CREGEX_H
|
|
||||||
|
|
||||||
class RegEx
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
RegEx();
|
|
||||||
~RegEx();
|
|
||||||
bool isFree(bool set=false, bool val=false);
|
|
||||||
void Clear();
|
|
||||||
|
|
||||||
int Compile(const char *pattern, int iFlags);
|
|
||||||
int Match(const char *str);
|
|
||||||
void ClearMatch();
|
|
||||||
const char *GetSubstring(int s, char buffer[], int max);
|
|
||||||
public:
|
|
||||||
int mErrorOffset;
|
|
||||||
const char *mError;
|
|
||||||
int mSubStrings;
|
|
||||||
private:
|
|
||||||
pcre *re;
|
|
||||||
bool mFree;
|
|
||||||
int ovector[30];
|
|
||||||
char *subject;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //_INCLUDE_CREGEX_H
|
|
||||||
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
# (C)2004-2008 SourceMod Development Team
|
|
||||||
# Makefile written by David "BAILOPAN" Anderson
|
|
||||||
|
|
||||||
SMSDK = ../..
|
|
||||||
SRCDS_BASE = ~/srcds
|
|
||||||
HL2SDK_ORIG = ../../../hl2sdk
|
|
||||||
HL2SDK_OB = ../../../hl2sdk-ob
|
|
||||||
SOURCEMM14 = ../../../sourcemm-1.4
|
|
||||||
SOURCEMM16 = ../../../sourcemm-1.6
|
|
||||||
|
|
||||||
#####################################
|
|
||||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
|
||||||
#####################################
|
|
||||||
|
|
||||||
PROJECT = regex
|
|
||||||
|
|
||||||
#Uncomment for Metamod: Source enabled extension
|
|
||||||
#USEMETA = true
|
|
||||||
|
|
||||||
OBJECTS = sdk/smsdk_ext.cpp extension.cpp CRegEx.cpp
|
|
||||||
|
|
||||||
##############################################
|
|
||||||
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
|
|
||||||
##############################################
|
|
||||||
|
|
||||||
C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
|
|
||||||
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
|
|
||||||
C_GCC4_FLAGS = -fvisibility=hidden
|
|
||||||
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
|
|
||||||
CPP = gcc-4.1
|
|
||||||
|
|
||||||
override ENGSET = false
|
|
||||||
ifeq "$(ENGINE)" "original"
|
|
||||||
HL2SDK = $(HL2SDK_ORIG)
|
|
||||||
HL2PUB = $(HL2SDK_ORIG)/public
|
|
||||||
HL2LIB = $(HL2SDK_ORIG)/linux_sdk
|
|
||||||
METAMOD = $(SOURCEMM14)
|
|
||||||
INCLUDE += -I$(HL2SDK)/public/dlls
|
|
||||||
SRCDS = $(SRCDS_BASE)
|
|
||||||
override ENGSET = true
|
|
||||||
endif
|
|
||||||
ifeq "$(ENGINE)" "orangebox"
|
|
||||||
HL2SDK = $(HL2SDK_OB)
|
|
||||||
HL2PUB = $(HL2SDK_OB)/public
|
|
||||||
HL2LIB = $(HL2SDK_OB)/linux_sdk
|
|
||||||
CFLAGS += -DORANGEBOX_BUILD
|
|
||||||
METAMOD = $(SOURCEMM16)
|
|
||||||
INCLUDE += -I$(HL2SDK)/public/game/server
|
|
||||||
SRCDS = $(SRCDS_BASE)/orangebox
|
|
||||||
override ENGSET = true
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq "$(USEMETA)" "true"
|
|
||||||
LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so
|
|
||||||
|
|
||||||
LINK += $(LINK_HL2)
|
|
||||||
|
|
||||||
INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
|
||||||
-I$(METAMOD) -I$(METAMOD)/sourcehook -I$(METAMOD)/sourcemm -I$(SMSDK)/public \
|
|
||||||
-I$(SMSDK)/public/sourcepawn
|
|
||||||
else
|
|
||||||
INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn -I$(SOURCEMM16)/sourcehook
|
|
||||||
endif
|
|
||||||
|
|
||||||
LINK += lib_linux/libpcre.a -static-libgcc
|
|
||||||
|
|
||||||
CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
|
|
||||||
-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror -mfpmath=sse \
|
|
||||||
-msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -m32
|
|
||||||
CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
|
|
||||||
|
|
||||||
################################################
|
|
||||||
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
|
|
||||||
################################################
|
|
||||||
|
|
||||||
ifeq "$(DEBUG)" "true"
|
|
||||||
BIN_DIR = Debug
|
|
||||||
CFLAGS += $(C_DEBUG_FLAGS)
|
|
||||||
else
|
|
||||||
BIN_DIR = Release
|
|
||||||
CFLAGS += $(C_OPT_FLAGS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq "$(USEMETA)" "true"
|
|
||||||
BIN_DIR := $(BIN_DIR).$(ENGINE)
|
|
||||||
endif
|
|
||||||
|
|
||||||
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
|
||||||
ifeq "$(GCC_VERSION)" "4"
|
|
||||||
CFLAGS += $(C_GCC4_FLAGS)
|
|
||||||
CPPFLAGS += $(CPP_GCC4_FLAGS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
BINARY = $(PROJECT).ext.so
|
|
||||||
|
|
||||||
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
|
||||||
|
|
||||||
$(BIN_DIR)/%.o: %.cpp
|
|
||||||
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
|
||||||
|
|
||||||
all: check
|
|
||||||
mkdir -p $(BIN_DIR)/sdk
|
|
||||||
if [ "$(USEMETA)" == "true" ]; then \
|
|
||||||
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so; \
|
|
||||||
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \
|
|
||||||
fi
|
|
||||||
$(MAKE) -f Makefile extension
|
|
||||||
|
|
||||||
check:
|
|
||||||
if [ "$(USEMETA)" == "true" ] && [ "$(ENGSET)" == "false" ]; then \
|
|
||||||
echo "You must supply ENGINE=orangebox or ENGINE=original"; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
extension: check $(OBJ_LINUX)
|
|
||||||
$(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
|
||||||
|
|
||||||
debug:
|
|
||||||
$(MAKE) -f Makefile all DEBUG=true
|
|
||||||
|
|
||||||
default: all
|
|
||||||
|
|
||||||
clean: check
|
|
||||||
rm -rf $(BIN_DIR)/*.o
|
|
||||||
rm -rf $(BIN_DIR)/sdk/*.o
|
|
||||||
rm -rf $(BIN_DIR)/$(BINARY)
|
|
||||||
@@ -1,188 +0,0 @@
|
|||||||
/**
|
|
||||||
* vim: set ts=4 :
|
|
||||||
* =============================================================================
|
|
||||||
* SourceMod Regular Expressions Extension
|
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
|
||||||
* =============================================================================
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
|
||||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
||||||
* Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
* details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
||||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
||||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
||||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
||||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
||||||
* this exception to all derivative works. AlliedModders LLC defines further
|
|
||||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
||||||
* or <http://www.sourcemod.net/license.php>.
|
|
||||||
*
|
|
||||||
* Version: $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "extension.h"
|
|
||||||
|
|
||||||
#include <sh_string.h>
|
|
||||||
#include "pcre.h"
|
|
||||||
#include "CRegEx.h"
|
|
||||||
using namespace SourceHook;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file extension.cpp
|
|
||||||
* @brief Implement Regex extension code here.
|
|
||||||
*/
|
|
||||||
|
|
||||||
RegexExtension g_RegexExtension; /**< Global singleton for extension's main interface */
|
|
||||||
|
|
||||||
SMEXT_LINK(&g_RegexExtension);
|
|
||||||
|
|
||||||
RegexHandler g_RegexHandler;
|
|
||||||
HandleType_t g_RegexHandle=0;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool RegexExtension::SDK_OnLoad(char *error, size_t err_max, bool late)
|
|
||||||
{
|
|
||||||
g_pShareSys->AddNatives(myself,regex_natives);
|
|
||||||
g_RegexHandle = g_pHandleSys->CreateType("Regex", &g_RegexHandler, 0, NULL, NULL, myself->GetIdentity(), NULL);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RegexExtension::SDK_OnUnload()
|
|
||||||
{
|
|
||||||
g_pHandleSys->RemoveType(g_RegexHandle, myself->GetIdentity());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static cell_t CompileRegex(IPluginContext *pCtx, const cell_t *params)
|
|
||||||
{
|
|
||||||
char *regex;
|
|
||||||
pCtx->LocalToString(params[1], ®ex);
|
|
||||||
|
|
||||||
RegEx *x = new RegEx();
|
|
||||||
|
|
||||||
if (x->Compile(regex, params[2]) == 0)
|
|
||||||
{
|
|
||||||
cell_t *eOff;
|
|
||||||
pCtx->LocalToPhysAddr(params[5], &eOff);
|
|
||||||
const char *err = x->mError;
|
|
||||||
*eOff = x->mErrorOffset;
|
|
||||||
pCtx->StringToLocal(params[3], params[4], err ? err:"unknown");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return g_pHandleSys->CreateHandle(g_RegexHandle, (void*)x, pCtx->GetIdentity(), myself->GetIdentity(), NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static cell_t MatchRegex(IPluginContext *pCtx, const cell_t *params)
|
|
||||||
{
|
|
||||||
Handle_t hndl = static_cast<Handle_t>(params[1]);
|
|
||||||
HandleError err;
|
|
||||||
HandleSecurity sec;
|
|
||||||
sec.pOwner = NULL;
|
|
||||||
sec.pIdentity = myself->GetIdentity();
|
|
||||||
|
|
||||||
RegEx *x;
|
|
||||||
|
|
||||||
if ((err=g_pHandleSys->ReadHandle(hndl, g_RegexHandle, &sec, (void **)&x)) != HandleError_None)
|
|
||||||
{
|
|
||||||
return pCtx->ThrowNativeError("Invalid file handle %x (error %d)", hndl, err);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!x)
|
|
||||||
{
|
|
||||||
pCtx->ThrowNativeError("Regex data not found\n");
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
char *str;
|
|
||||||
pCtx->LocalToString(params[2], &str);
|
|
||||||
|
|
||||||
int e = x->Match(str);
|
|
||||||
|
|
||||||
if (e == -1)
|
|
||||||
{
|
|
||||||
/* there was a match error. move on. */
|
|
||||||
cell_t *res;
|
|
||||||
pCtx->LocalToPhysAddr(params[3], &res);
|
|
||||||
*res = x->mErrorOffset;
|
|
||||||
/* only clear the match results, since the regex object
|
|
||||||
may still be referenced later */
|
|
||||||
x->ClearMatch();
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
else if (e == 0)
|
|
||||||
{
|
|
||||||
/* only clear the match results, since the regex object
|
|
||||||
may still be referenced later */
|
|
||||||
x->ClearMatch();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return x->mSubStrings;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static cell_t GetRegexSubString(IPluginContext *pCtx, const cell_t *params)
|
|
||||||
{
|
|
||||||
Handle_t hndl=static_cast<Handle_t>(params[1]);
|
|
||||||
HandleError err;
|
|
||||||
HandleSecurity sec;
|
|
||||||
sec.pOwner=NULL;
|
|
||||||
sec.pIdentity=myself->GetIdentity();
|
|
||||||
|
|
||||||
RegEx *x;
|
|
||||||
|
|
||||||
if ((err=g_pHandleSys->ReadHandle(hndl, g_RegexHandle, &sec, (void **)&x)) != HandleError_None)
|
|
||||||
{
|
|
||||||
return pCtx->ThrowNativeError("Invalid file handle %x (error %d)", hndl, err);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!x)
|
|
||||||
{
|
|
||||||
pCtx->ThrowNativeError("Regex data not found\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static char buffer[4096];
|
|
||||||
const char *ret=x->GetSubstring(params[2], buffer, sizeof(buffer));
|
|
||||||
|
|
||||||
if(!ret)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
pCtx->StringToLocalUTF8(params[3], params[4], ret, NULL);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RegexHandler::OnHandleDestroy(HandleType_t type, void *object)
|
|
||||||
{
|
|
||||||
RegEx *x = (RegEx *)object;
|
|
||||||
|
|
||||||
x->Clear();
|
|
||||||
delete x;
|
|
||||||
}
|
|
||||||
|
|
||||||
const sp_nativeinfo_t regex_natives[] =
|
|
||||||
{
|
|
||||||
{"GetRegexSubString", GetRegexSubString},
|
|
||||||
{"MatchRegex", MatchRegex},
|
|
||||||
{"CompileRegex", CompileRegex},
|
|
||||||
{NULL, NULL},
|
|
||||||
};
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
/**
|
|
||||||
* vim: set ts=4 :
|
|
||||||
* =============================================================================
|
|
||||||
* SourceMod Regular Expressions Extension
|
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
|
||||||
* =============================================================================
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
|
||||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
||||||
* Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
* details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
||||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
||||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
||||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
||||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
||||||
* this exception to all derivative works. AlliedModders LLC defines further
|
|
||||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
||||||
* or <http://www.sourcemod.net/license.php>.
|
|
||||||
*
|
|
||||||
* Version: $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
|
|
||||||
#define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file extension.h
|
|
||||||
* @brief Regex extension code header.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "smsdk_ext.h"
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Sample implementation of the SDK Extension.
|
|
||||||
* Note: Uncomment one of the pre-defined virtual functions in order to use it.
|
|
||||||
*/
|
|
||||||
class RegexExtension : public SDKExtension
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* @brief This is called after the initial loading sequence has been processed.
|
|
||||||
*
|
|
||||||
* @param error Error message buffer.
|
|
||||||
* @param maxlength Size of error message buffer.
|
|
||||||
* @param late Whether or not the module was loaded after map load.
|
|
||||||
* @return True to succeed loading, false to fail.
|
|
||||||
*/
|
|
||||||
virtual bool SDK_OnLoad(char *error, size_t maxlength, bool late);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief This is called right before the extension is unloaded.
|
|
||||||
*/
|
|
||||||
virtual void SDK_OnUnload();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief This is called once all known extensions have been loaded.
|
|
||||||
* Note: It is is a good idea to add natives here, if any are provided.
|
|
||||||
*/
|
|
||||||
//virtual void SDK_OnAllLoaded();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Called when the pause state is changed.
|
|
||||||
*/
|
|
||||||
//virtual void SDK_OnPauseChange(bool paused);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief this is called when Core wants to know if your extension is working.
|
|
||||||
*
|
|
||||||
* @param error Error message buffer.
|
|
||||||
* @param maxlength Size of error message buffer.
|
|
||||||
* @return True if working, false otherwise.
|
|
||||||
*/
|
|
||||||
//virtual bool QueryRunning(char *error, size_t maxlength);
|
|
||||||
public:
|
|
||||||
#if defined SMEXT_CONF_METAMOD
|
|
||||||
/**
|
|
||||||
* @brief Called when Metamod is attached, before the extension version is called.
|
|
||||||
*
|
|
||||||
* @param error Error buffer.
|
|
||||||
* @param maxlength Maximum size of error buffer.
|
|
||||||
* @param late Whether or not Metamod considers this a late load.
|
|
||||||
* @return True to succeed, false to fail.
|
|
||||||
*/
|
|
||||||
//virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlength, bool late);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Called when Metamod is detaching, after the extension version is called.
|
|
||||||
* NOTE: By default this is blocked unless sent from SourceMod.
|
|
||||||
*
|
|
||||||
* @param error Error buffer.
|
|
||||||
* @param maxlength Maximum size of error buffer.
|
|
||||||
* @return True to succeed, false to fail.
|
|
||||||
*/
|
|
||||||
//virtual bool SDK_OnMetamodUnload(char *error, size_t maxlength);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Called when Metamod's pause state is changing.
|
|
||||||
* NOTE: By default this is blocked unless sent from SourceMod.
|
|
||||||
*
|
|
||||||
* @param paused Pause state being set.
|
|
||||||
* @param error Error buffer.
|
|
||||||
* @param maxlength Maximum size of error buffer.
|
|
||||||
* @return True to succeed, false to fail.
|
|
||||||
*/
|
|
||||||
//virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlength);
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class RegexHandler: public IHandleTypeDispatch
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void OnHandleDestroy(HandleType_t type, void *object);
|
|
||||||
};
|
|
||||||
|
|
||||||
extern RegexHandler g_RegexHandler;
|
|
||||||
extern HandleType_t g_RegexHandle;
|
|
||||||
|
|
||||||
|
|
||||||
// Natives
|
|
||||||
extern const sp_nativeinfo_t regex_natives[];
|
|
||||||
|
|
||||||
#endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
|
||||||
# Visual Studio 2005
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regex", "regex.vcproj", "{B3E797CF-4E77-4C9D-B8A8-7589B6902206}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Win32 = Debug|Win32
|
|
||||||
Release|Win32 = Release|Win32
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
@@ -1,247 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
|
||||||
<VisualStudioProject
|
|
||||||
ProjectType="Visual C++"
|
|
||||||
Version="8.00"
|
|
||||||
Name="regex"
|
|
||||||
ProjectGUID="{B3E797CF-4E77-4C9D-B8A8-7589B6902206}"
|
|
||||||
RootNamespace="regex"
|
|
||||||
Keyword="Win32Proj"
|
|
||||||
>
|
|
||||||
<Platforms>
|
|
||||||
<Platform
|
|
||||||
Name="Win32"
|
|
||||||
/>
|
|
||||||
</Platforms>
|
|
||||||
<ToolFiles>
|
|
||||||
</ToolFiles>
|
|
||||||
<Configurations>
|
|
||||||
<Configuration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
|
||||||
IntermediateDirectory="$(ConfigurationName)"
|
|
||||||
ConfigurationType="2"
|
|
||||||
CharacterSet="2"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreBuildEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCustomBuildTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXMLDataGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCMIDLTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="0"
|
|
||||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;"$(SOURCEMM16)\sourcehook""
|
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;ORANGEBOX_BUILD"
|
|
||||||
MinimalRebuild="true"
|
|
||||||
BasicRuntimeChecks="3"
|
|
||||||
RuntimeLibrary="1"
|
|
||||||
EnableEnhancedInstructionSet="1"
|
|
||||||
RuntimeTypeInfo="false"
|
|
||||||
UsePrecompiledHeader="0"
|
|
||||||
WarningLevel="3"
|
|
||||||
Detect64BitPortabilityProblems="false"
|
|
||||||
DebugInformationFormat="4"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManagedResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreLinkEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCLinkerTool"
|
|
||||||
AdditionalDependencies="../lib_win/pcre.lib"
|
|
||||||
OutputFile="$(OutDir)\regex.ext.dll"
|
|
||||||
LinkIncremental="2"
|
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
|
|
||||||
GenerateDebugInformation="true"
|
|
||||||
SubSystem="2"
|
|
||||||
TargetMachine="1"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCALinkTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManifestTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXDCMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCBscMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCFxCopTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCAppVerifierTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebDeploymentTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPostBuildEventTool"
|
|
||||||
/>
|
|
||||||
</Configuration>
|
|
||||||
<Configuration
|
|
||||||
Name="Release|Win32"
|
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
|
||||||
IntermediateDirectory="$(ConfigurationName)"
|
|
||||||
ConfigurationType="2"
|
|
||||||
CharacterSet="2"
|
|
||||||
WholeProgramOptimization="1"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreBuildEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCustomBuildTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXMLDataGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCMIDLTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
FavorSizeOrSpeed="1"
|
|
||||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;"$(SOURCEMM16)\sourcehook""
|
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;ORANGEBOX_BUILD"
|
|
||||||
RuntimeLibrary="0"
|
|
||||||
EnableEnhancedInstructionSet="1"
|
|
||||||
RuntimeTypeInfo="false"
|
|
||||||
UsePrecompiledHeader="0"
|
|
||||||
WarningLevel="3"
|
|
||||||
Detect64BitPortabilityProblems="false"
|
|
||||||
DebugInformationFormat="3"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManagedResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreLinkEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCLinkerTool"
|
|
||||||
AdditionalDependencies="../lib_win/pcre.lib"
|
|
||||||
OutputFile="$(OutDir)\regex.ext.dll"
|
|
||||||
LinkIncremental="1"
|
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
|
||||||
GenerateDebugInformation="true"
|
|
||||||
SubSystem="2"
|
|
||||||
OptimizeReferences="2"
|
|
||||||
EnableCOMDATFolding="2"
|
|
||||||
TargetMachine="1"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCALinkTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManifestTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXDCMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCBscMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCFxCopTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCAppVerifierTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebDeploymentTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPostBuildEventTool"
|
|
||||||
/>
|
|
||||||
</Configuration>
|
|
||||||
</Configurations>
|
|
||||||
<References>
|
|
||||||
</References>
|
|
||||||
<Files>
|
|
||||||
<Filter
|
|
||||||
Name="Source Files"
|
|
||||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
|
||||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
|
||||||
>
|
|
||||||
<File
|
|
||||||
RelativePath="..\CRegEx.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\extension.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
</Filter>
|
|
||||||
<Filter
|
|
||||||
Name="Header Files"
|
|
||||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
|
||||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
|
||||||
>
|
|
||||||
<File
|
|
||||||
RelativePath="..\CRegEx.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\extension.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\pcre.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
</Filter>
|
|
||||||
<Filter
|
|
||||||
Name="Resource Files"
|
|
||||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
|
||||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
|
||||||
>
|
|
||||||
<File
|
|
||||||
RelativePath="..\version.rc"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
</Filter>
|
|
||||||
<Filter
|
|
||||||
Name="SourceMod SDK"
|
|
||||||
UniqueIdentifier="{31958233-BB2D-4e41-A8F9-CE8A4684F436}"
|
|
||||||
>
|
|
||||||
<File
|
|
||||||
RelativePath="..\sdk\smsdk_config.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\sdk\smsdk_ext.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\sdk\smsdk_ext.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
</Filter>
|
|
||||||
</Files>
|
|
||||||
<Globals>
|
|
||||||
</Globals>
|
|
||||||
</VisualStudioProject>
|
|
||||||
@@ -1,305 +0,0 @@
|
|||||||
/*************************************************
|
|
||||||
* Perl-Compatible Regular Expressions *
|
|
||||||
*************************************************/
|
|
||||||
|
|
||||||
/* This is the public header file for the PCRE library, to be #included by
|
|
||||||
applications that call the PCRE functions.
|
|
||||||
|
|
||||||
Copyright (c) 1997-2007 University of Cambridge
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived from
|
|
||||||
this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
-----------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _PCRE_H
|
|
||||||
#define _PCRE_H
|
|
||||||
|
|
||||||
/* The current PCRE version information. */
|
|
||||||
|
|
||||||
#define PCRE_MAJOR 7
|
|
||||||
#define PCRE_MINOR 4
|
|
||||||
#define PCRE_PRERELEASE
|
|
||||||
#define PCRE_DATE 2007-09-21
|
|
||||||
|
|
||||||
/* When an application links to a PCRE DLL in Windows, the symbols that are
|
|
||||||
imported have to be identified as such. When building PCRE, the appropriate
|
|
||||||
export setting is defined in pcre_internal.h, which includes this file. So we
|
|
||||||
don't change existing definitions of PCRE_EXP_DECL and PCRECPP_EXP_DECL. */
|
|
||||||
|
|
||||||
#define PCRE_STATIC
|
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(PCRE_STATIC)
|
|
||||||
# ifndef PCRE_EXP_DECL
|
|
||||||
# define PCRE_EXP_DECL extern __declspec(dllimport)
|
|
||||||
# endif
|
|
||||||
# ifdef __cplusplus
|
|
||||||
# ifndef PCRECPP_EXP_DECL
|
|
||||||
# define PCRECPP_EXP_DECL extern __declspec(dllimport)
|
|
||||||
# endif
|
|
||||||
# ifndef PCRECPP_EXP_DEFN
|
|
||||||
# define PCRECPP_EXP_DEFN __declspec(dllimport)
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* By default, we use the standard "extern" declarations. */
|
|
||||||
|
|
||||||
#ifndef PCRE_EXP_DECL
|
|
||||||
# ifdef __cplusplus
|
|
||||||
# define PCRE_EXP_DECL extern "C"
|
|
||||||
# else
|
|
||||||
# define PCRE_EXP_DECL extern
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
# ifndef PCRECPP_EXP_DECL
|
|
||||||
# define PCRECPP_EXP_DECL extern
|
|
||||||
# endif
|
|
||||||
# ifndef PCRECPP_EXP_DEFN
|
|
||||||
# define PCRECPP_EXP_DEFN
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Have to include stdlib.h in order to ensure that size_t is defined;
|
|
||||||
it is needed here for malloc. */
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/* Allow for C++ users */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Options */
|
|
||||||
|
|
||||||
#define PCRE_CASELESS 0x00000001
|
|
||||||
#define PCRE_MULTILINE 0x00000002
|
|
||||||
#define PCRE_DOTALL 0x00000004
|
|
||||||
#define PCRE_EXTENDED 0x00000008
|
|
||||||
#define PCRE_ANCHORED 0x00000010
|
|
||||||
#define PCRE_DOLLAR_ENDONLY 0x00000020
|
|
||||||
#define PCRE_EXTRA 0x00000040
|
|
||||||
#define PCRE_NOTBOL 0x00000080
|
|
||||||
#define PCRE_NOTEOL 0x00000100
|
|
||||||
#define PCRE_UNGREEDY 0x00000200
|
|
||||||
#define PCRE_NOTEMPTY 0x00000400
|
|
||||||
#define PCRE_UTF8 0x00000800
|
|
||||||
#define PCRE_NO_AUTO_CAPTURE 0x00001000
|
|
||||||
#define PCRE_NO_UTF8_CHECK 0x00002000
|
|
||||||
#define PCRE_AUTO_CALLOUT 0x00004000
|
|
||||||
#define PCRE_PARTIAL 0x00008000
|
|
||||||
#define PCRE_DFA_SHORTEST 0x00010000
|
|
||||||
#define PCRE_DFA_RESTART 0x00020000
|
|
||||||
#define PCRE_FIRSTLINE 0x00040000
|
|
||||||
#define PCRE_DUPNAMES 0x00080000
|
|
||||||
#define PCRE_NEWLINE_CR 0x00100000
|
|
||||||
#define PCRE_NEWLINE_LF 0x00200000
|
|
||||||
#define PCRE_NEWLINE_CRLF 0x00300000
|
|
||||||
#define PCRE_NEWLINE_ANY 0x00400000
|
|
||||||
#define PCRE_NEWLINE_ANYCRLF 0x00500000
|
|
||||||
#define PCRE_BSR_ANYCRLF 0x00800000
|
|
||||||
#define PCRE_BSR_UNICODE 0x01000000
|
|
||||||
|
|
||||||
/* Exec-time and get/set-time error codes */
|
|
||||||
|
|
||||||
#define PCRE_ERROR_NOMATCH (-1)
|
|
||||||
#define PCRE_ERROR_NULL (-2)
|
|
||||||
#define PCRE_ERROR_BADOPTION (-3)
|
|
||||||
#define PCRE_ERROR_BADMAGIC (-4)
|
|
||||||
#define PCRE_ERROR_UNKNOWN_OPCODE (-5)
|
|
||||||
#define PCRE_ERROR_UNKNOWN_NODE (-5) /* For backward compatibility */
|
|
||||||
#define PCRE_ERROR_NOMEMORY (-6)
|
|
||||||
#define PCRE_ERROR_NOSUBSTRING (-7)
|
|
||||||
#define PCRE_ERROR_MATCHLIMIT (-8)
|
|
||||||
#define PCRE_ERROR_CALLOUT (-9) /* Never used by PCRE itself */
|
|
||||||
#define PCRE_ERROR_BADUTF8 (-10)
|
|
||||||
#define PCRE_ERROR_BADUTF8_OFFSET (-11)
|
|
||||||
#define PCRE_ERROR_PARTIAL (-12)
|
|
||||||
#define PCRE_ERROR_BADPARTIAL (-13)
|
|
||||||
#define PCRE_ERROR_INTERNAL (-14)
|
|
||||||
#define PCRE_ERROR_BADCOUNT (-15)
|
|
||||||
#define PCRE_ERROR_DFA_UITEM (-16)
|
|
||||||
#define PCRE_ERROR_DFA_UCOND (-17)
|
|
||||||
#define PCRE_ERROR_DFA_UMLIMIT (-18)
|
|
||||||
#define PCRE_ERROR_DFA_WSSIZE (-19)
|
|
||||||
#define PCRE_ERROR_DFA_RECURSE (-20)
|
|
||||||
#define PCRE_ERROR_RECURSIONLIMIT (-21)
|
|
||||||
#define PCRE_ERROR_NULLWSLIMIT (-22) /* No longer actually used */
|
|
||||||
#define PCRE_ERROR_BADNEWLINE (-23)
|
|
||||||
|
|
||||||
/* Request types for pcre_fullinfo() */
|
|
||||||
|
|
||||||
#define PCRE_INFO_OPTIONS 0
|
|
||||||
#define PCRE_INFO_SIZE 1
|
|
||||||
#define PCRE_INFO_CAPTURECOUNT 2
|
|
||||||
#define PCRE_INFO_BACKREFMAX 3
|
|
||||||
#define PCRE_INFO_FIRSTBYTE 4
|
|
||||||
#define PCRE_INFO_FIRSTCHAR 4 /* For backwards compatibility */
|
|
||||||
#define PCRE_INFO_FIRSTTABLE 5
|
|
||||||
#define PCRE_INFO_LASTLITERAL 6
|
|
||||||
#define PCRE_INFO_NAMEENTRYSIZE 7
|
|
||||||
#define PCRE_INFO_NAMECOUNT 8
|
|
||||||
#define PCRE_INFO_NAMETABLE 9
|
|
||||||
#define PCRE_INFO_STUDYSIZE 10
|
|
||||||
#define PCRE_INFO_DEFAULT_TABLES 11
|
|
||||||
#define PCRE_INFO_OKPARTIAL 12
|
|
||||||
#define PCRE_INFO_JCHANGED 13
|
|
||||||
#define PCRE_INFO_HASCRORLF 14
|
|
||||||
|
|
||||||
/* Request types for pcre_config(). Do not re-arrange, in order to remain
|
|
||||||
compatible. */
|
|
||||||
|
|
||||||
#define PCRE_CONFIG_UTF8 0
|
|
||||||
#define PCRE_CONFIG_NEWLINE 1
|
|
||||||
#define PCRE_CONFIG_LINK_SIZE 2
|
|
||||||
#define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD 3
|
|
||||||
#define PCRE_CONFIG_MATCH_LIMIT 4
|
|
||||||
#define PCRE_CONFIG_STACKRECURSE 5
|
|
||||||
#define PCRE_CONFIG_UNICODE_PROPERTIES 6
|
|
||||||
#define PCRE_CONFIG_MATCH_LIMIT_RECURSION 7
|
|
||||||
#define PCRE_CONFIG_BSR 8
|
|
||||||
|
|
||||||
/* Bit flags for the pcre_extra structure. Do not re-arrange or redefine
|
|
||||||
these bits, just add new ones on the end, in order to remain compatible. */
|
|
||||||
|
|
||||||
#define PCRE_EXTRA_STUDY_DATA 0x0001
|
|
||||||
#define PCRE_EXTRA_MATCH_LIMIT 0x0002
|
|
||||||
#define PCRE_EXTRA_CALLOUT_DATA 0x0004
|
|
||||||
#define PCRE_EXTRA_TABLES 0x0008
|
|
||||||
#define PCRE_EXTRA_MATCH_LIMIT_RECURSION 0x0010
|
|
||||||
|
|
||||||
/* Types */
|
|
||||||
|
|
||||||
struct real_pcre; /* declaration; the definition is private */
|
|
||||||
typedef struct real_pcre pcre;
|
|
||||||
|
|
||||||
/* When PCRE is compiled as a C++ library, the subject pointer type can be
|
|
||||||
replaced with a custom type. For conventional use, the public interface is a
|
|
||||||
const char *. */
|
|
||||||
|
|
||||||
#ifndef PCRE_SPTR
|
|
||||||
#define PCRE_SPTR const char *
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The structure for passing additional data to pcre_exec(). This is defined in
|
|
||||||
such as way as to be extensible. Always add new fields at the end, in order to
|
|
||||||
remain compatible. */
|
|
||||||
|
|
||||||
typedef struct pcre_extra {
|
|
||||||
unsigned long int flags; /* Bits for which fields are set */
|
|
||||||
void *study_data; /* Opaque data from pcre_study() */
|
|
||||||
unsigned long int match_limit; /* Maximum number of calls to match() */
|
|
||||||
void *callout_data; /* Data passed back in callouts */
|
|
||||||
const unsigned char *tables; /* Pointer to character tables */
|
|
||||||
unsigned long int match_limit_recursion; /* Max recursive calls to match() */
|
|
||||||
} pcre_extra;
|
|
||||||
|
|
||||||
/* The structure for passing out data via the pcre_callout_function. We use a
|
|
||||||
structure so that new fields can be added on the end in future versions,
|
|
||||||
without changing the API of the function, thereby allowing old clients to work
|
|
||||||
without modification. */
|
|
||||||
|
|
||||||
typedef struct pcre_callout_block {
|
|
||||||
int version; /* Identifies version of block */
|
|
||||||
/* ------------------------ Version 0 ------------------------------- */
|
|
||||||
int callout_number; /* Number compiled into pattern */
|
|
||||||
int *offset_vector; /* The offset vector */
|
|
||||||
PCRE_SPTR subject; /* The subject being matched */
|
|
||||||
int subject_length; /* The length of the subject */
|
|
||||||
int start_match; /* Offset to start of this match attempt */
|
|
||||||
int current_position; /* Where we currently are in the subject */
|
|
||||||
int capture_top; /* Max current capture */
|
|
||||||
int capture_last; /* Most recently closed capture */
|
|
||||||
void *callout_data; /* Data passed in with the call */
|
|
||||||
/* ------------------- Added for Version 1 -------------------------- */
|
|
||||||
int pattern_position; /* Offset to next item in the pattern */
|
|
||||||
int next_item_length; /* Length of next item in the pattern */
|
|
||||||
/* ------------------------------------------------------------------ */
|
|
||||||
} pcre_callout_block;
|
|
||||||
|
|
||||||
/* Indirection for store get and free functions. These can be set to
|
|
||||||
alternative malloc/free functions if required. Special ones are used in the
|
|
||||||
non-recursive case for "frames". There is also an optional callout function
|
|
||||||
that is triggered by the (?) regex item. For Virtual Pascal, these definitions
|
|
||||||
have to take another form. */
|
|
||||||
|
|
||||||
#ifndef VPCOMPAT
|
|
||||||
PCRE_EXP_DECL void *(*pcre_malloc)(size_t);
|
|
||||||
PCRE_EXP_DECL void (*pcre_free)(void *);
|
|
||||||
PCRE_EXP_DECL void *(*pcre_stack_malloc)(size_t);
|
|
||||||
PCRE_EXP_DECL void (*pcre_stack_free)(void *);
|
|
||||||
PCRE_EXP_DECL int (*pcre_callout)(pcre_callout_block *);
|
|
||||||
#else /* VPCOMPAT */
|
|
||||||
PCRE_EXP_DECL void *pcre_malloc(size_t);
|
|
||||||
PCRE_EXP_DECL void pcre_free(void *);
|
|
||||||
PCRE_EXP_DECL void *pcre_stack_malloc(size_t);
|
|
||||||
PCRE_EXP_DECL void pcre_stack_free(void *);
|
|
||||||
PCRE_EXP_DECL int pcre_callout(pcre_callout_block *);
|
|
||||||
#endif /* VPCOMPAT */
|
|
||||||
|
|
||||||
/* Exported PCRE functions */
|
|
||||||
|
|
||||||
PCRE_EXP_DECL pcre *pcre_compile(const char *, int, const char **, int *,
|
|
||||||
const unsigned char *);
|
|
||||||
PCRE_EXP_DECL pcre *pcre_compile2(const char *, int, int *, const char **,
|
|
||||||
int *, const unsigned char *);
|
|
||||||
PCRE_EXP_DECL int pcre_config(int, void *);
|
|
||||||
PCRE_EXP_DECL int pcre_copy_named_substring(const pcre *, const char *,
|
|
||||||
int *, int, const char *, char *, int);
|
|
||||||
PCRE_EXP_DECL int pcre_copy_substring(const char *, int *, int, int, char *,
|
|
||||||
int);
|
|
||||||
PCRE_EXP_DECL int pcre_dfa_exec(const pcre *, const pcre_extra *,
|
|
||||||
const char *, int, int, int, int *, int , int *, int);
|
|
||||||
PCRE_EXP_DECL int pcre_exec(const pcre *, const pcre_extra *, PCRE_SPTR,
|
|
||||||
int, int, int, int *, int);
|
|
||||||
PCRE_EXP_DECL void pcre_free_substring(const char *);
|
|
||||||
PCRE_EXP_DECL void pcre_free_substring_list(const char **);
|
|
||||||
PCRE_EXP_DECL int pcre_fullinfo(const pcre *, const pcre_extra *, int,
|
|
||||||
void *);
|
|
||||||
PCRE_EXP_DECL int pcre_get_named_substring(const pcre *, const char *,
|
|
||||||
int *, int, const char *, const char **);
|
|
||||||
PCRE_EXP_DECL int pcre_get_stringnumber(const pcre *, const char *);
|
|
||||||
PCRE_EXP_DECL int pcre_get_stringtable_entries(const pcre *, const char *,
|
|
||||||
char **, char **);
|
|
||||||
PCRE_EXP_DECL int pcre_get_substring(const char *, int *, int, int,
|
|
||||||
const char **);
|
|
||||||
PCRE_EXP_DECL int pcre_get_substring_list(const char *, int *, int,
|
|
||||||
const char ***);
|
|
||||||
PCRE_EXP_DECL int pcre_info(const pcre *, int *, int *);
|
|
||||||
PCRE_EXP_DECL const unsigned char *pcre_maketables(void);
|
|
||||||
PCRE_EXP_DECL int pcre_refcount(pcre *, int);
|
|
||||||
PCRE_EXP_DECL pcre_extra *pcre_study(const pcre *, int, const char **);
|
|
||||||
PCRE_EXP_DECL const char *pcre_version(void);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* End of pcre.h */
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
/**
|
|
||||||
* vim: set ts=4 :
|
|
||||||
* =============================================================================
|
|
||||||
* SourceMod Regular Expressions Extension
|
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
|
||||||
* =============================================================================
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
|
||||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
||||||
* Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
* details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
||||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
||||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
||||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
||||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
||||||
* this exception to all derivative works. AlliedModders LLC defines further
|
|
||||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
||||||
* or <http://www.sourcemod.net/license.php>.
|
|
||||||
*
|
|
||||||
* Version: $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_
|
|
||||||
#define _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_
|
|
||||||
|
|
||||||
#include "svn_version.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file smsdk_config.h
|
|
||||||
* @brief Contains macros for configuring basic extension information.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Basic information exposed publicly */
|
|
||||||
#define SMEXT_CONF_NAME "Regex"
|
|
||||||
#define SMEXT_CONF_DESCRIPTION "Provides regex natives for plugins"
|
|
||||||
#define SMEXT_CONF_VERSION SVN_FULL_VERSION
|
|
||||||
#define SMEXT_CONF_AUTHOR "AlliedModders LLC"
|
|
||||||
#define SMEXT_CONF_URL "http://www.sourcemod.net/"
|
|
||||||
#define SMEXT_CONF_LOGTAG "REGEX"
|
|
||||||
#define SMEXT_CONF_LICENSE "GPL"
|
|
||||||
#define SMEXT_CONF_DATESTRING __DATE__
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Exposes plugin's main interface.
|
|
||||||
*/
|
|
||||||
#define SMEXT_LINK(name) SDKExtension *g_pExtensionIface = name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Sets whether or not this plugin required Metamod.
|
|
||||||
* NOTE: Uncomment to enable, comment to disable.
|
|
||||||
*/
|
|
||||||
//#define SMEXT_CONF_METAMOD
|
|
||||||
|
|
||||||
/** Enable interfaces you want to use here by uncommenting lines */
|
|
||||||
//#define SMEXT_ENABLE_FORWARDSYS
|
|
||||||
#define SMEXT_ENABLE_HANDLESYS
|
|
||||||
//#define SMEXT_ENABLE_PLAYERHELPERS
|
|
||||||
//#define SMEXT_ENABLE_DBMANAGER
|
|
||||||
//#define SMEXT_ENABLE_GAMECONF
|
|
||||||
//#define SMEXT_ENABLE_MEMUTILS
|
|
||||||
//#define SMEXT_ENABLE_GAMEHELPERS
|
|
||||||
//#define SMEXT_ENABLE_TIMERSYS
|
|
||||||
//#define SMEXT_ENABLE_THREADER
|
|
||||||
//#define SMEXT_ENABLE_LIBSYS
|
|
||||||
//#define SMEXT_ENABLE_MENUS
|
|
||||||
//#define SMEXT_ENABLE_ADTFACTORY
|
|
||||||
//#define SMEXT_ENABLE_PLUGINSYS
|
|
||||||
//#define SMEXT_ENABLE_ADMINSYS
|
|
||||||
//#define SMEXT_ENABLE_TEXTPARSERS
|
|
||||||
//#define SMEXT_ENABLE_USERMSGS
|
|
||||||
|
|
||||||
#endif // _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_
|
|
||||||
@@ -1,455 +0,0 @@
|
|||||||
/**
|
|
||||||
* vim: set ts=4 :
|
|
||||||
* =============================================================================
|
|
||||||
* SourceMod Base Extension Code
|
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
|
||||||
* =============================================================================
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
|
||||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
||||||
* Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
* details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
||||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
||||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
||||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
||||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
||||||
* this exception to all derivative works. AlliedModders LLC defines further
|
|
||||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
||||||
* or <http://www.sourcemod.net/license.php>.
|
|
||||||
*
|
|
||||||
* Version: $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <malloc.h>
|
|
||||||
#include "smsdk_ext.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file smsdk_ext.cpp
|
|
||||||
* @brief Contains wrappers for making Extensions easier to write.
|
|
||||||
*/
|
|
||||||
|
|
||||||
IExtension *myself = NULL; /**< Ourself */
|
|
||||||
IShareSys *g_pShareSys = NULL; /**< Share system */
|
|
||||||
IShareSys *sharesys = NULL; /**< Share system */
|
|
||||||
ISourceMod *g_pSM = NULL; /**< SourceMod helpers */
|
|
||||||
ISourceMod *smutils = NULL; /**< SourceMod helpers */
|
|
||||||
|
|
||||||
#if defined SMEXT_ENABLE_FORWARDSYS
|
|
||||||
IForwardManager *g_pForwards = NULL; /**< Forward system */
|
|
||||||
IForwardManager *forwards = NULL; /**< Forward system */
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_HANDLESYS
|
|
||||||
IHandleSys *g_pHandleSys = NULL; /**< Handle system */
|
|
||||||
IHandleSys *handlesys = NULL; /**< Handle system */
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_PLAYERHELPERS
|
|
||||||
IPlayerManager *playerhelpers = NULL; /**< Player helpers */
|
|
||||||
#endif //SMEXT_ENABLE_PLAYERHELPERS
|
|
||||||
#if defined SMEXT_ENABLE_DBMANAGER
|
|
||||||
IDBManager *dbi = NULL; /**< DB Manager */
|
|
||||||
#endif //SMEXT_ENABLE_DBMANAGER
|
|
||||||
#if defined SMEXT_ENABLE_GAMECONF
|
|
||||||
IGameConfigManager *gameconfs = NULL; /**< Game config manager */
|
|
||||||
#endif //SMEXT_ENABLE_DBMANAGER
|
|
||||||
#if defined SMEXT_ENABLE_MEMUTILS
|
|
||||||
IMemoryUtils *memutils = NULL;
|
|
||||||
#endif //SMEXT_ENABLE_DBMANAGER
|
|
||||||
#if defined SMEXT_ENABLE_GAMEHELPERS
|
|
||||||
IGameHelpers *gamehelpers = NULL;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_TIMERSYS
|
|
||||||
ITimerSystem *timersys = NULL;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_ADTFACTORY
|
|
||||||
IADTFactory *adtfactory = NULL;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_THREADER
|
|
||||||
IThreader *threader = NULL;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_LIBSYS
|
|
||||||
ILibrarySys *libsys = NULL;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_PLUGINSYS
|
|
||||||
SourceMod::IPluginManager *plsys;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_MENUS
|
|
||||||
IMenuManager *menus = NULL;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_ADMINSYS
|
|
||||||
IAdminSystem *adminsys = NULL;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_TEXTPARSERS
|
|
||||||
ITextParsers *textparsers = NULL;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_USERMSGS
|
|
||||||
IUserMessages *usermsgs = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Exports the main interface */
|
|
||||||
PLATFORM_EXTERN_C IExtensionInterface *GetSMExtAPI()
|
|
||||||
{
|
|
||||||
return g_pExtensionIface;
|
|
||||||
}
|
|
||||||
|
|
||||||
SDKExtension::SDKExtension()
|
|
||||||
{
|
|
||||||
#if defined SMEXT_CONF_METAMOD
|
|
||||||
m_SourceMMLoaded = false;
|
|
||||||
m_WeAreUnloaded = false;
|
|
||||||
m_WeGotPauseChange = false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SDKExtension::OnExtensionLoad(IExtension *me, IShareSys *sys, char *error, size_t maxlength, bool late)
|
|
||||||
{
|
|
||||||
g_pShareSys = sharesys = sys;
|
|
||||||
myself = me;
|
|
||||||
|
|
||||||
#if defined SMEXT_CONF_METAMOD
|
|
||||||
m_WeAreUnloaded = true;
|
|
||||||
|
|
||||||
if (!m_SourceMMLoaded)
|
|
||||||
{
|
|
||||||
if (error)
|
|
||||||
{
|
|
||||||
snprintf(error, maxlength, "Metamod attach failed");
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
SM_GET_IFACE(SOURCEMOD, g_pSM);
|
|
||||||
smutils = g_pSM;
|
|
||||||
#if defined SMEXT_ENABLE_HANDLESYS
|
|
||||||
SM_GET_IFACE(HANDLESYSTEM, g_pHandleSys);
|
|
||||||
handlesys = g_pHandleSys;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_FORWARDSYS
|
|
||||||
SM_GET_IFACE(FORWARDMANAGER, g_pForwards);
|
|
||||||
forwards = g_pForwards;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_PLAYERHELPERS
|
|
||||||
SM_GET_IFACE(PLAYERMANAGER, playerhelpers);
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_DBMANAGER
|
|
||||||
SM_GET_IFACE(DBI, dbi);
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_GAMECONF
|
|
||||||
SM_GET_IFACE(GAMECONFIG, gameconfs);
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_MEMUTILS
|
|
||||||
SM_GET_IFACE(MEMORYUTILS, memutils);
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_GAMEHELPERS
|
|
||||||
SM_GET_IFACE(GAMEHELPERS, gamehelpers);
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_TIMERSYS
|
|
||||||
SM_GET_IFACE(TIMERSYS, timersys);
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_ADTFACTORY
|
|
||||||
SM_GET_IFACE(ADTFACTORY, adtfactory);
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_THREADER
|
|
||||||
SM_GET_IFACE(THREADER, threader);
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_LIBSYS
|
|
||||||
SM_GET_IFACE(LIBRARYSYS, libsys);
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_PLUGINSYS
|
|
||||||
SM_GET_IFACE(PLUGINSYSTEM, plsys);
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_MENUS
|
|
||||||
SM_GET_IFACE(MENUMANAGER, menus);
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_ADMINSYS
|
|
||||||
SM_GET_IFACE(ADMINSYS, adminsys);
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_TEXTPARSERS
|
|
||||||
SM_GET_IFACE(TEXTPARSERS, textparsers);
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_USERMSGS
|
|
||||||
SM_GET_IFACE(USERMSGS, usermsgs);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (SDK_OnLoad(error, maxlength, late))
|
|
||||||
{
|
|
||||||
#if defined SMEXT_CONF_METAMOD
|
|
||||||
m_WeAreUnloaded = true;
|
|
||||||
#endif
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SDKExtension::IsMetamodExtension()
|
|
||||||
{
|
|
||||||
#if defined SMEXT_CONF_METAMOD
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void SDKExtension::OnExtensionPauseChange(bool state)
|
|
||||||
{
|
|
||||||
#if defined SMEXT_CONF_METAMOD
|
|
||||||
m_WeGotPauseChange = true;
|
|
||||||
#endif
|
|
||||||
SDK_OnPauseChange(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SDKExtension::OnExtensionsAllLoaded()
|
|
||||||
{
|
|
||||||
SDK_OnAllLoaded();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SDKExtension::OnExtensionUnload()
|
|
||||||
{
|
|
||||||
#if defined SMEXT_CONF_METAMOD
|
|
||||||
m_WeAreUnloaded = true;
|
|
||||||
#endif
|
|
||||||
SDK_OnUnload();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *SDKExtension::GetExtensionAuthor()
|
|
||||||
{
|
|
||||||
return SMEXT_CONF_AUTHOR;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *SDKExtension::GetExtensionDateString()
|
|
||||||
{
|
|
||||||
return SMEXT_CONF_DATESTRING;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *SDKExtension::GetExtensionDescription()
|
|
||||||
{
|
|
||||||
return SMEXT_CONF_DESCRIPTION;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *SDKExtension::GetExtensionVerString()
|
|
||||||
{
|
|
||||||
return SMEXT_CONF_VERSION;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *SDKExtension::GetExtensionName()
|
|
||||||
{
|
|
||||||
return SMEXT_CONF_NAME;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *SDKExtension::GetExtensionTag()
|
|
||||||
{
|
|
||||||
return SMEXT_CONF_LOGTAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *SDKExtension::GetExtensionURL()
|
|
||||||
{
|
|
||||||
return SMEXT_CONF_URL;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SDKExtension::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SDKExtension::SDK_OnUnload()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void SDKExtension::SDK_OnPauseChange(bool paused)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void SDKExtension::SDK_OnAllLoaded()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined SMEXT_CONF_METAMOD
|
|
||||||
|
|
||||||
PluginId g_PLID = 0; /**< Metamod plugin ID */
|
|
||||||
ISmmPlugin *g_PLAPI = NULL; /**< Metamod plugin API */
|
|
||||||
SourceHook::ISourceHook *g_SHPtr = NULL; /**< SourceHook pointer */
|
|
||||||
ISmmAPI *g_SMAPI = NULL; /**< SourceMM API pointer */
|
|
||||||
|
|
||||||
IVEngineServer *engine = NULL; /**< IVEngineServer pointer */
|
|
||||||
IServerGameDLL *gamedll = NULL; /**< IServerGameDLL pointer */
|
|
||||||
|
|
||||||
/** Exposes the extension to Metamod */
|
|
||||||
SMM_API void *PL_EXPOSURE(const char *name, int *code)
|
|
||||||
{
|
|
||||||
#if defined METAMOD_PLAPI_VERSION
|
|
||||||
if (name && !strcmp(name, METAMOD_PLAPI_NAME))
|
|
||||||
#else
|
|
||||||
if (name && !strcmp(name, PLAPI_NAME))
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
if (code)
|
|
||||||
{
|
|
||||||
*code = IFACE_OK;
|
|
||||||
}
|
|
||||||
return static_cast<void *>(g_pExtensionIface);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (code)
|
|
||||||
{
|
|
||||||
*code = IFACE_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SDKExtension::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late)
|
|
||||||
{
|
|
||||||
PLUGIN_SAVEVARS();
|
|
||||||
|
|
||||||
#if defined METAMOD_PLAPI_VERSION
|
|
||||||
GET_V_IFACE_ANY(serverFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
|
|
||||||
GET_V_IFACE_CURRENT(engineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
|
|
||||||
#else
|
|
||||||
GET_V_IFACE_ANY(GetServerFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
|
|
||||||
GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_SourceMMLoaded = true;
|
|
||||||
|
|
||||||
return SDK_OnMetamodLoad(ismm, error, maxlen, late);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SDKExtension::Unload(char *error, size_t maxlen)
|
|
||||||
{
|
|
||||||
if (!m_WeAreUnloaded)
|
|
||||||
{
|
|
||||||
if (error)
|
|
||||||
{
|
|
||||||
snprintf(error, maxlen, "This extension must be unloaded by SourceMod.");
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SDK_OnMetamodUnload(error, maxlen);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SDKExtension::Pause(char *error, size_t maxlen)
|
|
||||||
{
|
|
||||||
if (!m_WeGotPauseChange)
|
|
||||||
{
|
|
||||||
if (error)
|
|
||||||
{
|
|
||||||
snprintf(error, maxlen, "This extension must be paused by SourceMod.");
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_WeGotPauseChange = false;
|
|
||||||
|
|
||||||
return SDK_OnMetamodPauseChange(true, error, maxlen);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SDKExtension::Unpause(char *error, size_t maxlen)
|
|
||||||
{
|
|
||||||
if (!m_WeGotPauseChange)
|
|
||||||
{
|
|
||||||
if (error)
|
|
||||||
{
|
|
||||||
snprintf(error, maxlen, "This extension must be unpaused by SourceMod.");
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_WeGotPauseChange = false;
|
|
||||||
|
|
||||||
return SDK_OnMetamodPauseChange(false, error, maxlen);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *SDKExtension::GetAuthor()
|
|
||||||
{
|
|
||||||
return GetExtensionAuthor();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *SDKExtension::GetDate()
|
|
||||||
{
|
|
||||||
return GetExtensionDateString();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *SDKExtension::GetDescription()
|
|
||||||
{
|
|
||||||
return GetExtensionDescription();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *SDKExtension::GetLicense()
|
|
||||||
{
|
|
||||||
return SMEXT_CONF_LICENSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *SDKExtension::GetLogTag()
|
|
||||||
{
|
|
||||||
return GetExtensionTag();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *SDKExtension::GetName()
|
|
||||||
{
|
|
||||||
return GetExtensionName();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *SDKExtension::GetURL()
|
|
||||||
{
|
|
||||||
return GetExtensionURL();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *SDKExtension::GetVersion()
|
|
||||||
{
|
|
||||||
return GetExtensionVerString();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SDKExtension::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlength, bool late)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SDKExtension::SDK_OnMetamodUnload(char *error, size_t maxlength)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SDKExtension::SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlength)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Overload a few things to prevent libstdc++ linking */
|
|
||||||
#if defined __linux__
|
|
||||||
extern "C" void __cxa_pure_virtual(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void *operator new(size_t size)
|
|
||||||
{
|
|
||||||
return malloc(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void *operator new[](size_t size)
|
|
||||||
{
|
|
||||||
return malloc(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator delete(void *ptr)
|
|
||||||
{
|
|
||||||
free(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator delete[](void * ptr)
|
|
||||||
{
|
|
||||||
free(ptr);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -1,327 +0,0 @@
|
|||||||
/**
|
|
||||||
* vim: set ts=4 :
|
|
||||||
* =============================================================================
|
|
||||||
* SourceMod Base Extension Code
|
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
|
||||||
* =============================================================================
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
|
||||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
||||||
* Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
* details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
||||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
||||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
||||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
||||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
||||||
* this exception to all derivative works. AlliedModders LLC defines further
|
|
||||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
||||||
* or <http://www.sourcemod.net/license.php>.
|
|
||||||
*
|
|
||||||
* Version: $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
|
||||||
#define _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file smsdk_ext.h
|
|
||||||
* @brief Contains wrappers for making Extensions easier to write.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "smsdk_config.h"
|
|
||||||
#include <IExtensionSys.h>
|
|
||||||
#include <IHandleSys.h>
|
|
||||||
#include <sp_vm_api.h>
|
|
||||||
#include <sm_platform.h>
|
|
||||||
#include <ISourceMod.h>
|
|
||||||
#if defined SMEXT_ENABLE_FORWARDSYS
|
|
||||||
#include <IForwardSys.h>
|
|
||||||
#endif //SMEXT_ENABLE_FORWARDSYS
|
|
||||||
#if defined SMEXT_ENABLE_PLAYERHELPERS
|
|
||||||
#include <IPlayerHelpers.h>
|
|
||||||
#endif //SMEXT_ENABLE_PlAYERHELPERS
|
|
||||||
#if defined SMEXT_ENABLE_DBMANAGER
|
|
||||||
#include <IDBDriver.h>
|
|
||||||
#endif //SMEXT_ENABLE_DBMANAGER
|
|
||||||
#if defined SMEXT_ENABLE_GAMECONF
|
|
||||||
#include <IGameConfigs.h>
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_MEMUTILS
|
|
||||||
#include <IMemoryUtils.h>
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_GAMEHELPERS
|
|
||||||
#include <IGameHelpers.h>
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_TIMERSYS
|
|
||||||
#include <ITimerSystem.h>
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_ADTFACTORY
|
|
||||||
#include <IADTFactory.h>
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_THREADER
|
|
||||||
#include <IThreader.h>
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_LIBSYS
|
|
||||||
#include <ILibrarySys.h>
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_PLUGINSYS
|
|
||||||
#include <IPluginSys.h>
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_MENUS
|
|
||||||
#include <IMenuManager.h>
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_ADMINSYS
|
|
||||||
#include <IAdminSystem.h>
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_TEXTPARSERS
|
|
||||||
#include <ITextParsers.h>
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_USERMSGS
|
|
||||||
#include <IUserMessages.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined SMEXT_CONF_METAMOD
|
|
||||||
#include <ISmmPlugin.h>
|
|
||||||
#include <eiface.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace SourceMod;
|
|
||||||
using namespace SourcePawn;
|
|
||||||
|
|
||||||
class SDKExtension :
|
|
||||||
#if defined SMEXT_CONF_METAMOD
|
|
||||||
public ISmmPlugin,
|
|
||||||
#endif
|
|
||||||
public IExtensionInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/** Constructor */
|
|
||||||
SDKExtension();
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* @brief This is called after the initial loading sequence has been processed.
|
|
||||||
*
|
|
||||||
* @param error Error message buffer.
|
|
||||||
* @param maxlength Size of error message buffer.
|
|
||||||
* @param late Whether or not the module was loaded after map load.
|
|
||||||
* @return True to succeed loading, false to fail.
|
|
||||||
*/
|
|
||||||
virtual bool SDK_OnLoad(char *error, size_t maxlength, bool late);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief This is called right before the extension is unloaded.
|
|
||||||
*/
|
|
||||||
virtual void SDK_OnUnload();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief This is called once all known extensions have been loaded.
|
|
||||||
*/
|
|
||||||
virtual void SDK_OnAllLoaded();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Called when the pause state is changed.
|
|
||||||
*/
|
|
||||||
virtual void SDK_OnPauseChange(bool paused);
|
|
||||||
|
|
||||||
#if defined SMEXT_CONF_METAMOD
|
|
||||||
/**
|
|
||||||
* @brief Called when Metamod is attached, before the extension version is called.
|
|
||||||
*
|
|
||||||
* @param error Error buffer.
|
|
||||||
* @param maxlength Maximum size of error buffer.
|
|
||||||
* @param late Whether or not Metamod considers this a late load.
|
|
||||||
* @return True to succeed, false to fail.
|
|
||||||
*/
|
|
||||||
virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlength, bool late);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Called when Metamod is detaching, after the extension version is called.
|
|
||||||
* NOTE: By default this is blocked unless sent from SourceMod.
|
|
||||||
*
|
|
||||||
* @param error Error buffer.
|
|
||||||
* @param maxlength Maximum size of error buffer.
|
|
||||||
* @return True to succeed, false to fail.
|
|
||||||
*/
|
|
||||||
virtual bool SDK_OnMetamodUnload(char *error, size_t maxlength);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Called when Metamod's pause state is changing.
|
|
||||||
* NOTE: By default this is blocked unless sent from SourceMod.
|
|
||||||
*
|
|
||||||
* @param paused Pause state being set.
|
|
||||||
* @param error Error buffer.
|
|
||||||
* @param maxlength Maximum size of error buffer.
|
|
||||||
* @return True to succeed, false to fail.
|
|
||||||
*/
|
|
||||||
virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlength);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public: //IExtensionInterface
|
|
||||||
virtual bool OnExtensionLoad(IExtension *me, IShareSys *sys, char *error, size_t maxlength, bool late);
|
|
||||||
virtual void OnExtensionUnload();
|
|
||||||
virtual void OnExtensionsAllLoaded();
|
|
||||||
|
|
||||||
/** Returns whether or not this is a Metamod-based extension */
|
|
||||||
virtual bool IsMetamodExtension();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Called when the pause state changes.
|
|
||||||
*
|
|
||||||
* @param state True if being paused, false if being unpaused.
|
|
||||||
*/
|
|
||||||
virtual void OnExtensionPauseChange(bool state);
|
|
||||||
|
|
||||||
/** Returns name */
|
|
||||||
virtual const char *GetExtensionName();
|
|
||||||
/** Returns URL */
|
|
||||||
virtual const char *GetExtensionURL();
|
|
||||||
/** Returns log tag */
|
|
||||||
virtual const char *GetExtensionTag();
|
|
||||||
/** Returns author */
|
|
||||||
virtual const char *GetExtensionAuthor();
|
|
||||||
/** Returns version string */
|
|
||||||
virtual const char *GetExtensionVerString();
|
|
||||||
/** Returns description string */
|
|
||||||
virtual const char *GetExtensionDescription();
|
|
||||||
/** Returns date string */
|
|
||||||
virtual const char *GetExtensionDateString();
|
|
||||||
#if defined SMEXT_CONF_METAMOD
|
|
||||||
public: //ISmmPlugin
|
|
||||||
/** Called when the extension is attached to Metamod. */
|
|
||||||
virtual bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlength, bool late);
|
|
||||||
/** Returns the author to MM */
|
|
||||||
virtual const char *GetAuthor();
|
|
||||||
/** Returns the name to MM */
|
|
||||||
virtual const char *GetName();
|
|
||||||
/** Returns the description to MM */
|
|
||||||
virtual const char *GetDescription();
|
|
||||||
/** Returns the URL to MM */
|
|
||||||
virtual const char *GetURL();
|
|
||||||
/** Returns the license to MM */
|
|
||||||
virtual const char *GetLicense();
|
|
||||||
/** Returns the version string to MM */
|
|
||||||
virtual const char *GetVersion();
|
|
||||||
/** Returns the date string to MM */
|
|
||||||
virtual const char *GetDate();
|
|
||||||
/** Returns the logtag to MM */
|
|
||||||
virtual const char *GetLogTag();
|
|
||||||
/** Called on unload */
|
|
||||||
virtual bool Unload(char *error, size_t maxlength);
|
|
||||||
/** Called on pause */
|
|
||||||
virtual bool Pause(char *error, size_t maxlength);
|
|
||||||
/** Called on unpause */
|
|
||||||
virtual bool Unpause(char *error, size_t maxlength);
|
|
||||||
private:
|
|
||||||
bool m_SourceMMLoaded;
|
|
||||||
bool m_WeAreUnloaded;
|
|
||||||
bool m_WeGotPauseChange;
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
extern SDKExtension *g_pExtensionIface;
|
|
||||||
extern IExtension *myself;
|
|
||||||
|
|
||||||
extern IShareSys *g_pShareSys;
|
|
||||||
extern IShareSys *sharesys; /* Note: Newer name */
|
|
||||||
extern ISourceMod *g_pSM;
|
|
||||||
extern ISourceMod *smutils; /* Note: Newer name */
|
|
||||||
|
|
||||||
/* Optional interfaces are below */
|
|
||||||
#if defined SMEXT_ENABLE_FORWARDSYS
|
|
||||||
extern IForwardManager *g_pForwards;
|
|
||||||
extern IForwardManager *forwards; /* Note: Newer name */
|
|
||||||
#endif //SMEXT_ENABLE_FORWARDSYS
|
|
||||||
#if defined SMEXT_ENABLE_HANDLESYS
|
|
||||||
extern IHandleSys *g_pHandleSys;
|
|
||||||
extern IHandleSys *handlesys; /* Note: Newer name */
|
|
||||||
#endif //SMEXT_ENABLE_HANDLESYS
|
|
||||||
#if defined SMEXT_ENABLE_PLAYERHELPERS
|
|
||||||
extern IPlayerManager *playerhelpers;
|
|
||||||
#endif //SMEXT_ENABLE_PLAYERHELPERS
|
|
||||||
#if defined SMEXT_ENABLE_DBMANAGER
|
|
||||||
extern IDBManager *dbi;
|
|
||||||
#endif //SMEXT_ENABLE_DBMANAGER
|
|
||||||
#if defined SMEXT_ENABLE_GAMECONF
|
|
||||||
extern IGameConfigManager *gameconfs;
|
|
||||||
#endif //SMEXT_ENABLE_DBMANAGER
|
|
||||||
#if defined SMEXT_ENABLE_MEMUTILS
|
|
||||||
extern IMemoryUtils *memutils;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_GAMEHELPERS
|
|
||||||
extern IGameHelpers *gamehelpers;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_TIMERSYS
|
|
||||||
extern ITimerSystem *timersys;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_ADTFACTORY
|
|
||||||
extern IADTFactory *adtfactory;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_THREADER
|
|
||||||
extern IThreader *threader;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_LIBSYS
|
|
||||||
extern ILibrarySys *libsys;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_PLUGINSYS
|
|
||||||
extern SourceMod::IPluginManager *plsys;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_MENUS
|
|
||||||
extern IMenuManager *menus;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_ADMINSYS
|
|
||||||
extern IAdminSystem *adminsys;
|
|
||||||
#endif
|
|
||||||
#if defined SMEXT_ENABLE_USERMSGS
|
|
||||||
extern IUserMessages *usermsgs;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined SMEXT_CONF_METAMOD
|
|
||||||
PLUGIN_GLOBALVARS();
|
|
||||||
extern IVEngineServer *engine;
|
|
||||||
extern IServerGameDLL *gamedll;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Creates a SourceMod interface macro pair */
|
|
||||||
#define SM_MKIFACE(name) SMINTERFACE_##name##_NAME, SMINTERFACE_##name##_VERSION
|
|
||||||
/** Automates retrieving SourceMod interfaces */
|
|
||||||
#define SM_GET_IFACE(prefix, addr) \
|
|
||||||
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) \
|
|
||||||
{ \
|
|
||||||
if (error != NULL && maxlength) \
|
|
||||||
{ \
|
|
||||||
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
|
||||||
if (len >= maxlength) \
|
|
||||||
{ \
|
|
||||||
error[maxlength - 1] = '\0'; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
return false; \
|
|
||||||
}
|
|
||||||
/** Automates retrieving SourceMod interfaces when needed outside of SDK_OnLoad() */
|
|
||||||
#define SM_GET_LATE_IFACE(prefix, addr) \
|
|
||||||
g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)
|
|
||||||
/** Validates a SourceMod interface pointer */
|
|
||||||
#define SM_CHECK_IFACE(prefix, addr) \
|
|
||||||
if (!addr) \
|
|
||||||
{ \
|
|
||||||
if (error != NULL && maxlength) \
|
|
||||||
{ \
|
|
||||||
size_t len = snprintf(error, maxlength, "Could not find interface: %s", SMINTERFACE_##prefix##_NAME); \
|
|
||||||
if (len >= maxlength) \
|
|
||||||
{ \
|
|
||||||
error[maxlength - 1] = '\0'; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
return false; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
/**
|
|
||||||
* vim: set ts=4 :
|
|
||||||
* =============================================================================
|
|
||||||
* SourceMod Regular Expressions Extension
|
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
|
||||||
* =============================================================================
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
|
||||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
||||||
* Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
* details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
||||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
||||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
||||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
||||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
||||||
* this exception to all derivative works. AlliedModders LLC defines further
|
|
||||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
||||||
* or <http://www.sourcemod.net/license.php>.
|
|
||||||
*
|
|
||||||
* Version: $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Autogenerated by build scripts
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _INCLUDE_REGEXEXT_VERSION_H_
|
|
||||||
#define _INCLUDE_REGEXEXT_VERSION_H_
|
|
||||||
|
|
||||||
#define SVN_FULL_VERSION "1.0.2.2236"
|
|
||||||
#define SVN_FILE_VERSION 1,0,2,2236
|
|
||||||
|
|
||||||
#endif //_INCLUDE_REGEXEXT_VERSION_H_
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
/**
|
|
||||||
* vim: set ts=4 :
|
|
||||||
* =============================================================================
|
|
||||||
* SourceMod Regular Expressions Extension
|
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
|
||||||
* =============================================================================
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
|
||||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
||||||
* Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
* details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
||||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
||||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
||||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
||||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
||||||
* this exception to all derivative works. AlliedModders LLC defines further
|
|
||||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
||||||
* or <http://www.sourcemod.net/license.php>.
|
|
||||||
*
|
|
||||||
* Version: $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Autogenerated by build scripts
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _INCLUDE_REGEXEXT_VERSION_H_
|
|
||||||
#define _INCLUDE_REGEXEXT_VERSION_H_
|
|
||||||
|
|
||||||
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
|
|
||||||
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
|
|
||||||
|
|
||||||
#endif //_INCLUDE_REGEXEXT_VERSION_H_
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
// Microsoft Visual C++ generated resource script.
|
|
||||||
//
|
|
||||||
//#include "resource.h"
|
|
||||||
|
|
||||||
#define APSTUDIO_READONLY_SYMBOLS
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Generated from the TEXTINCLUDE 2 resource.
|
|
||||||
//
|
|
||||||
#include "winres.h"
|
|
||||||
|
|
||||||
#include "svn_version.h"
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
#undef APSTUDIO_READONLY_SYMBOLS
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// English (U.S.) resources
|
|
||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
|
||||||
#ifdef _WIN32
|
|
||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
|
||||||
#pragma code_page(1252)
|
|
||||||
#endif //_WIN32
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Version
|
|
||||||
//
|
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
|
||||||
FILEVERSION SVN_FILE_VERSION
|
|
||||||
PRODUCTVERSION SVN_FILE_VERSION
|
|
||||||
FILEFLAGSMASK 0x17L
|
|
||||||
#ifdef _DEBUG
|
|
||||||
FILEFLAGS 0x1L
|
|
||||||
#else
|
|
||||||
FILEFLAGS 0x0L
|
|
||||||
#endif
|
|
||||||
FILEOS 0x4L
|
|
||||||
FILETYPE 0x2L
|
|
||||||
FILESUBTYPE 0x0L
|
|
||||||
BEGIN
|
|
||||||
BLOCK "StringFileInfo"
|
|
||||||
BEGIN
|
|
||||||
BLOCK "000004b0"
|
|
||||||
BEGIN
|
|
||||||
VALUE "Comments", "SourceMod Regular Expression Extension"
|
|
||||||
VALUE "FileDescription", "SourceMod Regular Expression Extension"
|
|
||||||
VALUE "FileVersion", SVN_FULL_VERSION
|
|
||||||
VALUE "InternalName", "SourceMod Regular Expression Extension"
|
|
||||||
VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC"
|
|
||||||
VALUE "OriginalFilename", "regex.ext.dll"
|
|
||||||
VALUE "ProductName", "SourceMod Regular Expression Extension"
|
|
||||||
VALUE "ProductVersion", SVN_FULL_VERSION
|
|
||||||
END
|
|
||||||
END
|
|
||||||
BLOCK "VarFileInfo"
|
|
||||||
BEGIN
|
|
||||||
VALUE "Translation", 0x0, 1200
|
|
||||||
END
|
|
||||||
END
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// TEXTINCLUDE
|
|
||||||
//
|
|
||||||
|
|
||||||
1 TEXTINCLUDE
|
|
||||||
BEGIN
|
|
||||||
"resource.h\0"
|
|
||||||
END
|
|
||||||
|
|
||||||
2 TEXTINCLUDE
|
|
||||||
BEGIN
|
|
||||||
"#include ""winres.h""\r\n"
|
|
||||||
"\0"
|
|
||||||
END
|
|
||||||
|
|
||||||
3 TEXTINCLUDE
|
|
||||||
BEGIN
|
|
||||||
"\r\n"
|
|
||||||
"\0"
|
|
||||||
END
|
|
||||||
|
|
||||||
#endif // APSTUDIO_INVOKED
|
|
||||||
|
|
||||||
#endif // English (U.S.) resources
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef APSTUDIO_INVOKED
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Generated from the TEXTINCLUDE 3 resource.
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
#endif // not APSTUDIO_INVOKED
|
|
||||||
|
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
# (C)2004-2008 SourceMod Development Team
|
#(C)2004-2006 SourceMM Development Team
|
||||||
# Makefile written by David "BAILOPAN" Anderson
|
# Makefile written by David "BAILOPAN" Anderson
|
||||||
|
|
||||||
SMSDK = ../..
|
|
||||||
SRCDS_BASE = ~/srcds
|
|
||||||
HL2SDK_ORIG = ../../../hl2sdk
|
HL2SDK_ORIG = ../../../hl2sdk
|
||||||
HL2SDK_OB = ../../../hl2sdk-ob
|
HL2SDK_OB = ../../../hl2sdk-ob
|
||||||
SOURCEMM14 = ../../../sourcemm-1.4
|
SOURCEMM14 = ../../../sourcemm-1.4
|
||||||
SOURCEMM16 = ../../../sourcemm-1.6
|
SOURCEMM16 = ../../../sourcemm-1.6
|
||||||
|
SRCDS_BASE = ~/srcds
|
||||||
|
SMSDK = ../..
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
### EDIT BELOW FOR OTHER PROJECTS ###
|
||||||
@@ -14,25 +14,19 @@ SOURCEMM16 = ../../../sourcemm-1.6
|
|||||||
|
|
||||||
PROJECT = sdktools
|
PROJECT = sdktools
|
||||||
|
|
||||||
#Uncomment for Metamod: Source enabled extension
|
|
||||||
USEMETA = true
|
|
||||||
|
|
||||||
OBJECTS = sdk/smsdk_ext.cpp extension.cpp vdecoder.cpp vcallbuilder.cpp vcaller.cpp \
|
OBJECTS = sdk/smsdk_ext.cpp extension.cpp vdecoder.cpp vcallbuilder.cpp vcaller.cpp \
|
||||||
vnatives.cpp vsound.cpp tenatives.cpp trnatives.cpp tempents.cpp vstringtable.cpp \
|
vnatives.cpp vsound.cpp tenatives.cpp trnatives.cpp tempents.cpp vstringtable.cpp \
|
||||||
vhelpers.cpp vglobals.cpp voice.cpp inputnatives.cpp teamnatives.cpp output.cpp \
|
vhelpers.cpp vglobals.cpp voice.cpp inputnatives.cpp teamnatives.cpp
|
||||||
outputnatives.cpp
|
|
||||||
|
|
||||||
##############################################
|
##############################################
|
||||||
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
|
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
|
||||||
##############################################
|
##############################################
|
||||||
|
|
||||||
C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
|
C_OPT_FLAGS = -O3 -funroll-loops -pipe -fno-strict-aliasing
|
||||||
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
|
C_DEBUG_FLAGS = -g -ggdb3
|
||||||
C_GCC4_FLAGS = -fvisibility=hidden
|
CPP_GCC4_FLAGS = -fvisibility=hidden -fvisibility-inlines-hidden
|
||||||
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
|
|
||||||
CPP = gcc-4.1
|
CPP = gcc-4.1
|
||||||
|
|
||||||
override ENGSET = false
|
|
||||||
ifeq "$(ENGINE)" "original"
|
ifeq "$(ENGINE)" "original"
|
||||||
HL2SDK = $(HL2SDK_ORIG)
|
HL2SDK = $(HL2SDK_ORIG)
|
||||||
HL2PUB = $(HL2SDK_ORIG)/public
|
HL2PUB = $(HL2SDK_ORIG)/public
|
||||||
@@ -40,7 +34,6 @@ ifeq "$(ENGINE)" "original"
|
|||||||
METAMOD = $(SOURCEMM14)
|
METAMOD = $(SOURCEMM14)
|
||||||
INCLUDE += -I$(HL2SDK)/public/dlls
|
INCLUDE += -I$(HL2SDK)/public/dlls
|
||||||
SRCDS = $(SRCDS_BASE)
|
SRCDS = $(SRCDS_BASE)
|
||||||
override ENGSET = true
|
|
||||||
endif
|
endif
|
||||||
ifeq "$(ENGINE)" "orangebox"
|
ifeq "$(ENGINE)" "orangebox"
|
||||||
HL2SDK = $(HL2SDK_OB)
|
HL2SDK = $(HL2SDK_OB)
|
||||||
@@ -50,24 +43,21 @@ ifeq "$(ENGINE)" "orangebox"
|
|||||||
METAMOD = $(SOURCEMM16)
|
METAMOD = $(SOURCEMM16)
|
||||||
INCLUDE += -I$(HL2SDK)/public/game/server -I$(HL2SDK)/common
|
INCLUDE += -I$(HL2SDK)/public/game/server -I$(HL2SDK)/common
|
||||||
SRCDS = $(SRCDS_BASE)/orangebox
|
SRCDS = $(SRCDS_BASE)/orangebox
|
||||||
override ENGSET = true
|
endif
|
||||||
|
ifeq "$(ENGINE)" ""
|
||||||
|
echo "You must supply ENGINE=orangebox or ENGINE=original"
|
||||||
|
false
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(USEMETA)" "true"
|
LINK_HL2 = $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_i486.so tier0_i486.so
|
||||||
LINK_HL2 = $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_i486.so tier0_i486.so
|
|
||||||
|
|
||||||
LINK += $(LINK_HL2)
|
LINK += $(LINK_HL2) -static-libgcc
|
||||||
|
|
||||||
INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/tier0 \
|
INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
|
||||||
-I$(HL2PUB)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook -I$(METAMOD)/sourcemm -I$(SMSDK)/public \
|
-I$(HL2PUB)/vstdlib -I$(HL2SDK)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook -I$(METAMOD)/sourcemm \
|
||||||
-I$(SMSDK)/public/extensions -I$(SMSDK)/public/sourcepawn
|
-I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn -I$(SMSDK)/public/extensions \
|
||||||
else
|
|
||||||
INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
|
|
||||||
endif
|
|
||||||
|
|
||||||
LINK += -static-libgcc
|
CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
|
||||||
|
|
||||||
CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
|
|
||||||
-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror -Wno-switch \
|
-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror -Wno-switch \
|
||||||
-Wno-unused -mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -m32
|
-Wno-unused -mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -m32
|
||||||
CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti -fno-threadsafe-statics
|
CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti -fno-threadsafe-statics
|
||||||
@@ -77,20 +67,15 @@ CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti -fno-threadsafe-stat
|
|||||||
################################################
|
################################################
|
||||||
|
|
||||||
ifeq "$(DEBUG)" "true"
|
ifeq "$(DEBUG)" "true"
|
||||||
BIN_DIR = Debug
|
BIN_DIR = Debug.$(ENGINE)
|
||||||
CFLAGS += $(C_DEBUG_FLAGS)
|
CFLAGS += $(C_DEBUG_FLAGS)
|
||||||
else
|
else
|
||||||
BIN_DIR = Release
|
BIN_DIR = Release.$(ENGINE)
|
||||||
CFLAGS += $(C_OPT_FLAGS)
|
CFLAGS += $(C_OPT_FLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(USEMETA)" "true"
|
|
||||||
BIN_DIR := $(BIN_DIR).$(ENGINE)
|
|
||||||
endif
|
|
||||||
|
|
||||||
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
||||||
ifeq "$(GCC_VERSION)" "4"
|
ifeq "$(GCC_VERSION)" "4"
|
||||||
CFLAGS += $(C_GCC4_FLAGS)
|
|
||||||
CPPFLAGS += $(CPP_GCC4_FLAGS)
|
CPPFLAGS += $(CPP_GCC4_FLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -101,21 +86,13 @@ OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
|||||||
$(BIN_DIR)/%.o: %.cpp
|
$(BIN_DIR)/%.o: %.cpp
|
||||||
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
all: check
|
all:
|
||||||
mkdir -p $(BIN_DIR)/sdk
|
mkdir -p $(BIN_DIR)/sdk
|
||||||
if [ "$(USEMETA)" == "true" ]; then \
|
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so
|
||||||
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so; \
|
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so
|
||||||
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \
|
|
||||||
fi
|
|
||||||
$(MAKE) -f Makefile extension
|
$(MAKE) -f Makefile extension
|
||||||
|
|
||||||
check:
|
extension: $(OBJ_LINUX)
|
||||||
if [ "$(USEMETA)" == "true" ] && [ "$(ENGSET)" == "false" ]; then \
|
|
||||||
echo "You must supply ENGINE=orangebox or ENGINE=original"; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
extension: check $(OBJ_LINUX)
|
|
||||||
$(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
$(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
@@ -123,7 +100,8 @@ debug:
|
|||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
clean: check
|
clean:
|
||||||
rm -rf $(BIN_DIR)/*.o
|
rm -rf $(BIN_DIR)/*.o
|
||||||
rm -rf $(BIN_DIR)/sdk/*.o
|
rm -rf $(BIN_DIR)/sdk/*.o
|
||||||
rm -rf $(BIN_DIR)/$(BINARY)
|
rm -rf $(BIN_DIR)/$(BINARY)
|
||||||
|
|
||||||
|
|||||||
@@ -1,98 +0,0 @@
|
|||||||
/**
|
|
||||||
* vim: set ts=4 :
|
|
||||||
* =============================================================================
|
|
||||||
* SourceMod SDKTools Extension
|
|
||||||
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
|
||||||
* =============================================================================
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
|
||||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
||||||
* Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
* details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
||||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
||||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
||||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
||||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
||||||
* this exception to all derivative works. AlliedModders LLC defines further
|
|
||||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
||||||
* or <http://www.sourcemod.net/license.php>.
|
|
||||||
*
|
|
||||||
* Version: $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _INCLUDE_SOURCEMOD_DETOURS_H_
|
|
||||||
#define _INCLUDE_SOURCEMOD_DETOURS_H_
|
|
||||||
|
|
||||||
#if defined PLATFORM_LINUX
|
|
||||||
#include <sys/mman.h>
|
|
||||||
#define PAGE_SIZE 4096
|
|
||||||
#define ALIGN(ar) ((long)ar & ~(PAGE_SIZE-1))
|
|
||||||
#define PAGE_EXECUTE_READWRITE PROT_READ|PROT_WRITE|PROT_EXEC
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct patch_t
|
|
||||||
{
|
|
||||||
patch_t()
|
|
||||||
{
|
|
||||||
patch[0] = 0;
|
|
||||||
bytes = 0;
|
|
||||||
}
|
|
||||||
unsigned char patch[20];
|
|
||||||
size_t bytes;
|
|
||||||
};
|
|
||||||
|
|
||||||
inline void ProtectMemory(void *addr, int length, int prot)
|
|
||||||
{
|
|
||||||
#if defined PLATFORM_LINUX
|
|
||||||
void *addr2 = (void *)ALIGN(addr);
|
|
||||||
mprotect(addr2, sysconf(_SC_PAGESIZE), prot);
|
|
||||||
#elif defined PLATFORM_WINDOWS
|
|
||||||
DWORD old_prot;
|
|
||||||
VirtualProtect(addr, length, prot, &old_prot);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void SetMemPatchable(void *address, size_t size)
|
|
||||||
{
|
|
||||||
ProtectMemory(address, (int)size, PAGE_EXECUTE_READWRITE);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void DoGatePatch(unsigned char *target, void *callback)
|
|
||||||
{
|
|
||||||
SetMemPatchable(target, 20);
|
|
||||||
|
|
||||||
target[0] = 0xFF; /* JMP */
|
|
||||||
target[1] = 0x25; /* MEM32 */
|
|
||||||
*(void **)(&target[2]) = callback;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void ApplyPatch(void *address, int offset, const patch_t *patch, patch_t *restore)
|
|
||||||
{
|
|
||||||
ProtectMemory(address, 20, PAGE_EXECUTE_READWRITE);
|
|
||||||
|
|
||||||
unsigned char *addr = (unsigned char *)address + offset;
|
|
||||||
if (restore)
|
|
||||||
{
|
|
||||||
for (size_t i=0; i<patch->bytes; i++)
|
|
||||||
{
|
|
||||||
restore->patch[i] = addr[i];
|
|
||||||
}
|
|
||||||
restore->bytes = patch->bytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (size_t i=0; i<patch->bytes; i++)
|
|
||||||
{
|
|
||||||
addr[i] = patch->patch[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif //_INCLUDE_SOURCEMOD_DETOURS_H_
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod SDKTools Extension
|
* SourceMod SDKTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -36,7 +36,6 @@
|
|||||||
#include "vglobals.h"
|
#include "vglobals.h"
|
||||||
#include "tempents.h"
|
#include "tempents.h"
|
||||||
#include "vsound.h"
|
#include "vsound.h"
|
||||||
#include "output.h"
|
|
||||||
|
|
||||||
#if defined ORANGEBOX_BUILD
|
#if defined ORANGEBOX_BUILD
|
||||||
#define SDKTOOLS_GAME_FILE "sdktools.games.ep2"
|
#define SDKTOOLS_GAME_FILE "sdktools.games.ep2"
|
||||||
@@ -92,7 +91,6 @@ bool SDKTools::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|||||||
sharesys->AddNatives(myself, g_VoiceNatives);
|
sharesys->AddNatives(myself, g_VoiceNatives);
|
||||||
sharesys->AddNatives(myself, g_EntInputNatives);
|
sharesys->AddNatives(myself, g_EntInputNatives);
|
||||||
sharesys->AddNatives(myself, g_TeamNatives);
|
sharesys->AddNatives(myself, g_TeamNatives);
|
||||||
sharesys->AddNatives(myself, g_EntOutputNatives);
|
|
||||||
|
|
||||||
SM_GET_IFACE(GAMEHELPERS, g_pGameHelpers);
|
SM_GET_IFACE(GAMEHELPERS, g_pGameHelpers);
|
||||||
|
|
||||||
@@ -116,12 +114,6 @@ bool SDKTools::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|||||||
|
|
||||||
MathLib_Init(2.2f, 2.2f, 0.0f, 2);
|
MathLib_Init(2.2f, 2.2f, 0.0f, 2);
|
||||||
|
|
||||||
spengine = g_pSM->GetScriptingEngine();
|
|
||||||
|
|
||||||
plsys->AddPluginsListener(&g_OutputManager);
|
|
||||||
|
|
||||||
g_OutputManager.Init();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,7 +156,6 @@ void SDKTools::SDK_OnUnload()
|
|||||||
gameconfs->CloseGameConfigFile(g_pGameConf);
|
gameconfs->CloseGameConfigFile(g_pGameConf);
|
||||||
playerhelpers->RemoveClientListener(&g_SdkTools);
|
playerhelpers->RemoveClientListener(&g_SdkTools);
|
||||||
playerhelpers->UnregisterCommandTargetProcessor(this);
|
playerhelpers->UnregisterCommandTargetProcessor(this);
|
||||||
plsys->RemovePluginsListener(&g_OutputManager);
|
|
||||||
|
|
||||||
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, LevelInit, gamedll, this, &SDKTools::LevelInit, true);
|
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, LevelInit, gamedll, this, &SDKTools::LevelInit, true);
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod SDKTools Extension
|
* SourceMod SDKTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod SDKTools Extension
|
* SourceMod SDKTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
</ToolFiles>
|
</ToolFiles>
|
||||||
<Configurations>
|
<Configurations>
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="Debug - Old Metamod|Win32"
|
Name="Debug|Win32"
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
IntermediateDirectory="$(ConfigurationName)"
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
ConfigurationType="2"
|
ConfigurationType="2"
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(SOURCEMM14)";"$(SOURCEMM14)\sourcemm";"$(SOURCEMM14)\sourcehook""
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
@@ -63,10 +63,10 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
AdditionalDependencies="vstdlib.lib tier0.lib tier1.lib mathlib.lib"
|
||||||
OutputFile="$(OutDir)\sdktools.ext.dll"
|
OutputFile="$(OutDir)\sdktools.ext.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
IgnoreDefaultLibraryNames="LIBCMT"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="Release - Old Metamod|Win32"
|
Name="Release|Win32"
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
IntermediateDirectory="$(ConfigurationName)"
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
ConfigurationType="2"
|
ConfigurationType="2"
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(SOURCEMM14)";"$(SOURCEMM14)\sourcemm";"$(SOURCEMM14)\sourcehook""
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
EnableEnhancedInstructionSet="1"
|
EnableEnhancedInstructionSet="1"
|
||||||
@@ -143,10 +143,9 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
AdditionalDependencies="vstdlib.lib tier0.lib tier1.lib mathlib.lib"
|
||||||
OutputFile="$(OutDir)\sdktools.ext.dll"
|
OutputFile="$(OutDir)\sdktools.ext.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
|
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
@@ -203,7 +202,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn;"$(HL2SDKOB)\common";"$(HL2SDKOB)\public";"$(HL2SDKOB)\public\engine";"$(HL2SDKOB)\public\game\server";"$(HL2SDKOB)\public\mathlib";"$(HL2SDKOB)\public\tier0";"$(HL2SDKOB)\public\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;"$(HL2SDKOB)\public";"$(HL2SDKOB)\public\dlls";"$(HL2SDKOB)\public\engine";"$(HL2SDKOB)\public\tier0";"$(HL2SDKOB)\public\tier1";"$(HL2SDKOB)\public\vstdlib";"$(HL2SDKOB)\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook";"$(HL2SDKOB)\public\game\server";"$(HL2SDKOB)\common""
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;ORANGEBOX_BUILD"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;ORANGEBOX_BUILD"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
@@ -229,7 +228,169 @@
|
|||||||
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib" "$(HL2SDKOB)\lib\public\vstdlib.lib" "$(HL2SDKOB)\lib\public\mathlib.lib""
|
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib" "$(HL2SDKOB)\lib\public\vstdlib.lib" "$(HL2SDKOB)\lib\public\mathlib.lib""
|
||||||
OutputFile="$(OutDir)\sdktools.ext.dll"
|
OutputFile="$(OutDir)\sdktools.ext.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
IgnoreDefaultLibraryNames="LIBCMT"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
SubSystem="2"
|
||||||
|
TargetMachine="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug - Episode 1|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="2"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(HL2SDK)\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="1"
|
||||||
|
EnableEnhancedInstructionSet="1"
|
||||||
|
RuntimeTypeInfo="false"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="false"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
||||||
|
OutputFile="$(OutDir)\sdktools.ext.dll"
|
||||||
|
LinkIncremental="2"
|
||||||
|
IgnoreDefaultLibraryNames="LIBCMT"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
SubSystem="2"
|
||||||
|
TargetMachine="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug - Old Metamod|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="2"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(HL2SDK)\tier1";"$(SOURCEMM14)";"$(SOURCEMM14)\sourcemm";"$(SOURCEMM14)\sourcehook""
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="1"
|
||||||
|
EnableEnhancedInstructionSet="1"
|
||||||
|
RuntimeTypeInfo="false"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="false"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
||||||
|
OutputFile="$(OutDir)\sdktools.ext.dll"
|
||||||
|
LinkIncremental="2"
|
||||||
|
IgnoreDefaultLibraryNames="LIBCMT"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
@@ -285,7 +446,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn;"$(HL2SDKOB)\common";"$(HL2SDKOB)\public";"$(HL2SDKOB)\public\engine";"$(HL2SDKOB)\public\game\server";"$(HL2SDKOB)\public\mathlib";"$(HL2SDKOB)\public\tier0";"$(HL2SDKOB)\public\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;"$(HL2SDKOB)\public";"$(HL2SDKOB)\public\dlls";"$(HL2SDKOB)\public\engine";"$(HL2SDKOB)\public\tier0";"$(HL2SDKOB)\public\tier1";"$(HL2SDKOB)\public\vstdlib";"$(HL2SDKOB)\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook";"$(HL2SDKOB)\public\game\server";"$(HL2SDKOB)\common""
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;ORANGEBOX_BUILD"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD;ORANGEBOX_BUILD"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
EnableEnhancedInstructionSet="1"
|
EnableEnhancedInstructionSet="1"
|
||||||
@@ -309,7 +470,6 @@
|
|||||||
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib" "$(HL2SDKOB)\lib\public\vstdlib.lib" "$(HL2SDKOB)\lib\public\mathlib.lib""
|
AdditionalDependencies=""$(HL2SDKOB)\lib\public\tier0.lib" "$(HL2SDKOB)\lib\public\tier1.lib" "$(HL2SDKOB)\lib\public\vstdlib.lib" "$(HL2SDKOB)\lib\public\mathlib.lib""
|
||||||
OutputFile="$(OutDir)\sdktools.ext.dll"
|
OutputFile="$(OutDir)\sdktools.ext.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
|
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
@@ -341,87 +501,6 @@
|
|||||||
Name="VCPostBuildEventTool"
|
Name="VCPostBuildEventTool"
|
||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
<Configuration
|
|
||||||
Name="Debug - Episode 1|Win32"
|
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
|
||||||
IntermediateDirectory="$(ConfigurationName)"
|
|
||||||
ConfigurationType="2"
|
|
||||||
CharacterSet="2"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreBuildEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCustomBuildTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXMLDataGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCMIDLTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="0"
|
|
||||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
|
||||||
MinimalRebuild="true"
|
|
||||||
BasicRuntimeChecks="3"
|
|
||||||
RuntimeLibrary="1"
|
|
||||||
EnableEnhancedInstructionSet="1"
|
|
||||||
RuntimeTypeInfo="false"
|
|
||||||
UsePrecompiledHeader="0"
|
|
||||||
WarningLevel="3"
|
|
||||||
Detect64BitPortabilityProblems="false"
|
|
||||||
DebugInformationFormat="4"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManagedResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreLinkEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCLinkerTool"
|
|
||||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
|
||||||
OutputFile="$(OutDir)\sdktools.ext.dll"
|
|
||||||
LinkIncremental="2"
|
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMT"
|
|
||||||
GenerateDebugInformation="true"
|
|
||||||
SubSystem="2"
|
|
||||||
TargetMachine="1"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCALinkTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManifestTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXDCMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCBscMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCFxCopTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCAppVerifierTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebDeploymentTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPostBuildEventTool"
|
|
||||||
/>
|
|
||||||
</Configuration>
|
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="Release - Episode 1|Win32"
|
Name="Release - Episode 1|Win32"
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
@@ -448,7 +527,88 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\mathlib";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(HL2SDK)\tier1";"$(SOURCEMM16)";"$(SOURCEMM16)\sourcemm";"$(SOURCEMM16)\sourcehook""
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||||
|
RuntimeLibrary="0"
|
||||||
|
EnableEnhancedInstructionSet="1"
|
||||||
|
RuntimeTypeInfo="false"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="false"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
||||||
|
OutputFile="$(OutDir)\sdktools.ext.dll"
|
||||||
|
LinkIncremental="1"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
SubSystem="2"
|
||||||
|
OptimizeReferences="2"
|
||||||
|
EnableCOMDATFolding="2"
|
||||||
|
TargetMachine="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Release - Old Metamod|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="2"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
FavorSizeOrSpeed="1"
|
||||||
|
AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn;..\..\..\public\extensions;"$(HL2SDK)\public";"$(HL2SDK)\public\dlls";"$(HL2SDK)\public\engine";"$(HL2SDK)\public\tier0";"$(HL2SDK)\public\tier1";"$(HL2SDK)\public\vstdlib";"$(HL2SDK)\tier1";"$(SOURCEMM14)";"$(SOURCEMM14)\sourcemm";"$(SOURCEMM14)\sourcehook""
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
EnableEnhancedInstructionSet="1"
|
EnableEnhancedInstructionSet="1"
|
||||||
@@ -472,7 +632,6 @@
|
|||||||
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
AdditionalDependencies=""$(HL2SDK)\lib\public\tier0.lib" "$(HL2SDK)\lib\public\tier1.lib" "$(HL2SDK)\lib\public\vstdlib.lib" "$(HL2SDK)\lib\public\mathlib.lib""
|
||||||
OutputFile="$(OutDir)\sdktools.ext.dll"
|
OutputFile="$(OutDir)\sdktools.ext.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
IgnoreDefaultLibraryNames="LIBC;LIBCD;LIBCMTD"
|
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
@@ -521,14 +680,6 @@
|
|||||||
RelativePath="..\inputnatives.cpp"
|
RelativePath="..\inputnatives.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\output.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\outputnatives.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\teamnatives.cpp"
|
RelativePath="..\teamnatives.cpp"
|
||||||
>
|
>
|
||||||
@@ -591,18 +742,10 @@
|
|||||||
RelativePath="..\CellRecipientFilter.h"
|
RelativePath="..\CellRecipientFilter.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\detours.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\extension.h"
|
RelativePath="..\extension.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\output.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\tempents.h"
|
RelativePath="..\tempents.h"
|
||||||
>
|
>
|
||||||
@@ -653,6 +796,78 @@
|
|||||||
<File
|
<File
|
||||||
RelativePath="..\sdk\smsdk_ext.cpp"
|
RelativePath="..\sdk\smsdk_ext.cpp"
|
||||||
>
|
>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"
|
||||||
|
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"
|
||||||
|
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug - Orange Box|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"
|
||||||
|
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug - Episode 1|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"
|
||||||
|
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug - Old Metamod|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"
|
||||||
|
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release - Orange Box|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"
|
||||||
|
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release - Episode 1|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"
|
||||||
|
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release - Old Metamod|Win32"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"
|
||||||
|
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
|
||||||
|
/>
|
||||||
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\sdk\smsdk_ext.h"
|
RelativePath="..\sdk\smsdk_ext.h"
|
||||||
|
|||||||
@@ -1,485 +0,0 @@
|
|||||||
/**
|
|
||||||
* vim: set ts=4 :
|
|
||||||
* =============================================================================
|
|
||||||
* SourceMod SDKTools Extension
|
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
|
||||||
* =============================================================================
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
|
||||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
||||||
* Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
* details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
||||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
||||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
||||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
||||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
||||||
* this exception to all derivative works. AlliedModders LLC defines further
|
|
||||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
||||||
* or <http://www.sourcemod.net/license.php>.
|
|
||||||
*
|
|
||||||
* Version: $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "extension.h"
|
|
||||||
#include "output.h"
|
|
||||||
|
|
||||||
ISourcePawnEngine *spengine = NULL;
|
|
||||||
EntityOutputManager g_OutputManager;
|
|
||||||
|
|
||||||
EntityOutputManager::EntityOutputManager()
|
|
||||||
{
|
|
||||||
info_address = NULL;
|
|
||||||
info_callback = NULL;
|
|
||||||
HookCount = 0;
|
|
||||||
is_detoured = false;
|
|
||||||
enabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
EntityOutputManager::~EntityOutputManager()
|
|
||||||
{
|
|
||||||
if (!enabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
EntityOutputs->Destroy();
|
|
||||||
ClassNames->Destroy();
|
|
||||||
ShutdownFireEventDetour();
|
|
||||||
}
|
|
||||||
|
|
||||||
void EntityOutputManager::Init()
|
|
||||||
{
|
|
||||||
enabled = CreateFireEventDetour();
|
|
||||||
|
|
||||||
if (!enabled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
EntityOutputs = adtfactory->CreateBasicTrie();
|
|
||||||
ClassNames = adtfactory->CreateBasicTrie();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool EntityOutputManager::IsEnabled()
|
|
||||||
{
|
|
||||||
return enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool EntityOutputManager::CreateFireEventDetour()
|
|
||||||
{
|
|
||||||
if (!g_pGameConf->GetMemSig("FireOutput", &info_address) || !info_address)
|
|
||||||
{
|
|
||||||
g_pSM->LogError(myself, "Could not locate FireOutput - Disabling Entity Outputs");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!g_pGameConf->GetOffset("FireOutputBackup", (int *)&(info_restore.bytes)))
|
|
||||||
{
|
|
||||||
g_pSM->LogError(myself, "Could not locate FireOutputBackup - Disabling Entity Outputs");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* First, save restore bits */
|
|
||||||
for (size_t i=0; i<info_restore.bytes; i++)
|
|
||||||
{
|
|
||||||
info_restore.patch[i] = ((unsigned char *)info_address)[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
info_callback = spengine->ExecAlloc(100);
|
|
||||||
JitWriter wr;
|
|
||||||
JitWriter *jit = ≀
|
|
||||||
wr.outbase = (jitcode_t)info_callback;
|
|
||||||
wr.outptr = wr.outbase;
|
|
||||||
|
|
||||||
/* Function we are detouring into is
|
|
||||||
*
|
|
||||||
* void FireEventDetour(CBaseEntityOutput(void *) *pOutput, CBaseEntity *pActivator, CBaseEntity *pCaller, float fDelay = 0 )
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* push fDelay [esp+20h]
|
|
||||||
* push pCaller [esp+1Ch]
|
|
||||||
* push pActivator [esp+18h]
|
|
||||||
* push pOutput [ecx]
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#if defined PLATFORM_WINDOWS
|
|
||||||
|
|
||||||
IA32_Push_Rm_Disp8_ESP(jit, 32);
|
|
||||||
IA32_Push_Rm_Disp8_ESP(jit, 32);
|
|
||||||
IA32_Push_Rm_Disp8_ESP(jit, 32);
|
|
||||||
|
|
||||||
IA32_Push_Reg(jit, REG_ECX);
|
|
||||||
|
|
||||||
#elif defined PLATFORM_LINUX
|
|
||||||
IA32_Push_Rm_Disp8_ESP(jit, 20);
|
|
||||||
IA32_Push_Rm_Disp8_ESP(jit, 20);
|
|
||||||
IA32_Push_Rm_Disp8_ESP(jit, 20);
|
|
||||||
|
|
||||||
IA32_Push_Rm_Disp8_ESP(jit, 16);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
jitoffs_t call = IA32_Call_Imm32(jit, 0);
|
|
||||||
IA32_Write_Jump32_Abs(jit, call, (void *)TempDetour);
|
|
||||||
|
|
||||||
|
|
||||||
#if defined PLATFORM_LINUX
|
|
||||||
IA32_Add_Rm_Imm8(jit, REG_ESP, 4, MOD_REG); //add esp, 4
|
|
||||||
#elif defined PLATFORM_WINDOWS
|
|
||||||
IA32_Pop_Reg(jit, REG_ECX);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
IA32_Add_Rm_Imm8(jit, REG_ESP, 12, MOD_REG); //add esp, 12 (0Ch)
|
|
||||||
|
|
||||||
|
|
||||||
/* Patch old bytes in */
|
|
||||||
for (size_t i=0; i<info_restore.bytes; i++)
|
|
||||||
{
|
|
||||||
jit->write_ubyte(info_restore.patch[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return to the original function */
|
|
||||||
call = IA32_Jump_Imm32(jit, 0);
|
|
||||||
IA32_Write_Jump32_Abs(jit, call, (unsigned char *)info_address + info_restore.bytes);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EntityOutputManager::InitFireEventDetour()
|
|
||||||
{
|
|
||||||
if (!is_detoured)
|
|
||||||
{
|
|
||||||
DoGatePatch((unsigned char *)info_address, &info_callback);
|
|
||||||
is_detoured = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void EntityOutputManager::DeleteFireEventDetour()
|
|
||||||
{
|
|
||||||
if (is_detoured)
|
|
||||||
{
|
|
||||||
ShutdownFireEventDetour();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (info_callback)
|
|
||||||
{
|
|
||||||
/* Free the gate */
|
|
||||||
spengine->ExecFree(info_callback);
|
|
||||||
info_callback = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void TempDetour(void *pOutput, CBaseEntity *pActivator, CBaseEntity *pCaller, float fDelay)
|
|
||||||
{
|
|
||||||
g_OutputManager.FireEventDetour(pOutput, pActivator, pCaller, fDelay);
|
|
||||||
}
|
|
||||||
|
|
||||||
void EntityOutputManager::ShutdownFireEventDetour()
|
|
||||||
{
|
|
||||||
if (info_callback)
|
|
||||||
{
|
|
||||||
/* Remove the patch */
|
|
||||||
ApplyPatch(info_address, 0, &info_restore, NULL);
|
|
||||||
is_detoured = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void EntityOutputManager::FireEventDetour(void *pOutput, CBaseEntity *pActivator, CBaseEntity *pCaller, float fDelay)
|
|
||||||
{
|
|
||||||
char sOutput[20];
|
|
||||||
Q_snprintf(sOutput, sizeof(sOutput), "%x", pOutput);
|
|
||||||
|
|
||||||
// attempt to directly lookup a hook using the pOutput pointer
|
|
||||||
OutputNameStruct *pOutputName = NULL;
|
|
||||||
|
|
||||||
edict_t *pEdict = gameents->BaseEntityToEdict(pCaller);
|
|
||||||
|
|
||||||
/* TODO: Add support for entities without an edict */
|
|
||||||
if (pEdict == NULL)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool fastLookup = false;
|
|
||||||
|
|
||||||
// Fast lookup failed - check the slow way for hooks that havn't fired yet
|
|
||||||
if ((fastLookup = EntityOutputs->Retrieve(sOutput, (void **)&pOutputName)) == false)
|
|
||||||
{
|
|
||||||
const char *classname = pEdict->GetClassName();
|
|
||||||
const char *outputname = FindOutputName(pOutput, pCaller);
|
|
||||||
|
|
||||||
pOutputName = FindOutputPointer(classname, outputname, false);
|
|
||||||
|
|
||||||
if (!pOutputName)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pOutputName->hooks.empty())
|
|
||||||
{
|
|
||||||
if (!fastLookup)
|
|
||||||
{
|
|
||||||
// hook exists on this classname and output - map it into our quick find trie
|
|
||||||
EntityOutputs->Insert(sOutput, pOutputName);
|
|
||||||
}
|
|
||||||
|
|
||||||
SourceHook::List<omg_hooks *>::iterator _iter;
|
|
||||||
|
|
||||||
omg_hooks *hook;
|
|
||||||
|
|
||||||
_iter = pOutputName->hooks.begin();
|
|
||||||
|
|
||||||
while (_iter != pOutputName->hooks.end())
|
|
||||||
{
|
|
||||||
hook = (omg_hooks *)*_iter;
|
|
||||||
|
|
||||||
hook->in_use = true;
|
|
||||||
|
|
||||||
int serial = pEdict->m_NetworkSerialNumber;
|
|
||||||
|
|
||||||
if (serial != hook->entity_filter && hook->entity_index == engine->IndexOfEdict(pEdict))
|
|
||||||
{
|
|
||||||
// same entity index but different serial number. Entity has changed, kill the hook.
|
|
||||||
_iter = pOutputName->hooks.erase(_iter);
|
|
||||||
CleanUpHook(hook);
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hook->entity_filter == -1 || hook->entity_filter == serial) // Global classname hook
|
|
||||||
{
|
|
||||||
//fire the forward to hook->pf
|
|
||||||
hook->pf->PushString(pOutputName->Name);
|
|
||||||
hook->pf->PushCell(engine->IndexOfEdict(pEdict));
|
|
||||||
|
|
||||||
edict_t *pEdictActivator = gameents->BaseEntityToEdict(pActivator);
|
|
||||||
if (!pEdictActivator)
|
|
||||||
{
|
|
||||||
hook->pf->PushCell(-1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
hook->pf->PushCell(engine->IndexOfEdict(pEdictActivator));
|
|
||||||
}
|
|
||||||
//hook->pf->PushCell(handle);
|
|
||||||
hook->pf->PushFloat(fDelay);
|
|
||||||
hook->pf->Execute(NULL);
|
|
||||||
|
|
||||||
if ((hook->entity_filter != -1) && hook->only_once)
|
|
||||||
{
|
|
||||||
_iter = pOutputName->hooks.erase(_iter);
|
|
||||||
CleanUpHook(hook);
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hook->delete_me)
|
|
||||||
{
|
|
||||||
_iter = pOutputName->hooks.erase(_iter);
|
|
||||||
CleanUpHook(hook);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
hook->in_use = false;
|
|
||||||
_iter++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
omg_hooks *EntityOutputManager::NewHook()
|
|
||||||
{
|
|
||||||
omg_hooks *hook;
|
|
||||||
|
|
||||||
if (FreeHooks.empty())
|
|
||||||
{
|
|
||||||
hook = new omg_hooks;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
hook = g_OutputManager.FreeHooks.front();
|
|
||||||
g_OutputManager.FreeHooks.pop();
|
|
||||||
}
|
|
||||||
|
|
||||||
return hook;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EntityOutputManager::OnHookAdded()
|
|
||||||
{
|
|
||||||
HookCount++;
|
|
||||||
|
|
||||||
if (HookCount == 1)
|
|
||||||
{
|
|
||||||
// This is the first hook created
|
|
||||||
InitFireEventDetour();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void EntityOutputManager::OnHookRemoved()
|
|
||||||
{
|
|
||||||
HookCount--;
|
|
||||||
|
|
||||||
if (HookCount == 0)
|
|
||||||
{
|
|
||||||
ShutdownFireEventDetour();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void EntityOutputManager::CleanUpHook(omg_hooks *hook)
|
|
||||||
{
|
|
||||||
FreeHooks.push(hook);
|
|
||||||
|
|
||||||
OnHookRemoved();
|
|
||||||
|
|
||||||
IPlugin *pPlugin = plsys->FindPluginByContext(hook->pf->GetParentContext()->GetContext());
|
|
||||||
SourceHook::List<omg_hooks *> *pList = NULL;
|
|
||||||
|
|
||||||
if (!pPlugin->GetProperty("OutputHookList", (void **)&pList, false) || !pList)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SourceHook::List<omg_hooks *>::iterator p_iter = pList->begin();
|
|
||||||
|
|
||||||
omg_hooks *pluginHook;
|
|
||||||
|
|
||||||
while (p_iter != pList->end())
|
|
||||||
{
|
|
||||||
pluginHook = (omg_hooks *)*p_iter;
|
|
||||||
if (pluginHook == hook)
|
|
||||||
{
|
|
||||||
p_iter = pList->erase(p_iter);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p_iter++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void EntityOutputManager::OnPluginDestroyed(IPlugin *plugin)
|
|
||||||
{
|
|
||||||
SourceHook::List<omg_hooks *> *pList = NULL;
|
|
||||||
|
|
||||||
if (plugin->GetProperty("OutputHookList", (void **)&pList, true))
|
|
||||||
{
|
|
||||||
SourceHook::List<omg_hooks *>::iterator p_iter = pList->begin();
|
|
||||||
omg_hooks *hook;
|
|
||||||
|
|
||||||
while (p_iter != pList->end())
|
|
||||||
{
|
|
||||||
hook = (omg_hooks *)*p_iter;
|
|
||||||
|
|
||||||
p_iter = pList->erase(p_iter); //remove from this plugins list
|
|
||||||
hook->m_parent->hooks.remove(hook); // remove from the y's list
|
|
||||||
|
|
||||||
FreeHooks.push(hook); //save the omg_hook
|
|
||||||
|
|
||||||
OnHookRemoved();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
OutputNameStruct *EntityOutputManager::FindOutputPointer(const char *classname, const char *outputname, bool create)
|
|
||||||
{
|
|
||||||
ClassNameStruct *pClassname;
|
|
||||||
|
|
||||||
if (!ClassNames->Retrieve(classname, (void **)&pClassname))
|
|
||||||
{
|
|
||||||
if (create)
|
|
||||||
{
|
|
||||||
pClassname = new ClassNameStruct;
|
|
||||||
ClassNames->Insert(classname, pClassname);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
OutputNameStruct *pOutputName;
|
|
||||||
|
|
||||||
if (!pClassname->OutputList->Retrieve(outputname, (void **)&pOutputName))
|
|
||||||
{
|
|
||||||
if (create)
|
|
||||||
{
|
|
||||||
pOutputName = new OutputNameStruct;
|
|
||||||
pClassname->OutputList->Insert(outputname, pOutputName);
|
|
||||||
strncpy(pOutputName->Name, outputname, sizeof(pOutputName->Name));
|
|
||||||
pOutputName->Name[49] = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return pOutputName;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Iterate the datamap of pCaller and look for output pointers with the same address as pOutput
|
|
||||||
const char *EntityOutputManager::FindOutputName(void *pOutput, CBaseEntity *pCaller)
|
|
||||||
{
|
|
||||||
datamap_t *pMap = gamehelpers->GetDataMap(pCaller);
|
|
||||||
|
|
||||||
while (pMap)
|
|
||||||
{
|
|
||||||
for (int i=0; i<pMap->dataNumFields; i++)
|
|
||||||
{
|
|
||||||
if (pMap->dataDesc[i].flags & FTYPEDESC_OUTPUT)
|
|
||||||
{
|
|
||||||
if ((char *)pCaller + pMap->dataDesc[i].fieldOffset[0] == pOutput)
|
|
||||||
{
|
|
||||||
return pMap->dataDesc[i].externalName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pMap = pMap->baseMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Thanks SM core
|
|
||||||
edict_t *EntityOutputManager::BaseHandleToEdict(CBaseHandle &hndl)
|
|
||||||
{
|
|
||||||
if (!hndl.IsValid())
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
int index = hndl.GetEntryIndex();
|
|
||||||
|
|
||||||
edict_t *pStoredEdict;
|
|
||||||
|
|
||||||
pStoredEdict = engine->PEntityOfEntIndex(index);
|
|
||||||
|
|
||||||
if (pStoredEdict == NULL)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
IServerEntity *pSE = pStoredEdict->GetIServerEntity();
|
|
||||||
|
|
||||||
if (pSE == NULL)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pSE->GetRefEHandle() != hndl)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return pStoredEdict;
|
|
||||||
}
|
|
||||||
@@ -1,148 +0,0 @@
|
|||||||
/**
|
|
||||||
* vim: set ts=4 :
|
|
||||||
* =============================================================================
|
|
||||||
* SourceMod SDKTools Extension
|
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
|
||||||
* =============================================================================
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
|
||||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
||||||
* Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
* details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
||||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
||||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
||||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
||||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
||||||
* this exception to all derivative works. AlliedModders LLC defines further
|
|
||||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
||||||
* or <http://www.sourcemod.net/license.php>.
|
|
||||||
*
|
|
||||||
* Version: $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _INCLUDE_SOURCEMOD_OUTPUT_H_
|
|
||||||
#define _INCLUDE_SOURCEMOD_OUTPUT_H_
|
|
||||||
|
|
||||||
#include <jit/jit_helpers.h>
|
|
||||||
#include <jit/x86/x86_macros.h>
|
|
||||||
#include "sh_list.h"
|
|
||||||
#include "sh_stack.h"
|
|
||||||
#include "sm_trie_tpl.h"
|
|
||||||
#include "detours.h"
|
|
||||||
|
|
||||||
extern ISourcePawnEngine *spengine;
|
|
||||||
|
|
||||||
struct OutputNameStruct;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is a function specific hook that corresponds to an entity classname
|
|
||||||
* and outputname. There can be many of these for each classname/output combo
|
|
||||||
*/
|
|
||||||
struct omg_hooks
|
|
||||||
{
|
|
||||||
int entity_filter; // if not -1 is an entity signature
|
|
||||||
int entity_index;
|
|
||||||
bool only_once;
|
|
||||||
IPluginFunction *pf;
|
|
||||||
OutputNameStruct *m_parent;
|
|
||||||
bool in_use;
|
|
||||||
bool delete_me;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This represents an output belonging to a specific classname
|
|
||||||
*/
|
|
||||||
struct OutputNameStruct
|
|
||||||
{
|
|
||||||
SourceHook::List<omg_hooks *> hooks;
|
|
||||||
char Name[50];
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This represents an entity classname
|
|
||||||
*/
|
|
||||||
struct ClassNameStruct
|
|
||||||
{
|
|
||||||
//Trie mapping outputname to a OutputNameStruct
|
|
||||||
//KTrie<OutputNameStruct *> OutputList;
|
|
||||||
IBasicTrie *OutputList;
|
|
||||||
|
|
||||||
ClassNameStruct()
|
|
||||||
{
|
|
||||||
OutputList = adtfactory->CreateBasicTrie();
|
|
||||||
}
|
|
||||||
|
|
||||||
~ClassNameStruct()
|
|
||||||
{
|
|
||||||
OutputList->Destroy();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class EntityOutputManager : public IPluginsListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
EntityOutputManager();
|
|
||||||
~EntityOutputManager();
|
|
||||||
public:
|
|
||||||
void Init();
|
|
||||||
|
|
||||||
bool IsEnabled();
|
|
||||||
|
|
||||||
void FireEventDetour(void *pOutput, CBaseEntity *pActivator, CBaseEntity *pCaller, float fDelay);
|
|
||||||
|
|
||||||
void OnPluginDestroyed(IPlugin *plugin);
|
|
||||||
|
|
||||||
OutputNameStruct *FindOutputPointer(const char *classname, const char *outputname, bool create);
|
|
||||||
|
|
||||||
void CleanUpHook(omg_hooks *hook);
|
|
||||||
|
|
||||||
omg_hooks *NewHook();
|
|
||||||
|
|
||||||
void OnHookAdded();
|
|
||||||
void OnHookRemoved();
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool enabled;
|
|
||||||
|
|
||||||
// Patch/unpatch the server dll
|
|
||||||
void InitFireEventDetour();
|
|
||||||
void ShutdownFireEventDetour();
|
|
||||||
bool is_detoured;
|
|
||||||
|
|
||||||
//These create/delete the allocated memory and write into it
|
|
||||||
bool CreateFireEventDetour();
|
|
||||||
void DeleteFireEventDetour();
|
|
||||||
|
|
||||||
const char *FindOutputName(void *pOutput, CBaseEntity *pCaller);
|
|
||||||
edict_t *BaseHandleToEdict(CBaseHandle &hndl);
|
|
||||||
|
|
||||||
//Maps CEntityOutput * to a OutputNameStruct
|
|
||||||
IBasicTrie *EntityOutputs;
|
|
||||||
// Maps classname to a ClassNameStruct
|
|
||||||
IBasicTrie *ClassNames;
|
|
||||||
|
|
||||||
SourceHook::CStack<omg_hooks *> FreeHooks; //Stores hook pointers to avoid calls to new
|
|
||||||
|
|
||||||
int HookCount;
|
|
||||||
|
|
||||||
patch_t info_restore;
|
|
||||||
void *info_address;
|
|
||||||
void *info_callback;
|
|
||||||
};
|
|
||||||
|
|
||||||
void TempDetour(void *pOutput, CBaseEntity *pActivator, CBaseEntity *pCaller, float fDelay);
|
|
||||||
|
|
||||||
extern EntityOutputManager g_OutputManager;
|
|
||||||
|
|
||||||
extern sp_nativeinfo_t g_EntOutputNatives[];
|
|
||||||
|
|
||||||
#endif //_INCLUDE_SOURCEMOD_OUTPUT_H_
|
|
||||||
@@ -1,278 +0,0 @@
|
|||||||
/**
|
|
||||||
* vim: set ts=4 :
|
|
||||||
* =============================================================================
|
|
||||||
* SourceMod SDKTools Extension
|
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
|
||||||
* =============================================================================
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
|
||||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
||||||
* Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
||||||
* details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
||||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
||||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
||||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
||||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
||||||
* this exception to all derivative works. AlliedModders LLC defines further
|
|
||||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
||||||
* or <http://www.sourcemod.net/license.php>.
|
|
||||||
*
|
|
||||||
* Version: $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "extension.h"
|
|
||||||
#include "output.h"
|
|
||||||
|
|
||||||
// HookSingleEntityOutput(ent, const String:output[], function, bool:once);
|
|
||||||
cell_t HookSingleEntityOutput(IPluginContext *pContext, const cell_t *params)
|
|
||||||
{
|
|
||||||
if (!g_OutputManager.IsEnabled())
|
|
||||||
{
|
|
||||||
return pContext->ThrowNativeError("Entity Outputs are disabled - See error logs for details");
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEdict = engine->PEntityOfEntIndex(params[1]);
|
|
||||||
if (!pEdict)
|
|
||||||
{
|
|
||||||
return pContext->ThrowNativeError("Invalid Entity index %i", params[1]);
|
|
||||||
}
|
|
||||||
const char *classname = pEdict->GetClassName();
|
|
||||||
|
|
||||||
char *outputname;
|
|
||||||
pContext->LocalToString(params[2], &outputname);
|
|
||||||
|
|
||||||
OutputNameStruct *pOutputName = g_OutputManager.FindOutputPointer((const char *)classname, outputname, true);
|
|
||||||
|
|
||||||
//Check for an existing identical hook
|
|
||||||
SourceHook::List<omg_hooks *>::iterator _iter;
|
|
||||||
|
|
||||||
omg_hooks *hook;
|
|
||||||
|
|
||||||
IPluginFunction *pFunction;
|
|
||||||
pFunction = pContext->GetFunctionById(params[3]);
|
|
||||||
|
|
||||||
for (_iter=pOutputName->hooks.begin(); _iter!=pOutputName->hooks.end(); _iter++)
|
|
||||||
{
|
|
||||||
hook = (omg_hooks *)*_iter;
|
|
||||||
if (hook->pf == pFunction && hook->entity_filter == pEdict->m_NetworkSerialNumber)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
hook = g_OutputManager.NewHook();
|
|
||||||
|
|
||||||
hook->entity_filter = pEdict->m_NetworkSerialNumber;
|
|
||||||
hook->entity_index = engine->IndexOfEdict(pEdict);
|
|
||||||
hook->only_once= !!params[4];
|
|
||||||
hook->pf = pFunction;
|
|
||||||
hook->m_parent = pOutputName;
|
|
||||||
hook->in_use = false;
|
|
||||||
hook->delete_me = false;
|
|
||||||
|
|
||||||
pOutputName->hooks.push_back(hook);
|
|
||||||
|
|
||||||
g_OutputManager.OnHookAdded();
|
|
||||||
|
|
||||||
IPlugin *pPlugin = plsys->FindPluginByContext(pContext->GetContext());
|
|
||||||
SourceHook::List<omg_hooks *> *pList = NULL;
|
|
||||||
|
|
||||||
if (!pPlugin->GetProperty("OutputHookList", (void **)&pList, false) || !pList)
|
|
||||||
{
|
|
||||||
pList = new SourceHook::List<omg_hooks *>;
|
|
||||||
pPlugin->SetProperty("OutputHookList", pList);
|
|
||||||
}
|
|
||||||
|
|
||||||
pList->push_back(hook);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// HookEntityOutput(const String:classname[], const String:output[], function);
|
|
||||||
cell_t HookEntityOutput(IPluginContext *pContext, const cell_t *params)
|
|
||||||
{
|
|
||||||
if (!g_OutputManager.IsEnabled())
|
|
||||||
{
|
|
||||||
return pContext->ThrowNativeError("Entity Outputs are disabled - See error logs for details");
|
|
||||||
}
|
|
||||||
|
|
||||||
//Find or create the base structures for this classname and the output
|
|
||||||
char *classname;
|
|
||||||
pContext->LocalToString(params[1], &classname);
|
|
||||||
|
|
||||||
char *outputname;
|
|
||||||
pContext->LocalToString(params[2], &outputname);
|
|
||||||
|
|
||||||
OutputNameStruct *pOutputName = g_OutputManager.FindOutputPointer((const char *)classname, outputname, true);
|
|
||||||
|
|
||||||
//Check for an existing identical hook
|
|
||||||
SourceHook::List<omg_hooks *>::iterator _iter;
|
|
||||||
|
|
||||||
omg_hooks *hook;
|
|
||||||
|
|
||||||
IPluginFunction *pFunction;
|
|
||||||
pFunction = pContext->GetFunctionById(params[3]);
|
|
||||||
|
|
||||||
for (_iter=pOutputName->hooks.begin(); _iter!=pOutputName->hooks.end(); _iter++)
|
|
||||||
{
|
|
||||||
hook = (omg_hooks *)*_iter;
|
|
||||||
if (hook->pf == pFunction && hook->entity_filter == -1)
|
|
||||||
{
|
|
||||||
//already hooked to this function...
|
|
||||||
//throw an error or just let them get away with stupidity?
|
|
||||||
// seems like poor coding if they dont know if something is hooked or not
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
hook = g_OutputManager.NewHook();
|
|
||||||
|
|
||||||
hook->entity_filter = -1;
|
|
||||||
hook->pf = pFunction;
|
|
||||||
hook->m_parent = pOutputName;
|
|
||||||
hook->in_use = false;
|
|
||||||
hook->delete_me = false;
|
|
||||||
|
|
||||||
pOutputName->hooks.push_back(hook);
|
|
||||||
|
|
||||||
g_OutputManager.OnHookAdded();
|
|
||||||
|
|
||||||
IPlugin *pPlugin = plsys->FindPluginByContext(pContext->GetContext());
|
|
||||||
SourceHook::List<omg_hooks *> *pList = NULL;
|
|
||||||
|
|
||||||
if (!pPlugin->GetProperty("OutputHookList", (void **)&pList, false) || !pList)
|
|
||||||
{
|
|
||||||
pList = new SourceHook::List<omg_hooks *>;
|
|
||||||
pPlugin->SetProperty("OutputHookList", pList);
|
|
||||||
}
|
|
||||||
|
|
||||||
pList->push_back(hook);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnHookEntityOutput(const String:classname[], const String:output[], EntityOutput:callback);
|
|
||||||
cell_t UnHookEntityOutput(IPluginContext *pContext, const cell_t *params)
|
|
||||||
{
|
|
||||||
if (!g_OutputManager.IsEnabled())
|
|
||||||
{
|
|
||||||
return pContext->ThrowNativeError("Entity Outputs are disabled - See error logs for details");
|
|
||||||
}
|
|
||||||
|
|
||||||
char *classname;
|
|
||||||
pContext->LocalToString(params[1], &classname);
|
|
||||||
|
|
||||||
char *outputname;
|
|
||||||
pContext->LocalToString(params[2], &outputname);
|
|
||||||
|
|
||||||
OutputNameStruct *pOutputName = g_OutputManager.FindOutputPointer((const char *)classname, outputname, false);
|
|
||||||
|
|
||||||
if (!pOutputName)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Check for an existing identical hook
|
|
||||||
SourceHook::List<omg_hooks *>::iterator _iter;
|
|
||||||
|
|
||||||
omg_hooks *hook;
|
|
||||||
|
|
||||||
IPluginFunction *pFunction;
|
|
||||||
pFunction = pContext->GetFunctionById(params[3]);
|
|
||||||
|
|
||||||
for (_iter=pOutputName->hooks.begin(); _iter!=pOutputName->hooks.end(); _iter++)
|
|
||||||
{
|
|
||||||
hook = (omg_hooks *)*_iter;
|
|
||||||
if (hook->pf == pFunction && hook->entity_filter == -1)
|
|
||||||
{
|
|
||||||
// remove this hook.
|
|
||||||
if (hook->in_use)
|
|
||||||
{
|
|
||||||
hook->delete_me = true;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
pOutputName->hooks.erase(_iter);
|
|
||||||
g_OutputManager.CleanUpHook(hook);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnHookSingleEntityOutput(entity, const String:output[], EntityOutput:callback);
|
|
||||||
cell_t UnHookSingleEntityOutput(IPluginContext *pContext, const cell_t *params)
|
|
||||||
{
|
|
||||||
if (!g_OutputManager.IsEnabled())
|
|
||||||
{
|
|
||||||
return pContext->ThrowNativeError("Entity Outputs are disabled - See error logs for details");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find the classname of the entity and lookup the classname and output structures
|
|
||||||
edict_t *pEdict = engine->PEntityOfEntIndex(params[1]);
|
|
||||||
if (!pEdict)
|
|
||||||
{
|
|
||||||
return pContext->ThrowNativeError("Invalid Entity index %i", params[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *classname = pEdict->GetClassName();
|
|
||||||
|
|
||||||
char *outputname;
|
|
||||||
pContext->LocalToString(params[2], &outputname);
|
|
||||||
|
|
||||||
OutputNameStruct *pOutputName = g_OutputManager.FindOutputPointer((const char *)classname, outputname, false);
|
|
||||||
|
|
||||||
if (!pOutputName)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Check for an existing identical hook
|
|
||||||
SourceHook::List<omg_hooks *>::iterator _iter;
|
|
||||||
|
|
||||||
omg_hooks *hook;
|
|
||||||
|
|
||||||
IPluginFunction *pFunction;
|
|
||||||
pFunction = pContext->GetFunctionById(params[3]);
|
|
||||||
|
|
||||||
for (_iter=pOutputName->hooks.begin(); _iter!=pOutputName->hooks.end(); _iter++)
|
|
||||||
{
|
|
||||||
hook = (omg_hooks *)*_iter;
|
|
||||||
if (hook->pf == pFunction && hook->entity_index == engine->IndexOfEdict(pEdict))
|
|
||||||
{
|
|
||||||
// remove this hook.
|
|
||||||
if (hook->in_use)
|
|
||||||
{
|
|
||||||
hook->delete_me = true;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
pOutputName->hooks.erase(_iter);
|
|
||||||
g_OutputManager.CleanUpHook(hook);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
sp_nativeinfo_t g_EntOutputNatives[] =
|
|
||||||
{
|
|
||||||
{"HookEntityOutput", HookEntityOutput},
|
|
||||||
{"UnhookEntityOutput", UnHookEntityOutput},
|
|
||||||
{"HookSingleEntityOutput", HookSingleEntityOutput},
|
|
||||||
{"UnhookSingleEntityOutput", UnHookSingleEntityOutput},
|
|
||||||
{NULL, NULL},
|
|
||||||
};
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod SDKTools Extension
|
* SourceMod SDKTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod Base Extension Code
|
* SourceMod Base Extension Code
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod Base Extension Code
|
* SourceMod Base Extension Code
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod SDKTools Extension
|
* SourceMod SDKTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
|
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
|
||||||
#define _INCLUDE_SDKTOOLS_VERSION_H_
|
#define _INCLUDE_SDKTOOLS_VERSION_H_
|
||||||
|
|
||||||
#define SVN_FULL_VERSION "1.0.2.2236"
|
#define SVN_FULL_VERSION "1.0.1.2166"
|
||||||
#define SVN_FILE_VERSION 1,0,2,2236
|
#define SVN_FILE_VERSION 1,0,1,2166
|
||||||
|
|
||||||
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
|
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod SDKTools Extension
|
* SourceMod SDKTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
|
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
|
||||||
#define _INCLUDE_SDKTOOLS_VERSION_H_
|
#define _INCLUDE_SDKTOOLS_VERSION_H_
|
||||||
|
|
||||||
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
|
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$LOCAL_BUILD$"
|
||||||
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
|
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$LOCAL_BUILD$
|
||||||
|
|
||||||
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
|
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod SDKTools Extension
|
* SourceMod SDKTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -46,7 +46,6 @@ bool FindTeamEntities(SendTable *pTable, const char *name)
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int props = pTable->GetNumProps();
|
int props = pTable->GetNumProps();
|
||||||
SendProp *prop;
|
SendProp *prop;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod SDKTools Extension
|
* SourceMod SDKTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod SDKTools Extension
|
* SourceMod SDKTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod SDKTools Extension
|
* SourceMod SDKTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* vim: set ts=4 :
|
* vim: set ts=4 :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod SDKTools Extension
|
* SourceMod SDKTools Extension
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it under
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
@@ -61,8 +61,6 @@ Ray_t g_Ray;
|
|||||||
trace_t g_Trace;
|
trace_t g_Trace;
|
||||||
Vector g_StartVec;
|
Vector g_StartVec;
|
||||||
Vector g_EndVec;
|
Vector g_EndVec;
|
||||||
Vector g_HullMins;
|
|
||||||
Vector g_HullMaxs;
|
|
||||||
QAngle g_DirAngles;
|
QAngle g_DirAngles;
|
||||||
CTraceFilterHitAll g_HitAllFilter;
|
CTraceFilterHitAll g_HitAllFilter;
|
||||||
CSMTraceFilter g_SMTraceFilter;
|
CSMTraceFilter g_SMTraceFilter;
|
||||||
@@ -106,25 +104,6 @@ static cell_t smn_TRTraceRay(IPluginContext *pContext, const cell_t *params)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell_t smn_TRTraceHull(IPluginContext *pContext, const cell_t *params)
|
|
||||||
{
|
|
||||||
cell_t *startaddr, *endaddr, *mins, *maxs;
|
|
||||||
pContext->LocalToPhysAddr(params[1], &startaddr);
|
|
||||||
pContext->LocalToPhysAddr(params[2], &endaddr);
|
|
||||||
pContext->LocalToPhysAddr(params[3], &mins);
|
|
||||||
pContext->LocalToPhysAddr(params[4], &maxs);
|
|
||||||
|
|
||||||
g_StartVec.Init(sp_ctof(startaddr[0]), sp_ctof(startaddr[1]), sp_ctof(startaddr[2]));
|
|
||||||
g_HullMins.Init(sp_ctof(mins[0]), sp_ctof(mins[1]), sp_ctof(mins[2]));
|
|
||||||
g_HullMaxs.Init(sp_ctof(maxs[0]), sp_ctof(maxs[1]), sp_ctof(maxs[2]));
|
|
||||||
g_EndVec.Init(sp_ctof(endaddr[0]), sp_ctof(endaddr[1]), sp_ctof(endaddr[2]));
|
|
||||||
|
|
||||||
g_Ray.Init(g_StartVec, g_EndVec, g_HullMins, g_HullMaxs);
|
|
||||||
enginetrace->TraceRay(g_Ray, params[5], &g_HitAllFilter, &g_Trace);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static cell_t smn_TRTraceRayFilter(IPluginContext *pContext, const cell_t *params)
|
static cell_t smn_TRTraceRayFilter(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
cell_t *startaddr, *endaddr;
|
cell_t *startaddr, *endaddr;
|
||||||
@@ -177,38 +156,6 @@ static cell_t smn_TRTraceRayFilter(IPluginContext *pContext, const cell_t *param
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell_t smn_TRTraceHullFilter(IPluginContext *pContext, const cell_t *params)
|
|
||||||
{
|
|
||||||
cell_t data;
|
|
||||||
IPluginFunction *pFunc;
|
|
||||||
cell_t *startaddr, *endaddr, *mins, *maxs;
|
|
||||||
|
|
||||||
pFunc = pContext->GetFunctionById(params[6]);
|
|
||||||
if (!pFunc)
|
|
||||||
{
|
|
||||||
return pContext->ThrowNativeError("Invalid function id (%X)", params[5]);
|
|
||||||
}
|
|
||||||
|
|
||||||
data = params[7];
|
|
||||||
|
|
||||||
g_SMTraceFilter.SetFunctionPtr(pFunc, data);
|
|
||||||
pContext->LocalToPhysAddr(params[1], &startaddr);
|
|
||||||
pContext->LocalToPhysAddr(params[2], &endaddr);
|
|
||||||
pContext->LocalToPhysAddr(params[3], &mins);
|
|
||||||
pContext->LocalToPhysAddr(params[4], &maxs);
|
|
||||||
|
|
||||||
g_StartVec.Init(sp_ctof(startaddr[0]), sp_ctof(startaddr[1]), sp_ctof(startaddr[2]));
|
|
||||||
g_HullMins.Init(sp_ctof(mins[0]), sp_ctof(mins[1]), sp_ctof(mins[2]));
|
|
||||||
g_HullMaxs.Init(sp_ctof(maxs[0]), sp_ctof(maxs[1]), sp_ctof(maxs[2]));
|
|
||||||
g_EndVec.Init(sp_ctof(endaddr[0]), sp_ctof(endaddr[1]), sp_ctof(endaddr[2]));
|
|
||||||
|
|
||||||
g_Ray.Init(g_StartVec, g_EndVec, g_HullMins, g_HullMaxs);
|
|
||||||
enginetrace->TraceRay(g_Ray, params[5], &g_SMTraceFilter, &g_Trace);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static cell_t smn_TRTraceRayEx(IPluginContext *pContext, const cell_t *params)
|
static cell_t smn_TRTraceRayEx(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
cell_t *startaddr, *endaddr;
|
cell_t *startaddr, *endaddr;
|
||||||
@@ -255,38 +202,6 @@ static cell_t smn_TRTraceRayEx(IPluginContext *pContext, const cell_t *params)
|
|||||||
return hndl;
|
return hndl;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell_t smn_TRTraceHullEx(IPluginContext *pContext, const cell_t *params)
|
|
||||||
{
|
|
||||||
cell_t *startaddr, *endaddr, *mins, *maxs;
|
|
||||||
pContext->LocalToPhysAddr(params[1], &startaddr);
|
|
||||||
pContext->LocalToPhysAddr(params[2], &endaddr);
|
|
||||||
pContext->LocalToPhysAddr(params[3], &mins);
|
|
||||||
pContext->LocalToPhysAddr(params[4], &maxs);
|
|
||||||
|
|
||||||
Ray_t ray;
|
|
||||||
Vector StartVec, EndVec, vmins, vmaxs;
|
|
||||||
|
|
||||||
StartVec.Init(sp_ctof(startaddr[0]), sp_ctof(startaddr[1]), sp_ctof(startaddr[2]));
|
|
||||||
vmins.Init(sp_ctof(mins[0]), sp_ctof(mins[1]), sp_ctof(mins[2]));
|
|
||||||
vmaxs.Init(sp_ctof(maxs[0]), sp_ctof(maxs[1]), sp_ctof(maxs[2]));
|
|
||||||
EndVec.Init(sp_ctof(endaddr[0]), sp_ctof(endaddr[1]), sp_ctof(endaddr[2]));
|
|
||||||
|
|
||||||
ray.Init(StartVec, EndVec, vmins, vmaxs);
|
|
||||||
|
|
||||||
trace_t *tr = new trace_t;
|
|
||||||
enginetrace->TraceRay(ray, params[5], &g_HitAllFilter, tr);
|
|
||||||
|
|
||||||
HandleError herr;
|
|
||||||
Handle_t hndl;
|
|
||||||
if (!(hndl=handlesys->CreateHandle(g_TraceHandle, tr, pContext->GetIdentity(), myself->GetIdentity(), &herr)))
|
|
||||||
{
|
|
||||||
delete tr;
|
|
||||||
return pContext->ThrowNativeError("Unable to create a new trace handle (error %d)", herr);
|
|
||||||
}
|
|
||||||
|
|
||||||
return hndl;
|
|
||||||
}
|
|
||||||
|
|
||||||
static cell_t smn_TRTraceRayFilterEx(IPluginContext *pContext, const cell_t *params)
|
static cell_t smn_TRTraceRayFilterEx(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
IPluginFunction *pFunc;
|
IPluginFunction *pFunc;
|
||||||
@@ -352,50 +267,6 @@ static cell_t smn_TRTraceRayFilterEx(IPluginContext *pContext, const cell_t *par
|
|||||||
return hndl;
|
return hndl;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell_t smn_TRTraceHullFilterEx(IPluginContext *pContext, const cell_t *params)
|
|
||||||
{
|
|
||||||
IPluginFunction *pFunc;
|
|
||||||
cell_t *startaddr, *endaddr, *mins, *maxs;
|
|
||||||
cell_t data;
|
|
||||||
|
|
||||||
pFunc = pContext->GetFunctionById(params[6]);
|
|
||||||
if (!pFunc)
|
|
||||||
{
|
|
||||||
return pContext->ThrowNativeError("Invalid function id (%X)", params[5]);
|
|
||||||
}
|
|
||||||
pContext->LocalToPhysAddr(params[1], &startaddr);
|
|
||||||
pContext->LocalToPhysAddr(params[2], &endaddr);
|
|
||||||
pContext->LocalToPhysAddr(params[3], &mins);
|
|
||||||
pContext->LocalToPhysAddr(params[4], &maxs);
|
|
||||||
|
|
||||||
Vector StartVec, EndVec, vmins, vmaxs;
|
|
||||||
CSMTraceFilter smfilter;
|
|
||||||
Ray_t ray;
|
|
||||||
|
|
||||||
data = params[7];
|
|
||||||
|
|
||||||
smfilter.SetFunctionPtr(pFunc, data);
|
|
||||||
StartVec.Init(sp_ctof(startaddr[0]), sp_ctof(startaddr[1]), sp_ctof(startaddr[2]));
|
|
||||||
vmins.Init(sp_ctof(mins[0]), sp_ctof(mins[1]), sp_ctof(mins[2]));
|
|
||||||
vmaxs.Init(sp_ctof(maxs[0]), sp_ctof(maxs[1]), sp_ctof(maxs[2]));
|
|
||||||
EndVec.Init(sp_ctof(endaddr[0]), sp_ctof(endaddr[1]), sp_ctof(endaddr[2]));
|
|
||||||
|
|
||||||
ray.Init(StartVec, EndVec, vmins, vmaxs);
|
|
||||||
|
|
||||||
trace_t *tr = new trace_t;
|
|
||||||
enginetrace->TraceRay(ray, params[5], &smfilter, tr);
|
|
||||||
|
|
||||||
HandleError herr;
|
|
||||||
Handle_t hndl;
|
|
||||||
if (!(hndl=handlesys->CreateHandle(g_TraceHandle, tr, pContext->GetIdentity(), myself->GetIdentity(), &herr)))
|
|
||||||
{
|
|
||||||
delete tr;
|
|
||||||
return pContext->ThrowNativeError("Unable to create a new trace handle (error %d)", herr);
|
|
||||||
}
|
|
||||||
|
|
||||||
return hndl;
|
|
||||||
}
|
|
||||||
|
|
||||||
static cell_t smn_TRGetFraction(IPluginContext *pContext, const cell_t *params)
|
static cell_t smn_TRGetFraction(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
trace_t *tr;
|
trace_t *tr;
|
||||||
@@ -558,9 +429,7 @@ static cell_t smn_TRGetPointContentsEnt(IPluginContext *pContext, const cell_t *
|
|||||||
sp_nativeinfo_t g_TRNatives[] =
|
sp_nativeinfo_t g_TRNatives[] =
|
||||||
{
|
{
|
||||||
{"TR_TraceRay", smn_TRTraceRay},
|
{"TR_TraceRay", smn_TRTraceRay},
|
||||||
{"TR_TraceHull", smn_TRTraceHull},
|
|
||||||
{"TR_TraceRayEx", smn_TRTraceRayEx},
|
{"TR_TraceRayEx", smn_TRTraceRayEx},
|
||||||
{"TR_TraceHullEx", smn_TRTraceHullEx},
|
|
||||||
{"TR_GetFraction", smn_TRGetFraction},
|
{"TR_GetFraction", smn_TRGetFraction},
|
||||||
{"TR_GetEndPosition", smn_TRGetEndPosition},
|
{"TR_GetEndPosition", smn_TRGetEndPosition},
|
||||||
{"TR_GetEntityIndex", smn_TRGetEntityIndex},
|
{"TR_GetEntityIndex", smn_TRGetEntityIndex},
|
||||||
@@ -570,8 +439,6 @@ sp_nativeinfo_t g_TRNatives[] =
|
|||||||
{"TR_GetPointContentsEnt", smn_TRGetPointContentsEnt},
|
{"TR_GetPointContentsEnt", smn_TRGetPointContentsEnt},
|
||||||
{"TR_TraceRayFilter", smn_TRTraceRayFilter},
|
{"TR_TraceRayFilter", smn_TRTraceRayFilter},
|
||||||
{"TR_TraceRayFilterEx", smn_TRTraceRayFilterEx},
|
{"TR_TraceRayFilterEx", smn_TRTraceRayFilterEx},
|
||||||
{"TR_TraceHullFilter", smn_TRTraceHullFilter},
|
|
||||||
{"TR_TraceHullFilterEx", smn_TRTraceHullFilterEx},
|
|
||||||
{"TR_GetPlaneNormal", smn_TRGetPlaneNormal},
|
{"TR_GetPlaneNormal", smn_TRGetPlaneNormal},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user