Move dlls/ to modules/
This commit is contained in:
21
modules/nvault/AMBuilder
Normal file
21
modules/nvault/AMBuilder
Normal file
@ -0,0 +1,21 @@
|
||||
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||
import os.path
|
||||
|
||||
binary = AMXX.MetaModule(builder, 'nvault')
|
||||
|
||||
binary.compiler.defines += [
|
||||
'HAVE_STDINT_H',
|
||||
]
|
||||
|
||||
binary.sources = [
|
||||
'../../public/sdk/amxxmodule.cpp',
|
||||
'amxxapi.cpp',
|
||||
'Binary.cpp',
|
||||
'Journal.cpp',
|
||||
'NVault.cpp',
|
||||
]
|
||||
|
||||
if builder.target_platform == 'windows':
|
||||
binary.sources += ['version.rc']
|
||||
|
||||
AMXX.modules += [builder.Add(binary)]
|
160
modules/nvault/Binary.cpp
Normal file
160
modules/nvault/Binary.cpp
Normal file
@ -0,0 +1,160 @@
|
||||
// vim: set ts=4 sw=4 tw=99 noet:
|
||||
//
|
||||
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
|
||||
// Copyright (C) The AMX Mod X Development Team.
|
||||
//
|
||||
// This software is licensed under the GNU General Public License, version 3 or higher.
|
||||
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
|
||||
// https://alliedmods.net/amxmodx-license
|
||||
|
||||
//
|
||||
// NVault Module
|
||||
//
|
||||
|
||||
#include "Binary.h"
|
||||
#include "amxxmodule.h"
|
||||
|
||||
BinaryWriter::BinaryWriter(FILE *fp)
|
||||
{
|
||||
m_Fp = fp;
|
||||
}
|
||||
|
||||
bool BinaryWriter::WriteAddr(void *buffer, size_t size)
|
||||
{
|
||||
if (fwrite(buffer, size, 1, m_Fp) != 1)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BinaryWriter::WriteUInt32(uint32_t num)
|
||||
{
|
||||
if ( !WriteAddr(&num, sizeof(uint32_t)) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BinaryWriter::WriteInt32(int32_t num)
|
||||
{
|
||||
if ( !WriteAddr(&num, sizeof(int32_t)) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BinaryWriter::WriteUInt16(uint16_t num)
|
||||
{
|
||||
if ( !WriteAddr(&num, sizeof(uint16_t)) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BinaryWriter::WriteInt16(int16_t num)
|
||||
{
|
||||
if ( !WriteAddr(&num, sizeof(int16_t)) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BinaryWriter::WriteUInt8(uint8_t num)
|
||||
{
|
||||
if ( !WriteAddr(&num, sizeof(uint8_t)) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BinaryWriter::WriteInt8(int8_t num)
|
||||
{
|
||||
if ( !WriteAddr(&num, sizeof(int8_t)) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BinaryWriter::WriteChars(const char buffer[], size_t chars)
|
||||
{
|
||||
if (!chars)
|
||||
return true;
|
||||
|
||||
if (fwrite(buffer, sizeof(char), chars, m_Fp) != chars)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
BinaryReader::BinaryReader(FILE *fp)
|
||||
{
|
||||
m_Fp = fp;
|
||||
}
|
||||
|
||||
bool BinaryReader::ReadAddr(void *buffer, size_t size)
|
||||
{
|
||||
if (fread(buffer, size, 1, m_Fp) != 1)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
bool BinaryReader::ReadUInt32(uint32_t& num)
|
||||
{
|
||||
if ( !ReadAddr(&num, sizeof(uint32_t)) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BinaryReader::ReadInt32(int32_t& num)
|
||||
{
|
||||
if ( !ReadAddr(&num, sizeof(int32_t)) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BinaryReader::ReadUInt16(uint16_t& num)
|
||||
{
|
||||
if ( !ReadAddr(&num, sizeof(uint16_t)) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BinaryReader::ReadInt16(int16_t& num)
|
||||
{
|
||||
if ( !ReadAddr(&num, sizeof(int16_t)) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BinaryReader::ReadUInt8(uint8_t& num)
|
||||
{
|
||||
if ( !ReadAddr(&num, sizeof(uint8_t)) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BinaryReader::ReadInt8(int8_t& num)
|
||||
{
|
||||
if ( !ReadAddr(&num, sizeof(int8_t)) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BinaryReader::ReadChars(char buffer[], size_t chars)
|
||||
{
|
||||
if (!chars)
|
||||
return true;
|
||||
|
||||
if (fread(buffer, sizeof(char), chars, m_Fp) != chars)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
61
modules/nvault/Binary.h
Normal file
61
modules/nvault/Binary.h
Normal file
@ -0,0 +1,61 @@
|
||||
// vim: set ts=4 sw=4 tw=99 noet:
|
||||
//
|
||||
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
|
||||
// Copyright (C) The AMX Mod X Development Team.
|
||||
//
|
||||
// This software is licensed under the GNU General Public License, version 3 or higher.
|
||||
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
|
||||
// https://alliedmods.net/amxmodx-license
|
||||
|
||||
//
|
||||
// NVault Module
|
||||
//
|
||||
|
||||
#ifndef _INCLUDE_BINARY_H
|
||||
#define _INCLUDE_BINARY_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include "compat.h"
|
||||
#include "amxxmodule.h"
|
||||
|
||||
class BinaryReader
|
||||
{
|
||||
public:
|
||||
BinaryReader(FILE *fp);
|
||||
//~BinaryReader();
|
||||
public:
|
||||
bool ReadUInt32(uint32_t& num);
|
||||
bool ReadInt32(int32_t& num);
|
||||
bool ReadUInt16(uint16_t& num);
|
||||
bool ReadInt16(int16_t& num);
|
||||
bool ReadUInt8(uint8_t& num);
|
||||
bool ReadInt8(int8_t& num);
|
||||
bool ReadChars(char buffer[], size_t chars);
|
||||
private:
|
||||
bool ReadAddr(void *buffer, size_t size);
|
||||
private:
|
||||
FILE *m_Fp;
|
||||
};
|
||||
|
||||
class BinaryWriter
|
||||
{
|
||||
public:
|
||||
BinaryWriter() { m_Fp = NULL; }
|
||||
BinaryWriter(FILE *fp);
|
||||
public:
|
||||
void SetFilePtr(FILE *fp) { m_Fp = fp; }
|
||||
bool WriteUInt32(uint32_t num);
|
||||
bool WriteInt32(int32_t num);
|
||||
bool WriteUInt16(uint16_t num);
|
||||
bool WriteInt16(int16_t num);
|
||||
bool WriteUInt8(uint8_t num);
|
||||
bool WriteInt8(int8_t num);
|
||||
bool WriteChars(const char buffer[], size_t chars);
|
||||
private:
|
||||
bool WriteAddr(void *buffer, size_t size);
|
||||
private:
|
||||
FILE *m_Fp;
|
||||
};
|
||||
|
||||
#endif //_INCLUDE_BINARY_H
|
||||
|
47
modules/nvault/IVault.h
Normal file
47
modules/nvault/IVault.h
Normal file
@ -0,0 +1,47 @@
|
||||
// vim: set ts=4 sw=4 tw=99 noet:
|
||||
//
|
||||
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
|
||||
// Copyright (C) The AMX Mod X Development Team.
|
||||
//
|
||||
// This software is licensed under the GNU General Public License, version 3 or higher.
|
||||
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
|
||||
// https://alliedmods.net/amxmodx-license
|
||||
|
||||
//
|
||||
// NVault Module
|
||||
//
|
||||
|
||||
#ifndef _INCLUDE_IVAULT_H
|
||||
#define _INCLUDE_IVAULT_H
|
||||
|
||||
#include <time.h>
|
||||
|
||||
class IVault
|
||||
{
|
||||
public:
|
||||
virtual ~IVault() { }
|
||||
public:
|
||||
virtual bool GetValue(const char *key, time_t &stamp, char buffer[], size_t len) =0;
|
||||
virtual void SetValue(const char *key, const char *val) =0;
|
||||
virtual void SetValue(const char *key, const char *val, time_t stamp) =0;
|
||||
virtual size_t Prune(time_t start, time_t end) =0;
|
||||
virtual void Clear() =0;
|
||||
virtual void Remove(const char *key) =0;
|
||||
virtual size_t Items() =0;
|
||||
virtual void Touch(const char *key, time_t stamp) =0;
|
||||
};
|
||||
|
||||
class IVaultMngr
|
||||
{
|
||||
public:
|
||||
virtual ~IVaultMngr() { }
|
||||
public:
|
||||
/**
|
||||
* Note: Will return NULL if the vault failed to create.
|
||||
*/
|
||||
virtual IVault *OpenVault(const char *name) =0;
|
||||
};
|
||||
|
||||
typedef IVaultMngr *(*GETVAULTMNGR_FUNC)();
|
||||
|
||||
#endif //_INCLUDE_IVAULT_H
|
254
modules/nvault/Journal.cpp
Normal file
254
modules/nvault/Journal.cpp
Normal file
@ -0,0 +1,254 @@
|
||||
// vim: set ts=4 sw=4 tw=99 noet:
|
||||
//
|
||||
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
|
||||
// Copyright (C) The AMX Mod X Development Team.
|
||||
//
|
||||
// This software is licensed under the GNU General Public License, version 3 or higher.
|
||||
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
|
||||
// https://alliedmods.net/amxmodx-license
|
||||
|
||||
//
|
||||
// NVault Module
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "Journal.h"
|
||||
|
||||
Journal::Journal(const char *file)
|
||||
{
|
||||
m_File = file;
|
||||
}
|
||||
|
||||
bool Journal::Erase()
|
||||
{
|
||||
return (unlink(m_File.chars()) == 0);
|
||||
}
|
||||
|
||||
int Journal::Replay(VaultMap *pMap)
|
||||
{
|
||||
m_fp = fopen(m_File.chars(), "rb");
|
||||
if (!m_fp)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
BinaryReader br(m_fp);
|
||||
|
||||
uint8_t len8;
|
||||
uint16_t len16;
|
||||
char *key = NULL;
|
||||
char *val = NULL;
|
||||
ke::AString sKey;
|
||||
ke::AString sVal;
|
||||
time_t stamp;
|
||||
JOp op;
|
||||
int ops = 0;
|
||||
uint8_t temp8;
|
||||
|
||||
uint32_t itemp;
|
||||
|
||||
// try
|
||||
// {
|
||||
do
|
||||
{
|
||||
if (!br.ReadUInt8(temp8)) goto fail;
|
||||
op = static_cast<JOp>(temp8);
|
||||
if (op == Journal_Clear)
|
||||
{
|
||||
pMap->clear();
|
||||
}
|
||||
else if (op == Journal_Prune)
|
||||
{
|
||||
time_t start;
|
||||
time_t end;
|
||||
|
||||
if (!br.ReadUInt32(itemp)) goto fail;
|
||||
start = static_cast<time_t>(itemp);
|
||||
|
||||
if (!br.ReadUInt32(itemp)) goto fail;
|
||||
end = static_cast<time_t>(itemp);
|
||||
|
||||
for (StringHashMap<ArrayInfo>::iterator iter = pMap->iter(); !iter.empty(); iter.next())
|
||||
{
|
||||
time_t stamp = iter->value.stamp;
|
||||
bool remove = false;
|
||||
|
||||
if (stamp != 0)
|
||||
{
|
||||
if (start == 0 && end == 0)
|
||||
remove = true;
|
||||
else if (start == 0 && stamp < end)
|
||||
remove = true;
|
||||
else if (end == 0 && stamp > start)
|
||||
remove = true;
|
||||
else if (stamp > start && stamp < end)
|
||||
remove = true;
|
||||
|
||||
if (remove)
|
||||
{
|
||||
iter.erase();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (op == Journal_Insert)
|
||||
{
|
||||
if (!br.ReadUInt32(itemp)) goto fail;
|
||||
stamp = static_cast<time_t>(itemp);
|
||||
|
||||
if (!br.ReadUInt8(len8)) goto fail;
|
||||
|
||||
key = new char[len8+1];
|
||||
if (!br.ReadChars(key, len8)) goto fail;
|
||||
|
||||
if (!br.ReadUInt16(len16)) goto fail;
|
||||
val = new char[len16+1];
|
||||
|
||||
if (!br.ReadChars(val, len16)) goto fail;
|
||||
|
||||
key[len8] = '\0';
|
||||
val[len16] = '\0';
|
||||
|
||||
ArrayInfo info; info.value = val; info.stamp = stamp;
|
||||
pMap->replace(key, info);
|
||||
|
||||
//clean up
|
||||
delete [] key;
|
||||
key = NULL;
|
||||
delete [] val;
|
||||
val = NULL;
|
||||
} else if (op == Journal_Remove) {
|
||||
|
||||
if (!br.ReadUInt8(len8)) goto fail;
|
||||
|
||||
key = new char[len8+1];
|
||||
if (!br.ReadChars(key, len8)) goto fail;
|
||||
key[len8] = '\0';
|
||||
|
||||
pMap->remove(key);
|
||||
}
|
||||
ops++;
|
||||
} while (op < Journal_TotalOps && op);
|
||||
goto success;
|
||||
// } catch (...) {
|
||||
|
||||
fail:
|
||||
//journal is done
|
||||
if (key)
|
||||
{
|
||||
delete [] key;
|
||||
key = NULL;
|
||||
}
|
||||
if (val)
|
||||
{
|
||||
delete [] val;
|
||||
val = NULL;
|
||||
}
|
||||
// }
|
||||
|
||||
success:
|
||||
fclose(m_fp);
|
||||
|
||||
return ops;
|
||||
}
|
||||
|
||||
bool Journal::Begin()
|
||||
{
|
||||
m_fp = fopen(m_File.chars(), "wb");
|
||||
m_Bw.SetFilePtr(m_fp);
|
||||
return (m_fp != NULL);
|
||||
}
|
||||
|
||||
bool Journal::End()
|
||||
{
|
||||
if (m_fp)
|
||||
fclose(m_fp);
|
||||
|
||||
m_Bw.SetFilePtr(NULL);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Journal::Write_Clear()
|
||||
{
|
||||
// try
|
||||
// {
|
||||
if (!WriteOp(Journal_Clear)) goto fail;
|
||||
return true;
|
||||
// } catch (...) {
|
||||
fail:
|
||||
return false;
|
||||
// }
|
||||
}
|
||||
|
||||
bool Journal::Write_Insert(const char *key, const char *val, time_t stamp)
|
||||
{
|
||||
// try
|
||||
// {
|
||||
if (!WriteOp(Journal_Insert)) goto fail;
|
||||
if (!WriteInt32(static_cast<int32_t>(stamp))) goto fail;
|
||||
if (!WriteString(key, Encode_Small)) goto fail;
|
||||
if (!WriteString(val, Encode_Medium)) goto fail;
|
||||
return true;
|
||||
// } catch (...) {
|
||||
fail:
|
||||
return false;
|
||||
// }
|
||||
}
|
||||
|
||||
bool Journal::Write_Prune(time_t start, time_t end)
|
||||
{
|
||||
// try
|
||||
// {
|
||||
if (!WriteOp(Journal_Prune)) goto fail;
|
||||
if (!WriteInt32(static_cast<int32_t>(start))) goto fail;
|
||||
if (!WriteInt32(static_cast<int32_t>(end))) goto fail;
|
||||
return true;
|
||||
// } catch (...) {
|
||||
|
||||
fail:
|
||||
return false;
|
||||
// }
|
||||
}
|
||||
|
||||
bool Journal::Write_Remove(const char *key)
|
||||
{
|
||||
// try
|
||||
// {
|
||||
if (!WriteOp(Journal_Remove)) goto fail;
|
||||
if (!WriteString(key, Encode_Small)) goto fail;
|
||||
return true;
|
||||
// } catch (...) {
|
||||
|
||||
fail:
|
||||
return false;
|
||||
// }
|
||||
}
|
||||
|
||||
bool Journal::WriteInt32(int num)
|
||||
{
|
||||
return m_Bw.WriteInt32(num);
|
||||
}
|
||||
|
||||
bool Journal::WriteOp(JOp op)
|
||||
{
|
||||
return m_Bw.WriteUInt8(static_cast<uint8_t>(op));
|
||||
}
|
||||
|
||||
bool Journal::WriteString(const char *str, Encode enc)
|
||||
{
|
||||
size_t len = strlen(str);
|
||||
if (enc == Encode_Small)
|
||||
{
|
||||
if (!m_Bw.WriteUInt8(static_cast<uint8_t>(len))) return false;
|
||||
} else if (enc == Encode_Medium) {
|
||||
if (!m_Bw.WriteUInt16(static_cast<uint16_t>(len))) return false;
|
||||
}
|
||||
return m_Bw.WriteChars(str, len);
|
||||
|
||||
|
||||
}
|
||||
|
71
modules/nvault/Journal.h
Normal file
71
modules/nvault/Journal.h
Normal file
@ -0,0 +1,71 @@
|
||||
// vim: set ts=4 sw=4 tw=99 noet:
|
||||
//
|
||||
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
|
||||
// Copyright (C) The AMX Mod X Development Team.
|
||||
//
|
||||
// This software is licensed under the GNU General Public License, version 3 or higher.
|
||||
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
|
||||
// https://alliedmods.net/amxmodx-license
|
||||
|
||||
//
|
||||
// NVault Module
|
||||
//
|
||||
|
||||
#ifndef _INCLUDE_JOURNAL_H
|
||||
#define _INCLUDE_JOURNAL_H
|
||||
|
||||
#include "Binary.h"
|
||||
#include <am-linkedlist.h>
|
||||
#include <sm_stringhashmap.h>
|
||||
#include <am-string.h>
|
||||
|
||||
enum JOp
|
||||
{
|
||||
Journal_Nop=0, //no operation
|
||||
Journal_Clear, //clears, no parameters
|
||||
Journal_Prune, //prunes, two params (start, end, 32bit both)
|
||||
Journal_Insert, //inserts stamp (32), key (8+[]), val (16+[])
|
||||
Journal_Remove, //removes key(8+[])
|
||||
Journal_TotalOps,
|
||||
};
|
||||
|
||||
enum Encode
|
||||
{
|
||||
Encode_Small,
|
||||
Encode_Medium,
|
||||
};
|
||||
|
||||
struct ArrayInfo
|
||||
{
|
||||
ke::AString value;
|
||||
time_t stamp;
|
||||
};
|
||||
|
||||
typedef StringHashMap<ArrayInfo> VaultMap;
|
||||
|
||||
class Journal
|
||||
{
|
||||
public:
|
||||
Journal(const char *file);
|
||||
public:
|
||||
bool Begin();
|
||||
bool End();
|
||||
int Replay(VaultMap *pMap);
|
||||
bool Erase();
|
||||
public:
|
||||
bool Write_Clear();
|
||||
bool Write_Prune(time_t start, time_t end);
|
||||
bool Write_Insert(const char *key, const char *val, time_t stamp);
|
||||
bool Write_Remove(const char *key);
|
||||
private:
|
||||
bool WriteOp(JOp op);
|
||||
bool WriteInt32(int num);
|
||||
bool WriteString(const char *str, Encode enc);
|
||||
private:
|
||||
ke::AString m_File;
|
||||
FILE *m_fp;
|
||||
BinaryWriter m_Bw;
|
||||
};
|
||||
|
||||
#endif //_INCLUDE_JOURNAL_H
|
||||
|
124
modules/nvault/Makefile
Normal file
124
modules/nvault/Makefile
Normal file
@ -0,0 +1,124 @@
|
||||
# (C)2004-2013 AMX Mod X Development Team
|
||||
# Makefile written by David "BAILOPAN" Anderson
|
||||
|
||||
###########################################
|
||||
### EDIT THESE PATHS FOR YOUR OWN SETUP ###
|
||||
###########################################
|
||||
|
||||
HLSDK = ../../../hlsdk
|
||||
MM_ROOT = ../../../metamod/metamod
|
||||
PUBLIC_ROOT = ../../public
|
||||
|
||||
#####################################
|
||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
||||
#####################################
|
||||
|
||||
PROJECT = nvault
|
||||
|
||||
OBJECTS = amxxmodule.cpp amxxapi.cpp Binary.cpp Journal.cpp NVault.cpp
|
||||
|
||||
##############################################
|
||||
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
|
||||
##############################################
|
||||
|
||||
C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -fomit-frame-pointer -pipe
|
||||
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
|
||||
C_GCC4_FLAGS = -fvisibility=hidden
|
||||
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
|
||||
CPP = gcc
|
||||
CPP_OSX = clang
|
||||
|
||||
LINK =
|
||||
|
||||
INCLUDE = -I. -I$(PUBLIC_ROOT) -I$(PUBLIC_ROOT)/sdk -I$(PUBLIC_ROOT)/amtl \
|
||||
-I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/pm_shared\
|
||||
-I$(MM_ROOT)
|
||||
|
||||
################################################
|
||||
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
|
||||
################################################
|
||||
|
||||
OS := $(shell uname -s)
|
||||
|
||||
ifeq "$(OS)" "Darwin"
|
||||
CPP = $(CPP_OSX)
|
||||
LIB_EXT = dylib
|
||||
LIB_SUFFIX = _amxx
|
||||
CFLAGS += -DOSX
|
||||
LINK += -dynamiclib -lstdc++ -mmacosx-version-min=10.5
|
||||
else
|
||||
LIB_EXT = so
|
||||
LIB_SUFFIX = _amxx_i386
|
||||
CFLAGS += -DLINUX
|
||||
LINK += -shared
|
||||
endif
|
||||
|
||||
LINK += -m32 -lm -ldl
|
||||
|
||||
CFLAGS += -DPAWN_CELL_SIZE=32 -DJIT -DASM32 -DHAVE_STDINT_H -fno-strict-aliasing -m32 -Wall -Werror
|
||||
CPPFLAGS += -fno-exceptions -fno-rtti
|
||||
|
||||
BINARY = $(PROJECT)$(LIB_SUFFIX).$(LIB_EXT)
|
||||
|
||||
ifeq "$(DEBUG)" "true"
|
||||
BIN_DIR = Debug
|
||||
CFLAGS += $(C_DEBUG_FLAGS)
|
||||
else
|
||||
BIN_DIR = Release
|
||||
CFLAGS += $(C_OPT_FLAGS)
|
||||
LINK += -s
|
||||
endif
|
||||
|
||||
IS_CLANG := $(shell $(CPP) --version | head -1 | grep clang > /dev/null && echo "1" || echo "0")
|
||||
|
||||
ifeq "$(IS_CLANG)" "1"
|
||||
CPP_MAJOR := $(shell $(CPP) --version | grep clang | sed "s/.*version \([0-9]\)*\.[0-9]*.*/\1/")
|
||||
CPP_MINOR := $(shell $(CPP) --version | grep clang | sed "s/.*version [0-9]*\.\([0-9]\)*.*/\1/")
|
||||
else
|
||||
CPP_MAJOR := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
||||
CPP_MINOR := $(shell $(CPP) -dumpversion >&1 | cut -b3)
|
||||
endif
|
||||
|
||||
# Clang || GCC >= 4
|
||||
ifeq "$(shell expr $(IS_CLANG) \| $(CPP_MAJOR) \>= 4)" "1"
|
||||
CFLAGS += $(C_GCC4_FLAGS)
|
||||
CPPFLAGS += $(CPP_GCC4_FLAGS)
|
||||
endif
|
||||
|
||||
# Clang >= 3 || GCC >= 4.7
|
||||
ifeq "$(shell expr $(IS_CLANG) \& $(CPP_MAJOR) \>= 3 \| $(CPP_MAJOR) \>= 4 \& $(CPP_MINOR) \>= 7)" "1"
|
||||
CPPFLAGS += -Wno-delete-non-virtual-dtor
|
||||
endif
|
||||
|
||||
# OS is Linux and not using clang
|
||||
ifeq "$(shell expr $(OS) \= Linux \& $(IS_CLANG) \= 0)" "1"
|
||||
LINK += -static-libgcc
|
||||
endif
|
||||
|
||||
OBJ_BIN := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
||||
|
||||
# This will break if we include other Makefiles, but is fine for now. It allows
|
||||
# us to make a copy of this file that uses altered paths (ie. Makefile.mine)
|
||||
# or other changes without mucking up the original.
|
||||
MAKEFILE_NAME := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
||||
|
||||
$(BIN_DIR)/%.o: %.cpp
|
||||
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
||||
|
||||
all:
|
||||
mkdir -p $(BIN_DIR)
|
||||
ln -sf $(PUBLIC_ROOT)/sdk/amxxmodule.cpp
|
||||
$(MAKE) -f $(MAKEFILE_NAME) $(PROJECT)
|
||||
|
||||
$(PROJECT): $(OBJ_BIN)
|
||||
$(CPP) $(INCLUDE) $(OBJ_BIN) $(LINK) -o $(BIN_DIR)/$(BINARY)
|
||||
|
||||
debug:
|
||||
$(MAKE) -f $(MAKEFILE_NAME) all DEBUG=true
|
||||
|
||||
default: all
|
||||
|
||||
clean:
|
||||
rm -rf $(BIN_DIR)/*.o
|
||||
rm -f $(BIN_DIR)/$(BINARY)
|
||||
|
391
modules/nvault/NVault.cpp
Normal file
391
modules/nvault/NVault.cpp
Normal file
@ -0,0 +1,391 @@
|
||||
// vim: set ts=4 sw=4 tw=99 noet:
|
||||
//
|
||||
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
|
||||
// Copyright (C) The AMX Mod X Development Team.
|
||||
//
|
||||
// This software is licensed under the GNU General Public License, version 3 or higher.
|
||||
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
|
||||
// https://alliedmods.net/amxmodx-license
|
||||
|
||||
//
|
||||
// NVault Module
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#include "amxxmodule.h"
|
||||
#include "NVault.h"
|
||||
#include "Binary.h"
|
||||
#include <am-string.h>
|
||||
|
||||
/**
|
||||
* :TODO: This beast calls strcpy()/new() way too much by creating new strings on the stack.
|
||||
* That's easily remedied and it should be fixed?
|
||||
* ---bail
|
||||
*/
|
||||
|
||||
NVault::NVault(const char *file)
|
||||
{
|
||||
m_File = file;
|
||||
m_Journal = NULL;
|
||||
m_Open = false;
|
||||
|
||||
FILE *fp = fopen(m_File.chars(), "rb");
|
||||
if (!fp)
|
||||
{
|
||||
fp = fopen(m_File.chars(), "wb");
|
||||
if (!fp)
|
||||
{
|
||||
this->m_Valid = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this->m_Valid = true;
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
NVault::~NVault()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
VaultError NVault::_ReadFromFile()
|
||||
{
|
||||
FILE *fp = fopen(m_File.chars(), "rb");
|
||||
|
||||
if (!fp)
|
||||
{
|
||||
return Vault_NoFile;
|
||||
}
|
||||
//this is a little more optimized than the other version in the journal <_<
|
||||
//I could optimize this more by embedding the position in the hash table but...
|
||||
// the hash function can be changed. this could be fixed by storing a string and its
|
||||
// resulting hash, and the entries could be ignored therein, but not right now.
|
||||
//Also the string class could have embedded binary reading (like it does for text files)
|
||||
BinaryReader br(fp);
|
||||
|
||||
uint8_t oldkeylen=0;
|
||||
uint16_t oldvallen=0;
|
||||
uint8_t keylen;
|
||||
uint16_t vallen;
|
||||
time_t stamp;
|
||||
char *key = NULL;
|
||||
char *val = NULL;
|
||||
|
||||
// try
|
||||
// {
|
||||
uint32_t magic;
|
||||
if (!br.ReadUInt32(magic)) goto fail;
|
||||
|
||||
if (magic != VAULT_MAGIC)
|
||||
return Vault_BadFile;
|
||||
|
||||
|
||||
uint16_t version;
|
||||
if (!br.ReadUInt16(version)) goto fail;
|
||||
|
||||
if (version != VAULT_VERSION)
|
||||
return Vault_OldFile;
|
||||
|
||||
int32_t entries;
|
||||
|
||||
if (!br.ReadInt32(entries)) goto fail;
|
||||
|
||||
|
||||
int32_t temp;
|
||||
for (int32_t i=0; i<entries; i++)
|
||||
{
|
||||
if (!br.ReadInt32(temp)) goto fail;
|
||||
|
||||
stamp = static_cast<time_t>(temp);
|
||||
|
||||
if (!br.ReadUInt8(keylen)) goto fail;
|
||||
if (!br.ReadUInt16(vallen)) goto fail;
|
||||
|
||||
if (!keylen || keylen > oldkeylen)
|
||||
{
|
||||
if (key)
|
||||
delete [] key;
|
||||
key = new char[keylen + 1];
|
||||
oldkeylen = keylen;
|
||||
}
|
||||
if (!vallen || vallen > oldvallen)
|
||||
{
|
||||
if (val)
|
||||
delete [] val;
|
||||
val = new char[vallen + 1];
|
||||
oldvallen = vallen;
|
||||
}
|
||||
|
||||
if (!br.ReadChars(key, keylen)) goto fail;
|
||||
if (!br.ReadChars(val, vallen)) goto fail;
|
||||
|
||||
key[keylen] = '\0';
|
||||
val[vallen] = '\0';
|
||||
|
||||
ArrayInfo info; info.value = val; info.stamp = stamp;
|
||||
m_Hash.replace(key, info);
|
||||
}
|
||||
|
||||
// } catch (...) {
|
||||
|
||||
goto success;
|
||||
fail:
|
||||
if (key)
|
||||
{
|
||||
delete [] key;
|
||||
key = NULL;
|
||||
}
|
||||
if (val)
|
||||
{
|
||||
delete [] val;
|
||||
val = NULL;
|
||||
}
|
||||
fclose(fp);
|
||||
return Vault_Read;
|
||||
// }
|
||||
|
||||
success:
|
||||
fclose(fp);
|
||||
|
||||
return Vault_Ok;
|
||||
}
|
||||
|
||||
bool NVault::_SaveToFile()
|
||||
{
|
||||
FILE *fp = fopen(m_File.chars(), "wb");
|
||||
|
||||
if (!fp)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
BinaryWriter bw(fp);
|
||||
|
||||
// try
|
||||
// {
|
||||
uint32_t magic = VAULT_MAGIC;
|
||||
uint16_t version = VAULT_VERSION;
|
||||
|
||||
time_t stamp;
|
||||
ke::AString key;
|
||||
ke::AString val;
|
||||
|
||||
StringHashMap<ArrayInfo>::iterator iter = m_Hash.iter();
|
||||
|
||||
if (!bw.WriteUInt32(magic)) goto fail;
|
||||
if (!bw.WriteUInt16(version)) goto fail;
|
||||
|
||||
if (!bw.WriteUInt32( m_Hash.elements() )) goto fail;
|
||||
|
||||
while (!iter.empty())
|
||||
{
|
||||
key = (*iter).key;
|
||||
val = (*iter).value.value;
|
||||
stamp = (*iter).value.stamp;
|
||||
|
||||
if (!bw.WriteInt32(static_cast<int32_t>(stamp))) goto fail;;
|
||||
if (!bw.WriteUInt8( key.length() )) goto fail;
|
||||
if (!bw.WriteUInt16( val.length() )) goto fail;
|
||||
if (!bw.WriteChars( key.chars(), key.length() )) goto fail;
|
||||
if (!bw.WriteChars( val.chars(), val.length() )) goto fail;
|
||||
|
||||
iter.next();
|
||||
}
|
||||
|
||||
goto success;
|
||||
// } catch (...) {
|
||||
|
||||
fail:
|
||||
fclose(fp);
|
||||
return false;
|
||||
// }
|
||||
success:
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const char *NVault::GetValue(const char *key)
|
||||
{
|
||||
StringHashMap<ArrayInfo>::Result r = m_Hash.find(key);
|
||||
if (!r.found())
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
return r->value.value.chars();
|
||||
}
|
||||
|
||||
bool NVault::Open()
|
||||
{
|
||||
_ReadFromFile();
|
||||
|
||||
char *journal_name = new char[m_File.length() + 10];
|
||||
strcpy(journal_name, m_File.chars());
|
||||
|
||||
char *pos = strstr(journal_name, ".vault");
|
||||
if (pos)
|
||||
{
|
||||
strcpy(pos, ".journal");
|
||||
} else {
|
||||
strcat(journal_name, ".journal");
|
||||
}
|
||||
|
||||
m_Journal = new Journal(journal_name);
|
||||
delete [] journal_name;
|
||||
|
||||
m_Journal->Replay(&m_Hash);
|
||||
m_Journal->Erase();
|
||||
if (!m_Journal->Begin())
|
||||
{
|
||||
delete m_Journal;
|
||||
m_Journal = NULL;
|
||||
}
|
||||
|
||||
m_Open = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NVault::Close()
|
||||
{
|
||||
if (!m_Open)
|
||||
return false;
|
||||
|
||||
_SaveToFile();
|
||||
|
||||
if (m_Journal)
|
||||
{
|
||||
m_Journal->End();
|
||||
m_Journal->Erase();
|
||||
}
|
||||
|
||||
m_Open = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void NVault::SetValue(const char *key, const char *val)
|
||||
{
|
||||
if (m_Journal)
|
||||
m_Journal->Write_Insert(key, val, time(NULL));
|
||||
|
||||
ArrayInfo info; info.value = val; info.stamp = time(NULL);
|
||||
m_Hash.replace(key, info);
|
||||
}
|
||||
|
||||
void NVault::SetValue(const char *key, const char *val, time_t stamp)
|
||||
{
|
||||
if (m_Journal)
|
||||
m_Journal->Write_Insert(key, val, stamp);
|
||||
|
||||
ArrayInfo info; info.value = val; info.stamp = stamp;
|
||||
m_Hash.replace(key, info);
|
||||
}
|
||||
|
||||
void NVault::Remove(const char *key)
|
||||
{
|
||||
if (m_Journal)
|
||||
m_Journal->Write_Remove(key);
|
||||
|
||||
m_Hash.remove(ke::AString(key).chars());
|
||||
}
|
||||
|
||||
void NVault::Clear()
|
||||
{
|
||||
if (m_Journal)
|
||||
m_Journal->Write_Clear();
|
||||
|
||||
m_Hash.clear();
|
||||
}
|
||||
|
||||
size_t NVault::Items()
|
||||
{
|
||||
return m_Hash.elements();
|
||||
}
|
||||
|
||||
size_t NVault::Prune(time_t start, time_t end)
|
||||
{
|
||||
if (m_Journal)
|
||||
m_Journal->Write_Prune(start, end);
|
||||
|
||||
size_t removed = 0;
|
||||
|
||||
for (StringHashMap<ArrayInfo>::iterator iter = m_Hash.iter(); !iter.empty(); iter.next())
|
||||
{
|
||||
time_t stamp = iter->value.stamp;
|
||||
bool remove = false;
|
||||
|
||||
if (stamp != 0)
|
||||
{
|
||||
if (start == 0 && end == 0)
|
||||
remove = true;
|
||||
else if (start == 0 && stamp < end)
|
||||
remove = true;
|
||||
else if (end == 0 && stamp > start)
|
||||
remove = true;
|
||||
else if (stamp > start && stamp < end)
|
||||
remove = true;
|
||||
|
||||
if (remove)
|
||||
{
|
||||
iter.erase();
|
||||
removed++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return removed;
|
||||
}
|
||||
|
||||
void NVault::Touch(const char *key, time_t stamp)
|
||||
{
|
||||
StringHashMap<ArrayInfo>::Insert i = m_Hash.findForAdd(key);
|
||||
if (!i.found())
|
||||
{
|
||||
if (!m_Hash.add(i, key))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetValue(key, "", time(NULL));
|
||||
}
|
||||
|
||||
i->value.stamp = stamp;
|
||||
}
|
||||
|
||||
bool NVault::GetValue(const char *key, time_t &stamp, char buffer[], size_t len)
|
||||
{
|
||||
ArrayInfo result;
|
||||
|
||||
if (!m_Hash.retrieve(key, &result))
|
||||
{
|
||||
buffer[0] = '\0';
|
||||
return false;
|
||||
}
|
||||
|
||||
stamp = result.stamp;
|
||||
UTIL_Format(buffer, len, "%s", result.value.chars());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
IVault *VaultMngr::OpenVault(const char *file)
|
||||
{
|
||||
NVault *pVault;
|
||||
//try
|
||||
//{
|
||||
pVault = new NVault(file);
|
||||
|
||||
// } catch (...) {
|
||||
if (!pVault->isValid())
|
||||
{
|
||||
delete pVault;
|
||||
pVault = NULL;
|
||||
}
|
||||
|
||||
return static_cast<IVault *>(pVault);
|
||||
}
|
||||
|
87
modules/nvault/NVault.h
Normal file
87
modules/nvault/NVault.h
Normal file
@ -0,0 +1,87 @@
|
||||
// vim: set ts=4 sw=4 tw=99 noet:
|
||||
//
|
||||
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
|
||||
// Copyright (C) The AMX Mod X Development Team.
|
||||
//
|
||||
// This software is licensed under the GNU General Public License, version 3 or higher.
|
||||
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
|
||||
// https://alliedmods.net/amxmodx-license
|
||||
|
||||
//
|
||||
// NVault Module
|
||||
//
|
||||
|
||||
#ifndef _INCLUDE_NVAULT_H
|
||||
#define _INCLUDE_NVAULT_H
|
||||
|
||||
#include <am-linkedlist.h>
|
||||
#include <sm_stringhashmap.h>
|
||||
#include "IVault.h"
|
||||
#include "Journal.h"
|
||||
|
||||
#define VAULT_MAGIC 0x6E564C54 //nVLT
|
||||
#define VAULT_VERSION 0x0200 //second version
|
||||
|
||||
// File format:
|
||||
// VAULT_MAGIC (int32)
|
||||
// VAULT_VERSION (int16)
|
||||
// ENTRIES (int32)
|
||||
// [
|
||||
// stamp (int32)
|
||||
// keylen (int8)
|
||||
// vallen (int16)
|
||||
// key ([])
|
||||
// val ([])
|
||||
// ]
|
||||
|
||||
enum VaultError
|
||||
{
|
||||
Vault_Ok=0,
|
||||
Vault_NoFile,
|
||||
Vault_BadFile,
|
||||
Vault_OldFile,
|
||||
Vault_Read,
|
||||
};
|
||||
|
||||
class NVault : public IVault
|
||||
{
|
||||
public:
|
||||
NVault(const char *file);
|
||||
~NVault();
|
||||
public:
|
||||
bool GetValue(const char *key, time_t &stamp, char buffer[], size_t len);
|
||||
const char *GetValue(const char *key);
|
||||
void SetValue(const char *key, const char *val);
|
||||
void SetValue(const char *key, const char *val, time_t stamp);
|
||||
void Touch(const char *key, time_t stamp);
|
||||
size_t Prune(time_t start, time_t end);
|
||||
void Clear();
|
||||
void Remove(const char *key);
|
||||
bool Open();
|
||||
bool Close();
|
||||
size_t Items();
|
||||
const char *GetFilename() { return m_File.chars(); }
|
||||
private:
|
||||
VaultError _ReadFromFile();
|
||||
bool _SaveToFile();
|
||||
private:
|
||||
ke::AString m_File;
|
||||
StringHashMap<ArrayInfo> m_Hash;
|
||||
Journal *m_Journal;
|
||||
bool m_Open;
|
||||
|
||||
bool m_Valid;
|
||||
|
||||
public:
|
||||
bool isValid() { return m_Valid; }
|
||||
};
|
||||
|
||||
class VaultMngr : public IVaultMngr
|
||||
{
|
||||
public:
|
||||
//when you delete it, it will be closed+saved automatically
|
||||
//when you open it, it will read the file automatically, as well as begin/restore journaling
|
||||
IVault *OpenVault(const char *file);
|
||||
};
|
||||
|
||||
#endif //_INCLUDE_NVAULT_H
|
285
modules/nvault/amxxapi.cpp
Normal file
285
modules/nvault/amxxapi.cpp
Normal file
@ -0,0 +1,285 @@
|
||||
// vim: set ts=4 sw=4 tw=99 noet:
|
||||
//
|
||||
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
|
||||
// Copyright (C) The AMX Mod X Development Team.
|
||||
//
|
||||
// This software is licensed under the GNU General Public License, version 3 or higher.
|
||||
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
|
||||
// https://alliedmods.net/amxmodx-license
|
||||
|
||||
//
|
||||
// NVault Module
|
||||
//
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "amxxapi.h"
|
||||
#include "NVault.h"
|
||||
#include <sm_queue.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#define MKDIR(p) mkdir(p)
|
||||
#else
|
||||
#define MKDIR(p) mkdir(p, 0755)
|
||||
#endif
|
||||
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#else
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
ke::Vector<NVault *> g_Vaults;
|
||||
Queue<int> g_OldVaults;
|
||||
|
||||
VaultMngr g_VaultMngr;
|
||||
|
||||
#ifndef _WIN32
|
||||
extern "C" void __cxa_pure_virtual(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
static cell nvault_open(AMX *amx, cell *params)
|
||||
{
|
||||
int len, id=-1;
|
||||
char *name = MF_GetAmxString(amx, params[1], 0, &len);
|
||||
char path[255], file[255];
|
||||
MF_BuildPathnameR(path, sizeof(path)-1, "%s/vault", MF_GetLocalInfo("amxx_datadir", "addons/amxmodx/data"));
|
||||
sprintf(file, "%s/%s.vault", path, name);
|
||||
for (size_t i=0; i<g_Vaults.length(); i++)
|
||||
{
|
||||
if (!g_Vaults[i])
|
||||
continue;
|
||||
if (strcmp(g_Vaults.at(i)->GetFilename(), file) == 0)
|
||||
return i;
|
||||
}
|
||||
NVault *v = (NVault *)g_VaultMngr.OpenVault(file);
|
||||
if (v == NULL || !v->Open())
|
||||
{
|
||||
delete v;
|
||||
return -1;
|
||||
}
|
||||
if (!g_OldVaults.empty())
|
||||
{
|
||||
id = g_OldVaults.first();
|
||||
g_OldVaults.pop();
|
||||
}
|
||||
if (id != -1)
|
||||
{
|
||||
g_Vaults[id] = v;
|
||||
} else {
|
||||
g_Vaults.append(v);
|
||||
id = (int)g_Vaults.length()-1;
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
static cell nvault_touch(AMX *amx, cell *params)
|
||||
{
|
||||
unsigned int id = params[1];
|
||||
if (id >= g_Vaults.length() || !g_Vaults.at(id))
|
||||
{
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id);
|
||||
return 0;
|
||||
}
|
||||
NVault *pVault = g_Vaults.at(id);
|
||||
int len;
|
||||
char *key = MF_GetAmxString(amx, params[2], 0, &len);
|
||||
|
||||
if (params[3] == -1)
|
||||
{
|
||||
pVault->Touch(key, time(NULL));
|
||||
} else {
|
||||
pVault->Touch(key, static_cast<time_t>(params[3]));
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell nvault_get(AMX *amx, cell *params)
|
||||
{
|
||||
unsigned int id = params[1];
|
||||
if (id >= g_Vaults.length() || !g_Vaults.at(id))
|
||||
{
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id);
|
||||
return 0;
|
||||
}
|
||||
NVault *pVault = g_Vaults.at(id);
|
||||
unsigned int numParams = (*params)/sizeof(cell);
|
||||
int len;
|
||||
char *key = MF_GetAmxString(amx, params[2], 0, &len);
|
||||
const char *val = pVault->GetValue(key);
|
||||
switch (numParams)
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
return atoi(val);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
cell *fAddr = MF_GetAmxAddr(amx, params[3]);
|
||||
*fAddr = amx_ftoc((REAL)atof(val));
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
len = *(MF_GetAmxAddr(amx, params[4]));
|
||||
return MF_SetAmxString(amx, params[3], val, len);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell nvault_lookup(AMX *amx, cell *params)
|
||||
{
|
||||
unsigned int id = params[1];
|
||||
if (id >= g_Vaults.length() || !g_Vaults.at(id))
|
||||
{
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id);
|
||||
return 0;
|
||||
}
|
||||
NVault *pVault = g_Vaults.at(id);
|
||||
int len;
|
||||
time_t stamp;
|
||||
char *key = MF_GetAmxString(amx, params[2], 0, &len);
|
||||
char *buffer = new char[params[4]+1];
|
||||
if (!pVault->GetValue(key, stamp, buffer, params[4]))
|
||||
{
|
||||
delete [] buffer;
|
||||
return 0;
|
||||
}
|
||||
MF_SetAmxString(amx, params[3], buffer, params[4]);
|
||||
cell *addr = MF_GetAmxAddr(amx, params[5]);
|
||||
addr[0] = (cell)stamp;
|
||||
delete [] buffer;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell nvault_set(AMX *amx, cell *params)
|
||||
{
|
||||
unsigned int id = params[1];
|
||||
if (id >= g_Vaults.length() || !g_Vaults.at(id))
|
||||
{
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id);
|
||||
return 0;
|
||||
}
|
||||
NVault *pVault = g_Vaults.at(id);
|
||||
int len;
|
||||
const char *key = MF_GetAmxString(amx, params[2], 0, &len);
|
||||
const char *val = MF_GetAmxString(amx, params[3], 1, &len);
|
||||
|
||||
pVault->SetValue(key, val);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell nvault_pset(AMX *amx, cell *params)
|
||||
{
|
||||
unsigned int id = params[1];
|
||||
if (id >= g_Vaults.length() || !g_Vaults.at(id))
|
||||
{
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id);
|
||||
return 0;
|
||||
}
|
||||
NVault *pVault = g_Vaults.at(id);
|
||||
int len;
|
||||
const char *key = MF_GetAmxString(amx, params[2], 0, &len);
|
||||
const char *val = MF_GetAmxString(amx, params[3], 1, &len);
|
||||
|
||||
pVault->SetValue(key, val, 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell nvault_close(AMX *amx, cell *params)
|
||||
{
|
||||
unsigned int id = params[1];
|
||||
if (id >= g_Vaults.length() || !g_Vaults.at(id))
|
||||
{
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id);
|
||||
return 0;
|
||||
}
|
||||
NVault *pVault = g_Vaults.at(id);
|
||||
pVault->Close();
|
||||
delete pVault;
|
||||
g_Vaults[id] = NULL;
|
||||
g_OldVaults.push(id);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL nvault_prune(AMX *amx, cell *params)
|
||||
{
|
||||
unsigned int id = params[1];
|
||||
if (id >= g_Vaults.length() || !g_Vaults.at(id))
|
||||
{
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id);
|
||||
return 0;
|
||||
}
|
||||
NVault *pVault = g_Vaults.at(id);
|
||||
time_t start = (time_t )params[2];
|
||||
time_t end = (time_t )params[3];
|
||||
|
||||
return pVault->Prune(start, end);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL nvault_remove(AMX *amx, cell *params)
|
||||
{
|
||||
unsigned int id = params[1];
|
||||
if (id >= g_Vaults.length() || !g_Vaults.at(id))
|
||||
{
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid vault id: %d\n", id);
|
||||
return 0;
|
||||
}
|
||||
NVault *pVault = g_Vaults.at(id);
|
||||
int len;
|
||||
const char *key = MF_GetAmxString(amx, params[2], 0, &len);
|
||||
pVault->Remove(key);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
IVaultMngr *GetVaultMngr()
|
||||
{
|
||||
return static_cast<IVaultMngr *>(&g_VaultMngr);
|
||||
}
|
||||
|
||||
void OnAmxxAttach()
|
||||
{
|
||||
//create the dir if it doesn't exist
|
||||
MKDIR(MF_BuildPathname("%s/vault", MF_GetLocalInfo("amxx_datadir", "addons/amxmodx/data")));
|
||||
MF_AddNatives(nVault_natives);
|
||||
MF_RegisterFunction((void *)GetVaultMngr, "GetVaultMngr");
|
||||
}
|
||||
|
||||
void OnPluginsUnloaded()
|
||||
{
|
||||
for (size_t i=0; i<g_Vaults.length(); i++)
|
||||
{
|
||||
if (g_Vaults[i])
|
||||
delete g_Vaults[i];
|
||||
}
|
||||
g_Vaults.clear();
|
||||
while (!g_OldVaults.empty())
|
||||
g_OldVaults.pop();
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO nVault_natives[] = {
|
||||
{"nvault_open", nvault_open},
|
||||
{"nvault_get", nvault_get},
|
||||
{"nvault_lookup", nvault_lookup},
|
||||
{"nvault_set", nvault_set},
|
||||
{"nvault_pset", nvault_pset},
|
||||
{"nvault_close", nvault_close},
|
||||
{"nvault_prune", nvault_prune},
|
||||
{"nvault_remove", nvault_remove},
|
||||
{"nvault_touch", nvault_touch},
|
||||
{NULL, NULL},
|
||||
};
|
25
modules/nvault/amxxapi.h
Normal file
25
modules/nvault/amxxapi.h
Normal file
@ -0,0 +1,25 @@
|
||||
// vim: set ts=4 sw=4 tw=99 noet:
|
||||
//
|
||||
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
|
||||
// Copyright (C) The AMX Mod X Development Team.
|
||||
//
|
||||
// This software is licensed under the GNU General Public License, version 3 or higher.
|
||||
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
|
||||
// https://alliedmods.net/amxmodx-license
|
||||
|
||||
//
|
||||
// NVault Module
|
||||
//
|
||||
|
||||
#ifndef _INCLUDE_AMXXAPI_H
|
||||
#define _INCLUDE_AMXXAPI_H
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include <am-vector.h>
|
||||
#include <am-string.h>
|
||||
#include <sm_queue.h>
|
||||
|
||||
extern AMX_NATIVE_INFO nVault_natives[];
|
||||
|
||||
#endif //_INCLUDE_AMXXAPI_H
|
||||
|
37
modules/nvault/compat.h
Normal file
37
modules/nvault/compat.h
Normal file
@ -0,0 +1,37 @@
|
||||
// vim: set ts=4 sw=4 tw=99 noet:
|
||||
//
|
||||
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
|
||||
// Copyright (C) The AMX Mod X Development Team.
|
||||
//
|
||||
// This software is licensed under the GNU General Public License, version 3 or higher.
|
||||
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
|
||||
// https://alliedmods.net/amxmodx-license
|
||||
|
||||
//
|
||||
// NVault Module
|
||||
//
|
||||
|
||||
#ifndef _INCLUDE_COMPAT_H
|
||||
#define _INCLUDE_COMPAT_H
|
||||
|
||||
#ifdef WIN32
|
||||
#if (_MSC_VER < 1300)
|
||||
typedef signed char int8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
#else
|
||||
typedef signed __int8 int8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
#endif
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#endif //_INCLUDE_COMPAT_H
|
504
modules/nvault/moduleconfig.h
Normal file
504
modules/nvault/moduleconfig.h
Normal file
@ -0,0 +1,504 @@
|
||||
// vim: set ts=4 sw=4 tw=99 noet:
|
||||
//
|
||||
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
|
||||
// Copyright (C) The AMX Mod X Development Team.
|
||||
//
|
||||
// This software is licensed under the GNU General Public License, version 3 or higher.
|
||||
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
|
||||
// https://alliedmods.net/amxmodx-license
|
||||
|
||||
//
|
||||
// Module Config
|
||||
//
|
||||
|
||||
#ifndef __MODULECONFIG_H__
|
||||
#define __MODULECONFIG_H__
|
||||
|
||||
#include <amxmodx_version.h>
|
||||
|
||||
// Module info
|
||||
#define MODULE_NAME "nVault"
|
||||
#define MODULE_VERSION AMXX_VERSION
|
||||
#define MODULE_AUTHOR "AMX Mod X Dev Team"
|
||||
#define MODULE_URL "http://www.amxmodx.org/"
|
||||
#define MODULE_LOGTAG "nVault"
|
||||
#define MODULE_LIBRARY "nvault"
|
||||
#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
|
||||
|
||||
#ifdef __DATE__
|
||||
#define MODULE_DATE __DATE__
|
||||
#else // __DATE__
|
||||
#define MODULE_DATE "Unknown"
|
||||
#endif // __DATE__
|
||||
|
||||
// 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 */
|
||||
//#define FN_AMXX_QUERY OnAmxxQuery
|
||||
|
||||
/** 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
|
||||
|
||||
/**** METAMOD ****/
|
||||
// If your module doesn't use metamod, you may close the file now :)
|
||||
#ifdef USE_METAMOD
|
||||
// ----
|
||||
// Hook Functions
|
||||
// Uncomment these to be called
|
||||
// You can also change the function name
|
||||
|
||||
// - Metamod init functions
|
||||
// Also consider using FN_AMXX_*
|
||||
// Meta query
|
||||
//#define FN_META_QUERY OnMetaQuery
|
||||
// Meta attach
|
||||
//#define FN_META_ATTACH OnMetaAttach
|
||||
// Meta detach
|
||||
//#define FN_META_DETACH OnMetaDetach
|
||||
|
||||
// (wd) are Will Day's notes
|
||||
// - GetEntityAPI2 functions
|
||||
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
|
||||
// #define FN_DispatchSpawn DispatchSpawn /* pfnSpawn() */
|
||||
// #define FN_DispatchThink DispatchThink /* pfnThink() */
|
||||
// #define FN_DispatchUse DispatchUse /* pfnUse() */
|
||||
// #define FN_DispatchTouch DispatchTouch /* pfnTouch() */
|
||||
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
|
||||
// #define FN_DispatchKeyValue DispatchKeyValue /* pfnKeyValue() */
|
||||
// #define FN_DispatchSave DispatchSave /* pfnSave() */
|
||||
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
|
||||
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
|
||||
// #define FN_SaveWriteFields SaveWriteFields /* pfnSaveWriteFields() */
|
||||
// #define FN_SaveReadFields SaveReadFields /* pfnSaveReadFields() */
|
||||
// #define FN_SaveGlobalState SaveGlobalState /* pfnSaveGlobalState() */
|
||||
// #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_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_StartFrame StartFrame /* pfnStartFrame() */
|
||||
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
||||
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
||||
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
|
||||
// #define FN_PlayerCustomization PlayerCustomization /* pfnPlayerCustomization() Notifies .dll of new customization for player. */
|
||||
// #define FN_SpectatorConnect SpectatorConnect /* pfnSpectatorConnect() Called when spectator joins server */
|
||||
// #define FN_SpectatorDisconnect SpectatorDisconnect /* pfnSpectatorDisconnect() Called when spectator leaves the server */
|
||||
// #define FN_SpectatorThink SpectatorThink /* pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t) */
|
||||
// #define FN_Sys_Error Sys_Error /* pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2 */
|
||||
// #define FN_PM_Move PM_Move /* pfnPM_Move() (wd) SDK2 */
|
||||
// #define FN_PM_Init PM_Init /* pfnPM_Init() Server version of player movement initialization; (wd) SDK2 */
|
||||
// #define FN_PM_FindTextureType PM_FindTextureType /* pfnPM_FindTextureType() (wd) SDK2 */
|
||||
// #define FN_SetupVisibility SetupVisibility /* pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2 */
|
||||
// #define FN_UpdateClientData UpdateClientData /* pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2 */
|
||||
// #define FN_AddToFullPack AddToFullPack /* pfnAddToFullPack() (wd) SDK2 */
|
||||
// #define FN_CreateBaseline CreateBaseline /* pfnCreateBaseline() Tweak entity baseline for network encoding allows setup of player baselines too.; (wd) SDK2 */
|
||||
// #define FN_RegisterEncoders RegisterEncoders /* pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 */
|
||||
// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */
|
||||
// #define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */
|
||||
// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */
|
||||
// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */
|
||||
// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */
|
||||
// #define FN_CreateInstancedBaselines CreateInstancedBaselines /* pfnCreateInstancedBaselines() (wd) SDK2 */
|
||||
// #define FN_InconsistentFile InconsistentFile /* pfnInconsistentFile() (wd) SDK2 */
|
||||
// #define FN_AllowLagCompensation AllowLagCompensation /* pfnAllowLagCompensation() (wd) SDK2 */
|
||||
|
||||
// - GetEntityAPI2_Post functions
|
||||
// #define FN_GameDLLInit_Post GameDLLInit_Post
|
||||
// #define FN_DispatchSpawn_Post DispatchSpawn_Post
|
||||
// #define FN_DispatchThink_Post DispatchThink_Post
|
||||
// #define FN_DispatchUse_Post DispatchUse_Post
|
||||
// #define FN_DispatchTouch_Post DispatchTouch_Post
|
||||
// #define FN_DispatchBlocked_Post DispatchBlocked_Post
|
||||
// #define FN_DispatchKeyValue_Post DispatchKeyValue_Post
|
||||
// #define FN_DispatchSave_Post DispatchSave_Post
|
||||
// #define FN_DispatchRestore_Post DispatchRestore_Post
|
||||
// #define FN_DispatchObjectCollsionBox_Post DispatchObjectCollsionBox_Post
|
||||
// #define FN_SaveWriteFields_Post SaveWriteFields_Post
|
||||
// #define FN_SaveReadFields_Post SaveReadFields_Post
|
||||
// #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_ClientDisconnect_Post ClientDisconnect_Post
|
||||
// #define FN_ClientKill_Post ClientKill_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_ServerDeactivate_Post ServerDeactivate_Post
|
||||
// #define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||
// #define FN_PlayerPostThink_Post PlayerPostThink_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
|
||||
// #define FN_PlayerCustomization_Post PlayerCustomization_Post
|
||||
// #define FN_SpectatorConnect_Post SpectatorConnect_Post
|
||||
// #define FN_SpectatorDisconnect_Post SpectatorDisconnect_Post
|
||||
// #define FN_SpectatorThink_Post SpectatorThink_Post
|
||||
// #define FN_Sys_Error_Post Sys_Error_Post
|
||||
// #define FN_PM_Move_Post PM_Move_Post
|
||||
// #define FN_PM_Init_Post PM_Init_Post
|
||||
// #define FN_PM_FindTextureType_Post PM_FindTextureType_Post
|
||||
// #define FN_SetupVisibility_Post SetupVisibility_Post
|
||||
// #define FN_UpdateClientData_Post UpdateClientData_Post
|
||||
// #define FN_AddToFullPack_Post AddToFullPack_Post
|
||||
// #define FN_CreateBaseline_Post CreateBaseline_Post
|
||||
// #define FN_RegisterEncoders_Post RegisterEncoders_Post
|
||||
// #define FN_GetWeaponData_Post GetWeaponData_Post
|
||||
// #define FN_CmdStart_Post CmdStart_Post
|
||||
// #define FN_CmdEnd_Post CmdEnd_Post
|
||||
// #define FN_ConnectionlessPacket_Post ConnectionlessPacket_Post
|
||||
// #define FN_GetHullBounds_Post GetHullBounds_Post
|
||||
// #define FN_CreateInstancedBaselines_Post CreateInstancedBaselines_Post
|
||||
// #define FN_InconsistentFile_Post InconsistentFile_Post
|
||||
// #define FN_AllowLagCompensation_Post AllowLagCompensation_Post
|
||||
|
||||
// - GetEngineAPI functions
|
||||
// #define FN_PrecacheModel PrecacheModel
|
||||
// #define FN_PrecacheSound PrecacheSound
|
||||
// #define FN_SetModel SetModel
|
||||
// #define FN_ModelIndex ModelIndex
|
||||
// #define FN_ModelFrames ModelFrames
|
||||
// #define FN_SetSize SetSize
|
||||
// #define FN_ChangeLevel ChangeLevel
|
||||
// #define FN_GetSpawnParms GetSpawnParms
|
||||
// #define FN_SaveSpawnParms SaveSpawnParms
|
||||
// #define FN_VecToYaw VecToYaw
|
||||
// #define FN_VecToAngles VecToAngles
|
||||
// #define FN_MoveToOrigin MoveToOrigin
|
||||
// #define FN_ChangeYaw ChangeYaw
|
||||
// #define FN_ChangePitch ChangePitch
|
||||
// #define FN_FindEntityByString FindEntityByString
|
||||
// #define FN_GetEntityIllum GetEntityIllum
|
||||
// #define FN_FindEntityInSphere FindEntityInSphere
|
||||
// #define FN_FindClientInPVS FindClientInPVS
|
||||
// #define FN_EntitiesInPVS EntitiesInPVS
|
||||
// #define FN_MakeVectors MakeVectors
|
||||
// #define FN_AngleVectors AngleVectors
|
||||
// #define FN_CreateEntity CreateEntity
|
||||
// #define FN_RemoveEntity RemoveEntity
|
||||
// #define FN_CreateNamedEntity CreateNamedEntity
|
||||
// #define FN_MakeStatic MakeStatic
|
||||
// #define FN_EntIsOnFloor EntIsOnFloor
|
||||
// #define FN_DropToFloor DropToFloor
|
||||
// #define FN_WalkMove WalkMove
|
||||
// #define FN_SetOrigin SetOrigin
|
||||
// #define FN_EmitSound EmitSound
|
||||
// #define FN_EmitAmbientSound EmitAmbientSound
|
||||
// #define FN_TraceLine TraceLine
|
||||
// #define FN_TraceToss TraceToss
|
||||
// #define FN_TraceMonsterHull TraceMonsterHull
|
||||
// #define FN_TraceHull TraceHull
|
||||
// #define FN_TraceModel TraceModel
|
||||
// #define FN_TraceTexture TraceTexture
|
||||
// #define FN_TraceSphere TraceSphere
|
||||
// #define FN_GetAimVector GetAimVector
|
||||
// #define FN_ServerCommand ServerCommand
|
||||
// #define FN_ServerExecute ServerExecute
|
||||
// #define FN_engClientCommand engClientCommand
|
||||
// #define FN_ParticleEffect ParticleEffect
|
||||
// #define FN_LightStyle LightStyle
|
||||
// #define FN_DecalIndex DecalIndex
|
||||
// #define FN_PointContents PointContents
|
||||
// #define FN_MessageBegin MessageBegin
|
||||
// #define FN_MessageEnd MessageEnd
|
||||
// #define FN_WriteByte WriteByte
|
||||
// #define FN_WriteChar WriteChar
|
||||
// #define FN_WriteShort WriteShort
|
||||
// #define FN_WriteLong WriteLong
|
||||
// #define FN_WriteAngle WriteAngle
|
||||
// #define FN_WriteCoord WriteCoord
|
||||
// #define FN_WriteString WriteString
|
||||
// #define FN_WriteEntity WriteEntity
|
||||
// #define FN_CVarRegister CVarRegister
|
||||
// #define FN_CVarGetFloat CVarGetFloat
|
||||
// #define FN_CVarGetString CVarGetString
|
||||
// #define FN_CVarSetFloat CVarSetFloat
|
||||
// #define FN_CVarSetString CVarSetString
|
||||
// #define FN_AlertMessage AlertMessage
|
||||
// #define FN_EngineFprintf EngineFprintf
|
||||
// #define FN_PvAllocEntPrivateData PvAllocEntPrivateData
|
||||
// #define FN_PvEntPrivateData PvEntPrivateData
|
||||
// #define FN_FreeEntPrivateData FreeEntPrivateData
|
||||
// #define FN_SzFromIndex SzFromIndex
|
||||
// #define FN_AllocString AllocString
|
||||
// #define FN_GetVarsOfEnt GetVarsOfEnt
|
||||
// #define FN_PEntityOfEntOffset PEntityOfEntOffset
|
||||
// #define FN_EntOffsetOfPEntity EntOffsetOfPEntity
|
||||
// #define FN_IndexOfEdict IndexOfEdict
|
||||
// #define FN_PEntityOfEntIndex PEntityOfEntIndex
|
||||
// #define FN_FindEntityByVars FindEntityByVars
|
||||
// #define FN_GetModelPtr GetModelPtr
|
||||
// #define FN_RegUserMsg RegUserMsg
|
||||
// #define FN_AnimationAutomove AnimationAutomove
|
||||
// #define FN_GetBonePosition GetBonePosition
|
||||
// #define FN_FunctionFromName FunctionFromName
|
||||
// #define FN_NameForFunction NameForFunction
|
||||
// #define FN_ClientPrintf ClientPrintf
|
||||
// #define FN_ServerPrint ServerPrint
|
||||
// #define FN_Cmd_Args Cmd_Args
|
||||
// #define FN_Cmd_Argv Cmd_Argv
|
||||
// #define FN_Cmd_Argc Cmd_Argc
|
||||
// #define FN_GetAttachment GetAttachment
|
||||
// #define FN_CRC32_Init CRC32_Init
|
||||
// #define FN_CRC32_ProcessBuffer CRC32_ProcessBuffer
|
||||
// #define FN_CRC32_ProcessByte CRC32_ProcessByte
|
||||
// #define FN_CRC32_Final CRC32_Final
|
||||
// #define FN_RandomLong RandomLong
|
||||
// #define FN_RandomFloat RandomFloat
|
||||
// #define FN_SetView SetView
|
||||
// #define FN_Time Time
|
||||
// #define FN_CrosshairAngle CrosshairAngle
|
||||
// #define FN_LoadFileForMe LoadFileForMe
|
||||
// #define FN_FreeFile FreeFile
|
||||
// #define FN_EndSection EndSection
|
||||
// #define FN_CompareFileTime CompareFileTime
|
||||
// #define FN_GetGameDir GetGameDir
|
||||
// #define FN_Cvar_RegisterVariable Cvar_RegisterVariable
|
||||
// #define FN_FadeClientVolume FadeClientVolume
|
||||
// #define FN_SetClientMaxspeed SetClientMaxspeed
|
||||
// #define FN_CreateFakeClient CreateFakeClient
|
||||
// #define FN_RunPlayerMove RunPlayerMove
|
||||
// #define FN_NumberOfEntities NumberOfEntities
|
||||
// #define FN_GetInfoKeyBuffer GetInfoKeyBuffer
|
||||
// #define FN_InfoKeyValue InfoKeyValue
|
||||
// #define FN_SetKeyValue SetKeyValue
|
||||
// #define FN_SetClientKeyValue SetClientKeyValue
|
||||
// #define FN_IsMapValid IsMapValid
|
||||
// #define FN_StaticDecal StaticDecal
|
||||
// #define FN_PrecacheGeneric PrecacheGeneric
|
||||
// #define FN_GetPlayerUserId GetPlayerUserId
|
||||
// #define FN_BuildSoundMsg BuildSoundMsg
|
||||
// #define FN_IsDedicatedServer IsDedicatedServer
|
||||
// #define FN_CVarGetPointer CVarGetPointer
|
||||
// #define FN_GetPlayerWONId GetPlayerWONId
|
||||
// #define FN_Info_RemoveKey Info_RemoveKey
|
||||
// #define FN_GetPhysicsKeyValue GetPhysicsKeyValue
|
||||
// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue
|
||||
// #define FN_GetPhysicsInfoString GetPhysicsInfoString
|
||||
// #define FN_PrecacheEvent PrecacheEvent
|
||||
// #define FN_PlaybackEvent PlaybackEvent
|
||||
// #define FN_SetFatPVS SetFatPVS
|
||||
// #define FN_SetFatPAS SetFatPAS
|
||||
// #define FN_CheckVisibility CheckVisibility
|
||||
// #define FN_DeltaSetField DeltaSetField
|
||||
// #define FN_DeltaUnsetField DeltaUnsetField
|
||||
// #define FN_DeltaAddEncoder DeltaAddEncoder
|
||||
// #define FN_GetCurrentPlayer GetCurrentPlayer
|
||||
// #define FN_CanSkipPlayer CanSkipPlayer
|
||||
// #define FN_DeltaFindField DeltaFindField
|
||||
// #define FN_DeltaSetFieldByIndex DeltaSetFieldByIndex
|
||||
// #define FN_DeltaUnsetFieldByIndex DeltaUnsetFieldByIndex
|
||||
// #define FN_SetGroupMask SetGroupMask
|
||||
// #define FN_engCreateInstancedBaseline engCreateInstancedBaseline
|
||||
// #define FN_Cvar_DirectSet Cvar_DirectSet
|
||||
// #define FN_ForceUnmodified ForceUnmodified
|
||||
// #define FN_GetPlayerStats GetPlayerStats
|
||||
// #define FN_AddServerCommand AddServerCommand
|
||||
// #define FN_Voice_GetClientListening Voice_GetClientListening
|
||||
// #define FN_Voice_SetClientListening Voice_SetClientListening
|
||||
// #define FN_GetPlayerAuthId GetPlayerAuthId
|
||||
|
||||
// - GetEngineAPI_Post functions
|
||||
// #define FN_PrecacheModel_Post PrecacheModel_Post
|
||||
// #define FN_PrecacheSound_Post PrecacheSound_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
|
||||
// #define FN_ChangeLevel_Post ChangeLevel_Post
|
||||
// #define FN_GetSpawnParms_Post GetSpawnParms_Post
|
||||
// #define FN_SaveSpawnParms_Post SaveSpawnParms_Post
|
||||
// #define FN_VecToYaw_Post VecToYaw_Post
|
||||
// #define FN_VecToAngles_Post VecToAngles_Post
|
||||
// #define FN_MoveToOrigin_Post MoveToOrigin_Post
|
||||
// #define FN_ChangeYaw_Post ChangeYaw_Post
|
||||
// #define FN_ChangePitch_Post ChangePitch_Post
|
||||
// #define FN_FindEntityByString_Post FindEntityByString_Post
|
||||
// #define FN_GetEntityIllum_Post GetEntityIllum_Post
|
||||
// #define FN_FindEntityInSphere_Post FindEntityInSphere_Post
|
||||
// #define FN_FindClientInPVS_Post FindClientInPVS_Post
|
||||
// #define FN_EntitiesInPVS_Post EntitiesInPVS_Post
|
||||
// #define FN_MakeVectors_Post MakeVectors_Post
|
||||
// #define FN_AngleVectors_Post AngleVectors_Post
|
||||
// #define FN_CreateEntity_Post CreateEntity_Post
|
||||
// #define FN_RemoveEntity_Post RemoveEntity_Post
|
||||
// #define FN_CreateNamedEntity_Post CreateNamedEntity_Post
|
||||
// #define FN_MakeStatic_Post MakeStatic_Post
|
||||
// #define FN_EntIsOnFloor_Post EntIsOnFloor_Post
|
||||
// #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_EmitAmbientSound_Post EmitAmbientSound_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
|
||||
// #define FN_TraceModel_Post TraceModel_Post
|
||||
// #define FN_TraceTexture_Post TraceTexture_Post
|
||||
// #define FN_TraceSphere_Post TraceSphere_Post
|
||||
// #define FN_GetAimVector_Post GetAimVector_Post
|
||||
// #define FN_ServerCommand_Post ServerCommand_Post
|
||||
// #define FN_ServerExecute_Post ServerExecute_Post
|
||||
// #define FN_engClientCommand_Post engClientCommand_Post
|
||||
// #define FN_ParticleEffect_Post ParticleEffect_Post
|
||||
// #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_CVarRegister_Post CVarRegister_Post
|
||||
// #define FN_CVarGetFloat_Post CVarGetFloat_Post
|
||||
// #define FN_CVarGetString_Post CVarGetString_Post
|
||||
// #define FN_CVarSetFloat_Post CVarSetFloat_Post
|
||||
// #define FN_CVarSetString_Post CVarSetString_Post
|
||||
// #define FN_AlertMessage_Post AlertMessage_Post
|
||||
// #define FN_EngineFprintf_Post EngineFprintf_Post
|
||||
// #define FN_PvAllocEntPrivateData_Post PvAllocEntPrivateData_Post
|
||||
// #define FN_PvEntPrivateData_Post PvEntPrivateData_Post
|
||||
// #define FN_FreeEntPrivateData_Post FreeEntPrivateData_Post
|
||||
// #define FN_SzFromIndex_Post SzFromIndex_Post
|
||||
// #define FN_AllocString_Post AllocString_Post
|
||||
// #define FN_GetVarsOfEnt_Post GetVarsOfEnt_Post
|
||||
// #define FN_PEntityOfEntOffset_Post PEntityOfEntOffset_Post
|
||||
// #define FN_EntOffsetOfPEntity_Post EntOffsetOfPEntity_Post
|
||||
// #define FN_IndexOfEdict_Post IndexOfEdict_Post
|
||||
// #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_AnimationAutomove_Post AnimationAutomove_Post
|
||||
// #define FN_GetBonePosition_Post GetBonePosition_Post
|
||||
// #define FN_FunctionFromName_Post FunctionFromName_Post
|
||||
// #define FN_NameForFunction_Post NameForFunction_Post
|
||||
// #define FN_ClientPrintf_Post ClientPrintf_Post
|
||||
// #define FN_ServerPrint_Post ServerPrint_Post
|
||||
// #define FN_Cmd_Args_Post Cmd_Args_Post
|
||||
// #define FN_Cmd_Argv_Post Cmd_Argv_Post
|
||||
// #define FN_Cmd_Argc_Post Cmd_Argc_Post
|
||||
// #define FN_GetAttachment_Post GetAttachment_Post
|
||||
// #define FN_CRC32_Init_Post CRC32_Init_Post
|
||||
// #define FN_CRC32_ProcessBuffer_Post CRC32_ProcessBuffer_Post
|
||||
// #define FN_CRC32_ProcessByte_Post CRC32_ProcessByte_Post
|
||||
// #define FN_CRC32_Final_Post CRC32_Final_Post
|
||||
// #define FN_RandomLong_Post RandomLong_Post
|
||||
// #define FN_RandomFloat_Post RandomFloat_Post
|
||||
// #define FN_SetView_Post SetView_Post
|
||||
// #define FN_Time_Post Time_Post
|
||||
// #define FN_CrosshairAngle_Post CrosshairAngle_Post
|
||||
// #define FN_LoadFileForMe_Post LoadFileForMe_Post
|
||||
// #define FN_FreeFile_Post FreeFile_Post
|
||||
// #define FN_EndSection_Post EndSection_Post
|
||||
// #define FN_CompareFileTime_Post CompareFileTime_Post
|
||||
// #define FN_GetGameDir_Post GetGameDir_Post
|
||||
// #define FN_Cvar_RegisterVariable_Post Cvar_RegisterVariable_Post
|
||||
// #define FN_FadeClientVolume_Post FadeClientVolume_Post
|
||||
// #define FN_SetClientMaxspeed_Post SetClientMaxspeed_Post
|
||||
// #define FN_CreateFakeClient_Post CreateFakeClient_Post
|
||||
// #define FN_RunPlayerMove_Post RunPlayerMove_Post
|
||||
// #define FN_NumberOfEntities_Post NumberOfEntities_Post
|
||||
// #define FN_GetInfoKeyBuffer_Post GetInfoKeyBuffer_Post
|
||||
// #define FN_InfoKeyValue_Post InfoKeyValue_Post
|
||||
// #define FN_SetKeyValue_Post SetKeyValue_Post
|
||||
// #define FN_SetClientKeyValue_Post SetClientKeyValue_Post
|
||||
// #define FN_IsMapValid_Post IsMapValid_Post
|
||||
// #define FN_StaticDecal_Post StaticDecal_Post
|
||||
// #define FN_PrecacheGeneric_Post PrecacheGeneric_Post
|
||||
// #define FN_GetPlayerUserId_Post GetPlayerUserId_Post
|
||||
// #define FN_BuildSoundMsg_Post BuildSoundMsg_Post
|
||||
// #define FN_IsDedicatedServer_Post IsDedicatedServer_Post
|
||||
// #define FN_CVarGetPointer_Post CVarGetPointer_Post
|
||||
// #define FN_GetPlayerWONId_Post GetPlayerWONId_Post
|
||||
// #define FN_Info_RemoveKey_Post Info_RemoveKey_Post
|
||||
// #define FN_GetPhysicsKeyValue_Post GetPhysicsKeyValue_Post
|
||||
// #define FN_SetPhysicsKeyValue_Post SetPhysicsKeyValue_Post
|
||||
// #define FN_GetPhysicsInfoString_Post GetPhysicsInfoString_Post
|
||||
// #define FN_PrecacheEvent_Post PrecacheEvent_Post
|
||||
// #define FN_PlaybackEvent_Post PlaybackEvent_Post
|
||||
// #define FN_SetFatPVS_Post SetFatPVS_Post
|
||||
// #define FN_SetFatPAS_Post SetFatPAS_Post
|
||||
// #define FN_CheckVisibility_Post CheckVisibility_Post
|
||||
// #define FN_DeltaSetField_Post DeltaSetField_Post
|
||||
// #define FN_DeltaUnsetField_Post DeltaUnsetField_Post
|
||||
// #define FN_DeltaAddEncoder_Post DeltaAddEncoder_Post
|
||||
// #define FN_GetCurrentPlayer_Post GetCurrentPlayer_Post
|
||||
// #define FN_CanSkipPlayer_Post CanSkipPlayer_Post
|
||||
// #define FN_DeltaFindField_Post DeltaFindField_Post
|
||||
// #define FN_DeltaSetFieldByIndex_Post DeltaSetFieldByIndex_Post
|
||||
// #define FN_DeltaUnsetFieldByIndex_Post DeltaUnsetFieldByIndex_Post
|
||||
// #define FN_SetGroupMask_Post SetGroupMask_Post
|
||||
// #define FN_engCreateInstancedBaseline_Post engCreateInstancedBaseline_Post
|
||||
// #define FN_Cvar_DirectSet_Post Cvar_DirectSet_Post
|
||||
// #define FN_ForceUnmodified_Post ForceUnmodified_Post
|
||||
// #define FN_GetPlayerStats_Post GetPlayerStats_Post
|
||||
// #define FN_AddServerCommand_Post AddServerCommand_Post
|
||||
// #define FN_Voice_GetClientListening_Post Voice_GetClientListening_Post
|
||||
// #define FN_Voice_SetClientListening_Post Voice_SetClientListening_Post
|
||||
// #define FN_GetPlayerAuthId_Post GetPlayerAuthId_Post
|
||||
|
||||
// #define FN_OnFreeEntPrivateData OnFreeEntPrivateData
|
||||
// #define FN_GameShutdown GameShutdown
|
||||
// #define FN_ShouldCollide ShouldCollide
|
||||
|
||||
// #define FN_OnFreeEntPrivateData_Post OnFreeEntPrivateData_Post
|
||||
// #define FN_GameShutdown_Post GameShutdown_Post
|
||||
// #define FN_ShouldCollide_Post ShouldCollide_Post
|
||||
|
||||
|
||||
#endif // USE_METAMOD
|
||||
|
||||
#endif // __MODULECONFIG_H__
|
20
modules/nvault/msvc12/nvault.sln
Normal file
20
modules/nvault/msvc12/nvault.sln
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nvault", "nvault.vcxproj", "{E2827EDF-F83F-4D54-8FD1-F47BA1E4D328}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E2827EDF-F83F-4D54-8FD1-F47BA1E4D328}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E2827EDF-F83F-4D54-8FD1-F47BA1E4D328}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E2827EDF-F83F-4D54-8FD1-F47BA1E4D328}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E2827EDF-F83F-4D54-8FD1-F47BA1E4D328}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
124
modules/nvault/msvc12/nvault.vcxproj
Normal file
124
modules/nvault/msvc12/nvault.vcxproj
Normal file
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{E2827EDF-F83F-4D54-8FD1-F47BA1E4D328}</ProjectGuid>
|
||||
<RootNamespace>nvault</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)_amxx</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName)_amxx</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl\include;..\..\third_party;..\..\third_party\hashing;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;NVAULT_EXPORTS;HAVE_STDINT_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<StructMemberAlignment>4Bytes</StructMemberAlignment>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)nvault.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(OutDir)nvault.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<IgnoreSpecificDefaultLibraries>LIBCMT;</IgnoreSpecificDefaultLibraries>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\;..\..\..\public;..\..\..\public\sdk; ..\..\..\public\amtl\include;..\..\third_party;..\..\third_party\hashing;$(METAMOD)\metamod;$(HLSDK)\common;$(HLSDK)\engine;$(HLSDK)\dlls;$(HLSDK)\pm_shared;$(HLSDK)\public;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;NVAULT_EXPORTS;HAVE_STDINT_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<StructMemberAlignment>4Bytes</StructMemberAlignment>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<ImportLibrary>$(OutDir)nvault.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\amxxapi.cpp" />
|
||||
<ClCompile Include="..\Binary.cpp" />
|
||||
<ClCompile Include="..\Journal.cpp" />
|
||||
<ClCompile Include="..\NVault.cpp" />
|
||||
<ClCompile Include="..\..\..\public\sdk\amxxmodule.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\amxxapi.h" />
|
||||
<ClInclude Include="..\Binary.h" />
|
||||
<ClInclude Include="..\compat.h" />
|
||||
<ClInclude Include="..\IVault.h" />
|
||||
<ClInclude Include="..\Journal.h" />
|
||||
<ClInclude Include="..\NVault.h" />
|
||||
<ClInclude Include="..\moduleconfig.h" />
|
||||
<ClInclude Include="..\..\..\public\sdk\amxxmodule.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\plugins\include\nvault.inc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
70
modules/nvault/msvc12/nvault.vcxproj.filters
Normal file
70
modules/nvault/msvc12/nvault.vcxproj.filters
Normal file
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Module SDK">
|
||||
<UniqueIdentifier>{3ba100b1-c511-4a2b-bd4f-d4793e871082}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Module SDK\SDK Base">
|
||||
<UniqueIdentifier>{300ce24d-2a06-4b65-8c00-8b0f757656ec}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Pawn Includes">
|
||||
<UniqueIdentifier>{4722a41b-9bbc-4c55-b0da-315b9f16f618}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\amxxapi.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Binary.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Journal.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\NVault.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\public\sdk\amxxmodule.cpp">
|
||||
<Filter>Module SDK\SDK Base</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\amxxapi.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Binary.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\compat.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\IVault.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Journal.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\NVault.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\sdk\amxxmodule.h">
|
||||
<Filter>Module SDK\SDK Base</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\moduleconfig.h">
|
||||
<Filter>Module SDK</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\plugins\include\nvault.inc">
|
||||
<Filter>Pawn Includes</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
101
modules/nvault/version.rc
Normal file
101
modules/nvault/version.rc
Normal file
@ -0,0 +1,101 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include <winresrc.h>
|
||||
#include <moduleconfig.h>
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION AMXX_VERSION_FILE
|
||||
PRODUCTVERSION AMXX_VERSION_FILE
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "000004b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "AMX Mod X"
|
||||
VALUE "FileDescription", "AMX Mod X"
|
||||
VALUE "FileVersion", AMXX_VERSION
|
||||
VALUE "InternalName", MODULE_LIBRARY
|
||||
VALUE "LegalCopyright", "Copyright (c) AMX Mod X Dev Team"
|
||||
VALUE "OriginalFilename", MODULE_LIBRARY "_amxx.dll"
|
||||
VALUE "ProductName", MODULE_NAME
|
||||
VALUE "ProductVersion", AMXX_VERSION
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0, 1200
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
Reference in New Issue
Block a user