Unix line endings everywhere

This commit is contained in:
Asher Baker 2018-07-21 01:31:51 +01:00
parent 2706b7f628
commit 38258d2a23
11 changed files with 1535 additions and 1535 deletions

6
.gitignore vendored
View File

@ -1,3 +1,3 @@
/build /build
/extension/version_auto.h /extension/version_auto.h
/breakpad /breakpad

View File

@ -1,45 +1,45 @@
# vim: set ts=2 sw=2 tw=99 noet ft=python: # vim: set ts=2 sw=2 tw=99 noet ft=python:
import os import os
from ambuild.command import Command from ambuild.command import Command
from ambuild.command import ShellCommand from ambuild.command import ShellCommand
try: try:
import urllib.request as urllib import urllib.request as urllib
except ImportError: except ImportError:
import urllib2 as urllib import urllib2 as urllib
class IterateDebugInfoCommand(Command): class IterateDebugInfoCommand(Command):
def run(self, master, job): def run(self, master, job):
pdblog = open(os.path.join(AMBuild.outputFolder, 'pdblog.txt'), 'rt') pdblog = open(os.path.join(AMBuild.outputFolder, 'pdblog.txt'), 'rt')
for debug_info in pdblog: for debug_info in pdblog:
debug_info = os.path.join(AMBuild.outputFolder, debug_info.strip()) debug_info = os.path.join(AMBuild.outputFolder, debug_info.strip())
job.AddCommand(SymbolCommand(debug_info, symbolServer)) job.AddCommand(SymbolCommand(debug_info, symbolServer))
pdblog.close() pdblog.close()
class SymbolCommand(ShellCommand): class SymbolCommand(ShellCommand):
def __init__(self, debugFile, symbolServer): def __init__(self, debugFile, symbolServer):
self.serverResponse = None self.serverResponse = None
self.symbolServer = symbolServer self.symbolServer = symbolServer
if AMBuild.target['platform'] == 'linux': if AMBuild.target['platform'] == 'linux':
cmdstring = "dump_syms {0} {1}".format(debugFile, os.path.dirname(debugFile)) cmdstring = "dump_syms {0} {1}".format(debugFile, os.path.dirname(debugFile))
elif AMBuild.target['platform'] == 'darwin': elif AMBuild.target['platform'] == 'darwin':
cmdstring = "dump_syms {0}".format(debugFile) cmdstring = "dump_syms {0}".format(debugFile)
elif AMBuild.target['platform'] == 'windows': elif AMBuild.target['platform'] == 'windows':
cmdstring = "dump_syms.exe {0}".format(debugFile) cmdstring = "dump_syms.exe {0}".format(debugFile)
ShellCommand.__init__(self, cmdstring) ShellCommand.__init__(self, cmdstring)
def run(self, master, job): def run(self, master, job):
ShellCommand.run(self, master, job) ShellCommand.run(self, master, job)
if self.stdout != None and len(self.stdout) > 0: if self.stdout != None and len(self.stdout) > 0:
request = urllib.Request(symbolServer, self.stdout.encode('utf-8')) request = urllib.Request(symbolServer, self.stdout.encode('utf-8'))
request.add_header("Content-Type", "text/plain") request.add_header("Content-Type", "text/plain")
self.serverResponse = urllib.urlopen(request).read().decode('utf-8') self.serverResponse = urllib.urlopen(request).read().decode('utf-8')
def spew(self, runner): def spew(self, runner):
if self.stderr != None and len(self.stderr) > 0: if self.stderr != None and len(self.stderr) > 0:
runner.PrintOut(self.stderr) runner.PrintOut(self.stderr)
if self.serverResponse != None and len(self.serverResponse) > 0: if self.serverResponse != None and len(self.serverResponse) > 0:
runner.PrintOut(self.serverResponse) runner.PrintOut(self.serverResponse)
if 'BREAKPAD_SYMBOL_SERVER' in os.environ: if 'BREAKPAD_SYMBOL_SERVER' in os.environ:
symbolServer = os.environ['BREAKPAD_SYMBOL_SERVER'] symbolServer = os.environ['BREAKPAD_SYMBOL_SERVER']
job = AMBuild.AddJob('breakpad-symbols') job = AMBuild.AddJob('breakpad-symbols')
job.AddCommand(IterateDebugInfoCommand()) job.AddCommand(IterateDebugInfoCommand())

View File

@ -1,127 +1,127 @@
# vim: set ts=2 sw=2 tw=99 noet ft=python: # vim: set ts=2 sw=2 tw=99 noet ft=python:
import os import os
import shutil import shutil
import ambuild.osutil as osutil import ambuild.osutil as osutil
from ambuild.command import Command from ambuild.command import Command
job = AMBuild.AddJob('package') job = AMBuild.AddJob('package')
class DestroyPath(Command): class DestroyPath(Command):
def __init__(self, folder): def __init__(self, folder):
Command.__init__(self) Command.__init__(self)
self.folder = folder self.folder = folder
def destroy(self, path): def destroy(self, path):
entries = os.listdir(path) entries = os.listdir(path)
for entry in entries: for entry in entries:
newpath = os.path.join(path, entry) newpath = os.path.join(path, entry)
if os.path.isdir(newpath): if os.path.isdir(newpath):
self.destroy(newpath) self.destroy(newpath)
os.rmdir(newpath) os.rmdir(newpath)
elif os.path.isfile(newpath): elif os.path.isfile(newpath):
os.remove(newpath) os.remove(newpath)
def run(self, runner, job): def run(self, runner, job):
runner.PrintOut('rm -rf {0}/*'.format(self.folder)) runner.PrintOut('rm -rf {0}/*'.format(self.folder))
self.destroy(self.folder) self.destroy(self.folder)
class CreateFolders(Command): class CreateFolders(Command):
def __init__(self, folders): def __init__(self, folders):
Command.__init__(self) Command.__init__(self)
self.folders = folders self.folders = folders
def run(self, runner, job): def run(self, runner, job):
for folder in self.folders: for folder in self.folders:
path = os.path.join(*folder) path = os.path.join(*folder)
runner.PrintOut('mkdir {0}'.format(path)) runner.PrintOut('mkdir {0}'.format(path))
os.makedirs(path) os.makedirs(path)
#Shallow folder copy #Shallow folder copy
class CopyFolder(Command): class CopyFolder(Command):
def __init__(self, fromList, toList, excludes = []): def __init__(self, fromList, toList, excludes = []):
Command.__init__(self) Command.__init__(self)
self.fromPath = os.path.join(AMBuild.sourceFolder, *fromList) self.fromPath = os.path.join(AMBuild.sourceFolder, *fromList)
self.toPath = os.path.join(*toList) self.toPath = os.path.join(*toList)
self.excludes = excludes self.excludes = excludes
def run(self, runner, job): def run(self, runner, job):
entries = os.listdir(self.fromPath) entries = os.listdir(self.fromPath)
for entry in entries: for entry in entries:
if entry in self.excludes: if entry in self.excludes:
continue continue
path = os.path.join(self.fromPath, entry) path = os.path.join(self.fromPath, entry)
if not os.path.isfile(path): if not os.path.isfile(path):
continue continue
runner.PrintOut('copy {0} to {1}'.format(path, self.toPath)) runner.PrintOut('copy {0} to {1}'.format(path, self.toPath))
shutil.copy(path, self.toPath) shutil.copy(path, self.toPath)
#Single file copy #Single file copy
class CopyFile(Command): class CopyFile(Command):
def __init__(self, fromFile, toPath): def __init__(self, fromFile, toPath):
Command.__init__(self) Command.__init__(self)
self.fromFile = fromFile self.fromFile = fromFile
self.toPath = toPath self.toPath = toPath
def run(self, runner, job): def run(self, runner, job):
runner.PrintOut('copy {0} to {1}'.format(self.fromFile, self.toPath)) runner.PrintOut('copy {0} to {1}'.format(self.fromFile, self.toPath))
shutil.copy(self.fromFile, self.toPath) shutil.copy(self.fromFile, self.toPath)
folders = [ folders = [
['addons', 'sourcemod', 'configs'], ['addons', 'sourcemod', 'configs'],
['addons', 'sourcemod', 'gamedata'], ['addons', 'sourcemod', 'gamedata'],
['addons', 'sourcemod', 'extensions'], ['addons', 'sourcemod', 'extensions'],
] ]
#Setup #Setup
job.AddCommand(DestroyPath(os.path.join(AMBuild.outputFolder, 'package'))) job.AddCommand(DestroyPath(os.path.join(AMBuild.outputFolder, 'package')))
job.AddCommand(CreateFolders(folders)) job.AddCommand(CreateFolders(folders))
job.AddCommand(CopyFile(os.path.join(AMBuild.sourceFolder, 'accelerator.games.txt'), os.path.join('addons', 'sourcemod', 'gamedata'))) job.AddCommand(CopyFile(os.path.join(AMBuild.sourceFolder, 'accelerator.games.txt'), os.path.join('addons', 'sourcemod', 'gamedata')))
job.AddCommand(CopyFile(os.path.join(AMBuild.sourceFolder, 'accelerator.autoload'), os.path.join('addons', 'sourcemod', 'extensions'))) job.AddCommand(CopyFile(os.path.join(AMBuild.sourceFolder, 'accelerator.autoload'), os.path.join('addons', 'sourcemod', 'extensions')))
bincopies = [] bincopies = []
def AddNormalLibrary(name, dest): def AddNormalLibrary(name, dest):
dest = os.path.join('addons', 'sourcemod', dest) dest = os.path.join('addons', 'sourcemod', dest)
bincopies.append(CopyFile(os.path.join('..', name, name + osutil.SharedLibSuffix()), dest)) bincopies.append(CopyFile(os.path.join('..', name, name + osutil.SharedLibSuffix()), dest))
# Each platform's version of dump_syms needs the path in a different format. # Each platform's version of dump_syms needs the path in a different format.
if AMBuild.target['platform'] == 'linux': if AMBuild.target['platform'] == 'linux':
debug_info.append(name + '/' + name + '.so') debug_info.append(name + '/' + name + '.so')
elif AMBuild.target['platform'] == 'darwin': elif AMBuild.target['platform'] == 'darwin':
debug_info.append(name + '/' + name + '.dylib.dSYM') debug_info.append(name + '/' + name + '.dylib.dSYM')
elif AMBuild.target['platform'] == 'windows': elif AMBuild.target['platform'] == 'windows':
debug_info.append(name + '\\' + name + '.pdb') debug_info.append(name + '\\' + name + '.pdb')
def AddExecutable(name, dest): def AddExecutable(name, dest):
dest = os.path.join('addons', 'sourcemod', dest) dest = os.path.join('addons', 'sourcemod', dest)
bincopies.append(CopyFile(os.path.join('..', name, name + osutil.ExecutableSuffix()), dest)) bincopies.append(CopyFile(os.path.join('..', name, name + osutil.ExecutableSuffix()), dest))
# Each platform's version of dump_syms needs the path in a different format. # Each platform's version of dump_syms needs the path in a different format.
if AMBuild.target['platform'] == 'linux': if AMBuild.target['platform'] == 'linux':
debug_info.append(name + '/' + name) debug_info.append(name + '/' + name)
elif AMBuild.target['platform'] == 'darwin': elif AMBuild.target['platform'] == 'darwin':
debug_info.append(name + '/' + name + '.dSYM') debug_info.append(name + '/' + name + '.dSYM')
elif AMBuild.target['platform'] == 'windows': elif AMBuild.target['platform'] == 'windows':
debug_info.append(name + '\\' + name + '.pdb') debug_info.append(name + '\\' + name + '.pdb')
def AddHL2Library(name, dest): def AddHL2Library(name, dest):
for i in SM.sdkInfo: for i in SM.sdkInfo:
sdk = SM.sdkInfo[i] sdk = SM.sdkInfo[i]
if AMBuild.target['platform'] not in sdk['platform']: if AMBuild.target['platform'] not in sdk['platform']:
continue continue
AddNormalLibrary(name + '.ext.' + sdk['ext'], dest) AddNormalLibrary(name + '.ext.' + sdk['ext'], dest)
debug_info = [] debug_info = []
AddNormalLibrary('accelerator.ext', 'extensions') AddNormalLibrary('accelerator.ext', 'extensions')
AddExecutable('test-crash-dump-generation', 'configs') AddExecutable('test-crash-dump-generation', 'configs')
job.AddCommandGroup(bincopies) job.AddCommandGroup(bincopies)
pdblog = open(os.path.join(AMBuild.outputFolder, 'pdblog.txt'), 'wt') pdblog = open(os.path.join(AMBuild.outputFolder, 'pdblog.txt'), 'wt')
for pdb in debug_info: for pdb in debug_info:
pdblog.write(pdb + '\n') pdblog.write(pdb + '\n')
pdblog.close() pdblog.close()

View File

@ -1,56 +1,56 @@
# vim: set ts=2 sw=2 tw=99 noet ft=python: # vim: set ts=2 sw=2 tw=99 noet ft=python:
import os import os
import re import re
import subprocess import subprocess
from ambuild.cache import Cache from ambuild.cache import Cache
import ambuild.command as command import ambuild.command as command
#Quickly try to ascertain the current repository revision #Quickly try to ascertain the current repository revision
def GetVersion(): def GetVersion():
rev = command.RunDirectCommand(AMBuild, ['git', 'rev-list', '--count', 'HEAD']).stdoutText.strip() rev = command.RunDirectCommand(AMBuild, ['git', 'rev-list', '--count', 'HEAD']).stdoutText.strip()
cset = command.RunDirectCommand(AMBuild, ['git', 'log', '--pretty=format:%h', '-n', '1']).stdoutText.strip() cset = command.RunDirectCommand(AMBuild, ['git', 'log', '--pretty=format:%h', '-n', '1']).stdoutText.strip()
if not rev or not cset: if not rev or not cset:
raise Exception('Could not determine repository version') raise Exception('Could not determine repository version')
return (rev, cset) return (rev, cset)
def PerformReversioning(): def PerformReversioning():
rev, cset = GetVersion() rev, cset = GetVersion()
cacheFile = os.path.join(AMBuild.outputFolder, '.ambuild', 'hgcache') cacheFile = os.path.join(AMBuild.outputFolder, '.ambuild', 'hgcache')
cache = Cache(cacheFile) cache = Cache(cacheFile)
if os.path.isfile(cacheFile): if os.path.isfile(cacheFile):
cache.LoadCache() cache.LoadCache()
if cache.HasVariable('cset') and cache['cset'] == cset: if cache.HasVariable('cset') and cache['cset'] == cset:
return False return False
cache.CacheVariable('cset', cset) cache.CacheVariable('cset', cset)
productFile = open(os.path.join(AMBuild.sourceFolder, 'product.version'), 'r') productFile = open(os.path.join(AMBuild.sourceFolder, 'product.version'), 'r')
productContents = productFile.read() productContents = productFile.read()
productFile.close() productFile.close()
m = re.match('(\d+)\.(\d+)\.(\d+)(.*)', productContents) m = re.match('(\d+)\.(\d+)\.(\d+)(.*)', productContents)
if m == None: if m == None:
raise Exception('Could not detremine product version') raise Exception('Could not detremine product version')
major, minor, release, tag = m.groups() major, minor, release, tag = m.groups()
incFolder = os.path.join(AMBuild.sourceFolder, 'extension') incFolder = os.path.join(AMBuild.sourceFolder, 'extension')
incFile = open(os.path.join(incFolder, 'version_auto.h'), 'w') incFile = open(os.path.join(incFolder, 'version_auto.h'), 'w')
incFile.write(""" incFile.write("""
#ifndef _AUTO_VERSION_INFORMATION_H_ #ifndef _AUTO_VERSION_INFORMATION_H_
#define _AUTO_VERSION_INFORMATION_H_ #define _AUTO_VERSION_INFORMATION_H_
#define SM_BUILD_TAG \"{0}\" #define SM_BUILD_TAG \"{0}\"
#define SM_BUILD_UNIQUEID \"{1}:{2}\" SM_BUILD_TAG #define SM_BUILD_UNIQUEID \"{1}:{2}\" SM_BUILD_TAG
#define SM_VERSION \"{3}.{4}.{5}\" #define SM_VERSION \"{3}.{4}.{5}\"
#define SM_FULL_VERSION SM_VERSION SM_BUILD_TAG #define SM_FULL_VERSION SM_VERSION SM_BUILD_TAG
#define SM_FILE_VERSION {6},{7},{8},0 #define SM_FILE_VERSION {6},{7},{8},0
#endif /* _AUTO_VERSION_INFORMATION_H_ */ #endif /* _AUTO_VERSION_INFORMATION_H_ */
""".format(tag, rev, cset, major, minor, release, major, minor, release)) """.format(tag, rev, cset, major, minor, release, major, minor, release))
incFile.close() incFile.close()
cache.WriteCache() cache.WriteCache()
PerformReversioning() PerformReversioning()

View File

@ -1,85 +1,85 @@
/** /**
* vim: set ts=4 : * vim: set ts=4 :
* ============================================================================= * =============================================================================
* SourceMod Updater Extension * SourceMod Updater Extension
* Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved. * Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* ============================================================================= * =============================================================================
* *
* This program is free software; you can redistribute it and/or modify it under * This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the * the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation. * Free Software Foundation.
* *
* This program is distributed in the hope that it will be useful, but WITHOUT * 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 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details. * details.
* *
* You should have received a copy of the GNU General Public License along with * You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>. * this program. If not, see <http://www.gnu.org/licenses/>.
* *
* As a special exception, AlliedModders LLC gives you permission to link the * As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the * code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in * by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants * all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further * this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>. * or <http://www.sourcemod.net/license.php>.
* *
* Version: $Id$ * Version: $Id$
*/ */
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "MemoryDownloader.h" #include "MemoryDownloader.h"
using namespace SourceMod; using namespace SourceMod;
MemoryDownloader::MemoryDownloader() : buffer(NULL), bufsize(0), bufpos(0) MemoryDownloader::MemoryDownloader() : buffer(NULL), bufsize(0), bufpos(0)
{ {
} }
MemoryDownloader::~MemoryDownloader() MemoryDownloader::~MemoryDownloader()
{ {
free(buffer); free(buffer);
} }
DownloadWriteStatus MemoryDownloader::OnDownloadWrite(IWebTransfer *session, DownloadWriteStatus MemoryDownloader::OnDownloadWrite(IWebTransfer *session,
void *userdata, void *userdata,
void *ptr, void *ptr,
size_t size, size_t size,
size_t nmemb) size_t nmemb)
{ {
size_t total = size * nmemb; size_t total = size * nmemb;
if (bufpos + total > bufsize) if (bufpos + total > bufsize)
{ {
size_t rem = (bufpos + total) - bufsize; size_t rem = (bufpos + total) - bufsize;
bufsize += rem + (rem / 2); bufsize += rem + (rem / 2);
buffer = (char *)realloc(buffer, bufsize); buffer = (char *)realloc(buffer, bufsize);
} }
assert(bufpos + total <= bufsize); assert(bufpos + total <= bufsize);
memcpy(&buffer[bufpos], ptr, total); memcpy(&buffer[bufpos], ptr, total);
bufpos += total; bufpos += total;
return DownloadWrite_Okay; return DownloadWrite_Okay;
} }
void MemoryDownloader::Reset() void MemoryDownloader::Reset()
{ {
bufpos = 0; bufpos = 0;
} }
char *MemoryDownloader::GetBuffer() char *MemoryDownloader::GetBuffer()
{ {
return buffer; return buffer;
} }
size_t MemoryDownloader::GetSize() size_t MemoryDownloader::GetSize()
{ {
return bufpos; return bufpos;
} }

View File

@ -1,62 +1,62 @@
/** /**
* vim: set ts=4 : * vim: set ts=4 :
* ============================================================================= * =============================================================================
* SourceMod Updater Extension * SourceMod Updater Extension
* Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved. * Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* ============================================================================= * =============================================================================
* *
* This program is free software; you can redistribute it and/or modify it under * This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the * the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation. * Free Software Foundation.
* *
* This program is distributed in the hope that it will be useful, but WITHOUT * 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 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details. * details.
* *
* You should have received a copy of the GNU General Public License along with * You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>. * this program. If not, see <http://www.gnu.org/licenses/>.
* *
* As a special exception, AlliedModders LLC gives you permission to link the * As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the * code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in * by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants * all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further * this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>. * or <http://www.sourcemod.net/license.php>.
* *
* Version: $Id$ * Version: $Id$
*/ */
#ifndef _INCLUDE_SOURCEMOD_UPDATER_MEMORY_DOWNLOADER_H_ #ifndef _INCLUDE_SOURCEMOD_UPDATER_MEMORY_DOWNLOADER_H_
#define _INCLUDE_SOURCEMOD_UPDATER_MEMORY_DOWNLOADER_H_ #define _INCLUDE_SOURCEMOD_UPDATER_MEMORY_DOWNLOADER_H_
#include <IWebternet.h> #include <IWebternet.h>
namespace SourceMod namespace SourceMod
{ {
class MemoryDownloader : public ITransferHandler class MemoryDownloader : public ITransferHandler
{ {
public: public:
MemoryDownloader(); MemoryDownloader();
~MemoryDownloader(); ~MemoryDownloader();
public: public:
DownloadWriteStatus OnDownloadWrite(IWebTransfer *session, DownloadWriteStatus OnDownloadWrite(IWebTransfer *session,
void *userdata, void *userdata,
void *ptr, void *ptr,
size_t size, size_t size,
size_t nmemb); size_t nmemb);
public: public:
void Reset(); void Reset();
char *GetBuffer(); char *GetBuffer();
size_t GetSize(); size_t GetSize();
private: private:
char *buffer; char *buffer;
size_t bufsize; size_t bufsize;
size_t bufpos; size_t bufpos;
}; };
} }
#endif /* _INCLUDE_SOURCEMOD_UPDATER_MEMORY_DOWNLOADER_H_ */ #endif /* _INCLUDE_SOURCEMOD_UPDATER_MEMORY_DOWNLOADER_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -1,109 +1,109 @@
/** /**
* ============================================================================= * =============================================================================
* Accelerator Extension * Accelerator Extension
* Copyright (C) 2009-2010 Asher Baker (asherkin). All rights reserved. * Copyright (C) 2009-2010 Asher Baker (asherkin). All rights reserved.
* ============================================================================= * =============================================================================
* *
* This program is free software; you can redistribute it and/or modify it under * This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the * the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation. * Free Software Foundation.
* *
* This program is distributed in the hope that it will be useful, but WITHOUT * 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 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details. * details.
* *
* You should have received a copy of the GNU General Public License along with * You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>. * this program. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
#ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_ #ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
#define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_ #define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
/** /**
* @file extension.hpp * @file extension.hpp
* @brief Accelerator extension code header. * @brief Accelerator extension code header.
*/ */
#include "smsdk_ext.h" #include "smsdk_ext.h"
/** /**
* @brief Sample implementation of the SDK Extension. * @brief Sample implementation of the SDK Extension.
* Note: Uncomment one of the pre-defined virtual functions in order to use it. * Note: Uncomment one of the pre-defined virtual functions in order to use it.
*/ */
class Accelerator : public SDKExtension class Accelerator : public SDKExtension
{ {
public: public:
/** /**
* @brief This is called after the initial loading sequence has been processed. * @brief This is called after the initial loading sequence has been processed.
* *
* @param error Error message buffer. * @param error Error message buffer.
* @param maxlength Size of error message buffer. * @param maxlength Size of error message buffer.
* @param late Whether or not the module was loaded after map load. * @param late Whether or not the module was loaded after map load.
* @return True to succeed loading, false to fail. * @return True to succeed loading, false to fail.
*/ */
virtual bool SDK_OnLoad(char *error, size_t maxlen, bool late); virtual bool SDK_OnLoad(char *error, size_t maxlen, bool late);
/** /**
* @brief This is called right before the extension is unloaded. * @brief This is called right before the extension is unloaded.
*/ */
virtual void SDK_OnUnload(); virtual void SDK_OnUnload();
/** /**
* @brief Called when the pause state is changed. * @brief Called when the pause state is changed.
*/ */
//virtual void SDK_OnPauseChange(bool paused); //virtual void SDK_OnPauseChange(bool paused);
/** /**
* @brief this is called when Core wants to know if your extension is working. * @brief this is called when Core wants to know if your extension is working.
* *
* @param error Error message buffer. * @param error Error message buffer.
* @param maxlength Size of error message buffer. * @param maxlength Size of error message buffer.
* @return True if working, false otherwise. * @return True if working, false otherwise.
*/ */
//virtual bool QueryRunning(char *error, size_t maxlen); //virtual bool QueryRunning(char *error, size_t maxlen);
public: public:
#if defined SMEXT_CONF_METAMOD #if defined SMEXT_CONF_METAMOD
/** /**
* @brief Called when Metamod is attached, before the extension version is called. * @brief Called when Metamod is attached, before the extension version is called.
* *
* @param error Error buffer. * @param error Error buffer.
* @param maxlength Maximum size of error buffer. * @param maxlength Maximum size of error buffer.
* @param late Whether or not Metamod considers this a late load. * @param late Whether or not Metamod considers this a late load.
* @return True to succeed, false to fail. * @return True to succeed, false to fail.
*/ */
//virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late); //virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late);
/** /**
* @brief Called when Metamod is detaching, after the extension version is called. * @brief Called when Metamod is detaching, after the extension version is called.
* NOTE: By default this is blocked unless sent from SourceMod. * NOTE: By default this is blocked unless sent from SourceMod.
* *
* @param error Error buffer. * @param error Error buffer.
* @param maxlength Maximum size of error buffer. * @param maxlength Maximum size of error buffer.
* @return True to succeed, false to fail. * @return True to succeed, false to fail.
*/ */
//virtual bool SDK_OnMetamodUnload(char *error, size_t maxlen); //virtual bool SDK_OnMetamodUnload(char *error, size_t maxlen);
/** /**
* @brief Called when Metamod's pause state is changing. * @brief Called when Metamod's pause state is changing.
* NOTE: By default this is blocked unless sent from SourceMod. * NOTE: By default this is blocked unless sent from SourceMod.
* *
* @param paused Pause state being set. * @param paused Pause state being set.
* @param error Error buffer. * @param error Error buffer.
* @param maxlength Maximum size of error buffer. * @param maxlength Maximum size of error buffer.
* @return True to succeed, false to fail. * @return True to succeed, false to fail.
*/ */
//virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlen); //virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlen);
#endif #endif
/** /**
* @brief Called on server activation before plugins receive the OnServerLoad forward. * @brief Called on server activation before plugins receive the OnServerLoad forward.
* *
* @param pEdictList Edicts list. * @param pEdictList Edicts list.
* @param edictCount Number of edicts in the list. * @param edictCount Number of edicts in the list.
* @param clientMax Maximum number of clients allowed in the server. * @param clientMax Maximum number of clients allowed in the server.
*/ */
virtual void OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax); virtual void OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax);
}; };
#endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_ #endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_

View File

@ -1,81 +1,81 @@
/** /**
* ============================================================================= * =============================================================================
* Accelerator Extension * Accelerator Extension
* Copyright (C) 2011 Asher Baker (asherkin). All rights reserved. * Copyright (C) 2011 Asher Baker (asherkin). All rights reserved.
* ============================================================================= * =============================================================================
* *
* This program is free software; you can redistribute it and/or modify it under * This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the * the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation. * Free Software Foundation.
* *
* This program is distributed in the hope that it will be useful, but WITHOUT * 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 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details. * details.
* *
* You should have received a copy of the GNU General Public License along with * You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>. * this program. If not, see <http://www.gnu.org/licenses/>.
* *
* As a special exception, AlliedModders LLC gives you permission to link the * As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the * code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in * by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants * all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further * this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>. * or <http://www.sourcemod.net/license.php>.
*/ */
#ifndef _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ #ifndef _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_
#define _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ #define _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_
/** /**
* @file smsdk_config.hpp * @file smsdk_config.hpp
* @brief Contains macros for configuring basic extension information. * @brief Contains macros for configuring basic extension information.
*/ */
#include "version.h" // SM_FULL_VERSION #include "version.h" // SM_FULL_VERSION
/* Basic information exposed publicly */ /* Basic information exposed publicly */
#define SMEXT_CONF_NAME "Accelerator" #define SMEXT_CONF_NAME "Accelerator"
#define SMEXT_CONF_DESCRIPTION "SRCDS Crash Handler" #define SMEXT_CONF_DESCRIPTION "SRCDS Crash Handler"
#define SMEXT_CONF_VERSION SM_FULL_VERSION #define SMEXT_CONF_VERSION SM_FULL_VERSION
#define SMEXT_CONF_AUTHOR "Asher \"asherkin\" Baker" #define SMEXT_CONF_AUTHOR "Asher \"asherkin\" Baker"
#define SMEXT_CONF_URL "https://crash.limetech.org/" #define SMEXT_CONF_URL "https://crash.limetech.org/"
#define SMEXT_CONF_LOGTAG "CRASH" #define SMEXT_CONF_LOGTAG "CRASH"
#define SMEXT_CONF_LICENSE "GPL" #define SMEXT_CONF_LICENSE "GPL"
#define SMEXT_CONF_DATESTRING __DATE__ #define SMEXT_CONF_DATESTRING __DATE__
/** /**
* @brief Exposes plugin's main interface. * @brief Exposes plugin's main interface.
*/ */
#define SMEXT_LINK(name) SDKExtension *g_pExtensionIface = name; #define SMEXT_LINK(name) SDKExtension *g_pExtensionIface = name;
/** /**
* @brief Sets whether or not this plugin required Metamod. * @brief Sets whether or not this plugin required Metamod.
* NOTE: Uncomment to enable, comment to disable. * NOTE: Uncomment to enable, comment to disable.
*/ */
//#define SMEXT_CONF_METAMOD //#define SMEXT_CONF_METAMOD
/** Enable interfaces you want to use here by uncommenting lines */ /** Enable interfaces you want to use here by uncommenting lines */
//#define SMEXT_ENABLE_FORWARDSYS //#define SMEXT_ENABLE_FORWARDSYS
//#define SMEXT_ENABLE_HANDLESYS //#define SMEXT_ENABLE_HANDLESYS
//#define SMEXT_ENABLE_PLAYERHELPERS //#define SMEXT_ENABLE_PLAYERHELPERS
//#define SMEXT_ENABLE_DBMANAGER //#define SMEXT_ENABLE_DBMANAGER
#define SMEXT_ENABLE_GAMECONF #define SMEXT_ENABLE_GAMECONF
//#define SMEXT_ENABLE_MEMUTILS //#define SMEXT_ENABLE_MEMUTILS
#define SMEXT_ENABLE_GAMEHELPERS #define SMEXT_ENABLE_GAMEHELPERS
//#define SMEXT_ENABLE_TIMERSYS //#define SMEXT_ENABLE_TIMERSYS
#define SMEXT_ENABLE_THREADER #define SMEXT_ENABLE_THREADER
#define SMEXT_ENABLE_LIBSYS #define SMEXT_ENABLE_LIBSYS
//#define SMEXT_ENABLE_MENUS //#define SMEXT_ENABLE_MENUS
//#define SMEXT_ENABLE_ADTFACTORY //#define SMEXT_ENABLE_ADTFACTORY
#define SMEXT_ENABLE_PLUGINSYS #define SMEXT_ENABLE_PLUGINSYS
//#define SMEXT_ENABLE_ADMINSYS //#define SMEXT_ENABLE_ADMINSYS
//#define SMEXT_ENABLE_TEXTPARSERS //#define SMEXT_ENABLE_TEXTPARSERS
//#define SMEXT_ENABLE_USERMSGS //#define SMEXT_ENABLE_USERMSGS
//#define SMEXT_ENABLE_TRANSLATOR //#define SMEXT_ENABLE_TRANSLATOR
//#define SMEXT_ENABLE_NINVOKE //#define SMEXT_ENABLE_NINVOKE
#define SMEXT_ENABLE_ROOTCONSOLEMENU #define SMEXT_ENABLE_ROOTCONSOLEMENU
#endif // _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ #endif // _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_

View File

@ -1,27 +1,27 @@
#ifndef _INCLUDE_VERSION_INFORMATION_H_ #ifndef _INCLUDE_VERSION_INFORMATION_H_
#define _INCLUDE_VERSION_INFORMATION_H_ #define _INCLUDE_VERSION_INFORMATION_H_
/** /**
* @file Contains version information. * @file Contains version information.
* @brief This file will redirect to an autogenerated version if being compiled via * @brief This file will redirect to an autogenerated version if being compiled via
* the build scripts. * the build scripts.
*/ */
#if defined SM_GENERATED_BUILD #if defined SM_GENERATED_BUILD
#include "version_auto.h" #include "version_auto.h"
#else #else
#ifndef SM_GENERATED_BUILD #ifndef SM_GENERATED_BUILD
#undef BINARY_NAME #undef BINARY_NAME
#define BINARY_NAME "accelerator.ext.dll\0" #define BINARY_NAME "accelerator.ext.dll\0"
#endif #endif
#define SM_BUILD_TAG "-manual" #define SM_BUILD_TAG "-manual"
#define SM_BUILD_UNIQUEID "[MANUAL BUILD]" #define SM_BUILD_UNIQUEID "[MANUAL BUILD]"
#define SM_VERSION "2.3.3" #define SM_VERSION "2.3.3"
#define SM_FULL_VERSION SM_VERSION SM_BUILD_TAG #define SM_FULL_VERSION SM_VERSION SM_BUILD_TAG
#define SM_FILE_VERSION 2,3,3,0 #define SM_FILE_VERSION 2,3,3,0
#endif #endif
#endif /* _INCLUDE_VERSION_INFORMATION_H_ */ #endif /* _INCLUDE_VERSION_INFORMATION_H_ */

View File

@ -1,45 +1,45 @@
#include "winres.h" #include "winres.h"
#include <version.h> #include <version.h>
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252) #pragma code_page(1252)
#endif #endif
#ifndef SM_GENERATED_BUILD #ifndef SM_GENERATED_BUILD
#define BINARY_NAME "accelerator.ext.dll\0" #define BINARY_NAME "accelerator.ext.dll\0"
#endif #endif
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION SM_FILE_VERSION FILEVERSION SM_FILE_VERSION
PRODUCTVERSION SM_FILE_VERSION PRODUCTVERSION SM_FILE_VERSION
FILEFLAGSMASK 0x17L FILEFLAGSMASK 0x17L
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
#else #else
FILEFLAGS 0x0L FILEFLAGS 0x0L
#endif #endif
FILEOS 0x4L FILEOS 0x4L
FILETYPE 0x2L FILETYPE 0x2L
FILESUBTYPE 0x0L FILESUBTYPE 0x0L
BEGIN BEGIN
BLOCK "StringFileInfo" BLOCK "StringFileInfo"
BEGIN BEGIN
BLOCK "040904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "Comments", "Accelerator Extension" VALUE "Comments", "Accelerator Extension"
VALUE "FileDescription", "SourceMod Accelerator Extension" VALUE "FileDescription", "SourceMod Accelerator Extension"
VALUE "FileVersion", SM_BUILD_UNIQUEID VALUE "FileVersion", SM_BUILD_UNIQUEID
VALUE "InternalName", "Accelerator" VALUE "InternalName", "Accelerator"
VALUE "LegalCopyright", "Copyright (c) 2012, Asher Baker" VALUE "LegalCopyright", "Copyright (c) 2012, Asher Baker"
VALUE "OriginalFilename", BINARY_NAME VALUE "OriginalFilename", BINARY_NAME
VALUE "ProductName", "Accelerator Extension" VALUE "ProductName", "Accelerator Extension"
VALUE "ProductVersion", SM_FULL_VERSION VALUE "ProductVersion", SM_FULL_VERSION
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"
BEGIN BEGIN
VALUE "Translation", 0x0409, 0x04B0 VALUE "Translation", 0x0409, 0x04B0
END END
END END