Compare commits
1 Commits
amxmodx-1.
...
amxmodx-1.
Author | SHA1 | Date | |
---|---|---|---|
38a339fb1c |
@ -56,8 +56,6 @@ CForward::CForward(const char *name, ForwardExecType et, int numParams, const Fo
|
||||
m_Funcs.push_back(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
m_Name.assign(name);
|
||||
}
|
||||
|
||||
cell CForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
|
||||
@ -212,16 +210,12 @@ cell CForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
|
||||
|
||||
void CSPForward::Set(int func, AMX *amx, int numParams, const ForwardParam *paramTypes)
|
||||
{
|
||||
char name[sNAMEMAX];
|
||||
m_Func = func;
|
||||
m_Amx = amx;
|
||||
m_NumParams = numParams;
|
||||
memcpy((void *)m_ParamTypes, paramTypes, numParams * sizeof(ForwardParam));
|
||||
m_HasFunc = true;
|
||||
isFree = false;
|
||||
name[0] = '\0';
|
||||
amx_GetPublic(amx, func, name);
|
||||
m_Name.assign(name);
|
||||
}
|
||||
|
||||
void CSPForward::Set(const char *funcName, AMX *amx, int numParams, const ForwardParam *paramTypes)
|
||||
@ -231,7 +225,6 @@ void CSPForward::Set(const char *funcName, AMX *amx, int numParams, const Forwar
|
||||
memcpy((void *)m_ParamTypes, paramTypes, numParams * sizeof(ForwardParam));
|
||||
m_HasFunc = (amx_FindPublic(amx, funcName, &m_Func) == AMX_ERR_NONE);
|
||||
isFree = false;
|
||||
m_Name.assign(funcName);
|
||||
}
|
||||
|
||||
cell CSPForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
|
||||
@ -452,11 +445,6 @@ cell CForwardMngr::executeForwards(int id, cell *params)
|
||||
return retVal;
|
||||
}
|
||||
|
||||
const char *CForwardMngr::getFuncName(int id) const
|
||||
{
|
||||
return (id & 1) ? m_SPForwards[id >> 1]->getFuncName() : m_Forwards[id >> 1]->getFuncName();
|
||||
}
|
||||
|
||||
int CForwardMngr::getParamsNum(int id) const
|
||||
{
|
||||
return (id & 1) ? m_SPForwards[id >> 1]->getParamsNum() : m_Forwards[id >> 1]->getParamsNum();
|
||||
|
@ -93,7 +93,6 @@ class CForward
|
||||
const char *m_FuncName;
|
||||
ForwardExecType m_ExecType;
|
||||
int m_NumParams;
|
||||
String m_Name;
|
||||
|
||||
struct AMXForward
|
||||
{
|
||||
@ -121,11 +120,6 @@ public:
|
||||
{
|
||||
return m_Funcs.size();
|
||||
}
|
||||
|
||||
const char *getFuncName() const
|
||||
{
|
||||
return m_Name.c_str();
|
||||
}
|
||||
|
||||
ForwardParam getParamType(int paramId) const
|
||||
{
|
||||
@ -147,7 +141,6 @@ class CSPForward
|
||||
|
||||
int m_Func;
|
||||
bool m_HasFunc;
|
||||
String m_Name;
|
||||
|
||||
public:
|
||||
bool isFree;
|
||||
@ -167,11 +160,6 @@ public:
|
||||
{
|
||||
return (m_HasFunc) ? 1 : 0;
|
||||
}
|
||||
|
||||
const char *getFuncName() const
|
||||
{
|
||||
return m_Name.c_str();
|
||||
}
|
||||
|
||||
ForwardParam getParamType(int paramId) const
|
||||
{
|
||||
@ -219,7 +207,6 @@ public:
|
||||
bool isSPForward(int id) const; // check whether forward is single plugin
|
||||
int getParamsNum(int id) const; // get num of params of a forward
|
||||
int getFuncsNum(int id) const; // get num of found functions of a forward
|
||||
const char *getFuncName(int id) const; // get the function name
|
||||
|
||||
ForwardParam getParamType(int id, int paramId) const;
|
||||
cell prepareArray(void *ptr, unsigned int size, ForwardArrayElemType type, bool copyBack); // prepare array
|
||||
|
@ -30,7 +30,6 @@
|
||||
*/
|
||||
|
||||
#include "amxmodx.h"
|
||||
#include "libraries.h"
|
||||
|
||||
#ifndef FAR
|
||||
#define FAR
|
||||
@ -42,8 +41,6 @@ typedef int (FAR *QUERYMOD_NEW)(int * /*ifvers*/, amxx_module_info_s * /*modInfo
|
||||
typedef int (FAR *ATTACHMOD_NEW)(PFN_REQ_FNPTR /*reqFnptrFunc*/);
|
||||
typedef int (FAR *DETACHMOD_NEW)(void);
|
||||
typedef void (FAR *PLUGINSLOADED_NEW)(void);
|
||||
typedef void (*PLUGINSUNLOADED_NEW)(void);
|
||||
typedef void (*PLUGINSUNLOADING_NEW)(void);
|
||||
|
||||
// *****************************************************
|
||||
// class CModule
|
||||
@ -82,12 +79,6 @@ void CModule::clear(bool clearFilename)
|
||||
m_InfoNew.reload = 0;
|
||||
m_MissingFunc = NULL;
|
||||
|
||||
for (size_t i=0; i<m_DestroyableIndexes.size(); i++)
|
||||
{
|
||||
delete [] m_Natives[m_DestroyableIndexes[i]];
|
||||
}
|
||||
|
||||
m_DestroyableIndexes.clear();
|
||||
m_Natives.clear();
|
||||
}
|
||||
|
||||
@ -111,53 +102,6 @@ bool CModule::attachMetamod(const char *mmfile, PLUG_LOADTIME now)
|
||||
return true;
|
||||
}
|
||||
|
||||
//this ugly function is ultimately something like O(n^4).
|
||||
//sigh. it shouldn't be needed.
|
||||
void CModule::rewriteNativeLists(AMX_NATIVE_INFO *list)
|
||||
{
|
||||
AMX_NATIVE_INFO *curlist;
|
||||
for (size_t i=0; i<m_Natives.size(); i++)
|
||||
{
|
||||
curlist = m_Natives[i];
|
||||
bool changed = false;
|
||||
bool found = false;
|
||||
CVector<size_t> newlist;
|
||||
for (size_t j=0; curlist[j].func != NULL; j++)
|
||||
{
|
||||
found = false;
|
||||
for (size_t k=0; list[k].func != NULL; k++)
|
||||
{
|
||||
if (strcmp(curlist[j].name, list[k].name) == 0)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
changed = true;
|
||||
//don't break, we have to search it all
|
||||
} else {
|
||||
newlist.push_back(j);
|
||||
}
|
||||
}
|
||||
if (changed)
|
||||
{
|
||||
//now build the new list
|
||||
AMX_NATIVE_INFO *rlist = new AMX_NATIVE_INFO[newlist.size()+1];
|
||||
for (size_t j=0; j<newlist.size(); j++)
|
||||
{
|
||||
rlist[j].func = curlist[newlist[j]].func;
|
||||
rlist[j].name = curlist[newlist[j]].name;
|
||||
}
|
||||
rlist[newlist.size()].func = NULL;
|
||||
rlist[newlist.size()].name = NULL;
|
||||
m_Natives[i] = rlist;
|
||||
m_DestroyableIndexes.push_back(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CModule::attachModule()
|
||||
{
|
||||
// old & new
|
||||
@ -182,7 +126,7 @@ bool CModule::attachModule()
|
||||
{
|
||||
case AMXX_OK:
|
||||
m_Status = MODULE_LOADED;
|
||||
break;
|
||||
return true;
|
||||
case AMXX_PARAM:
|
||||
AMXXLOG_Log("[AMXX] Internal Error: Module \"%s\" (version \"%s\") retured \"Invalid parameter\" from Attach func.", m_Filename.c_str(), getVersion());
|
||||
m_Status = MODULE_INTERROR;
|
||||
@ -200,13 +144,6 @@ bool CModule::attachModule()
|
||||
m_Status = MODULE_BADLOAD;
|
||||
}
|
||||
|
||||
if (m_Status == MODULE_LOADED)
|
||||
{
|
||||
AddLibrariesFromString(m_InfoNew.library, LibType_Library, LibSource_Module, this);
|
||||
AddLibrariesFromString(m_InfoNew.libclass, LibType_Class, LibSource_Module, this);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -247,36 +184,10 @@ bool CModule::queryModule()
|
||||
return false;
|
||||
case AMXX_IFVERS:
|
||||
if (ifVers < AMXX_INTERFACE_VERSION)
|
||||
{
|
||||
//backwards compat for new defs
|
||||
if (ifVers == 3)
|
||||
{
|
||||
g_ModuleCallReason = ModuleCall_Query;
|
||||
g_CurrentlyCalledModule = this;
|
||||
retVal = (*queryFunc_New)(&ifVers, &m_InfoNew);
|
||||
g_CurrentlyCalledModule = NULL;
|
||||
g_ModuleCallReason = ModuleCall_NotCalled;
|
||||
if (retVal == AMXX_OK)
|
||||
{
|
||||
m_InfoNew.library = m_InfoNew.logtag;
|
||||
if (StrCaseStr(m_InfoNew.library, "sql")
|
||||
|| StrCaseStr(m_InfoNew.library, "dbi"))
|
||||
{
|
||||
m_InfoNew.libclass = "DBI";
|
||||
} else {
|
||||
m_InfoNew.libclass = "";
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
m_Status = MODULE_OLD;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
m_Status = MODULE_OLD;
|
||||
else
|
||||
m_Status = MODULE_NEWER;
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
case AMXX_OK:
|
||||
break;
|
||||
default:
|
||||
@ -306,8 +217,6 @@ bool CModule::detachModule()
|
||||
if (m_Status != MODULE_LOADED)
|
||||
return false;
|
||||
|
||||
RemoveLibraries(this);
|
||||
|
||||
if (m_Amxx)
|
||||
{
|
||||
DETACHMOD_NEW detachFunc_New = (DETACHMOD_NEW)DLPROC(m_Handle, "AMXX_Detach");
|
||||
@ -335,38 +244,6 @@ bool CModule::detachModule()
|
||||
return true;
|
||||
}
|
||||
|
||||
void CModule::CallPluginsUnloaded()
|
||||
{
|
||||
if (m_Status != MODULE_LOADED)
|
||||
return;
|
||||
|
||||
if (!m_Handle)
|
||||
return;
|
||||
|
||||
PLUGINSUNLOADED_NEW func = (PLUGINSUNLOADED_NEW)DLPROC(m_Handle, "AMXX_PluginsUnloaded");
|
||||
|
||||
if (!func)
|
||||
return;
|
||||
|
||||
func();
|
||||
}
|
||||
|
||||
void CModule::CallPluginsUnloading()
|
||||
{
|
||||
if (m_Status != MODULE_LOADED)
|
||||
return;
|
||||
|
||||
if (!m_Handle)
|
||||
return;
|
||||
|
||||
PLUGINSUNLOADING_NEW func = (PLUGINSUNLOADING_NEW)DLPROC(m_Handle, "AMXX_PluginsUnloading");
|
||||
|
||||
if (!func)
|
||||
return;
|
||||
|
||||
func();
|
||||
}
|
||||
|
||||
void CModule::CallPluginsLoaded()
|
||||
{
|
||||
if (m_Status != MODULE_LOADED)
|
||||
|
@ -59,8 +59,6 @@ struct amxx_module_info_s
|
||||
const char *version;
|
||||
int reload; // reload on mapchange when nonzero
|
||||
const char *logtag; //added in version 2
|
||||
const char *library; // added in version 4
|
||||
const char *libclass; // added in version 4
|
||||
};
|
||||
|
||||
#define AMXX_OK 0 /* no error */
|
||||
@ -68,7 +66,7 @@ struct amxx_module_info_s
|
||||
#define AMXX_PARAM 2 /* Invalid parameter */
|
||||
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
|
||||
|
||||
#define AMXX_INTERFACE_VERSION 4
|
||||
#define AMXX_INTERFACE_VERSION 3
|
||||
|
||||
class CModule
|
||||
{
|
||||
@ -92,7 +90,6 @@ public:
|
||||
bool attachModule();
|
||||
bool queryModule();
|
||||
bool detachModule();
|
||||
void rewriteNativeLists(AMX_NATIVE_INFO *list);
|
||||
|
||||
#ifndef FAKEMETA
|
||||
bool attachMetamod(const char *mmfile, PLUG_LOADTIME now);
|
||||
@ -113,11 +110,8 @@ public:
|
||||
inline bool IsMetamod() { return m_Metamod; }
|
||||
|
||||
void CallPluginsLoaded();
|
||||
void CallPluginsUnloaded();
|
||||
void CallPluginsUnloading();
|
||||
|
||||
CVector<AMX_NATIVE_INFO*> m_Natives;
|
||||
CVector<size_t> m_DestroyableIndexes;
|
||||
CList<AMX_NATIVE_INFO*> m_Natives;
|
||||
};
|
||||
|
||||
#endif //CMODULE_H
|
||||
|
@ -36,7 +36,6 @@
|
||||
#include "amx.h"
|
||||
#include "natives.h"
|
||||
#include "debugger.h"
|
||||
#include "libraries.h"
|
||||
|
||||
extern const char *no_function;
|
||||
|
||||
@ -108,17 +107,6 @@ int CPluginMngr::loadPluginsFromFile(const char* filename)
|
||||
|
||||
line.clear();
|
||||
line._fread(fp);
|
||||
/** quick hack */
|
||||
char *ptr = const_cast<char *>(line.c_str());
|
||||
while (*ptr)
|
||||
{
|
||||
if (*ptr == ';')
|
||||
{
|
||||
*ptr = '\0';
|
||||
} else {
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
sscanf(line.c_str(), "%s %s", pluginName, debug);
|
||||
|
||||
if (!isalnum(*pluginName))
|
||||
@ -142,8 +130,6 @@ int CPluginMngr::loadPluginsFromFile(const char* filename)
|
||||
|
||||
fclose(fp);
|
||||
|
||||
InvalidateCache();
|
||||
|
||||
return pCounter;
|
||||
}
|
||||
|
||||
@ -252,8 +238,8 @@ CPluginMngr::CPlugin::CPlugin(int i, const char* p, const char* n, char* e, int
|
||||
|
||||
if (status == ps_running)
|
||||
{
|
||||
m_PauseFwd = registerSPForwardByName(&amx, "plugin_pause", FP_DONE);
|
||||
m_UnpauseFwd = registerSPForwardByName(&amx, "plugin_unpause", FP_DONE);
|
||||
m_PauseFwd = registerSPForwardByName(&amx, "plugin_pause");
|
||||
m_UnpauseFwd = registerSPForwardByName(&amx, "plugin_unpause");
|
||||
|
||||
if (amx.flags & AMX_FLAG_DEBUG)
|
||||
{
|
||||
@ -397,251 +383,3 @@ void CPluginMngr::CPlugin::unpausePlugin()
|
||||
executeForwards(m_UnpauseFwd);
|
||||
}
|
||||
}
|
||||
|
||||
char *CPluginMngr::ReadIntoOrFromCache(const char *file, size_t &bufsize)
|
||||
{
|
||||
List<plcache_entry *>::iterator iter;
|
||||
plcache_entry *pl;
|
||||
|
||||
for (iter=m_plcache.begin(); iter!=m_plcache.end(); iter++)
|
||||
{
|
||||
pl = (*iter);
|
||||
if (pl->path.compare(file) == 0)
|
||||
{
|
||||
bufsize = pl->bufsize;
|
||||
return pl->buffer;
|
||||
}
|
||||
}
|
||||
|
||||
pl = new plcache_entry;
|
||||
|
||||
pl->file = new CAmxxReader(file, sizeof(cell));
|
||||
pl->buffer = NULL;
|
||||
if (pl->file->GetStatus() != CAmxxReader::Err_None)
|
||||
{
|
||||
delete pl->file;
|
||||
delete pl;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pl->bufsize = pl->file->GetBufferSize();
|
||||
if (pl->bufsize)
|
||||
{
|
||||
pl->buffer = new char[pl->bufsize];
|
||||
pl->file->GetSection(pl->buffer);
|
||||
}
|
||||
|
||||
if (!pl->buffer || pl->file->GetStatus() != CAmxxReader::Err_None)
|
||||
{
|
||||
delete [] pl->buffer;
|
||||
delete pl->file;
|
||||
delete pl;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pl->path.assign(file);
|
||||
|
||||
bufsize = pl->bufsize;
|
||||
|
||||
m_plcache.push_back(pl);
|
||||
|
||||
return pl->buffer;
|
||||
}
|
||||
|
||||
void CPluginMngr::InvalidateCache()
|
||||
{
|
||||
List<plcache_entry *>::iterator iter;
|
||||
plcache_entry *pl;
|
||||
|
||||
for (iter=m_plcache.begin(); iter!=m_plcache.end(); iter++)
|
||||
{
|
||||
pl = (*iter);
|
||||
delete [] pl->buffer;
|
||||
delete pl->file;
|
||||
delete pl;
|
||||
}
|
||||
|
||||
m_plcache.clear();
|
||||
}
|
||||
|
||||
void CPluginMngr::InvalidateFileInCache(const char *file, bool freebuf)
|
||||
{
|
||||
List<plcache_entry *>::iterator iter;
|
||||
plcache_entry *pl;
|
||||
|
||||
for (iter=m_plcache.begin(); iter!=m_plcache.end(); iter++)
|
||||
{
|
||||
pl = (*iter);
|
||||
if (pl->path.compare(file) == 0)
|
||||
{
|
||||
if (freebuf)
|
||||
delete [] pl->buffer;
|
||||
delete pl->file;
|
||||
delete pl;
|
||||
m_plcache.erase(iter);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CPluginMngr::CacheAndLoadModules(const char *plugin)
|
||||
{
|
||||
size_t progsize;
|
||||
char *prog = ReadIntoOrFromCache(plugin, progsize);
|
||||
|
||||
if (!prog)
|
||||
return;
|
||||
|
||||
AMX_HEADER hdr;
|
||||
memcpy(&hdr, prog, sizeof(AMX_HEADER));
|
||||
|
||||
uint16_t magic = hdr.magic;
|
||||
amx_Align16(&magic);
|
||||
|
||||
if (magic != AMX_MAGIC)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (hdr.file_version < MIN_FILE_VERSION ||
|
||||
hdr.file_version > CUR_FILE_VERSION)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ((hdr.defsize != sizeof(AMX_FUNCSTUB)) &&
|
||||
(hdr.defsize != sizeof(AMX_FUNCSTUBNT)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
amx_Align32((uint32_t*)&hdr.nametable);
|
||||
uint16_t *namelength=(uint16_t*)((unsigned char*)prog + (unsigned)hdr.nametable);
|
||||
amx_Align16(namelength);
|
||||
if (*namelength>sNAMEMAX)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (hdr.stp <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AMX amx;
|
||||
memset(&amx, 0, sizeof(AMX));
|
||||
amx.base = (unsigned char *)prog;
|
||||
|
||||
int num;
|
||||
char name[sNAMEMAX+1];
|
||||
|
||||
num = amx_GetLibraries(&amx);
|
||||
for (int i=0; i<num; i++)
|
||||
{
|
||||
amx_GetLibrary(&amx, i, name, sNAMEMAX);
|
||||
if (stricmp(name, "Float")==0)
|
||||
continue;
|
||||
//awful backwards compat hack
|
||||
if (stricmp(name, "socket")==0)
|
||||
strcpy(name, "sockets");
|
||||
//we don't want to report failed modules here...
|
||||
LoadModule(name, PT_ANYTIME, true, true);
|
||||
}
|
||||
|
||||
cell tag_id;
|
||||
amx_NumTags(&amx, &num);
|
||||
|
||||
CVector<LibDecoder *> expects;
|
||||
CVector<LibDecoder *> defaults;
|
||||
CStack<LibDecoder *> delstack;
|
||||
for (int i=0; i<num; i++)
|
||||
{
|
||||
amx_GetTag(&amx, i, name, &tag_id);
|
||||
if (name[0] == '?')
|
||||
{
|
||||
LibDecoder *dc = new LibDecoder;
|
||||
delstack.push(dc);
|
||||
if (DecodeLibCmdString(name, dc))
|
||||
{
|
||||
if (dc->cmd == LibCmd_ForceLib)
|
||||
{
|
||||
RunLibCommand(dc);
|
||||
} else if ( (dc->cmd == LibCmd_ExpectClass) ||
|
||||
(dc->cmd == LibCmd_ExpectLib) )
|
||||
{
|
||||
expects.push_back(dc);
|
||||
} else if (dc->cmd == LibCmd_DefaultLib) {
|
||||
defaults.push_back(dc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i=0; i<expects.size(); i++)
|
||||
{
|
||||
RunLibCommand(expects[i]);
|
||||
}
|
||||
for (size_t i=0; i<defaults.size(); i++)
|
||||
{
|
||||
RunLibCommand(defaults[i]);
|
||||
}
|
||||
|
||||
expects.clear();
|
||||
defaults.clear();
|
||||
|
||||
while (!delstack.empty())
|
||||
{
|
||||
delete delstack.front();
|
||||
delstack.pop();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void CPluginMngr::CALMFromFile(const char *file)
|
||||
{
|
||||
char filename[256];
|
||||
FILE *fp = fopen(build_pathname_r(filename, sizeof(filename) - 1, "%s", file), "rt");
|
||||
|
||||
if (!fp)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Find now folder
|
||||
char pluginName[256];
|
||||
char line[256];
|
||||
String rline;
|
||||
|
||||
while (!feof(fp))
|
||||
{
|
||||
fgets(line, sizeof(line)-1, fp);
|
||||
if (line[0] == ';' || line[0] == '\n' || line[0] == '\0')
|
||||
continue;
|
||||
|
||||
/** quick hack */
|
||||
char *ptr = line;
|
||||
while (*ptr)
|
||||
{
|
||||
if (*ptr == ';')
|
||||
{
|
||||
*ptr = '\0';
|
||||
} else {
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
|
||||
rline.assign(line);
|
||||
rline.trim();
|
||||
pluginName[0] = '\0';
|
||||
sscanf(rline.c_str(), "%s", pluginName);
|
||||
|
||||
if (!isalnum(*pluginName))
|
||||
continue;
|
||||
|
||||
build_pathname_r(filename, sizeof(filename)-1, "%s/%s", get_localinfo("amxx_pluginsdir", "addons/amxmodx/plugins"), pluginName);
|
||||
|
||||
CacheAndLoadModules(filename);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
|
@ -32,11 +32,6 @@
|
||||
#ifndef PLUGIN_H
|
||||
#define PLUGIN_H
|
||||
|
||||
#include "CString.h"
|
||||
#include "sh_list.h"
|
||||
#include "amx.h"
|
||||
#include "amxxfile.h"
|
||||
|
||||
// *****************************************************
|
||||
// class CPluginMngr
|
||||
// *****************************************************
|
||||
@ -116,7 +111,7 @@ private:
|
||||
int pCounter;
|
||||
public:
|
||||
CPluginMngr() { head = 0; pCounter = 0; pNatives = NULL; m_Finalized=false;}
|
||||
~CPluginMngr() { clear(); InvalidateCache(); }
|
||||
~CPluginMngr() { clear(); }
|
||||
|
||||
bool m_Finalized;
|
||||
AMX_NATIVE_INFO *pNatives;
|
||||
@ -150,21 +145,6 @@ public:
|
||||
|
||||
inline iterator begin() const { return iterator(head); }
|
||||
inline iterator end() const { return iterator(0); }
|
||||
public:
|
||||
struct plcache_entry
|
||||
{
|
||||
CAmxxReader *file;
|
||||
size_t bufsize;
|
||||
char *buffer;
|
||||
String path;
|
||||
};
|
||||
char *ReadIntoOrFromCache(const char *file, size_t &bufsize);
|
||||
void InvalidateCache();
|
||||
void InvalidateFileInCache(const char *file, bool freebuf);
|
||||
void CacheAndLoadModules(const char *plugin);
|
||||
void CALMFromFile(const char *file);
|
||||
private:
|
||||
List<plcache_entry *> m_plcache;
|
||||
};
|
||||
|
||||
#endif //PLUGIN_H
|
||||
|
@ -34,6 +34,16 @@
|
||||
|
||||
/*********************** CTask ***********************/
|
||||
|
||||
int CTaskMngr::CTask::getTaskId() const
|
||||
{
|
||||
return m_iId;
|
||||
}
|
||||
|
||||
CPluginMngr::CPlugin *CTaskMngr::CTask::getPlugin() const
|
||||
{
|
||||
return m_pPlugin;
|
||||
}
|
||||
|
||||
void CTaskMngr::CTask::set(CPluginMngr::CPlugin *pPlugin, int iFunc, int iFlags, cell iId, float fBase, int iParamsLen, const cell *pParams, int iRepeat, float fCurrentTime)
|
||||
{
|
||||
clear();
|
||||
@ -43,7 +53,6 @@ void CTaskMngr::CTask::set(CPluginMngr::CPlugin *pPlugin, int iFunc, int iFlags,
|
||||
m_iFunc = iFunc;
|
||||
m_iId = iId;
|
||||
m_fBase = fBase;
|
||||
m_bInExecute = false;
|
||||
|
||||
if (iFlags & 2)
|
||||
{
|
||||
@ -141,7 +150,6 @@ void CTaskMngr::CTask::executeIfRequired(float fCurrentTime, float fTimeLimit, f
|
||||
//only bother calling if we have something to call
|
||||
if (!(m_bLoop && !m_iRepeat))
|
||||
{
|
||||
m_bInExecute = true;
|
||||
if (m_iParamLen) // call with parameters
|
||||
{
|
||||
cell arr = prepareCellArray(m_pParams, m_iParamLen);
|
||||
@ -149,7 +157,6 @@ void CTaskMngr::CTask::executeIfRequired(float fCurrentTime, float fTimeLimit, f
|
||||
} else {
|
||||
executeForwards(m_iFunc, m_iId);
|
||||
}
|
||||
m_bInExecute = false;
|
||||
}
|
||||
|
||||
if (isFree())
|
||||
@ -186,7 +193,6 @@ CTaskMngr::CTask::CTask()
|
||||
m_bLoop = false;
|
||||
m_bAfterStart = false;
|
||||
m_bBeforeEnd = false;
|
||||
m_bInExecute = false;
|
||||
|
||||
m_fNextExecTime = 0.0f;
|
||||
|
||||
|
@ -45,7 +45,6 @@ private:
|
||||
int m_iFunc;
|
||||
int m_iRepeat;
|
||||
|
||||
bool m_bInExecute;
|
||||
bool m_bLoop;
|
||||
bool m_bAfterStart;
|
||||
bool m_bBeforeEnd;
|
||||
@ -62,15 +61,13 @@ private:
|
||||
void clear();
|
||||
bool isFree() const;
|
||||
|
||||
inline CPluginMngr::CPlugin *getPlugin() const { return m_pPlugin; }
|
||||
inline AMX *getAMX() const { return m_pPlugin->getAMX(); }
|
||||
inline int getTaskId() const { return m_iId; }
|
||||
CPluginMngr::CPlugin *getPlugin() const;
|
||||
int getTaskId() const;
|
||||
|
||||
void executeIfRequired(float fCurrentTime, float fTimeLimit, float fTimeLeft); // also removes the task if needed
|
||||
|
||||
void changeBase(float fNewBase);
|
||||
void resetNextExecTime(float fCurrentTime);
|
||||
inline bool inExecute() const { return m_bInExecute; }
|
||||
|
||||
bool shouldRepeat();
|
||||
|
||||
@ -95,11 +92,9 @@ private:
|
||||
friend bool operator == (const CTask &left, const CTaskDescriptor &right)
|
||||
{
|
||||
if (right.m_bFree)
|
||||
return (left.isFree() && !left.inExecute());
|
||||
return left.isFree();
|
||||
|
||||
return (!left.isFree()) &&
|
||||
(right.m_pAmx ? left.getAMX() == right.m_pAmx : true) &&
|
||||
(left.getTaskId() == right.m_iId);
|
||||
return !left.isFree() && (right.m_pAmx ? left.getPlugin()->getAMX() == right.m_pAmx : true) && left.getTaskId() == right.m_iId;
|
||||
}
|
||||
};
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -9,19 +9,16 @@ MM_ROOT = ../metamod/metamod
|
||||
OPT_FLAGS = -O2 -funroll-loops -s -fomit-frame-pointer -pipe
|
||||
DEBUG_FLAGS = -g -ggdb3
|
||||
CPP = gcc
|
||||
NAME = amxmodx
|
||||
|
||||
BIN_SUFFIX_32 = mm_i386.so
|
||||
BIN_SUFFIX_64 = mm_amd64.so
|
||||
NAME = amxmodx_mm
|
||||
|
||||
OBJECTS = meta_api.cpp CFile.cpp CVault.cpp vault.cpp float.cpp file.cpp modules.cpp \
|
||||
CMisc.cpp CTask.cpp string.cpp amxmodx.cpp CEvent.cpp CCmd.cpp CLogEvent.cpp \
|
||||
srvcmd.cpp strptime.cpp amxcore.cpp amxtime.cpp power.cpp amxxlog.cpp fakemeta.cpp \
|
||||
amxxfile.cpp CLang.cpp md5.cpp emsg.cpp CForward.cpp CPlugin.cpp CModule.cpp \
|
||||
CMenu.cpp util.cpp amx.cpp amxdbg.cpp natives.cpp newmenus.cpp debugger.cpp \
|
||||
optimizer.cpp format.cpp messages.cpp libraries.cpp vector.cpp
|
||||
optimizer.cpp format.cpp
|
||||
|
||||
LINK = /lib/libstdc++.a
|
||||
LINK = -lz /lib/libstdc++.a
|
||||
|
||||
INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \
|
||||
-I$(MM_ROOT) -Lzlib -I$(HLSDK)/common
|
||||
@ -34,26 +31,22 @@ else
|
||||
CFLAGS = $(OPT_FLAGS)
|
||||
endif
|
||||
|
||||
ifeq "$(BINLOG)" "true"
|
||||
NAME := $(NAME)_bl
|
||||
BIN_DIR := $(BIN_DIR)BinLog
|
||||
OBJECTS += binlog.cpp
|
||||
CFLAGS += -DBINLOG_ENABLED
|
||||
ifeq "$(MMGR)" "true"
|
||||
OBJECTS += mmgr/mmgr.cpp
|
||||
CFLAGS += -DMEMORY_TEST
|
||||
endif
|
||||
|
||||
CFLAGS += -DLINUX -DNDEBUG -fPIC -Wno-deprecated -DHAVE_STDINT_H -static-libgcc -fno-rtti -fno-exceptions
|
||||
|
||||
ifeq "$(AMD64)" "true"
|
||||
BINARY = $(NAME)_$(BIN_SUFFIX_64)
|
||||
CFLAGS += -DPAWN_CELL_SIZE=64 -DHAVE_I64 -DAMD64 -m64
|
||||
LINK += -lz64
|
||||
BINARY = $(NAME)_amd64.so
|
||||
CFLAGS += -DPAWN_CELL_SIZE=64 -DHAVE_I64 -DAMD64 -m64
|
||||
OBJECTS += JIT/natives-amd64.o
|
||||
else
|
||||
BINARY = $(NAME)_$(BIN_SUFFIX_32)
|
||||
BINARY = $(NAME)_i386.so
|
||||
OBJECTS += JIT/amxexecn.o JIT/amxjitsn.o JIT/natives-x86.o
|
||||
OBJECTS += JIT/helpers-x86.o
|
||||
CFLAGS += -DPAWN_CELL_SIZE=32 -DJIT -DASM32
|
||||
LINK += -lz
|
||||
OPT_FLAGS += -march=i586
|
||||
endif
|
||||
|
||||
@ -70,23 +63,23 @@ amd64:
|
||||
rm -f zlib/libz.a
|
||||
$(MAKE) all AMD64=true
|
||||
|
||||
amd64_mmgr:
|
||||
rm -f zlib/libz.a
|
||||
$(MAKE) all AMD64=true MMGR=true
|
||||
|
||||
amd64_debug_mmgr:
|
||||
rm -f zlib/libz.a
|
||||
$(MAKE) all AMD64=true DEBUG=true MMGR=true
|
||||
|
||||
amd64_debug:
|
||||
rm -f zlib/libz.a
|
||||
$(MAKE) all AMD64=true DEBUG=true
|
||||
|
||||
amd64_binlog:
|
||||
rm -f zlib/libz.a
|
||||
$(MAKE) all AMD64=true BINLOG=true
|
||||
mmgr:
|
||||
$(MAKE) all MMGR=true
|
||||
|
||||
amd64_binlog_debug:
|
||||
rm -f zlib/libz.a
|
||||
$(MAKE) all AMD64=true BINLOG=true DEBUG=true
|
||||
|
||||
binlog:
|
||||
$(MAKE) all BINLOG=true
|
||||
|
||||
binlog_debug:
|
||||
$(MAKE) all BINLOG=true DEBUG=true
|
||||
debug_mmgr:
|
||||
$(MAKE) all MMGR=true DEBUG=true
|
||||
|
||||
amxmodx: $(OBJ_LINUX)
|
||||
$(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
||||
@ -98,14 +91,7 @@ default: all
|
||||
|
||||
clean:
|
||||
rm -rf Release/*.o
|
||||
rm -rf Release/$(NAME)_$(BIN_SUFFIX_32)
|
||||
rm -rf Release/$(NAME)_$(BIN_SUFFIX_64)
|
||||
rm -rf ReleaseBinLog/*.o
|
||||
rm -rf ReleaseBinLog/$(NAME)_bl_$(BIN_SUFFIX_32)
|
||||
rm -rf ReleaseBinLog/$(NAME)_bl_$(BIN_SUFFIX_64)
|
||||
rm -rf Release/$(BINARY)
|
||||
rm -rf Debug/*.o
|
||||
rm -rf Debug/$(NAME)_$(BIN_SUFFIX_32)
|
||||
rm -rf Debug/$(NAME)_$(BIN_SUFFIX_64)
|
||||
rm -rf DebugBinLog/*.o
|
||||
rm -rf DebugBinLog/$(NAME)_bl_$(BIN_SUFFIX_32)
|
||||
rm -rf DebugBinLog/$(NAME)_bl_$(BIN_SUFFIX_64)
|
||||
rm -rf Debug/$(BINARY)
|
||||
|
||||
|
167
amxmodx/amx.cpp
167
amxmodx/amx.cpp
@ -844,6 +844,19 @@ int AMXAPI amx_Init(AMX *amx, void *program)
|
||||
{
|
||||
AMX_HEADER *hdr;
|
||||
BROWSEHOOK hook = NULL;
|
||||
#if (defined _Windows || defined LINUX || defined __FreeBSD__ || defined __OpenBSD__) && !defined AMX_NODYNALOAD
|
||||
char libname[sNAMEMAX+8]; /* +1 for '\0', +3 for 'amx' prefix, +4 for extension */
|
||||
#if defined _Windows
|
||||
typedef int (FAR WINAPI *AMX_ENTRY)(AMX _FAR *amx);
|
||||
HINSTANCE hlib;
|
||||
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__
|
||||
typedef int (*AMX_ENTRY)(AMX *amx);
|
||||
void *hlib;
|
||||
#endif
|
||||
int numlibraries,i;
|
||||
AMX_FUNCSTUB *lib;
|
||||
AMX_ENTRY libinit;
|
||||
#endif
|
||||
|
||||
if ((amx->flags & AMX_FLAG_RELOC)!=0)
|
||||
return AMX_ERR_INIT; /* already initialized (may not do so twice) */
|
||||
@ -853,6 +866,22 @@ int AMXAPI amx_Init(AMX *amx, void *program)
|
||||
* multi-byte words
|
||||
*/
|
||||
assert(check_endian());
|
||||
#if BYTE_ORDER==BIG_ENDIAN
|
||||
amx_Align32((uint32_t*)&hdr->size);
|
||||
amx_Align16(&hdr->magic);
|
||||
amx_Align16((uint16_t*)&hdr->flags);
|
||||
amx_Align16((uint16_t*)&hdr->defsize);
|
||||
amx_Align32((uint32_t*)&hdr->cod);
|
||||
amx_Align32((uint32_t*)&hdr->dat);
|
||||
amx_Align32((uint32_t*)&hdr->hea);
|
||||
amx_Align32((uint32_t*)&hdr->stp);
|
||||
amx_Align32((uint32_t*)&hdr->cip);
|
||||
amx_Align32((uint32_t*)&hdr->publics);
|
||||
amx_Align32((uint32_t*)&hdr->natives);
|
||||
amx_Align32((uint32_t*)&hdr->libraries);
|
||||
amx_Align32((uint32_t*)&hdr->pubvars);
|
||||
amx_Align32((uint32_t*)&hdr->tags);
|
||||
#endif
|
||||
|
||||
if (hdr->magic!=AMX_MAGIC)
|
||||
return AMX_ERR_FORMAT;
|
||||
@ -873,7 +902,13 @@ int AMXAPI amx_Init(AMX *amx, void *program)
|
||||
} /* if */
|
||||
if (hdr->stp<=0)
|
||||
return AMX_ERR_FORMAT;
|
||||
|
||||
#if BYTE_ORDER==BIG_ENDIAN
|
||||
if ((hdr->flags & AMX_FLAG_COMPACT)==0) {
|
||||
ucell *code=(ucell *)((unsigned char *)program+(int)hdr->cod);
|
||||
while (code<(ucell *)((unsigned char *)program+(int)hdr->hea))
|
||||
swapcell(code++);
|
||||
} /* if */
|
||||
#endif
|
||||
assert((hdr->flags & AMX_FLAG_COMPACT)!=0 || hdr->hea == hdr->size);
|
||||
if ((hdr->flags & AMX_FLAG_COMPACT)!=0) {
|
||||
#if AMX_COMPACTMARGIN > 2
|
||||
@ -900,12 +935,108 @@ int AMXAPI amx_Init(AMX *amx, void *program)
|
||||
amx->callback=amx_Callback;
|
||||
amx->data=NULL;
|
||||
|
||||
/* also align all addresses in the public function, public variable,
|
||||
* public tag and native function tables --offsets into the name table
|
||||
* (if present) must also be swapped.
|
||||
*/
|
||||
#if BYTE_ORDER==BIG_ENDIAN
|
||||
{ /* local */
|
||||
AMX_FUNCSTUB *fs;
|
||||
int i,num;
|
||||
|
||||
fs=GETENTRY(hdr,natives,0);
|
||||
num=NUMENTRIES(hdr,natives,libraries);
|
||||
for (i=0; i<num; i++) {
|
||||
amx_AlignCell(&fs->address); /* redundant, because it should be zero */
|
||||
if (USENAMETABLE(hdr))
|
||||
amx_AlignCell(&((AMX_FUNCSTUBNT*)fs)->nameofs);
|
||||
fs=(AMX_FUNCSTUB*)((unsigned char *)fs+hdr->defsize);
|
||||
} /* for */
|
||||
|
||||
fs=GETENTRY(hdr,publics,0);
|
||||
assert(hdr->publics<=hdr->natives);
|
||||
num=NUMENTRIES(hdr,publics,natives);
|
||||
for (i=0; i<num; i++) {
|
||||
amx_AlignCell(&fs->address);
|
||||
if (USENAMETABLE(hdr))
|
||||
amx_AlignCell(&((AMX_FUNCSTUBNT*)fs)->nameofs);
|
||||
fs=(AMX_FUNCSTUB*)((unsigned char *)fs+hdr->defsize);
|
||||
} /* for */
|
||||
|
||||
fs=GETENTRY(hdr,pubvars,0);
|
||||
assert(hdr->pubvars<=hdr->tags);
|
||||
num=NUMENTRIES(hdr,pubvars,tags);
|
||||
for (i=0; i<num; i++) {
|
||||
amx_AlignCell(&fs->address);
|
||||
if (USENAMETABLE(hdr))
|
||||
amx_AlignCell(&((AMX_FUNCSTUBNT*)fs)->nameofs);
|
||||
fs=(AMX_FUNCSTUB*)((unsigned char *)fs+hdr->defsize);
|
||||
} /* for */
|
||||
|
||||
fs=GETENTRY(hdr,tags,0);
|
||||
if (hdr->file_version<7) {
|
||||
assert(hdr->tags<=hdr->cod);
|
||||
num=NUMENTRIES(hdr,tags,cod);
|
||||
} else {
|
||||
assert(hdr->tags<=hdr->nametable);
|
||||
num=NUMENTRIES(hdr,tags,nametable);
|
||||
} /* if */
|
||||
for (i=0; i<num; i++) {
|
||||
amx_AlignCell(&fs->address);
|
||||
if (USENAMETABLE(hdr))
|
||||
amx_AlignCell(&((AMX_FUNCSTUBNT*)fs)->nameofs);
|
||||
fs=(AMX_FUNCSTUB*)((unsigned char *)fs+hdr->defsize);
|
||||
} /* for */
|
||||
} /* local */
|
||||
#endif
|
||||
|
||||
/* relocate call and jump instructions */
|
||||
hook = (BROWSEHOOK)amx->usertags[UT_BROWSEHOOK];
|
||||
if (hook)
|
||||
hook(amx, NULL, NULL);
|
||||
amx_BrowseRelocate(amx);
|
||||
|
||||
/* load any extension modules that the AMX refers to */
|
||||
#if (defined _Windows || defined LINUX || defined __FreeBSD__ || defined __OpenBSD__) && !defined AMX_NODYNALOAD
|
||||
hdr=(AMX_HEADER *)amx->base;
|
||||
numlibraries=NUMENTRIES(hdr,libraries,pubvars);
|
||||
for (i=0; i<numlibraries; i++) {
|
||||
lib=GETENTRY(hdr,libraries,i);
|
||||
strcpy(libname,"amx");
|
||||
strcat(libname,GETENTRYNAME(hdr,lib));
|
||||
#if defined _Windows
|
||||
strcat(libname,".dll");
|
||||
#if defined __WIN32__
|
||||
hlib=LoadLibraryA(libname);
|
||||
#else
|
||||
hlib=LoadLibrary(libname);
|
||||
if (hlib<=HINSTANCE_ERROR)
|
||||
hlib=NULL;
|
||||
#endif
|
||||
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__
|
||||
strcat(libname,".so");
|
||||
hlib=dlopen(libname,RTLD_NOW);
|
||||
#endif
|
||||
if (hlib!=NULL) {
|
||||
/* a library that cannot be loaded or that does not have the required
|
||||
* initialization function is simply ignored
|
||||
*/
|
||||
char funcname[sNAMEMAX+9]; /* +1 for '\0', +4 for 'amx_', +4 for 'Init' */
|
||||
strcpy(funcname,"amx_");
|
||||
strcat(funcname,GETENTRYNAME(hdr,lib));
|
||||
strcat(funcname,"Init");
|
||||
#if defined _Windows
|
||||
libinit=(AMX_ENTRY)GetProcAddress(hlib,funcname);
|
||||
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__
|
||||
libinit=(AMX_ENTRY)dlsym(hlib,funcname);
|
||||
#endif
|
||||
if (libinit!=NULL)
|
||||
libinit(amx);
|
||||
} /* if */
|
||||
lib->address=(ucell)hlib;
|
||||
} /* for */
|
||||
#endif
|
||||
|
||||
return AMX_ERR_NONE;
|
||||
}
|
||||
|
||||
@ -1481,36 +1612,6 @@ int AMXAPI amx_RegisterToAny(AMX *amx, AMX_NATIVE f)
|
||||
return err;
|
||||
}
|
||||
|
||||
int AMXAPI amx_Reregister(AMX *amx, const AMX_NATIVE_INFO *list, int number)
|
||||
{
|
||||
AMX_FUNCSTUB *func;
|
||||
AMX_HEADER *hdr;
|
||||
int i,numnatives,count=0;
|
||||
AMX_NATIVE funcptr;
|
||||
|
||||
hdr=(AMX_HEADER *)amx->base;
|
||||
assert(hdr!=NULL);
|
||||
assert(hdr->magic==AMX_MAGIC);
|
||||
assert(hdr->natives<=hdr->libraries);
|
||||
numnatives=NUMENTRIES(hdr,natives,libraries);
|
||||
|
||||
count=0;
|
||||
func=GETENTRY(hdr,natives,0);
|
||||
for (i=0; i<numnatives; i++) {
|
||||
if (func->address!=0) {
|
||||
/* this function is located */
|
||||
funcptr=(list!=NULL) ? findfunction(GETENTRYNAME(hdr,func),list,number) : NULL;
|
||||
if (funcptr!=NULL)
|
||||
{
|
||||
func->address=(ucell)funcptr;
|
||||
count++;
|
||||
}
|
||||
} /* if */
|
||||
func=(AMX_FUNCSTUB*)((unsigned char*)func+hdr->defsize);
|
||||
} /* for */
|
||||
return count;
|
||||
}
|
||||
|
||||
int AMXAPI amx_Register(AMX *amx, const AMX_NATIVE_INFO *list, int number)
|
||||
{
|
||||
AMX_FUNCSTUB *func;
|
||||
@ -1531,12 +1632,12 @@ int AMXAPI amx_Register(AMX *amx, const AMX_NATIVE_INFO *list, int number)
|
||||
/* this function is not yet located */
|
||||
funcptr=(list!=NULL) ? findfunction(GETENTRYNAME(hdr,func),list,number) : NULL;
|
||||
if (funcptr!=NULL)
|
||||
{
|
||||
{
|
||||
func->address=(ucell)funcptr;
|
||||
} else {
|
||||
no_function = GETENTRYNAME(hdr,func);
|
||||
err=AMX_ERR_NOTFOUND;
|
||||
}
|
||||
}
|
||||
} /* if */
|
||||
func=(AMX_FUNCSTUB*)((unsigned char*)func+hdr->defsize);
|
||||
} /* for */
|
||||
|
@ -166,14 +166,6 @@ typedef int (AMXAPI *AMX_NATIVE_FILTER)(struct tagAMX *amx, int index);
|
||||
#pragma warning(disable:4103) /* disable warning message 4103 that complains
|
||||
* about pragma pack in a header file */
|
||||
#pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
// MSVC8 - Replace POSIX stricmp with ISO C++ conformant one as it is deprecated
|
||||
#define stricmp _stricmp
|
||||
|
||||
// Need this because of some stupid bug
|
||||
#pragma warning (disable : 4996)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Some compilers do not support the #pragma align, which should be fine. Some
|
||||
@ -410,7 +402,6 @@ int AMXAPI amx_PushArray(AMX *amx, cell *amx_addr, cell **phys_addr, const cell
|
||||
int AMXAPI amx_PushString(AMX *amx, cell *amx_addr, cell **phys_addr, const char *string, int pack, int use_wchar);
|
||||
int AMXAPI amx_RaiseError(AMX *amx, int error);
|
||||
int AMXAPI amx_Register(AMX *amx, const AMX_NATIVE_INFO *nativelist, int number);
|
||||
int AMXAPI amx_Reregister(AMX *amx, const AMX_NATIVE_INFO *nativelist, int number);
|
||||
int AMXAPI amx_RegisterToAny(AMX *amx, AMX_NATIVE f);
|
||||
int AMXAPI amx_Release(AMX *amx, cell amx_addr);
|
||||
int AMXAPI amx_SetCallback(AMX *amx, AMX_CALLBACK callback);
|
||||
|
@ -1473,23 +1473,11 @@ OP_FLOAT_ROUND:
|
||||
mov [ebp], eax
|
||||
fldcw [ebp]
|
||||
;calculate
|
||||
sub esp,4
|
||||
push 0
|
||||
fld dword [edi+ecx+4]
|
||||
test edx,edx
|
||||
jz .correct
|
||||
jmp .skip_correct
|
||||
.correct:
|
||||
fadd st0
|
||||
fadd dword [g_round_nearest]
|
||||
fistp dword [esp]
|
||||
pop eax
|
||||
sar eax,1
|
||||
jmp .done
|
||||
.skip_correct:
|
||||
frndint
|
||||
fistp dword [esp]
|
||||
pop eax
|
||||
.done:
|
||||
pop edx
|
||||
;restore bits
|
||||
pop ebp
|
||||
@ -1605,8 +1593,6 @@ Start_DATA
|
||||
|
||||
lodb_and DD 0ffh, 0ffffh, 0, 0ffffffffh
|
||||
|
||||
g_round_nearest DD 0.5
|
||||
|
||||
GLOBAL g_flags
|
||||
g_flags:
|
||||
DD -1
|
||||
@ -1754,10 +1740,10 @@ _amx_opcodelist DD OP_INVALID
|
||||
DD OP_SYSREQ_D
|
||||
DD OP_SYMTAG
|
||||
DD OP_BREAK
|
||||
DD OP_FLOAT_MUL
|
||||
DD OP_FLOAT_DIV
|
||||
DD OP_FLOAT_ADD
|
||||
DD OP_FLOAT_SUB
|
||||
DD OP_FLOAT_TO
|
||||
DD OP_FLOAT_ROUND
|
||||
DD OP_FLOAT_CMP
|
||||
DD OP_FLOAT_MUL
|
||||
DD OP_FLOAT_DIV
|
||||
DD OP_FLOAT_ADD
|
||||
DD OP_FLOAT_SUB
|
||||
DD OP_FLOAT_TO
|
||||
DD OP_FLOAT_ROUND
|
||||
DD OP_FLOAT_CMP
|
@ -1962,23 +1962,11 @@ OP_FLOAT_ROUND:
|
||||
mov [ebp], eax
|
||||
fldcw [ebp]
|
||||
;calculate
|
||||
sub esp,4
|
||||
push 0
|
||||
fld dword [esi+4]
|
||||
test edx,edx
|
||||
jz .correct
|
||||
jmp .skip_correct
|
||||
.correct:
|
||||
fadd st0
|
||||
fadd dword [g_round_nearest]
|
||||
fistp dword [esp]
|
||||
pop eax
|
||||
sar eax,1
|
||||
jmp .done
|
||||
.skip_correct:
|
||||
frndint
|
||||
fistp dword [esp]
|
||||
pop eax
|
||||
.done:
|
||||
pop edx
|
||||
;restore bits
|
||||
pop ebp
|
||||
@ -2434,10 +2422,6 @@ g_flagsjit:
|
||||
DD -1
|
||||
DD 0
|
||||
DD 1
|
||||
|
||||
global g_round_nearest
|
||||
g_round_nearest:
|
||||
DD 0.5
|
||||
|
||||
global amx_opcodelist_jit, _amx_opcodelist_jit
|
||||
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "natives.h"
|
||||
#include "debugger.h"
|
||||
#include "binlog.h"
|
||||
#include "libraries.h"
|
||||
|
||||
static cell AMX_NATIVE_CALL get_xvar_id(AMX *amx, cell *params)
|
||||
{
|
||||
@ -60,7 +59,7 @@ static cell AMX_NATIVE_CALL set_xvar_num(AMX *amx, cell *params)
|
||||
{
|
||||
if (g_xvars.setValue(params[1], params[2]))
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid xvar id");
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -357,24 +356,8 @@ static cell AMX_NATIVE_CALL show_hudmessage(AMX *amx, cell *params) /* 2 param *
|
||||
int len = 0;
|
||||
g_langMngr.SetDefLang(params[1]);
|
||||
char* message = NULL;
|
||||
|
||||
/**
|
||||
* Earlier versions would ignore invalid bounds.
|
||||
* Now, bounds are only checked for internal operations.
|
||||
* "channel" stores the valid channel that core uses.
|
||||
* "g_hudset.channel" stores the direct channel passed to the engine.
|
||||
*/
|
||||
|
||||
bool aut = (g_hudset.channel == -1) ? true : false;
|
||||
int channel = -1;
|
||||
if (!aut)
|
||||
{
|
||||
/**
|
||||
* guarantee this to be between 0-4
|
||||
* if it's not auto, we don't care
|
||||
*/
|
||||
channel = abs(g_hudset.channel % 5);
|
||||
}
|
||||
if (params[1] == 0)
|
||||
{
|
||||
for (int i = 1; i <= gpGlobals->maxClients; ++i)
|
||||
@ -387,12 +370,10 @@ static cell AMX_NATIVE_CALL show_hudmessage(AMX *amx, cell *params) /* 2 param *
|
||||
message = UTIL_SplitHudMessage(format_amxstring(amx, params, 2, len));
|
||||
if (aut)
|
||||
{
|
||||
channel = pPlayer->NextHUDChannel();
|
||||
pPlayer->channels[channel] = gpGlobals->time;
|
||||
g_hudset.channel = channel;
|
||||
g_hudset.channel = pPlayer->NextHUDChannel();
|
||||
pPlayer->channels[g_hudset.channel] = gpGlobals->time;
|
||||
}
|
||||
//don't need to set g_hudset!
|
||||
pPlayer->hudmap[channel] = 0;
|
||||
pPlayer->hudmap[g_hudset.channel] = 0;
|
||||
UTIL_HudMessage(pPlayer->pEdict, g_hudset, message);
|
||||
}
|
||||
}
|
||||
@ -412,11 +393,10 @@ static cell AMX_NATIVE_CALL show_hudmessage(AMX *amx, cell *params) /* 2 param *
|
||||
{
|
||||
if (aut)
|
||||
{
|
||||
channel = pPlayer->NextHUDChannel();
|
||||
pPlayer->channels[channel] = gpGlobals->time;
|
||||
g_hudset.channel = channel;
|
||||
g_hudset.channel = pPlayer->NextHUDChannel();
|
||||
pPlayer->channels[g_hudset.channel] = gpGlobals->time;
|
||||
}
|
||||
pPlayer->hudmap[channel] = 0;
|
||||
pPlayer->hudmap[g_hudset.channel] = 0;
|
||||
UTIL_HudMessage(pPlayer->pEdict, g_hudset, message);
|
||||
}
|
||||
}
|
||||
@ -554,11 +534,6 @@ static cell AMX_NATIVE_CALL is_user_alive(AMX *amx, cell *params) /* 1 param */
|
||||
return ((pPlayer->ingame && pPlayer->IsAlive()) ? 1 : 0);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_amxx_verstring(AMX *amx, cell *params) /* 2 params */
|
||||
{
|
||||
return set_amxstring(amx, params[1], AMX_VERSION, params[2]);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_frags(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
int index = params[1];
|
||||
@ -653,20 +628,6 @@ static cell AMX_NATIVE_CALL get_weaponname(AMX *amx, cell *params) /* 3 param */
|
||||
return set_amxstring(amx, params[2], g_weaponsData[index].fullName.c_str(), params[3]);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_weaponid(AMX *amx, cell *params)
|
||||
{
|
||||
int ilen;
|
||||
const char *name = get_amxstring(amx, params[1], 0, ilen);
|
||||
|
||||
for (int i = 1; i < MAX_WEAPONS; i++)
|
||||
{
|
||||
if (!strcmp(g_weaponsData[i].fullName.c_str(), name))
|
||||
return g_weaponsData[i].iId;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_weapons(AMX *amx, cell *params) /* 3 param */
|
||||
{
|
||||
int index = params[1];
|
||||
@ -1071,7 +1032,7 @@ static cell AMX_NATIVE_CALL register_plugin(AMX *amx, cell *params) /* 3 param *
|
||||
a->setVersion(vers);
|
||||
a->setAuthor(author);
|
||||
|
||||
return a->getId();
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL register_menucmd(AMX *amx, cell *params) /* 3 param */
|
||||
@ -1143,7 +1104,7 @@ static cell AMX_NATIVE_CALL amx_md5_file(AMX *amx, cell *params)
|
||||
|
||||
if (!fp)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Cant open file \"%s\"", file);
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1350,7 +1311,8 @@ static cell AMX_NATIVE_CALL register_event(AMX *amx, cell *params) /* 2 param */
|
||||
|
||||
if ((pos = g_events.getEventId(sTemp)) == 0)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid event (name \"%s\") (plugin \"%s\")", sTemp, plugin->getName());
|
||||
AMXXLOG_Log("[AMXX] Invalid event (name \"%s\") (plugin \"%s\")", sTemp, plugin->getName());
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1556,9 +1518,7 @@ static cell AMX_NATIVE_CALL get_pcvar_float(AMX *amx, cell *params)
|
||||
return 0;
|
||||
}
|
||||
|
||||
REAL val = (REAL)ptr->value;
|
||||
|
||||
return amx_ftoc(val);
|
||||
return amx_ftoc(ptr->value);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_cvar_float(AMX *amx, cell *params) /* 1 param */
|
||||
@ -1642,6 +1602,116 @@ static cell AMX_NATIVE_CALL set_cvar_string(AMX *amx, cell *params) /* 2 param *
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL message_begin(AMX *amx, cell *params) /* 4 param */
|
||||
{
|
||||
int numparam = *params / sizeof(cell);
|
||||
float vecOrigin[3];
|
||||
cell *cpOrigin;
|
||||
|
||||
if (params[2] < 1 || ((params[2] > 63) // maximal number of engine messages
|
||||
&& !GET_USER_MSG_NAME(PLID, params[2], NULL)))
|
||||
{
|
||||
AMXXLOG_Log("[AMXX] Plugin called message_begin with an invalid message id (%d).", params[2]);
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (params[1])
|
||||
{
|
||||
case MSG_BROADCAST:
|
||||
case MSG_ALL:
|
||||
case MSG_SPEC:
|
||||
MESSAGE_BEGIN(params[1], params[2], NULL);
|
||||
break;
|
||||
case MSG_PVS: case MSG_PAS:
|
||||
case MSG_PVS_R: case MSG_PAS_R:
|
||||
if (numparam < 3)
|
||||
{
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
cpOrigin = get_amxaddr(amx, params[3]);
|
||||
|
||||
vecOrigin[0] = static_cast<float>(*cpOrigin);
|
||||
vecOrigin[1] = static_cast<float>(*(cpOrigin + 1));
|
||||
vecOrigin[2] = static_cast<float>(*(cpOrigin + 2));
|
||||
|
||||
MESSAGE_BEGIN(params[1], params[2], vecOrigin);
|
||||
|
||||
break;
|
||||
case MSG_ONE_UNRELIABLE:
|
||||
case MSG_ONE:
|
||||
if (numparam < 4)
|
||||
{
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
MESSAGE_BEGIN(params[1], params[2], NULL, INDEXENT(params[4]));
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL message_end(AMX *amx, cell *params)
|
||||
{
|
||||
MESSAGE_END();
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_byte(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
WRITE_BYTE(params[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_char(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
WRITE_CHAR(params[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_short(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
WRITE_SHORT(params[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_long(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
WRITE_LONG(params[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_entity(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
WRITE_ENTITY(params[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_angle(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
WRITE_ANGLE(static_cast<float>(params[1]));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_coord(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
WRITE_COORD(static_cast<float>(params[1]));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_string(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
int a;
|
||||
WRITE_STRING(get_amxstring(amx, params[1], 3, a));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL log_message(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
int len;
|
||||
@ -1736,6 +1806,12 @@ static cell AMX_NATIVE_CALL get_time(AMX *amx, cell *params) /* 3 param */
|
||||
time_t td = time(NULL);
|
||||
tm* lt = localtime(&td);
|
||||
|
||||
if (lt == 0)
|
||||
{
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
char szDate[512];
|
||||
strftime(szDate, 511, sptemp, lt);
|
||||
|
||||
@ -1752,7 +1828,7 @@ static cell AMX_NATIVE_CALL format_time(AMX *amx, cell *params) /* 3 param */
|
||||
|
||||
if (lt == 0)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Couldn't get localtime");
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1778,7 +1854,7 @@ static cell AMX_NATIVE_CALL parse_time(AMX *amx, cell *params) /* 3 param */
|
||||
|
||||
if (mytime == 0)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Couldn't get localtime");
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1789,7 +1865,7 @@ static cell AMX_NATIVE_CALL parse_time(AMX *amx, cell *params) /* 3 param */
|
||||
|
||||
if (mytime == 0)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Couldn't get localtime");
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1827,7 +1903,7 @@ static cell AMX_NATIVE_CALL read_data(AMX *amx, cell *params) /* 3 param */
|
||||
return set_amxstring(amx, params[2], g_events.getArgString(params[1]), *get_amxaddr(amx, params[3]));
|
||||
default:
|
||||
cell *fCell = get_amxaddr(amx, params[2]);
|
||||
REAL fparam = (REAL)g_events.getArgFloat(params[1]);
|
||||
float fparam = g_events.getArgFloat(params[1]);
|
||||
fCell[0] = amx_ftoc(fparam);
|
||||
return (int)fparam;
|
||||
}
|
||||
@ -2003,7 +2079,7 @@ static cell AMX_NATIVE_CALL get_maxplayers(AMX *amx, cell *params)
|
||||
|
||||
static cell AMX_NATIVE_CALL get_gametime(AMX *amx, cell *params)
|
||||
{
|
||||
REAL pFloat = (REAL)gpGlobals->time;
|
||||
REAL pFloat = gpGlobals->time;
|
||||
return amx_ftoc(pFloat);
|
||||
}
|
||||
|
||||
@ -2141,7 +2217,9 @@ static cell AMX_NATIVE_CALL set_task(AMX *amx, cell *params) /* 2 param */
|
||||
|
||||
if (iFunc == -1)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Function is not present (function \"%s\") (plugin \"%s\")", stemp, plugin->getName());
|
||||
AMXXLOG_Log("[AMXX] Function is not present (function \"%s\") (plugin \"%s\")", stemp, plugin->getName());
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2307,7 +2385,7 @@ static cell AMX_NATIVE_CALL pause(AMX *amx, cell *params) /* 3 param */
|
||||
|
||||
if (flags & 2) // pause function
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "This usage of the native pause() has been deprecated!");
|
||||
AMXXLOG_Log("[AMXX] This usage of the native pause() has been deprecated!");
|
||||
return 1;
|
||||
}
|
||||
else if (flags & 4)
|
||||
@ -2343,7 +2421,7 @@ static cell AMX_NATIVE_CALL unpause(AMX *amx, cell *params) /* 3 param */
|
||||
|
||||
if (flags & 2)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "This usage of the native pause() has been deprecated!");
|
||||
AMXXLOG_Log("[AMXX] This usage of the native pause() has been deprecated!");
|
||||
return 1;
|
||||
}
|
||||
else if (flags & 4)
|
||||
@ -2498,12 +2576,12 @@ static cell AMX_NATIVE_CALL precache_sound(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
if (g_dontprecache)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Precaching not allowed");
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int len;
|
||||
char* sptemp = get_amxstring(amx, params[1], 0, len);
|
||||
int ilen;
|
||||
char* sptemp = get_amxstring(amx, params[1], 0, ilen);
|
||||
|
||||
PRECACHE_SOUND((char*)STRING(ALLOC_STRING(sptemp)));
|
||||
|
||||
@ -2514,28 +2592,40 @@ static cell AMX_NATIVE_CALL precache_model(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
if (g_dontprecache)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Precaching not allowed");
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int len;
|
||||
char* sptemp = get_amxstring(amx, params[1], 0, len);
|
||||
int ilen;
|
||||
char* sptemp = get_amxstring(amx, params[1], 0, ilen);
|
||||
|
||||
return PRECACHE_MODEL((char*)STRING(ALLOC_STRING(sptemp)));
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL precache_generic(AMX *amx, cell *params)
|
||||
static cell AMX_NATIVE_CALL get_distance(AMX *amx, cell *params) /* 2 param */
|
||||
{
|
||||
if (g_dontprecache)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Precaching not allowed");
|
||||
return 0;
|
||||
}
|
||||
cell *cpVec1 = get_amxaddr(amx, params[1]);
|
||||
cell *cpVec2 = get_amxaddr(amx, params[2]);
|
||||
|
||||
Vector vec1 = Vector((float)cpVec1[0], (float)cpVec1[1], (float)cpVec1[2]);
|
||||
Vector vec2 = Vector((float)cpVec2[0], (float)cpVec2[1], (float)cpVec2[2]);
|
||||
|
||||
int iDist = (int)((vec1 - vec2).Length());
|
||||
|
||||
return iDist;
|
||||
}
|
||||
|
||||
int len;
|
||||
char* sptemp = get_amxstring(amx, params[1], 0, len);
|
||||
static cell AMX_NATIVE_CALL get_distance_f(AMX *amx, cell *params)
|
||||
{
|
||||
cell *cpVec1 = get_amxaddr(amx, params[1]);
|
||||
cell *cpVec2 = get_amxaddr(amx, params[2]);
|
||||
|
||||
Vector vec1 = Vector((float)amx_ctof(cpVec1[0]), (float)amx_ctof(cpVec1[1]), (float)amx_ctof(cpVec1[2]));
|
||||
Vector vec2 = Vector((float)amx_ctof(cpVec2[0]), (float)amx_ctof(cpVec2[1]), (float)amx_ctof(cpVec2[2]));
|
||||
|
||||
return PRECACHE_GENERIC((char*)STRING(ALLOC_STRING(sptemp)));
|
||||
REAL fDist = (REAL) (vec1 - vec2).Length();
|
||||
|
||||
return amx_ftoc(fDist);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL random_float(AMX *amx, cell *params) /* 2 param */
|
||||
@ -2754,7 +2844,7 @@ static cell AMX_NATIVE_CALL parse_loguser(AMX *amx, cell *params)
|
||||
|
||||
if (len < 6) // no user to parse!?
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "No user name specified");
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2778,7 +2868,7 @@ static cell AMX_NATIVE_CALL parse_loguser(AMX *amx, cell *params)
|
||||
/******** GET AUTHID **********/
|
||||
if (len <= 0)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "No Authid found");
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2801,7 +2891,7 @@ static cell AMX_NATIVE_CALL parse_loguser(AMX *amx, cell *params)
|
||||
/******** GET USERID **********/
|
||||
if (len <= 0)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "No Userid found");
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -3274,7 +3364,8 @@ static cell AMX_NATIVE_CALL callfunc_push_byval(AMX *amx, cell *params)
|
||||
|
||||
if (g_CallFunc_CurParam == CALLFUNC_MAXPARAMS)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Callfunc_push_xxx: maximal parameters num: %d", CALLFUNC_MAXPARAMS);
|
||||
AMXXLOG_Log("[AMXX] callfunc_push_xxx: maximal parameters num: %d", CALLFUNC_MAXPARAMS);
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -3632,18 +3723,43 @@ static cell AMX_NATIVE_CALL module_exists(AMX *amx, cell *params)
|
||||
int len;
|
||||
char *module = get_amxstring(amx, params[1], 0, len);
|
||||
|
||||
if (!FindLibrary(module, LibType_Library))
|
||||
return FindLibrary(module, LibType_Class);
|
||||
CList<CModule, const char *>::iterator a;
|
||||
|
||||
return true;
|
||||
}
|
||||
bool isdbi = false, found = false;
|
||||
const amxx_module_info_s *info;
|
||||
|
||||
if (stricmp(module, "dbi") == 0)
|
||||
isdbi = true;
|
||||
|
||||
static cell AMX_NATIVE_CALL LibraryExists(AMX *amx, cell *params)
|
||||
{
|
||||
int len;
|
||||
char *library = get_amxstring(amx, params[1], 0, len);
|
||||
for (a = g_modules.begin(); a; ++a)
|
||||
{
|
||||
if ((*a).getStatusValue() == MODULE_LOADED)
|
||||
{
|
||||
info = (*a).getInfoNew();
|
||||
if (info)
|
||||
{
|
||||
if (isdbi)
|
||||
{
|
||||
if (info->logtag && (StrCaseStr(info->logtag, "sql") || StrCaseStr(info->logtag, "dbi")))
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (info->logtag && (stricmp(info->logtag, module) == 0))
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
found = LibraryExists(module);
|
||||
|
||||
return FindLibrary(library, static_cast<LibType>(params[2]));
|
||||
return (found ? 1 : 0);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_fail_state(AMX *amx, cell *params)
|
||||
@ -3725,7 +3841,7 @@ static cell AMX_NATIVE_CALL CreateOneForward(AMX *amx, cell *params)
|
||||
for (cell i=3; i<=count; i++)
|
||||
ps[i-3] = *get_amxaddr(amx, params[i]);
|
||||
|
||||
return registerSPForwardByNameC(p->getAMX(), funcname, ps, count-2);
|
||||
return registerSPForwardByNameC(amx, funcname, ps, count-2);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL PrepareArray(AMX *amx, cell *params)
|
||||
@ -3932,11 +4048,6 @@ static cell AMX_NATIVE_CALL ShowSyncHudMsg(AMX *amx, cell *params)
|
||||
return len;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL is_user_hacking(AMX *amx, cell *params)
|
||||
{
|
||||
return g_bmod_cstrike ? 1 : 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL arrayset(AMX *amx, cell *params)
|
||||
{
|
||||
memset(get_amxaddr(amx, params[1]), params[2], params[3] * sizeof(cell));
|
||||
@ -3944,27 +4055,6 @@ static cell AMX_NATIVE_CALL arrayset(AMX *amx, cell *params)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL amxx_setpl_curweap(AMX *amx, cell *params)
|
||||
{
|
||||
if (params[1] < 1 || params[1] > gpGlobals->maxClients)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid client %d", params[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
CPlayer *p = GET_PLAYER_POINTER_I(params[1]);
|
||||
|
||||
if (!p->ingame)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Player %d not ingame", params[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
p->current = params[2];
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO amxmodx_Natives[] =
|
||||
{
|
||||
{"abort", amx_abort},
|
||||
@ -4002,6 +4092,8 @@ AMX_NATIVE_INFO amxmodx_Natives[] =
|
||||
{"get_cvar_num", get_cvar_num},
|
||||
{"get_cvar_pointer", get_cvar_pointer},
|
||||
{"get_cvar_string", get_cvar_string},
|
||||
{"get_distance", get_distance},
|
||||
{"get_distance_f", get_distance_f},
|
||||
{"get_flags", get_flags},
|
||||
{"get_func_id", get_func_id},
|
||||
{"get_gametime", get_gametime},
|
||||
@ -4026,7 +4118,6 @@ AMX_NATIVE_INFO amxmodx_Natives[] =
|
||||
{"get_systime", get_systime},
|
||||
{"get_time", get_time},
|
||||
{"get_timeleft", get_timeleft},
|
||||
{"get_amxx_verstring", get_amxx_verstring},
|
||||
{"get_user_aiming", get_user_aiming},
|
||||
{"get_user_ammo", get_user_ammo},
|
||||
{"get_user_armor", get_user_armor},
|
||||
@ -4051,7 +4142,6 @@ AMX_NATIVE_INFO amxmodx_Natives[] =
|
||||
{"hcsardhnexsnu", register_byval},
|
||||
{"get_user_weapon", get_user_weapon},
|
||||
{"get_user_weapons", get_user_weapons},
|
||||
{"get_weaponid", get_weaponid},
|
||||
{"get_weaponname", get_weaponname},
|
||||
{"get_xvar_float", get_xvar_num},
|
||||
{"get_xvar_id", get_xvar_id},
|
||||
@ -4069,7 +4159,6 @@ AMX_NATIVE_INFO amxmodx_Natives[] =
|
||||
{"is_user_bot", is_user_bot},
|
||||
{"is_user_connected", is_user_connected},
|
||||
{"is_user_connecting", is_user_connecting},
|
||||
{"is_user_hacking", is_user_hacking},
|
||||
{"is_user_hltv", is_user_hltv},
|
||||
{"lang_exists", lang_exists},
|
||||
{"log_amx", log_amx},
|
||||
@ -4077,6 +4166,8 @@ AMX_NATIVE_INFO amxmodx_Natives[] =
|
||||
{"log_to_file", log_to_file},
|
||||
{"md5", amx_md5},
|
||||
{"md5_file", amx_md5_file},
|
||||
{"message_begin", message_begin},
|
||||
{"message_end", message_end},
|
||||
{"module_exists", module_exists},
|
||||
{"mkdir", amx_mkdir},
|
||||
{"next_hudchannel", next_hudchannel},
|
||||
@ -4087,7 +4178,6 @@ AMX_NATIVE_INFO amxmodx_Natives[] =
|
||||
{"plugin_flags", plugin_flags},
|
||||
{"precache_model", precache_model},
|
||||
{"precache_sound", precache_sound},
|
||||
{"precache_generic", precache_generic},
|
||||
{"query_client_cvar", query_client_cvar},
|
||||
{"random_float", random_float},
|
||||
{"random_num", random_num},
|
||||
@ -4141,6 +4231,14 @@ AMX_NATIVE_INFO amxmodx_Natives[] =
|
||||
{"user_has_weapon", user_has_weapon},
|
||||
{"user_kill", user_kill},
|
||||
{"user_slap", user_slap},
|
||||
{"write_angle", write_angle},
|
||||
{"write_byte", write_byte},
|
||||
{"write_char", write_char},
|
||||
{"write_coord", write_coord},
|
||||
{"write_entity", write_entity},
|
||||
{"write_long", write_long},
|
||||
{"write_short", write_short},
|
||||
{"write_string", write_string},
|
||||
{"xvar_exists", xvar_exists},
|
||||
{"ClearSyncHud", ClearSyncHud},
|
||||
{"CreateHudSyncObj", CreateHudSyncObj},
|
||||
@ -4150,6 +4248,5 @@ AMX_NATIVE_INFO amxmodx_Natives[] =
|
||||
{"ExecuteForward", ExecuteForward},
|
||||
{"PrepareArray", PrepareArray},
|
||||
{"ShowSyncHudMsg", ShowSyncHudMsg},
|
||||
{"LibraryExists", LibraryExists},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
@ -42,13 +42,8 @@
|
||||
#include <extdll.h>
|
||||
#include <meta_api.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// MSVC8 - replace POSIX functions with ISO C++ conformant ones as they are deprecated
|
||||
#if _MSC_VER >= 1400
|
||||
#define unlink _unlink
|
||||
#define mkdir _mkdir
|
||||
#define strdup _strdup
|
||||
#endif
|
||||
#ifdef MEMORY_TEST
|
||||
#include "mmgr/mmgr.h"
|
||||
#endif
|
||||
|
||||
#include "md5.h"
|
||||
@ -72,8 +67,7 @@
|
||||
#include "amxxlog.h"
|
||||
|
||||
#define AMXXLOG_Log g_log.Log
|
||||
#define AMXXLOG_Error g_log.LogError
|
||||
#define AMX_VERSION "1.75a"
|
||||
#define AMX_VERSION "1.71"
|
||||
|
||||
extern AMX_NATIVE_INFO core_Natives[];
|
||||
extern AMX_NATIVE_INFO time_Natives[];
|
||||
@ -83,8 +77,6 @@ extern AMX_NATIVE_INFO file_Natives[];
|
||||
extern AMX_NATIVE_INFO float_Natives[];
|
||||
extern AMX_NATIVE_INFO string_Natives[];
|
||||
extern AMX_NATIVE_INFO vault_Natives[];
|
||||
extern AMX_NATIVE_INFO msg_Natives[];
|
||||
extern AMX_NATIVE_INFO vector_Natives[];
|
||||
|
||||
#ifndef __linux__
|
||||
#define DLLOAD(path) (DLHANDLE)LoadLibrary(path)
|
||||
@ -265,8 +257,6 @@ enum CountModulesMode
|
||||
|
||||
int countModules(CountModulesMode mode);
|
||||
void modules_callPluginsLoaded();
|
||||
void modules_callPluginsUnloaded();
|
||||
void modules_callPluginsUnloading();
|
||||
|
||||
cell* get_amxaddr(AMX *amx, cell amx_addr);
|
||||
char* build_pathname(char *fmt, ...);
|
||||
@ -338,6 +328,4 @@ struct func_s
|
||||
const char *desc;
|
||||
};
|
||||
|
||||
extern enginefuncs_t *g_pEngTable;
|
||||
|
||||
#endif // AMXMODX_H
|
||||
|
@ -54,7 +54,7 @@ static cell AMX_NATIVE_CALL _time(AMX *amx, cell *params)
|
||||
/* the time() function returns the number of seconds since January 1 1970
|
||||
* in Universal Coordinated Time (the successor to Greenwich Mean Time)
|
||||
*/
|
||||
return (cell)sec1970;
|
||||
return sec1970;
|
||||
}
|
||||
|
||||
#if defined __BORLANDC__ || defined __WATCOMC__
|
||||
|
@ -109,7 +109,7 @@ CAmxxReader::CAmxxReader(const char *filename, int cellsize)
|
||||
{
|
||||
DATAREAD(&m_Bh.version, sizeof(int16_t), 1);
|
||||
|
||||
if (m_Bh.version > MAGIC_VERSION)
|
||||
if (m_Bh.version != MAGIC_VERSION)
|
||||
{
|
||||
m_Status = Err_OldFile;
|
||||
fclose(m_pFile);
|
||||
|
@ -48,7 +48,6 @@ CLog::CLog()
|
||||
{
|
||||
m_LogType = 0;
|
||||
m_LogFile.clear();
|
||||
m_FoundError = false;
|
||||
}
|
||||
|
||||
CLog::~CLog()
|
||||
@ -227,45 +226,3 @@ void CLog::Log(const char *fmt, ...)
|
||||
ALERT(at_logged, "%s\n", msg_);
|
||||
}
|
||||
}
|
||||
|
||||
void CLog::LogError(const char *fmt, ...)
|
||||
{
|
||||
static char file[256];
|
||||
|
||||
if (m_FoundError)
|
||||
return;
|
||||
|
||||
// get time
|
||||
time_t td;
|
||||
time(&td);
|
||||
tm *curTime = localtime(&td);
|
||||
|
||||
char date[32];
|
||||
strftime(date, 31, "%m/%d/%Y - %H:%M:%S", curTime);
|
||||
|
||||
// msg
|
||||
static char msg[3072];
|
||||
|
||||
va_list arglst;
|
||||
va_start(arglst, fmt);
|
||||
vsnprintf(msg, 3071, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
FILE *pF = NULL;
|
||||
build_pathname_r(file, sizeof(file)-1, "%s/error_%02d%02d%02d.log", g_log_dir.c_str(), curTime->tm_mon + 1, curTime->tm_mday, curTime->tm_year - 100);
|
||||
pF = fopen(file, "a+");
|
||||
|
||||
if (pF)
|
||||
{
|
||||
fprintf(pF, "L %s: %s\n", date, msg);
|
||||
fclose(pF);
|
||||
} else {
|
||||
ALERT(at_logged, "[AMXX] Unexpected fatal logging error (couldn't open %s for a+). AMXX Error Logging disabled for this map.\n", file);
|
||||
m_FoundError = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// print on server console
|
||||
print_srvconsole("L %s: %s\n", date, msg);
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,6 @@ class CLog
|
||||
private:
|
||||
String m_LogFile;
|
||||
int m_LogType;
|
||||
bool m_FoundError;
|
||||
|
||||
void GetLastFile(int &outMonth, int &outDay, String &outFilename);
|
||||
void UseFile(const String &fileName);
|
||||
@ -48,7 +47,6 @@ public:
|
||||
void CloseFile();
|
||||
void MapChange();
|
||||
void Log(const char *fmt, ...);
|
||||
void LogError(const char *fmt, ...);
|
||||
};
|
||||
|
||||
#endif // __AMXXLOG_H__
|
||||
|
@ -1,9 +1,9 @@
|
||||
#if defined BINLOG_ENABLED
|
||||
|
||||
#include <time.h>
|
||||
#include "amxmodx.h"
|
||||
#include "binlog.h"
|
||||
|
||||
#if defined BINLOG_ENABLED
|
||||
|
||||
BinLog g_BinLog;
|
||||
int g_binlog_level = 0;
|
||||
int g_binlog_maxsize = 0;
|
||||
@ -227,43 +227,32 @@ void BinLog::WritePluginDB(FILE *fp)
|
||||
if (c && pl->isDebug())
|
||||
c = 2;
|
||||
fwrite(&c, sizeof(char), 1, fp);
|
||||
if (c)
|
||||
len = (char)strlen(pl->getName());
|
||||
fwrite(&len, sizeof(char), 1, fp);
|
||||
len++;
|
||||
fwrite(pl->getName(), sizeof(char), len, fp);
|
||||
int natives, publics;
|
||||
AMX *amx = pl->getAMX();
|
||||
amx_NumNatives(amx, &natives);
|
||||
amx_NumPublics(amx, &publics);
|
||||
fwrite(&natives, sizeof(int), 1, fp);
|
||||
fwrite(&publics, sizeof(int), 1, fp);
|
||||
char name[34];
|
||||
for (int i=0; i<natives; i++)
|
||||
{
|
||||
len = (char)strlen(pl->getName());
|
||||
amx_GetNative(amx, i, name);
|
||||
len = (char)strlen(name);
|
||||
fwrite(&len, sizeof(char), 1, fp);
|
||||
len++;
|
||||
fwrite(pl->getName(), sizeof(char), len, fp);
|
||||
int natives, publics;
|
||||
AMX *amx = pl->getAMX();
|
||||
amx_NumNatives(amx, &natives);
|
||||
amx_NumPublics(amx, &publics);
|
||||
fwrite(&natives, sizeof(int), 1, fp);
|
||||
fwrite(&publics, sizeof(int), 1, fp);
|
||||
char name[34];
|
||||
for (int i=0; i<natives; i++)
|
||||
{
|
||||
amx_GetNative(amx, i, name);
|
||||
len = (char)strlen(name);
|
||||
fwrite(&len, sizeof(char), 1, fp);
|
||||
len++;
|
||||
fwrite(name, sizeof(char), len, fp);
|
||||
}
|
||||
for (int i=0; i<publics; i++)
|
||||
{
|
||||
amx_GetPublic(amx, i, name);
|
||||
len = (char)strlen(name);
|
||||
fwrite(&len, sizeof(char), 1, fp);
|
||||
len++;
|
||||
fwrite(name, sizeof(char), len, fp);
|
||||
}
|
||||
} else {
|
||||
char empty[] = " ";
|
||||
len = 1;
|
||||
fwrite(name, sizeof(char), len, fp);
|
||||
}
|
||||
for (int i=0; i<publics; i++)
|
||||
{
|
||||
amx_GetPublic(amx, i, name);
|
||||
len = (char)strlen(name);
|
||||
fwrite(&len, sizeof(char), 1, fp);
|
||||
fwrite(empty, sizeof(char), len, fp);
|
||||
int no = 0;
|
||||
fwrite(&no, sizeof(int), 1, fp);
|
||||
fwrite(&no, sizeof(int), 1, fp);
|
||||
len++;
|
||||
fwrite(name, sizeof(char), len, fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -556,15 +556,15 @@ void Debugger::Clear()
|
||||
void Debugger::DisplayTrace(const char *message)
|
||||
{
|
||||
if (message != NULL)
|
||||
AMXXLOG_Error("%s", message);
|
||||
AMXXLOG_Log("%s", message);
|
||||
|
||||
char buffer[512];
|
||||
FormatError(buffer, sizeof(buffer)-1);
|
||||
|
||||
const char *filename = _GetFilename();
|
||||
|
||||
AMXXLOG_Error("[AMXX] Displaying debug trace (plugin \"%s\")", filename);
|
||||
AMXXLOG_Error("[AMXX] %s", buffer);
|
||||
AMXXLOG_Log("[AMXX] Displaying debug trace (plugin \"%s\")", filename);
|
||||
AMXXLOG_Log("[AMXX] %s", buffer);
|
||||
|
||||
int count = 0;
|
||||
long lLine;
|
||||
@ -573,7 +573,7 @@ void Debugger::DisplayTrace(const char *message)
|
||||
while (pTrace)
|
||||
{
|
||||
GetTraceInfo(pTrace, lLine, function, file);
|
||||
AMXXLOG_Error(
|
||||
AMXXLOG_Log(
|
||||
"[AMXX] [%d] %s::%s (line %d)",
|
||||
count,
|
||||
file,
|
||||
@ -633,14 +633,12 @@ void Debugger::GenericMessage(AMX *amx, int err)
|
||||
Debugger::FmtGenericMsg(amx, err, buffer, sizeof(buffer)-1);
|
||||
|
||||
if (buffer[0] != '\0')
|
||||
AMXXLOG_Error("[AMXX] %s", buffer);
|
||||
AMXXLOG_Log("[AMXX] %s", buffer);
|
||||
}
|
||||
|
||||
Debugger::~Debugger()
|
||||
{
|
||||
Clear();
|
||||
dbg_FreeInfo(m_pAmxDbg);
|
||||
delete m_pAmxDbg;
|
||||
}
|
||||
|
||||
int Handler::SetErrorHandler(const char *function)
|
||||
@ -695,7 +693,7 @@ const char *Handler::GetLastMsg()
|
||||
return m_MsgCache.c_str();
|
||||
}
|
||||
|
||||
int Handler::HandleModule(const char *module, bool isClass)
|
||||
int Handler::HandleModule(const char *module)
|
||||
{
|
||||
if (m_iModFunc < 0)
|
||||
return 0;
|
||||
@ -711,7 +709,6 @@ int Handler::HandleModule(const char *module, bool isClass)
|
||||
|
||||
//temporarily set prenit
|
||||
m_pAmx->flags |= AMX_FLAG_PRENIT;
|
||||
amx_Push(m_pAmx, isClass ? 1 : 0);
|
||||
amx_PushString(m_pAmx, &hea_addr, &phys_addr, module, 0, 0);
|
||||
int err = amx_Exec(m_pAmx, &retval, m_iModFunc);
|
||||
amx_Release(m_pAmx, hea_addr);
|
||||
@ -765,7 +762,7 @@ int Handler::HandleNative(const char *native, int index, int trap)
|
||||
}
|
||||
if (!trap)
|
||||
{
|
||||
AMXXLOG_Error("[AMXX] Runtime failure %d occurred in native filter. Aborting plugin load.", err);
|
||||
AMXXLOG_Log("[AMXX] Runtime failure %d occurred in native filter. Aborting plugin load.", err);
|
||||
return 0;
|
||||
}
|
||||
//handle this manually.
|
||||
@ -776,7 +773,7 @@ int Handler::HandleNative(const char *native, int index, int trap)
|
||||
} else if (err != -1) {
|
||||
LogError(m_pAmx, err, NULL);
|
||||
}
|
||||
AMXXLOG_Error("[AMXX] NOTE: Runtime failures in native filters are not good!");
|
||||
AMXXLOG_Log("[AMXX] NOTE: Runtime failures in native filters are not good!");
|
||||
retval = 0;
|
||||
}
|
||||
if (!trap)
|
||||
@ -836,10 +833,10 @@ int Handler::HandleError(const char *msg)
|
||||
pDebugger->DisplayTrace(msg);
|
||||
} else {
|
||||
if (GetLastMsg())
|
||||
AMXXLOG_Error("%s", GetLastMsg());
|
||||
AMXXLOG_Log("%s", GetLastMsg());
|
||||
Debugger::GenericMessage(m_pAmx, err);
|
||||
}
|
||||
AMXXLOG_Error("[AMXX] NOTE: Runtime failures in an error filter are not good!");
|
||||
AMXXLOG_Log("[AMXX] NOTE: Runtime failures in an error filter are not good!");
|
||||
}
|
||||
|
||||
if (pDebugger)
|
||||
@ -867,7 +864,7 @@ static cell AMX_NATIVE_CALL set_error_filter(AMX *amx, cell *params)
|
||||
if (!pHandler)
|
||||
{
|
||||
Debugger::GenericMessage(amx, AMX_ERR_NOTFOUND);
|
||||
AMXXLOG_Error("[AMXX] Plugin not initialized correctly.");
|
||||
AMXXLOG_Log("[AMXX] Plugin not initialized correctly.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -875,7 +872,7 @@ static cell AMX_NATIVE_CALL set_error_filter(AMX *amx, cell *params)
|
||||
if (err != AMX_ERR_NONE)
|
||||
{
|
||||
Debugger::GenericMessage(amx, AMX_ERR_NOTFOUND);
|
||||
AMXXLOG_Error("[AMXX] Function not found: %s", function);
|
||||
AMXXLOG_Log("[AMXX] Function not found: %s", function);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -955,7 +952,7 @@ static cell AMX_NATIVE_CALL set_native_filter(AMX *amx, cell *params)
|
||||
if (!pHandler)
|
||||
{
|
||||
Debugger::GenericMessage(amx, AMX_ERR_NOTFOUND);
|
||||
AMXXLOG_Error("[AMXX] Plugin not initialized correctly.");
|
||||
AMXXLOG_Log("[AMXX] Plugin not initialized correctly.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -974,7 +971,7 @@ static cell AMX_NATIVE_CALL set_native_filter(AMX *amx, cell *params)
|
||||
if (err != AMX_ERR_NONE)
|
||||
{
|
||||
Debugger::GenericMessage(amx, AMX_ERR_NOTFOUND);
|
||||
AMXXLOG_Error("[AMXX] Function not found: %s", function);
|
||||
AMXXLOG_Log("[AMXX] Function not found: %s", function);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ public:
|
||||
public:
|
||||
int HandleError(const char *msg);
|
||||
int HandleNative(const char *native, int index, int trap);
|
||||
int HandleModule(const char *module, bool isClass=false);
|
||||
int HandleModule(const char *module);
|
||||
public:
|
||||
bool IsHandling() const { return m_Handling; }
|
||||
void SetErrorMsg(const char *msg);
|
||||
|
@ -51,6 +51,8 @@
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#include <extdll.h>
|
||||
#include <meta_api.h>
|
||||
#include "amxmodx.h"
|
||||
|
||||
CVector<FILE *> FileList;
|
||||
@ -139,7 +141,7 @@ static cell AMX_NATIVE_CALL read_file(AMX *amx, cell *params) /* 5 param */
|
||||
|
||||
if ((fp =fopen(build_pathname("%s", szFile), "r")) == NULL)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Couldn't read file \"%s\"", szFile);
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -183,7 +185,7 @@ static cell AMX_NATIVE_CALL write_file(AMX *amx, cell *params) /* 3 param */
|
||||
{
|
||||
if ((pFile = fopen(sFile, "a")) == NULL)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Couldn't write file \"%s\"", sFile);
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -199,7 +201,7 @@ static cell AMX_NATIVE_CALL write_file(AMX *amx, cell *params) /* 3 param */
|
||||
{
|
||||
if ((pFile = fopen(sFile, "w")) == NULL)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Couldn't write file \"%s\"", sFile);
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -219,7 +221,7 @@ static cell AMX_NATIVE_CALL write_file(AMX *amx, cell *params) /* 3 param */
|
||||
|
||||
if ((pTemp = tmpfile()) == NULL)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Couldn't create temp file");
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -249,7 +251,7 @@ static cell AMX_NATIVE_CALL write_file(AMX *amx, cell *params) /* 3 param */
|
||||
// now rewrite because file can be now smaller...
|
||||
if ((pFile = fopen(sFile, "w")) == NULL)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Couldn't write file \"%s\"", sFile);
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -554,18 +556,6 @@ static cell AMX_NATIVE_CALL amx_fread_blocks(AMX *amx, cell *params)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL amx_fputs(AMX *amx, cell *params)
|
||||
{
|
||||
FILE *fp = (FILE *)params[1];
|
||||
|
||||
if (!fp)
|
||||
return 0;
|
||||
|
||||
int len;
|
||||
char *str = get_amxstring(amx, params[2], 0, len);
|
||||
return fputs(str, fp);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL amx_fgets(AMX *amx, cell *params)
|
||||
{
|
||||
FILE *fp = (FILE *)params[1];
|
||||
@ -799,19 +789,6 @@ static cell AMX_NATIVE_CALL amx_rmdir(AMX *amx, cell *params)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL amx_rename(AMX *amx, cell *params)
|
||||
{
|
||||
int len;
|
||||
char *fold = get_amxstring(amx, params[1], 0, len);
|
||||
char *fnew = get_amxstring(amx, params[2], 1, len);
|
||||
|
||||
#if defined __linux__
|
||||
return (rename(fold, fnew) == 0);
|
||||
#elif defined WIN32
|
||||
return MoveFileA(fold, fnew);
|
||||
#endif
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO file_Natives[] =
|
||||
{
|
||||
{"delete_file", delete_file},
|
||||
@ -845,7 +822,5 @@ AMX_NATIVE_INFO file_Natives[] =
|
||||
{"fputc", amx_fputc},
|
||||
{"fungetc", amx_ungetc},
|
||||
{"rmdir", amx_rmdir},
|
||||
{"fputs", amx_fputs},
|
||||
{"rename_file", amx_rename},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
@ -80,14 +80,14 @@ const char *translate(AMX *amx, cell amxaddr, const char *key)
|
||||
const char *testlang = amx_mldebug->string;
|
||||
if (!g_langMngr.LangExists(testlang))
|
||||
{
|
||||
AMXXLOG_Error("[AMXX] \"%s\" is an invalid debug language", testlang);
|
||||
AMXXLOG_Log("[AMXX] \"%s\" is an invalid debug language", testlang);
|
||||
validlang = false;
|
||||
}
|
||||
|
||||
g_langMngr.GetDef(testlang, key, debug_status);
|
||||
|
||||
if (validlang && debug_status == ERR_BADKEY)
|
||||
AMXXLOG_Error("[AMXX] Language key \"%s\" not found for language \"%s\", check \"%s\"", key, testlang, GetFileName(amx));
|
||||
AMXXLOG_Log("[AMXX] Language key \"%s\" not found for language \"%s\", check \"%s\"", key, testlang, GetFileName(amx));
|
||||
}
|
||||
|
||||
if (def == NULL)
|
||||
@ -96,7 +96,7 @@ const char *translate(AMX *amx, cell amxaddr, const char *key)
|
||||
{
|
||||
if (status == ERR_BADLANG && (BadLang_Table.AltFindOrInsert(pLangName).last + 120.0f < gpGlobals->time))
|
||||
{
|
||||
AMXXLOG_Error("[AMXX] Language \"%s\" not found", pLangName);
|
||||
AMXXLOG_Log("[AMXX] Language \"%s\" not found", pLangName);
|
||||
BadLang_Table.AltFindOrInsert(pLangName).last = gpGlobals->time;
|
||||
}
|
||||
}
|
||||
|
@ -1,243 +0,0 @@
|
||||
#include "libraries.h"
|
||||
#include "sh_list.h"
|
||||
|
||||
List<Library *> g_libraries;
|
||||
|
||||
bool AddLibrary(const char *name, LibType type, LibSource src, void *parent)
|
||||
{
|
||||
if (FindLibrary(name, type))
|
||||
return false;
|
||||
|
||||
Library *lib = new Library;
|
||||
|
||||
lib->name.assign(name);
|
||||
lib->type = type;
|
||||
lib->src = src;
|
||||
lib->parent = parent;
|
||||
|
||||
g_libraries.push_back(lib);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DecodeLibCmdString(const char *str, LibDecoder *dec)
|
||||
{
|
||||
if (dec->buffer)
|
||||
{
|
||||
free(dec->buffer);
|
||||
dec->buffer = NULL;
|
||||
}
|
||||
if (str[0] != '?')
|
||||
{
|
||||
return false;
|
||||
} else {
|
||||
str++;
|
||||
if (*str == 'r')
|
||||
{
|
||||
str++;
|
||||
if (*str == 'c')
|
||||
dec->cmd = LibCmd_ReqClass;
|
||||
else if (*str == 'l')
|
||||
dec->cmd = LibCmd_ReqLib;
|
||||
else
|
||||
return false;
|
||||
str++;
|
||||
} else if (*str == 'f') {
|
||||
str++;
|
||||
dec->cmd = LibCmd_ForceLib;
|
||||
} else if (*str == 'e') {
|
||||
str++;
|
||||
if (*str == 'c')
|
||||
dec->cmd = LibCmd_ExpectClass;
|
||||
else if (*str == 'l')
|
||||
dec->cmd = LibCmd_ExpectLib;
|
||||
else
|
||||
return false;
|
||||
str++;
|
||||
} else if (*str == 'd') {
|
||||
str++;
|
||||
dec->cmd = LibCmd_DefaultLib;
|
||||
}
|
||||
if (*str != '_')
|
||||
return false;
|
||||
str++;
|
||||
if (dec->cmd < LibCmd_ExpectLib)
|
||||
{
|
||||
dec->buffer = strdup(str);
|
||||
dec->param1 = dec->buffer;
|
||||
dec->param2 = NULL;
|
||||
} else {
|
||||
dec->buffer = strdup(str);
|
||||
char *p = strchr(dec->buffer, '_');
|
||||
while (p && (*(p+1) == '_'))
|
||||
p = strchr(p+2, '_');
|
||||
if (!p || !*(p+1))
|
||||
return false;
|
||||
*p = '\0';
|
||||
dec->param1 = dec->buffer;
|
||||
dec->param2 = p+1;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t AddLibrariesFromString(const char *name, LibType type, LibSource src, void *parent)
|
||||
{
|
||||
char buffer[255];
|
||||
char *ptr, *p, s;
|
||||
size_t count = 0;
|
||||
|
||||
snprintf(buffer, sizeof(buffer)-1, "%s", name);
|
||||
|
||||
ptr = buffer;
|
||||
p = buffer;
|
||||
while (*p)
|
||||
{
|
||||
while (*p && (*p != ','))
|
||||
p++;
|
||||
s = *p;
|
||||
*p = '\0';
|
||||
if (AddLibrary(ptr, type, src, parent))
|
||||
count++;
|
||||
if (!s)
|
||||
break;
|
||||
p++;
|
||||
while (*p && (*p == ','))
|
||||
p++;
|
||||
ptr = p;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
size_t ClearLibraries(LibSource src)
|
||||
{
|
||||
List<Library *>::iterator iter;
|
||||
size_t count = 0;
|
||||
|
||||
iter = g_libraries.begin();
|
||||
while (iter != g_libraries.end())
|
||||
{
|
||||
if ( (*iter)->src == src )
|
||||
{
|
||||
delete (*iter);
|
||||
iter = g_libraries.erase(iter);
|
||||
count++;
|
||||
} else {
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
size_t RemoveLibraries(void *parent)
|
||||
{
|
||||
List<Library *>::iterator iter;
|
||||
Library *lib;
|
||||
size_t count = 0;
|
||||
|
||||
iter = g_libraries.begin();
|
||||
while (iter != g_libraries.end())
|
||||
{
|
||||
lib = (*iter);
|
||||
if (lib->parent == parent)
|
||||
{
|
||||
delete (*iter);
|
||||
iter = g_libraries.erase(iter);
|
||||
count++;
|
||||
} else {
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
bool FindLibrary(const char *name, LibType type)
|
||||
{
|
||||
List<Library *>::iterator iter;
|
||||
Library *lib;
|
||||
|
||||
for (iter = g_libraries.begin(); iter != g_libraries.end(); iter++)
|
||||
{
|
||||
lib = (*iter);
|
||||
if (lib->type != type)
|
||||
continue;
|
||||
if (strcasecmp(lib->name.c_str(), name) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
LibError RunLibCommand(const LibDecoder *enc)
|
||||
{
|
||||
List<Library *>::iterator iter,end;
|
||||
Library *lib;
|
||||
|
||||
iter = g_libraries.begin();
|
||||
end = g_libraries.end();
|
||||
|
||||
if ( (enc->cmd == LibCmd_ReqLib) || (enc->cmd == LibCmd_ReqClass) )
|
||||
{
|
||||
LibType expect;
|
||||
|
||||
if (enc->cmd == LibCmd_ReqLib)
|
||||
expect = LibType_Library;
|
||||
else if (enc->cmd == LibCmd_ReqClass)
|
||||
expect = LibType_Class;
|
||||
|
||||
/** see if it exists */
|
||||
for (; iter != end; iter++)
|
||||
{
|
||||
lib = (*iter);
|
||||
if (lib->type != expect)
|
||||
continue;
|
||||
if (strcasecmp(lib->name.c_str(), enc->param1) == 0)
|
||||
return LibErr_None;
|
||||
}
|
||||
if (expect == LibType_Library)
|
||||
return LibErr_NoLibrary;
|
||||
else if (expect = LibType_Class)
|
||||
return LibErr_NoClass;
|
||||
|
||||
return LibErr_NoLibrary;
|
||||
} else if (enc->cmd == LibCmd_ForceLib) {
|
||||
if (!LoadModule(enc->param1, PT_ANYTIME, true, true))
|
||||
{
|
||||
return LibErr_NoLibrary;
|
||||
}
|
||||
} else if ( (enc->cmd == LibCmd_DefaultLib) ||
|
||||
((enc->cmd == LibCmd_ExpectLib) || (enc->cmd == LibCmd_ExpectClass)) )
|
||||
{
|
||||
LibType expect;
|
||||
|
||||
if (enc->cmd == LibCmd_ExpectLib)
|
||||
expect = LibType_Library;
|
||||
else
|
||||
expect = LibType_Class;
|
||||
|
||||
/** see if it exists */
|
||||
for (; iter != end; iter++)
|
||||
{
|
||||
lib = (*iter);
|
||||
if (lib->type != expect)
|
||||
continue;
|
||||
if (strcasecmp(lib->name.c_str(), enc->param1) == 0)
|
||||
return LibErr_None;
|
||||
}
|
||||
|
||||
if (!LoadModule(enc->param2, PT_ANYTIME, true, true))
|
||||
{
|
||||
return LibErr_NoLibrary;
|
||||
}
|
||||
|
||||
return LibErr_None;
|
||||
}
|
||||
|
||||
return LibErr_None;
|
||||
}
|
@ -1,73 +0,0 @@
|
||||
#ifndef _INCLUDE_LIBRARIES_H
|
||||
#define _INCLUDE_LIBRARIES_H
|
||||
|
||||
#include <string.h>
|
||||
#include "amxmodx.h"
|
||||
#include "CString.h"
|
||||
|
||||
enum LibSource
|
||||
{
|
||||
LibSource_Plugin,
|
||||
LibSource_Module
|
||||
};
|
||||
|
||||
enum LibType
|
||||
{
|
||||
LibType_Library,
|
||||
LibType_Class
|
||||
};
|
||||
|
||||
struct Library
|
||||
{
|
||||
String name;
|
||||
LibSource src;
|
||||
LibType type;
|
||||
void *parent;
|
||||
};
|
||||
|
||||
enum LibCmd
|
||||
{
|
||||
LibCmd_ReqLib,
|
||||
LibCmd_ReqClass,
|
||||
LibCmd_ForceLib,
|
||||
LibCmd_ExpectLib,
|
||||
LibCmd_ExpectClass,
|
||||
LibCmd_DefaultLib,
|
||||
};
|
||||
|
||||
enum LibError
|
||||
{
|
||||
LibErr_None = 0,
|
||||
LibErr_NoLibrary,
|
||||
LibErr_NoClass,
|
||||
};
|
||||
|
||||
class LibDecoder
|
||||
{
|
||||
public:
|
||||
LibDecoder() : buffer(NULL)
|
||||
{
|
||||
}
|
||||
~LibDecoder()
|
||||
{
|
||||
free(buffer);
|
||||
buffer = NULL;
|
||||
param1 = NULL;
|
||||
param2 = NULL;
|
||||
}
|
||||
char *buffer;
|
||||
char *param1;
|
||||
char *param2;
|
||||
LibCmd cmd;
|
||||
};
|
||||
|
||||
bool AddLibrary(const char *name, LibType type, LibSource src, void *parent=NULL);
|
||||
bool DecodeLibCmdString(const char *str, LibDecoder *cmd);
|
||||
size_t AddLibrariesFromString(const char *name, LibType type, LibSource src, void *parent=NULL);
|
||||
size_t ClearLibraries(LibSource src);
|
||||
LibError RunLibCommand(const LibDecoder *enc);
|
||||
size_t RemoveLibraries(void *parent);
|
||||
bool FindLibrary(const char *name, LibType type);
|
||||
|
||||
|
||||
#endif //_INCLUDE_LIBRARIES_H
|
@ -1,805 +0,0 @@
|
||||
#include "amxmodx.h"
|
||||
#include "messages.h"
|
||||
|
||||
Message Msg;
|
||||
CVector<int> msgHooks[256];
|
||||
int msgBlocks[256] = {BLOCK_NOT};
|
||||
int msgDest;
|
||||
int msgType;
|
||||
float *msgOrigin;
|
||||
edict_t *msgpEntity;
|
||||
bool inhook = false;
|
||||
bool inblock = false;
|
||||
enginefuncs_t *g_pEngTable = NULL;
|
||||
|
||||
void ClearMessages()
|
||||
{
|
||||
for (size_t i=0; i<MAX_MESSAGES; i++)
|
||||
{
|
||||
msgHooks[i].clear();
|
||||
msgBlocks[i] = BLOCK_NOT;
|
||||
}
|
||||
}
|
||||
|
||||
Message::Message()
|
||||
{
|
||||
m_CurParam = 0;
|
||||
}
|
||||
|
||||
bool Message::Ready()
|
||||
{
|
||||
if (!m_Params.size())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Message::Init()
|
||||
{
|
||||
if (!Ready())
|
||||
{
|
||||
msgparam *p = new msgparam;
|
||||
m_Params.push_back(p);
|
||||
}
|
||||
m_CurParam = 0;
|
||||
}
|
||||
|
||||
Message::~Message()
|
||||
{
|
||||
for (size_t i=0; i<m_Params.size(); i++)
|
||||
delete m_Params[i];
|
||||
|
||||
m_Params.clear();
|
||||
}
|
||||
|
||||
msgparam *Message::AdvPtr()
|
||||
{
|
||||
msgparam *pParam = NULL;
|
||||
|
||||
if (++m_CurParam >= m_Params.size())
|
||||
{
|
||||
pParam = new msgparam;
|
||||
m_Params.push_back(pParam);
|
||||
} else {
|
||||
pParam = m_Params[m_CurParam];
|
||||
}
|
||||
|
||||
return pParam;
|
||||
}
|
||||
|
||||
void Message::AddParam(const char *data, msgtype type)
|
||||
{
|
||||
msgparam *pParam = AdvPtr();
|
||||
|
||||
pParam->szData.assign(data);
|
||||
pParam->type = type;
|
||||
}
|
||||
|
||||
void Message::AddParam(int data, msgtype type)
|
||||
{
|
||||
msgparam *pParam = AdvPtr();
|
||||
|
||||
pParam->v.iData = data;
|
||||
pParam->type = type;
|
||||
}
|
||||
|
||||
void Message::AddParam(float data, msgtype type)
|
||||
{
|
||||
msgparam *pParam = AdvPtr();
|
||||
|
||||
pParam->v.fData = data;
|
||||
pParam->type = type;
|
||||
}
|
||||
|
||||
msgtype Message::GetParamType(size_t index)
|
||||
{
|
||||
if (index < 1 || index > m_CurParam)
|
||||
return static_cast<msgtype>(0);
|
||||
|
||||
return m_Params[index]->type;
|
||||
}
|
||||
|
||||
float Message::GetParamFloat(size_t index)
|
||||
{
|
||||
if (index < 1 || index > m_CurParam)
|
||||
return 0;
|
||||
|
||||
return m_Params[index]->v.fData;
|
||||
}
|
||||
|
||||
const char *Message::GetParamString(size_t index)
|
||||
{
|
||||
if (index < 1 || index > m_CurParam)
|
||||
return 0;
|
||||
|
||||
return m_Params[index]->szData.c_str();
|
||||
}
|
||||
|
||||
int Message::GetParamInt(size_t index)
|
||||
{
|
||||
if (index < 1 || index > m_CurParam)
|
||||
return 0;
|
||||
|
||||
return m_Params[index]->v.iData;
|
||||
}
|
||||
|
||||
void Message::SetParam(size_t index, float data)
|
||||
{
|
||||
if (index < 1 || index > m_CurParam)
|
||||
return;
|
||||
|
||||
m_Params[index]->v.fData = data;
|
||||
}
|
||||
|
||||
void Message::SetParam(size_t index, int data)
|
||||
{
|
||||
if (index < 1 || index > m_CurParam)
|
||||
return;
|
||||
|
||||
m_Params[index]->v.iData = data;
|
||||
}
|
||||
|
||||
void Message::SetParam(size_t index, const char *data)
|
||||
{
|
||||
if (index < 1 || index > m_CurParam)
|
||||
return;
|
||||
|
||||
m_Params[index]->szData.assign(data);
|
||||
}
|
||||
|
||||
void Message::Reset()
|
||||
{
|
||||
m_CurParam = 0;
|
||||
}
|
||||
|
||||
size_t Message::Params()
|
||||
{
|
||||
return m_CurParam;
|
||||
}
|
||||
|
||||
void Message::Send()
|
||||
{
|
||||
msgparam *pParam = NULL;
|
||||
|
||||
for (size_t i=1; i<=m_CurParam; i++)
|
||||
{
|
||||
pParam = m_Params[i];
|
||||
switch (pParam->type)
|
||||
{
|
||||
case arg_byte:
|
||||
WRITE_BYTE(pParam->v.iData);
|
||||
break;
|
||||
case arg_char:
|
||||
WRITE_CHAR(pParam->v.iData);
|
||||
break;
|
||||
case arg_short:
|
||||
WRITE_SHORT(pParam->v.iData);
|
||||
break;
|
||||
case arg_long:
|
||||
WRITE_LONG(pParam->v.iData);
|
||||
break;
|
||||
case arg_angle:
|
||||
WRITE_ANGLE(pParam->v.fData);
|
||||
break;
|
||||
case arg_coord:
|
||||
WRITE_COORD(pParam->v.fData);
|
||||
break;
|
||||
case arg_string:
|
||||
WRITE_STRING(pParam->szData.c_str());
|
||||
break;
|
||||
case arg_entity:
|
||||
WRITE_ENTITY(pParam->v.iData);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void C_MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed)
|
||||
{
|
||||
if (msgBlocks[msg_type])
|
||||
{
|
||||
inblock = true;
|
||||
msgType = msg_type;
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
} else if (msgHooks[msg_type].size()) {
|
||||
inhook = true;
|
||||
msgDest = msg_dest;
|
||||
msgType = msg_type;
|
||||
msgOrigin = (float *)pOrigin;
|
||||
msgpEntity = ed;
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void C_WriteByte(int iValue)
|
||||
{
|
||||
if (inblock)
|
||||
{
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
} else if (inhook) {
|
||||
Msg.AddParam(iValue, arg_byte);
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void C_WriteChar(int iValue)
|
||||
{
|
||||
if (inblock)
|
||||
{
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
} else if (inhook) {
|
||||
Msg.AddParam(iValue, arg_char);
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void C_WriteShort(int iValue)
|
||||
{
|
||||
if (inblock)
|
||||
{
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
} else if (inhook) {
|
||||
Msg.AddParam(iValue, arg_short);
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void C_WriteLong(int iValue)
|
||||
{
|
||||
if (inblock)
|
||||
{
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
} else if (inhook) {
|
||||
Msg.AddParam(iValue, arg_long);
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void C_WriteAngle(float flValue)
|
||||
{
|
||||
if (inblock)
|
||||
{
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
} else if (inhook) {
|
||||
Msg.AddParam(flValue, arg_angle);
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void C_WriteCoord(float flValue)
|
||||
{
|
||||
if (inblock)
|
||||
{
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
} else if (inhook) {
|
||||
Msg.AddParam(flValue, arg_coord);
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void C_WriteString(const char *sz)
|
||||
{
|
||||
if (inblock)
|
||||
{
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
} else if (inhook) {
|
||||
Msg.AddParam(sz, arg_string);
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void C_WriteEntity(int iValue)
|
||||
{
|
||||
if (inblock)
|
||||
{
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
} else if (inhook) {
|
||||
Msg.AddParam(iValue, arg_entity);
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void C_MessageEnd(void)
|
||||
{
|
||||
int mres = 0, mresB = 0;
|
||||
unsigned int i = 0;
|
||||
if (inblock)
|
||||
{
|
||||
inblock = false;
|
||||
if (msgBlocks[msgType] == BLOCK_ONCE)
|
||||
{
|
||||
msgBlocks[msgType] = BLOCK_NOT;
|
||||
}
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
} else if (inhook) {
|
||||
for (i=0; i<msgHooks[msgType].size(); i++)
|
||||
{
|
||||
mresB = executeForwards(msgHooks[msgType].at(i), (cell)msgType, (cell)msgDest, (cell)ENTINDEX(msgpEntity));
|
||||
if (mresB > mres)
|
||||
mres = mresB;
|
||||
}
|
||||
inhook = false;
|
||||
if (mres & 1)
|
||||
{
|
||||
Msg.Reset();
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
|
||||
/* send the real message */
|
||||
MESSAGE_BEGIN(msgDest, msgType, msgOrigin, msgpEntity);
|
||||
Msg.Send();
|
||||
MESSAGE_END();
|
||||
|
||||
/* reset */
|
||||
Msg.Reset();
|
||||
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL message_begin(AMX *amx, cell *params) /* 4 param */
|
||||
{
|
||||
int numparam = *params / sizeof(cell);
|
||||
float vecOrigin[3];
|
||||
cell *cpOrigin;
|
||||
|
||||
if (params[2] < 1 || ((params[2] > 63) // maximal number of engine messages
|
||||
&& !GET_USER_MSG_NAME(PLID, params[2], NULL)))
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Plugin called message_begin with an invalid message id (%d).", params[2]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (params[1])
|
||||
{
|
||||
case MSG_BROADCAST:
|
||||
case MSG_ALL:
|
||||
case MSG_SPEC:
|
||||
MESSAGE_BEGIN(params[1], params[2], NULL);
|
||||
break;
|
||||
case MSG_PVS: case MSG_PAS:
|
||||
case MSG_PVS_R: case MSG_PAS_R:
|
||||
if (numparam < 3)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid number of parameters passed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
cpOrigin = get_amxaddr(amx, params[3]);
|
||||
|
||||
vecOrigin[0] = static_cast<float>(*cpOrigin);
|
||||
vecOrigin[1] = static_cast<float>(*(cpOrigin + 1));
|
||||
vecOrigin[2] = static_cast<float>(*(cpOrigin + 2));
|
||||
|
||||
MESSAGE_BEGIN(params[1], params[2], vecOrigin);
|
||||
|
||||
break;
|
||||
case MSG_ONE_UNRELIABLE:
|
||||
case MSG_ONE:
|
||||
if (numparam < 4)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid number of parameters passed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
MESSAGE_BEGIN(params[1], params[2], NULL, INDEXENT(params[4]));
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL message_end(AMX *amx, cell *params)
|
||||
{
|
||||
MESSAGE_END();
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_byte(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
WRITE_BYTE(params[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_char(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
WRITE_CHAR(params[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_short(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
WRITE_SHORT(params[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_long(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
WRITE_LONG(params[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_entity(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
WRITE_ENTITY(params[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_angle(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
WRITE_ANGLE(static_cast<float>(params[1]));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_coord(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
WRITE_COORD(static_cast<float>(params[1]));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL write_string(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
int a;
|
||||
WRITE_STRING(get_amxstring(amx, params[1], 3, a));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL register_message(AMX *amx, cell *params)
|
||||
{
|
||||
int len;
|
||||
char *name = get_amxstring(amx, params[2], 0, len);
|
||||
|
||||
if (!Msg.Ready())
|
||||
Msg.Init();
|
||||
|
||||
if (params[1]>0 && params[1] < 256)
|
||||
{
|
||||
int id = registerSPForwardByName(amx, name, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
|
||||
if (id != -1)
|
||||
{
|
||||
msgHooks[params[1]].push_back(id);
|
||||
return id;
|
||||
} else {
|
||||
LogError(amx, AMX_ERR_NOTFOUND, "Could not find function \"%s\"", name);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_msg_block(AMX *amx, cell *params)
|
||||
{
|
||||
int msgid = params[1];
|
||||
int block = params[2];
|
||||
|
||||
if (msgid < 1 || msgid > 255)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid message id");
|
||||
return 0;
|
||||
}
|
||||
|
||||
msgBlocks[msgid] = block;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_msg_block(AMX *amx, cell *params)
|
||||
{
|
||||
int msgid = params[1];
|
||||
|
||||
if (msgid < 1 || msgid > 255)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid message id");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return msgBlocks[msgid];
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_msg_args(AMX *amx, cell *params)
|
||||
{
|
||||
return Msg.Params();
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_msg_argtype(AMX *amx, cell *params)
|
||||
{
|
||||
size_t argn = static_cast<size_t>(params[1]);
|
||||
|
||||
if (!inhook || argn > Msg.Params())
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid message argument %d", argn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Msg.GetParamType(argn);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_msg_arg_int(AMX *amx, cell *params)
|
||||
{
|
||||
size_t argn = static_cast<size_t>(params[1]);
|
||||
|
||||
if (!inhook || argn > Msg.Params())
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid message argument %d", argn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Msg.GetParamInt(argn);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_msg_arg_int(AMX *amx, cell *params)
|
||||
{
|
||||
size_t argn = static_cast<size_t>(params[1]);
|
||||
|
||||
if (!inhook || argn > Msg.Params())
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid message argument %d", argn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Msg.SetParam(argn, (int)params[3]);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_msg_arg_float(AMX *amx, cell *params)
|
||||
{
|
||||
size_t argn = static_cast<size_t>(params[1]);
|
||||
|
||||
if (!inhook || argn > Msg.Params())
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid message argument %d", argn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
REAL f = (REAL)Msg.GetParamFloat(argn);
|
||||
return amx_ftoc(f);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_msg_arg_float(AMX *amx, cell *params)
|
||||
{
|
||||
size_t argn = static_cast<size_t>(params[1]);
|
||||
|
||||
if (!inhook || argn > Msg.Params())
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid message argument %d", argn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
REAL fVal = amx_ctof(params[3]);
|
||||
|
||||
Msg.SetParam(argn, (float)fVal);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_msg_arg_string(AMX *amx, cell *params)
|
||||
{
|
||||
size_t argn = static_cast<size_t>(params[1]);
|
||||
|
||||
if (!inhook || argn > Msg.Params())
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid message argument %d", argn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *szVal = Msg.GetParamString(argn);
|
||||
|
||||
return set_amxstring(amx, params[2], szVal, params[3]);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_msg_arg_string(AMX *amx, cell *params)
|
||||
{
|
||||
size_t argn = static_cast<size_t>(params[1]);
|
||||
int iLen;
|
||||
|
||||
if (!inhook || argn > Msg.Params())
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid message argument %d", argn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *szVal = get_amxstring(amx, params[2], 0, iLen);
|
||||
|
||||
Msg.SetParam(argn, szVal);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_msg_origin(AMX *amx, cell *params)
|
||||
{
|
||||
if (!inhook)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Not in a message hook");
|
||||
return 0;
|
||||
}
|
||||
|
||||
cell *cAddr = get_amxaddr(amx, params[1]);
|
||||
|
||||
if (msgDest >= MSG_PVS && msgDest <= MSG_PAS_R)
|
||||
{
|
||||
vec3_t vRet = (Vector)msgOrigin;
|
||||
cAddr[0] = FloatToCell(vRet.x);
|
||||
cAddr[1] = FloatToCell(vRet.y);
|
||||
cAddr[2] = FloatToCell(vRet.z);
|
||||
} else {
|
||||
cAddr[0] = 0;
|
||||
cAddr[1] = 0;
|
||||
cAddr[2] = 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL emessage_begin(AMX *amx, cell *params) /* 4 param */
|
||||
{
|
||||
int numparam = *params / sizeof(cell);
|
||||
float vecOrigin[3];
|
||||
cell *cpOrigin;
|
||||
|
||||
if (params[2] < 1 || ((params[2] > 63) // maximal number of engine messages
|
||||
&& !GET_USER_MSG_NAME(PLID, params[2], NULL)))
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Plugin called message_begin with an invalid message id (%d).", params[2]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (params[1])
|
||||
{
|
||||
case MSG_BROADCAST:
|
||||
case MSG_ALL:
|
||||
case MSG_SPEC:
|
||||
g_pEngTable->pfnMessageBegin(params[1], params[2], NULL, NULL);
|
||||
break;
|
||||
case MSG_PVS: case MSG_PAS:
|
||||
case MSG_PVS_R: case MSG_PAS_R:
|
||||
if (numparam < 3)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid number of parameters passed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
cpOrigin = get_amxaddr(amx, params[3]);
|
||||
|
||||
vecOrigin[0] = static_cast<float>(*cpOrigin);
|
||||
vecOrigin[1] = static_cast<float>(*(cpOrigin + 1));
|
||||
vecOrigin[2] = static_cast<float>(*(cpOrigin + 2));
|
||||
|
||||
g_pEngTable->pfnMessageBegin(params[1], params[2], vecOrigin, NULL);
|
||||
|
||||
break;
|
||||
case MSG_ONE_UNRELIABLE:
|
||||
case MSG_ONE:
|
||||
if (numparam < 4)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid number of parameters passed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
g_pEngTable->pfnMessageBegin(params[1], params[2], NULL, INDEXENT(params[4]));
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL emessage_end(AMX *amx, cell *params)
|
||||
{
|
||||
g_pEngTable->pfnMessageEnd();
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL ewrite_byte(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
g_pEngTable->pfnWriteByte(params[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL ewrite_char(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
g_pEngTable->pfnWriteChar(params[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL ewrite_short(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
g_pEngTable->pfnWriteShort(params[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL ewrite_long(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
g_pEngTable->pfnWriteLong(params[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL ewrite_entity(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
g_pEngTable->pfnWriteEntity(params[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL ewrite_angle(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
g_pEngTable->pfnWriteAngle(static_cast<float>(params[1]));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL ewrite_coord(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
g_pEngTable->pfnWriteCoord(static_cast<float>(params[1]));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL ewrite_string(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
int a;
|
||||
g_pEngTable->pfnWriteString(get_amxstring(amx, params[1], 3, a));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO msg_Natives[] =
|
||||
{
|
||||
{"message_begin", message_begin},
|
||||
{"message_end", message_end},
|
||||
|
||||
{"write_angle", write_angle},
|
||||
{"write_byte", write_byte},
|
||||
{"write_char", write_char},
|
||||
{"write_coord", write_coord},
|
||||
{"write_entity", write_entity},
|
||||
{"write_long", write_long},
|
||||
{"write_short", write_short},
|
||||
{"write_string", write_string},
|
||||
|
||||
{"register_message", register_message},
|
||||
|
||||
{"set_msg_block", set_msg_block},
|
||||
{"get_msg_block", get_msg_block},
|
||||
|
||||
{"get_msg_args", get_msg_args},
|
||||
{"get_msg_argtype", get_msg_argtype},
|
||||
{"get_msg_arg_int", get_msg_arg_int},
|
||||
{"set_msg_arg_int", set_msg_arg_int},
|
||||
{"get_msg_arg_float", get_msg_arg_float},
|
||||
{"set_msg_arg_float", set_msg_arg_float},
|
||||
{"get_msg_arg_string", get_msg_arg_string},
|
||||
{"set_msg_arg_string", set_msg_arg_string},
|
||||
{"get_msg_origin", get_msg_origin},
|
||||
|
||||
{"emessage_begin", emessage_begin},
|
||||
{"emessage_end", emessage_end},
|
||||
|
||||
{"ewrite_angle", ewrite_angle},
|
||||
{"ewrite_byte", ewrite_byte},
|
||||
{"ewrite_char", ewrite_char},
|
||||
{"ewrite_coord", ewrite_coord},
|
||||
{"ewrite_entity", ewrite_entity},
|
||||
{"ewrite_long", ewrite_long},
|
||||
{"ewrite_short", ewrite_short},
|
||||
{"ewrite_string", ewrite_string},
|
||||
|
||||
{NULL, NULL},
|
||||
};
|
@ -33,8 +33,6 @@
|
||||
|
||||
#if defined WIN32
|
||||
#include <direct.h>
|
||||
#else
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
#include "amxmodx.h"
|
||||
@ -43,8 +41,6 @@
|
||||
#include "natives.h"
|
||||
#include "binlog.h"
|
||||
#include "optimizer.h"
|
||||
#include "libraries.h"
|
||||
#include "messages.h"
|
||||
|
||||
plugin_info_t Plugin_info =
|
||||
{
|
||||
@ -153,57 +149,6 @@ int FF_InconsistentFile = -1;
|
||||
int FF_ClientAuthorized = -1;
|
||||
int FF_ChangeLevel = -1;
|
||||
|
||||
void ParseAndOrAdd(CStack<String *> & files, const char *name)
|
||||
{
|
||||
if (strncmp(name, "plugins-", 8) == 0)
|
||||
{
|
||||
#if !defined WIN32
|
||||
size_t len = strlen(name);
|
||||
if (strcmp(&name[len-4], ".ini") == 0)
|
||||
{
|
||||
#endif
|
||||
String *pString = new String(name);
|
||||
files.push(pString);
|
||||
#if !defined WIN32
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void BuildPluginFileList(CStack<String *> & files)
|
||||
{
|
||||
char path[255];
|
||||
#if defined WIN32
|
||||
build_pathname_r(path, sizeof(path)-1, "%s/*.ini", get_localinfo("amxx_configsdir", "addons/amxmodx/configs"));
|
||||
_finddata_t fd;
|
||||
intptr_t handle = _findfirst(path, &fd);
|
||||
|
||||
if (handle < 0)
|
||||
return;
|
||||
|
||||
while (!_findnext(handle, &fd))
|
||||
{
|
||||
ParseAndOrAdd(files, fd.name);
|
||||
}
|
||||
|
||||
_findclose(handle);
|
||||
#elif defined __linux__
|
||||
build_pathname_r(path, sizeof(path)-1, "%s/", get_localinfo("amxx_configsdir", "addons/amxmodx/configs"));
|
||||
struct dirent *ep;
|
||||
DIR *dp;
|
||||
|
||||
if ((dp = opendir(path)) == NULL)
|
||||
return;
|
||||
|
||||
while ( (ep=readdir(dp)) != NULL )
|
||||
{
|
||||
ParseAndOrAdd(files, ep->d_name);
|
||||
}
|
||||
|
||||
closedir (dp);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Precache stuff from force consistency calls
|
||||
// or check for pointed files won't be done
|
||||
int C_PrecacheModel(char *s)
|
||||
@ -316,20 +261,6 @@ int C_Spawn(edict_t *pent)
|
||||
|
||||
// ###### Load modules
|
||||
loadModules(get_localinfo("amxx_modules", "addons/amxmodx/configs/modules.ini"), PT_ANYTIME);
|
||||
g_plugins.CALMFromFile(get_localinfo("amxx_plugins", "addons/amxmodx/configs/plugins.ini"));
|
||||
CStack<String *> files;
|
||||
BuildPluginFileList(files);
|
||||
char path[255];
|
||||
while (!files.empty())
|
||||
{
|
||||
String *pString = files.front();
|
||||
snprintf(path, sizeof(path)-1, "%s/%s",
|
||||
get_localinfo("amxx_configsdir", "addons/amxmodx/configs"),
|
||||
pString->c_str());
|
||||
g_plugins.CALMFromFile(path);
|
||||
delete pString;
|
||||
files.pop();
|
||||
}
|
||||
int loaded = countModules(CountModules_Running); // Call after attachModules so all modules don't have pending stat
|
||||
|
||||
// Set some info about amx version and modules
|
||||
@ -367,17 +298,6 @@ int C_Spawn(edict_t *pent)
|
||||
|
||||
// ###### Load AMX scripts
|
||||
g_plugins.loadPluginsFromFile(get_localinfo("amxx_plugins", "addons/amxmodx/configs/plugins.ini"));
|
||||
BuildPluginFileList(files);
|
||||
while (!files.empty())
|
||||
{
|
||||
String *pString = files.front();
|
||||
snprintf(path, sizeof(path)-1, "%s/%s",
|
||||
get_localinfo("amxx_configsdir", "addons/amxmodx/configs"),
|
||||
pString->c_str());
|
||||
g_plugins.loadPluginsFromFile(path);
|
||||
delete pString;
|
||||
files.pop();
|
||||
}
|
||||
g_plugins.Finalize();
|
||||
|
||||
// Register forwards
|
||||
@ -568,8 +488,6 @@ void C_ServerDeactivate_Post()
|
||||
{
|
||||
if (!g_initialized)
|
||||
RETURN_META(MRES_IGNORED);
|
||||
|
||||
modules_callPluginsUnloading();
|
||||
|
||||
detachReloadModules();
|
||||
g_auth.clear();
|
||||
@ -588,9 +506,6 @@ void C_ServerDeactivate_Post()
|
||||
g_xvars.clear();
|
||||
g_plugins.clear();
|
||||
ClearPluginLibraries();
|
||||
modules_callPluginsUnloaded();
|
||||
|
||||
ClearMessages();
|
||||
|
||||
for (unsigned int i=0; i<g_hudsync.size(); i++)
|
||||
delete [] g_hudsync[i];
|
||||
@ -1351,8 +1266,6 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, m
|
||||
// This will also call modules Meta_Query and Meta_Attach functions
|
||||
loadModules(get_localinfo("amxx_modules", "addons/amxmodx/configs/modules.ini"), now);
|
||||
|
||||
GET_HOOK_TABLES(PLID, &g_pEngTable, NULL, NULL);
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
@ -1364,8 +1277,6 @@ C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason)
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
modules_callPluginsUnloading();
|
||||
|
||||
g_auth.clear();
|
||||
g_forwards.clear();
|
||||
g_commands.clear();
|
||||
@ -1384,19 +1295,12 @@ C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason)
|
||||
g_cvars.clear();
|
||||
g_langMngr.Clear();
|
||||
|
||||
ClearMessages();
|
||||
|
||||
modules_callPluginsUnloaded();
|
||||
|
||||
detachModules();
|
||||
|
||||
g_log.CloseFile();
|
||||
|
||||
Module_UncacheFunctions();
|
||||
|
||||
ClearLibraries(LibSource_Plugin);
|
||||
ClearLibraries(LibSource_Module);
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
@ -1532,18 +1436,6 @@ C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *inte
|
||||
meta_engfuncs.pfnPrecacheSound = C_PrecacheSound;
|
||||
meta_engfuncs.pfnChangeLevel = C_ChangeLevel;
|
||||
|
||||
/* message stuff from messages.h/cpp */
|
||||
meta_engfuncs.pfnMessageBegin = C_MessageBegin;
|
||||
meta_engfuncs.pfnMessageEnd = C_MessageEnd;
|
||||
meta_engfuncs.pfnWriteAngle = C_WriteAngle;
|
||||
meta_engfuncs.pfnWriteByte = C_WriteByte;
|
||||
meta_engfuncs.pfnWriteChar = C_WriteChar;
|
||||
meta_engfuncs.pfnWriteCoord = C_WriteCoord;
|
||||
meta_engfuncs.pfnWriteEntity = C_WriteEntity;
|
||||
meta_engfuncs.pfnWriteLong = C_WriteLong;
|
||||
meta_engfuncs.pfnWriteShort = C_WriteShort;
|
||||
meta_engfuncs.pfnWriteString = C_WriteString;
|
||||
|
||||
memcpy(pengfuncsFromEngine, &meta_engfuncs, sizeof(enginefuncs_t));
|
||||
|
||||
return 1;
|
||||
|
@ -46,8 +46,6 @@
|
||||
#include "debugger.h"
|
||||
#include "optimizer.h"
|
||||
#include "binlog.h"
|
||||
#include "libraries.h"
|
||||
#include "messages.h"
|
||||
|
||||
CList<CModule, const char*> g_modules;
|
||||
CList<CScript, AMX*> g_loadedscripts;
|
||||
@ -163,63 +161,56 @@ static binlogfuncs_t logfuncs =
|
||||
int load_amxscript(AMX *amx, void **program, const char *filename, char error[64], int debug)
|
||||
{
|
||||
*error = 0;
|
||||
size_t bufSize;
|
||||
*program = (void *)g_plugins.ReadIntoOrFromCache(filename, bufSize);
|
||||
if (!*program)
|
||||
{
|
||||
CAmxxReader reader(filename, PAWN_CELL_SIZE / 8);
|
||||
|
||||
if (reader.GetStatus() == CAmxxReader::Err_None)
|
||||
{
|
||||
bufSize = reader.GetBufferSize();
|
||||
|
||||
if (bufSize != 0)
|
||||
{
|
||||
*program = (void*) (new char[bufSize]);
|
||||
|
||||
if (!*program)
|
||||
{
|
||||
strcpy(error, "Failed to allocate memory");
|
||||
return (amx->error = AMX_ERR_MEMORY);
|
||||
}
|
||||
|
||||
reader.GetSection(*program);
|
||||
}
|
||||
}
|
||||
CAmxxReader reader(filename, PAWN_CELL_SIZE / 8);
|
||||
|
||||
switch (reader.GetStatus())
|
||||
if (reader.GetStatus() == CAmxxReader::Err_None)
|
||||
{
|
||||
size_t bufSize = reader.GetBufferSize();
|
||||
|
||||
if (bufSize != 0)
|
||||
{
|
||||
case CAmxxReader::Err_None:
|
||||
break;
|
||||
case CAmxxReader::Err_FileOpen:
|
||||
strcpy(error, "Plugin file open error");
|
||||
return (amx->error = AMX_ERR_NOTFOUND);
|
||||
case CAmxxReader::Err_FileRead:
|
||||
strcpy(error, "Plugin file read error");
|
||||
return (amx->error = AMX_ERR_NOTFOUND);
|
||||
case CAmxxReader::Err_InvalidParam:
|
||||
strcpy(error, "Internal error: Invalid parameter");
|
||||
return (amx->error = AMX_ERR_NOTFOUND);
|
||||
case CAmxxReader::Err_FileInvalid:
|
||||
strcpy(error, "Invalid Plugin");
|
||||
return (amx->error = AMX_ERR_FORMAT);
|
||||
case CAmxxReader::Err_SectionNotFound:
|
||||
strcpy(error, "Searched section not found (.amxx)");
|
||||
return (amx->error = AMX_ERR_NOTFOUND);
|
||||
case CAmxxReader::Err_DecompressorInit:
|
||||
strcpy(error, "Decompressor initialization failed");
|
||||
return (amx->error = AMX_ERR_INIT);
|
||||
case CAmxxReader::Err_Decompress:
|
||||
strcpy(error, "Internal error: Decompress");
|
||||
return (amx->error = AMX_ERR_NOTFOUND);
|
||||
case CAmxxReader::Err_OldFile:
|
||||
strcpy(error, "Plugin uses deprecated format. Update compiler");
|
||||
default:
|
||||
strcpy(error, "Unknown error");
|
||||
return (amx->error = AMX_ERR_NOTFOUND);
|
||||
*program = (void*) (new char[bufSize]);
|
||||
|
||||
if (!*program)
|
||||
{
|
||||
strcpy(error, "Failed to allocate memory");
|
||||
return (amx->error = AMX_ERR_MEMORY);
|
||||
}
|
||||
|
||||
reader.GetSection(*program);
|
||||
}
|
||||
} else {
|
||||
g_plugins.InvalidateFileInCache(filename, false);
|
||||
}
|
||||
|
||||
switch (reader.GetStatus())
|
||||
{
|
||||
case CAmxxReader::Err_None:
|
||||
break;
|
||||
case CAmxxReader::Err_FileOpen:
|
||||
strcpy(error, "Plugin file open error");
|
||||
return (amx->error = AMX_ERR_NOTFOUND);
|
||||
case CAmxxReader::Err_FileRead:
|
||||
strcpy(error, "Plugin file read error");
|
||||
return (amx->error = AMX_ERR_NOTFOUND);
|
||||
case CAmxxReader::Err_InvalidParam:
|
||||
strcpy(error, "Internal error: Invalid parameter");
|
||||
return (amx->error = AMX_ERR_NOTFOUND);
|
||||
case CAmxxReader::Err_FileInvalid:
|
||||
strcpy(error, "Invalid Plugin");
|
||||
return (amx->error = AMX_ERR_FORMAT);
|
||||
case CAmxxReader::Err_SectionNotFound:
|
||||
strcpy(error, "Searched section not found (.amxx)");
|
||||
return (amx->error = AMX_ERR_NOTFOUND);
|
||||
case CAmxxReader::Err_DecompressorInit:
|
||||
strcpy(error, "Decompressor initialization failed");
|
||||
return (amx->error = AMX_ERR_INIT);
|
||||
case CAmxxReader::Err_Decompress:
|
||||
strcpy(error, "Internal error: Decompress");
|
||||
return (amx->error = AMX_ERR_NOTFOUND);
|
||||
case CAmxxReader::Err_OldFile:
|
||||
strcpy(error, "Plugin uses deprecated format. Update compiler");
|
||||
default:
|
||||
strcpy(error, "Unknown error");
|
||||
return (amx->error = AMX_ERR_NOTFOUND);
|
||||
}
|
||||
|
||||
// check for magic
|
||||
@ -345,12 +336,12 @@ int load_amxscript(AMX *amx, void **program, const char *filename, char error[64
|
||||
if (amx->base)
|
||||
memcpy(amx->base, np, amx->code_size);
|
||||
|
||||
delete [] np;
|
||||
delete [] rt;
|
||||
delete[] np;
|
||||
delete[] rt;
|
||||
|
||||
char *prg = (char *)(*program);
|
||||
|
||||
delete [] prg;
|
||||
delete[] prg;
|
||||
(*program) = amx->base;
|
||||
|
||||
if (*program == 0)
|
||||
@ -371,6 +362,12 @@ int load_amxscript(AMX *amx, void **program, const char *filename, char error[64
|
||||
|
||||
CScript* aa = new CScript(amx, *program, filename);
|
||||
|
||||
if (aa == 0)
|
||||
{
|
||||
strcpy(error, "Failed to allocate memory");
|
||||
return (amx->error = AMX_ERR_MEMORY);
|
||||
}
|
||||
|
||||
g_loadedscripts.put(aa);
|
||||
|
||||
set_amxnatives(amx, error);
|
||||
@ -430,102 +427,69 @@ const char *StrCaseStr(const char *as, const char *bs)
|
||||
int CheckModules(AMX *amx, char error[128])
|
||||
{
|
||||
int numLibraries = amx_GetLibraries(amx);
|
||||
char buffer[64];
|
||||
LibType expect;
|
||||
bool found;
|
||||
char buffer[32];
|
||||
|
||||
bool found = false;
|
||||
bool isdbi = false;
|
||||
|
||||
CList<CModule, const char *>::iterator a;
|
||||
|
||||
const amxx_module_info_s *info;
|
||||
|
||||
Handler *pHandler = (Handler *)amx->userdata[UD_HANDLER];
|
||||
|
||||
/** decode old style plugins */
|
||||
for (int i = 0; i < numLibraries; i++)
|
||||
{
|
||||
amx_GetLibrary(amx, i, buffer, sizeof(buffer) - 1);
|
||||
found = false;
|
||||
|
||||
if (stricmp(buffer, "float") == 0)
|
||||
continue;
|
||||
|
||||
|
||||
isdbi = false;
|
||||
|
||||
if (stricmp(buffer, "dbi") == 0)
|
||||
isdbi = true;
|
||||
|
||||
for (a = g_modules.begin(); a; ++a)
|
||||
{
|
||||
expect = LibType_Class;
|
||||
} else {
|
||||
expect = LibType_Library;
|
||||
}
|
||||
|
||||
found = FindLibrary(buffer, expect);
|
||||
|
||||
/* for binary compat */
|
||||
if (!found)
|
||||
{
|
||||
CList<CModule, const char *>::iterator a = g_modules.begin();
|
||||
while (a)
|
||||
if ((*a).getStatusValue() == MODULE_LOADED)
|
||||
{
|
||||
CModule &cm = (*a);
|
||||
if (cm.getStatusValue() != MODULE_LOADED)
|
||||
info = (*a).getInfoNew();
|
||||
|
||||
if (info)
|
||||
{
|
||||
++a;
|
||||
continue;
|
||||
}
|
||||
if (cm.getInfoNew() &&
|
||||
cm.getInfoNew()->logtag &&
|
||||
!strcasecmp(cm.getInfoNew()->logtag, buffer))
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
++a;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
if (expect == LibType_Library)
|
||||
{
|
||||
if (!LoadModule(buffer, PT_ANYTIME, true, true))
|
||||
{
|
||||
if (pHandler->HandleModule(buffer, (expect == LibType_Class)))
|
||||
found = true;
|
||||
} else {
|
||||
found = true;
|
||||
if (isdbi)
|
||||
{
|
||||
if (info->logtag && (StrCaseStr(info->logtag, "sql") || StrCaseStr(info->logtag, "dbi")))
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (info->logtag && (stricmp(info->logtag, buffer) == 0))
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
found = LibraryExists(buffer);
|
||||
|
||||
if (!found)
|
||||
{
|
||||
const char *type = "Module/Library";
|
||||
if (expect == LibType_Class)
|
||||
type = "Module/Library Class";
|
||||
sprintf(error, "%s \"%s\" required for plugin. Check modules.ini.", type, buffer);
|
||||
return 0;
|
||||
if (pHandler->HandleModule(buffer))
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
/** decode new style plugins */
|
||||
amx_NumTags(amx, &numLibraries);
|
||||
cell notused;
|
||||
LibDecoder dec;
|
||||
LibError err;
|
||||
for (int i=0; i<numLibraries; i++)
|
||||
{
|
||||
amx_GetTag(amx, i, buffer, ¬used);
|
||||
if (buffer[0] != '?')
|
||||
continue;
|
||||
if (DecodeLibCmdString(buffer, &dec))
|
||||
|
||||
if (!found)
|
||||
{
|
||||
if (dec.cmd == LibCmd_ReqClass || dec.cmd == LibCmd_ReqLib)
|
||||
{
|
||||
if ( (err=RunLibCommand(&dec)) != LibErr_None )
|
||||
{
|
||||
if (!pHandler->HandleModule(dec.param1, (err == LibErr_NoClass)))
|
||||
{
|
||||
const char *type = "Module/Library";
|
||||
if (err == LibErr_NoClass)
|
||||
type = "Module/Library Class";
|
||||
sprintf(error, "%s \"%s\" required for plugin. Check modules.ini.", type, dec.param1);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
sprintf(error, "Module \"%s\" required for plugin. Check modules.ini.", buffer);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -534,14 +498,10 @@ int CheckModules(AMX *amx, char error[128])
|
||||
|
||||
int set_amxnatives(AMX* amx, char error[128])
|
||||
{
|
||||
CModule *cm;
|
||||
for (CList<CModule, const char *>::iterator a = g_modules.begin(); a ; ++a)
|
||||
{
|
||||
cm = &(*a);
|
||||
for (size_t i=0; i<cm->m_Natives.size(); i++)
|
||||
{
|
||||
amx_Register(amx, cm->m_Natives[i], -1);
|
||||
}
|
||||
for (CList<AMX_NATIVE_INFO*>::iterator cc = (*a).m_Natives.begin(); cc; ++cc)
|
||||
amx_Register(amx, *cc, -1);
|
||||
}
|
||||
|
||||
amx_Register(amx, string_Natives, -1);
|
||||
@ -554,8 +514,6 @@ int set_amxnatives(AMX* amx, char error[128])
|
||||
amx_Register(amx, g_NewMenuNatives, -1);
|
||||
amx_Register(amx, g_NativeNatives, -1);
|
||||
amx_Register(amx, g_DebugNatives, -1);
|
||||
amx_Register(amx, msg_Natives, -1);
|
||||
amx_Register(amx, vector_Natives, -1);
|
||||
|
||||
//we're not actually gonna check these here anymore
|
||||
amx->flags |= AMX_FLAG_PRENIT;
|
||||
@ -777,220 +735,130 @@ char* build_pathname_addons(char *fmt, ...)
|
||||
return string;
|
||||
}
|
||||
|
||||
#if defined WIN32
|
||||
#define SEPCHAR '\\'
|
||||
#elif defined __linux__
|
||||
#define SEPCHAR '/'
|
||||
#endif
|
||||
|
||||
bool ConvertModuleName(const char *pathString, String &path)
|
||||
bool validFile(const char* file)
|
||||
{
|
||||
String local;
|
||||
|
||||
local.assign(pathString);
|
||||
char *tmpname = const_cast<char *>(local.c_str());
|
||||
char *orig_path = tmpname;
|
||||
|
||||
path.clear();
|
||||
|
||||
size_t len = local.size();
|
||||
if (!len)
|
||||
return false;
|
||||
|
||||
/* run to filename instead of dir */
|
||||
char *ptr = tmpname;
|
||||
ptr = tmpname + len - 1;
|
||||
while (ptr >= tmpname && *ptr != SEPCHAR)
|
||||
ptr--;
|
||||
if (ptr >= tmpname)
|
||||
{
|
||||
*ptr++ = '\0';
|
||||
tmpname = ptr;
|
||||
}
|
||||
|
||||
bool foundAmxx = false;
|
||||
int iDigit = '3';
|
||||
ptr = tmpname;
|
||||
while (*ptr)
|
||||
{
|
||||
while (*ptr && *ptr != '_')
|
||||
ptr++;
|
||||
if (strncmp(ptr, "_amxx", 5) == 0)
|
||||
{
|
||||
char *p = ptr + 5;
|
||||
if (strncmp(p, ".dll", 4) == 0)
|
||||
{
|
||||
foundAmxx = true;
|
||||
break;
|
||||
} else if (p[0] == '_') {
|
||||
p++;
|
||||
if (strncmp(p, "amd64.so", 8) == 0)
|
||||
{
|
||||
foundAmxx = true;
|
||||
break;
|
||||
} else if (p[0] == 'i') {
|
||||
p++;
|
||||
if (isdigit(p[0]) && p[1] == '8' && p[2] == '6')
|
||||
{
|
||||
iDigit = p[0];
|
||||
foundAmxx = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (p[0] == '\0') {
|
||||
foundAmxx = true;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
while (*ptr && *ptr == '_')
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundAmxx)
|
||||
{
|
||||
ptr = tmpname + strlen(tmpname) - 1;
|
||||
while (ptr >= tmpname && *ptr != '.')
|
||||
ptr--;
|
||||
if (ptr > tmpname && *ptr == '.')
|
||||
{
|
||||
*ptr = '\0';
|
||||
}
|
||||
} else {
|
||||
*ptr = '\0';
|
||||
}
|
||||
|
||||
path.assign(orig_path);
|
||||
path.append(SEPCHAR);
|
||||
path.append(tmpname);
|
||||
path.append("_amxx");
|
||||
#if defined __linux__
|
||||
#if defined AMD64 || PAWN_CELL_SIZE==64
|
||||
path.append("_amd64");
|
||||
#else
|
||||
path.append("_i");
|
||||
path.append(iDigit);
|
||||
path.append("86");
|
||||
#endif
|
||||
const char* a = 0;
|
||||
|
||||
while (*file)
|
||||
if (*file++ == '.')
|
||||
a = file;
|
||||
#ifndef __linux__
|
||||
return (a && !strcmp(a, "dll"));
|
||||
#else
|
||||
return (a && !strcmp(a, "so"));
|
||||
#endif
|
||||
#if defined WIN32
|
||||
path.append(".dll");
|
||||
#elif defined __linux__
|
||||
path.append(".so");
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LoadModule(const char *shortname, PLUG_LOADTIME now, bool simplify, bool noFileBail)
|
||||
void ConvertModuleName(const char *pathString, String &path)
|
||||
{
|
||||
char pathString[512];
|
||||
String path;
|
||||
|
||||
build_pathname_r(
|
||||
pathString,
|
||||
sizeof(pathString)-1,
|
||||
"%s/%s",
|
||||
get_localinfo("amxx_modulesdir", "addons/amxmodx/modules"),
|
||||
shortname);
|
||||
|
||||
if (simplify)
|
||||
#if PAWN_CELL_SIZE==64
|
||||
char *ptr = strstr(pathString, "i386");
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
if (!ConvertModuleName(pathString, path))
|
||||
return false;
|
||||
} else {
|
||||
//attempt to fix the binary name
|
||||
*ptr = 0;
|
||||
path.assign(pathString);
|
||||
}
|
||||
|
||||
if (noFileBail)
|
||||
{
|
||||
FILE *fp = fopen(path.c_str(), "rb");
|
||||
if (!fp)
|
||||
return false;
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
CList<CModule, const char *>::iterator a = g_modules.find(path.c_str());
|
||||
|
||||
if (a)
|
||||
return false;
|
||||
|
||||
CModule* cc = new CModule(path.c_str());
|
||||
|
||||
cc->queryModule();
|
||||
|
||||
bool error = true;
|
||||
|
||||
switch (cc->getStatusValue())
|
||||
{
|
||||
case MODULE_BADLOAD:
|
||||
report_error(1, "[AMXX] Module is not a valid library (file \"%s\")", path.c_str());
|
||||
break;
|
||||
case MODULE_NOINFO:
|
||||
report_error(1, "[AMXX] Couldn't find info about module (file \"%s\")", path.c_str());
|
||||
break;
|
||||
case MODULE_NOQUERY:
|
||||
report_error(1, "[AMXX] Couldn't find \"AMX_Query\" or \"AMXX_Query\" (file \"%s\")", path.c_str());
|
||||
break;
|
||||
case MODULE_NOATTACH:
|
||||
report_error(1, "[AMXX] Couldn't find \"%s\" (file \"%s\")", cc->isAmxx() ? "AMXX_Attach" : "AMX_Attach", path.c_str());
|
||||
break;
|
||||
case MODULE_OLD:
|
||||
report_error(1, "[AMXX] Module has a different interface version (file \"%s\")", path.c_str());
|
||||
break;
|
||||
case MODULE_NEWER:
|
||||
report_error(1, "[AMXX] Module has a newer interface version (file \"%s\"). Please download a new amxmodx.", path.c_str());
|
||||
break;
|
||||
case MODULE_INTERROR:
|
||||
report_error(1, "[AMXX] Internal error during module load (file \"%s\")", path.c_str());
|
||||
break;
|
||||
case MODULE_NOT64BIT:
|
||||
report_error(1, "[AMXX] Module \"%s\" is not 64 bit compatible.", path.c_str());
|
||||
break;
|
||||
default:
|
||||
error = false;
|
||||
break;
|
||||
}
|
||||
|
||||
g_modules.put(cc);
|
||||
|
||||
if (error)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cc->IsMetamod())
|
||||
{
|
||||
char *mmpathname = build_pathname_addons(
|
||||
"%s/%s",
|
||||
get_localinfo("amxx_modulesdir", "addons/amxmodx/modules"),
|
||||
shortname);
|
||||
ConvertModuleName(mmpathname, path);
|
||||
cc->attachMetamod(path.c_str(), now);
|
||||
}
|
||||
|
||||
bool retVal = cc->attachModule();
|
||||
|
||||
if (cc->isAmxx() && !retVal)
|
||||
{
|
||||
switch (cc->getStatusValue())
|
||||
path.append("amd64.so");
|
||||
} else {
|
||||
ptr = strstr(pathString, ".dll");
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
case MODULE_FUNCNOTPRESENT:
|
||||
report_error(1, "[AMXX] Module requested a not exisitng function (file \"%s\")%s%s%s", cc->getFilename(), cc->getMissingFunc() ? " (func \"" : "",
|
||||
cc->getMissingFunc() ? cc->getMissingFunc() : "", cc->getMissingFunc() ? "\")" : "");
|
||||
break;
|
||||
case MODULE_INTERROR:
|
||||
report_error(1, "[AMXX] Internal error during module load (file \"%s\")", cc->getFilename());
|
||||
break;
|
||||
case MODULE_BADLOAD:
|
||||
report_error(1, "[AMXX] Module is not a valid library (file \"%s\")", cc->getFilename());
|
||||
break;
|
||||
*ptr = 0;
|
||||
path.assign(pathString);
|
||||
path.append("_amd64.so");
|
||||
} else {
|
||||
ptr = strstr(pathString, ".so");
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
path.assign(pathString);
|
||||
} else {
|
||||
//no extension at all
|
||||
path.assign(pathString);
|
||||
path.append("_amd64.so");
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
|
||||
return true;
|
||||
#ifdef __linux__
|
||||
char *ptr = strstr(pathString, "amd64");
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
//attempt to fix the binary name
|
||||
*ptr = 0;
|
||||
path.assign(pathString);
|
||||
path.append("i386.so");
|
||||
} else {
|
||||
ptr = strstr(pathString, ".dll");
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
*ptr = 0;
|
||||
path.assign(pathString);
|
||||
path.append("_i386.so");
|
||||
} else {
|
||||
//check to see if this file even has an extension
|
||||
ptr = strstr(pathString, ".so");
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
path.assign(pathString);
|
||||
} else {
|
||||
path.assign(pathString);
|
||||
path.append("_i386.so");
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
char *ptr = strstr(pathString, ".dll");
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
path.assign(pathString);
|
||||
} else {
|
||||
//prevent this from loading .so too
|
||||
ptr = strstr(pathString, ".so");
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
int i = 0, len = strlen(pathString), c = -1;
|
||||
|
||||
for (i = len - 1; i >= 0; i--)
|
||||
{
|
||||
//cut off at first _
|
||||
if (pathString[i] == '_')
|
||||
{
|
||||
//make sure this is a valid _
|
||||
if (i == len - 1 || strncmp(&(pathString[i + 1]), "amxx", 4) == 0)
|
||||
break;
|
||||
|
||||
c = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
*ptr = 0;
|
||||
|
||||
if (c == -1)
|
||||
{
|
||||
path.assign(pathString);
|
||||
path.append(".dll");
|
||||
} else {
|
||||
ptr = (char *)&(pathString[c]);
|
||||
*ptr = 0;
|
||||
path.assign(pathString);
|
||||
path.append(".dll");
|
||||
}
|
||||
} else {
|
||||
path.assign(pathString);
|
||||
path.append(".dll");
|
||||
}
|
||||
}
|
||||
#endif //__linux__
|
||||
#endif //PAWN_CELL_SIZE==64
|
||||
}
|
||||
|
||||
int loadModules(const char* filename, PLUG_LOADTIME now)
|
||||
@ -1003,39 +871,112 @@ int loadModules(const char* filename, PLUG_LOADTIME now)
|
||||
return 0;
|
||||
}
|
||||
|
||||
String line;
|
||||
char moduleName[256];
|
||||
char buffer[255];
|
||||
char pathString[512];
|
||||
String line;
|
||||
int loaded = 0;
|
||||
|
||||
String path;
|
||||
|
||||
while (!feof(fp))
|
||||
{
|
||||
buffer[0] = '\0';
|
||||
fgets(buffer, sizeof(buffer)-1, fp);
|
||||
|
||||
if (buffer[0] == ';' || buffer[0] == '\n')
|
||||
if (!line._fread(fp) || line.size() < 1)
|
||||
continue;
|
||||
|
||||
bool simplify = true;
|
||||
if (buffer[0] == '>')
|
||||
{
|
||||
simplify = false;
|
||||
line.assign(&buffer[1]);
|
||||
} else {
|
||||
line.assign(buffer);
|
||||
}
|
||||
|
||||
line.trim();
|
||||
|
||||
*moduleName = 0;
|
||||
|
||||
if (sscanf(line.c_str(), "%s", moduleName) == EOF)
|
||||
continue;
|
||||
|
||||
if (LoadModule(moduleName, now, simplify))
|
||||
loaded++;
|
||||
if (moduleName[0] == ';')
|
||||
continue;
|
||||
|
||||
char* pathname = build_pathname("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxmodx/modules"), moduleName);
|
||||
strcpy(pathString, pathname);
|
||||
|
||||
path.assign("");
|
||||
|
||||
ConvertModuleName(pathString, path);
|
||||
|
||||
if (!validFile(path.c_str()))
|
||||
continue;
|
||||
|
||||
CList<CModule, const char *>::iterator a = g_modules.find(path.c_str());
|
||||
|
||||
if (a)
|
||||
continue; // already loaded
|
||||
|
||||
CModule* cc = new CModule(path.c_str());
|
||||
|
||||
if (cc == 0)
|
||||
{
|
||||
fclose(fp);
|
||||
return loaded;
|
||||
}
|
||||
|
||||
cc->queryModule();
|
||||
|
||||
switch (cc->getStatusValue())
|
||||
{
|
||||
case MODULE_BADLOAD:
|
||||
report_error(1, "[AMXX] Module is not a valid library (file \"%s\")", path.c_str());
|
||||
break;
|
||||
case MODULE_NOINFO:
|
||||
report_error(1, "[AMXX] Couldn't find info. about module (file \"%s\")", path.c_str());
|
||||
break;
|
||||
case MODULE_NOQUERY:
|
||||
report_error(1, "[AMXX] Couldn't find \"AMX_Query\" or \"AMXX_Query\" (file \"%s\")", path.c_str());
|
||||
break;
|
||||
case MODULE_NOATTACH:
|
||||
report_error(1, "[AMXX] Couldn't find \"%s\" (file \"%s\")", cc->isAmxx() ? "AMXX_Attach" : "AMX_Attach", path.c_str());
|
||||
break;
|
||||
case MODULE_OLD:
|
||||
report_error(1, "[AMXX] Module has a different interface version (file \"%s\")", path.c_str());
|
||||
break;
|
||||
case MODULE_NEWER:
|
||||
report_error(1, "[AMXX] Module has a newer interface version (file \"%s\"). Please download a new amxmodx.", path.c_str());
|
||||
break;
|
||||
case MODULE_INTERROR:
|
||||
report_error(1, "[AMXX] Internal error during module load (file \"%s\")", path.c_str());
|
||||
break;
|
||||
case MODULE_NOT64BIT:
|
||||
report_error(1, "[AMXX] Module \"%s\" is not 64 bit compatible.", path.c_str());
|
||||
break;
|
||||
default:
|
||||
++loaded;
|
||||
}
|
||||
|
||||
g_modules.put(cc);
|
||||
|
||||
if (cc->IsMetamod())
|
||||
{
|
||||
char* mmpathname = build_pathname_addons("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxmodx/modules"), line.c_str());
|
||||
|
||||
ConvertModuleName(mmpathname, path);
|
||||
cc->attachMetamod(path.c_str(), now);
|
||||
}
|
||||
|
||||
bool retVal = cc->attachModule();
|
||||
|
||||
if (cc->isAmxx() && !retVal)
|
||||
{
|
||||
switch (cc->getStatusValue())
|
||||
{
|
||||
case MODULE_FUNCNOTPRESENT:
|
||||
report_error(1, "[AMXX] Module requested a not exisitng function (file \"%s\")%s%s%s", cc->getFilename(), cc->getMissingFunc() ? " (func \"" : "",
|
||||
cc->getMissingFunc() ? cc->getMissingFunc() : "", cc->getMissingFunc() ? "\")" : "");
|
||||
break;
|
||||
case MODULE_INTERROR:
|
||||
report_error(1, "[AMXX] Internal error during module load (file \"%s\")", cc->getFilename());
|
||||
break;
|
||||
case MODULE_BADLOAD:
|
||||
report_error(1, "[AMXX] Module is not a valid library (file \"%s\")", cc->getFilename());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
@ -1139,29 +1080,6 @@ void modules_callPluginsLoaded()
|
||||
}
|
||||
}
|
||||
|
||||
//same for unloaded
|
||||
void modules_callPluginsUnloaded()
|
||||
{
|
||||
CList<CModule, const char *>::iterator iter = g_modules.begin();
|
||||
|
||||
while (iter)
|
||||
{
|
||||
(*iter).CallPluginsUnloaded();
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
|
||||
void modules_callPluginsUnloading()
|
||||
{
|
||||
CList<CModule, const char *>::iterator iter = g_modules.begin();
|
||||
|
||||
while (iter)
|
||||
{
|
||||
(*iter).CallPluginsUnloading();
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
|
||||
// new functions
|
||||
int MNF_AddNatives(AMX_NATIVE_INFO* natives)
|
||||
{
|
||||
@ -1170,7 +1088,12 @@ int MNF_AddNatives(AMX_NATIVE_INFO* natives)
|
||||
if (!g_CurrentlyCalledModule || g_ModuleCallReason != ModuleCall_Attach)
|
||||
return FALSE; // may only be called from attach
|
||||
|
||||
g_CurrentlyCalledModule->m_Natives.push_back(natives);
|
||||
// This is needed so that CList can free it ;]
|
||||
AMX_NATIVE_INFO** pPtr = new AMX_NATIVE_INFO*(natives);
|
||||
if (!pPtr)
|
||||
return FALSE;
|
||||
|
||||
g_CurrentlyCalledModule->m_Natives.put(pPtr);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -1336,24 +1259,6 @@ const char * MNF_GetPlayerName(int id)
|
||||
return GET_PLAYER_POINTER_I(id)->name.c_str();
|
||||
}
|
||||
|
||||
void MNF_OverrideNatives(AMX_NATIVE_INFO *natives, const char *name)
|
||||
{
|
||||
//HACKHACK - we should never have had to do this
|
||||
//find a better solution for SourceMod!!!
|
||||
for (CList<CModule, const char *>::iterator a = g_modules.begin(); a ; ++a)
|
||||
{
|
||||
CModule &cm = (*a);
|
||||
if (cm.getStatusValue() != MODULE_LOADED)
|
||||
continue;
|
||||
const amxx_module_info_s *p = cm.getInfoNew();
|
||||
if (!p || !p->name)
|
||||
continue;
|
||||
if (strcmp(p->name, name)==0)
|
||||
continue;
|
||||
cm.rewriteNativeLists(natives);
|
||||
}
|
||||
}
|
||||
|
||||
const char * MNF_GetPlayerIP(int id)
|
||||
{
|
||||
if (id < 1 || id > gpGlobals->maxClients)
|
||||
@ -1569,10 +1474,10 @@ extern "C" void LogError(AMX *amx, int err, const char *fmt, ...)
|
||||
if (!pDebugger)
|
||||
{
|
||||
if (fmt)
|
||||
AMXXLOG_Error("%s", msg_buffer);
|
||||
AMXXLOG_Log("%s", msg_buffer);
|
||||
|
||||
Debugger::GenericMessage(amx, err);
|
||||
AMXXLOG_Error("[AMXX] To enable debug mode, add \"debug\" after the plugin name in plugins.ini (without quotes).");
|
||||
AMXXLOG_Log("[AMXX] To enable debug mode, add \"debug\" after the plugin name in plugins.ini (without quotes).");
|
||||
//destroy original error code so the original is not displayed again
|
||||
} else {
|
||||
pDebugger->SetTracedError(err);
|
||||
@ -1588,21 +1493,6 @@ void MNF_MergeDefinitionFile(const char *file)
|
||||
g_langMngr.MergeDefinitionFile(file);
|
||||
}
|
||||
|
||||
int MNF_FindLibrary(const char *name, LibType type)
|
||||
{
|
||||
return FindLibrary(name, type) ? 1 : 0;
|
||||
}
|
||||
|
||||
size_t MFN_AddLibraries(const char *name, LibType type, void *parent)
|
||||
{
|
||||
return AddLibrariesFromString(name, type, LibSource_Module, parent) ? 1 : 0;
|
||||
}
|
||||
|
||||
size_t MNF_RemoveLibraries(void *parent)
|
||||
{
|
||||
return RemoveLibraries(parent);
|
||||
}
|
||||
|
||||
edict_t* MNF_GetPlayerEdict(int id)
|
||||
{
|
||||
if (id < 1 || id > gpGlobals->maxClients)
|
||||
@ -1679,27 +1569,6 @@ void MNF_RegisterFunction(void *pfn, const char *description)
|
||||
REGISTER_FUNC(description, pfn);
|
||||
}
|
||||
|
||||
void *MNF_RegisterFunctionEx(void *pfn, const char *description)
|
||||
{
|
||||
func_s *pFunc;
|
||||
CList<func_s, const char *>::iterator iter;
|
||||
|
||||
for (iter = g_functions.begin(); iter; ++iter)
|
||||
{
|
||||
pFunc = &(*iter);
|
||||
if (strcmp(description, pFunc->desc) == 0)
|
||||
{
|
||||
void *pOld = pFunc->pfn;
|
||||
pFunc->pfn = pfn;
|
||||
return pOld;
|
||||
}
|
||||
}
|
||||
|
||||
MNF_RegisterFunction(pfn, description);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Module_UncacheFunctions()
|
||||
{
|
||||
g_functions.clear();
|
||||
@ -1722,11 +1591,6 @@ int MNF_SetPlayerTeamInfo(int player, int teamid, const char *teamname)
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char *MNF_GetLocalInfo(char *name, const char *def)
|
||||
{
|
||||
return get_localinfo(name, def);
|
||||
}
|
||||
|
||||
void *MNF_PlayerPropAddr(int id, int prop)
|
||||
{
|
||||
if (id < 1 || id > gpGlobals->maxClients)
|
||||
@ -1799,7 +1663,6 @@ void Module_CacheFunctions()
|
||||
REGISTER_FUNC("MergeDefinitionFile", MNF_MergeDefinitionFile)
|
||||
REGISTER_FUNC("Format", MNF_Format)
|
||||
REGISTER_FUNC("RegisterFunction", MNF_RegisterFunction);
|
||||
REGISTER_FUNC("RegisterFunctionEx", MNF_RegisterFunctionEx);
|
||||
|
||||
// Amx scripts loading / unloading / managing
|
||||
REGISTER_FUNC("GetAmxScript", MNF_GetAmxScript)
|
||||
@ -1816,7 +1679,6 @@ void Module_CacheFunctions()
|
||||
REGISTER_FUNC("FormatAmxString", MNF_FormatAmxString)
|
||||
REGISTER_FUNC("CopyAmxMemory", MNF_CopyAmxMemory)
|
||||
REGISTER_FUNC("GetAmxAddr", get_amxaddr)
|
||||
REGISTER_FUNC("AmxReregister", amx_Reregister);
|
||||
|
||||
// other amx stuff
|
||||
REGISTER_FUNC("amx_Exec", amx_Exec)
|
||||
@ -1870,12 +1732,6 @@ void Module_CacheFunctions()
|
||||
REGISTER_FUNC("RegAuthFunc", MNF_RegAuthorizeFunc);
|
||||
REGISTER_FUNC("UnregAuthFunc", MNF_UnregAuthorizeFunc);
|
||||
|
||||
REGISTER_FUNC("FindLibrary", MNF_FindLibrary);
|
||||
REGISTER_FUNC("AddLibraries", MFN_AddLibraries);
|
||||
REGISTER_FUNC("RemoveLibraries", MNF_RemoveLibraries);
|
||||
REGISTER_FUNC("OverrideNatives", MNF_OverrideNatives);
|
||||
REGISTER_FUNC("GetLocalInfo", MNF_GetLocalInfo);
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
REGISTER_FUNC("Allocator", m_allocator)
|
||||
REGISTER_FUNC("Deallocator", m_deallocator)
|
||||
@ -1892,6 +1748,11 @@ void *Module_ReqFnptr(const char *funcName)
|
||||
// code
|
||||
// ^---- really? wow!
|
||||
|
||||
if (!g_CurrentlyCalledModule)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
g_LastRequestedFunc = funcName;
|
||||
|
||||
CList<func_s, const char *>::iterator iter;
|
||||
|
@ -72,7 +72,6 @@ typedef enum
|
||||
} PlayerProp;
|
||||
|
||||
int CheckModules(AMX *amx, char error[128]);
|
||||
bool LoadModule(const char *shortname, PLUG_LOADTIME now, bool simplify=true, bool noFileBail=false);
|
||||
const char *StrCaseStr(const char *as, const char *bs);
|
||||
|
||||
class Debugger;
|
||||
@ -80,12 +79,7 @@ Debugger *DisableDebugHandler(AMX *amx);
|
||||
void EnableDebugHandler(AMX *amx, Debugger *pd);
|
||||
|
||||
bool DirExists(const char *dir);
|
||||
|
||||
const char* GetFileName(AMX *amx);
|
||||
|
||||
inline cell FloatToCell(float input)
|
||||
{
|
||||
REAL output = input;
|
||||
return *(cell *)&output;
|
||||
}
|
||||
|
||||
#endif // __MODULES_H__
|
||||
|
@ -5,20 +5,38 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "amxmodx", "amxmodx_mm.vcpro
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
JITDebug = JITDebug
|
||||
JITDebugBinLog = JITDebugBinLog
|
||||
JITMemtestRelease = JITMemtestRelease
|
||||
JITRelease = JITRelease
|
||||
JITReleaseBinLog = JITReleaseBinLog
|
||||
MaximalSpeed = MaximalSpeed
|
||||
MemtestDebug = MemtestDebug
|
||||
MemtestRelease = MemtestRelease
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.Debug.ActiveCfg = Debug|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.Debug.Build.0 = Debug|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITDebug.ActiveCfg = JITDebug|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITDebug.Build.0 = JITDebug|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITDebugBinLog.ActiveCfg = JITDebugBinLog|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITDebugBinLog.Build.0 = JITDebugBinLog|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITMemtestRelease.ActiveCfg = JITMemtestRelease|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITMemtestRelease.Build.0 = JITMemtestRelease|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITRelease.ActiveCfg = JITRelease|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITRelease.Build.0 = JITRelease|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITReleaseBinLog.ActiveCfg = JITReleaseBinLog|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITReleaseBinLog.Build.0 = JITReleaseBinLog|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MaximalSpeed.ActiveCfg = MaximalSpeed|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MaximalSpeed.Build.0 = MaximalSpeed|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MemtestDebug.ActiveCfg = MemtestDebug|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MemtestDebug.Build.0 = MemtestDebug|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MemtestRelease.ActiveCfg = MemtestRelease|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MemtestRelease.Build.0 = MemtestRelease|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.Release.ActiveCfg = Release|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
|
@ -4,7 +4,6 @@
|
||||
Version="7.10"
|
||||
Name="amxmodx"
|
||||
ProjectGUID="{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}"
|
||||
RootNamespace="amxmodx"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
@ -12,6 +11,287 @@
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""C:\Hry\Half-Life\SDK\Multiplayer Source\pm_shared";"C:\Hry\Half-Life\SDK\Multiplayer Source\dlls";"C:\Hry\Half-Life\SDK\Multiplayer Source\engine";"C:\Hry\Half-Life\SDK\Multiplayer Source\common";C:\Files\Programming\metamod\metamod"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
StructMemberAlignment="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="amxmodx.h"
|
||||
PrecompiledHeaderFile=".\debug/amxmodx.pch"
|
||||
AssemblerListingLocation=".\debug/"
|
||||
ObjectFile=".\debug/"
|
||||
ProgramDataBaseFileName=".\debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="..\JIT\natives-x86.obj ..\zlib\zlib.lib"
|
||||
OutputFile="debug/amxmodx_mm.dll"
|
||||
Version="0.1"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
IgnoreDefaultLibraryNames="MSVCRT"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\debug/amxx_mm.pdb"
|
||||
ImportLibrary=".\debug/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\debug/amxmodx.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="1"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="amxmodx.h"
|
||||
PrecompiledHeaderFile=".\release/amxmodx.pch"
|
||||
AssemblerListingLocation=".\release/"
|
||||
ObjectFile=".\release/"
|
||||
ProgramDataBaseFileName=".\release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib ..\JIT\natives-x86.obj"
|
||||
OutputFile="release/amxmodx_mm.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
IgnoreDefaultLibraryNames="LIBC"
|
||||
ModuleDefinitionFile=""
|
||||
ProgramDatabaseFile=".\release/amxx_mm.pdb"
|
||||
ImportLibrary=".\release/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\release/amxmodx.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="MemtestDebug|Win32"
|
||||
OutputDirectory="MemtestDebug"
|
||||
IntermediateDirectory="MemtestDebug"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""C:\Hry\Half-Life\SDK\Multiplayer Source\pm_shared";"C:\Hry\Half-Life\SDK\Multiplayer Source\dlls";"C:\Hry\Half-Life\SDK\Multiplayer Source\engine";"C:\Hry\Half-Life\SDK\Multiplayer Source\common";C:\Files\Programming\metamod\metamod"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;MEMORY_TEST"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
StructMemberAlignment="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="amxmodx.h"
|
||||
PrecompiledHeaderFile=".\memtestdebug/amxmodx.pch"
|
||||
AssemblerListingLocation=".\memtestdebug/"
|
||||
ObjectFile=".\memtestdebug/"
|
||||
ProgramDataBaseFileName=".\memtestdebug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib ..\JIT\natives-x86.obj"
|
||||
OutputFile="memtestdebug/amxmodx_mm.dll"
|
||||
Version="1.6.5.0"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
IgnoreDefaultLibraryNames="MSVCRT"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\memtestdebug/amxx_mm.pdb"
|
||||
ImportLibrary=".\memtestdebug/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\debug/amxmodx.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="MemtestRelease|Win32"
|
||||
OutputDirectory="MemtestRelease"
|
||||
IntermediateDirectory="MemtestRelease"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="1"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;MEMORY_TEST"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="amxmodx.h"
|
||||
PrecompiledHeaderFile=".\memtestrelease/amxmodx.pch"
|
||||
AssemblerListingLocation=".\memtestrelease/"
|
||||
ObjectFile=".\memtestrelease/"
|
||||
ProgramDataBaseFileName=".\memtestrelease/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib ..\JIT\natives-x86.obj"
|
||||
OutputFile="memtestrelease/amxmodx_mm.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
IgnoreDefaultLibraryNames="MSVCRT"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\memtestrelease/amxx_mm.pdb"
|
||||
GenerateMapFile="TRUE"
|
||||
MapExports="TRUE"
|
||||
ImportLibrary=".\memtestrelease/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\release/amxmodx.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="JITDebug|Win32"
|
||||
OutputDirectory="JITDebug"
|
||||
@ -49,11 +329,11 @@
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
IgnoreDefaultLibraryNames="MSVCRT;LIBC"
|
||||
IgnoreDefaultLibraryNames="MSVCRT"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\jitdebug/amxmodx_mm.pdb"
|
||||
ImportLibrary=".\jitdebug/amxmodx_mm.lib"/>
|
||||
ProgramDatabaseFile=".\jitdebug/amxx_mm.pdb"
|
||||
ImportLibrary=".\jitdebug/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
@ -130,7 +410,148 @@
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\jitrelease/amxmodx_mm.pdb"
|
||||
GenerateMapFile="TRUE"
|
||||
ImportLibrary=".\jitrelease/amxmodx_mm.lib"/>
|
||||
ImportLibrary=".\jitrelease/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\release/amxmodx.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="JITMemtestRelease|Win32"
|
||||
OutputDirectory="JITMemtestRelease"
|
||||
IntermediateDirectory="JITMemtestRelease"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="1"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;MEMORY_TEST;JIT;ASM32;PAWN_CELL_SIZE=32"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="amxmodx.h"
|
||||
PrecompiledHeaderFile=".\jitmemtestrelease/amxmodx.pch"
|
||||
AssemblerListingLocation=".\jitmemtestrelease/"
|
||||
ObjectFile=".\jitmemtestrelease/"
|
||||
ProgramDataBaseFileName=".\jitmemtestrelease/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="..\zlib\zlib.lib ..\JIT\amxjitsn.obj ..\JIT\amxexecn.obj ..\JIT\natives-x86.obj"
|
||||
OutputFile="jitmemtestrelease/amxmodx_mm.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
IgnoreDefaultLibraryNames="MSVCRT"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\jitmemtestrelease/amxx_mm.pdb"
|
||||
ImportLibrary=".\jitmemtestrelease/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\release/amxmodx.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="MaximalSpeed|Win32"
|
||||
OutputDirectory="MaximalSpeed"
|
||||
IntermediateDirectory="MaximalSpeed"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="1"
|
||||
EnableIntrinsicFunctions="TRUE"
|
||||
FavorSizeOrSpeed="1"
|
||||
OptimizeForProcessor="2"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;JIT"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="amxmodx.h"
|
||||
PrecompiledHeaderFile=".\MaximalSpeed/amxmodx.pch"
|
||||
AssemblerListingLocation=".\MaximalSpeed/"
|
||||
ObjectFile=".\MaximalSpeed/"
|
||||
ProgramDataBaseFileName=".\MaximalSpeed/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib ..\zlib\zlib.lib"
|
||||
OutputFile="MaximalSpeed/amxmodx_mm.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
ModuleDefinitionFile=""
|
||||
ProgramDatabaseFile=".\MaximalSpeede/amxx_mm.pdb"
|
||||
ImportLibrary=".\jitrelease/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
@ -191,16 +612,16 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="..\zlib\zlib.lib ..\JIT\amxjitsn.obj ..\JIT\amxexecn.obj ..\JIT\natives-x86.obj"
|
||||
OutputFile="jitdebugbinlog/amxmodx_bl_mm.dll"
|
||||
OutputFile="jitdebugbinlog/amxmodx_mm.dll"
|
||||
Version="0.1"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
IgnoreDefaultLibraryNames="MSVCRT;LIBC"
|
||||
IgnoreDefaultLibraryNames="MSVCRT"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\jitdebugbinlog/amxmodx_bl_mm.pdb"
|
||||
ImportLibrary=".\jitdebugbinlog/amxmodx_bl_mm.lib"/>
|
||||
ProgramDatabaseFile=".\jitdebugbinlog/amxx_mm.pdb"
|
||||
ImportLibrary=".\jitdebugbinlog/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
@ -268,16 +689,16 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="..\zlib\zlib.lib ..\JIT\amxjitsn.obj ..\JIT\amxexecn.obj ..\JIT\natives-x86.obj"
|
||||
OutputFile="jitreleasebinlog/amxmodx_bl_mm.dll"
|
||||
OutputFile="jitreleasebinlog/amxmodx_mm.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
IgnoreDefaultLibraryNames="MSVCRT"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\jitreleasebinlog/amxmodx_bl_mm.pdb"
|
||||
ProgramDatabaseFile=".\jitreleasebinlog/amxmodx_mm.pdb"
|
||||
GenerateMapFile="TRUE"
|
||||
ImportLibrary=".\jitreleasebinlog/amxmodx_bl_mm.lib"/>
|
||||
ImportLibrary=".\jitreleasebinlog/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
@ -336,18 +757,6 @@
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\binlog.cpp">
|
||||
<FileConfiguration
|
||||
Name="JITDebug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="JITRelease|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CCmd.cpp">
|
||||
@ -381,6 +790,18 @@
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CTask.cpp">
|
||||
<FileConfiguration
|
||||
Name="JITRelease|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AssemblerOutput="0"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="JITReleaseBinLog|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AssemblerOutput="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CVault.cpp">
|
||||
@ -393,6 +814,12 @@
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\fakemeta.cpp">
|
||||
<FileConfiguration
|
||||
Name="MemtestDebug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
GeneratePreprocessedFile="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\file.cpp">
|
||||
@ -415,15 +842,9 @@
|
||||
AssemblerOutput="4"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\libraries.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\md5.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\messages.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\meta_api.cpp">
|
||||
</File>
|
||||
@ -469,9 +890,55 @@
|
||||
<File
|
||||
RelativePath="..\vault.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\vector.cpp">
|
||||
</File>
|
||||
<Filter
|
||||
Name="mmgr"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\mmgr\mmgr.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="JITDebug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="JITRelease|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MaximalSpeed|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="JITDebugBinLog|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="JITReleaseBinLog|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
@ -551,18 +1018,12 @@
|
||||
<File
|
||||
RelativePath="..\format.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\libraries.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\md5.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\menus.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\messages.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\modules.h">
|
||||
</File>
|
||||
@ -593,6 +1054,16 @@
|
||||
<File
|
||||
RelativePath="..\zlib\zlib.h">
|
||||
</File>
|
||||
<Filter
|
||||
Name="mmgr"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\mmgr\mmgr.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\mmgr\nommgr.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
@ -635,6 +1106,30 @@
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\sdk\amxxmodule.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MemtestDebug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MemtestRelease|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="JITDebug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
@ -647,6 +1142,18 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="JITMemtestRelease|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MaximalSpeed|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="JITDebugBinLog|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
|
@ -1,24 +1,35 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "amxmodx_mm", "amxmodx_mm.vcproj", "{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "amxmodx", "amxmodx_mm.vcproj", "{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
JITDebug|Win32 = JITDebug|Win32
|
||||
JITDebugBinLog|Win32 = JITDebugBinLog|Win32
|
||||
JITMemtestRelease|Win32 = JITMemtestRelease|Win32
|
||||
JITRelease|Win32 = JITRelease|Win32
|
||||
JITReleaseBinLog|Win32 = JITReleaseBinLog|Win32
|
||||
MaximalSpeed|Win32 = MaximalSpeed|Win32
|
||||
MemtestDebug|Win32 = MemtestDebug|Win32
|
||||
MemtestRelease|Win32 = MemtestRelease|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITDebug|Win32.ActiveCfg = JITDebug|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITDebug|Win32.Build.0 = JITDebug|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITDebugBinLog|Win32.ActiveCfg = JITDebugBinLog|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITDebugBinLog|Win32.Build.0 = JITDebugBinLog|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITMemtestRelease|Win32.ActiveCfg = JITMemtestRelease|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITMemtestRelease|Win32.Build.0 = JITMemtestRelease|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITRelease|Win32.ActiveCfg = JITRelease|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITRelease|Win32.Build.0 = JITRelease|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITReleaseBinLog|Win32.ActiveCfg = JITReleaseBinLog|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITReleaseBinLog|Win32.Build.0 = JITReleaseBinLog|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MaximalSpeed|Win32.ActiveCfg = MaximalSpeed|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MaximalSpeed|Win32.Build.0 = MaximalSpeed|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MemtestDebug|Win32.ActiveCfg = MemtestDebug|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MemtestDebug|Win32.Build.0 = MemtestDebug|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MemtestRelease|Win32.ActiveCfg = MemtestRelease|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MemtestRelease|Win32.Build.0 = MemtestRelease|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -32,7 +32,6 @@
|
||||
#include "sh_stack.h"
|
||||
#include "natives.h"
|
||||
#include "debugger.h"
|
||||
#include "libraries.h"
|
||||
|
||||
#ifdef __linux__
|
||||
#include <malloc.h>
|
||||
@ -48,6 +47,7 @@
|
||||
CStack<int> g_ErrorStk;
|
||||
CVector<regnative *> g_RegNatives;
|
||||
CStack<regnative *> g_NativeStack;
|
||||
CVector<String> g_Libraries;
|
||||
static char g_errorStr[512] = {0};
|
||||
bool g_Initialized = false;
|
||||
|
||||
@ -68,28 +68,11 @@ int amxx_DynaCallback(int idx, AMX *amx, cell *params)
|
||||
return 0;
|
||||
}
|
||||
|
||||
CPluginMngr::CPlugin *pPlugin = g_plugins.findPluginFast(amx);
|
||||
CPluginMngr::CPlugin *pNativePlugin = g_plugins.findPluginFast(pNative->amx);
|
||||
|
||||
if (!pNativePlugin->isExecutable(pNative->func))
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Called dynanative into a paused plugin.");
|
||||
pPlugin->setStatus(ps_paused);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (pNative->caller)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Bug caught! Please contact the AMX Mod X Dev Team.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//parameter stack
|
||||
//NOTE: it is possible that recursive register native calling
|
||||
// could potentially be somehow damaged here.
|
||||
//so, a :TODO: - make the stack unique, rather than a known ptr
|
||||
pNative->caller = amx;
|
||||
|
||||
CPluginMngr::CPlugin *pPlugin = g_plugins.findPluginFast(amx);
|
||||
|
||||
int err = 0;
|
||||
cell ret = 0;
|
||||
g_ErrorStk.push(0);
|
||||
@ -129,8 +112,6 @@ int amxx_DynaCallback(int idx, AMX *amx, cell *params)
|
||||
g_NativeStack.pop();
|
||||
g_ErrorStk.pop();
|
||||
|
||||
pNative->caller = NULL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -362,7 +343,7 @@ static cell AMX_NATIVE_CALL register_library(AMX *amx, cell *params)
|
||||
int len;
|
||||
char *lib = get_amxstring(amx, params[1], 0, len);
|
||||
|
||||
AddLibrary(lib, LibType_Library, LibSource_Plugin, g_plugins.findPluginFast(amx));
|
||||
AddPluginLibrary(lib);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -389,7 +370,6 @@ static cell AMX_NATIVE_CALL register_native(AMX *amx, cell *params)
|
||||
regnative *pNative = new regnative;
|
||||
pNative->amx = amx;
|
||||
pNative->func = idx;
|
||||
pNative->caller = NULL;
|
||||
|
||||
//we'll apply a safety buffer too
|
||||
//make our function
|
||||
@ -416,9 +396,27 @@ static cell AMX_NATIVE_CALL register_native(AMX *amx, cell *params)
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool LibraryExists(const char *name)
|
||||
{
|
||||
for (size_t i=0; i<g_Libraries.size(); i++)
|
||||
{
|
||||
if (stricmp(g_Libraries[i].c_str(), name)==0)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void AddPluginLibrary(const char *name)
|
||||
{
|
||||
String f(name);
|
||||
g_Libraries.push_back(f);
|
||||
}
|
||||
|
||||
void ClearPluginLibraries()
|
||||
{
|
||||
ClearLibraries(LibSource_Plugin);
|
||||
g_Libraries.clear();
|
||||
|
||||
for (size_t i=0; i<g_RegNatives.size(); i++)
|
||||
{
|
||||
delete [] g_RegNatives[i]->pfn;
|
||||
|
@ -61,7 +61,9 @@ extern "C" int amxx_DynaFunc(AMX *amx, cell *params);
|
||||
extern "C" int amxx_DynaCodesize();
|
||||
|
||||
AMX_NATIVE_INFO *BuildNativeTable();
|
||||
void AddPluginLibrary(const char *name);
|
||||
void ClearPluginLibraries();
|
||||
bool LibraryExists(const char *name);
|
||||
|
||||
//I couldn't resist :)
|
||||
extern AMX_NATIVE_INFO g_NativeNatives[];
|
||||
|
@ -151,7 +151,7 @@ int Menu::PagekeyToItem(page_t page, item_t key)
|
||||
|
||||
if (num_pages == 1 || !items_per_page)
|
||||
{
|
||||
if (key > m_Items.size())
|
||||
if (m_AlwaysExit && key > m_Items.size())
|
||||
return MENU_EXIT;
|
||||
else
|
||||
return key-1;
|
||||
|
@ -2430,9 +2430,7 @@ static amxx_module_info_s g_ModuleInfo =
|
||||
#else // MODULE_RELOAD_ON_MAPCHANGE
|
||||
0,
|
||||
#endif // MODULE_RELOAD_ON_MAPCHANGE
|
||||
MODULE_LOGTAG,
|
||||
MODULE_LIBRARY,
|
||||
MODULE_LIBCLASS
|
||||
MODULE_LOGTAG
|
||||
};
|
||||
|
||||
// Storage for the requested functions
|
||||
@ -2508,13 +2506,6 @@ PFN_SET_TEAM_INFO g_fn_SetTeamInfo;
|
||||
PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr;
|
||||
PFN_REG_AUTH_FUNC g_fn_RegAuthFunc;
|
||||
PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc;
|
||||
PFN_FINDLIBRARY g_fn_FindLibrary;
|
||||
PFN_ADDLIBRARIES g_fn_AddLibraries;
|
||||
PFN_REMOVELIBRARIES g_fn_RemoveLibraries;
|
||||
PFN_OVERRIDENATIVES g_fn_OverrideNatives;
|
||||
PFN_GETLOCALINFO g_fn_GetLocalInfo;
|
||||
PFN_AMX_REREGISTER g_fn_AmxReRegister;
|
||||
PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx;
|
||||
|
||||
// *** Exports ***
|
||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||
@ -2565,7 +2556,6 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||
REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION);
|
||||
REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX);
|
||||
|
||||
// Amx scripts
|
||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||
@ -2630,14 +2620,6 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
||||
REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC);
|
||||
REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC);
|
||||
|
||||
//Added in 1.75
|
||||
REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY);
|
||||
REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES);
|
||||
REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES);
|
||||
REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES);
|
||||
REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO);
|
||||
REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER);
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
// Memory
|
||||
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
||||
@ -2672,27 +2654,14 @@ C_DLLEXPORT int AMXX_PluginsLoaded()
|
||||
return AMXX_OK;
|
||||
}
|
||||
|
||||
C_DLLEXPORT void AMXX_PluginsUnloaded()
|
||||
{
|
||||
#ifdef FN_AMXX_PLUGINSUNLOADED
|
||||
FN_AMXX_PLUGINSUNLOADED();
|
||||
#endif // FN_AMXX_PLUGINSUNLOADED
|
||||
}
|
||||
|
||||
C_DLLEXPORT void AMXX_PluginsUnloading()
|
||||
{
|
||||
#ifdef FN_AMXX_PLUGINSUNLOADING
|
||||
FN_AMXX_PLUGINSUNLOADING();
|
||||
#endif // FN_AMXX_PLUGINSUNLOADING
|
||||
}
|
||||
|
||||
// Advanced MF functions
|
||||
void MF_Log(const char *fmt, ...)
|
||||
{
|
||||
// :TODO: Overflow possible here
|
||||
char msg[3072];
|
||||
va_list arglst;
|
||||
va_start(arglst, fmt);
|
||||
vsnprintf(msg, sizeof(msg) - 1, fmt, arglst);
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_Log("[%s] %s", MODULE_LOGTAG, msg);
|
||||
@ -2700,10 +2669,11 @@ void MF_Log(const char *fmt, ...)
|
||||
|
||||
void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||
{
|
||||
// :TODO: Overflow possible here
|
||||
char msg[3072];
|
||||
va_list arglst;
|
||||
va_start(arglst, fmt);
|
||||
vsnprintf(msg, sizeof(msg) - 1, fmt, arglst);
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg);
|
||||
@ -2771,15 +2741,10 @@ void ValidateMacros_DontCallThis_Smiley()
|
||||
MF_GetPlayerEdict(0);
|
||||
MF_Format("", 4, "str");
|
||||
MF_RegisterFunction(NULL, "");
|
||||
MF_RegisterFunctionEx(NULL, "");
|
||||
MF_SetPlayerTeamInfo(0, 0, "");
|
||||
MF_PlayerPropAddr(0, 0);
|
||||
MF_RegAuthFunc(NULL);
|
||||
MF_UnregAuthFunc(NULL);
|
||||
MF_FindLibrary(NULL, LibType_Class);
|
||||
MF_AddLibraries(NULL, LibType_Class, NULL);
|
||||
MF_RemoveLibraries(NULL);
|
||||
MF_OverrideNatives(NULL, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -34,8 +34,7 @@
|
||||
// module interface version was 1
|
||||
// 2 - added logtag to struct (amxx1.1-rc1)
|
||||
// 3 - added new tagAMX structure (amxx1.5)
|
||||
// 4 - added new 'library' setting for direct loading
|
||||
#define AMXX_INTERFACE_VERSION 4
|
||||
#define AMXX_INTERFACE_VERSION 3
|
||||
|
||||
// amxx module info
|
||||
struct amxx_module_info_s
|
||||
@ -45,8 +44,6 @@ struct amxx_module_info_s
|
||||
const char *version;
|
||||
int reload; // reload on mapchange when nonzero
|
||||
const char *logtag; // added in version 2
|
||||
const char *library; // added in version 4
|
||||
const char *libclass; // added in version 4
|
||||
};
|
||||
|
||||
// return values from functions called by amxx
|
||||
@ -156,137 +153,9 @@ typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx);
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER
|
||||
#pragma warning(disable:4103) /* disable warning message 4103 that complains
|
||||
* about pragma pack in a header file */
|
||||
#pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
#if !defined NO_MSVC8_AUTO_COMPAT
|
||||
|
||||
/* Disable deprecation warnings concerning unsafe CRT functions */
|
||||
#if !defined _CRT_SECURE_NO_DEPRECATE
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
/* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */
|
||||
#define access _access
|
||||
#define cabs _cabs
|
||||
#define cgets _cgets
|
||||
#define chdir _chdir
|
||||
#define chmod _chmod
|
||||
#define chsize _chsize
|
||||
#define close _close
|
||||
#define cprintf _cprintf
|
||||
#define cputs _cputts
|
||||
#define creat _creat
|
||||
#define cscanf _cscanf
|
||||
#define cwait _cwait
|
||||
#define dup _dup
|
||||
#define dup2 _dup2
|
||||
#define ecvt _ecvt
|
||||
#define eof _eof
|
||||
#define execl _execl
|
||||
#define execle _execle
|
||||
#define execlp _execlp
|
||||
#define execlpe _execlpe
|
||||
#define execv _execv
|
||||
#define execve _execv
|
||||
#define execvp _execvp
|
||||
#define execvpe _execvpe
|
||||
#define fcloseall _fcloseall
|
||||
#define fcvt _fcvt
|
||||
#define fdopen _fdopen
|
||||
#define fgetchar _fgetchar
|
||||
#define filelength _filelength
|
||||
#define fileno _fileno
|
||||
#define flushall _flushall
|
||||
#define fputchar _fputchar
|
||||
#define gcvt _gcvt
|
||||
#define getch _getch
|
||||
#define getche _getche
|
||||
#define getcwd _getcwd
|
||||
#define getpid _getpid
|
||||
#define getw _getw
|
||||
#define hypot _hypot
|
||||
#define inp _inp
|
||||
#define inpw _inpw
|
||||
#define isascii __isascii
|
||||
#define isatty _isatty
|
||||
#define iscsym __iscsym
|
||||
#define iscsymf __iscsymf
|
||||
#define itoa _itoa
|
||||
#define j0 _j0
|
||||
#define j1 _j1
|
||||
#define jn _jn
|
||||
#define kbhit _kbhit
|
||||
#define lfind _lfind
|
||||
#define locking _locking
|
||||
#define lsearch _lsearch
|
||||
#define lseek _lseek
|
||||
#define ltoa _ltoa
|
||||
#define memccpy _memccpy
|
||||
#define memicmp _memicmp
|
||||
#define mkdir _mkdir
|
||||
#define mktemp _mktemp
|
||||
#define open _open
|
||||
#define outp _outp
|
||||
#define outpw _outpw
|
||||
#define putch _putch
|
||||
#define putenv _putenv
|
||||
#define putw _putw
|
||||
#define read _read
|
||||
#define rmdir _rmdir
|
||||
#define rmtmp _rmtmp
|
||||
#define setmode _setmode
|
||||
#define sopen _sopen
|
||||
#define spawnl _spawnl
|
||||
#define spawnle _spawnle
|
||||
#define spawnlp _spawnlp
|
||||
#define spawnlpe _spawnlpe
|
||||
#define spawnv _spawnv
|
||||
#define spawnve _spawnve
|
||||
#define spawnvp _spawnvp
|
||||
#define spawnvpe _spawnvpe
|
||||
#define strcmpi _strcmpi
|
||||
#define strdup _strdup
|
||||
#define stricmp _stricmp
|
||||
#define strlwr _strlwr
|
||||
#define strnicmp _strnicmp
|
||||
#define strnset _strnset
|
||||
#define strrev _strrev
|
||||
#define strset _strset
|
||||
#define strupr _strupr
|
||||
#define swab _swab
|
||||
#define tell _tell
|
||||
#define tempnam _tempnam
|
||||
#define toascii __toascii
|
||||
#define tzset _tzset
|
||||
#define ultoa _ultoa
|
||||
#define umask _umask
|
||||
#define ungetch _ungetch
|
||||
#define unlink _unlink
|
||||
#define wcsdup _wcsdup
|
||||
#define wcsicmp _wcsicmp
|
||||
#define wcsicoll _wcsicoll
|
||||
#define wcslwr _wcslwr
|
||||
#define wcsnicmp _wcsnicmp
|
||||
#define wcsnset _wcsnset
|
||||
#define wcsrev _wcsrev
|
||||
#define wcsset _wcsset
|
||||
#define wcsupr _wcsupr
|
||||
#define write _write
|
||||
#define y0 _y0
|
||||
#define y1 _y1
|
||||
#define yn _yn
|
||||
|
||||
/* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant
|
||||
* functions above are deprecated. */
|
||||
#pragma warning (disable:4996)
|
||||
|
||||
#endif
|
||||
#else
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
#pragma warning(disable:4103) /* disable warning message 4103 that complains
|
||||
* about pragma pack in a header file */
|
||||
#pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */
|
||||
#endif
|
||||
|
||||
|
||||
@ -2035,14 +1904,6 @@ void FN_AMXX_DETACH(void);
|
||||
void FN_AMXX_PLUGINSLOADED(void);
|
||||
#endif // FN_AMXX_PLUGINSLOADED
|
||||
|
||||
#ifdef FN_AMXX_PLUGINSUNLOADING
|
||||
void FN_AMXX_PLUGINSUNLOADING(void);
|
||||
#endif // FN_AMXX_PLUGINSUNLOADING
|
||||
|
||||
#ifdef FN_AMXX_PLUGINSUNLOADED
|
||||
void FN_AMXX_PLUGINSUNLOADED(void);
|
||||
#endif // FN_AMXX_PLUGINSUNLOADED
|
||||
|
||||
// *** Types ***
|
||||
typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/);
|
||||
|
||||
@ -2089,12 +1950,6 @@ enum PlayerProp
|
||||
Player_NewmenuPage, //int
|
||||
};
|
||||
|
||||
enum LibType
|
||||
{
|
||||
LibType_Library,
|
||||
LibType_Class
|
||||
};
|
||||
|
||||
typedef void (*AUTHORIZEFUNC)(int player, const char *authstring);
|
||||
|
||||
typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/);
|
||||
@ -2176,13 +2031,6 @@ typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/);
|
||||
typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */);
|
||||
typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC);
|
||||
typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC);
|
||||
typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/);
|
||||
typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/);
|
||||
typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/);
|
||||
typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/);
|
||||
typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/);
|
||||
typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/);
|
||||
typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/);
|
||||
|
||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||
@ -2250,13 +2098,6 @@ extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo;
|
||||
extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr;
|
||||
extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc;
|
||||
extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc;
|
||||
extern PFN_FINDLIBRARY g_fn_FindLibrary;
|
||||
extern PFN_ADDLIBRARIES g_fn_AddLibraries;
|
||||
extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries;
|
||||
extern PFN_OVERRIDENATIVES g_fn_OverrideNatives;
|
||||
extern PFN_GETLOCALINFO g_fn_GetLocalInfo;
|
||||
extern PFN_AMX_REREGISTER g_fn_AmxReRegister;
|
||||
extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx;
|
||||
|
||||
#ifdef MAY_NEVER_BE_DEFINED
|
||||
// Function prototypes for intellisense and similar systems
|
||||
@ -2321,13 +2162,6 @@ int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { }
|
||||
void * MF_PlayerPropAddr (int id, int prop) { }
|
||||
void MF_RegAuthFunc (AUTHORIZEFUNC fn) { }
|
||||
void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { }
|
||||
int MF_FindLibrary (const char *name, LibType type) { }
|
||||
size_t MF_AddLibraries (const char *name, LibType type, void *parent) { }
|
||||
size_t MF_RemoveLibraries (void *parent) { }
|
||||
void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { }
|
||||
const char * MF_GetLocalInfo (const char *name, const char *def) { }
|
||||
int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; }
|
||||
void * MF_RegisterFunctionEx (void *pfn, const char *description) { }
|
||||
#endif // MAY_NEVER_BE_DEFINED
|
||||
|
||||
#define MF_AddNatives g_fn_AddNatives
|
||||
@ -2397,13 +2231,6 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...);
|
||||
#define MF_PlayerPropAddr g_fn_PlayerPropAddr
|
||||
#define MF_RegAuthFunc g_fn_RegAuthFunc
|
||||
#define MF_UnregAuthFunc g_fn_UnregAuthFunc
|
||||
#define MF_FindLibrary g_fn_FindLibrary
|
||||
#define MF_AddLibraries g_fn_AddLibraries
|
||||
#define MF_RemoveLibraries g_fn_RemoveLibraries
|
||||
#define MF_OverrideNatives g_fn_OverrideNatives
|
||||
#define MF_GetLocalInfo g_fn_GetLocalInfo
|
||||
#define MF_AmxReRegister g_fn_AmxReRegister
|
||||
#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
/*** Memory ***/
|
||||
|
@ -3,24 +3,12 @@
|
||||
#ifndef __MODULECONFIG_H__
|
||||
#define __MODULECONFIG_H__
|
||||
|
||||
/** Module info
|
||||
* -The logtag is the tag that the module's log messages will be
|
||||
* prepended with.
|
||||
* -The library is the name that the #pragma library
|
||||
* message will have prepended.
|
||||
* -The library class is the class of libraries that
|
||||
* a module belongs to (like DBI). Keep it "" to
|
||||
* ignore.
|
||||
* -For both library and library class, you can use a comma
|
||||
* to add multiple entries.
|
||||
*/
|
||||
// Module info
|
||||
#define MODULE_NAME "--ENTER NAME HERE--"
|
||||
#define MODULE_VERSION "--ENTER VERSION HERE--"
|
||||
#define MODULE_AUTHOR "--ENTER AUTHOR HERE--"
|
||||
#define MODULE_URL "--ENTER URL HERE--"
|
||||
#define MODULE_LOGTAG "--ENTER LOGTAG HERE--"
|
||||
#define MODULE_LIBRARY "--ENTER LIBRARY HERE--"
|
||||
#define MODULE_LIBCLASS ""
|
||||
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
|
||||
#define MODULE_RELOAD_ON_MAPCHANGE
|
||||
|
||||
@ -43,35 +31,18 @@
|
||||
// It allows you to compile without libstdc++.so as a dependency
|
||||
// #define NO_ALLOC_OVERRIDES
|
||||
|
||||
// Uncomment this if you are using MSVC8 or greater and want to fix some of the compatibility issues yourself
|
||||
// #define NO_MSVC8_AUTO_COMPAT
|
||||
|
||||
/**
|
||||
* AMXX Init functions
|
||||
* Also consider using FN_META_*
|
||||
*/
|
||||
|
||||
/** AMXX query */
|
||||
// - AMXX Init functions
|
||||
// Also consider using FN_META_*
|
||||
// AMXX query
|
||||
//#define FN_AMXX_QUERY OnAmxxQuery
|
||||
|
||||
/** AMXX attach
|
||||
* Do native functions init here (MF_AddNatives)
|
||||
*/
|
||||
// AMXX attach
|
||||
// Do native functions init here (MF_AddNatives)
|
||||
//#define FN_AMXX_ATTACH OnAmxxAttach
|
||||
|
||||
/** AMXX Detach (unload) */
|
||||
// AMXX detach
|
||||
//#define FN_AMXX_DETACH OnAmxxDetach
|
||||
|
||||
/** All plugins loaded
|
||||
* Do forward functions init here (MF_RegisterForward)
|
||||
*/
|
||||
//#define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||
|
||||
/** All plugins are about to be unloaded */
|
||||
//#define FN_AMXX_PLUGINSUNLOADING OnPluginsUnloading
|
||||
|
||||
/** All plugins are now unloaded */
|
||||
//#define FN_AMXX_PLUGINSUNLOADED OnPluginsUnloaded
|
||||
// All plugins loaded
|
||||
// Do forward functions init here (MF_RegisterForward)
|
||||
// #define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||
|
||||
/**** METAMOD ****/
|
||||
// If your module doesn't use metamod, you may close the file now :)
|
||||
|
@ -11,13 +11,6 @@
|
||||
#ifndef _INCLUDE_SMM_LIST_H
|
||||
#define _INCLUDE_SMM_LIST_H
|
||||
|
||||
// MSVC8 fix for offsetof macro redefition warnings
|
||||
#ifdef _MSC_VER
|
||||
#if _MSC_VER >= 1400
|
||||
#undef offsetof
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <new>
|
||||
#include <malloc.h>
|
||||
|
||||
|
@ -39,7 +39,7 @@ void amx_command()
|
||||
{
|
||||
|
||||
print_srvconsole("Currently loaded plugins:\n");
|
||||
print_srvconsole(" %-23.22s %-8.7s %-17.16s %-16.15s %-9.8s\n", "name", "version", "author", "file", "status");
|
||||
print_srvconsole(" %-18.17s %-8.7s %-17.16s %-16.15s %-9.8s\n", "name", "version", "author", "file", "status");
|
||||
|
||||
int plugins = 0;
|
||||
int running = 0;
|
||||
@ -52,7 +52,7 @@ void amx_command()
|
||||
if ((*a).isValid() && !(*a).isPaused())
|
||||
++running;
|
||||
|
||||
print_srvconsole(" [%3d] %-23.22s %-8.7s %-17.16s %-16.15s %-9.8s\n", plugins, (*a).getTitle(), (*a).getVersion(), (*a).getAuthor(), (*a).getName(), (*a).getStatus());
|
||||
print_srvconsole(" [%3d] %-18.17s %-8.7s %-17.16s %-16.15s %-9.8s\n", plugins, (*a).getTitle(), (*a).getVersion(), (*a).getAuthor(), (*a).getName(), (*a).getStatus());
|
||||
++a;
|
||||
}
|
||||
|
||||
|
@ -832,7 +832,7 @@ static cell AMX_NATIVE_CALL format_args(AMX *amx, cell *params)
|
||||
|
||||
if (pos < 0)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Pos has to be a positive number");
|
||||
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -973,67 +973,6 @@ static cell AMX_NATIVE_CALL n_strfind(AMX *amx, cell *params)
|
||||
return (find - str);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL vformat(AMX *amx, cell *params)
|
||||
{
|
||||
int vargPos = static_cast<int>(params[4]);
|
||||
|
||||
/** get the parent parameter array */
|
||||
AMX_HEADER *hdr = (AMX_HEADER *)amx->base;
|
||||
cell *local_params = (cell *)(
|
||||
(char *)amx->base + (cell)hdr->dat +
|
||||
(cell)amx->frm + (2 * sizeof(cell))
|
||||
);
|
||||
|
||||
cell max = local_params[0] / sizeof(cell);
|
||||
if (vargPos > (int)max + 1)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid vararg parameter passed: %d", vargPos);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* check for bounds clipping
|
||||
*/
|
||||
cell addr_start = params[1];
|
||||
cell addr_end = addr_start + params[2];
|
||||
bool copy = false;
|
||||
for (int i = vargPos; i <= max; i++)
|
||||
{
|
||||
//does this clip the bounds?
|
||||
if ( (local_params[i] >= addr_start)
|
||||
&& (local_params[i] <= addr_end) )
|
||||
{
|
||||
copy = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* get destination info */
|
||||
cell *fmt = get_amxaddr(amx, params[3]);
|
||||
cell *realdest = get_amxaddr(amx, params[1]);
|
||||
size_t maxlen = static_cast<size_t>(params[2]);
|
||||
cell *dest = realdest;
|
||||
|
||||
/* if this is necessary... */
|
||||
static cell cpbuf[4096];
|
||||
if (copy)
|
||||
dest = cpbuf;
|
||||
|
||||
/* perform format */
|
||||
size_t total = atcprintf(dest, maxlen, fmt, amx, local_params, &vargPos);
|
||||
|
||||
/* copy back */
|
||||
if (copy)
|
||||
{
|
||||
memcpy(realdest, dest, (total+1) * sizeof(cell));
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
AMX_NATIVE_INFO string_Natives[] =
|
||||
{
|
||||
{"add", add},
|
||||
@ -1069,6 +1008,5 @@ AMX_NATIVE_INFO string_Natives[] =
|
||||
{"strcmp", n_strcmp},
|
||||
{"str_to_float", str_to_float},
|
||||
{"float_to_str", float_to_str},
|
||||
{"vformat", vformat},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
@ -14,16 +14,6 @@
|
||||
#define strnicmp strncasecmp
|
||||
#endif
|
||||
|
||||
#if _MSC_VER
|
||||
#if _MSC_VER >= 1400
|
||||
// MSVC8 - Replace POSIX stricmp with ISO C++ conformant one as it is deprecated
|
||||
#define stricmp _stricmp
|
||||
|
||||
// Need this because of some stupid bug
|
||||
#pragma warning (disable : 4996)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// this file does not include amxmodx.h, so we have to include the memory manager here
|
||||
#ifdef MEMORY_TEST
|
||||
#include "mmgr/mmgr.h"
|
||||
|
@ -1,205 +0,0 @@
|
||||
/* AMX Mod X
|
||||
*
|
||||
* by the AMX Mod X Development Team
|
||||
* originally developed by OLO
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* 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, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*/
|
||||
|
||||
#include "amxmodx.h"
|
||||
|
||||
#define ANGLEVECTORS_FORWARD 1
|
||||
#define ANGLEVECTORS_RIGHT 2
|
||||
#define ANGLEVECTORS_UP 3
|
||||
|
||||
static cell AMX_NATIVE_CALL get_distance(AMX *amx, cell *params)
|
||||
{
|
||||
cell *cpVec1 = get_amxaddr(amx, params[1]);
|
||||
cell *cpVec2 = get_amxaddr(amx, params[2]);
|
||||
|
||||
Vector vec1 = Vector((float)cpVec1[0], (float)cpVec1[1], (float)cpVec1[2]);
|
||||
Vector vec2 = Vector((float)cpVec2[0], (float)cpVec2[1], (float)cpVec2[2]);
|
||||
|
||||
int iDist = (int)((vec1 - vec2).Length());
|
||||
|
||||
return iDist;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_distance_f(AMX *amx, cell *params)
|
||||
{
|
||||
cell *cpVec1 = get_amxaddr(amx, params[1]);
|
||||
cell *cpVec2 = get_amxaddr(amx, params[2]);
|
||||
|
||||
Vector vec1 = Vector((float)amx_ctof(cpVec1[0]), (float)amx_ctof(cpVec1[1]), (float)amx_ctof(cpVec1[2]));
|
||||
Vector vec2 = Vector((float)amx_ctof(cpVec2[0]), (float)amx_ctof(cpVec2[1]), (float)amx_ctof(cpVec2[2]));
|
||||
|
||||
REAL fDist = (REAL) (vec1 - vec2).Length();
|
||||
|
||||
return amx_ftoc(fDist);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL VelocityByAim(AMX *amx, cell *params)
|
||||
{
|
||||
int iEnt = params[1];
|
||||
int iVelocity = params[2];
|
||||
cell *vRet = get_amxaddr(amx, params[3]);
|
||||
Vector vVector = Vector(0, 0, 0);
|
||||
edict_t *pEnt = NULL;
|
||||
|
||||
if (iEnt < 0 || iEnt > gpGlobals->maxEntities)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", iEnt);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (iEnt > 0 && iEnt <= gpGlobals->maxClients)
|
||||
{
|
||||
if (!GET_PLAYER_POINTER_I(iEnt)->ingame)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not ingame)", iEnt);
|
||||
return 0;
|
||||
}
|
||||
pEnt = GET_PLAYER_POINTER_I(iEnt)->pEdict;
|
||||
} else {
|
||||
pEnt = INDEXENT(iEnt);
|
||||
}
|
||||
}
|
||||
|
||||
if (!pEnt)
|
||||
{
|
||||
LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d (nullent)", iEnt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
MAKE_VECTORS(pEnt->v.v_angle);
|
||||
vVector = gpGlobals->v_forward * iVelocity;
|
||||
|
||||
vRet[0] = FloatToCell(vVector.x);
|
||||
vRet[1] = FloatToCell(vVector.y);
|
||||
vRet[2] = FloatToCell(vVector.z);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL vector_to_angle(AMX *amx, cell *params)
|
||||
{
|
||||
cell *cAddr = get_amxaddr(amx, params[1]);
|
||||
|
||||
REAL fX = amx_ctof(cAddr[0]);
|
||||
REAL fY = amx_ctof(cAddr[1]);
|
||||
REAL fZ = amx_ctof(cAddr[2]);
|
||||
|
||||
Vector vVector = Vector(fX, fY, fZ);
|
||||
Vector vAngle = Vector(0, 0, 0);
|
||||
VEC_TO_ANGLES(vVector, vAngle);
|
||||
|
||||
cell *vRet = get_amxaddr(amx, params[2]);
|
||||
|
||||
vRet[0] = FloatToCell(vAngle.x);
|
||||
vRet[1] = FloatToCell(vAngle.y);
|
||||
vRet[2] = FloatToCell(vAngle.z);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL angle_vector(AMX *amx, cell *params)
|
||||
{
|
||||
Vector v_angles, v_forward, v_right, v_up, v_return;
|
||||
|
||||
cell *vCell = get_amxaddr(amx, params[1]);
|
||||
v_angles.x = amx_ctof(vCell[0]);
|
||||
v_angles.y = amx_ctof(vCell[1]);
|
||||
v_angles.z = amx_ctof(vCell[2]);
|
||||
|
||||
g_engfuncs.pfnAngleVectors(v_angles, v_forward, v_right, v_up);
|
||||
|
||||
switch (params[2])
|
||||
{
|
||||
case ANGLEVECTORS_FORWARD:
|
||||
v_return = v_forward;
|
||||
break;
|
||||
case ANGLEVECTORS_RIGHT:
|
||||
v_return = v_right;
|
||||
break;
|
||||
case ANGLEVECTORS_UP:
|
||||
v_return = v_up;
|
||||
break;
|
||||
}
|
||||
|
||||
vCell = get_amxaddr(amx, params[3]);
|
||||
vCell[0] = FloatToCell(v_return.x);
|
||||
vCell[1] = FloatToCell(v_return.y);
|
||||
vCell[2] = FloatToCell(v_return.z);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL vector_length(AMX *amx, cell *params)
|
||||
{
|
||||
cell *cAddr = get_amxaddr(amx, params[1]);
|
||||
|
||||
REAL fX = amx_ctof(cAddr[0]);
|
||||
REAL fY = amx_ctof(cAddr[1]);
|
||||
REAL fZ = amx_ctof(cAddr[2]);
|
||||
|
||||
Vector vVector = Vector(fX, fY, fZ);
|
||||
|
||||
REAL fLength = vVector.Length();
|
||||
|
||||
return amx_ftoc(fLength);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL vector_distance(AMX *amx, cell *params)
|
||||
{
|
||||
cell *cAddr = get_amxaddr(amx, params[1]);
|
||||
cell *cAddr2 = get_amxaddr(amx, params[2]);
|
||||
|
||||
REAL fX = amx_ctof(cAddr[0]);
|
||||
REAL fY = amx_ctof(cAddr[1]);
|
||||
REAL fZ = amx_ctof(cAddr[2]);
|
||||
REAL fX2 = amx_ctof(cAddr2[0]);
|
||||
REAL fY2 = amx_ctof(cAddr2[1]);
|
||||
REAL fZ2 = amx_ctof(cAddr2[2]);
|
||||
|
||||
Vector vVector = Vector(fX, fY, fZ);
|
||||
Vector vVector2 = Vector(fX2, fY2, fZ2);
|
||||
|
||||
REAL fLength = (vVector - vVector2).Length();
|
||||
|
||||
return amx_ftoc(fLength);
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO vector_Natives[] = {
|
||||
{"get_distance", get_distance},
|
||||
{"get_distance_f", get_distance_f},
|
||||
{"velocity_by_aim", VelocityByAim},
|
||||
{"vector_to_angle", vector_to_angle},
|
||||
{"angle_vector", angle_vector},
|
||||
{"vector_length", vector_length},
|
||||
{"vector_distance", vector_distance},
|
||||
{NULL, NULL},
|
||||
};
|
@ -1,5 +1,6 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@ -26,8 +27,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,7,5,1
|
||||
PRODUCTVERSION 1,7,5,1
|
||||
FILEVERSION 1,7,1,0
|
||||
PRODUCTVERSION 1,7,1,0
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@ -44,12 +45,12 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "Comments", "AMX Mod X"
|
||||
VALUE "FileDescription", "AMX Mod X"
|
||||
VALUE "FileVersion", "1.75a"
|
||||
VALUE "FileVersion", "1.71"
|
||||
VALUE "InternalName", "amxmodx"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2004-2006, AMX Mod X Dev Team"
|
||||
VALUE "OriginalFilename", "amxmodx_mm.dll"
|
||||
VALUE "ProductName", "AMX Mod X"
|
||||
VALUE "ProductVersion", "1.75a"
|
||||
VALUE "ProductVersion", "1.71"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
@ -62,7 +62,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
pc_printf("Welcome to the AMX Mod X %s Compiler.\n", VERSION_STRING);
|
||||
pc_printf("Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team\n\n");
|
||||
pc_printf("Copyright (c) 1997-2005 ITB CompuPhase, AMX Mod X Team\n\n");
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
|
@ -1,7 +1,9 @@
|
||||
#ifndef _AMXXSC_INCLUDE_H
|
||||
#define _AMXXSC_INCLUDE_H
|
||||
|
||||
#define VERSION_STRING "1.75-300"
|
||||
#define VERSION_STRING "1.70-300"
|
||||
#define VERSION 03000
|
||||
#define MAGIC_HEADER 0x414D5842
|
||||
#define MAGIC_HEADER2 0x414D5858
|
||||
#define MAGIC_VERSION 0x0300
|
||||
|
||||
|
@ -61,8 +61,6 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "sc.h"
|
||||
#define VERSION_STR "3.0.3367-amxx"
|
||||
#define VERSION_INT 0x300
|
||||
@ -127,7 +125,6 @@ static void dostate(void);
|
||||
static void addwhile(int *ptr);
|
||||
static void delwhile(void);
|
||||
static int *readwhile(void);
|
||||
static void inst_datetime_defines(void);
|
||||
|
||||
static int lastst = 0; /* last executed statement type */
|
||||
static int nestlevel = 0; /* number of active (open) compound statements */
|
||||
@ -385,23 +382,6 @@ long pc_lengthbin(void *handle)
|
||||
|
||||
#endif /* !defined NO_MAIN */
|
||||
|
||||
void inst_datetime_defines()
|
||||
{
|
||||
char date[64];
|
||||
char ltime[64];
|
||||
time_t td;
|
||||
struct tm *curtime;
|
||||
|
||||
time(&td);
|
||||
curtime = localtime(&td);
|
||||
|
||||
strftime(date, 31, "\"%m/%d/%Y\"", curtime);
|
||||
strftime(ltime, 31, "\"%H:%M:%S\"", curtime);
|
||||
|
||||
insert_subst("__DATE__", date, 8);
|
||||
insert_subst("__TIME__", ltime, 8);
|
||||
}
|
||||
|
||||
|
||||
/* "main" of the compiler
|
||||
*/
|
||||
@ -551,7 +531,7 @@ int pc_compile(int argc, char *argv[])
|
||||
delete_symbols(&glbtab,0,TRUE,FALSE);
|
||||
#if !defined NO_DEFINE
|
||||
delete_substtable();
|
||||
inst_datetime_defines();
|
||||
insert_subst("__DATE__", "\"" __DATE__ "\"", 8);
|
||||
#endif
|
||||
resetglobals();
|
||||
sc_ctrlchar=sc_ctrlchar_org;
|
||||
@ -615,7 +595,7 @@ int pc_compile(int argc, char *argv[])
|
||||
delete_symbols(&glbtab,0,TRUE,FALSE);
|
||||
#if !defined NO_DEFINE
|
||||
delete_substtable();
|
||||
inst_datetime_defines();
|
||||
insert_subst("__DATE__", "\"" __DATE__ "\"", 8);
|
||||
#endif
|
||||
resetglobals();
|
||||
sc_ctrlchar=sc_ctrlchar_org;
|
||||
|
@ -1016,29 +1016,8 @@ static int command(void)
|
||||
} /* if */
|
||||
} else if (strcmp(str,"dynamic")==0) {
|
||||
preproc_expr(&sc_stksize,NULL);
|
||||
} else if ( !strcmp(str,"library") ||
|
||||
!strcmp(str, "reqlib") ||
|
||||
!strcmp(str, "reqclass") ||
|
||||
!strcmp(str, "loadlib") ||
|
||||
!strcmp(str, "explib") ||
|
||||
!strcmp(str, "expclass") ||
|
||||
!strcmp(str, "defclasslib") ) {
|
||||
char name[sNAMEMAX+1],sname[sNAMEMAX+1];
|
||||
const char *prefix = "";
|
||||
sname[0] = '\0';
|
||||
sname[1] = '\0';
|
||||
if (!strcmp(str, "reqlib"))
|
||||
prefix = "?rl_";
|
||||
else if (!strcmp(str, "reqclass"))
|
||||
prefix = "?rc_";
|
||||
else if (!strcmp(str, "loadlib"))
|
||||
prefix = "?f_";
|
||||
else if (!strcmp(str, "explib"))
|
||||
prefix = "?el_";
|
||||
else if (!strcmp(str, "expclass"))
|
||||
prefix = "?ec_";
|
||||
else if (!strcmp(str, "defclasslib"))
|
||||
prefix = "?d_";
|
||||
} else if (strcmp(str,"library")==0) {
|
||||
char name[sNAMEMAX+1];
|
||||
while (*lptr<=' ' && *lptr!='\0')
|
||||
lptr++;
|
||||
if (*lptr=='"') {
|
||||
@ -1048,20 +1027,6 @@ static int command(void)
|
||||
for (i=0; i<sizeof name && (alphanum(*lptr) || *lptr=='-'); i++,lptr++)
|
||||
name[i]=*lptr;
|
||||
name[i]='\0';
|
||||
if (!strncmp(str, "exp", 3) || !strncmp(str, "def", 3))
|
||||
{
|
||||
while (*lptr && isspace(*lptr))
|
||||
lptr++;
|
||||
for (i=1; i<sizeof sname && alphanum(*lptr); i++,lptr++)
|
||||
sname[i]=*lptr;
|
||||
sname[i] = '\0';
|
||||
if (!sname[1])
|
||||
{
|
||||
error(45);
|
||||
} else {
|
||||
sname[0] = '_';
|
||||
}
|
||||
}
|
||||
} /* if */
|
||||
if (strlen(name)==0) {
|
||||
curlibrary=NULL;
|
||||
@ -1069,22 +1034,8 @@ static int command(void)
|
||||
pc_addlibtable=FALSE;
|
||||
} else {
|
||||
/* add the name if it does not yet exist in the table */
|
||||
char newname[sNAMEMAX+1];
|
||||
if (strlen(name) + strlen(prefix) + strlen(sname) <= sNAMEMAX)
|
||||
{
|
||||
strcpy(newname, prefix);
|
||||
strcat(newname, name);
|
||||
strcat(newname, sname);
|
||||
if (newname[0] != '?')
|
||||
{
|
||||
if (find_constval(&libname_tab,newname,0)==NULL)
|
||||
{
|
||||
curlibrary=append_constval(&libname_tab,newname,0,0);
|
||||
}
|
||||
} else {
|
||||
exporttag(pc_addtag(newname));
|
||||
}
|
||||
}
|
||||
if (find_constval(&libname_tab,name,0)==NULL)
|
||||
curlibrary=append_constval(&libname_tab,name,0,0);
|
||||
} /* if */
|
||||
} else if (strcmp(str,"pack")==0) {
|
||||
cell val;
|
||||
|
@ -14,6 +14,7 @@
|
||||
"mp_friendlyfire" "0" "1" "u"
|
||||
"mp_limitteams" "0" "1" "2" "u"
|
||||
"mp_autoteambalance" "0" "1" "2" "u"
|
||||
"mp_limitteams" "0" "1" "2" "u"
|
||||
"allow_spectators" "0" "1" "u"
|
||||
"mp_freezetime" "0" "6" "u"
|
||||
"mp_buytime" "1" "0.5" "u"
|
||||
|
@ -1,39 +1,83 @@
|
||||
; AMX Mod X Modules
|
||||
; You can specify both linux & win32 modules here
|
||||
; To enable a module, remove the semi-colon from the line
|
||||
|
||||
;;;
|
||||
; To enable a module, remove the semi-colon (;) in front of its name.
|
||||
; If it's not here, simply add it its name, one per line.
|
||||
; You don't need to write the _amxx part or the file extension.
|
||||
;;;
|
||||
; ------------------------------
|
||||
; Fun - provides extra functions
|
||||
; ------------------------------
|
||||
fun_amxx_i386.so
|
||||
fun_amxx.dll
|
||||
fun_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; SQL Modules usually need to be enabled manually ;;
|
||||
;; You can have any number on at a time. Use ;;
|
||||
;; amx_sql_type in sql.cfg to specify the default ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; ----------------------------------------------------
|
||||
; Engine - provides engine functions core to Half-Life
|
||||
; ----------------------------------------------------
|
||||
;engine_amxx_i386.so
|
||||
;engine_amxx.dll
|
||||
;engine_amxx_amd64.so
|
||||
|
||||
;mysql
|
||||
;sqlite
|
||||
; ----------------------------------------------------------
|
||||
; Fakemeta - provides a massive interface into the HL engine
|
||||
; ----------------------------------------------------------
|
||||
;fakemeta_amxx_i386.so
|
||||
;fakemeta_amxx.dll
|
||||
;fakemeta_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Put third party modules below here. ;;
|
||||
;; You can just list their names, without the _amxx ;;
|
||||
;; or file extension. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; -------------------------------------------
|
||||
; Database Access - only enable one of these
|
||||
; -------------------------------------------
|
||||
; MySQL
|
||||
;mysql_amxx_i386.so
|
||||
;mysql_amxx.dll
|
||||
;mysql_amxx_amd64.so
|
||||
; PostgreSQL
|
||||
;pgsql_amxx_i386.so
|
||||
;pgsql_amxx.dll
|
||||
; Microsoft SQL
|
||||
;mssql_amxx.dll
|
||||
; SQLite
|
||||
;sqlite_amxx.dll
|
||||
;sqlite_amxx_i386.so
|
||||
;sqlite_amxx_amd64.so
|
||||
|
||||
; ---------------------------------------------
|
||||
; GeoIP - determines the country of ip adresses
|
||||
; ---------------------------------------------
|
||||
;geoip_amxx_i386.so
|
||||
;geoip_amxx.dll
|
||||
;geoip_amxx_amd64.so
|
||||
|
||||
; --------------------------------
|
||||
; Sockets - network socket support
|
||||
; --------------------------------
|
||||
;sockets_amxx_i386.so
|
||||
;sockets_amxx.dll
|
||||
;sockets_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; These modules will be auto-detected and loaded ;;
|
||||
;; as needed. You do not need to enable them here ;;
|
||||
;; unless you have problems. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; --------------------------
|
||||
; Regular Expression support
|
||||
; --------------------------
|
||||
;regex_amxx_i386.so
|
||||
;regex_amxx.dll
|
||||
;regex_amxx_amd64.so
|
||||
|
||||
fun
|
||||
;engine
|
||||
;fakemeta
|
||||
;geoip
|
||||
;sockets
|
||||
;regex
|
||||
;nvault
|
||||
cstrike
|
||||
csx
|
||||
; --------------------
|
||||
; Binary Vault support
|
||||
; --------------------
|
||||
;nvault_amxx_i386.so
|
||||
;nvault_amxx.dll
|
||||
;nvault_amxx_amd64.so
|
||||
|
||||
; ----------------------------------------------------------
|
||||
; Counter-Strike - adds functions specific to Counter-Strike
|
||||
; ----------------------------------------------------------
|
||||
cstrike_amxx_i386.so
|
||||
cstrike_amxx.dll
|
||||
cstrike_amxx_amd64.so
|
||||
|
||||
; -----------------------------------------------------
|
||||
; CSX - adds functionality for CS statistics and events
|
||||
; -----------------------------------------------------
|
||||
csx_amxx_i386.so
|
||||
csx_amxx.dll
|
||||
csx_amxx_amd64.so
|
||||
|
@ -1,39 +1,83 @@
|
||||
; AMX Mod X Modules
|
||||
; You can specify both linux & win32 modules here
|
||||
; To enable a module, remove the semi-colon from the line
|
||||
|
||||
;;;
|
||||
; To enable a module, remove the semi-colon (;) in front of its name.
|
||||
; If it's not here, simply add it its name, one per line.
|
||||
; You don't need to write the _amxx part or the file extension.
|
||||
;;;
|
||||
; ------------------------------
|
||||
; Fun - provides extra functions
|
||||
; ------------------------------
|
||||
fun_amxx_i386.so
|
||||
fun_amxx.dll
|
||||
fun_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; SQL Modules usually need to be enabled manually ;;
|
||||
;; You can have any number on at a time. Use ;;
|
||||
;; amx_sql_type in sql.cfg to specify the default ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; ----------------------------------------------------
|
||||
; Engine - provides engine functions core to Half-Life
|
||||
; ----------------------------------------------------
|
||||
;engine_amxx_i386.so
|
||||
;engine_amxx.dll
|
||||
;engine_amxx_amd64.so
|
||||
|
||||
;mysql
|
||||
;sqlite
|
||||
; ----------------------------------------------------------
|
||||
; Fakemeta - provides a massive interface into the HL engine
|
||||
; ----------------------------------------------------------
|
||||
;fakemeta_amxx_i386.so
|
||||
;fakemeta_amxx.dll
|
||||
;fakemeta_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Put third party modules below here. ;;
|
||||
;; You can just list their names, without the _amxx ;;
|
||||
;; or file extension. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; -------------------------------------------
|
||||
; Database Access - only enable one of these
|
||||
; -------------------------------------------
|
||||
; MySQL
|
||||
;mysql_amxx_i386.so
|
||||
;mysql_amxx.dll
|
||||
;mysql_amxx_amd64.so
|
||||
; PostgreSQL
|
||||
;pgsql_amxx_i386.so
|
||||
;pgsql_amxx.dll
|
||||
; Microsoft SQL
|
||||
;mssql_amxx.dll
|
||||
; SQLite
|
||||
;sqlite_amxx.dll
|
||||
;sqlite_amxx_i386.so
|
||||
;sqlite_amxx_amd64.so
|
||||
|
||||
; ---------------------------------------------
|
||||
; GeoIP - determines the country of ip adresses
|
||||
; ---------------------------------------------
|
||||
;geoip_amxx_i386.so
|
||||
;geoip_amxx.dll
|
||||
;geoip_amxx_amd64.so
|
||||
|
||||
; --------------------------------
|
||||
; Sockets - network socket support
|
||||
; --------------------------------
|
||||
;sockets_amxx_i386.so
|
||||
;sockets_amxx.dll
|
||||
;sockets_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; These modules will be auto-detected and loaded ;;
|
||||
;; as needed. You do not need to enable them here ;;
|
||||
;; unless you have problems. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; --------------------------
|
||||
; Regular Expression support
|
||||
; --------------------------
|
||||
;regex_amxx_i386.so
|
||||
;regex_amxx.dll
|
||||
;regex_amxx_amd64.so
|
||||
|
||||
fun
|
||||
;engine
|
||||
;fakemeta
|
||||
;geoip
|
||||
;sockets
|
||||
;regex
|
||||
;nvault
|
||||
dodfun
|
||||
dodx
|
||||
; --------------------
|
||||
; Binary Vault support
|
||||
; --------------------
|
||||
;nvault_amxx_i386.so
|
||||
;nvault_amxx.dll
|
||||
;nvault_amxx_amd64.so
|
||||
|
||||
; --------------------------------------------------
|
||||
; Day of Defeat Fun - adds functions specific to DoD
|
||||
; --------------------------------------------------
|
||||
dodfun_amxx_i386.so
|
||||
dodfun_amxx.dll
|
||||
dodfun_amxx_amd64.so
|
||||
|
||||
; -------------------------------------------------------
|
||||
; Day of Defeat X - adds stats and addition DoD functions
|
||||
; -------------------------------------------------------
|
||||
dodx_amxx_i386.so
|
||||
dodx_amxx.dll
|
||||
dodx_amxx_amd64.so
|
||||
|
@ -1,37 +1,69 @@
|
||||
; AMX Mod X Modules
|
||||
; You can specify both linux & win32 modules here
|
||||
; To enable a module, remove the semi-colon from the line
|
||||
|
||||
;;;
|
||||
; To enable a module, remove the semi-colon (;) in front of its name.
|
||||
; If it's not here, simply add it its name, one per line.
|
||||
; You don't need to write the _amxx part or the file extension.
|
||||
;;;
|
||||
; ------------------------------
|
||||
; Fun - provides extra functions
|
||||
; ------------------------------
|
||||
fun_amxx_i386.so
|
||||
fun_amxx.dll
|
||||
fun_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; SQL Modules usually need to be enabled manually ;;
|
||||
;; You can have any number on at a time. Use ;;
|
||||
;; amx_sql_type in sql.cfg to specify the default ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; ----------------------------------------------------
|
||||
; Engine - provides engine functions core to Half-Life
|
||||
; ----------------------------------------------------
|
||||
engine_amxx_i386.so
|
||||
engine_amxx.dll
|
||||
engine_amxx_amd64.so
|
||||
|
||||
;mysql
|
||||
;sqlite
|
||||
; ----------------------------------------------------------
|
||||
; Fakemeta - provides a massive interface into the HL engine
|
||||
; ----------------------------------------------------------
|
||||
fakemeta_amxx_i386.so
|
||||
fakemeta_amxx.dll
|
||||
fakemeta_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Put third party modules below here. ;;
|
||||
;; You can just list their names, without the _amxx ;;
|
||||
;; or file extension. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; -------------------------------------------
|
||||
; Database Access - only enable one of these
|
||||
; -------------------------------------------
|
||||
; MySQL
|
||||
;mysql_amxx_i386.so
|
||||
;mysql_amxx.dll
|
||||
;mysql_amxx_amd64.so
|
||||
; PostgreSQL
|
||||
;pgsql_amxx_i386.so
|
||||
;pgsql_amxx.dll
|
||||
; Microsoft SQL
|
||||
;mssql_amxx.dll
|
||||
; SQLite
|
||||
;sqlite_amxx.dll
|
||||
;sqlite_amxx_i386.so
|
||||
;sqlite_amxx_amd64.so
|
||||
|
||||
; ---------------------------------------------
|
||||
; GeoIP - determines the country of ip adresses
|
||||
; ---------------------------------------------
|
||||
;geoip_amxx_i386.so
|
||||
;geoip_amxx.dll
|
||||
;geoip_amxx_amd64.so
|
||||
|
||||
; --------------------------------
|
||||
; Sockets - network socket support
|
||||
; --------------------------------
|
||||
;sockets_amxx_i386.so
|
||||
;sockets_amxx.dll
|
||||
;sockets_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; These modules will be auto-detected and loaded ;;
|
||||
;; as needed. You do not need to enable them here ;;
|
||||
;; unless you have problems. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; --------------------------
|
||||
; Regular Expression support
|
||||
; --------------------------
|
||||
;regex_amxx_i386.so
|
||||
;regex_amxx.dll
|
||||
;regex_amxx_amd64.so
|
||||
|
||||
fun
|
||||
engine
|
||||
fakemeta
|
||||
;geoip
|
||||
;sockets
|
||||
;regex
|
||||
;nvault
|
||||
; --------------------
|
||||
; Binary Vault support
|
||||
; --------------------
|
||||
;nvault_amxx_i386.so
|
||||
;nvault_amxx.dll
|
||||
;nvault_amxx_amd64.so
|
@ -1,37 +1,69 @@
|
||||
; AMX Mod X Modules
|
||||
; You can specify both linux & win32 modules here
|
||||
; To enable a module, remove the semi-colon from the line
|
||||
|
||||
;;;
|
||||
; To enable a module, remove the semi-colon (;) in front of its name.
|
||||
; If it's not here, simply add it its name, one per line.
|
||||
; You don't need to write the _amxx part or the file extension.
|
||||
;;;
|
||||
; ------------------------------
|
||||
; Fun - provides extra functions
|
||||
; ------------------------------
|
||||
fun_amxx_i386.so
|
||||
fun_amxx.dll
|
||||
fun_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; SQL Modules usually need to be enabled manually ;;
|
||||
;; You can have any number on at a time. Use ;;
|
||||
;; amx_sql_type in sql.cfg to specify the default ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; ----------------------------------------------------
|
||||
; Engine - provides engine functions core to Half-Life
|
||||
; ----------------------------------------------------
|
||||
;engine_amxx_i386.so
|
||||
;engine_amxx.dll
|
||||
;engine_amxx_amd64.so
|
||||
|
||||
;mysql
|
||||
;sqlite
|
||||
; ----------------------------------------------------------
|
||||
; Fakemeta - provides a massive interface into the HL engine
|
||||
; ----------------------------------------------------------
|
||||
;fakemeta_amxx_i386.so
|
||||
;fakemeta_amxx.dll
|
||||
;fakemeta_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Put third party modules below here. ;;
|
||||
;; You can just list their names, without the _amxx ;;
|
||||
;; or file extension. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; -------------------------------------------
|
||||
; Database Access - only enable one of these
|
||||
; -------------------------------------------
|
||||
; MySQL
|
||||
;mysql_amxx_i386.so
|
||||
;mysql_amxx.dll
|
||||
;mysql_amxx_amd64.so
|
||||
; PostgreSQL
|
||||
;pgsql_amxx_i386.so
|
||||
;pgsql_amxx.dll
|
||||
; Microsoft SQL
|
||||
;mssql_amxx.dll
|
||||
; SQLite
|
||||
;sqlite_amxx.dll
|
||||
;sqlite_amxx_i386.so
|
||||
;sqlite_amxx_amd64.so
|
||||
|
||||
; ---------------------------------------------
|
||||
; GeoIP - determines the country of ip adresses
|
||||
; ---------------------------------------------
|
||||
;geoip_amxx_i386.so
|
||||
;geoip_amxx.dll
|
||||
;geoip_amxx_amd64.so
|
||||
|
||||
; --------------------------------
|
||||
; Sockets - network socket support
|
||||
; --------------------------------
|
||||
;sockets_amxx_i386.so
|
||||
;sockets_amxx.dll
|
||||
;sockets_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; These modules will be auto-detected and loaded ;;
|
||||
;; as needed. You do not need to enable them here ;;
|
||||
;; unless you have problems. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; --------------------------
|
||||
; Regular Expression support
|
||||
; --------------------------
|
||||
;regex_amxx_i386.so
|
||||
;regex_amxx.dll
|
||||
;regex_amxx_amd64.so
|
||||
|
||||
;fun
|
||||
;engine
|
||||
;fakemeta
|
||||
;geoip
|
||||
;sockets
|
||||
;regex
|
||||
;nvault
|
||||
; --------------------
|
||||
; Binary Vault support
|
||||
; --------------------
|
||||
;nvault_amxx_i386.so
|
||||
;nvault_amxx.dll
|
||||
;nvault_amxx_amd64.so
|
@ -1,38 +1,76 @@
|
||||
; AMX Mod X Modules
|
||||
; You can specify both linux & win32 modules here
|
||||
; To enable a module, remove the semi-colon from the line
|
||||
|
||||
;;;
|
||||
; To enable a module, remove the semi-colon (;) in front of its name.
|
||||
; If it's not here, simply add it its name, one per line.
|
||||
; You don't need to write the _amxx part or the file extension.
|
||||
;;;
|
||||
; ------------------------------
|
||||
; Fun - provides extra functions
|
||||
; ------------------------------
|
||||
fun_amxx_i386.so
|
||||
fun_amxx.dll
|
||||
fun_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; SQL Modules usually need to be enabled manually ;;
|
||||
;; You can have any number on at a time. Use ;;
|
||||
;; amx_sql_type in sql.cfg to specify the default ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; ----------------------------------------------------
|
||||
; Engine - provides engine functions core to Half-Life
|
||||
; ----------------------------------------------------
|
||||
;engine_amxx_i386.so
|
||||
;engine_amxx.dll
|
||||
;engine_amxx_amd64.so
|
||||
|
||||
;mysql
|
||||
;sqlite
|
||||
; ----------------------------------------------------------
|
||||
; Fakemeta - provides a massive interface into the HL engine
|
||||
; ----------------------------------------------------------
|
||||
;fakemeta_amxx_i386.so
|
||||
;fakemeta_amxx.dll
|
||||
;fakemeta_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Put third party modules below here. ;;
|
||||
;; You can just list their names, without the _amxx ;;
|
||||
;; or file extension. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; -------------------------------------------
|
||||
; Database Access - only enable one of these
|
||||
; -------------------------------------------
|
||||
; MySQL
|
||||
;mysql_amxx_i386.so
|
||||
;mysql_amxx.dll
|
||||
;mysql_amxx_amd64.so
|
||||
; PostgreSQL
|
||||
;pgsql_amxx_i386.so
|
||||
;pgsql_amxx.dll
|
||||
; Microsoft SQL
|
||||
;mssql_amxx.dll
|
||||
; SQLite
|
||||
;sqlite_amxx.dll
|
||||
;sqlite_amxx_i386.so
|
||||
;sqlite_amxx_amd64.so
|
||||
|
||||
; ---------------------------------------------
|
||||
; GeoIP - determines the country of ip adresses
|
||||
; ---------------------------------------------
|
||||
;geoip_amxx_i386.so
|
||||
;geoip_amxx.dll
|
||||
;geoip_amxx_amd64.so
|
||||
|
||||
; --------------------------------
|
||||
; Sockets - network socket support
|
||||
; --------------------------------
|
||||
;sockets_amxx_i386.so
|
||||
;sockets_amxx.dll
|
||||
;sockets_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; These modules will be auto-detected and loaded ;;
|
||||
;; as needed. You do not need to enable them here ;;
|
||||
;; unless you have problems. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; --------------------------
|
||||
; Regular Expression support
|
||||
; --------------------------
|
||||
;regex_amxx_i386.so
|
||||
;regex_amxx.dll
|
||||
;regex_amxx_amd64.so
|
||||
|
||||
fun
|
||||
;engine
|
||||
;fakemeta
|
||||
;geoip
|
||||
;sockets
|
||||
;regex
|
||||
;nvault
|
||||
ns
|
||||
; --------------------
|
||||
; Binary Vault support
|
||||
; --------------------
|
||||
;nvault_amxx_i386.so
|
||||
;nvault_amxx.dll
|
||||
;nvault_amxx_amd64.so
|
||||
|
||||
; -----------------
|
||||
; Natural Selection
|
||||
; -----------------
|
||||
ns_amxx_i386.so
|
||||
ns_amxx.dll
|
||||
ns_amxx_amd64.so
|
||||
|
@ -4,11 +4,8 @@
|
||||
// *NOTE* Linux users may encounter problems if they specify "localhost" instead of "127.0.0.1"
|
||||
// We recommend using your server IP address instead of its name
|
||||
|
||||
// *NOTE* amx_sql_type specifies the DEFAULT database type which admin.sma will use.
|
||||
|
||||
amx_sql_host "127.0.0.1"
|
||||
amx_sql_user "root"
|
||||
amx_sql_pass ""
|
||||
amx_sql_db "amx"
|
||||
amx_sql_table "admins"
|
||||
amx_sql_type "mysql"
|
||||
amx_sql_db "amx"
|
||||
amx_sql_table "admins"
|
@ -1,38 +1,76 @@
|
||||
; AMX Mod X Modules
|
||||
; You can specify both linux & win32 modules here
|
||||
; To enable a module, remove the semi-colon from the line
|
||||
|
||||
;;;
|
||||
; To enable a module, remove the semi-colon (;) in front of its name.
|
||||
; If it's not here, simply add it its name, one per line.
|
||||
; You don't need to write the _amxx part or the file extension.
|
||||
;;;
|
||||
; ------------------------------
|
||||
; Fun - provides extra functions
|
||||
; ------------------------------
|
||||
fun_amxx_i386.so
|
||||
fun_amxx.dll
|
||||
fun_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; SQL Modules usually need to be enabled manually ;;
|
||||
;; You can have any number on at a time. Use ;;
|
||||
;; amx_sql_type in sql.cfg to specify the default ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; ----------------------------------------------------
|
||||
; Engine - provides engine functions core to Half-Life
|
||||
; ----------------------------------------------------
|
||||
;engine_amxx_i386.so
|
||||
;engine_amxx.dll
|
||||
;engine_amxx_amd64.so
|
||||
|
||||
;mysql
|
||||
;sqlite
|
||||
; ----------------------------------------------------------
|
||||
; Fakemeta - provides a massive interface into the HL engine
|
||||
; ----------------------------------------------------------
|
||||
;fakemeta_amxx_i386.so
|
||||
;fakemeta_amxx.dll
|
||||
;fakemeta_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Put third party modules below here. ;;
|
||||
;; You can just list their names, without the _amxx ;;
|
||||
;; or file extension. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; -------------------------------------------
|
||||
; Database Access - only enable one of these
|
||||
; -------------------------------------------
|
||||
; MySQL
|
||||
;mysql_amxx_i386.so
|
||||
;mysql_amxx.dll
|
||||
;mysql_amxx_amd64.so
|
||||
; PostgreSQL
|
||||
;pgsql_amxx_i386.so
|
||||
;pgsql_amxx.dll
|
||||
; Microsoft SQL
|
||||
;mssql_amxx.dll
|
||||
; SQLite
|
||||
;sqlite_amxx.dll
|
||||
;sqlite_amxx_i386.so
|
||||
;sqlite_amxx_amd64.so
|
||||
|
||||
; ---------------------------------------------
|
||||
; GeoIP - determines the country of ip adresses
|
||||
; ---------------------------------------------
|
||||
;geoip_amxx_i386.so
|
||||
;geoip_amxx.dll
|
||||
;geoip_amxx_amd64.so
|
||||
|
||||
; --------------------------------
|
||||
; Sockets - network socket support
|
||||
; --------------------------------
|
||||
;sockets_amxx_i386.so
|
||||
;sockets_amxx.dll
|
||||
;sockets_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; These modules will be auto-detected and loaded ;;
|
||||
;; as needed. You do not need to enable them here ;;
|
||||
;; unless you have problems. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; --------------------------
|
||||
; Regular Expression support
|
||||
; --------------------------
|
||||
;regex_amxx_i386.so
|
||||
;regex_amxx.dll
|
||||
;regex_amxx_amd64.so
|
||||
|
||||
fun
|
||||
;engine
|
||||
;fakemeta
|
||||
;geoip
|
||||
;sockets
|
||||
;regex
|
||||
;nvault
|
||||
tfcx
|
||||
; --------------------
|
||||
; Binary Vault support
|
||||
; --------------------
|
||||
;nvault_amxx_i386.so
|
||||
;nvault_amxx.dll
|
||||
;nvault_amxx_amd64.so
|
||||
|
||||
; ------------------------------------------------------------------
|
||||
; Team Fortress Classic X - adds functions and stats specific to TFC
|
||||
; ------------------------------------------------------------------
|
||||
tfcx_amxx_i386.so
|
||||
tfcx_amxx.dll
|
||||
tfcx_amxx_amd64.so
|
||||
|
@ -1,39 +1,83 @@
|
||||
; AMX Mod X Modules
|
||||
; You can specify both linux & win32 modules here
|
||||
; To enable a module, remove the semi-colon from the line
|
||||
|
||||
;;;
|
||||
; To enable a module, remove the semi-colon (;) in front of its name.
|
||||
; If it's not here, simply add it its name, one per line.
|
||||
; You don't need to write the _amxx part or the file extension.
|
||||
;;;
|
||||
; ------------------------------
|
||||
; Fun - provides extra functions
|
||||
; ------------------------------
|
||||
fun_amxx_i386.so
|
||||
fun_amxx.dll
|
||||
fun_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; SQL Modules usually need to be enabled manually ;;
|
||||
;; You can have any number on at a time. Use ;;
|
||||
;; amx_sql_type in sql.cfg to specify the default ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; ----------------------------------------------------
|
||||
; Engine - provides engine functions core to Half-Life
|
||||
; ----------------------------------------------------
|
||||
;engine_amxx_i386.so
|
||||
;engine_amxx.dll
|
||||
;engine_amxx_amd64.so
|
||||
|
||||
;mysql
|
||||
;sqlite
|
||||
; ----------------------------------------------------------
|
||||
; Fakemeta - provides a massive interface into the HL engine
|
||||
; ----------------------------------------------------------
|
||||
;fakemeta_amxx_i386.so
|
||||
;fakemeta_amxx.dll
|
||||
;fakemeta_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Put third party modules below here. ;;
|
||||
;; You can just list their names, without the _amxx ;;
|
||||
;; or file extension. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; -------------------------------------------
|
||||
; Database Access - only enable one of these
|
||||
; -------------------------------------------
|
||||
; MySQL
|
||||
;mysql_amxx_i386.so
|
||||
;mysql_amxx.dll
|
||||
;mysql_amxx_amd64.so
|
||||
; PostgreSQL
|
||||
;pgsql_amxx_i386.so
|
||||
;pgsql_amxx.dll
|
||||
; Microsoft SQL
|
||||
;mssql_amxx.dll
|
||||
; SQLite
|
||||
;sqlite_amxx.dll
|
||||
;sqlite_amxx_i386.so
|
||||
;sqlite_amxx_amd64.so
|
||||
|
||||
; ---------------------------------------------
|
||||
; GeoIP - determines the country of ip adresses
|
||||
; ---------------------------------------------
|
||||
;geoip_amxx_i386.so
|
||||
;geoip_amxx.dll
|
||||
;geoip_amxx_amd64.so
|
||||
|
||||
; --------------------------------
|
||||
; Sockets - network socket support
|
||||
; --------------------------------
|
||||
;sockets_amxx_i386.so
|
||||
;sockets_amxx.dll
|
||||
;sockets_amxx_amd64.so
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; These modules will be auto-detected and loaded ;;
|
||||
;; as needed. You do not need to enable them here ;;
|
||||
;; unless you have problems. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; --------------------------
|
||||
; Regular Expression support
|
||||
; --------------------------
|
||||
;regex_amxx_i386.so
|
||||
;regex_amxx.dll
|
||||
;regex_amxx_amd64.so
|
||||
|
||||
fun
|
||||
;engine
|
||||
;fakemeta
|
||||
;geoip
|
||||
;sockets
|
||||
;regex
|
||||
;nvault
|
||||
tsx
|
||||
tsfun
|
||||
; --------------------
|
||||
; Binary Vault support
|
||||
; --------------------
|
||||
;nvault_amxx_i386.so
|
||||
;nvault_amxx.dll
|
||||
;nvault_amxx_amd64.so
|
||||
|
||||
; -----------------------------------------------------------
|
||||
; The Specialists X - adds functions and stats specific to TS
|
||||
; -----------------------------------------------------------
|
||||
tsx_amxx_i386.so
|
||||
tsx_amxx.dll
|
||||
tsx_amxx_amd64.so
|
||||
|
||||
; -----------------------------------------------------------
|
||||
; The Specialists Fun - more functionality
|
||||
; -----------------------------------------------------------
|
||||
tsfun_amxx_i386.so
|
||||
tsfun_amxx.dll
|
||||
tsfun_amxx_amd64.so
|
@ -31,7 +31,7 @@ static cell AMX_NATIVE_CALL get_user_level(AMX *amx,cell *params)
|
||||
|
||||
static cell AMX_NATIVE_CALL set_user_level(AMX *amx,cell *params)
|
||||
{
|
||||
if(GetUserLevel(params[1]) > params[2])
|
||||
if(GetUserLevel(params[0]) > params[2])
|
||||
{
|
||||
MF_LogError(amx,AMX_ERR_NATIVE,"Must set to a level higher than current one!");
|
||||
return 0;
|
||||
|
@ -1,175 +0,0 @@
|
||||
# Microsoft Developer Studio Generated Dependency File, included by Array.mak
|
||||
|
||||
.\Array.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\CArray.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\CBinTrie.h"\
|
||||
".\ComboArray.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\BinTrieNatives.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\BinTrieNativeFunctions.h"\
|
||||
".\Capsule.h"\
|
||||
".\CArray.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\CBinTrie.h"\
|
||||
".\ComboArray.h"\
|
||||
".\GenericNatives.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\NativeIncludes.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\Capsule.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\CArray.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\CArray.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\CBinTrie.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\CBinTrie.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\CKeytable.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\CKeytable.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\JudyExtra.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\CBinTrie.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\ListNatives.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\CArray.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\CBinTrie.h"\
|
||||
".\ComboArray.h"\
|
||||
".\GenericNatives.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\ListNativeFunctions.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\NativeIncludes.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\MapNatives.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\CArray.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\CBinTrie.h"\
|
||||
".\CHashtable.h"\
|
||||
".\CKeytable.h"\
|
||||
".\ComboArray.h"\
|
||||
".\ComboTable.h"\
|
||||
".\GenericNatives.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\MapNativeFunctions.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\NativeIncludes.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\amxxmodule.cpp : \
|
||||
".\amxxmodule.h"\
|
||||
".\moduleconfig.h"\
|
||||
|
@ -130,6 +130,10 @@ SOURCE=.\MapNatives.cpp
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\BinTrieNativeFunctions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Capsule.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -166,8 +170,16 @@ SOURCE=.\ComboTable.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\GenericNatives.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\JudyIncludes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MapNativeFunctions.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
@ -182,14 +194,6 @@ SOURCE=.\amxxmodule.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\BinTrieNativeFunctions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\GenericNatives.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Judy.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -214,10 +218,6 @@ SOURCE=.\ListNativeFunctions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MapNativeFunctions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\moduleconfig.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
Binary file not shown.
Binary file not shown.
@ -6,105 +6,31 @@
|
||||
--------------------Configuration: Array - Win32 Release--------------------
|
||||
</h3>
|
||||
<h3>Command Lines</h3>
|
||||
Creating temporary file "C:\DOCUME~1\Edward\LOCALS~1\Temp\RSPED.tmp" with contents
|
||||
[
|
||||
/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ARRAY_EXPORTS" /FR"Release/" /Fp"Release/Array.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
|
||||
"C:\Array\Array.cpp"
|
||||
"C:\Array\BinTrieNatives.cpp"
|
||||
"C:\Array\Capsule.cpp"
|
||||
"C:\Array\CArray.cpp"
|
||||
"C:\Array\CBinTrie.cpp"
|
||||
"C:\Array\CKeytable.cpp"
|
||||
"C:\Array\JudyExtra.cpp"
|
||||
"C:\Array\ListNatives.cpp"
|
||||
"C:\Array\MapNatives.cpp"
|
||||
"C:\Array\amxxmodule.cpp"
|
||||
]
|
||||
Creating command line "cl.exe @C:\DOCUME~1\Edward\LOCALS~1\Temp\RSPED.tmp"
|
||||
Creating temporary file "C:\DOCUME~1\Edward\LOCALS~1\Temp\RSPEE.tmp" with contents
|
||||
Creating temporary file "C:\DOCUME~1\Edward\LOCALS~1\Temp\RSP36D.tmp" with contents
|
||||
[
|
||||
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /pdb:"Release/Array.pdb" /machine:I386 /out:"Release/Array.dll" /implib:"Release/Array.lib"
|
||||
.\Release\Array.obj
|
||||
.\Release\BinTrieNatives.obj
|
||||
.\Release\Capsule.obj
|
||||
.\Release\CArray.obj
|
||||
.\Release\CBinTrie.obj
|
||||
.\Release\CKeytable.obj
|
||||
.\Release\JudyExtra.obj
|
||||
.\Release\ListNatives.obj
|
||||
.\Release\MapNatives.obj
|
||||
.\Release\amxxmodule.obj
|
||||
.\Judy.lib
|
||||
".\Release\Array.obj"
|
||||
".\Release\BinTrieNatives.obj"
|
||||
".\Release\Capsule.obj"
|
||||
".\Release\CArray.obj"
|
||||
".\Release\CBinTrie.obj"
|
||||
".\Release\CKeytable.obj"
|
||||
".\Release\JudyExtra.obj"
|
||||
".\Release\ListNatives.obj"
|
||||
".\Release\MapNatives.obj"
|
||||
".\Release\amxxmodule.obj"
|
||||
".\Judy.lib"
|
||||
]
|
||||
Creating command line "link.exe @C:\DOCUME~1\Edward\LOCALS~1\Temp\RSPEE.tmp"
|
||||
Creating command line "link.exe @C:\DOCUME~1\Edward\LOCALS~1\Temp\RSP36D.tmp"
|
||||
<h3>Output Window</h3>
|
||||
Compiling...
|
||||
Array.cpp
|
||||
BinTrieNatives.cpp
|
||||
Capsule.cpp
|
||||
CArray.cpp
|
||||
CBinTrie.cpp
|
||||
CKeytable.cpp
|
||||
JudyExtra.cpp
|
||||
C:\Array\JudyExtra.cpp(10) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(15) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(20) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(23) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(34) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(41) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(66) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(102) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(107) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(112) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(115) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(127) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(132) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(137) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(140) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(160) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(164) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(167) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(190) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(205) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(210) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(215) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(218) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(230) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(235) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(240) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(243) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(258) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(266) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(274) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(277) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(305) : warning C4101: 'e' : unreferenced local variable
|
||||
ListNatives.cpp
|
||||
MapNatives.cpp
|
||||
amxxmodule.cpp
|
||||
Linking...
|
||||
Creating library Release/Array.lib and object Release/Array.exp
|
||||
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
|
||||
Creating temporary file "C:\DOCUME~1\Edward\LOCALS~1\Temp\RSPF2.tmp" with contents
|
||||
[
|
||||
/nologo /o"Release/Array.bsc"
|
||||
.\Release\Array.sbr
|
||||
.\Release\BinTrieNatives.sbr
|
||||
.\Release\Capsule.sbr
|
||||
.\Release\CArray.sbr
|
||||
.\Release\CBinTrie.sbr
|
||||
.\Release\CKeytable.sbr
|
||||
.\Release\JudyExtra.sbr
|
||||
.\Release\ListNatives.sbr
|
||||
.\Release\MapNatives.sbr
|
||||
.\Release\amxxmodule.sbr]
|
||||
Creating command line "bscmake.exe @C:\DOCUME~1\Edward\LOCALS~1\Temp\RSPF2.tmp"
|
||||
Creating browse info file...
|
||||
<h3>Output Window</h3>
|
||||
|
||||
|
||||
|
||||
<h3>Results</h3>
|
||||
Array.dll - 0 error(s), 33 warning(s)
|
||||
Array.dll - 0 error(s), 1 warning(s)
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -66,14 +66,14 @@ bool Capsule::GetBool( void )
|
||||
{
|
||||
if (type != capsule_type_bool) ThrowTypeError(capsule_type_bool);
|
||||
|
||||
return (data != NULL);
|
||||
return reinterpret_cast<bool>(data);
|
||||
}
|
||||
|
||||
void Capsule::SetBool(bool Value)
|
||||
{
|
||||
CheckEmpty(true);
|
||||
type = capsule_type_bool;
|
||||
if(Value == true) data = reinterpret_cast<Pvoid_t>(1);
|
||||
data = reinterpret_cast<void*>(Value);
|
||||
};
|
||||
|
||||
cell Capsule::GetInt( void )
|
||||
|
Binary file not shown.
@ -2502,10 +2502,6 @@ PFN_FORMAT g_fn_Format;
|
||||
PFN_REGISTERFUNCTION g_fn_RegisterFunction;
|
||||
PFN_REQ_FNPTR g_fn_RequestFunction;
|
||||
PFN_AMX_PUSH g_fn_AmxPush;
|
||||
PFN_SET_TEAM_INFO g_fn_SetTeamInfo;
|
||||
PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr;
|
||||
PFN_REG_AUTH_FUNC g_fn_RegAuthFunc;
|
||||
PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc;
|
||||
|
||||
// *** Exports ***
|
||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||
@ -2615,10 +2611,6 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
||||
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
||||
REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT);
|
||||
REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH);
|
||||
REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO);
|
||||
REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR);
|
||||
REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC);
|
||||
REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC);
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
// Memory
|
||||
@ -2741,10 +2733,6 @@ void ValidateMacros_DontCallThis_Smiley()
|
||||
MF_GetPlayerEdict(0);
|
||||
MF_Format("", 4, "str");
|
||||
MF_RegisterFunction(NULL, "");
|
||||
MF_SetPlayerTeamInfo(0, 0, "");
|
||||
MF_PlayerPropAddr(0, 0);
|
||||
MF_RegAuthFunc(NULL);
|
||||
MF_UnregAuthFunc(NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2924,20 +2912,20 @@ void operator delete[](void *reportedAddress)
|
||||
#else
|
||||
|
||||
#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32
|
||||
void * operator new(size_t size) {
|
||||
void * ::operator new(size_t size) {
|
||||
return(calloc(1, size));
|
||||
}
|
||||
|
||||
void * operator new[](size_t size) {
|
||||
void * ::operator new[](size_t size) {
|
||||
return(calloc(1, size));
|
||||
}
|
||||
|
||||
void operator delete(void * ptr) {
|
||||
void ::operator delete(void * ptr) {
|
||||
if(ptr)
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
void operator delete[](void * ptr) {
|
||||
void ::operator delete[](void * ptr) {
|
||||
if(ptr)
|
||||
free(ptr);
|
||||
}
|
||||
|
@ -26,11 +26,6 @@
|
||||
#define LINUX
|
||||
#endif
|
||||
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
typedef unsigned int size_t;
|
||||
#define _SIZE_T_DEFINED
|
||||
#endif
|
||||
|
||||
#undef C_DLLEXPORT
|
||||
#define C_DLLEXPORT extern "C" DLLEXPORT
|
||||
|
||||
@ -1932,30 +1927,6 @@ enum ForwardParam
|
||||
FP_ARRAY, // array; use the return value of prepareArray.
|
||||
};
|
||||
|
||||
enum PlayerProp
|
||||
{
|
||||
Player_Name, //String
|
||||
Player_Ip, //String
|
||||
Player_Team, //String
|
||||
Player_Ingame, //bool
|
||||
Player_Authorized, //bool
|
||||
Player_Vgui, //bool
|
||||
Player_Time, //float
|
||||
Player_Playtime, //float
|
||||
Player_MenuExpire, //float
|
||||
Player_Weapons, //struct{int,int}[32]
|
||||
Player_CurrentWeapon, //int
|
||||
Player_TeamID, //int
|
||||
Player_Deaths, //int
|
||||
Player_Aiming, //int
|
||||
Player_Menu, //int
|
||||
Player_Keys, //int
|
||||
Player_Flags, //int[32]
|
||||
Player_Newmenu, //int
|
||||
Player_NewmenuPage, //int
|
||||
};
|
||||
|
||||
typedef void (*AUTHORIZEFUNC)(int player, const char *authstring);
|
||||
|
||||
typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/);
|
||||
typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...);
|
||||
@ -2007,7 +1978,6 @@ typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||
#else
|
||||
typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||
#endif
|
||||
typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/);
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||
@ -2033,9 +2003,6 @@ typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||
typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/);
|
||||
typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/);
|
||||
typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */);
|
||||
typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC);
|
||||
typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC);
|
||||
|
||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||
@ -2099,10 +2066,6 @@ extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam;
|
||||
extern PFN_REGISTERFUNCTION g_fn_RegisterFunction;
|
||||
extern PFN_REQ_FNPTR g_fn_RequestFunction;
|
||||
extern PFN_AMX_PUSH g_fn_AmxPush;
|
||||
extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo;
|
||||
extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr;
|
||||
extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc;
|
||||
extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc;
|
||||
|
||||
#ifdef MAY_NEVER_BE_DEFINED
|
||||
// Function prototypes for intellisense and similar systems
|
||||
@ -2163,10 +2126,6 @@ void MF_RegisterFunction (void *pfn, const char *description) { }
|
||||
void * MF_RequestFunction (const char *description) { }
|
||||
int MF_AmxPush (AMX *amx, cell *params) { }
|
||||
int MF_AmxExec (AMX *amx, cell *retval, int idx) { }
|
||||
int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { }
|
||||
void * MF_PlayerPropAddr (int id, int prop) { }
|
||||
void MF_RegAuthFunc (AUTHORIZEFUNC fn) { }
|
||||
void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { }
|
||||
#endif // MAY_NEVER_BE_DEFINED
|
||||
|
||||
#define MF_AddNatives g_fn_AddNatives
|
||||
@ -2230,12 +2189,8 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...);
|
||||
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||
#define MF_Format g_fn_Format
|
||||
#define MF_RegisterFunction g_fn_RegisterFunction
|
||||
#define MF_RequestFunction g_fn_RequestFunction
|
||||
#define MF_RequestFunction g_fn_RequestFunction;
|
||||
#define MF_AmxPush g_fn_AmxPush
|
||||
#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo
|
||||
#define MF_PlayerPropAddr g_fn_PlayerPropAddr
|
||||
#define MF_RegAuthFunc g_fn_RegAuthFunc
|
||||
#define MF_UnregAuthFunc g_fn_UnregAuthFunc
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
/*** Memory ***/
|
||||
|
Binary file not shown.
@ -1,58 +0,0 @@
|
||||
#(C)2004-2005 AMX Mod X Development Team
|
||||
# Makefile written by David "BAILOPAN" Anderson
|
||||
|
||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
||||
|
||||
OPT_FLAGS = -funroll-loops -s -pipe -fomit-frame-pointer-fexceptions
|
||||
DEBUG_FLAGS = -g -ggdb3
|
||||
CPP = gcc
|
||||
NAME = array_amxx
|
||||
|
||||
OBJECTS = amxxmodule.cpp Array.cpp BinTrieNatives.cpp Capsule.cpp CArray.cpp CBinTrie.cpp CKeytable.cpp JudyExtra.cpp ListNatives.cpp MapNatives.cpp
|
||||
|
||||
LINK = Judy.a libstdc++.a
|
||||
|
||||
ifeq "$(DEBUG)" "true"
|
||||
BIN_DIR = Debug
|
||||
CFLAGS = $(DEBUG_FLAGS)
|
||||
else
|
||||
BIN_DIR = Release
|
||||
CFLAGS = $(OPT_FLAGS)
|
||||
endif
|
||||
|
||||
CFLAGS += -DNDEBUG -fPIC -Wno-deprecated -DHAVE_STDINT_H -fexceptions -fno-rtti
|
||||
|
||||
ifeq "$(AMD64)" "true"
|
||||
BINARY = $(NAME)_amd64.so
|
||||
CFLAGS += -DPAWN_CELL_SIZE=64 -DHAVE_I64 -m64
|
||||
else
|
||||
BINARY = $(NAME)_i386.so
|
||||
CFLAGS += -DPAWN_CELL_SIZE=32 -DJIT -DASM32
|
||||
OPT_FLAGS += -march=i586
|
||||
endif
|
||||
|
||||
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
||||
|
||||
$(BIN_DIR)/%.o: %.cpp
|
||||
$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
|
||||
|
||||
all:
|
||||
mkdir -p $(BIN_DIR)
|
||||
$(MAKE) engine
|
||||
|
||||
amd64:
|
||||
$(MAKE) all AMD64=true
|
||||
|
||||
engine: $(OBJ_LINUX)
|
||||
$(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -shared -lm -o$(BIN_DIR)/$(BINARY)
|
||||
|
||||
debug:
|
||||
$(MAKE) all DEBUG=true
|
||||
|
||||
default: all
|
||||
|
||||
clean:
|
||||
rm -rf Release/*.o
|
||||
rm -rf Release/$(BINARY)
|
||||
rm -rf Debug/*.o
|
||||
rm -rf Debug/$(BINARY)
|
@ -3,14 +3,6 @@
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "CstrikePlayer.h"
|
||||
|
||||
#if defined _MSC_VER
|
||||
#if _MSC_VER >= 1400
|
||||
// MSVC8 - disable deprecation warnings for "unsafe" CRT functions
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <string.h> // strcpy()
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
@ -9,17 +9,14 @@ MM_ROOT = ../metamod/metamod
|
||||
OPT_FLAGS = -O2 -funroll-loops -s -pipe -fomit-frame-pointer
|
||||
DEBUG_FLAGS = -g -ggdb3
|
||||
CPP = gcc
|
||||
NAME = cstrike
|
||||
|
||||
BIN_SUFFIX_32 = amxx_i386.so
|
||||
BIN_SUFFIX_64 = amxx_amd64.so
|
||||
NAME = cstrike_amxx
|
||||
|
||||
OBJECTS = CstrikePlayer.cpp cstrike.cpp amxxmodule.cpp
|
||||
|
||||
LINK =
|
||||
|
||||
INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \
|
||||
-I$(MM_ROOT) -I$(HLSDK)/common
|
||||
-I$(MM_ROOT) -Lzlib -I$(HLSDK)/common
|
||||
|
||||
ifeq "$(DEBUG)" "true"
|
||||
BIN_DIR = Debug
|
||||
@ -32,12 +29,12 @@ endif
|
||||
CFLAGS += -DNDEBUG -fPIC -Wno-deprecated -fno-exceptions -DHAVE_STDINT_H -fno-rtti -static-libgcc
|
||||
|
||||
ifeq "$(AMD64)" "true"
|
||||
BINARY = $(NAME)_$(BIN_SUFFIX_64)
|
||||
BINARY = $(NAME)_amd64.so
|
||||
CFLAGS += -DPAWN_CELL_SIZE=64 -DHAVE_I64 -m64
|
||||
else
|
||||
BINARY = $(NAME)_$(BIN_SUFFIX_32)
|
||||
BINARY = $(NAME)_i386.so
|
||||
CFLAGS += -DPAWN_CELL_SIZE=32 -DJIT -DASM32
|
||||
OPT_FLAGS += -march=i586
|
||||
OPT_FLAGS += -march=i686
|
||||
endif
|
||||
|
||||
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
||||
@ -62,8 +59,7 @@ default: all
|
||||
|
||||
clean:
|
||||
rm -rf Release/*.o
|
||||
rm -rf Release/$(NAME)_$(BIN_SUFFIX_32)
|
||||
rm -rf Release/$(NAME)_$(BIN_SUFFIX_64)
|
||||
rm -rf Release/$(BINARY)
|
||||
rm -rf Debug/*.o
|
||||
rm -rf Debug/$(NAME)_$(BIN_SUFFIX_32)
|
||||
rm -rf Debug/$(NAME)_$(BIN_SUFFIX_64)
|
||||
rm -rf Debug/$(BINARY)
|
||||
|
||||
|
@ -2430,9 +2430,7 @@ static amxx_module_info_s g_ModuleInfo =
|
||||
#else // MODULE_RELOAD_ON_MAPCHANGE
|
||||
0,
|
||||
#endif // MODULE_RELOAD_ON_MAPCHANGE
|
||||
MODULE_LOGTAG,
|
||||
MODULE_LIBRARY,
|
||||
MODULE_LIBCLASS
|
||||
MODULE_LOGTAG
|
||||
};
|
||||
|
||||
// Storage for the requested functions
|
||||
@ -2506,13 +2504,6 @@ PFN_REQ_FNPTR g_fn_RequestFunction;
|
||||
PFN_AMX_PUSH g_fn_AmxPush;
|
||||
PFN_SET_TEAM_INFO g_fn_SetTeamInfo;
|
||||
PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr;
|
||||
PFN_REG_AUTH_FUNC g_fn_RegAuthFunc;
|
||||
PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc;
|
||||
PFN_FINDLIBRARY g_fn_FindLibrary;
|
||||
PFN_ADDLIBRARIES g_fn_AddLibraries;
|
||||
PFN_REMOVELIBRARIES g_fn_RemoveLibraries;
|
||||
PFN_OVERRIDENATIVES g_fn_OverrideNatives;
|
||||
PFN_GETLOCALINFO g_fn_GetLocalInfo;
|
||||
|
||||
// *** Exports ***
|
||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||
@ -2624,14 +2615,6 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
||||
REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH);
|
||||
REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO);
|
||||
REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR);
|
||||
REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC);
|
||||
REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC);
|
||||
|
||||
REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY);
|
||||
REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES);
|
||||
REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES);
|
||||
REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES);
|
||||
REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO);
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
// Memory
|
||||
@ -2667,27 +2650,14 @@ C_DLLEXPORT int AMXX_PluginsLoaded()
|
||||
return AMXX_OK;
|
||||
}
|
||||
|
||||
C_DLLEXPORT void AMXX_PluginsUnloaded()
|
||||
{
|
||||
#ifdef FN_AMXX_PLUGINSUNLOADED
|
||||
FN_AMXX_PLUGINSUNLOADED();
|
||||
#endif // FN_AMXX_PLUGINSUNLOADED
|
||||
}
|
||||
|
||||
C_DLLEXPORT void AMXX_PluginsUnloading()
|
||||
{
|
||||
#ifdef FN_AMXX_PLUGINSUNLOADING
|
||||
FN_AMXX_PLUGINSUNLOADING();
|
||||
#endif // FN_AMXX_PLUGINSUNLOADING
|
||||
}
|
||||
|
||||
// Advanced MF functions
|
||||
void MF_Log(const char *fmt, ...)
|
||||
{
|
||||
// :TODO: Overflow possible here
|
||||
char msg[3072];
|
||||
va_list arglst;
|
||||
va_start(arglst, fmt);
|
||||
vsnprintf(msg, sizeof(msg) - 1, fmt, arglst);
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_Log("[%s] %s", MODULE_LOGTAG, msg);
|
||||
@ -2695,10 +2665,11 @@ void MF_Log(const char *fmt, ...)
|
||||
|
||||
void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||
{
|
||||
// :TODO: Overflow possible here
|
||||
char msg[3072];
|
||||
va_list arglst;
|
||||
va_start(arglst, fmt);
|
||||
vsnprintf(msg, sizeof(msg) - 1, fmt, arglst);
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg);
|
||||
@ -2768,12 +2739,6 @@ void ValidateMacros_DontCallThis_Smiley()
|
||||
MF_RegisterFunction(NULL, "");
|
||||
MF_SetPlayerTeamInfo(0, 0, "");
|
||||
MF_PlayerPropAddr(0, 0);
|
||||
MF_RegAuthFunc(NULL);
|
||||
MF_UnregAuthFunc(NULL);
|
||||
MF_FindLibrary(NULL, LibType_Class);
|
||||
MF_AddLibraries(NULL, LibType_Class, NULL);
|
||||
MF_RemoveLibraries(NULL);
|
||||
MF_OverrideNatives(NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -34,8 +34,7 @@
|
||||
// module interface version was 1
|
||||
// 2 - added logtag to struct (amxx1.1-rc1)
|
||||
// 3 - added new tagAMX structure (amxx1.5)
|
||||
// 4 - added new 'library' setting for direct loading
|
||||
#define AMXX_INTERFACE_VERSION 4
|
||||
#define AMXX_INTERFACE_VERSION 3
|
||||
|
||||
// amxx module info
|
||||
struct amxx_module_info_s
|
||||
@ -45,8 +44,6 @@ struct amxx_module_info_s
|
||||
const char *version;
|
||||
int reload; // reload on mapchange when nonzero
|
||||
const char *logtag; // added in version 2
|
||||
const char *library; // added in version 4
|
||||
const char *libclass; // added in version 4
|
||||
};
|
||||
|
||||
// return values from functions called by amxx
|
||||
@ -156,137 +153,9 @@ typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx);
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER
|
||||
#pragma warning(disable:4103) /* disable warning message 4103 that complains
|
||||
* about pragma pack in a header file */
|
||||
#pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
#if !defined NO_MSVC8_AUTO_COMPAT
|
||||
|
||||
/* Disable deprecation warnings concerning unsafe CRT functions */
|
||||
#if !defined _CRT_SECURE_NO_DEPRECATE
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
/* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */
|
||||
#define access _access
|
||||
#define cabs _cabs
|
||||
#define cgets _cgets
|
||||
#define chdir _chdir
|
||||
#define chmod _chmod
|
||||
#define chsize _chsize
|
||||
#define close _close
|
||||
#define cprintf _cprintf
|
||||
#define cputs _cputts
|
||||
#define creat _creat
|
||||
#define cscanf _cscanf
|
||||
#define cwait _cwait
|
||||
#define dup _dup
|
||||
#define dup2 _dup2
|
||||
#define ecvt _ecvt
|
||||
#define eof _eof
|
||||
#define execl _execl
|
||||
#define execle _execle
|
||||
#define execlp _execlp
|
||||
#define execlpe _execlpe
|
||||
#define execv _execv
|
||||
#define execve _execv
|
||||
#define execvp _execvp
|
||||
#define execvpe _execvpe
|
||||
#define fcloseall _fcloseall
|
||||
#define fcvt _fcvt
|
||||
#define fdopen _fdopen
|
||||
#define fgetchar _fgetchar
|
||||
#define filelength _filelength
|
||||
#define fileno _fileno
|
||||
#define flushall _flushall
|
||||
#define fputchar _fputchar
|
||||
#define gcvt _gcvt
|
||||
#define getch _getch
|
||||
#define getche _getche
|
||||
#define getcwd _getcwd
|
||||
#define getpid _getpid
|
||||
#define getw _getw
|
||||
#define hypot _hypot
|
||||
#define inp _inp
|
||||
#define inpw _inpw
|
||||
#define isascii __isascii
|
||||
#define isatty _isatty
|
||||
#define iscsym __iscsym
|
||||
#define iscsymf __iscsymf
|
||||
#define itoa _itoa
|
||||
#define j0 _j0
|
||||
#define j1 _j1
|
||||
#define jn _jn
|
||||
#define kbhit _kbhit
|
||||
#define lfind _lfind
|
||||
#define locking _locking
|
||||
#define lsearch _lsearch
|
||||
#define lseek _lseek
|
||||
#define ltoa _ltoa
|
||||
#define memccpy _memccpy
|
||||
#define memicmp _memicmp
|
||||
#define mkdir _mkdir
|
||||
#define mktemp _mktemp
|
||||
#define open _open
|
||||
#define outp _outp
|
||||
#define outpw _outpw
|
||||
#define putch _putch
|
||||
#define putenv _putenv
|
||||
#define putw _putw
|
||||
#define read _read
|
||||
#define rmdir _rmdir
|
||||
#define rmtmp _rmtmp
|
||||
#define setmode _setmode
|
||||
#define sopen _sopen
|
||||
#define spawnl _spawnl
|
||||
#define spawnle _spawnle
|
||||
#define spawnlp _spawnlp
|
||||
#define spawnlpe _spawnlpe
|
||||
#define spawnv _spawnv
|
||||
#define spawnve _spawnve
|
||||
#define spawnvp _spawnvp
|
||||
#define spawnvpe _spawnvpe
|
||||
#define strcmpi _strcmpi
|
||||
#define strdup _strdup
|
||||
#define stricmp _stricmp
|
||||
#define strlwr _strlwr
|
||||
#define strnicmp _strnicmp
|
||||
#define strnset _strnset
|
||||
#define strrev _strrev
|
||||
#define strset _strset
|
||||
#define strupr _strupr
|
||||
#define swab _swab
|
||||
#define tell _tell
|
||||
#define tempnam _tempnam
|
||||
#define toascii __toascii
|
||||
#define tzset _tzset
|
||||
#define ultoa _ultoa
|
||||
#define umask _umask
|
||||
#define ungetch _ungetch
|
||||
#define unlink _unlink
|
||||
#define wcsdup _wcsdup
|
||||
#define wcsicmp _wcsicmp
|
||||
#define wcsicoll _wcsicoll
|
||||
#define wcslwr _wcslwr
|
||||
#define wcsnicmp _wcsnicmp
|
||||
#define wcsnset _wcsnset
|
||||
#define wcsrev _wcsrev
|
||||
#define wcsset _wcsset
|
||||
#define wcsupr _wcsupr
|
||||
#define write _write
|
||||
#define y0 _y0
|
||||
#define y1 _y1
|
||||
#define yn _yn
|
||||
|
||||
/* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant
|
||||
* functions above are deprecated. */
|
||||
#pragma warning (disable:4996)
|
||||
|
||||
#endif
|
||||
#else
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
#pragma warning(disable:4103) /* disable warning message 4103 that complains
|
||||
* about pragma pack in a header file */
|
||||
#pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */
|
||||
#endif
|
||||
|
||||
|
||||
@ -2035,14 +1904,6 @@ void FN_AMXX_DETACH(void);
|
||||
void FN_AMXX_PLUGINSLOADED(void);
|
||||
#endif // FN_AMXX_PLUGINSLOADED
|
||||
|
||||
#ifdef FN_AMXX_PLUGINSUNLOADING
|
||||
void FN_AMXX_PLUGINSUNLOADING(void);
|
||||
#endif // FN_AMXX_PLUGINSUNLOADING
|
||||
|
||||
#ifdef FN_AMXX_PLUGINSUNLOADED
|
||||
void FN_AMXX_PLUGINSUNLOADED(void);
|
||||
#endif // FN_AMXX_PLUGINSUNLOADED
|
||||
|
||||
// *** Types ***
|
||||
typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/);
|
||||
|
||||
@ -2089,14 +1950,6 @@ enum PlayerProp
|
||||
Player_NewmenuPage, //int
|
||||
};
|
||||
|
||||
enum LibType
|
||||
{
|
||||
LibType_Library,
|
||||
LibType_Class
|
||||
};
|
||||
|
||||
typedef void (*AUTHORIZEFUNC)(int player, const char *authstring);
|
||||
|
||||
typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/);
|
||||
typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...);
|
||||
typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...);
|
||||
@ -2173,14 +2026,7 @@ typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||
typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/);
|
||||
typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/);
|
||||
typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */);
|
||||
typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC);
|
||||
typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC);
|
||||
typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/);
|
||||
typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/);
|
||||
typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/);
|
||||
typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/);
|
||||
typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/);
|
||||
typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char */*name */);
|
||||
|
||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||
@ -2246,13 +2092,6 @@ extern PFN_REQ_FNPTR g_fn_RequestFunction;
|
||||
extern PFN_AMX_PUSH g_fn_AmxPush;
|
||||
extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo;
|
||||
extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr;
|
||||
extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc;
|
||||
extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc;
|
||||
extern PFN_FINDLIBRARY g_fn_FindLibrary;
|
||||
extern PFN_ADDLIBRARIES g_fn_AddLibraries;
|
||||
extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries;
|
||||
extern PFN_OVERRIDENATIVES g_fn_OverrideNatives;
|
||||
extern PFN_GETLOCALINFO g_fn_GetLocalInfo;
|
||||
|
||||
#ifdef MAY_NEVER_BE_DEFINED
|
||||
// Function prototypes for intellisense and similar systems
|
||||
@ -2315,13 +2154,6 @@ int MF_AmxPush (AMX *amx, cell *params) { }
|
||||
int MF_AmxExec (AMX *amx, cell *retval, int idx) { }
|
||||
int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { }
|
||||
void * MF_PlayerPropAddr (int id, int prop) { }
|
||||
void MF_RegAuthFunc (AUTHORIZEFUNC fn) { }
|
||||
void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { }
|
||||
int MF_FindLibrary (const char *name, LibType type) { }
|
||||
size_t MF_AddLibraries (const char *name, LibType type, void *parent) { }
|
||||
size_t MF_RemoveLibraries (void *parent) { }
|
||||
void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { }
|
||||
const char * MF_GetLocalInfo (const char *name, const char *def) { }
|
||||
#endif // MAY_NEVER_BE_DEFINED
|
||||
|
||||
#define MF_AddNatives g_fn_AddNatives
|
||||
@ -2385,17 +2217,10 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...);
|
||||
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||
#define MF_Format g_fn_Format
|
||||
#define MF_RegisterFunction g_fn_RegisterFunction
|
||||
#define MF_RequestFunction g_fn_RequestFunction
|
||||
#define MF_RequestFunction g_fn_RequestFunction;
|
||||
#define MF_AmxPush g_fn_AmxPush
|
||||
#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo
|
||||
#define MF_PlayerPropAddr g_fn_PlayerPropAddr
|
||||
#define MF_RegAuthFunc g_fn_RegAuthFunc
|
||||
#define MF_UnregAuthFunc g_fn_UnregAuthFunc
|
||||
#define MF_FindLibrary g_fn_FindLibrary
|
||||
#define MF_AddLibraries g_fn_AddLibraries
|
||||
#define MF_RemoveLibraries g_fn_RemoveLibraries
|
||||
#define MF_OverrideNatives g_fn_OverrideNatives
|
||||
#define MF_GetLocalInfo g_fn_GetLocalInfo
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
/*** Memory ***/
|
||||
|
@ -140,7 +140,8 @@ static cell AMX_NATIVE_CALL cs_set_user_deaths(AMX *amx, cell *params) // cs_set
|
||||
WRITE_SHORT(*((int *)pPlayer->pvPrivateData + OFFSET_TEAM)); // should these be byte?
|
||||
MESSAGE_END();
|
||||
|
||||
*static_cast<int *>(MF_PlayerPropAddr(params[1], Player_Deaths)) = params[2];
|
||||
int *deaths = static_cast<int *>(MF_PlayerPropAddr(params[1], Player_Deaths));
|
||||
*deaths = params[2];
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -413,13 +414,11 @@ static cell AMX_NATIVE_CALL cs_get_user_vip(AMX *amx, cell *params) // cs_get_us
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL cs_set_user_vip(AMX *amx, cell *params) // cs_set_user_vip(index, vip = 1, model = 1, scoreboard = 1); = 4 params
|
||||
static cell AMX_NATIVE_CALL cs_set_user_vip(AMX *amx, cell *params) // cs_set_user_vip(index, vip = 1); = 2 params
|
||||
{
|
||||
// Set user vip
|
||||
// params[1] = user index
|
||||
// params[2] = if 1, activate vip, else deactivate vip.
|
||||
// params[3] = if 1, update model
|
||||
// params[4] = if 1, update scoreboard with vip information
|
||||
|
||||
// Valid entity should be within range
|
||||
CHECK_PLAYER(params[1]);
|
||||
@ -427,72 +426,42 @@ static cell AMX_NATIVE_CALL cs_set_user_vip(AMX *amx, cell *params) // cs_set_us
|
||||
// Make into edict pointer
|
||||
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||
|
||||
bool updateModel, updateScoreboard;
|
||||
|
||||
// Backwards compatibility with older version of native that only took two params
|
||||
if (params[0] / sizeof(cell) == 2)
|
||||
{
|
||||
updateModel = true;
|
||||
updateScoreboard = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
updateModel = (params[3] == 1);
|
||||
updateScoreboard = (params[4] == 1);
|
||||
}
|
||||
|
||||
if (params[2] == 1)
|
||||
{
|
||||
if (params[2] == 1) {
|
||||
// Set to "be" vip.
|
||||
*((int *)pPlayer->pvPrivateData + OFFSET_VIP) |= PLAYER_IS_VIP;
|
||||
|
||||
if (updateModel)
|
||||
{
|
||||
// Set vip model
|
||||
*((int *)pPlayer->pvPrivateData + OFFSET_INTERNALMODEL) = CS_CT_VIP;
|
||||
// This makes the model get updated right away.
|
||||
MDLL_ClientUserInfoChanged(pPlayer, GETINFOKEYBUFFER(pPlayer)); // If this causes any problems for WON, do this line only in STEAM builds.
|
||||
}
|
||||
// Set vip model
|
||||
*((int *)pPlayer->pvPrivateData + OFFSET_INTERNALMODEL) = CS_CT_VIP;
|
||||
// This makes the model get updated right away.
|
||||
MDLL_ClientUserInfoChanged(pPlayer, GETINFOKEYBUFFER(pPlayer)); // If this causes any problems for WON, do this line only in STEAM builds.
|
||||
|
||||
if (updateScoreboard)
|
||||
{
|
||||
// Set VIP on scoreboard. Probably doesn't work for terrorist team.
|
||||
MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "ScoreAttrib", NULL));
|
||||
WRITE_BYTE(params[1]);
|
||||
WRITE_BYTE(SCOREATTRIB_VIP);
|
||||
MESSAGE_END();
|
||||
}
|
||||
// Set VIP on scoreboard. Probably doesn't work for terrorist team.
|
||||
MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "ScoreAttrib", NULL));
|
||||
WRITE_BYTE(params[1]);
|
||||
WRITE_BYTE(SCOREATTRIB_VIP);
|
||||
MESSAGE_END();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Set to not be vip.
|
||||
*((int *)pPlayer->pvPrivateData + OFFSET_VIP) &= ~PLAYER_IS_VIP;
|
||||
|
||||
if (updateModel)
|
||||
{
|
||||
// Set a random CT model.
|
||||
CS_Internal_Models CTmodels[4] = {CS_CT_URBAN, CS_CT_GSG9, CS_CT_GIGN, CS_CT_SAS};
|
||||
CS_Internal_Models ct_model = CTmodels[RANDOM_LONG(0, 3)];
|
||||
*((int *)pPlayer->pvPrivateData + OFFSET_INTERNALMODEL) = ct_model;
|
||||
// This makes the model get updated right away.
|
||||
MDLL_ClientUserInfoChanged(pPlayer, GETINFOKEYBUFFER(pPlayer)); // If this causes any problems for WON, do this line only in STEAM builds.
|
||||
}
|
||||
// Set a random CT model.
|
||||
CS_Internal_Models CTmodels[4] = {CS_CT_URBAN, CS_CT_GSG9, CS_CT_GIGN, CS_CT_SAS};
|
||||
CS_Internal_Models ct_model = CTmodels[RANDOM_LONG(0, 3)];
|
||||
*((int *)pPlayer->pvPrivateData + OFFSET_INTERNALMODEL) = ct_model;
|
||||
// This makes the model get updated right away.
|
||||
MDLL_ClientUserInfoChanged(pPlayer, GETINFOKEYBUFFER(pPlayer)); // If this causes any problems for WON, do this line only in STEAM builds.
|
||||
|
||||
if (updateScoreboard)
|
||||
{
|
||||
// Set nothing/dead on scoreboard.
|
||||
int scoreattrib;
|
||||
|
||||
if (pPlayer->v.deadflag == DEAD_NO && pPlayer->v.health > 0)
|
||||
scoreattrib = SCOREATTRIB_NOTHING; // cts can't have bombs anyway
|
||||
else
|
||||
scoreattrib = SCOREATTRIB_DEAD;
|
||||
|
||||
MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "ScoreAttrib", NULL));
|
||||
WRITE_BYTE(params[1]);
|
||||
WRITE_BYTE(scoreattrib);
|
||||
MESSAGE_END();
|
||||
}
|
||||
// Set nothing/dead on scoreboard.
|
||||
int scoreattrib;
|
||||
if (pPlayer->v.deadflag == DEAD_NO && pPlayer->v.health > 0)
|
||||
scoreattrib = SCOREATTRIB_NOTHING; // cts can't have bombs anyway
|
||||
else
|
||||
scoreattrib = SCOREATTRIB_DEAD;
|
||||
MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "ScoreAttrib", NULL));
|
||||
WRITE_BYTE(params[1]);
|
||||
WRITE_BYTE(scoreattrib);
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -579,29 +548,10 @@ static cell AMX_NATIVE_CALL cs_get_user_inside_buyzone(AMX *amx, cell *params) /
|
||||
|
||||
// Make into edict pointer
|
||||
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||
|
||||
// This offset is 0 when outside, 1 when inside.
|
||||
if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_MAPZONE) & PLAYER_IN_BUYZONE)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
return (int)*((int *)pPlayer->pvPrivateData + OFFSET_BUYZONE); // This offset is 0 when outside, 1 when inside.
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL cs_get_user_mapzones(AMX *amx, cell *params) // cs_get_user_mapzones(index); = 1 param
|
||||
{
|
||||
// Is user inside a special zone?
|
||||
// params[1] = user index
|
||||
|
||||
// Valid entity should be within range
|
||||
CHECK_PLAYER(params[1]);
|
||||
|
||||
// Make into edict pointer
|
||||
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||
|
||||
return (int)*((int *)pPlayer->pvPrivateData + OFFSET_MAPZONE);
|
||||
}
|
||||
|
||||
|
||||
static cell AMX_NATIVE_CALL cs_get_user_plant(AMX *amx, cell *params) // cs_get_user_plant(index); = 1 param
|
||||
{
|
||||
// Can user plant a bomb if he has one?
|
||||
@ -1407,87 +1357,6 @@ static cell AMX_NATIVE_CALL cs_set_armoury_type(AMX *amx, cell *params)
|
||||
#endif
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL cs_set_user_zoom(AMX *amx, cell *params)
|
||||
{
|
||||
// Set the weapon zoom type of a user
|
||||
// params[1] = user index
|
||||
// params[2] = zoom type
|
||||
// params[3] = mode (0=blocking mode, 1=player will loose the zoom set by changing weapon)
|
||||
|
||||
int index = params[1];
|
||||
// Check index
|
||||
CHECK_PLAYER(index);
|
||||
|
||||
int value, type = params[2];
|
||||
int curweap = *static_cast<int *>(MF_PlayerPropAddr(index, Player_CurrentWeapon));
|
||||
|
||||
// Fetch player pointer
|
||||
edict_t *pPlayer = MF_GetPlayerEdict(index);
|
||||
// Reset any previous zooming
|
||||
g_zooming[index] = 0;
|
||||
|
||||
if (type == CS_RESET_ZOOM)
|
||||
{
|
||||
*((int *)pPlayer->pvPrivateData + OFFSET_ZOOMTYPE) = CS_NO_ZOOM;
|
||||
return 1;
|
||||
}
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case CS_SET_NO_ZOOM:
|
||||
value = CS_NO_ZOOM;
|
||||
break;
|
||||
case CS_SET_FIRST_ZOOM:
|
||||
value = CS_FIRST_ZOOM;
|
||||
break;
|
||||
case CS_SET_SECOND_ZOOM:
|
||||
if (curweap == CSW_G3SG1 || curweap == CSW_SG550 || curweap == CSW_SCOUT)
|
||||
value = CS_SECOND_NONAWP_ZOOM;
|
||||
else
|
||||
value = CS_SECOND_AWP_ZOOM;
|
||||
break;
|
||||
case CS_SET_AUGSG552_ZOOM:
|
||||
value = CS_AUGSG552_ZOOM;
|
||||
break;
|
||||
default:
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid zoom type %d", type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!params[3])
|
||||
g_zooming[index] = value;
|
||||
*((int *)pPlayer->pvPrivateData + OFFSET_ZOOMTYPE) = value;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL cs_get_user_zoom(AMX *amx, cell *params)
|
||||
{
|
||||
// Returns the zoom type of a player
|
||||
// params[1] = user id
|
||||
|
||||
// Check Player
|
||||
CHECK_PLAYER(params[1]);
|
||||
// Fetch player pointer
|
||||
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||
int value = *((int *)pPlayer->pvPrivateData + OFFSET_ZOOMTYPE);
|
||||
|
||||
switch (value)
|
||||
{
|
||||
case CS_NO_ZOOM:
|
||||
return CS_SET_NO_ZOOM;
|
||||
case CS_FIRST_ZOOM:
|
||||
return CS_SET_FIRST_ZOOM;
|
||||
case CS_SECOND_AWP_ZOOM:
|
||||
case CS_SECOND_NONAWP_ZOOM:
|
||||
return CS_SET_SECOND_ZOOM;
|
||||
case CS_AUGSG552_ZOOM:
|
||||
return CS_SET_AUGSG552_ZOOM;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO cstrike_Exports[] = {
|
||||
{"cs_set_user_money", cs_set_user_money},
|
||||
{"cs_get_user_money", cs_get_user_money},
|
||||
@ -1503,7 +1372,6 @@ AMX_NATIVE_INFO cstrike_Exports[] = {
|
||||
{"cs_get_user_team", cs_get_user_team},
|
||||
{"cs_set_user_team", cs_set_user_team},
|
||||
{"cs_get_user_buyzone", cs_get_user_inside_buyzone},
|
||||
{"cs_get_user_mapzones", cs_get_user_mapzones},
|
||||
{"cs_get_user_plant", cs_get_user_plant},
|
||||
{"cs_set_user_plant", cs_set_user_plant},
|
||||
{"cs_get_user_defuse", cs_get_user_defusekit},
|
||||
@ -1533,8 +1401,6 @@ AMX_NATIVE_INFO cstrike_Exports[] = {
|
||||
{"cs_user_spawn", cs_user_spawn},
|
||||
{"cs_get_armoury_type", cs_get_armoury_type},
|
||||
{"cs_set_armoury_type", cs_set_armoury_type},
|
||||
{"cs_get_user_zoom", cs_get_user_zoom},
|
||||
{"cs_set_user_zoom", cs_set_user_zoom},
|
||||
//------------------- <-- max 19 characters!
|
||||
{NULL, NULL}
|
||||
};
|
||||
@ -1563,8 +1429,6 @@ void MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed)
|
||||
// Reset player model a short while (MODELRESETTIME) after this if they are using an edited model.
|
||||
if(msg_type == GET_USER_MSG_ID(PLID, "ResetHUD", NULL)) {
|
||||
int entityIndex = ENTINDEX(ed);
|
||||
if (g_zooming[entityIndex])
|
||||
g_zooming[entityIndex] = 0;
|
||||
if(g_players[entityIndex].GetModelled())
|
||||
g_players[entityIndex].SetInspectModel(true);
|
||||
//g_players[ENTINDEX(ed)].SetTime(gpGlobals->time + MODELRESETTIME);
|
||||
@ -1578,7 +1442,6 @@ void MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed)
|
||||
void ClientDisconnect(edict_t *pEntity) {
|
||||
int index = ENTINDEX(pEntity);
|
||||
g_players[index].SetModelled(false);
|
||||
g_zooming[index] = 0;
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
@ -1606,16 +1469,7 @@ void PlayerPostThink(edict_t* pPlayer) {
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void PlayerPreThink(edict_t *pPlayer)
|
||||
{
|
||||
int entityIndex = ENTINDEX(pPlayer);
|
||||
if (g_zooming[entityIndex])
|
||||
{
|
||||
*((int *)pPlayer->pvPrivateData + OFFSET_ZOOMTYPE) = g_zooming[entityIndex];
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void OnAmxxAttach()
|
||||
{
|
||||
|
@ -74,10 +74,9 @@
|
||||
#define OFFSET_DEFUSE_PLANT 193 + EXTRAOFFSET
|
||||
#define OFFSET_VIP 209 + EXTRAOFFSET
|
||||
#define OFFSET_TK 216 + EXTRAOFFSET // 040926
|
||||
#define OFFSET_MAPZONE 235 + EXTRAOFFSET
|
||||
#define OFFSET_BUYZONE 235 + EXTRAOFFSET
|
||||
#define OFFSET_ISDRIVING 350 + EXTRAOFFSET // 040926
|
||||
#define OFFSET_STATIONARY 362 + EXTRAOFFSET // 040927 (363 works also!)
|
||||
#define OFFSET_ZOOMTYPE 363 + EXTRAOFFSET
|
||||
|
||||
#define OFFSET_AWM_AMMO 377 + EXTRAOFFSET // 041029: All of these *_AMMO:s were changed -5
|
||||
#define OFFSET_SCOUT_AMMO 378 + EXTRAOFFSET
|
||||
@ -116,10 +115,9 @@
|
||||
#define OFFSET_DEFUSE_PLANT 219 + EXTRAOFFSET // +26
|
||||
#define OFFSET_VIP 242 + EXTRAOFFSET // +27
|
||||
#define OFFSET_TK 249 + EXTRAOFFSET // +33 040927
|
||||
#define OFFSET_MAPZONE 268 + EXTRAOFFSET // +27
|
||||
#define OFFSET_BUYZONE 268 + EXTRAOFFSET // +27
|
||||
#define OFFSET_ISDRIVING 386 + EXTRAOFFSET // 040927
|
||||
#define OFFSET_STATIONARY 400 + EXTRAOFFSET // 040927 (401 works also)
|
||||
#define OFFSET_ZOOMTYPE 402 + EXTRAOFFSET
|
||||
|
||||
#define OFFSET_AWM_AMMO 426 + EXTRAOFFSET // +44
|
||||
#define OFFSET_SCOUT_AMMO 427 + EXTRAOFFSET // +44
|
||||
@ -216,8 +214,6 @@
|
||||
|
||||
#define PLAYER_IS_VIP (1<<8)
|
||||
|
||||
#define PLAYER_IN_BUYZONE (1<<0)
|
||||
|
||||
#define TEAM_UNASSIGNED 0
|
||||
#define TEAM_T 1
|
||||
#define TEAM_CT 2
|
||||
@ -244,12 +240,6 @@
|
||||
#define CS_ARMOR_KEVLAR 1
|
||||
#define CS_ARMOR_ASSAULTSUIT 2
|
||||
|
||||
#define CS_FIRST_ZOOM 0x28
|
||||
#define CS_SECOND_AWP_ZOOM 0xA
|
||||
#define CS_SECOND_NONAWP_ZOOM 0xF
|
||||
#define CS_AUGSG552_ZOOM 0x37
|
||||
#define CS_NO_ZOOM 0x5A
|
||||
|
||||
enum CS_Internal_Models {
|
||||
CS_DONTCHANGE = 0,
|
||||
CS_CT_URBAN = 1,
|
||||
@ -262,19 +252,9 @@ enum CS_Internal_Models {
|
||||
CS_T_GUERILLA = 8,
|
||||
CS_CT_VIP = 9
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CS_RESET_ZOOM = 0,
|
||||
CS_SET_NO_ZOOM,
|
||||
CS_SET_FIRST_ZOOM,
|
||||
CS_SET_SECOND_ZOOM,
|
||||
CS_SET_AUGSG552_ZOOM,
|
||||
};
|
||||
// cstrike-specific defines above
|
||||
|
||||
CCstrikePlayer g_players[33];
|
||||
int g_zooming[33] = {0};
|
||||
bool g_precachedknife = false;
|
||||
bool g_noknives = false;
|
||||
// Globals above
|
||||
|
@ -5,12 +5,10 @@
|
||||
|
||||
// Module info
|
||||
#define MODULE_NAME "CStrike"
|
||||
#define MODULE_VERSION "1.75"
|
||||
#define MODULE_VERSION "1.71"
|
||||
#define MODULE_AUTHOR "AMX Mod X Dev Team"
|
||||
#define MODULE_URL "http://www.amxmodx.org"
|
||||
#define MODULE_LOGTAG "CSTRIKE"
|
||||
#define MODULE_LIBRARY "cstrike"
|
||||
#define MODULE_LIBCLASS ""
|
||||
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
|
||||
#define MODULE_RELOAD_ON_MAPCHANGE
|
||||
|
||||
@ -23,46 +21,18 @@
|
||||
// metamod plugin?
|
||||
#define USE_METAMOD
|
||||
|
||||
// use memory manager/tester?
|
||||
// note that if you use this, you cannot construct/allocate
|
||||
// anything before the module attached (OnAmxxAttach).
|
||||
// be careful of default constructors using new/malloc!
|
||||
// #define MEMORY_TEST
|
||||
|
||||
// Unless you use STL or exceptions, keep this commented.
|
||||
// It allows you to compile without libstdc++.so as a dependency
|
||||
// #define NO_ALLOC_OVERRIDES
|
||||
|
||||
// Uncomment this if you are using MSVC8 or greater and want to fix some of the compatibility issues yourself
|
||||
// #define NO_MSVC8_AUTO_COMPAT
|
||||
|
||||
/**
|
||||
* AMXX Init functions
|
||||
* Also consider using FN_META_*
|
||||
*/
|
||||
|
||||
/** AMXX query */
|
||||
// - AMXX Init functions
|
||||
// Also consider using FN_META_*
|
||||
// AMXX query
|
||||
//#define FN_AMXX_QUERY OnAmxxQuery
|
||||
|
||||
/** AMXX attach
|
||||
* Do native functions init here (MF_AddNatives)
|
||||
*/
|
||||
// AMXX attach
|
||||
// Do native functions init here (MF_AddNatives)
|
||||
#define FN_AMXX_ATTACH OnAmxxAttach
|
||||
|
||||
/** AMXX Detach (unload) */
|
||||
//#define FN_AMXX_DETACH OnAmxxDetach
|
||||
|
||||
/** All plugins loaded
|
||||
* Do forward functions init here (MF_RegisterForward)
|
||||
*/
|
||||
//#define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||
|
||||
/** All plugins are about to be unloaded */
|
||||
//#define FN_AMXX_PLUGINSUNLOADING OnPluginsUnloading
|
||||
|
||||
/** All plugins are now unloaded */
|
||||
//#define FN_AMXX_PLUGINSUNLOADED OnPluginsUnloaded
|
||||
|
||||
// AMXX dettach
|
||||
//#define FN_AMXX_DETTACH OnAmxxDettach
|
||||
// All plugins loaded
|
||||
// Do forward functions init here (MF_RegisterForward)
|
||||
// #define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||
|
||||
/**** METAMOD ****/
|
||||
// If your module doesn't use metamod, you may close the file now :)
|
||||
@ -78,8 +48,8 @@
|
||||
//#define FN_META_QUERY OnMetaQuery
|
||||
// Meta attach
|
||||
//#define FN_META_ATTACH OnMetaAttach
|
||||
// Meta detach
|
||||
//#define FN_META_DETACH OnMetaDetach
|
||||
// Meta dettach
|
||||
//#define FN_META_DETTACH OnMetaDettach
|
||||
|
||||
// (wd) are Will Day's notes
|
||||
// - GetEntityAPI2 functions
|
||||
@ -99,15 +69,15 @@
|
||||
// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */
|
||||
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
||||
// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
||||
#define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||
#define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||
// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
||||
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||
#define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||
// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||
#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
#define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||
#define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||
#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||
#define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||
// #define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
||||
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
||||
@ -490,3 +460,4 @@
|
||||
#endif // USE_METAMOD
|
||||
|
||||
#endif // __MODULECONFIG_H__
|
||||
|
||||
|
@ -1,307 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="cstrike"
|
||||
ProjectGUID="{AB148B92-4F47-42E6-8268-AB4E588EC6A2}"
|
||||
RootNamespace="cstrike"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Debug/cstrike.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
RuntimeTypeInfo="false"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\Debug/cstrike.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1053"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="Debug/cstrike_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/cstrike_amx_debug.pdb"
|
||||
ImportLibrary=".\Debug/cstrike_amx_debug.lib"
|
||||
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=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Release/cstrike.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
RuntimeTypeInfo="false"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\Release/cstrike.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1053"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="Release/cstrike_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ModuleDefinitionFile=""
|
||||
ProgramDatabaseFile=".\Release/cstrike_amx.pdb"
|
||||
ImportLibrary=".\Release/cstrike_amx.lib"
|
||||
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;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\cstrike.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;CSTRIKE_EXPORTS;$(NoInherit)"
|
||||
BasicRuntimeChecks="3"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;CSTRIKE_EXPORTS;$(NoInherit)"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CstrikePlayer.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;CSTRIKE_EXPORTS;$(NoInherit)"
|
||||
BasicRuntimeChecks="3"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;CSTRIKE_EXPORTS;$(NoInherit)"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\cstrike.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CstrikePlayer.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="AMXX module"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\amxxmodule.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\amxxmodule.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\moduleconfig.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="..\..\plugins\include\cstrike.inc"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -9,17 +9,14 @@ MM_ROOT = ../../../metamod/metamod
|
||||
OPT_FLAGS = -O3 -funroll-loops -s -pipe -fomit-frame-pointer
|
||||
DEBUG_FLAGS = -g -ggdb3
|
||||
CPP = gcc
|
||||
NAME = csx
|
||||
|
||||
BIN_SUFFIX_32 = amxx_i386.so
|
||||
BIN_SUFFIX_64 = amxx_amd64.so
|
||||
NAME = csx_amxx
|
||||
|
||||
OBJECTS = amxxmodule.cpp CRank.cpp CMisc.cpp meta_api.cpp rank.cpp usermsg.cpp
|
||||
|
||||
LINK =
|
||||
|
||||
INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \
|
||||
-I$(MM_ROOT) -I$(HLSDK)/common
|
||||
-I$(MM_ROOT) -Lzlib -I$(HLSDK)/common
|
||||
|
||||
ifeq "$(DEBUG)" "true"
|
||||
BIN_DIR = Debug
|
||||
@ -32,10 +29,10 @@ endif
|
||||
CFLAGS += -DNDEBUG -fPIC -Wno-deprecated -fno-exceptions -DHAVE_STDINT_H -static-libgcc -fno-rtti
|
||||
|
||||
ifeq "$(AMD64)" "true"
|
||||
BINARY = $(NAME)_$(BIN_SUFFIX_64)
|
||||
BINARY = $(NAME)_amd64.so
|
||||
CFLAGS += -DPAWN_CELL_SIZE=64 -DHAVE_I64 -m64
|
||||
else
|
||||
BINARY = $(NAME)_$(BIN_SUFFIX_32)
|
||||
BINARY = $(NAME)_i386.so
|
||||
CFLAGS += -DPAWN_CELL_SIZE=32 -DJIT -DASM32
|
||||
OPT_FLAGS += -march=i586
|
||||
endif
|
||||
@ -62,8 +59,7 @@ default: all
|
||||
|
||||
clean:
|
||||
rm -rf Release/*.o
|
||||
rm -rf Release/$(NAME)_$(BIN_SUFFIX_32)
|
||||
rm -rf Release/$(NAME)_$(BIN_SUFFIX_64)
|
||||
rm -rf Release/$(BINARY)
|
||||
rm -rf Debug/*.o
|
||||
rm -rf Debug/$(NAME)_$(BIN_SUFFIX_32)
|
||||
rm -rf Debug/$(NAME)_$(BIN_SUFFIX_64)
|
||||
rm -rf Debug/$(BINARY)
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
//#include "amxxmodule.h"
|
||||
#include "CRank.h"
|
||||
#include <stdio.h>
|
||||
//#include "rank.h"
|
||||
|
||||
// *****************************************************
|
||||
// class Stats
|
||||
@ -53,7 +55,7 @@ RankSystem::RankStats::~RankStats() {
|
||||
|
||||
void RankSystem::RankStats::setName( const char* nn ) {
|
||||
delete[] name;
|
||||
namelen = (short)strlen(nn) + 1;
|
||||
namelen = strlen(nn) + 1;
|
||||
name = new char[namelen];
|
||||
if ( name )
|
||||
strcpy( name , nn );
|
||||
@ -63,7 +65,7 @@ void RankSystem::RankStats::setName( const char* nn ) {
|
||||
|
||||
void RankSystem::RankStats::setUnique( const char* nn ) {
|
||||
delete[] unique;
|
||||
uniquelen = (short)strlen(nn) + 1;
|
||||
uniquelen = strlen(nn) + 1;
|
||||
unique = new char[uniquelen];
|
||||
if ( unique )
|
||||
strcpy( unique , nn );
|
||||
|
53
dlls/csx/source/WinCSX/ReadMe.txt
Executable file
53
dlls/csx/source/WinCSX/ReadMe.txt
Executable file
@ -0,0 +1,53 @@
|
||||
========================================================================
|
||||
WIN32 APPLICATION : WinCSX Project Overview
|
||||
========================================================================
|
||||
|
||||
AppWizard has created this WinCSX application for you.
|
||||
This file contains a summary of what you will find in each of the files that
|
||||
make up your WinCSX application.
|
||||
|
||||
|
||||
WinCSX.vcproj
|
||||
This is the main project file for VC++ projects generated using an Application Wizard.
|
||||
It contains information about the version of Visual C++ that generated the file, and
|
||||
information about the platforms, configurations, and project features selected with the
|
||||
Application Wizard.
|
||||
|
||||
WinCSX.cpp
|
||||
This is the main application source file.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
AppWizard has created the following resources:
|
||||
|
||||
WinCSX.rc
|
||||
This is a listing of all of the Microsoft Windows resources that the
|
||||
program uses. It includes the icons, bitmaps, and cursors that are stored
|
||||
in the RES subdirectory. This file can be directly edited in Microsoft
|
||||
Visual C++.
|
||||
|
||||
Resource.h
|
||||
This is the standard header file, which defines new resource IDs.
|
||||
Microsoft Visual C++ reads and updates this file.
|
||||
WinCSX.ico
|
||||
This is an icon file, which is used as the application's icon (32x32).
|
||||
This icon is included by the main resource file WinCSX.rc.
|
||||
|
||||
small.ico
|
||||
This is an icon file, which contains a smaller version (16x16)
|
||||
of the application's icon. This icon is included by the main resource
|
||||
file WinCSX.rc.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other standard files:
|
||||
|
||||
StdAfx.h, StdAfx.cpp
|
||||
These files are used to build a precompiled header (PCH) file
|
||||
named WinCSX.pch and a precompiled types file named StdAfx.obj.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other notes:
|
||||
|
||||
AppWizard uses "TODO:" comments to indicate parts of the source code you
|
||||
should add to or customize.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
@ -3,17 +3,16 @@
|
||||
// Used by WinCSX.rc
|
||||
//
|
||||
#define IDC_MYICON 2
|
||||
#define IDM_VISUALSTYLES 1
|
||||
#define IDD_WINCSX_DIALOG 102
|
||||
#define IDS_APP_TITLE 103
|
||||
#define IDD_WINCSXBOX 103
|
||||
#define IDM_ABOUT 104
|
||||
#define IDM_EXIT 105
|
||||
#define IDI_WINCSX 107
|
||||
#define IDI_SMALL 108
|
||||
#define IDC_WINCSX 109
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_ABOUTBOX 129
|
||||
#define IDR_241 132
|
||||
#define IDC_LIST 1010
|
||||
#define IDC_BUTTON_ABOUT 1029
|
||||
#define IDC_ABOUT 1029
|
||||
@ -37,6 +36,7 @@
|
||||
#define IDC_AUTHOR 1114
|
||||
#define ID_HELP_DIALOG 32771
|
||||
#define IDM_FILE_DIALOG 32773
|
||||
#define IDM_WINCSX 32774
|
||||
#define IDC_STATIC -1
|
||||
|
||||
// Next default values for new objects
|
||||
@ -44,7 +44,7 @@
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 133
|
||||
#define _APS_NEXT_RESOURCE_VALUE 131
|
||||
#define _APS_NEXT_COMMAND_VALUE 32775
|
||||
#define _APS_NEXT_CONTROL_VALUE 1033
|
||||
#define _APS_NEXT_SYMED_VALUE 110
|
||||
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="x86" />
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
</assembly>
|
@ -15,11 +15,11 @@
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Neutral resources
|
||||
// Swedish resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
@ -33,6 +33,33 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
IDI_WINCSX ICON "WinCSX.ico"
|
||||
IDI_SMALL ICON "small.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDC_WINCSX MENU
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "WinCSX", IDM_WINCSX
|
||||
MENUITEM "E&xit", IDM_EXIT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Accelerator
|
||||
//
|
||||
|
||||
IDC_WINCSX ACCELERATORS
|
||||
BEGIN
|
||||
"?", IDM_ABOUT, ASCII, ALT
|
||||
"/", IDM_ABOUT, ASCII, ALT
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
@ -89,13 +116,41 @@ CAPTION "About"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,109,68,50,14
|
||||
LTEXT "WinCSX 0.4",IDC_STATIC,18,20,66,8
|
||||
LTEXT "WinCSX 0.3",IDC_STATIC,18,20,66,8
|
||||
LTEXT "By JGHG",IDC_STATIC,18,28,66,8
|
||||
LTEXT "2005",IDC_STATIC,18,36,66,8
|
||||
LTEXT "http://www.amxmodx.org/",IDC_STATIC,18,44,88,8
|
||||
END
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""windows.h""\r\n"
|
||||
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
@ -133,13 +188,6 @@ END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 24
|
||||
//
|
||||
|
||||
IDM_VISUALSTYLES 24 "WinCSX.exe.manifest"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
@ -151,46 +199,6 @@ BEGIN
|
||||
IDC_WINCSX "WINCSX"
|
||||
END
|
||||
|
||||
#endif // Neutral resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Swedish resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""windows.h""\r\n"
|
||||
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // Swedish resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
Version="7.10"
|
||||
Name="WinCSX"
|
||||
ProjectGUID="{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}"
|
||||
RootNamespace="WinCSX"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
@ -153,9 +152,6 @@
|
||||
<File
|
||||
RelativePath=".\small.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\WinCSX.exe.manifest">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\WinCSX.ico">
|
||||
</File>
|
||||
@ -166,6 +162,9 @@
|
||||
<Filter
|
||||
Name="Dependencies"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath=".\amxxmodule.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\amxxmodule.h">
|
||||
</File>
|
||||
@ -179,6 +178,9 @@
|
||||
RelativePath=".\moduleconfig.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\ReadMe.txt">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
@ -32,6 +32,8 @@
|
||||
* Description: AMX Mod X Module Interface Functions
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <new>
|
||||
#include <stdarg.h>
|
||||
@ -45,6 +47,8 @@
|
||||
enginefuncs_t g_engfuncs;
|
||||
globalvars_t *gpGlobals;
|
||||
|
||||
|
||||
|
||||
DLL_FUNCTIONS *g_pFunctionTable;
|
||||
DLL_FUNCTIONS *g_pFunctionTable_Post;
|
||||
enginefuncs_t *g_pengfuncsTable;
|
||||
@ -52,6 +56,7 @@ enginefuncs_t *g_pengfuncsTable_Post;
|
||||
NEW_DLL_FUNCTIONS *g_pNewFunctionsTable;
|
||||
NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post;
|
||||
|
||||
|
||||
// GetEntityAPI2 functions
|
||||
static DLL_FUNCTIONS g_EntityAPI_Table =
|
||||
{
|
||||
@ -2293,6 +2298,11 @@ C_DLLEXPORT int Meta_Query(char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_
|
||||
|
||||
C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs)
|
||||
{
|
||||
if ( gpGamedllFuncs ){
|
||||
LOG_ERROR(PLID,"gpGamedllFuncs already set");
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
if(now > Plugin_info.loadable) {
|
||||
LOG_ERROR(PLID, "Can't load module right now");
|
||||
return(FALSE);
|
||||
@ -2418,6 +2428,9 @@ C_DLLEXPORT void __stdcall GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine,
|
||||
|
||||
/************* AMXX Stuff *************/
|
||||
|
||||
// *** Types ***
|
||||
typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/);
|
||||
|
||||
// *** Globals ***
|
||||
// Module info
|
||||
static amxx_module_info_s g_ModuleInfo =
|
||||
@ -2426,19 +2439,15 @@ static amxx_module_info_s g_ModuleInfo =
|
||||
MODULE_AUTHOR,
|
||||
MODULE_VERSION,
|
||||
#ifdef MODULE_RELOAD_ON_MAPCHANGE
|
||||
1,
|
||||
1
|
||||
#else // MODULE_RELOAD_ON_MAPCHANGE
|
||||
0,
|
||||
0
|
||||
#endif // MODULE_RELOAD_ON_MAPCHANGE
|
||||
MODULE_LOGTAG,
|
||||
MODULE_LIBRARY,
|
||||
MODULE_LIBCLASS
|
||||
};
|
||||
|
||||
// Storage for the requested functions
|
||||
PFN_ADD_NATIVES g_fn_AddNatives;
|
||||
PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||
PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR;
|
||||
PFN_GET_AMXADDR g_fn_GetAmxAddr;
|
||||
PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole;
|
||||
PFN_GET_MODNAME g_fn_GetModname;
|
||||
@ -2480,11 +2489,9 @@ PFN_IS_PLAYER_CONNECTING g_fn_IsPlayerConnecting;
|
||||
PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV;
|
||||
PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor;
|
||||
PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth;
|
||||
#ifdef MEMORY_TEST
|
||||
PFN_ALLOCATOR g_fn_Allocator;
|
||||
PFN_REALLOCATOR g_fn_Reallocator;
|
||||
PFN_DEALLOCATOR g_fn_Deallocator;
|
||||
#endif
|
||||
PFN_AMX_EXEC g_fn_AmxExec;
|
||||
PFN_AMX_EXECV g_fn_AmxExecv;
|
||||
PFN_AMX_ALLOT g_fn_AmxAllot;
|
||||
@ -2501,20 +2508,6 @@ PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||
PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||
PFN_FORMAT g_fn_Format;
|
||||
PFN_REGISTERFUNCTION g_fn_RegisterFunction;
|
||||
PFN_REQ_FNPTR g_fn_RequestFunction;
|
||||
PFN_AMX_PUSH g_fn_AmxPush;
|
||||
PFN_SET_TEAM_INFO g_fn_SetTeamInfo;
|
||||
PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr;
|
||||
PFN_REG_AUTH_FUNC g_fn_RegAuthFunc;
|
||||
PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc;
|
||||
PFN_FINDLIBRARY g_fn_FindLibrary;
|
||||
PFN_ADDLIBRARIES g_fn_AddLibraries;
|
||||
PFN_REMOVELIBRARIES g_fn_RemoveLibraries;
|
||||
PFN_OVERRIDENATIVES g_fn_OverrideNatives;
|
||||
PFN_GETLOCALINFO g_fn_GetLocalInfo;
|
||||
PFN_AMX_REREGISTER g_fn_AmxReRegister;
|
||||
PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx;
|
||||
|
||||
// *** Exports ***
|
||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||
@ -2552,20 +2545,15 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
||||
if (!reqFnptrFunc)
|
||||
return AMXX_PARAM;
|
||||
|
||||
g_fn_RequestFunction = reqFnptrFunc;
|
||||
|
||||
// Req all known functions
|
||||
// Misc
|
||||
REQFUNC("BuildPathname", g_fn_BuildPathname, PFN_BUILD_PATHNAME);
|
||||
REQFUNC("BuildPathnameR", g_fn_BuildPathnameR, PFN_BUILD_PATHNAME_R);
|
||||
REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE);
|
||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||
REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR);
|
||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||
REQFUNC("RegisterFunction", g_fn_RegisterFunction, PFN_REGISTERFUNCTION);
|
||||
REQFUNC("RegisterFunctionEx", g_fn_RegisterFunctionEx, PFN_REGISTERFUNCTIONEX);
|
||||
|
||||
// Amx scripts
|
||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||
@ -2624,26 +2612,11 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
||||
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
||||
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
||||
REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT);
|
||||
REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH);
|
||||
REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO);
|
||||
REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR);
|
||||
REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC);
|
||||
REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC);
|
||||
|
||||
//Added in 1.75
|
||||
REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY);
|
||||
REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES);
|
||||
REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES);
|
||||
REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES);
|
||||
REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO);
|
||||
REQFUNC("AmxReregister", g_fn_AmxReRegister, PFN_AMX_REREGISTER);
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
// Memory
|
||||
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
||||
REQFUNC_OPT("Reallocator", g_fn_Reallocator, PFN_REALLOCATOR);
|
||||
REQFUNC_OPT("Deallocator", g_fn_Deallocator, PFN_DEALLOCATOR);
|
||||
#endif
|
||||
|
||||
REQFUNC("CellToReal", g_fn_CellToReal, PFN_CELL_TO_REAL);
|
||||
REQFUNC("RealToCell", g_fn_RealToCell, PFN_REAL_TO_CELL);
|
||||
@ -2672,41 +2645,29 @@ C_DLLEXPORT int AMXX_PluginsLoaded()
|
||||
return AMXX_OK;
|
||||
}
|
||||
|
||||
C_DLLEXPORT void AMXX_PluginsUnloaded()
|
||||
{
|
||||
#ifdef FN_AMXX_PLUGINSUNLOADED
|
||||
FN_AMXX_PLUGINSUNLOADED();
|
||||
#endif // FN_AMXX_PLUGINSUNLOADED
|
||||
}
|
||||
|
||||
C_DLLEXPORT void AMXX_PluginsUnloading()
|
||||
{
|
||||
#ifdef FN_AMXX_PLUGINSUNLOADING
|
||||
FN_AMXX_PLUGINSUNLOADING();
|
||||
#endif // FN_AMXX_PLUGINSUNLOADING
|
||||
}
|
||||
|
||||
// Advanced MF functions
|
||||
void MF_Log(const char *fmt, ...)
|
||||
{
|
||||
// :TODO: Overflow possible here
|
||||
char msg[3072];
|
||||
va_list arglst;
|
||||
va_start(arglst, fmt);
|
||||
vsnprintf(msg, sizeof(msg) - 1, fmt, arglst);
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_Log("[%s] %s", MODULE_LOGTAG, msg);
|
||||
g_fn_Log("[%s] %s", MODULE_NAME, msg);
|
||||
}
|
||||
|
||||
void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||
{
|
||||
// :TODO: Overflow possible here
|
||||
char msg[3072];
|
||||
va_list arglst;
|
||||
va_start(arglst, fmt);
|
||||
vsnprintf(msg, sizeof(msg) - 1, fmt, arglst);
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg);
|
||||
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_NAME, msg);
|
||||
}
|
||||
|
||||
|
||||
@ -2716,7 +2677,6 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||
void ValidateMacros_DontCallThis_Smiley()
|
||||
{
|
||||
MF_BuildPathname("str", "str", 0);
|
||||
MF_BuildPathnameR(NULL, 0, "%d", 0);
|
||||
MF_FormatAmxString(NULL, 0, 0, NULL);
|
||||
MF_GetAmxAddr(NULL, 0);
|
||||
MF_PrintSrvConsole("str", "str", 0);
|
||||
@ -2758,7 +2718,7 @@ void ValidateMacros_DontCallThis_Smiley()
|
||||
MF_IsPlayerHLTV(0);
|
||||
MF_GetPlayerArmor(0);
|
||||
MF_GetPlayerHealth(0);
|
||||
MF_AmxExec(0, 0, 0);
|
||||
MF_AmxExec(0, 0, 0, 0);
|
||||
MF_AmxExecv(0, 0, 0, 0, 0);
|
||||
MF_AmxFindPublic(0, 0, 0);
|
||||
MF_AmxAllot(0, 0, 0, 0);
|
||||
@ -2770,21 +2730,9 @@ void ValidateMacros_DontCallThis_Smiley()
|
||||
MF_GetPlayerFrags(0);
|
||||
MF_GetPlayerEdict(0);
|
||||
MF_Format("", 4, "str");
|
||||
MF_RegisterFunction(NULL, "");
|
||||
MF_RegisterFunctionEx(NULL, "");
|
||||
MF_SetPlayerTeamInfo(0, 0, "");
|
||||
MF_PlayerPropAddr(0, 0);
|
||||
MF_RegAuthFunc(NULL);
|
||||
MF_UnregAuthFunc(NULL);
|
||||
MF_FindLibrary(NULL, LibType_Class);
|
||||
MF_AddLibraries(NULL, LibType_Class, NULL);
|
||||
MF_RemoveLibraries(NULL);
|
||||
MF_OverrideNatives(NULL, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
|
||||
/************* MEMORY *************/
|
||||
// undef all defined macros
|
||||
#undef new
|
||||
@ -2956,30 +2904,6 @@ void operator delete[](void *reportedAddress)
|
||||
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32
|
||||
void * operator new(size_t size) {
|
||||
return(calloc(1, size));
|
||||
}
|
||||
|
||||
void * operator new[](size_t size) {
|
||||
return(calloc(1, size));
|
||||
}
|
||||
|
||||
void operator delete(void * ptr) {
|
||||
if(ptr)
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
void operator delete[](void * ptr) {
|
||||
if(ptr)
|
||||
free(ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //MEMORY_TEST
|
||||
|
||||
/************* stuff from dlls/util.cpp *************/
|
||||
// must come here because cbase.h declares it's own operator new
|
||||
|
@ -31,10 +31,8 @@
|
||||
|
||||
// ***** AMXX stuff *****
|
||||
|
||||
// module interface version was 1
|
||||
// 2 - added logtag to struct (amxx1.1-rc1)
|
||||
// 3 - added new tagAMX structure (amxx1.5)
|
||||
#define AMXX_INTERFACE_VERSION 3
|
||||
// module interface version is 1
|
||||
#define AMXX_INTERFACE_VERSION 1
|
||||
|
||||
// amxx module info
|
||||
struct amxx_module_info_s
|
||||
@ -43,9 +41,10 @@ struct amxx_module_info_s
|
||||
const char *author;
|
||||
const char *version;
|
||||
int reload; // reload on mapchange when nonzero
|
||||
const char *logtag; // added in version 2
|
||||
};
|
||||
|
||||
|
||||
|
||||
// return values from functions called by amxx
|
||||
#define AMXX_OK 0 /* no error */
|
||||
#define AMXX_IFVERS 1 /* interface version */
|
||||
@ -54,56 +53,39 @@ struct amxx_module_info_s
|
||||
|
||||
// *** Small stuff ***
|
||||
// The next section is copied from the amx.h file
|
||||
// Copyright (c) ITB CompuPhase, 1997-2005
|
||||
// Copyright (c) ITB CompuPhase, 1997-2004
|
||||
|
||||
#if defined HAVE_STDINT_H
|
||||
#if defined __LCC__ || defined __DMC__ || defined __linux__ || defined __GNUC__
|
||||
#include <stdint.h>
|
||||
#else
|
||||
#if defined __LCC__ || defined __DMC__ || defined LINUX
|
||||
#if defined HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
|
||||
/* The ISO C99 defines the int16_t and int_32t types. If the compiler got
|
||||
* here, these types are probably undefined.
|
||||
*/
|
||||
#if defined __FreeBSD__
|
||||
#include <inttypes.h>
|
||||
#else
|
||||
typedef short int int16_t;
|
||||
typedef unsigned short int uint16_t;
|
||||
#if defined SN_TARGET_PS2
|
||||
typedef int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
#else
|
||||
#include <stdint.h>
|
||||
typedef long int int32_t;
|
||||
typedef unsigned long int uint32_t;
|
||||
#endif
|
||||
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
|
||||
/* The ISO C99 defines the int16_t and int_32t types. If the compiler got
|
||||
* here, these types are probably undefined.
|
||||
*/
|
||||
#if defined __MACH__
|
||||
#include <ppc/types.h>
|
||||
typedef unsigned short int uint16_t;
|
||||
typedef unsigned long int uint32_t;
|
||||
#elif defined __FreeBSD__
|
||||
#include <inttypes.h>
|
||||
#else
|
||||
typedef short int int16_t;
|
||||
typedef unsigned short int uint16_t;
|
||||
#if defined SN_TARGET_PS2
|
||||
typedef int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
#else
|
||||
typedef long int int32_t;
|
||||
typedef unsigned long int uint32_t;
|
||||
#endif
|
||||
#if defined __WIN32__ || defined _WIN32 || defined WIN32
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#define HAVE_I64
|
||||
#elif defined __GNUC__
|
||||
typedef long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
#define HAVE_I64
|
||||
#endif
|
||||
#if defined __WIN32__ || defined _WIN32 || defined WIN32
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#define HAVE_I64
|
||||
#elif defined __GNUC__
|
||||
typedef long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
#define HAVE_I64
|
||||
#endif
|
||||
#endif
|
||||
#define HAVE_STDINT_H
|
||||
#endif
|
||||
#if defined _LP64 || defined WIN64 || defined _WIN64
|
||||
#if !defined __64BIT__
|
||||
#define __64BIT__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* calling convention for native functions */
|
||||
#if !defined AMX_NATIVE_CALL
|
||||
#define AMX_NATIVE_CALL
|
||||
@ -122,26 +104,24 @@ struct amxx_module_info_s
|
||||
#define AMXEXPORT
|
||||
#endif
|
||||
|
||||
#if !defined PAWN_CELL_SIZE
|
||||
#define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */
|
||||
|
||||
|
||||
#if !defined SMALL_CELL_SIZE
|
||||
#define SMALL_CELL_SIZE 32 /* by default, use 32-bit cells */
|
||||
#endif
|
||||
#if PAWN_CELL_SIZE==16
|
||||
typedef uint16_t ucell;
|
||||
typedef int16_t cell;
|
||||
#elif PAWN_CELL_SIZE==32
|
||||
#if SMALL_CELL_SIZE==32
|
||||
typedef uint32_t ucell;
|
||||
typedef int32_t cell;
|
||||
#define REAL float
|
||||
#elif PAWN_CELL_SIZE==64
|
||||
typedef float REAL;
|
||||
#elif SMALL_CELL_SIZE==64
|
||||
typedef uint64_t ucell;
|
||||
typedef int64_t cell;
|
||||
#define REAL double
|
||||
typedef double REAL;
|
||||
#else
|
||||
#error Unsupported cell size (PAWN_CELL_SIZE)
|
||||
#error Unsupported cell size (SMALL_CELL_SIZE)
|
||||
#endif
|
||||
|
||||
#define UNPACKEDMAX ((1 << (sizeof(cell)-1)*8) - 1)
|
||||
#define UNLIMITED (~1u >> 1)
|
||||
|
||||
struct tagAMX;
|
||||
typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params);
|
||||
@ -153,158 +133,27 @@ typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx);
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER
|
||||
#pragma warning(disable:4103) /* disable warning message 4103 that complains
|
||||
* about pragma pack in a header file */
|
||||
#pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
#if !defined NO_MSVC8_AUTO_COMPAT
|
||||
|
||||
/* Disable deprecation warnings concerning unsafe CRT functions */
|
||||
#if !defined _CRT_SECURE_NO_DEPRECATE
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
/* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */
|
||||
#define access _access
|
||||
#define cabs _cabs
|
||||
#define cgets _cgets
|
||||
#define chdir _chdir
|
||||
#define chmod _chmod
|
||||
#define chsize _chsize
|
||||
#define close _close
|
||||
#define cprintf _cprintf
|
||||
#define cputs _cputts
|
||||
#define creat _creat
|
||||
#define cscanf _cscanf
|
||||
#define cwait _cwait
|
||||
#define dup _dup
|
||||
#define dup2 _dup2
|
||||
#define ecvt _ecvt
|
||||
#define eof _eof
|
||||
#define execl _execl
|
||||
#define execle _execle
|
||||
#define execlp _execlp
|
||||
#define execlpe _execlpe
|
||||
#define execv _execv
|
||||
#define execve _execv
|
||||
#define execvp _execvp
|
||||
#define execvpe _execvpe
|
||||
#define fcloseall _fcloseall
|
||||
#define fcvt _fcvt
|
||||
#define fdopen _fdopen
|
||||
#define fgetchar _fgetchar
|
||||
#define filelength _filelength
|
||||
#define fileno _fileno
|
||||
#define flushall _flushall
|
||||
#define fputchar _fputchar
|
||||
#define gcvt _gcvt
|
||||
#define getch _getch
|
||||
#define getche _getche
|
||||
#define getcwd _getcwd
|
||||
#define getpid _getpid
|
||||
#define getw _getw
|
||||
#define hypot _hypot
|
||||
#define inp _inp
|
||||
#define inpw _inpw
|
||||
#define isascii __isascii
|
||||
#define isatty _isatty
|
||||
#define iscsym __iscsym
|
||||
#define iscsymf __iscsymf
|
||||
#define itoa _itoa
|
||||
#define j0 _j0
|
||||
#define j1 _j1
|
||||
#define jn _jn
|
||||
#define kbhit _kbhit
|
||||
#define lfind _lfind
|
||||
#define locking _locking
|
||||
#define lsearch _lsearch
|
||||
#define lseek _lseek
|
||||
#define ltoa _ltoa
|
||||
#define memccpy _memccpy
|
||||
#define memicmp _memicmp
|
||||
#define mkdir _mkdir
|
||||
#define mktemp _mktemp
|
||||
#define open _open
|
||||
#define outp _outp
|
||||
#define outpw _outpw
|
||||
#define putch _putch
|
||||
#define putenv _putenv
|
||||
#define putw _putw
|
||||
#define read _read
|
||||
#define rmdir _rmdir
|
||||
#define rmtmp _rmtmp
|
||||
#define setmode _setmode
|
||||
#define sopen _sopen
|
||||
#define spawnl _spawnl
|
||||
#define spawnle _spawnle
|
||||
#define spawnlp _spawnlp
|
||||
#define spawnlpe _spawnlpe
|
||||
#define spawnv _spawnv
|
||||
#define spawnve _spawnve
|
||||
#define spawnvp _spawnvp
|
||||
#define spawnvpe _spawnvpe
|
||||
#define strcmpi _strcmpi
|
||||
#define strdup _strdup
|
||||
#define stricmp _stricmp
|
||||
#define strlwr _strlwr
|
||||
#define strnicmp _strnicmp
|
||||
#define strnset _strnset
|
||||
#define strrev _strrev
|
||||
#define strset _strset
|
||||
#define strupr _strupr
|
||||
#define swab _swab
|
||||
#define tell _tell
|
||||
#define tempnam _tempnam
|
||||
#define toascii __toascii
|
||||
#define tzset _tzset
|
||||
#define ultoa _ultoa
|
||||
#define umask _umask
|
||||
#define ungetch _ungetch
|
||||
#define unlink _unlink
|
||||
#define wcsdup _wcsdup
|
||||
#define wcsicmp _wcsicmp
|
||||
#define wcsicoll _wcsicoll
|
||||
#define wcslwr _wcslwr
|
||||
#define wcsnicmp _wcsnicmp
|
||||
#define wcsnset _wcsnset
|
||||
#define wcsrev _wcsrev
|
||||
#define wcsset _wcsset
|
||||
#define wcsupr _wcsupr
|
||||
#define write _write
|
||||
#define y0 _y0
|
||||
#define y1 _y1
|
||||
#define yn _yn
|
||||
|
||||
/* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant
|
||||
* functions above are deprecated. */
|
||||
#pragma warning (disable:4996)
|
||||
|
||||
#endif
|
||||
#else
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
#pragma warning(disable:4103) /* disable warning message 4103 that complains
|
||||
* about pragma pack in a header file */
|
||||
#pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */
|
||||
#endif
|
||||
|
||||
|
||||
/* Some compilers do not support the #pragma align, which should be fine. Some
|
||||
* compilers give a warning on unknown #pragmas, which is not so fine...
|
||||
*/
|
||||
#if (defined SN_TARGET_PS2 || defined __GNUC__) && !defined AMX_NO_ALIGN
|
||||
#if defined SN_TARGET_PS2 || defined __GNUC__
|
||||
#define AMX_NO_ALIGN
|
||||
#endif
|
||||
|
||||
|
||||
#if defined __GNUC__
|
||||
#define PACKED __attribute__((packed))
|
||||
#else
|
||||
#define PACKED
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined AMX_NO_ALIGN
|
||||
#if defined LINUX || defined __FreeBSD__
|
||||
#if defined __linux__
|
||||
#pragma pack(1) /* structures must be packed (byte-aligned) */
|
||||
#elif defined MACOS && defined __MWERKS__
|
||||
#pragma options align=mac68k
|
||||
#else
|
||||
#pragma pack(push)
|
||||
#pragma pack(1) /* structures must be packed (byte-aligned) */
|
||||
@ -325,7 +174,7 @@ typedef struct {
|
||||
* fields are valid at all times; many fields are cached in local variables.
|
||||
*/
|
||||
typedef struct tagAMX {
|
||||
unsigned char _FAR *base PACKED; /* points to the AMX header plus the code, optionally also the data */
|
||||
unsigned char _FAR *base PACKED; /* points to the AMX header ("amxhdr") plus the code, optionally also the data */
|
||||
unsigned char _FAR *data PACKED; /* points to separate data+stack+heap, may be NULL */
|
||||
AMX_CALLBACK callback PACKED;
|
||||
AMX_DEBUG debug PACKED; /* debug callback */
|
||||
@ -337,25 +186,28 @@ typedef struct tagAMX {
|
||||
cell stk PACKED; /* stack pointer: relative to base + amxhdr->dat */
|
||||
cell stp PACKED; /* top of the stack: relative to base + amxhdr->dat */
|
||||
int flags PACKED; /* current status, see amx_Flags() */
|
||||
/* for assertions and debug hook */
|
||||
cell curline PACKED;
|
||||
cell curfile PACKED;
|
||||
int dbgcode PACKED;
|
||||
cell dbgaddr PACKED;
|
||||
cell dbgparam PACKED;
|
||||
char _FAR *dbgname PACKED;
|
||||
/* user data */
|
||||
long usertags[AMX_USERNUM] PACKED;
|
||||
//okay userdata[3] in AMX Mod X is for the CPlugin * pointer
|
||||
//we're also gonna set userdata[2] to a special debug structure
|
||||
void _FAR *userdata[AMX_USERNUM] PACKED;
|
||||
/* native functions can raise an error */
|
||||
int error PACKED;
|
||||
/* passing parameters requires a "count" field */
|
||||
int paramcount;
|
||||
/* the sleep opcode needs to store the full AMX status */
|
||||
cell pri PACKED;
|
||||
cell alt PACKED;
|
||||
cell reset_stk PACKED;
|
||||
cell reset_hea PACKED;
|
||||
cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */
|
||||
/* support variables for the JIT */
|
||||
int reloc_size PACKED; /* required temporary buffer for relocations */
|
||||
long code_size PACKED; /* estimated memory footprint of the native code */
|
||||
} PACKED AMX;
|
||||
/* support variables for the JIT */
|
||||
int reloc_size PACKED; /* required temporary buffer for relocations */
|
||||
long code_size PACKED; /* estimated memory footprint of the native code */
|
||||
} AMX;
|
||||
|
||||
enum {
|
||||
AMX_ERR_NONE,
|
||||
@ -372,7 +224,6 @@ enum {
|
||||
AMX_ERR_NATIVE, /* native function failed */
|
||||
AMX_ERR_DIVIDE, /* divide by zero */
|
||||
AMX_ERR_SLEEP, /* go into sleepmode - code can be restarted */
|
||||
AMX_ERR_INVSTATE, /* invalid state for this access */
|
||||
|
||||
AMX_ERR_MEMORY = 16, /* out of memory */
|
||||
AMX_ERR_FORMAT, /* invalid file format */
|
||||
@ -2032,9 +1883,6 @@ void FN_AMXX_DETACH(void);
|
||||
void FN_AMXX_PLUGINSLOADED(void);
|
||||
#endif // FN_AMXX_PLUGINSLOADED
|
||||
|
||||
// *** Types ***
|
||||
typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/);
|
||||
|
||||
// ***** Module funcs stuff *****
|
||||
enum ForwardExecType
|
||||
{
|
||||
@ -2055,34 +1903,9 @@ enum ForwardParam
|
||||
FP_ARRAY, // array; use the return value of prepareArray.
|
||||
};
|
||||
|
||||
enum PlayerProp
|
||||
{
|
||||
Player_Name, //String
|
||||
Player_Ip, //String
|
||||
Player_Team, //String
|
||||
Player_Ingame, //bool
|
||||
Player_Authorized, //bool
|
||||
Player_Vgui, //bool
|
||||
Player_Time, //float
|
||||
Player_Playtime, //float
|
||||
Player_MenuExpire, //float
|
||||
Player_Weapons, //struct{int,int}[32]
|
||||
Player_CurrentWeapon, //int
|
||||
Player_TeamID, //int
|
||||
Player_Deaths, //int
|
||||
Player_Aiming, //int
|
||||
Player_Menu, //int
|
||||
Player_Keys, //int
|
||||
Player_Flags, //int[32]
|
||||
Player_Newmenu, //int
|
||||
Player_NewmenuPage, //int
|
||||
};
|
||||
|
||||
typedef void (*AUTHORIZEFUNC)(int player, const char *authstring);
|
||||
|
||||
typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/);
|
||||
typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...);
|
||||
typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...);
|
||||
typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/);
|
||||
typedef void (*PFN_PRINT_SRVCONSOLE) (char * /*format*/, ...);
|
||||
typedef const char * (*PFN_GET_MODNAME) (void);
|
||||
@ -2130,17 +1953,14 @@ typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||
#else
|
||||
typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||
#endif
|
||||
typedef void * (*PFN_PLAYER_PROP_ADDR) (int /*id*/, int /*prop*/);
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||
const unsigned int /*type*/, const size_t /*size*/);
|
||||
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||
const unsigned int /*type*/, const size_t /*size*/, void* /*addr*/ );
|
||||
typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||
const unsigned int /*type*/, const void* /*addr*/ );
|
||||
#endif
|
||||
typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/);
|
||||
typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, ... /*params*/);
|
||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||
typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/);
|
||||
typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
||||
@ -2154,15 +1974,9 @@ typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*f
|
||||
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
||||
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||
typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/);
|
||||
typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/);
|
||||
typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */);
|
||||
typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC);
|
||||
typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC);
|
||||
|
||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||
extern PFN_BUILD_PATHNAME_R g_fn_BuildPathnameR;
|
||||
extern PFN_GET_AMXADDR g_fn_GetAmxAddr;
|
||||
extern PFN_PRINT_SRVCONSOLE g_fn_PrintSrvConsole;
|
||||
extern PFN_GET_MODNAME g_fn_GetModname;
|
||||
@ -2204,6 +2018,7 @@ extern PFN_IS_PLAYER_HLTV g_fn_IsPlayerHLTV;
|
||||
extern PFN_GET_PLAYER_ARMOR g_fn_GetPlayerArmor;
|
||||
extern PFN_GET_PLAYER_HEALTH g_fn_GetPlayerHealth;
|
||||
extern PFN_AMX_EXEC g_fn_AmxExec;
|
||||
extern PFN_AMX_EXECV g_fn_AmxExecv;
|
||||
extern PFN_AMX_ALLOT g_fn_AmxAllot;
|
||||
extern PFN_AMX_FINDPUBLIC g_fn_AmxFindPublic;
|
||||
extern PFN_LOAD_AMXSCRIPT g_fn_LoadAmxScript;
|
||||
@ -2219,20 +2034,12 @@ extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||
extern PFN_FORMAT g_fn_Format;
|
||||
extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam;
|
||||
extern PFN_REGISTERFUNCTION g_fn_RegisterFunction;
|
||||
extern PFN_REQ_FNPTR g_fn_RequestFunction;
|
||||
extern PFN_AMX_PUSH g_fn_AmxPush;
|
||||
extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo;
|
||||
extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr;
|
||||
extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc;
|
||||
extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc;
|
||||
|
||||
#ifdef MAY_NEVER_BE_DEFINED
|
||||
// Function prototypes for intellisense and similar systems
|
||||
// They understand #if 0 so we use #ifdef MAY_NEVER_BE_DEFINED
|
||||
int MF_AddNatives (const AMX_NATIVE_INFO *list) { }
|
||||
char * MF_BuildPathname (const char * format, ...) { }
|
||||
char * MF_BuildPathnameR (char *buffer, size_t maxlen, const char *fmt, ...) { }
|
||||
cell * MF_GetAmxAddr (AMX * amx, cell offset) { }
|
||||
void MF_PrintSrvConsole (char * format, ...) { }
|
||||
const char * MF_GetModname (void) { }
|
||||
@ -2282,19 +2089,10 @@ void MF_UnregisterSPForward (int id) { }
|
||||
int MF_GetPlayerFlags (int id) { }
|
||||
edict_t* MF_GetPlayerEdict (int id) { }
|
||||
const char * MF_Format (const char *fmt, ...) { }
|
||||
void MF_RegisterFunction (void *pfn, const char *description) { }
|
||||
void * MF_RequestFunction (const char *description) { }
|
||||
int MF_AmxPush (AMX *amx, cell *params) { }
|
||||
int MF_AmxExec (AMX *amx, cell *retval, int idx) { }
|
||||
int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { }
|
||||
void * MF_PlayerPropAddr (int id, int prop) { }
|
||||
void MF_RegAuthFunc (AUTHORIZEFUNC fn) { }
|
||||
void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { }
|
||||
#endif // MAY_NEVER_BE_DEFINED
|
||||
|
||||
#define MF_AddNatives g_fn_AddNatives
|
||||
#define MF_BuildPathname g_fn_BuildPathname
|
||||
#define MF_BuildPathnameR g_fn_BuildPathnameR
|
||||
#define MF_FormatAmxString g_fn_FormatAmxString
|
||||
#define MF_GetAmxAddr g_fn_GetAmxAddr
|
||||
#define MF_PrintSrvConsole g_fn_PrintSrvConsole
|
||||
@ -2352,15 +2150,7 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...);
|
||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||
#define MF_Format g_fn_Format
|
||||
#define MF_RegisterFunction g_fn_RegisterFunction
|
||||
#define MF_RequestFunction g_fn_RequestFunction
|
||||
#define MF_AmxPush g_fn_AmxPush
|
||||
#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo
|
||||
#define MF_PlayerPropAddr g_fn_PlayerPropAddr
|
||||
#define MF_RegAuthFunc g_fn_RegAuthFunc
|
||||
#define MF_UnregAuthFunc g_fn_UnregAuthFunc
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
/*** Memory ***/
|
||||
void *operator new(size_t reportedSize);
|
||||
void *operator new[](size_t reportedSize);
|
||||
@ -2404,6 +2194,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||
|
||||
#endif //MEMORY_TEST
|
||||
|
||||
#endif // #ifndef __AMXXMODULE_H__
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
// Module info
|
||||
#define MODULE_NAME "CSX"
|
||||
#define MODULE_VERSION "1.72"
|
||||
#define MODULE_VERSION "1.00"
|
||||
#define MODULE_AUTHOR "AMX Mod X Dev Team"
|
||||
#define MODULE_URL "http://www.amxmodx.org/"
|
||||
#define MODULE_LOGTAG "CSX"
|
||||
@ -21,19 +21,6 @@
|
||||
// metamod plugin?
|
||||
//#define USE_METAMOD
|
||||
|
||||
// use memory manager/tester?
|
||||
// note that if you use this, you cannot construct/allocate
|
||||
// anything before the module attached (OnAmxxAttach).
|
||||
// be careful of default constructors using new/malloc!
|
||||
// #define MEMORY_TEST
|
||||
|
||||
// Unless you use STL or exceptions, keep this commented.
|
||||
// It allows you to compile without libstdc++.so as a dependency
|
||||
// #define NO_ALLOC_OVERRIDES
|
||||
|
||||
// Uncomment this if you are using MSVC8 or greater and want to fix some of the compatibility issues yourself
|
||||
// #define NO_MSVC8_AUTO_COMPAT
|
||||
|
||||
// - AMXX Init functions
|
||||
// Also consider using FN_META_*
|
||||
// AMXX query
|
||||
@ -82,13 +69,13 @@
|
||||
// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */
|
||||
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
||||
// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
||||
// #define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||
// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||
//#define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||
//#define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
||||
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||
// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||
// #define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
//#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||
// #define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||
@ -133,17 +120,17 @@
|
||||
// #define FN_SaveGlobalState_Post SaveGlobalState_Post
|
||||
// #define FN_RestoreGlobalState_Post RestoreGlobalState_Post
|
||||
// #define FN_ResetGlobalState_Post ResetGlobalState_Post
|
||||
// #define FN_ClientConnect_Post ClientConnect_Post
|
||||
//#define FN_ClientConnect_Post ClientConnect_Post
|
||||
// #define FN_ClientDisconnect_Post ClientDisconnect_Post
|
||||
// #define FN_ClientKill_Post ClientKill_Post
|
||||
// #define FN_ClientPutInServer_Post ClientPutInServer_Post
|
||||
//#define FN_ClientPutInServer_Post ClientPutInServer_Post
|
||||
// #define FN_ClientCommand_Post ClientCommand_Post
|
||||
// #define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
||||
// #define FN_ServerActivate_Post ServerActivate_Post
|
||||
//#define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
||||
//#define FN_ServerActivate_Post ServerActivate_Post
|
||||
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
||||
// #define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||
//#define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||
// #define FN_PlayerPostThink_Post PlayerPostThink_Post
|
||||
// #define FN_StartFrame_Post StartFrame_Post
|
||||
//#define FN_StartFrame_Post StartFrame_Post
|
||||
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
||||
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
||||
// #define FN_GetGameDescription_Post GetGameDescription_Post
|
||||
@ -318,7 +305,7 @@
|
||||
// - GetEngineAPI_Post functions
|
||||
// #define FN_PrecacheModel_Post PrecacheModel_Post
|
||||
// #define FN_PrecacheSound_Post PrecacheSound_Post
|
||||
// #define FN_SetModel_Post SetModel_Post
|
||||
//#define FN_SetModel_Post SetModel_Post
|
||||
// #define FN_ModelIndex_Post ModelIndex_Post
|
||||
// #define FN_ModelFrames_Post ModelFrames_Post
|
||||
// #define FN_SetSize_Post SetSize_Post
|
||||
@ -345,9 +332,9 @@
|
||||
// #define FN_DropToFloor_Post DropToFloor_Post
|
||||
// #define FN_WalkMove_Post WalkMove_Post
|
||||
// #define FN_SetOrigin_Post SetOrigin_Post
|
||||
// #define FN_EmitSound_Post EmitSound_Post
|
||||
//#define FN_EmitSound_Post EmitSound_Post
|
||||
// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post
|
||||
// #define FN_TraceLine_Post TraceLine_Post
|
||||
//#define FN_TraceLine_Post TraceLine_Post
|
||||
// #define FN_TraceToss_Post TraceToss_Post
|
||||
// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post
|
||||
// #define FN_TraceHull_Post TraceHull_Post
|
||||
@ -362,16 +349,16 @@
|
||||
// #define FN_LightStyle_Post LightStyle_Post
|
||||
// #define FN_DecalIndex_Post DecalIndex_Post
|
||||
// #define FN_PointContents_Post PointContents_Post
|
||||
// #define FN_MessageBegin_Post MessageBegin_Post
|
||||
// #define FN_MessageEnd_Post MessageEnd_Post
|
||||
// #define FN_WriteByte_Post WriteByte_Post
|
||||
// #define FN_WriteChar_Post WriteChar_Post
|
||||
// #define FN_WriteShort_Post WriteShort_Post
|
||||
// #define FN_WriteLong_Post WriteLong_Post
|
||||
// #define FN_WriteAngle_Post WriteAngle_Post
|
||||
// #define FN_WriteCoord_Post WriteCoord_Post
|
||||
// #define FN_WriteString_Post WriteString_Post
|
||||
// #define FN_WriteEntity_Post WriteEntity_Post
|
||||
//#define FN_MessageBegin_Post MessageBegin_Post
|
||||
//#define FN_MessageEnd_Post MessageEnd_Post
|
||||
//#define FN_WriteByte_Post WriteByte_Post
|
||||
//#define FN_WriteChar_Post WriteChar_Post
|
||||
//#define FN_WriteShort_Post WriteShort_Post
|
||||
//#define FN_WriteLong_Post WriteLong_Post
|
||||
//#define FN_WriteAngle_Post WriteAngle_Post
|
||||
//#define FN_WriteCoord_Post WriteCoord_Post
|
||||
//#define FN_WriteString_Post WriteString_Post
|
||||
//#define FN_WriteEntity_Post WriteEntity_Post
|
||||
// #define FN_CVarRegister_Post CVarRegister_Post
|
||||
// #define FN_CVarGetFloat_Post CVarGetFloat_Post
|
||||
// #define FN_CVarGetString_Post CVarGetString_Post
|
||||
@ -391,7 +378,7 @@
|
||||
// #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post
|
||||
// #define FN_FindEntityByVars_Post FindEntityByVars_Post
|
||||
// #define FN_GetModelPtr_Post GetModelPtr_Post
|
||||
// #define FN_RegUserMsg_Post RegUserMsg_Post
|
||||
//#define FN_RegUserMsg_Post RegUserMsg_Post
|
||||
// #define FN_AnimationAutomove_Post AnimationAutomove_Post
|
||||
// #define FN_GetBonePosition_Post GetBonePosition_Post
|
||||
// #define FN_FunctionFromName_Post FunctionFromName_Post
|
||||
@ -472,4 +459,4 @@
|
||||
|
||||
#endif // USE_METAMOD
|
||||
|
||||
#endif // __MODULECONFIG_H__
|
||||
#endif // __MODULECONFIG_H__
|
@ -1,269 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="WinCSX"
|
||||
ProjectGUID="{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}"
|
||||
RootNamespace="WinCSX"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/WinCSX.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/WinCSX.pdb"
|
||||
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="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/WinCSX.exe"
|
||||
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>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\WinCSX.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\Resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\stdafx.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\WinCSX.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\small.ico"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\WinCSX.exe.manifest"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\WinCSX.ico"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\WinCSX.rc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Dependencies"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\amxxmodule.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CRank.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CRank.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\moduleconfig.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -2430,9 +2430,7 @@ static amxx_module_info_s g_ModuleInfo =
|
||||
#else // MODULE_RELOAD_ON_MAPCHANGE
|
||||
0,
|
||||
#endif // MODULE_RELOAD_ON_MAPCHANGE
|
||||
MODULE_LOGTAG,
|
||||
MODULE_LIBRARY,
|
||||
MODULE_LIBCLASS
|
||||
MODULE_LOGTAG
|
||||
};
|
||||
|
||||
// Storage for the requested functions
|
||||
@ -2506,13 +2504,6 @@ PFN_REQ_FNPTR g_fn_RequestFunction;
|
||||
PFN_AMX_PUSH g_fn_AmxPush;
|
||||
PFN_SET_TEAM_INFO g_fn_SetTeamInfo;
|
||||
PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr;
|
||||
PFN_REG_AUTH_FUNC g_fn_RegAuthFunc;
|
||||
PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc;
|
||||
PFN_FINDLIBRARY g_fn_FindLibrary;
|
||||
PFN_ADDLIBRARIES g_fn_AddLibraries;
|
||||
PFN_REMOVELIBRARIES g_fn_RemoveLibraries;
|
||||
PFN_OVERRIDENATIVES g_fn_OverrideNatives;
|
||||
PFN_GETLOCALINFO g_fn_GetLocalInfo;
|
||||
|
||||
// *** Exports ***
|
||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||
@ -2624,14 +2615,6 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
||||
REQFUNC("amx_Push", g_fn_AmxPush, PFN_AMX_PUSH);
|
||||
REQFUNC("SetPlayerTeamInfo", g_fn_SetTeamInfo, PFN_SET_TEAM_INFO);
|
||||
REQFUNC("PlayerPropAddr", g_fn_PlayerPropAddr, PFN_PLAYER_PROP_ADDR);
|
||||
REQFUNC("RegAuthFunc", g_fn_RegAuthFunc, PFN_REG_AUTH_FUNC);
|
||||
REQFUNC("UnregAuthFunc", g_fn_UnregAuthFunc, PFN_UNREG_AUTH_FUNC);
|
||||
|
||||
REQFUNC("FindLibrary", g_fn_FindLibrary, PFN_FINDLIBRARY);
|
||||
REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES);
|
||||
REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES);
|
||||
REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES);
|
||||
REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO);
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
// Memory
|
||||
@ -2667,27 +2650,14 @@ C_DLLEXPORT int AMXX_PluginsLoaded()
|
||||
return AMXX_OK;
|
||||
}
|
||||
|
||||
C_DLLEXPORT void AMXX_PluginsUnloaded()
|
||||
{
|
||||
#ifdef FN_AMXX_PLUGINSUNLOADED
|
||||
FN_AMXX_PLUGINSUNLOADED();
|
||||
#endif // FN_AMXX_PLUGINSUNLOADED
|
||||
}
|
||||
|
||||
C_DLLEXPORT void AMXX_PluginsUnloading()
|
||||
{
|
||||
#ifdef FN_AMXX_PLUGINSUNLOADING
|
||||
FN_AMXX_PLUGINSUNLOADING();
|
||||
#endif // FN_AMXX_PLUGINSUNLOADING
|
||||
}
|
||||
|
||||
// Advanced MF functions
|
||||
void MF_Log(const char *fmt, ...)
|
||||
{
|
||||
// :TODO: Overflow possible here
|
||||
char msg[3072];
|
||||
va_list arglst;
|
||||
va_start(arglst, fmt);
|
||||
vsnprintf(msg, sizeof(msg) - 1, fmt, arglst);
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_Log("[%s] %s", MODULE_LOGTAG, msg);
|
||||
@ -2695,10 +2665,11 @@ void MF_Log(const char *fmt, ...)
|
||||
|
||||
void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||
{
|
||||
// :TODO: Overflow possible here
|
||||
char msg[3072];
|
||||
va_list arglst;
|
||||
va_start(arglst, fmt);
|
||||
vsnprintf(msg, sizeof(msg) - 1, fmt, arglst);
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg);
|
||||
@ -2768,12 +2739,6 @@ void ValidateMacros_DontCallThis_Smiley()
|
||||
MF_RegisterFunction(NULL, "");
|
||||
MF_SetPlayerTeamInfo(0, 0, "");
|
||||
MF_PlayerPropAddr(0, 0);
|
||||
MF_RegAuthFunc(NULL);
|
||||
MF_UnregAuthFunc(NULL);
|
||||
MF_FindLibrary(NULL, LibType_Class);
|
||||
MF_AddLibraries(NULL, LibType_Class, NULL);
|
||||
MF_RemoveLibraries(NULL);
|
||||
MF_OverrideNatives(NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -34,8 +34,7 @@
|
||||
// module interface version was 1
|
||||
// 2 - added logtag to struct (amxx1.1-rc1)
|
||||
// 3 - added new tagAMX structure (amxx1.5)
|
||||
// 4 - added new 'library' setting for direct loading
|
||||
#define AMXX_INTERFACE_VERSION 4
|
||||
#define AMXX_INTERFACE_VERSION 3
|
||||
|
||||
// amxx module info
|
||||
struct amxx_module_info_s
|
||||
@ -45,8 +44,6 @@ struct amxx_module_info_s
|
||||
const char *version;
|
||||
int reload; // reload on mapchange when nonzero
|
||||
const char *logtag; // added in version 2
|
||||
const char *library; // added in version 4
|
||||
const char *libclass; // added in version 4
|
||||
};
|
||||
|
||||
// return values from functions called by amxx
|
||||
@ -156,137 +153,9 @@ typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx);
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER
|
||||
#pragma warning(disable:4103) /* disable warning message 4103 that complains
|
||||
* about pragma pack in a header file */
|
||||
#pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
#if !defined NO_MSVC8_AUTO_COMPAT
|
||||
|
||||
/* Disable deprecation warnings concerning unsafe CRT functions */
|
||||
#if !defined _CRT_SECURE_NO_DEPRECATE
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
/* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */
|
||||
#define access _access
|
||||
#define cabs _cabs
|
||||
#define cgets _cgets
|
||||
#define chdir _chdir
|
||||
#define chmod _chmod
|
||||
#define chsize _chsize
|
||||
#define close _close
|
||||
#define cprintf _cprintf
|
||||
#define cputs _cputts
|
||||
#define creat _creat
|
||||
#define cscanf _cscanf
|
||||
#define cwait _cwait
|
||||
#define dup _dup
|
||||
#define dup2 _dup2
|
||||
#define ecvt _ecvt
|
||||
#define eof _eof
|
||||
#define execl _execl
|
||||
#define execle _execle
|
||||
#define execlp _execlp
|
||||
#define execlpe _execlpe
|
||||
#define execv _execv
|
||||
#define execve _execv
|
||||
#define execvp _execvp
|
||||
#define execvpe _execvpe
|
||||
#define fcloseall _fcloseall
|
||||
#define fcvt _fcvt
|
||||
#define fdopen _fdopen
|
||||
#define fgetchar _fgetchar
|
||||
#define filelength _filelength
|
||||
#define fileno _fileno
|
||||
#define flushall _flushall
|
||||
#define fputchar _fputchar
|
||||
#define gcvt _gcvt
|
||||
#define getch _getch
|
||||
#define getche _getche
|
||||
#define getcwd _getcwd
|
||||
#define getpid _getpid
|
||||
#define getw _getw
|
||||
#define hypot _hypot
|
||||
#define inp _inp
|
||||
#define inpw _inpw
|
||||
#define isascii __isascii
|
||||
#define isatty _isatty
|
||||
#define iscsym __iscsym
|
||||
#define iscsymf __iscsymf
|
||||
#define itoa _itoa
|
||||
#define j0 _j0
|
||||
#define j1 _j1
|
||||
#define jn _jn
|
||||
#define kbhit _kbhit
|
||||
#define lfind _lfind
|
||||
#define locking _locking
|
||||
#define lsearch _lsearch
|
||||
#define lseek _lseek
|
||||
#define ltoa _ltoa
|
||||
#define memccpy _memccpy
|
||||
#define memicmp _memicmp
|
||||
#define mkdir _mkdir
|
||||
#define mktemp _mktemp
|
||||
#define open _open
|
||||
#define outp _outp
|
||||
#define outpw _outpw
|
||||
#define putch _putch
|
||||
#define putenv _putenv
|
||||
#define putw _putw
|
||||
#define read _read
|
||||
#define rmdir _rmdir
|
||||
#define rmtmp _rmtmp
|
||||
#define setmode _setmode
|
||||
#define sopen _sopen
|
||||
#define spawnl _spawnl
|
||||
#define spawnle _spawnle
|
||||
#define spawnlp _spawnlp
|
||||
#define spawnlpe _spawnlpe
|
||||
#define spawnv _spawnv
|
||||
#define spawnve _spawnve
|
||||
#define spawnvp _spawnvp
|
||||
#define spawnvpe _spawnvpe
|
||||
#define strcmpi _strcmpi
|
||||
#define strdup _strdup
|
||||
#define stricmp _stricmp
|
||||
#define strlwr _strlwr
|
||||
#define strnicmp _strnicmp
|
||||
#define strnset _strnset
|
||||
#define strrev _strrev
|
||||
#define strset _strset
|
||||
#define strupr _strupr
|
||||
#define swab _swab
|
||||
#define tell _tell
|
||||
#define tempnam _tempnam
|
||||
#define toascii __toascii
|
||||
#define tzset _tzset
|
||||
#define ultoa _ultoa
|
||||
#define umask _umask
|
||||
#define ungetch _ungetch
|
||||
#define unlink _unlink
|
||||
#define wcsdup _wcsdup
|
||||
#define wcsicmp _wcsicmp
|
||||
#define wcsicoll _wcsicoll
|
||||
#define wcslwr _wcslwr
|
||||
#define wcsnicmp _wcsnicmp
|
||||
#define wcsnset _wcsnset
|
||||
#define wcsrev _wcsrev
|
||||
#define wcsset _wcsset
|
||||
#define wcsupr _wcsupr
|
||||
#define write _write
|
||||
#define y0 _y0
|
||||
#define y1 _y1
|
||||
#define yn _yn
|
||||
|
||||
/* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant
|
||||
* functions above are deprecated. */
|
||||
#pragma warning (disable:4996)
|
||||
|
||||
#endif
|
||||
#else
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
#pragma warning(disable:4103) /* disable warning message 4103 that complains
|
||||
* about pragma pack in a header file */
|
||||
#pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */
|
||||
#endif
|
||||
|
||||
|
||||
@ -2035,14 +1904,6 @@ void FN_AMXX_DETACH(void);
|
||||
void FN_AMXX_PLUGINSLOADED(void);
|
||||
#endif // FN_AMXX_PLUGINSLOADED
|
||||
|
||||
#ifdef FN_AMXX_PLUGINSUNLOADING
|
||||
void FN_AMXX_PLUGINSUNLOADING(void);
|
||||
#endif // FN_AMXX_PLUGINSUNLOADING
|
||||
|
||||
#ifdef FN_AMXX_PLUGINSUNLOADED
|
||||
void FN_AMXX_PLUGINSUNLOADED(void);
|
||||
#endif // FN_AMXX_PLUGINSUNLOADED
|
||||
|
||||
// *** Types ***
|
||||
typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/);
|
||||
|
||||
@ -2089,14 +1950,6 @@ enum PlayerProp
|
||||
Player_NewmenuPage, //int
|
||||
};
|
||||
|
||||
enum LibType
|
||||
{
|
||||
LibType_Library,
|
||||
LibType_Class
|
||||
};
|
||||
|
||||
typedef void (*AUTHORIZEFUNC)(int player, const char *authstring);
|
||||
|
||||
typedef int (*PFN_ADD_NATIVES) (const AMX_NATIVE_INFO * /*list*/);
|
||||
typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...);
|
||||
typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...);
|
||||
@ -2173,14 +2026,7 @@ typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||
typedef void (*PFN_REGISTERFUNCTION) (void * /*pfn*/, const char * /*desc*/);
|
||||
typedef int (*PFN_AMX_PUSH) (AMX * /*amx*/, cell /*value*/);
|
||||
typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char * /*name */);
|
||||
typedef void (*PFN_REG_AUTH_FUNC) (AUTHORIZEFUNC);
|
||||
typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC);
|
||||
typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/);
|
||||
typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/);
|
||||
typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/);
|
||||
typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/);
|
||||
typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/);
|
||||
typedef int (*PFN_SET_TEAM_INFO) (int /*player */, int /*teamid */, const char */*name */);
|
||||
|
||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||
@ -2246,13 +2092,6 @@ extern PFN_REQ_FNPTR g_fn_RequestFunction;
|
||||
extern PFN_AMX_PUSH g_fn_AmxPush;
|
||||
extern PFN_SET_TEAM_INFO g_fn_SetTeamInfo;
|
||||
extern PFN_PLAYER_PROP_ADDR g_fn_PlayerPropAddr;
|
||||
extern PFN_REG_AUTH_FUNC g_fn_RegAuthFunc;
|
||||
extern PFN_UNREG_AUTH_FUNC g_fn_UnregAuthFunc;
|
||||
extern PFN_FINDLIBRARY g_fn_FindLibrary;
|
||||
extern PFN_ADDLIBRARIES g_fn_AddLibraries;
|
||||
extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries;
|
||||
extern PFN_OVERRIDENATIVES g_fn_OverrideNatives;
|
||||
extern PFN_GETLOCALINFO g_fn_GetLocalInfo;
|
||||
|
||||
#ifdef MAY_NEVER_BE_DEFINED
|
||||
// Function prototypes for intellisense and similar systems
|
||||
@ -2315,13 +2154,6 @@ int MF_AmxPush (AMX *amx, cell *params) { }
|
||||
int MF_AmxExec (AMX *amx, cell *retval, int idx) { }
|
||||
int MF_SetPlayerTeamInfo (int id, int teamid, const char *teamname) { }
|
||||
void * MF_PlayerPropAddr (int id, int prop) { }
|
||||
void MF_RegAuthFunc (AUTHORIZEFUNC fn) { }
|
||||
void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { }
|
||||
int MF_FindLibrary (const char *name, LibType type) { }
|
||||
size_t MF_AddLibraries (const char *name, LibType type, void *parent) { }
|
||||
size_t MF_RemoveLibraries (void *parent) { }
|
||||
void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { }
|
||||
const char * MF_GetLocalInfo (const char *name, const char *def) { }
|
||||
#endif // MAY_NEVER_BE_DEFINED
|
||||
|
||||
#define MF_AddNatives g_fn_AddNatives
|
||||
@ -2385,17 +2217,10 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...);
|
||||
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||
#define MF_Format g_fn_Format
|
||||
#define MF_RegisterFunction g_fn_RegisterFunction
|
||||
#define MF_RequestFunction g_fn_RequestFunction
|
||||
#define MF_RequestFunction g_fn_RequestFunction;
|
||||
#define MF_AmxPush g_fn_AmxPush
|
||||
#define MF_SetPlayerTeamInfo g_fn_SetTeamInfo
|
||||
#define MF_PlayerPropAddr g_fn_PlayerPropAddr
|
||||
#define MF_RegAuthFunc g_fn_RegAuthFunc
|
||||
#define MF_UnregAuthFunc g_fn_UnregAuthFunc
|
||||
#define MF_FindLibrary g_fn_FindLibrary
|
||||
#define MF_AddLibraries g_fn_AddLibraries
|
||||
#define MF_RemoveLibraries g_fn_RemoveLibraries
|
||||
#define MF_OverrideNatives g_fn_OverrideNatives
|
||||
#define MF_GetLocalInfo g_fn_GetLocalInfo
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
/*** Memory ***/
|
||||
|
@ -5,12 +5,10 @@
|
||||
|
||||
// Module info
|
||||
#define MODULE_NAME "CSX"
|
||||
#define MODULE_VERSION "1.75"
|
||||
#define MODULE_VERSION "1.71"
|
||||
#define MODULE_AUTHOR "AMX Mod X Dev Team"
|
||||
#define MODULE_URL "http://www.amxmodx.org/"
|
||||
#define MODULE_LOGTAG "CSX"
|
||||
#define MODULE_LIBRARY "csx"
|
||||
#define MODULE_LIBCLASS "xstats"
|
||||
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
|
||||
#define MODULE_RELOAD_ON_MAPCHANGE
|
||||
|
||||
@ -23,47 +21,19 @@
|
||||
// metamod plugin?
|
||||
#define USE_METAMOD
|
||||
|
||||
// use memory manager/tester?
|
||||
// note that if you use this, you cannot construct/allocate
|
||||
// anything before the module attached (OnAmxxAttach).
|
||||
// be careful of default constructors using new/malloc!
|
||||
// #define MEMORY_TEST
|
||||
|
||||
// Unless you use STL or exceptions, keep this commented.
|
||||
// It allows you to compile without libstdc++.so as a dependency
|
||||
// #define NO_ALLOC_OVERRIDES
|
||||
|
||||
// Uncomment this if you are using MSVC8 or greater and want to fix some of the compatibility issues yourself
|
||||
// #define NO_MSVC8_AUTO_COMPAT
|
||||
|
||||
/**
|
||||
* AMXX Init functions
|
||||
* Also consider using FN_META_*
|
||||
*/
|
||||
|
||||
/** AMXX query */
|
||||
// - AMXX Init functions
|
||||
// Also consider using FN_META_*
|
||||
// AMXX query
|
||||
//#define FN_AMXX_QUERY OnAmxxQuery
|
||||
|
||||
/** AMXX attach
|
||||
* Do native functions init here (MF_AddNatives)
|
||||
*/
|
||||
// AMXX attach
|
||||
// Do native functions init here (MF_AddNatives)
|
||||
#define FN_AMXX_ATTACH OnAmxxAttach
|
||||
|
||||
/** AMXX Detach (unload) */
|
||||
// AMXX detach
|
||||
#define FN_AMXX_DETACH OnAmxxDetach
|
||||
|
||||
/** All plugins loaded
|
||||
* Do forward functions init here (MF_RegisterForward)
|
||||
*/
|
||||
// All plugins loaded
|
||||
// Do forward functions init here (MF_RegisterForward)
|
||||
#define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||
|
||||
/** All plugins are about to be unloaded */
|
||||
//#define FN_AMXX_PLUGINSUNLOADING OnPluginsUnloading
|
||||
|
||||
/** All plugins are now unloaded */
|
||||
//#define FN_AMXX_PLUGINSUNLOADED OnPluginsUnloaded
|
||||
|
||||
|
||||
/**** METAMOD ****/
|
||||
// If your module doesn't use metamod, you may close the file now :)
|
||||
#ifdef USE_METAMOD
|
||||
@ -99,13 +69,13 @@
|
||||
// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */
|
||||
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
||||
// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
||||
#define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||
#define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||
#define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||
#define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
||||
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||
// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||
#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||
// #define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||
@ -150,17 +120,17 @@
|
||||
// #define FN_SaveGlobalState_Post SaveGlobalState_Post
|
||||
// #define FN_RestoreGlobalState_Post RestoreGlobalState_Post
|
||||
// #define FN_ResetGlobalState_Post ResetGlobalState_Post
|
||||
#define FN_ClientConnect_Post ClientConnect_Post
|
||||
#define FN_ClientConnect_Post ClientConnect_Post
|
||||
// #define FN_ClientDisconnect_Post ClientDisconnect_Post
|
||||
// #define FN_ClientKill_Post ClientKill_Post
|
||||
#define FN_ClientPutInServer_Post ClientPutInServer_Post
|
||||
#define FN_ClientPutInServer_Post ClientPutInServer_Post
|
||||
// #define FN_ClientCommand_Post ClientCommand_Post
|
||||
#define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
||||
#define FN_ServerActivate_Post ServerActivate_Post
|
||||
#define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
||||
#define FN_ServerActivate_Post ServerActivate_Post
|
||||
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
||||
#define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||
#define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||
// #define FN_PlayerPostThink_Post PlayerPostThink_Post
|
||||
#define FN_StartFrame_Post StartFrame_Post
|
||||
#define FN_StartFrame_Post StartFrame_Post
|
||||
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
||||
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
||||
// #define FN_GetGameDescription_Post GetGameDescription_Post
|
||||
@ -362,9 +332,9 @@
|
||||
// #define FN_DropToFloor_Post DropToFloor_Post
|
||||
// #define FN_WalkMove_Post WalkMove_Post
|
||||
// #define FN_SetOrigin_Post SetOrigin_Post
|
||||
#define FN_EmitSound_Post EmitSound_Post
|
||||
#define FN_EmitSound_Post EmitSound_Post
|
||||
// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post
|
||||
#define FN_TraceLine_Post TraceLine_Post
|
||||
#define FN_TraceLine_Post TraceLine_Post
|
||||
// #define FN_TraceToss_Post TraceToss_Post
|
||||
// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post
|
||||
// #define FN_TraceHull_Post TraceHull_Post
|
||||
@ -380,15 +350,15 @@
|
||||
// #define FN_DecalIndex_Post DecalIndex_Post
|
||||
// #define FN_PointContents_Post PointContents_Post
|
||||
#define FN_MessageBegin_Post MessageBegin_Post
|
||||
#define FN_MessageEnd_Post MessageEnd_Post
|
||||
#define FN_WriteByte_Post WriteByte_Post
|
||||
#define FN_WriteChar_Post WriteChar_Post
|
||||
#define FN_WriteShort_Post WriteShort_Post
|
||||
#define FN_WriteLong_Post WriteLong_Post
|
||||
#define FN_WriteAngle_Post WriteAngle_Post
|
||||
#define FN_WriteCoord_Post WriteCoord_Post
|
||||
#define FN_WriteString_Post WriteString_Post
|
||||
#define FN_WriteEntity_Post WriteEntity_Post
|
||||
#define FN_MessageEnd_Post MessageEnd_Post
|
||||
#define FN_WriteByte_Post WriteByte_Post
|
||||
#define FN_WriteChar_Post WriteChar_Post
|
||||
#define FN_WriteShort_Post WriteShort_Post
|
||||
#define FN_WriteLong_Post WriteLong_Post
|
||||
#define FN_WriteAngle_Post WriteAngle_Post
|
||||
#define FN_WriteCoord_Post WriteCoord_Post
|
||||
#define FN_WriteString_Post WriteString_Post
|
||||
#define FN_WriteEntity_Post WriteEntity_Post
|
||||
// #define FN_CVarRegister_Post CVarRegister_Post
|
||||
// #define FN_CVarGetFloat_Post CVarGetFloat_Post
|
||||
// #define FN_CVarGetString_Post CVarGetString_Post
|
||||
@ -408,7 +378,7 @@
|
||||
// #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post
|
||||
// #define FN_FindEntityByVars_Post FindEntityByVars_Post
|
||||
// #define FN_GetModelPtr_Post GetModelPtr_Post
|
||||
#define FN_RegUserMsg_Post RegUserMsg_Post
|
||||
#define FN_RegUserMsg_Post RegUserMsg_Post
|
||||
// #define FN_AnimationAutomove_Post AnimationAutomove_Post
|
||||
// #define FN_GetBonePosition_Post GetBonePosition_Post
|
||||
// #define FN_FunctionFromName_Post FunctionFromName_Post
|
||||
@ -490,3 +460,4 @@
|
||||
#endif // USE_METAMOD
|
||||
|
||||
#endif // __MODULECONFIG_H__
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "csx", "csx.vcproj", "{1DC4A99A-F23F-4AAE-881C-79D157C91155}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinCSX", "..\WinCSX\msvc8\WinCSX.vcproj", "{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Release|Win32.Build.0 = Release|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -1,409 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="csx"
|
||||
ProjectGUID="{1DC4A99A-F23F-4AAE-881C-79D157C91155}"
|
||||
RootNamespace="csx"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\release"
|
||||
IntermediateDirectory=".\release"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\release/csx.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\metamod,..\..\sdk\common,..\..\sdk\engine,..\..\sdk\dlls"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;csx_EXPORTS;JIT"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
StructMemberAlignment="0"
|
||||
EnableFunctionLevelLinking="false"
|
||||
RuntimeTypeInfo="false"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\release/csx.pch"
|
||||
AssemblerListingLocation=".\release/"
|
||||
ObjectFile=".\release/"
|
||||
ProgramDataBaseFileName=".\release/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="release/csx_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile=".\release/csx_amxx.pdb"
|
||||
ImportLibrary=".\release/csx_amxx.lib"
|
||||
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|Win32"
|
||||
OutputDirectory=".\debug"
|
||||
IntermediateDirectory=".\debug"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\debug/csx.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\metamod,..\..\sdk\common,..\..\sdk\engine,..\..\sdk\dlls,..\..\hlsdk\sourcecode\pm_shared"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;csx_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
RuntimeTypeInfo="false"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\debug/csx.pch"
|
||||
AssemblerListingLocation=".\debug/"
|
||||
ObjectFile=".\debug/"
|
||||
ProgramDataBaseFileName=".\debug/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="debug/csx_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\debug/csx_amxx.pdb"
|
||||
ImportLibrary=".\debug/csx_amxx.lib"
|
||||
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;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\amxxmodule.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;JIT;$(NoInherit)"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;$(NoInherit)"
|
||||
BasicRuntimeChecks="3"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CMisc.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;JIT;$(NoInherit)"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;$(NoInherit)"
|
||||
BasicRuntimeChecks="3"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CRank.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;JIT;$(NoInherit)"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;$(NoInherit)"
|
||||
BasicRuntimeChecks="3"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\meta_api.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;JIT;$(NoInherit)"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;$(NoInherit)"
|
||||
BasicRuntimeChecks="3"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\rank.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;JIT;$(NoInherit)"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;$(NoInherit)"
|
||||
BasicRuntimeChecks="3"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\usermsg.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;JIT;$(NoInherit)"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;$(NoInherit)"
|
||||
BasicRuntimeChecks="3"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\amxxmodule.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CMisc.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CRank.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\moduleconfig.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\rank.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -150,4 +150,4 @@ void CObjective::Sort(){
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user