diff --git a/Makefile.am b/Makefile.am
index 2ac42231e..c9165d444 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -54,4 +54,3 @@ EXTRA_DIST += \
win/VC100/g3dlite.vcxproj
ACLOCAL_AMFLAGS = -I m4
-
diff --git a/NEWS b/NEWS
index a9a9b0120..0a2d066ce 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,7 @@ http://mangos.lighthouseapp.com/
Version 0.16
* Under discussion.
* OpenSSL lib upgrade to OpenSSL 1.0.0.
+ * Sockets lib use dropped.
* Upgrade to client version 3.3.3a (build 11723).
Version 0.15
diff --git a/configure.ac b/configure.ac
index 90b332abc..1fc4248ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -281,7 +281,6 @@ AC_CONFIG_FILES([
dep/lib/Makefile
dep/src/Makefile
dep/src/g3dlite/Makefile
- dep/src/sockets/Makefile
dep/src/zlib/Makefile
dep/src/gsoap/Makefile
dep/Makefile
diff --git a/contrib/extractor/.gitignore b/contrib/extractor/.gitignore
index 73cfdde63..c0dea6d25 100644
--- a/contrib/extractor/.gitignore
+++ b/contrib/extractor/.gitignore
@@ -14,8 +14,10 @@
*.ncb
*.pdb
*.suo
+*.sdf
debug
release
+ipch
*.user
*.ilk
ad_debug.exe
\ No newline at end of file
diff --git a/contrib/extractor/VC100_AD.sln b/contrib/extractor/VC100_AD.sln
new file mode 100644
index 000000000..0c148470f
--- /dev/null
+++ b/contrib/extractor/VC100_AD.sln
@@ -0,0 +1,19 @@
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ad", "VC100_ad.vcxproj", "{D7552D4F-408F-4F8E-859B-366659150CF4}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {D7552D4F-408F-4F8E-859B-366659150CF4}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D7552D4F-408F-4F8E-859B-366659150CF4}.Debug|Win32.Build.0 = Debug|Win32
+ {D7552D4F-408F-4F8E-859B-366659150CF4}.Release|Win32.ActiveCfg = Release|Win32
+ {D7552D4F-408F-4F8E-859B-366659150CF4}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/contrib/extractor/VC100_ad.vcxproj b/contrib/extractor/VC100_ad.vcxproj
new file mode 100644
index 000000000..9b5bde66f
--- /dev/null
+++ b/contrib/extractor/VC100_ad.vcxproj
@@ -0,0 +1,185 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+
+ ad
+ {D7552D4F-408F-4F8E-859B-366659150CF4}
+ ad
+
+
+
+ Application
+ false
+ MultiByte
+
+
+ Application
+ false
+ MultiByte
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>10.0.30319.1
+ .\
+ .\debug\
+
+ .\
+ .\release\
+
+ AllRules.ruleset
+
+
+ AllRules.ruleset
+
+
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ Win32
+ ./ad.tlb
+
+
+
+
+ Disabled
+ libmpq;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ EnableFastChecks
+ MultiThreadedDebug
+
+
+ $(IntDir)ad.pch
+ $(IntDir)
+ $(IntDir)
+ $(IntDir)
+ $(IntDir)
+ true
+ $(IntDir)
+ Level3
+ true
+ EditAndContinue
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0419
+
+
+ zlib.lib;%(AdditionalDependencies)
+ ad_debug.exe
+ true
+ ./debug/;%(AdditionalLibraryDirectories)
+ LIBCD.lib;%(IgnoreSpecificDefaultLibraries)
+ true
+ ./ad_debug.pdb
+ Console
+ false
+
+
+ MachineX86
+
+
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ Win32
+ ./ad.tlb
+
+
+
+
+ Full
+ OnlyExplicitInline
+ libmpq;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ MultiThreaded
+
+
+ $(IntDir)ad.pch
+ $(IntDir)
+ $(IntDir)
+ $(IntDir)
+ $(IntDir)
+ Level3
+ true
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0419
+
+
+ zlib.lib;%(AdditionalDependencies)
+ ./ad.exe
+ true
+ ./release/;%(AdditionalLibraryDirectories)
+ LIBC.lib;%(IgnoreSpecificDefaultLibraries)
+ ./ad.pdb
+ Console
+ false
+
+
+ MachineX86
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Disabled
+ %(PreprocessorDefinitions)
+ EnableFastChecks
+ true
+ Full
+ %(PreprocessorDefinitions)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/contrib/extractor/VC100_ad.vcxproj.filters b/contrib/extractor/VC100_ad.vcxproj.filters
new file mode 100644
index 000000000..a32c32c76
--- /dev/null
+++ b/contrib/extractor/VC100_ad.vcxproj.filters
@@ -0,0 +1,86 @@
+
+
+
+
+ {7748a821-40c1-4432-a07e-ff4da1273091}
+ cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
+
+
+ {bd48cc48-7a79-4088-9e3f-8bf123692891}
+ h;hpp;hxx;hm;inl
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+
\ No newline at end of file
diff --git a/contrib/vmap_extractor_v2/doc/The MoPaQ File Format.txt b/contrib/vmap_extractor_v2/doc/The MoPaQ File Format.txt
index 3a8f964cf..ce8d8f701 100644
--- a/contrib/vmap_extractor_v2/doc/The MoPaQ File Format.txt
+++ b/contrib/vmap_extractor_v2/doc/The MoPaQ File Format.txt
@@ -1,318 +1,318 @@
-THE MOPAQ ARCHIVE FORMAT
-v0.9 (Thursday, June 30, 2005)
-by Justin Olbrantz(Quantam)
-
-Distribution and reproduction of this specification are allowed without limitation, as long as it is not altered. Quoting
-in other works is freely allowed, as long as the source and author of the quote is stated.
-
-TABLE OF CONTENTS
-1. Introduction to the MoPaQ Format
-2. The MoPaQ Format
- 2.1 General Archive Layout
- 2.2 Archive Header
- 2.3 Block Table
- 2.4 Hash Table
- 2.5 File Data
- 2.6 Listfile
- 2.7 Extended Attributes
- 2.8 Weak (Old) Digital Signature
- 2.9 Strong (New) Digital Signature
-3. Algorithm Source Code
- 3.1 Encryption/Decryption
- 3.2 Hashing
- 3.3 Conversion of FILETIME and time_t
-
-1. INTRODUCTION TO THE MOPAQ FORMAT
-The MoPaQ (or MPQ) format is an archive file format designed by Mike O'Brien (hence the name Mike O'brien PaCK) at Blizzard
-Entertainment. The format has been used in all Blizzard games since (and including) Diablo. It is heavily optimized to be
-a read-only game archive format, and excels at this role.
-
-The Blizzard MoPaQ-reading functions are contained in the Storm module, which my be either statically or dynamically linked.
-The Blizzard MoPaQ-writing functions are contained in the MPQAPI module, which is always statically linked.
-
-2. THE MOPAQ FORMAT
-All numbers in the MoPaQ format are in little endian. Data types are listed either as int (integer, the number of bits specified),
-byte (8 bits), and char (bytes which contain ASCII characters). All sizes and offsets are in bytes, unless specified otherwise.
-Structure members are listed in the following general form:
-offset from the beginning of the structure: data type(array size) member name : member description
-
-2.1 GENERAL ARCHIVE LAYOUT
-- Archive Header
-- File Data
-- File Data - Special Files
-- Hash Table
-- Block Table
-- Strong Digital signature
-
-This is the usual archive format, and is not absolutely essential. Some archives have been observed placing the hash table
-and file table after the archive header, and before the file data.
-
-2.2 ARCHIVE HEADER
-00h: char(4) Magic : Indicates that the file is a MoPaQ archive. Must be ASCII "MPQ" 1Ah.
-04h: int32 HeaderSize : Size of the archive header. Should be 32.
-08h: int32 ArchiveSize : Size of the whole archive, including the header. Does not include the strong digital signature, if present.
-This size is used, among other things, for determining the region to hash in computing the digital signature.
-0Ch: int16 Unknown : Unknown
-0Eh: int8 SectorSizeShift : Power of two exponent specifying the number of 512-byte disk sectors in each logical sector
-in the archive. The size of each logical sector the archive is 512 * 2^SectorSizeShift. Bugs in the Storm library dictate
-that this should always be 3 (4096 byte sectors).
-10h: int32 HashTableOffset : Offset to the beginning of the hash table, relative to the beginning of the archive.
-14h: int32 BlockTableOffset : Offset to the beginning of the block table, relative to the beginning of the archive.
-18h: int32 HashTableEntries : Number of entries in the hash table. Must be a power of two, and must be less than 2^16.
-1Ch: int32 BlockTableEntries : Number of entries in the block table.
-
-The archive header is the first structure in the archive, at archive offset 0, but the archive does not need to be at offset
-0 of the containing file. The offset of the archive in the file is referred to here as ArchiveOffset. If the archive is not
-at the beginning of the file, it must begin at a disk sector boundary (512 bytes). Early versions of Storm require that the
-archive be at the end of the containing file (ArchiveOffset + ArchiveSize = file size), but this is not required in newer
-versions (due to the strong digital signature not being considered a part of the archive).
-
-2.3 BLOCK TABLE
-The block table contains entries for each region in the archive. Regions may be either files or empty space, which may be
-overwritten by new files (typically this space is from deleted file data). The block table is encrypted, using the hash
-of "(block table)" as the key. Each entry is structured as follows:
-
-00h: int32 BlockOffset : Offset of the beginning of the block, relative to the beginning of the archive. Meaningless if the block size is 0.
-04h: int32 BlockSize : Size of the block in the archive.
-08h: int32 FileSize : Size of the file data stored in the block. Only valid if the block is a file, otherwise meaningless, and should be 0. If the file is compressed, this is the size of the uncompressed file data.
-0Ch: int32 Flags : Bit mask of the flags for the block. The following values are conclusively identified:
- 80000000h: Block is a file, and follows the file data format; otherwise, block is free space, and may be overwritten. If the block is not a file, all other flags should be cleared.
- 01000000h: File is stored as a single unit, rather than split into sectors.
- 00020000h: The file's encryption key is adjusted by the block offset and file size (explained in detail in the File Data section). File must be encrypted.
- 00010000h: File is encrypted.
- 00000200h: File is compressed. Mutually exclusive to file imploded.
- 00000100h: File is imploded. Mutually exclusive to file compressed.
-
-2.4 HASH TABLE
-Instead of storing file names, for quick access MoPaQs use a fixed, power of two-size hash table of files in the archive. A file is uniquely identified by its file path, its language, and its platform. The home entry for a file in the hash table is computed as a hash of the file path. In the event of a collision (the home entry is occupied by another file), progressive overflow is used, and the file is placed in the next available hash table entry. Searches for a desired file in the hash table proceed from the home entry for the file until either the file is found, the entire hash table is searched, or an empty hash table entry (FileBlockIndex of FFFFFFFFh) is encountered. The hash table is encrypted using the hash of "(hash table)" as the key. Each entry is structured as follows:
-
-00h: int32 FilePathHashA : The hash of the file path, using method A.
-04h: int32 FilePathHashB : The hash of the file path, using method B.
-08h: int16 Language : The language of the file. This is a Windows LANGID data type, and uses the same values. 0 indicates the default language (American English), or that the file is language-neutral.
-0Ah: int8 Platform : The platform the file is used for. 0 indicates the default platform. No other values have been observed.
-0Ch: int32 FileBlockIndex : If the hash table entry is valid, this is the index into the block table of the file. Otherwise, one of the following two values:
- FFFFFFFFh: Hash table entry is empty, and has always been empty. Terminates searches for a given file.
- FFFFFFFEh: Hash table entry is empty, but was valid at some point (in other words, the file was deleted). Does not terminate searches for a given file.
-
-2.5 FILE DATA
-00h: int32(SectorsInFile + 1) SectorOffsetTable : Offsets to the start of each sector's data, relative to the beginning of the file data. Not present if this information is calculatable (see details below).
-immediately following SectorOffsetTable: SectorData : Data of each sector in the file, packed end to end (see details below).
-
-Normally, file data is split up into sectors, for simple streaming. All sectors, save for the last, will contain as many bytes of file data as specified in the archive header's SectorSizeShift; the last sector may be smaller than this, depending on the size of the file data. This sector size is the size of the raw file data; if the file is compressed, the compressed sector will be smaller or the same size as the uncompressed sector size. Individual sectors in a compressed file may be stored uncompressed; this occurs if and only if the sector could not be compressed by the algorithm used (if the compressed sector size was greater than or equal to the size of the raw data), and is indicated by the sector's compressed size in SectorOffsetTable being equal to the uncompressed size of the sector (which may be calculated from the FileSize).
-
-If the sector is compressed (but not imploded), a bit mask byte of the compression algorithm(s) used to compress the sector is appended to the beginning of the compressed sector data. This additional byte counts towards the total size of the sector; if the size of the sector (including this byte) exceeds or matches the uncompressed size of the sector data, the sector will be stored uncompressed, and this byte omitted. Multiple compression algorithms may be used on the same sector; in this case, successive compression occurs in the order the algorithms are listed below, and decompression occurs in the opposite order. For implimentations of all of these algorithms, see StormLib.
- 40h: IMA ADPCM mono
- 80h: IMA ADPCM stereo
- 01h: Huffman encoded
- 02h: Deflated (see ZLib)
- 08h: Imploded (see PKWare Data Compression Library)
- 10h: BZip2 compressed (see BZip2)
-
-If the file is stored as a single unit (indicated in the file's Flags), there is effectively only a single sector, which
-contains the entire file.
-
-If the file is encrypted, each sector (after compression and appendage of the compression type byte, if applicable)
-is encrypted with the file's key. The base key for a file is determined by a hash of the file name stripped of the
-directory (i.e. the key for a file named "directory\file" would be computed as the hash of "file"). If this key is
-adjusted, as indicated in the file's Flags, the final key is calculated as ((base key + BlockOffset - ArchiveOffset)
-XOR FileSize) (StormLib - an open-source implementation of the MoPaQ reading and writing functions,
-by Ladislav Zezula - incorrectly uses an AND in place of the XOR). Each sector is encrypted using the key + the
-0-based index of the sector in the file. The SectorOffsetTable, if present, is encrypted using the key - 1.
-
-The SectorOffsetTable is omitted when the sizes and offsets of all sectors in the file are calculatable from the FileSize.
-This can happen in several circumstances. If the file is not compressed/imploded, then the size and offset of all sectors
-is known, based on the archive's SectorSizeShift. If the file is stored as a single unit compressed/imploded, then the
-SectorOffsetTable is omitted, as the single file "sector" corresponds to BlockSize and FileSize, as mentioned previously.
-Note that the SectorOffsetTable will always be present if the file is compressed/imploded and the file is not stored as
-a single unit, even if there is only a single sector in the file (the size of the file is less than or equal to the
-archive's sector size).
-
-2.6 LISTFILE
-The listfile is a very simple extension to the MoPaQ format that contains the file paths of (most) files in the archive.
-The languages and platforms of the files are not stored in the listfile. The listfile is contained in the file "(listfile)",
-and is simply a non-Unix-style text file with one file path on each line, lines terminated with the bytes 0Dh 0Ah. The file
-"(listfile)" may not be listed in the listfile.
-
-2.7 EXTENDED ATTRIBUTES
-The extended attributes are optional file attributes for files in the block table. These attributes were added at times after
-the MoPaQ format was already finalized, and it is not necessary for every archive to have all (or any) of the extended attributes.
-If an archive contains a given attribute, there will be an instance of that attribute for every block in the block table, although
-the attribute will be meaningless if the block is not a file. The order of the attributes for blocks correspond to the order of the
-blocks in the block table, and are of the same number. The attributes are stored in parallel arrays in the "(attributes)" file,
-in the archive. The attributes corresponding to this file need not be valid (and logically cannot be). Unlike all the other
-structures in the MoPaQ format, entries in the extended attributes are NOT guaranteed to be aligned. Also note that in some
-archives, malicious zeroing of the attributes has been observed, perhaps with the intent of breaking archive viewers. This
-file is structured as follows:
-
-00h: int32 Version : Specifies the extended attributes format version. For now, must be 100.
-04h: int32 AttributesPresent : Bit mask of the extended attributes present in the archive:
- 00000001h: File CRC32s.
- 00000002h: File timestamps.
- 00000004h: File MD5s.
-08h: int32(BlockTableEntries) CRC32s : CRC32s of the (uncompressed) file data for each block in the archive. Omitted if the
-archive does not have CRC32s. immediately after CRC32s: FILETIME(BlockTableEntries) Timestamps : Timestamps for each block
-in the archive. The format is that of the Windows FILETIME structure. Omitted if the archive does not have timestamps.
-immediately after Timestamps: MD5(BlockTableEntries) MD5s : MD5s of the (uncompressed) file data for each block in the archive.
-Omitted if the archive does not have MD5s.
-
-2.8 WEAK DIGITAL SIGNATURE
-The weak digital signature is a digital signature using Microsoft CryptoAPI. It is an implimentation of the RSASSA-PKCS1-v1_5
-digital signature protocol, using the MD5 hashing algorithm and a 512-bit (weak) RSA key (for more information about this
-protocol, see the RSA Labs PKCS1 specification). The public key and exponent are stored in a resource in Storm. The signature
-is stored uncompressed, unencrypted in the file "(signature)" in the archive. The archive is hashed from the beginning of the
-archive (ArchiveOffset in the containing file) to the end of the archive (the length indicated by ArchiveSize); the signature
-file is added to the archive before signing, and the space occupied by the file is considered to be all binary 0s during
-signing/verification. This file is structured as follows:
-
-00h: int32 Unknown : Must be 0.
-04h: int32 Unknown : must be 0.
-08h: int512 Signature : The digital signature. Like all other numbers in the MoPaQ format, this is stored in little-endian order.
-
-2.9 STRONG DIGITAL SIGNATURE
-The strong digital signature uses a simple proprietary implementation of RSA signing, using the SHA-1 hashing algorithm and
-a 2048-bit (strong) RSA key. The default public key and exponent are stored in Storm, but other keys may be used as well.
-The strong digital signature is stored immediately after the archive, in the containing file; the entire archive (ArchiveSize
-bytes, starting at ArchiveOffset in the containing file) is hashed as a single block. The signature has the following format:
-
-00h: char(4) Magic : Indicates the presence of a digital signature. Must be "NGIS" ("SIGN" backwards).
-04h: int2048 Signature : The digital signature, stored in little-endian format.
-
-When the Signature field is decrypted with the public key and exponent, and the result stored in little-endian order, it is structured as follows:
-
-00h: byte Padding : Must be 0Bh.
-01h: byte(235) Padding : Must be BBh.
-ECh: byte(20) SHA-1 : SHA-1 hash of the archive, in standard SHA-1 format.
-
-3. ALGORITHM SOURCE CODE
-3.1 ENCRYPTION/DECRYPTION
-I believe this was derived at some point from code in StormLib. Assumes the long type to be 32 bits, and the machine to be little endian order.
-
-unsigned long dwCryptTable[0x500];
-
-void InitializeCryptTable()
-{
- unsigned long seed = 0x00100001;
- unsigned long index1 = 0;
- unsigned long index2 = 0;
- int i;
-
- for (index1 = 0; index1 < 0x100; index1++)
- {
- for (index2 = index1, i = 0; i < 5; i++, index2 += 0x100)
- {
- unsigned long temp1, temp2;
-
- seed = (seed * 125 + 3) % 0x2AAAAB;
- temp1 = (seed & 0xFFFF) << 0x10;
-
- seed = (seed * 125 + 3) % 0x2AAAAB;
- temp2 = (seed & 0xFFFF);
-
- dwCryptTable[index2] = (temp1 | temp2);
- }
- }
-}
-
-void EncryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey)
-{
- unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer;
- unsigned long seed = 0xEEEEEEEE;
- unsigned long ch;
-
- assert(lpbyBuffer);
-
- dwLength /= sizeof(unsigned long);
-
- while(dwLength-- > 0)
- {
- seed += dwCryptTable[0x400 + (dwKey & 0xFF)];
- ch = *lpdwBuffer ^ (dwKey + seed);
-
- dwKey = ((~dwKey << 0x15) + 0x11111111) | (dwKey >> 0x0B);
- seed = *lpdwBuffer + seed + (seed << 5) + 3;
-
- *lpdwBuffer++ = ch;
- }
-}
-
-void DecryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey)
-{
- unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer;
- unsigned long seed = 0xEEEEEEEE;
- unsigned long ch;
-
- assert(lpbyBuffer);
-
- dwLength /= sizeof(unsigned long);
-
- while(dwLength-- > 0)
- {
- seed += dwCryptTable[0x400 + (dwKey & 0xFF)];
- ch = *lpdwBuffer ^ (dwKey + seed);
-
- dwKey = ((~dwKey << 0x15) + 0x11111111) | (dwKey >> 0x0B);
- seed = ch + seed + (seed << 5) + 3;
-
- *lpdwBuffer++ = ch;
- }
-}
-
-3.2 HASHING
-Based on code from StormLib.
-
-// Different types of hashes to make with HashString
-#define MPQ_HASH_TABLE_OFFSET 0
-#define MPQ_HASH_NAME_A 1
-#define MPQ_HASH_NAME_B 2
-#define MPQ_HASH_FILE_KEY 3
-
-unsigned long HashString(const char *lpszString, unsigned long dwHashType)
-{
- unsigned long seed1 = 0x7FED7FED;
- unsigned long seed2 = 0xEEEEEEEE;
- int ch;
-
- while (*lpszString != 0)
- {
- ch = toupper(*lpszString++);
-
- seed1 = dwCryptTable[(dwHashType * 0xFF) + ch] ^ (seed1 + seed2);
- seed2 = ch + seed1 + seed2 + (seed2 << 5) + 3;
- }
- return seed1;
-}
-
-3.3 CONVERSION OF FILETIME AND time_t
-
-#define EPOCH_OFFSET 116444736000000000ULL // Number of 100 ns units between 01/01/1601 and 01/01/1970
-
-bool GetTimeFromFileTime(FILETIME &fileTime, time_t &time)
-{
- // The FILETIME represents a 64-bit integer: the number of 100 ns units since January 1, 1601
- unsigned long long nTime = ((unsigned long long)fileTime.dwHighDateTime << 32) + fileTime.dwLowDateTime;
-
- if (nTime < EPOCH_OFFSET)
- return false;
-
- nTime -= EPOCH_OFFSET; // Convert the time base from 01/01/1601 to 01/01/1970
- nTime /= 10000000ULL; // Convert 100 ns to sec
-
- time = (time_t)nTime;
-
- // Test for overflow (FILETIME is 64 bits, time_t is 32 bits)
- if ((nTime - (unsigned long long)time) > 0)
- return false;
-
- return true;
-}
-
-void GetFileTimeFromTime(time_t &time, FILETIME &fileTime)
-{
- unsigned long long nTime = (unsigned long long)time;
-
- nTime *= 10000000ULL;
- nTime += EPOCH_OFFSET;
-
- fileTime.dwLowDateTime = (DWORD)nTime;
- fileTime.dwHighDateTime = (DWORD)(nTime >> 32);
-}
+THE MOPAQ ARCHIVE FORMAT
+v0.9 (Thursday, June 30, 2005)
+by Justin Olbrantz(Quantam)
+
+Distribution and reproduction of this specification are allowed without limitation, as long as it is not altered. Quoting
+in other works is freely allowed, as long as the source and author of the quote is stated.
+
+TABLE OF CONTENTS
+1. Introduction to the MoPaQ Format
+2. The MoPaQ Format
+ 2.1 General Archive Layout
+ 2.2 Archive Header
+ 2.3 Block Table
+ 2.4 Hash Table
+ 2.5 File Data
+ 2.6 Listfile
+ 2.7 Extended Attributes
+ 2.8 Weak (Old) Digital Signature
+ 2.9 Strong (New) Digital Signature
+3. Algorithm Source Code
+ 3.1 Encryption/Decryption
+ 3.2 Hashing
+ 3.3 Conversion of FILETIME and time_t
+
+1. INTRODUCTION TO THE MOPAQ FORMAT
+The MoPaQ (or MPQ) format is an archive file format designed by Mike O'Brien (hence the name Mike O'brien PaCK) at Blizzard
+Entertainment. The format has been used in all Blizzard games since (and including) Diablo. It is heavily optimized to be
+a read-only game archive format, and excels at this role.
+
+The Blizzard MoPaQ-reading functions are contained in the Storm module, which my be either statically or dynamically linked.
+The Blizzard MoPaQ-writing functions are contained in the MPQAPI module, which is always statically linked.
+
+2. THE MOPAQ FORMAT
+All numbers in the MoPaQ format are in little endian. Data types are listed either as int (integer, the number of bits specified),
+byte (8 bits), and char (bytes which contain ASCII characters). All sizes and offsets are in bytes, unless specified otherwise.
+Structure members are listed in the following general form:
+offset from the beginning of the structure: data type(array size) member name : member description
+
+2.1 GENERAL ARCHIVE LAYOUT
+- Archive Header
+- File Data
+- File Data - Special Files
+- Hash Table
+- Block Table
+- Strong Digital signature
+
+This is the usual archive format, and is not absolutely essential. Some archives have been observed placing the hash table
+and file table after the archive header, and before the file data.
+
+2.2 ARCHIVE HEADER
+00h: char(4) Magic : Indicates that the file is a MoPaQ archive. Must be ASCII "MPQ" 1Ah.
+04h: int32 HeaderSize : Size of the archive header. Should be 32.
+08h: int32 ArchiveSize : Size of the whole archive, including the header. Does not include the strong digital signature, if present.
+This size is used, among other things, for determining the region to hash in computing the digital signature.
+0Ch: int16 Unknown : Unknown
+0Eh: int8 SectorSizeShift : Power of two exponent specifying the number of 512-byte disk sectors in each logical sector
+in the archive. The size of each logical sector the archive is 512 * 2^SectorSizeShift. Bugs in the Storm library dictate
+that this should always be 3 (4096 byte sectors).
+10h: int32 HashTableOffset : Offset to the beginning of the hash table, relative to the beginning of the archive.
+14h: int32 BlockTableOffset : Offset to the beginning of the block table, relative to the beginning of the archive.
+18h: int32 HashTableEntries : Number of entries in the hash table. Must be a power of two, and must be less than 2^16.
+1Ch: int32 BlockTableEntries : Number of entries in the block table.
+
+The archive header is the first structure in the archive, at archive offset 0, but the archive does not need to be at offset
+0 of the containing file. The offset of the archive in the file is referred to here as ArchiveOffset. If the archive is not
+at the beginning of the file, it must begin at a disk sector boundary (512 bytes). Early versions of Storm require that the
+archive be at the end of the containing file (ArchiveOffset + ArchiveSize = file size), but this is not required in newer
+versions (due to the strong digital signature not being considered a part of the archive).
+
+2.3 BLOCK TABLE
+The block table contains entries for each region in the archive. Regions may be either files or empty space, which may be
+overwritten by new files (typically this space is from deleted file data). The block table is encrypted, using the hash
+of "(block table)" as the key. Each entry is structured as follows:
+
+00h: int32 BlockOffset : Offset of the beginning of the block, relative to the beginning of the archive. Meaningless if the block size is 0.
+04h: int32 BlockSize : Size of the block in the archive.
+08h: int32 FileSize : Size of the file data stored in the block. Only valid if the block is a file, otherwise meaningless, and should be 0. If the file is compressed, this is the size of the uncompressed file data.
+0Ch: int32 Flags : Bit mask of the flags for the block. The following values are conclusively identified:
+ 80000000h: Block is a file, and follows the file data format; otherwise, block is free space, and may be overwritten. If the block is not a file, all other flags should be cleared.
+ 01000000h: File is stored as a single unit, rather than split into sectors.
+ 00020000h: The file's encryption key is adjusted by the block offset and file size (explained in detail in the File Data section). File must be encrypted.
+ 00010000h: File is encrypted.
+ 00000200h: File is compressed. Mutually exclusive to file imploded.
+ 00000100h: File is imploded. Mutually exclusive to file compressed.
+
+2.4 HASH TABLE
+Instead of storing file names, for quick access MoPaQs use a fixed, power of two-size hash table of files in the archive. A file is uniquely identified by its file path, its language, and its platform. The home entry for a file in the hash table is computed as a hash of the file path. In the event of a collision (the home entry is occupied by another file), progressive overflow is used, and the file is placed in the next available hash table entry. Searches for a desired file in the hash table proceed from the home entry for the file until either the file is found, the entire hash table is searched, or an empty hash table entry (FileBlockIndex of FFFFFFFFh) is encountered. The hash table is encrypted using the hash of "(hash table)" as the key. Each entry is structured as follows:
+
+00h: int32 FilePathHashA : The hash of the file path, using method A.
+04h: int32 FilePathHashB : The hash of the file path, using method B.
+08h: int16 Language : The language of the file. This is a Windows LANGID data type, and uses the same values. 0 indicates the default language (American English), or that the file is language-neutral.
+0Ah: int8 Platform : The platform the file is used for. 0 indicates the default platform. No other values have been observed.
+0Ch: int32 FileBlockIndex : If the hash table entry is valid, this is the index into the block table of the file. Otherwise, one of the following two values:
+ FFFFFFFFh: Hash table entry is empty, and has always been empty. Terminates searches for a given file.
+ FFFFFFFEh: Hash table entry is empty, but was valid at some point (in other words, the file was deleted). Does not terminate searches for a given file.
+
+2.5 FILE DATA
+00h: int32(SectorsInFile + 1) SectorOffsetTable : Offsets to the start of each sector's data, relative to the beginning of the file data. Not present if this information is calculatable (see details below).
+immediately following SectorOffsetTable: SectorData : Data of each sector in the file, packed end to end (see details below).
+
+Normally, file data is split up into sectors, for simple streaming. All sectors, save for the last, will contain as many bytes of file data as specified in the archive header's SectorSizeShift; the last sector may be smaller than this, depending on the size of the file data. This sector size is the size of the raw file data; if the file is compressed, the compressed sector will be smaller or the same size as the uncompressed sector size. Individual sectors in a compressed file may be stored uncompressed; this occurs if and only if the sector could not be compressed by the algorithm used (if the compressed sector size was greater than or equal to the size of the raw data), and is indicated by the sector's compressed size in SectorOffsetTable being equal to the uncompressed size of the sector (which may be calculated from the FileSize).
+
+If the sector is compressed (but not imploded), a bit mask byte of the compression algorithm(s) used to compress the sector is appended to the beginning of the compressed sector data. This additional byte counts towards the total size of the sector; if the size of the sector (including this byte) exceeds or matches the uncompressed size of the sector data, the sector will be stored uncompressed, and this byte omitted. Multiple compression algorithms may be used on the same sector; in this case, successive compression occurs in the order the algorithms are listed below, and decompression occurs in the opposite order. For implimentations of all of these algorithms, see StormLib.
+ 40h: IMA ADPCM mono
+ 80h: IMA ADPCM stereo
+ 01h: Huffman encoded
+ 02h: Deflated (see ZLib)
+ 08h: Imploded (see PKWare Data Compression Library)
+ 10h: BZip2 compressed (see BZip2)
+
+If the file is stored as a single unit (indicated in the file's Flags), there is effectively only a single sector, which
+contains the entire file.
+
+If the file is encrypted, each sector (after compression and appendage of the compression type byte, if applicable)
+is encrypted with the file's key. The base key for a file is determined by a hash of the file name stripped of the
+directory (i.e. the key for a file named "directory\file" would be computed as the hash of "file"). If this key is
+adjusted, as indicated in the file's Flags, the final key is calculated as ((base key + BlockOffset - ArchiveOffset)
+XOR FileSize) (StormLib - an open-source implementation of the MoPaQ reading and writing functions,
+by Ladislav Zezula - incorrectly uses an AND in place of the XOR). Each sector is encrypted using the key + the
+0-based index of the sector in the file. The SectorOffsetTable, if present, is encrypted using the key - 1.
+
+The SectorOffsetTable is omitted when the sizes and offsets of all sectors in the file are calculatable from the FileSize.
+This can happen in several circumstances. If the file is not compressed/imploded, then the size and offset of all sectors
+is known, based on the archive's SectorSizeShift. If the file is stored as a single unit compressed/imploded, then the
+SectorOffsetTable is omitted, as the single file "sector" corresponds to BlockSize and FileSize, as mentioned previously.
+Note that the SectorOffsetTable will always be present if the file is compressed/imploded and the file is not stored as
+a single unit, even if there is only a single sector in the file (the size of the file is less than or equal to the
+archive's sector size).
+
+2.6 LISTFILE
+The listfile is a very simple extension to the MoPaQ format that contains the file paths of (most) files in the archive.
+The languages and platforms of the files are not stored in the listfile. The listfile is contained in the file "(listfile)",
+and is simply a non-Unix-style text file with one file path on each line, lines terminated with the bytes 0Dh 0Ah. The file
+"(listfile)" may not be listed in the listfile.
+
+2.7 EXTENDED ATTRIBUTES
+The extended attributes are optional file attributes for files in the block table. These attributes were added at times after
+the MoPaQ format was already finalized, and it is not necessary for every archive to have all (or any) of the extended attributes.
+If an archive contains a given attribute, there will be an instance of that attribute for every block in the block table, although
+the attribute will be meaningless if the block is not a file. The order of the attributes for blocks correspond to the order of the
+blocks in the block table, and are of the same number. The attributes are stored in parallel arrays in the "(attributes)" file,
+in the archive. The attributes corresponding to this file need not be valid (and logically cannot be). Unlike all the other
+structures in the MoPaQ format, entries in the extended attributes are NOT guaranteed to be aligned. Also note that in some
+archives, malicious zeroing of the attributes has been observed, perhaps with the intent of breaking archive viewers. This
+file is structured as follows:
+
+00h: int32 Version : Specifies the extended attributes format version. For now, must be 100.
+04h: int32 AttributesPresent : Bit mask of the extended attributes present in the archive:
+ 00000001h: File CRC32s.
+ 00000002h: File timestamps.
+ 00000004h: File MD5s.
+08h: int32(BlockTableEntries) CRC32s : CRC32s of the (uncompressed) file data for each block in the archive. Omitted if the
+archive does not have CRC32s. immediately after CRC32s: FILETIME(BlockTableEntries) Timestamps : Timestamps for each block
+in the archive. The format is that of the Windows FILETIME structure. Omitted if the archive does not have timestamps.
+immediately after Timestamps: MD5(BlockTableEntries) MD5s : MD5s of the (uncompressed) file data for each block in the archive.
+Omitted if the archive does not have MD5s.
+
+2.8 WEAK DIGITAL SIGNATURE
+The weak digital signature is a digital signature using Microsoft CryptoAPI. It is an implimentation of the RSASSA-PKCS1-v1_5
+digital signature protocol, using the MD5 hashing algorithm and a 512-bit (weak) RSA key (for more information about this
+protocol, see the RSA Labs PKCS1 specification). The public key and exponent are stored in a resource in Storm. The signature
+is stored uncompressed, unencrypted in the file "(signature)" in the archive. The archive is hashed from the beginning of the
+archive (ArchiveOffset in the containing file) to the end of the archive (the length indicated by ArchiveSize); the signature
+file is added to the archive before signing, and the space occupied by the file is considered to be all binary 0s during
+signing/verification. This file is structured as follows:
+
+00h: int32 Unknown : Must be 0.
+04h: int32 Unknown : must be 0.
+08h: int512 Signature : The digital signature. Like all other numbers in the MoPaQ format, this is stored in little-endian order.
+
+2.9 STRONG DIGITAL SIGNATURE
+The strong digital signature uses a simple proprietary implementation of RSA signing, using the SHA-1 hashing algorithm and
+a 2048-bit (strong) RSA key. The default public key and exponent are stored in Storm, but other keys may be used as well.
+The strong digital signature is stored immediately after the archive, in the containing file; the entire archive (ArchiveSize
+bytes, starting at ArchiveOffset in the containing file) is hashed as a single block. The signature has the following format:
+
+00h: char(4) Magic : Indicates the presence of a digital signature. Must be "NGIS" ("SIGN" backwards).
+04h: int2048 Signature : The digital signature, stored in little-endian format.
+
+When the Signature field is decrypted with the public key and exponent, and the result stored in little-endian order, it is structured as follows:
+
+00h: byte Padding : Must be 0Bh.
+01h: byte(235) Padding : Must be BBh.
+ECh: byte(20) SHA-1 : SHA-1 hash of the archive, in standard SHA-1 format.
+
+3. ALGORITHM SOURCE CODE
+3.1 ENCRYPTION/DECRYPTION
+I believe this was derived at some point from code in StormLib. Assumes the long type to be 32 bits, and the machine to be little endian order.
+
+unsigned long dwCryptTable[0x500];
+
+void InitializeCryptTable()
+{
+ unsigned long seed = 0x00100001;
+ unsigned long index1 = 0;
+ unsigned long index2 = 0;
+ int i;
+
+ for (index1 = 0; index1 < 0x100; index1++)
+ {
+ for (index2 = index1, i = 0; i < 5; i++, index2 += 0x100)
+ {
+ unsigned long temp1, temp2;
+
+ seed = (seed * 125 + 3) % 0x2AAAAB;
+ temp1 = (seed & 0xFFFF) << 0x10;
+
+ seed = (seed * 125 + 3) % 0x2AAAAB;
+ temp2 = (seed & 0xFFFF);
+
+ dwCryptTable[index2] = (temp1 | temp2);
+ }
+ }
+}
+
+void EncryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey)
+{
+ unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer;
+ unsigned long seed = 0xEEEEEEEE;
+ unsigned long ch;
+
+ assert(lpbyBuffer);
+
+ dwLength /= sizeof(unsigned long);
+
+ while(dwLength-- > 0)
+ {
+ seed += dwCryptTable[0x400 + (dwKey & 0xFF)];
+ ch = *lpdwBuffer ^ (dwKey + seed);
+
+ dwKey = ((~dwKey << 0x15) + 0x11111111) | (dwKey >> 0x0B);
+ seed = *lpdwBuffer + seed + (seed << 5) + 3;
+
+ *lpdwBuffer++ = ch;
+ }
+}
+
+void DecryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey)
+{
+ unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer;
+ unsigned long seed = 0xEEEEEEEE;
+ unsigned long ch;
+
+ assert(lpbyBuffer);
+
+ dwLength /= sizeof(unsigned long);
+
+ while(dwLength-- > 0)
+ {
+ seed += dwCryptTable[0x400 + (dwKey & 0xFF)];
+ ch = *lpdwBuffer ^ (dwKey + seed);
+
+ dwKey = ((~dwKey << 0x15) + 0x11111111) | (dwKey >> 0x0B);
+ seed = ch + seed + (seed << 5) + 3;
+
+ *lpdwBuffer++ = ch;
+ }
+}
+
+3.2 HASHING
+Based on code from StormLib.
+
+// Different types of hashes to make with HashString
+#define MPQ_HASH_TABLE_OFFSET 0
+#define MPQ_HASH_NAME_A 1
+#define MPQ_HASH_NAME_B 2
+#define MPQ_HASH_FILE_KEY 3
+
+unsigned long HashString(const char *lpszString, unsigned long dwHashType)
+{
+ unsigned long seed1 = 0x7FED7FED;
+ unsigned long seed2 = 0xEEEEEEEE;
+ int ch;
+
+ while (*lpszString != 0)
+ {
+ ch = toupper(*lpszString++);
+
+ seed1 = dwCryptTable[(dwHashType * 0xFF) + ch] ^ (seed1 + seed2);
+ seed2 = ch + seed1 + seed2 + (seed2 << 5) + 3;
+ }
+ return seed1;
+}
+
+3.3 CONVERSION OF FILETIME AND time_t
+
+#define EPOCH_OFFSET 116444736000000000ULL // Number of 100 ns units between 01/01/1601 and 01/01/1970
+
+bool GetTimeFromFileTime(FILETIME &fileTime, time_t &time)
+{
+ // The FILETIME represents a 64-bit integer: the number of 100 ns units since January 1, 1601
+ unsigned long long nTime = ((unsigned long long)fileTime.dwHighDateTime << 32) + fileTime.dwLowDateTime;
+
+ if (nTime < EPOCH_OFFSET)
+ return false;
+
+ nTime -= EPOCH_OFFSET; // Convert the time base from 01/01/1601 to 01/01/1970
+ nTime /= 10000000ULL; // Convert 100 ns to sec
+
+ time = (time_t)nTime;
+
+ // Test for overflow (FILETIME is 64 bits, time_t is 32 bits)
+ if ((nTime - (unsigned long long)time) > 0)
+ return false;
+
+ return true;
+}
+
+void GetFileTimeFromTime(time_t &time, FILETIME &fileTime)
+{
+ unsigned long long nTime = (unsigned long long)time;
+
+ nTime *= 10000000ULL;
+ nTime += EPOCH_OFFSET;
+
+ fileTime.dwLowDateTime = (DWORD)nTime;
+ fileTime.dwHighDateTime = (DWORD)(nTime >> 32);
+}
diff --git a/contrib/vmap_extractor_v2/stormdll/StormDll.def b/contrib/vmap_extractor_v2/stormdll/StormDll.def
index e5cfea38c..8de88f5db 100644
--- a/contrib/vmap_extractor_v2/stormdll/StormDll.def
+++ b/contrib/vmap_extractor_v2/stormdll/StormDll.def
@@ -1,25 +1,25 @@
-; Storm definition file with alternate Storm.dll names
-LIBRARY "Storm"
-
-EXPORTS
- StormCloseArchive @252 ; 0x0FC
- StormCloseFile @253 ; 0x0FD
- StormDestroy @262 ; 0x106
- StormGetFileArchive @264 ; 0x108
- StormGetFileSize @265 ; 0x109
- StormOpenArchive @266 ; 0x10A
- StormOpenFile @267 ; 0x10B
- StormOpenFileEx @268 ; 0x10C
- StormReadFile @269 ; 0x10D
- StormSetBasePath @270 ; 0x10E
- StormSetFilePointer @271 ; 0x10F
- StormSetLocale @272 ; 0x110
- StormGetBasePath @273 ; 0x111
- StormGetArchiveName @275 ; 0x113
- StormGetFileName @276 ; 0x114
-
-; StormSetLastError @465 ; 0x
-
- StormCompress @551 ; 0x227
- StormDecompress @552 ; 0x228
+; Storm definition file with alternate Storm.dll names
+LIBRARY "Storm"
+
+EXPORTS
+ StormCloseArchive @252 ; 0x0FC
+ StormCloseFile @253 ; 0x0FD
+ StormDestroy @262 ; 0x106
+ StormGetFileArchive @264 ; 0x108
+ StormGetFileSize @265 ; 0x109
+ StormOpenArchive @266 ; 0x10A
+ StormOpenFile @267 ; 0x10B
+ StormOpenFileEx @268 ; 0x10C
+ StormReadFile @269 ; 0x10D
+ StormSetBasePath @270 ; 0x10E
+ StormSetFilePointer @271 ; 0x10F
+ StormSetLocale @272 ; 0x110
+ StormGetBasePath @273 ; 0x111
+ StormGetArchiveName @275 ; 0x113
+ StormGetFileName @276 ; 0x114
+
+; StormSetLastError @465 ; 0x
+
+ StormCompress @551 ; 0x227
+ StormDecompress @552 ; 0x228
\ No newline at end of file
diff --git a/contrib/vmap_extractor_v2/stormlib/bzip2/dlltest.dsp b/contrib/vmap_extractor_v2/stormlib/bzip2/dlltest.dsp
index 4b1615edc..04819a495 100644
--- a/contrib/vmap_extractor_v2/stormlib/bzip2/dlltest.dsp
+++ b/contrib/vmap_extractor_v2/stormlib/bzip2/dlltest.dsp
@@ -1,93 +1,93 @@
-# Microsoft Developer Studio Project File - Name="dlltest" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** ҏWȂł **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=dlltest - Win32 Debug
-!MESSAGE ͗LҲ̧قł͂܂B ۼުĂނ邽߂ɂ NMAKE gpĂB
-!MESSAGE [Ҳ̧ق̴߰] ނgpĎsĂ
-!MESSAGE
-!MESSAGE NMAKE /f "dlltest.mak".
-!MESSAGE
-!MESSAGE NMAKE ̎sɍ\wł܂
-!MESSAGE ײݏϸۂ̐ݒ`܂B:
-!MESSAGE
-!MESSAGE NMAKE /f "dlltest.mak" CFG="dlltest - Win32 Debug"
-!MESSAGE
-!MESSAGE I\ Ӱ:
-!MESSAGE
-!MESSAGE "dlltest - Win32 Release" ("Win32 (x86) Console Application" p)
-!MESSAGE "dlltest - Win32 Debug" ("Win32 (x86) Console Application" p)
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "dlltest - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x411 /d "NDEBUG"
-# ADD RSC /l 0x411 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"minibz2.exe"
-
-!ELSEIF "$(CFG)" == "dlltest - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "dlltest_"
-# PROP BASE Intermediate_Dir "dlltest_"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "dlltest_"
-# PROP Intermediate_Dir "dlltest_"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x411 /d "_DEBUG"
-# ADD RSC /l 0x411 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"minibz2.exe" /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "dlltest - Win32 Release"
-# Name "dlltest - Win32 Debug"
-# Begin Source File
-
-SOURCE=.\bzlib.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\dlltest.c
-# End Source File
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="dlltest" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** ҏWȂł **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=dlltest - Win32 Debug
+!MESSAGE ͗LҲ̧قł͂܂B ۼުĂނ邽߂ɂ NMAKE gpĂB
+!MESSAGE [Ҳ̧ق̴߰] ނgpĎsĂ
+!MESSAGE
+!MESSAGE NMAKE /f "dlltest.mak".
+!MESSAGE
+!MESSAGE NMAKE ̎sɍ\wł܂
+!MESSAGE ײݏϸۂ̐ݒ`܂B:
+!MESSAGE
+!MESSAGE NMAKE /f "dlltest.mak" CFG="dlltest - Win32 Debug"
+!MESSAGE
+!MESSAGE I\ Ӱ:
+!MESSAGE
+!MESSAGE "dlltest - Win32 Release" ("Win32 (x86) Console Application" p)
+!MESSAGE "dlltest - Win32 Debug" ("Win32 (x86) Console Application" p)
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "dlltest - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x411 /d "NDEBUG"
+# ADD RSC /l 0x411 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"minibz2.exe"
+
+!ELSEIF "$(CFG)" == "dlltest - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "dlltest_"
+# PROP BASE Intermediate_Dir "dlltest_"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "dlltest_"
+# PROP Intermediate_Dir "dlltest_"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x411 /d "_DEBUG"
+# ADD RSC /l 0x411 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"minibz2.exe" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "dlltest - Win32 Release"
+# Name "dlltest - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\bzlib.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\dlltest.c
+# End Source File
+# End Target
+# End Project
diff --git a/contrib/vmap_extractor_v2/stormlib/bzip2/libbz2.def b/contrib/vmap_extractor_v2/stormlib/bzip2/libbz2.def
index 2dc0dd891..4f83fcc61 100644
--- a/contrib/vmap_extractor_v2/stormlib/bzip2/libbz2.def
+++ b/contrib/vmap_extractor_v2/stormlib/bzip2/libbz2.def
@@ -1,27 +1,27 @@
-LIBRARY LIBBZ2
-DESCRIPTION "libbzip2: library for data compression"
-EXPORTS
- BZ2_bzCompressInit
- BZ2_bzCompress
- BZ2_bzCompressEnd
- BZ2_bzDecompressInit
- BZ2_bzDecompress
- BZ2_bzDecompressEnd
- BZ2_bzReadOpen
- BZ2_bzReadClose
- BZ2_bzReadGetUnused
- BZ2_bzRead
- BZ2_bzWriteOpen
- BZ2_bzWrite
- BZ2_bzWriteClose
- BZ2_bzWriteClose64
- BZ2_bzBuffToBuffCompress
- BZ2_bzBuffToBuffDecompress
- BZ2_bzlibVersion
- BZ2_bzopen
- BZ2_bzdopen
- BZ2_bzread
- BZ2_bzwrite
- BZ2_bzflush
- BZ2_bzclose
- BZ2_bzerror
+LIBRARY LIBBZ2
+DESCRIPTION "libbzip2: library for data compression"
+EXPORTS
+ BZ2_bzCompressInit
+ BZ2_bzCompress
+ BZ2_bzCompressEnd
+ BZ2_bzDecompressInit
+ BZ2_bzDecompress
+ BZ2_bzDecompressEnd
+ BZ2_bzReadOpen
+ BZ2_bzReadClose
+ BZ2_bzReadGetUnused
+ BZ2_bzRead
+ BZ2_bzWriteOpen
+ BZ2_bzWrite
+ BZ2_bzWriteClose
+ BZ2_bzWriteClose64
+ BZ2_bzBuffToBuffCompress
+ BZ2_bzBuffToBuffDecompress
+ BZ2_bzlibVersion
+ BZ2_bzopen
+ BZ2_bzdopen
+ BZ2_bzread
+ BZ2_bzwrite
+ BZ2_bzflush
+ BZ2_bzclose
+ BZ2_bzerror
diff --git a/contrib/vmap_extractor_v2/stormlib/bzip2/libbz2.dsp b/contrib/vmap_extractor_v2/stormlib/bzip2/libbz2.dsp
index a21a20f75..06c1d3762 100644
--- a/contrib/vmap_extractor_v2/stormlib/bzip2/libbz2.dsp
+++ b/contrib/vmap_extractor_v2/stormlib/bzip2/libbz2.dsp
@@ -1,130 +1,130 @@
-# Microsoft Developer Studio Project File - Name="libbz2" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** ҏWȂł **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=libbz2 - Win32 Debug
-!MESSAGE ͗LҲ̧قł͂܂B ۼުĂނ邽߂ɂ NMAKE gpĂB
-!MESSAGE [Ҳ̧ق̴߰] ނgpĎsĂ
-!MESSAGE
-!MESSAGE NMAKE /f "libbz2.mak".
-!MESSAGE
-!MESSAGE NMAKE ̎sɍ\wł܂
-!MESSAGE ײݏϸۂ̐ݒ`܂B:
-!MESSAGE
-!MESSAGE NMAKE /f "libbz2.mak" CFG="libbz2 - Win32 Debug"
-!MESSAGE
-!MESSAGE I\ Ӱ:
-!MESSAGE
-!MESSAGE "libbz2 - Win32 Release" ("Win32 (x86) Dynamic-Link Library" p)
-!MESSAGE "libbz2 - Win32 Debug" ("Win32 (x86) Dynamic-Link Library" p)
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "libbz2 - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
-# ADD BASE RSC /l 0x411 /d "NDEBUG"
-# ADD RSC /l 0x411 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /out:"libbz2.dll"
-
-!ELSEIF "$(CFG)" == "libbz2 - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
-# ADD BASE RSC /l 0x411 /d "_DEBUG"
-# ADD RSC /l 0x411 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"libbz2.dll" /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "libbz2 - Win32 Release"
-# Name "libbz2 - Win32 Debug"
-# Begin Source File
-
-SOURCE=.\blocksort.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\bzlib.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\bzlib.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\bzlib_private.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\compress.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\crctable.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\decompress.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\huffman.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libbz2.def
-# End Source File
-# Begin Source File
-
-SOURCE=.\randtable.c
-# End Source File
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="libbz2" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** ҏWȂł **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=libbz2 - Win32 Debug
+!MESSAGE ͗LҲ̧قł͂܂B ۼުĂނ邽߂ɂ NMAKE gpĂB
+!MESSAGE [Ҳ̧ق̴߰] ނgpĎsĂ
+!MESSAGE
+!MESSAGE NMAKE /f "libbz2.mak".
+!MESSAGE
+!MESSAGE NMAKE ̎sɍ\wł܂
+!MESSAGE ײݏϸۂ̐ݒ`܂B:
+!MESSAGE
+!MESSAGE NMAKE /f "libbz2.mak" CFG="libbz2 - Win32 Debug"
+!MESSAGE
+!MESSAGE I\ Ӱ:
+!MESSAGE
+!MESSAGE "libbz2 - Win32 Release" ("Win32 (x86) Dynamic-Link Library" p)
+!MESSAGE "libbz2 - Win32 Debug" ("Win32 (x86) Dynamic-Link Library" p)
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "libbz2 - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x411 /d "NDEBUG"
+# ADD RSC /l 0x411 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /out:"libbz2.dll"
+
+!ELSEIF "$(CFG)" == "libbz2 - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x411 /d "_DEBUG"
+# ADD RSC /l 0x411 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"libbz2.dll" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "libbz2 - Win32 Release"
+# Name "libbz2 - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\blocksort.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\bzlib.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\bzlib.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\bzlib_private.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\compress.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\crctable.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\decompress.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\huffman.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libbz2.def
+# End Source File
+# Begin Source File
+
+SOURCE=.\randtable.c
+# End Source File
+# End Target
+# End Project
diff --git a/contrib/vmap_extractor_v2/stormlib/bzip2/makefile.msc b/contrib/vmap_extractor_v2/stormlib/bzip2/makefile.msc
index 799a18a5f..6a628a753 100644
--- a/contrib/vmap_extractor_v2/stormlib/bzip2/makefile.msc
+++ b/contrib/vmap_extractor_v2/stormlib/bzip2/makefile.msc
@@ -1,63 +1,63 @@
-# Makefile for Microsoft Visual C++ 6.0
-# usage: nmake -f makefile.msc
-# K.M. Syring (syring@gsf.de)
-# Fixed up by JRS for bzip2-0.9.5d release.
-
-CC=cl
-CFLAGS= -DWIN32 -MD -Ox -D_FILE_OFFSET_BITS=64 -nologo
-
-OBJS= blocksort.obj \
- huffman.obj \
- crctable.obj \
- randtable.obj \
- compress.obj \
- decompress.obj \
- bzlib.obj
-
-all: lib bzip2 test
-
-bzip2: lib
- $(CC) $(CFLAGS) -o bzip2 bzip2.c libbz2.lib setargv.obj
- $(CC) $(CFLAGS) -o bzip2recover bzip2recover.c
-
-lib: $(OBJS)
- lib /out:libbz2.lib $(OBJS)
-
-test: bzip2
- type words1
- .\\bzip2 -1 < sample1.ref > sample1.rb2
- .\\bzip2 -2 < sample2.ref > sample2.rb2
- .\\bzip2 -3 < sample3.ref > sample3.rb2
- .\\bzip2 -d < sample1.bz2 > sample1.tst
- .\\bzip2 -d < sample2.bz2 > sample2.tst
- .\\bzip2 -ds < sample3.bz2 > sample3.tst
- @echo All six of the fc's should find no differences.
- @echo If fc finds an error on sample3.bz2, this could be
- @echo because WinZip's 'TAR file smart CR/LF conversion'
- @echo is too clever for its own good. Disable this option.
- @echo The correct size for sample3.ref is 120,244. If it
- @echo is 150,251, WinZip has messed it up.
- fc sample1.bz2 sample1.rb2
- fc sample2.bz2 sample2.rb2
- fc sample3.bz2 sample3.rb2
- fc sample1.tst sample1.ref
- fc sample2.tst sample2.ref
- fc sample3.tst sample3.ref
-
-
-
-clean:
- del *.obj
- del libbz2.lib
- del bzip2.exe
- del bzip2recover.exe
- del sample1.rb2
- del sample2.rb2
- del sample3.rb2
- del sample1.tst
- del sample2.tst
- del sample3.tst
-
-.c.obj:
- $(CC) $(CFLAGS) -c $*.c -o $*.obj
-
+# Makefile for Microsoft Visual C++ 6.0
+# usage: nmake -f makefile.msc
+# K.M. Syring (syring@gsf.de)
+# Fixed up by JRS for bzip2-0.9.5d release.
+
+CC=cl
+CFLAGS= -DWIN32 -MD -Ox -D_FILE_OFFSET_BITS=64 -nologo
+
+OBJS= blocksort.obj \
+ huffman.obj \
+ crctable.obj \
+ randtable.obj \
+ compress.obj \
+ decompress.obj \
+ bzlib.obj
+
+all: lib bzip2 test
+
+bzip2: lib
+ $(CC) $(CFLAGS) -o bzip2 bzip2.c libbz2.lib setargv.obj
+ $(CC) $(CFLAGS) -o bzip2recover bzip2recover.c
+
+lib: $(OBJS)
+ lib /out:libbz2.lib $(OBJS)
+
+test: bzip2
+ type words1
+ .\\bzip2 -1 < sample1.ref > sample1.rb2
+ .\\bzip2 -2 < sample2.ref > sample2.rb2
+ .\\bzip2 -3 < sample3.ref > sample3.rb2
+ .\\bzip2 -d < sample1.bz2 > sample1.tst
+ .\\bzip2 -d < sample2.bz2 > sample2.tst
+ .\\bzip2 -ds < sample3.bz2 > sample3.tst
+ @echo All six of the fc's should find no differences.
+ @echo If fc finds an error on sample3.bz2, this could be
+ @echo because WinZip's 'TAR file smart CR/LF conversion'
+ @echo is too clever for its own good. Disable this option.
+ @echo The correct size for sample3.ref is 120,244. If it
+ @echo is 150,251, WinZip has messed it up.
+ fc sample1.bz2 sample1.rb2
+ fc sample2.bz2 sample2.rb2
+ fc sample3.bz2 sample3.rb2
+ fc sample1.tst sample1.ref
+ fc sample2.tst sample2.ref
+ fc sample3.tst sample3.ref
+
+
+
+clean:
+ del *.obj
+ del libbz2.lib
+ del bzip2.exe
+ del bzip2recover.exe
+ del sample1.rb2
+ del sample2.rb2
+ del sample3.rb2
+ del sample1.tst
+ del sample2.tst
+ del sample3.tst
+
+.c.obj:
+ $(CC) $(CFLAGS) -c $*.c -o $*.obj
+
diff --git a/dep/include/Makefile.am b/dep/include/Makefile.am
index 6e7289426..afdfa0122 100644
--- a/dep/include/Makefile.am
+++ b/dep/include/Makefile.am
@@ -160,34 +160,6 @@ EXTRA_DIST += \
postgre/pg_type.h \
postgre/postgres_ext.h
-# Sockets header files for Win32 builds
-EXTRA_DIST += \
- sockets\Base64.h \
- sockets\CircularBuffer.h \
- sockets\IFile.h \
- sockets\Ipv4Address.h \
- sockets\Ipv6Address.h \
- sockets\ISocketHandler.h \
- sockets\ListenSocket.h \
- sockets\Mutex.h \
- sockets\Parse.h \
- sockets\RandomNumber.h \
- sockets\ResolvServer.h \
- sockets\ResolvSocket.h \
- sockets\SctpSocket.h \
- sockets\Socket.h \
- sockets\socket_include.h \
- sockets\SocketAddress.h \
- sockets\SocketHandler.h \
- sockets\sockets-config.h \
- sockets\StdLog.h \
- sockets\StdoutLog.h \
- sockets\TcpSocket.h \
- sockets\Thread.h \
- sockets\UdpSocket.h \
- sockets\Uid.h \
- sockets\Utility.h
-
# VLD header files for Win32 builds
EXTRA_DIST += \
vld/vld.h
diff --git a/dep/include/sockets/Base64.h b/dep/include/sockets/Base64.h
deleted file mode 100644
index a632bbec7..000000000
--- a/dep/include/sockets/Base64.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/** \file Base64.h
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_Base64_H
-#define _SOCKETS_Base64_H
-
-#include "sockets-config.h"
-#ifdef _MSC_VER
-#pragma warning(disable:4514)
-#endif
-
-#include
-#include
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-/** \defgroup util Utilities */
-
-/** Base64 encode/decode.
- \ingroup util */
-class Base64
-{
-public:
- Base64();
-
- void encode(FILE *, std::string& , bool add_crlf = true);
- void encode(const std::string&, std::string& , bool add_crlf = true);
- void encode(const char *, size_t, std::string& , bool add_crlf = true);
- void encode(const unsigned char *, size_t, std::string& , bool add_crlf = true);
-
- void decode(const std::string&, std::string& );
- void decode(const std::string&, unsigned char *, size_t&);
-
- size_t decode_length(const std::string& );
-
-private:
- Base64(const Base64& ) {}
- Base64& operator=(const Base64& ) { return *this; }
-static const char *bstr;
-static const char rstr[128];
-};
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // _SOCKETS_Base64_H
-
diff --git a/dep/include/sockets/Exception.h b/dep/include/sockets/Exception.h
deleted file mode 100644
index 81ba7373d..000000000
--- a/dep/include/sockets/Exception.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- ** \file Exception.h
- ** \date 2007-09-28
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2007 Anders Hedstrom
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _Sockets_Exception_H
-#define _Sockets_Exception_H
-
-#include
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-
-class Exception
-{
-public:
- Exception(const std::string& description);
- virtual ~Exception() {}
-
- virtual const std::string ToString() const;
-
- Exception(const Exception& ) {} // copy constructor
-
- Exception& operator=(const Exception& ) { return *this; } // assignment operator
-
-private:
- std::string m_description;
-
-};
-
-
-
-#ifdef SOCKETS_NAMESPACE
-} // namespace SOCKETS_NAMESPACE {
-#endif
-
-#endif // _Sockets_Exception_H
-
diff --git a/dep/include/sockets/File.h b/dep/include/sockets/File.h
deleted file mode 100644
index 58a1b71bb..000000000
--- a/dep/include/sockets/File.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/** \file File.h
- ** \date 2005-04-25
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_File_H
-#define _SOCKETS_File_H
-
-#include "sockets-config.h"
-#include "IFile.h"
-#include
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-/** IFile implementation of a disk file.
- \ingroup file */
-class File : public IFile
-{
-public:
- File();
- ~File();
-
- bool fopen(const std::string&, const std::string&);
- void fclose();
-
- size_t fread(char *, size_t, size_t) const;
- size_t fwrite(const char *, size_t, size_t);
-
- char *fgets(char *, int) const;
- void fprintf(const char *format, ...);
-
- off_t size() const;
- bool eof() const;
-
- void reset_read() const;
- void reset_write();
-
-private:
- File(const File& ) {} // copy constructor
- File& operator=(const File& ) { return *this; } // assignment operator
-
- std::string m_path;
- std::string m_mode;
- FILE *m_fil;
- mutable long m_rptr;
- long m_wptr;
-};
-
-
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // _SOCKETS_File_H
-
diff --git a/dep/include/sockets/IFile.h b/dep/include/sockets/IFile.h
deleted file mode 100644
index aecc50f59..000000000
--- a/dep/include/sockets/IFile.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/** \file IFile.h
- ** \date 2005-04-25
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_IFile_H
-#define _SOCKETS_IFile_H
-
-#include "sockets-config.h"
-#include
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-/** \defgroup file File handling */
-/** Pure virtual file I/O interface.
- \ingroup file */
-class IFile
-{
-public:
- virtual ~IFile() {}
-
- virtual bool fopen(const std::string&, const std::string&) = 0;
- virtual void fclose() = 0;
-
- virtual size_t fread(char *, size_t, size_t) const = 0;
- virtual size_t fwrite(const char *, size_t, size_t) = 0;
-
- virtual char *fgets(char *, int) const = 0;
- virtual void fprintf(const char *format, ...) = 0;
-
- virtual off_t size() const = 0;
- virtual bool eof() const = 0;
-
- virtual void reset_read() const = 0;
- virtual void reset_write() = 0;
-
-};
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // _SOCKETS_IFile_H
-
diff --git a/dep/include/sockets/ISocketHandler.h b/dep/include/sockets/ISocketHandler.h
deleted file mode 100644
index 2667e2d22..000000000
--- a/dep/include/sockets/ISocketHandler.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/** \file ISocketHandler.h
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_ISocketHandler_H
-#define _SOCKETS_ISocketHandler_H
-#include "sockets-config.h"
-
-#include
-
-#include "socket_include.h"
-#include "Socket.h"
-#include "StdLog.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-typedef enum {
- LIST_CALLONCONNECT = 0,
-#ifdef ENABLE_DETACH
- LIST_DETACH,
-#endif
- LIST_TIMEOUT,
- LIST_RETRY,
- LIST_CLOSE
-} list_t;
-
-class SocketAddress;
-class Mutex;
-
-
-/** Socket container class, event generator.
- \ingroup basic */
-class ISocketHandler
-{
- friend class Socket;
-
-public:
- /** Connection pool class for internal use by the ISocketHandler.
- \ingroup internal */
-#ifdef ENABLE_POOL
- class PoolSocket : public Socket
- {
- public:
- PoolSocket(ISocketHandler& h,Socket *src) : Socket(h) {
- CopyConnection( src );
- SetIsClient();
- }
-
- void OnRead() {
- Handler().LogError(this, "OnRead", 0, "data on hibernating socket", LOG_LEVEL_FATAL);
- SetCloseAndDelete();
- }
- void OnOptions(int,int,int,SOCKET) {}
-
- };
-#endif
-
-public:
- virtual ~ISocketHandler() {}
-
- /** Get mutex reference for threadsafe operations. */
- virtual Mutex& GetMutex() const = 0;
-
- /** Register StdLog object for error callback.
- \param log Pointer to log class */
- virtual void RegStdLog(StdLog *log) = 0;
-
- /** Log error to log class for print out / storage. */
- virtual void LogError(Socket *p,const std::string& user_text,int err,const std::string& sys_err,loglevel_t t = LOG_LEVEL_WARNING) = 0;
-
- // -------------------------------------------------------------------------
- // Socket stuff
- // -------------------------------------------------------------------------
- /** Add socket instance to socket map. Removal is always automatic. */
- virtual void Add(Socket *) = 0;
-private:
- /** Remove socket from socket map, used by Socket class. */
- virtual void Remove(Socket *) = 0;
-public:
- /** Get status of read/write/exception file descriptor set for a socket. */
- virtual void Get(SOCKET s,bool& r,bool& w,bool& e) = 0;
- /** Set read/write/exception file descriptor sets (fd_set). */
- virtual void Set(SOCKET s,bool bRead,bool bWrite,bool bException = true) = 0;
-
- /** Wait for events, generate callbacks. */
- virtual int Select(long sec,long usec) = 0;
- /** This method will not return until an event has been detected. */
- virtual int Select() = 0;
- /** Wait for events, generate callbacks. */
- virtual int Select(struct timeval *tsel) = 0;
-
- /** Check that a socket really is handled by this socket handler. */
- virtual bool Valid(Socket *) = 0;
- /** Return number of sockets handled by this handler. */
- virtual size_t GetCount() = 0;
-
- /** Override and return false to deny all incoming connections.
- \param p ListenSocket class pointer (use GetPort to identify which one) */
- virtual bool OkToAccept(Socket *p) = 0;
-
- /** Called by Socket when a socket changes state. */
- virtual void AddList(SOCKET s,list_t which_one,bool add) = 0;
-
- // -------------------------------------------------------------------------
- // Connection pool
- // -------------------------------------------------------------------------
-#ifdef ENABLE_POOL
- /** Find available open connection (used by connection pool). */
- virtual ISocketHandler::PoolSocket *FindConnection(int type,const std::string& protocol,SocketAddress&) = 0;
- /** Enable connection pool (by default disabled). */
- virtual void EnablePool(bool = true) = 0;
- /** Check pool status.
- \return true if connection pool is enabled */
- virtual bool PoolEnabled() = 0;
-#endif // ENABLE_POOL
-
- // -------------------------------------------------------------------------
- // Socks4
- // -------------------------------------------------------------------------
-#ifdef ENABLE_SOCKS4
- /** Set socks4 server ip that all new tcp sockets should use. */
- virtual void SetSocks4Host(ipaddr_t) = 0;
- /** Set socks4 server hostname that all new tcp sockets should use. */
- virtual void SetSocks4Host(const std::string& ) = 0;
- /** Set socks4 server port number that all new tcp sockets should use. */
- virtual void SetSocks4Port(port_t) = 0;
- /** Set optional socks4 userid. */
- virtual void SetSocks4Userid(const std::string& ) = 0;
- /** If connection to socks4 server fails, immediately try direct connection to final host. */
- virtual void SetSocks4TryDirect(bool = true) = 0;
- /** Get socks4 server ip.
- \return socks4 server ip */
- virtual ipaddr_t GetSocks4Host() = 0;
- /** Get socks4 port number.
- \return socks4 port number */
- virtual port_t GetSocks4Port() = 0;
- /** Get socks4 userid (optional).
- \return socks4 userid */
- virtual const std::string& GetSocks4Userid() = 0;
- /** Check status of socks4 try direct flag.
- \return true if direct connection should be tried if connection to socks4 server fails */
- virtual bool Socks4TryDirect() = 0;
-#endif // ENABLE_SOCKS4
-
- // -------------------------------------------------------------------------
- // DNS resolve server
- // -------------------------------------------------------------------------
-#ifdef ENABLE_RESOLVER
- /** Enable asynchronous DNS.
- \param port Listen port of asynchronous dns server */
- virtual void EnableResolver(port_t = 16667) = 0;
- /** Check resolver status.
- \return true if resolver is enabled */
- virtual bool ResolverEnabled() = 0;
- /** Queue a dns request.
- \param host Hostname to be resolved
- \param port Port number will be echoed in Socket::OnResolved callback */
- virtual int Resolve(Socket *,const std::string& host,port_t port) = 0;
-#ifdef ENABLE_IPV6
- virtual int Resolve6(Socket *,const std::string& host,port_t port) = 0;
-#endif
- /** Do a reverse dns lookup. */
- virtual int Resolve(Socket *,ipaddr_t a) = 0;
-#ifdef ENABLE_IPV6
- virtual int Resolve(Socket *,in6_addr& a) = 0;
-#endif
- /** Get listen port of asynchronous dns server. */
- virtual port_t GetResolverPort() = 0;
- /** Resolver thread ready for queries. */
- virtual bool ResolverReady() = 0;
- /** Returns true if socket waiting for a resolve event. */
- virtual bool Resolving(Socket *) = 0;
-#endif // ENABLE_RESOLVER
-
-#ifdef ENABLE_TRIGGERS
- /** Fetch unique trigger id. */
- virtual int TriggerID(Socket *src) = 0;
- /** Subscribe socket to trigger id. */
- virtual bool Subscribe(int id, Socket *dst) = 0;
- /** Unsubscribe socket from trigger id. */
- virtual bool Unsubscribe(int id, Socket *dst) = 0;
- /** Execute OnTrigger for subscribed sockets.
- \param id Trigger ID
- \param data Data passed from source to destination
- \param erase Empty trigger id source and destination maps if 'true',
- Leave them in place if 'false' - if a trigger should be called many times */
- virtual void Trigger(int id, Socket::TriggerData& data, bool erase = true) = 0;
-#endif // ENABLE_TRIGGERS
-
-#ifdef ENABLE_DETACH
- /** Indicates that the handler runs under SocketThread. */
- virtual void SetSlave(bool x = true) = 0;
- /** Indicates that the handler runs under SocketThread. */
- virtual bool IsSlave() = 0;
-#endif // ENABLE_DETACH
-
-};
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // _SOCKETS_ISocketHandler_H
-
diff --git a/dep/include/sockets/Ipv4Address.h b/dep/include/sockets/Ipv4Address.h
deleted file mode 100644
index b58c2ce94..000000000
--- a/dep/include/sockets/Ipv4Address.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- ** \file Ipv4Address.h
- ** \date 2006-09-21
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2007 Anders Hedstrom
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_Ipv4Address_H
-#define _SOCKETS_Ipv4Address_H
-
-#include "sockets-config.h"
-#include "SocketAddress.h"
-
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-/* Ipv4 address implementation.
- \ingroup basic */
-class Ipv4Address : public SocketAddress
-{
-public:
- /** Create empty Ipv4 address structure.
- \param port Port number */
- Ipv4Address(port_t port = 0);
- /** Create Ipv4 address structure.
- \param a Socket address in network byte order (as returned by Utility::u2ip)
- \param port Port number in host byte order */
- Ipv4Address(ipaddr_t a,port_t port);
- /** Create Ipv4 address structure.
- \param a Socket address in network byte order
- \param port Port number in host byte order */
- Ipv4Address(struct in_addr& a,port_t port);
- /** Create Ipv4 address structure.
- \param host Hostname to be resolved
- \param port Port number in host byte order */
- Ipv4Address(const std::string& host,port_t port);
- Ipv4Address(struct sockaddr_in&);
- ~Ipv4Address();
-
- // SocketAddress implementation
-
- operator struct sockaddr *();
- operator socklen_t();
- bool operator==(SocketAddress&);
-
- void SetPort(port_t port);
- port_t GetPort();
-
- void SetAddress(struct sockaddr *sa);
- int GetFamily();
-
- bool IsValid();
- std::auto_ptr GetCopy();
-
- /** Convert address struct to text. */
- std::string Convert(bool include_port = false);
- std::string Reverse();
-
- /** Resolve hostname. */
-static bool Resolve(const std::string& hostname,struct in_addr& a);
- /** Reverse resolve (IP to hostname). */
-static bool Reverse(struct in_addr& a,std::string& name);
- /** Convert address struct to text. */
-static std::string Convert(struct in_addr& a);
-
-private:
- Ipv4Address(const Ipv4Address& ) {} // copy constructor
- Ipv4Address& operator=(const Ipv4Address& ) { return *this; } // assignment operator
- struct sockaddr_in m_addr;
- bool m_valid;
-};
-
-
-
-
-#ifdef SOCKETS_NAMESPACE
-} // namespace SOCKETS_NAMESPACE {
-#endif
-#endif // _SOCKETS_Ipv4Address_H
-
diff --git a/dep/include/sockets/Ipv6Address.h b/dep/include/sockets/Ipv6Address.h
deleted file mode 100644
index a07114179..000000000
--- a/dep/include/sockets/Ipv6Address.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- ** \file Ipv6Address.h
- ** \date 2006-09-21
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2007 Anders Hedstrom
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_Ipv6Address_H
-#define _SOCKETS_Ipv6Address_H
-#include "sockets-config.h"
-#ifdef ENABLE_IPV6
-
-#include "SocketAddress.h"
-#ifdef IPPROTO_IPV6
-#if defined( _WIN32) && !defined(__CYGWIN__)
-typedef unsigned __int32 uint32_t;
-#endif
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-/** Ipv6 address implementation.
- \ingroup basic */
-class Ipv6Address : public SocketAddress
-{
-public:
- /** Create empty Ipv6 address structure.
- \param port Port number */
- Ipv6Address(port_t port = 0);
- /** Create Ipv6 address structure.
- \param a Socket address in network byte order
- \param port Port number in host byte order */
- Ipv6Address(struct in6_addr& a,port_t port);
- /** Create Ipv6 address structure.
- \param host Hostname to be resolved
- \param port Port number in host byte order */
- Ipv6Address(const std::string& host,port_t port);
- Ipv6Address(struct sockaddr_in6&);
- ~Ipv6Address();
-
- // SocketAddress implementation
-
- operator struct sockaddr *();
- operator socklen_t();
- bool operator==(SocketAddress&);
-
- void SetPort(port_t port);
- port_t GetPort();
-
- void SetAddress(struct sockaddr *sa);
- int GetFamily();
-
- bool IsValid();
- std::auto_ptr GetCopy();
-
- /** Convert address struct to text. */
- std::string Convert(bool include_port = false);
- std::string Reverse();
-
- /** Resolve hostname. */
-static bool Resolve(const std::string& hostname,struct in6_addr& a);
- /** Reverse resolve (IP to hostname). */
-static bool Reverse(struct in6_addr& a,std::string& name);
- /** Convert address struct to text. */
-static std::string Convert(struct in6_addr& a,bool mixed = false);
-
- void SetFlowinfo(uint32_t);
- uint32_t GetFlowinfo();
-#ifndef _WIN32
- void SetScopeId(uint32_t);
- uint32_t GetScopeId();
-#endif
-
-private:
- Ipv6Address(const Ipv6Address& ) {} // copy constructor
- Ipv6Address& operator=(const Ipv6Address& ) { return *this; } // assignment operator
- struct sockaddr_in6 m_addr;
- bool m_valid;
-};
-
-
-
-
-#ifdef SOCKETS_NAMESPACE
-} // namespace SOCKETS_NAMESPACE {
-#endif
-#endif // IPPROTO_IPV6
-#endif // ENABLE_IPV6
-#endif // _SOCKETS_Ipv6Address_H
-
diff --git a/dep/include/sockets/ListenSocket.h b/dep/include/sockets/ListenSocket.h
deleted file mode 100644
index f4edc37d6..000000000
--- a/dep/include/sockets/ListenSocket.h
+++ /dev/null
@@ -1,420 +0,0 @@
-/** \file ListenSocket.h
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_ListenSocket_H
-#define _SOCKETS_ListenSocket_H
-#include "sockets-config.h"
-
-#ifdef _WIN32
-#include
-#else
-#include
-#endif
-
-#include "ISocketHandler.h"
-#include "Socket.h"
-#include "Utility.h"
-#include "SctpSocket.h"
-#include "Ipv4Address.h"
-#include "Ipv6Address.h"
-#ifdef ENABLE_EXCEPTIONS
-#include "Exception.h"
-#endif
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-/** Binds incoming port number to new Socket class X.
- \ingroup basic */
-template
-class ListenSocket : public Socket
-{
-public:
- /** Constructor.
- \param h ISocketHandler reference
- \param use_creator Optional use of creator (default true) */
- ListenSocket(ISocketHandler& h,bool use_creator = true) : Socket(h), m_depth(0), m_creator(NULL)
- ,m_bHasCreate(false)
- {
- if (use_creator)
- {
- m_creator = new X(h);
- Socket *tmp = m_creator -> Create();
- if (tmp && dynamic_cast(tmp))
- {
- m_bHasCreate = true;
- }
- if (tmp)
- {
- delete tmp;
- }
- }
- }
- ~ListenSocket() {
- if (m_creator)
- {
- delete m_creator;
- }
- }
-
- /** Close file descriptor. */
- int Close() {
- if (GetSocket() != INVALID_SOCKET)
- {
- closesocket(GetSocket());
- }
- return 0;
- }
-
- /** Bind and listen to any interface.
- \param port Port (0 is random)
- \param depth Listen queue depth */
- int Bind(port_t port,int depth = 20) {
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- Ipv6Address ad(port);
- return Bind(ad, depth);
- }
- else
-#endif
-#endif
- {
- Ipv4Address ad(port);
- return Bind(ad, depth);
- }
- }
-
- int Bind(SocketAddress& ad,int depth) {
-#ifdef USE_SCTP
- if (dynamic_cast(m_creator))
- {
- return Bind(ad, "sctp", depth);
- }
-#endif
- return Bind(ad, "tcp", depth);
- }
-
- /** Bind and listen to any interface, with optional protocol.
- \param port Port (0 is random)
- \param protocol Network protocol
- \param depth Listen queue depth */
- int Bind(port_t port,const std::string& protocol,int depth = 20) {
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- Ipv6Address ad(port);
- return Bind(ad, protocol, depth);
- }
- else
-#endif
-#endif
- {
- Ipv4Address ad(port);
- return Bind(ad, protocol, depth);
- }
- }
-
- /** Bind and listen to specific interface.
- \param intf Interface hostname
- \param port Port (0 is random)
- \param depth Listen queue depth */
- int Bind(const std::string& intf,port_t port,int depth = 20) {
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- Ipv6Address ad(intf, port);
- if (ad.IsValid())
- {
- return Bind(ad, depth);
- }
- Handler().LogError(this, "Bind", 0, "name resolution of interface name failed", LOG_LEVEL_FATAL);
- return -1;
- }
- else
-#endif
-#endif
- {
- Ipv4Address ad(intf, port);
- if (ad.IsValid())
- {
- return Bind(ad, depth);
- }
- Handler().LogError(this, "Bind", 0, "name resolution of interface name failed", LOG_LEVEL_FATAL);
- return -1;
- }
- }
-
- /** Bind and listen to specific interface.
- \param intf Interface hostname
- \param port Port (0 is random)
- \param protocol Network protocol
- \param depth Listen queue depth */
- int Bind(const std::string& intf,port_t port,const std::string& protocol,int depth = 20) {
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- Ipv6Address ad(intf, port);
- if (ad.IsValid())
- {
- return Bind(ad, protocol, depth);
- }
- Handler().LogError(this, "Bind", 0, "name resolution of interface name failed", LOG_LEVEL_FATAL);
- return -1;
- }
- else
-#endif
-#endif
- {
- Ipv4Address ad(intf, port);
- if (ad.IsValid())
- {
- return Bind(ad, protocol, depth);
- }
- Handler().LogError(this, "Bind", 0, "name resolution of interface name failed", LOG_LEVEL_FATAL);
- return -1;
- }
- }
-
- /** Bind and listen to ipv4 interface.
- \param a Ipv4 interface address
- \param port Port (0 is random)
- \param depth Listen queue depth */
- int Bind(ipaddr_t a,port_t port,int depth = 20) {
- Ipv4Address ad(a, port);
-#ifdef USE_SCTP
- if (dynamic_cast(m_creator))
- {
- return Bind(ad, "sctp", depth);
- }
-#endif
- return Bind(ad, "tcp", depth);
- }
- /** Bind and listen to ipv4 interface.
- \param a Ipv4 interface address
- \param port Port (0 is random)
- \param protocol Network protocol
- \param depth Listen queue depth */
- int Bind(ipaddr_t a,port_t port,const std::string& protocol,int depth) {
- Ipv4Address ad(a, port);
- return Bind(ad, protocol, depth);
- }
-
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- /** Bind and listen to ipv6 interface.
- \param a Ipv6 interface address
- \param port Port (0 is random)
- \param depth Listen queue depth */
- int Bind(in6_addr a,port_t port,int depth = 20) {
- Ipv6Address ad(a, port);
-#ifdef USE_SCTP
- if (dynamic_cast(m_creator))
- {
- return Bind(ad, "sctp", depth);
- }
-#endif
- return Bind(ad, "tcp", depth);
- }
- /** Bind and listen to ipv6 interface.
- \param a Ipv6 interface address
- \param port Port (0 is random)
- \param protocol Network protocol
- \param depth Listen queue depth */
- int Bind(in6_addr a,port_t port,const std::string& protocol,int depth) {
- Ipv6Address ad(a, port);
- return Bind(ad, protocol, depth);
- }
-#endif
-#endif
-
- /** Bind and listen to network interface.
- \param ad Interface address
- \param protocol Network protocol
- \param depth Listen queue depth */
- int Bind(SocketAddress& ad,const std::string& protocol,int depth) {
- SOCKET s;
- if ( (s = CreateSocket(ad.GetFamily(), SOCK_STREAM, protocol)) == INVALID_SOCKET)
- {
- return -1;
- }
- if (bind(s, ad, ad) == -1)
- {
- Handler().LogError(this, "bind", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- closesocket(s);
-#ifdef ENABLE_EXCEPTIONS
- throw Exception("bind() failed for port " + Utility::l2string(ad.GetPort()) + ": " + StrError(Errno));
-#endif
- return -1;
- }
- if (listen(s, depth) == -1)
- {
- Handler().LogError(this, "listen", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- closesocket(s);
-#ifdef ENABLE_EXCEPTIONS
- throw Exception("listen() failed for port " + Utility::l2string(ad.GetPort()) + ": " + StrError(Errno));
-#endif
- return -1;
- }
- m_depth = depth;
- Attach(s);
- return 0;
- }
-
- /** Return assigned port number. */
- port_t GetPort()
- {
- return GetSockPort();
- }
-
- /** Return listen queue depth. */
- int GetDepth()
- {
- return m_depth;
- }
-
- /** OnRead on a ListenSocket receives an incoming connection. */
- void OnRead()
- {
- struct sockaddr sa;
- socklen_t sa_len = sizeof(struct sockaddr);
- SOCKET a_s = accept(GetSocket(), &sa, &sa_len);
-
- if (a_s == INVALID_SOCKET)
- {
- Handler().LogError(this, "accept", Errno, StrError(Errno), LOG_LEVEL_ERROR);
- return;
- }
- if (!Handler().OkToAccept(this))
- {
- Handler().LogError(this, "accept", -1, "Not OK to accept", LOG_LEVEL_WARNING);
- closesocket(a_s);
- return;
- }
- if (Handler().GetCount() >= FD_SETSIZE)
- {
- Handler().LogError(this, "accept", (int)Handler().GetCount(), "ISocketHandler fd_set limit reached", LOG_LEVEL_FATAL);
- closesocket(a_s);
- return;
- }
- Socket *tmp = m_bHasCreate ? m_creator -> Create() : new X(Handler());
-#ifdef ENABLE_IPV6
- tmp -> SetIpv6( IsIpv6() );
-#endif
- tmp -> SetParent(this);
- tmp -> Attach(a_s);
- tmp -> SetNonblocking(true);
- {
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (sa_len == sizeof(struct sockaddr_in6))
- {
- struct sockaddr_in6 *p = (struct sockaddr_in6 *)&sa;
- if (p -> sin6_family == AF_INET6)
- {
- Ipv6Address ad(p -> sin6_addr,ntohs(p -> sin6_port));
- ad.SetFlowinfo(p -> sin6_flowinfo);
-#ifndef _WIN32
- ad.SetScopeId(p -> sin6_scope_id);
-#endif
- tmp -> SetRemoteAddress(ad);
- }
- }
-#endif
-#endif
- if (sa_len == sizeof(struct sockaddr_in))
- {
- struct sockaddr_in *p = (struct sockaddr_in *)&sa;
- if (p -> sin_family == AF_INET)
- {
- Ipv4Address ad(p -> sin_addr,ntohs(p -> sin_port));
- tmp -> SetRemoteAddress(ad);
- }
- }
- }
- tmp -> SetConnected(true);
- tmp -> Init();
- tmp -> SetDeleteByHandler(true);
- Handler().Add(tmp);
-#ifdef HAVE_OPENSSL
- if (tmp -> IsSSL()) // SSL Enabled socket
- {
- // %! OnSSLAccept calls SSLNegotiate that can finish in this one call.
- // %! If that happens and negotiation fails, the 'tmp' instance is
- // %! still added to the list of active sockets in the sockethandler.
- // %! See bugfix for this in SocketHandler::Select - don't Set rwx
- // %! flags if CloseAndDelete() flag is true.
- // %! An even better fugbix (see TcpSocket::OnSSLAccept) now avoids
- // %! the Add problem altogether, so ignore the above.
- // %! (OnSSLAccept does no longer call SSLNegotiate().)
- tmp -> OnSSLAccept();
- }
- else
-#endif
- {
- tmp -> OnAccept();
- }
- }
-
- /** Please don't use this method.
- "accept()" is handled automatically in the OnRead() method. */
- virtual SOCKET Accept(SOCKET socket, struct sockaddr *saptr, socklen_t *lenptr)
- {
- return accept(socket, saptr, lenptr);
- }
-
- bool HasCreator() { return m_bHasCreate; }
-
- void OnOptions(int,int,int,SOCKET) {
- SetSoReuseaddr(true);
- }
-
-protected:
- ListenSocket(const ListenSocket& s) : Socket(s) {}
-private:
- ListenSocket& operator=(const ListenSocket& ) { return *this; }
- int m_depth;
- X *m_creator;
- bool m_bHasCreate;
-};
-
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // _SOCKETS_ListenSocket_H
-
diff --git a/dep/include/sockets/Lock.h b/dep/include/sockets/Lock.h
deleted file mode 100644
index 71fdd5e73..000000000
--- a/dep/include/sockets/Lock.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/** \file Lock.h
- ** \date 2005-08-22
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2005,2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_Lock_H
-#define _SOCKETS_Lock_H
-
-#include "sockets-config.h"
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-class Mutex;
-
-/** Mutex encapsulation class.
- \ingroup threading */
-class Lock
-{
-public:
- Lock(Mutex&);
- ~Lock();
-
-private:
- Mutex& m_mutex;
-};
-
-
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-#endif // _SOCKETS_Lock_H
-
diff --git a/dep/include/sockets/Mutex.h b/dep/include/sockets/Mutex.h
deleted file mode 100644
index 1de27760a..000000000
--- a/dep/include/sockets/Mutex.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/** \file Mutex.h
- ** \date 2004-10-30
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_Mutex_H
-#define _SOCKETS_Mutex_H
-
-#include "sockets-config.h"
-#ifndef _WIN32
-#include
-#else
-#include
-#endif
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-/** Mutex container class, used by Lock.
- \ingroup threading */
-class Mutex
-{
- friend class Lock;
-public:
- Mutex();
- ~Mutex();
-
- void Lock();
- void Unlock();
-private:
-#ifdef _WIN32
- HANDLE m_mutex;
-#else
- pthread_mutex_t m_mutex;
-#endif
-};
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-#endif // _SOCKETS_Mutex_H
-
diff --git a/dep/include/sockets/Parse.h b/dep/include/sockets/Parse.h
deleted file mode 100644
index 6961f3b1b..000000000
--- a/dep/include/sockets/Parse.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/** \file Parse.h - parse a string
- **
- ** Written: 1999-Feb-10 grymse@alhem.net
- **/
-
-/*
-Copyright (C) 1999-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef _SOCKETS_Parse_H
-#define _SOCKETS_Parse_H
-
-#include "sockets-config.h"
-#ifdef _MSC_VER
-#pragma warning(disable:4514)
-#endif
-
-#include
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-/***************************************************/
-/* interface of class Parse */
-
-/** Splits a string whatever way you want.
- \ingroup util */
-class Parse
-{
-public:
- Parse();
- Parse(const std::string&);
- Parse(const std::string&,const std::string&);
- Parse(const std::string&,const std::string&,short);
- ~Parse();
- short issplit(const char);
- void getsplit();
- void getsplit(std::string&);
- std::string getword();
- void getword(std::string&);
- void getword(std::string&,std::string&,int);
- std::string getrest();
- void getrest(std::string&);
- long getvalue();
- void setbreak(const char);
- int getwordlen();
- int getrestlen();
- void enablebreak(const char c) {
- pa_enable = c;
- }
- void disablebreak(const char c) {
- pa_disable = c;
- }
- void getline();
- void getline(std::string&);
- size_t getptr() { return pa_the_ptr; }
- void EnableQuote(bool b) { pa_quote = b; }
-
-private:
- std::string pa_the_str;
- std::string pa_splits;
- std::string pa_ord;
- size_t pa_the_ptr;
- char pa_breakchar;
- char pa_enable;
- char pa_disable;
- short pa_nospace;
- bool pa_quote;
-};
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // _SOCKETS_Parse_H
-
diff --git a/dep/include/sockets/ResolvServer.h b/dep/include/sockets/ResolvServer.h
deleted file mode 100644
index f8f8f5aad..000000000
--- a/dep/include/sockets/ResolvServer.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/** \file ResolvServer.h
- ** \date 2005-03-24
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_ResolvServer_H
-#define _SOCKETS_ResolvServer_H
-#include "sockets-config.h"
-#ifdef ENABLE_RESOLVER
-#include "socket_include.h"
-#include "Thread.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-/** \defgroup async Asynchronous DNS */
-/** Async DNS resolver thread.
- \ingroup async */
-class ResolvServer : public Thread
-{
-public:
- ResolvServer(port_t);
- ~ResolvServer();
-
- void Run();
- void Quit();
-
- bool Ready();
-
-private:
- ResolvServer(const ResolvServer& ) {} // copy constructor
- ResolvServer& operator=(const ResolvServer& ) { return *this; } // assignment operator
-
- bool m_quit;
- port_t m_port;
- bool m_ready;
-};
-
-
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // ENABLE_RESOLVER
-#endif // _SOCKETS_ResolvServer_H
-
diff --git a/dep/include/sockets/ResolvSocket.h b/dep/include/sockets/ResolvSocket.h
deleted file mode 100644
index ff4b1a5a9..000000000
--- a/dep/include/sockets/ResolvSocket.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/** \file ResolvSocket.h
- ** \date 2005-03-24
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_ResolvSocket_H
-#define _SOCKETS_ResolvSocket_H
-#include "sockets-config.h"
-#ifdef ENABLE_RESOLVER
-#include "TcpSocket.h"
-#include
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-class Mutex;
-
-/** Async DNS resolver socket.
- \ingroup async */
-class ResolvSocket : public TcpSocket
-{
- typedef std::map > cache_t; /* host, result */
- typedef std::map > timeout_t; /* host, time */
-
-public:
- ResolvSocket(ISocketHandler&);
- ResolvSocket(ISocketHandler&, Socket *parent, const std::string& host, port_t port, bool ipv6 = false);
- ResolvSocket(ISocketHandler&, Socket *parent, ipaddr_t);
-#ifdef ENABLE_IPV6
- ResolvSocket(ISocketHandler&, Socket *parent, in6_addr&);
-#endif
- ~ResolvSocket();
-
- void OnAccept() { m_bServer = true; }
- void OnLine(const std::string& line);
- void OnDetached();
- void OnDelete();
-
- void SetId(int x) { m_resolv_id = x; }
- int GetId() { return m_resolv_id; }
-
- void OnConnect();
-
-#ifdef ENABLE_IPV6
- void SetResolveIpv6(bool x = true) { m_resolve_ipv6 = x; }
-#endif
-
-private:
- ResolvSocket(const ResolvSocket& s) : TcpSocket(s) {} // copy constructor
- ResolvSocket& operator=(const ResolvSocket& ) { return *this; } // assignment operator
-
- std::string m_query;
- std::string m_data;
- bool m_bServer;
- Socket *m_parent;
- int m_resolv_id;
- std::string m_resolv_host;
- port_t m_resolv_port;
- ipaddr_t m_resolv_address;
-#ifdef ENABLE_IPV6
- bool m_resolve_ipv6;
- in6_addr m_resolv_address6;
-#endif
- static cache_t m_cache;
- static timeout_t m_cache_to;
- static Mutex m_cache_mutex;
- bool m_cached;
-};
-
-
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // ENABLE_RESOLVER
-#endif // _SOCKETS_ResolvSocket_H
-
diff --git a/dep/include/sockets/SctpSocket.h b/dep/include/sockets/SctpSocket.h
deleted file mode 100644
index d6d55f6be..000000000
--- a/dep/include/sockets/SctpSocket.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- ** \file SctpSocket.h
- ** \date 2006-09-04
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2007 Anders Hedstrom
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_SctpSocket_H
-#define _SOCKETS_SctpSocket_H
-#include "sockets-config.h"
-
-#include "StreamSocket.h"
-#ifdef USE_SCTP
-#include
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-#define SCTP_BUFSIZE_READ 16400
-
-class SocketAddress;
-
-
-class SctpSocket : public StreamSocket
-{
-public:
- /** SctpSocket constructor.
- \param h Owner
- \param type SCTP_STREAM or SCTP_SEQPACKET */
- SctpSocket(ISocketHandler& h,int type);
- ~SctpSocket();
-
- /** bind() */
- int Bind(const std::string&,port_t);
- int Bind(SocketAddress&);
- /** sctp_bindx() */
- int AddAddress(const std::string&,port_t);
- int AddAddress(SocketAddress&);
- /** sctp_bindx() */
- int RemoveAddress(const std::string&,port_t);
- int RemoveAddress(SocketAddress&);
-
- /** connect() */
- int Open(const std::string&,port_t);
- int Open(SocketAddress&);
-
- /** Connect timeout callback. */
- void OnConnectTimeout();
-#ifdef _WIN32
- /** Connection failed reported as exception on win32 */
- void OnException();
-#endif
-
-#ifndef SOLARIS
- /** sctp_connectx() */
- int AddConnection(const std::string&,port_t);
- int AddConnection(SocketAddress&);
-#endif
-
- /** Get peer addresses of an association. */
- int getpaddrs(sctp_assoc_t id,std::list&);
- /** Get all bound addresses of an association. */
- int getladdrs(sctp_assoc_t id,std::list&);
-
- /** sctp_peeloff */
- int PeelOff(sctp_assoc_t id);
-
- /** recvmsg callback */
- virtual void OnReceiveMessage(const char *buf,size_t sz,struct sockaddr *sa,socklen_t sa_len,struct sctp_sndrcvinfo *sinfo,int msg_flags) = 0;
-
- void OnOptions(int,int,int,SOCKET) {}
-
- virtual int Protocol();
-
-protected:
- SctpSocket(const SctpSocket& s) : StreamSocket(s) {}
- void OnRead();
- void OnWrite();
-
-private:
- SctpSocket& operator=(const SctpSocket& s) { return *this; }
- int m_type; ///< SCTP_STREAM or SCTP_SEQPACKET
- char *m_buf; ///< Temporary receive buffer
-};
-
-
-#ifdef SOCKETS_NAMESPACE
-} // namespace SOCKETS_NAMESPACE
-#endif
-
-#endif // USE_SCTP
-#endif // _SOCKETS_SctpSocket_H
-
diff --git a/dep/include/sockets/Socket.h b/dep/include/sockets/Socket.h
deleted file mode 100644
index bdb5fc603..000000000
--- a/dep/include/sockets/Socket.h
+++ /dev/null
@@ -1,739 +0,0 @@
-/** \file Socket.h
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This software is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_Socket_H
-#define _SOCKETS_Socket_H
-#include "sockets-config.h"
-
-#include
-#include
-#include
-#ifdef HAVE_OPENSSL
-#include
-#endif
-
-#include "socket_include.h"
-#include
-#include "SocketAddress.h"
-#include "Thread.h"
-
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-class ISocketHandler;
-class SocketAddress;
-class IFile;
-
-
-/** \defgroup basic Basic sockets */
-/** Socket base class.
- \ingroup basic */
-class Socket
-{
- friend class ISocketHandler;
-#ifdef ENABLE_DETACH
- /** Detached socket run thread.
- \ingroup internal */
- class SocketThread : public Thread
- {
- public:
- SocketThread(Socket *p);
- ~SocketThread();
-
- void Run();
-
- private:
- Socket *GetSocket() const { return m_socket; }
- SocketThread(const SocketThread& s) : m_socket(s.GetSocket()) {}
- SocketThread& operator=(const SocketThread& ) { return *this; }
- Socket *m_socket;
- };
-#endif // ENABLE_DETACH
-
-#ifdef ENABLE_TRIGGERS
-public:
- /** Data pass class from source to destination. */
- class TriggerData
- {
- public:
- TriggerData() : m_src(NULL) {}
- virtual ~TriggerData() {}
-
- Socket *GetSource() const { return m_src; }
- void SetSource(Socket *x) { m_src = x; }
-
- private:
- Socket *m_src;
- };
-#endif // ENABLE_TRIGGERS
-
- /** Socket mode flags. */
-/*
- enum {
- // Socket
- SOCK_DEL = 0x01, ///< Delete by handler flag
- SOCK_CLOSE = 0x02, ///< Close and delete flag
- SOCK_DISABLE_READ = 0x04, ///< Disable checking for read events
- SOCK_CONNECTED = 0x08, ///< Socket is connected (tcp/udp)
-
- SOCK_ERASED_BY_HANDLER = 0x10, ///< Set by handler before delete
- // HAVE_OPENSSL
- SOCK_ENABLE_SSL = 0x20, ///< Enable SSL for this TcpSocket
- SOCK_SSL = 0x40, ///< ssl negotiation mode (TcpSocket)
- SOCK_SSL_SERVER = 0x80, ///< True if this is an incoming ssl TcpSocket connection
-
- // ENABLE_IPV6
- SOCK_IPV6 = 0x0100, ///< This is an ipv6 socket if this one is true
- // ENABLE_POOL
- SOCK_CLIENT = 0x0200, ///< only client connections are pooled
- SOCK_RETAIN = 0x0400, ///< keep connection on close
- SOCK_LOST = 0x0800, ///< connection lost
-
- // ENABLE_SOCKS4
- SOCK_SOCKS4 = 0x1000, ///< socks4 negotiation mode (TcpSocket)
- // ENABLE_DETACH
- SOCK_DETACH = 0x2000, ///< Socket ordered to detach flag
- SOCK_DETACHED = 0x4000, ///< Socket has been detached
- // StreamSocket
- STREAMSOCK_CONNECTING = 0x8000, ///< Flag indicating connection in progress
-
- STREAMSOCK_FLUSH_BEFORE_CLOSE = 0x010000L, ///< Send all data before closing (default true)
- STREAMSOCK_CALL_ON_CONNECT = 0x020000L, ///< OnConnect will be called next ISocketHandler cycle if true
- STREAMSOCK_RETRY_CONNECT = 0x040000L, ///< Try another connection attempt next ISocketHandler cycle
- STREAMSOCK_LINE_PROTOCOL = 0x080000L, ///< Line protocol mode flag
-
- };
-*/
-
-public:
- /** "Default" constructor */
- Socket(ISocketHandler&);
-
- virtual ~Socket();
-
- /** Socket class instantiation method. Used when a "non-standard" constructor
- * needs to be used for the socket class. Note: the socket class still needs
- * the "default" constructor with one ISocketHandler& as input parameter.
- */
- virtual Socket *Create() { return NULL; }
-
- /** Returns reference to sockethandler that owns the socket.
- If the socket is detached, this is a reference to the slave sockethandler.
- */
- ISocketHandler& Handler() const;
-
- /** Returns reference to sockethandler that owns the socket.
- This one always returns the reference to the original sockethandler,
- even if the socket is detached.
- */
- ISocketHandler& MasterHandler() const;
-
- /** Called by ListenSocket after accept but before socket is added to handler.
- * CTcpSocket uses this to create its ICrypt member variable.
- * The ICrypt member variable is created by a virtual method, therefore
- * it can't be called directly from the CTcpSocket constructor.
- * Also used to determine if incoming HTTP connection is normal (port 80)
- * or ssl (port 443).
- */
- virtual void Init();
-
- /** Create a socket file descriptor.
- \param af Address family AF_INET / AF_INET6 / ...
- \param type SOCK_STREAM / SOCK_DGRAM / ...
- \param protocol "tcp" / "udp" / ... */
- SOCKET CreateSocket(int af,int type,const std::string& protocol = "");
-
- /** Assign this socket a file descriptor created
- by a call to socket() or otherwise. */
- void Attach(SOCKET s);
-
- /** Return file descriptor assigned to this socket. */
- SOCKET GetSocket();
-
- /** Close connection immediately - internal use.
- \sa SetCloseAndDelete */
- virtual int Close();
-
- /** Add file descriptor to sockethandler fd_set's. */
- void Set(bool bRead,bool bWrite,bool bException = true);
-
- /** Returns true when socket file descriptor is valid
- and socket is not about to be closed. */
- virtual bool Ready();
-
- /** Returns pointer to ListenSocket that created this instance
- * on an incoming connection. */
- Socket *GetParent();
-
- /** Used by ListenSocket to set parent pointer of newly created
- * socket instance. */
- void SetParent(Socket *);
-
- /** Get listening port from ListenSocket<>. */
- virtual port_t GetPort();
-
- /** Set socket non-block operation. */
- bool SetNonblocking(bool);
-
- /** Set socket non-block operation. */
- bool SetNonblocking(bool, SOCKET);
-
- /** Total lifetime of instance. */
- time_t Uptime();
-
- /** Set address/port of last connect() call. */
- void SetClientRemoteAddress(SocketAddress&);
-
- /** Get address/port of last connect() call. */
- std::auto_ptr GetClientRemoteAddress();
-
- /** Common interface for SendBuf used by Tcp and Udp sockets. */
- virtual void SendBuf(const char *,size_t,int = 0);
-
- /** Common interface for Send used by Tcp and Udp sockets. */
- virtual void Send(const std::string&,int = 0);
-
- /** Outgoing traffic counter. */
- virtual uint64_t GetBytesSent(bool clear = false);
-
- /** Incoming traffic counter. */
- virtual uint64_t GetBytesReceived(bool clear = false);
-
- // LIST_TIMEOUT
-
- /** Enable timeout control. 0=disable timeout check. */
- void SetTimeout(time_t secs);
-
- /** Check timeout. \return true if time limit reached */
- bool Timeout(time_t tnow);
-
- /** Used by ListenSocket. ipv4 and ipv6 */
- void SetRemoteAddress(SocketAddress&);
-
- /** \name Event callbacks */
- //@{
-
- /** Called when there is something to be read from the file descriptor. */
- virtual void OnRead();
- /** Called when there is room for another write on the file descriptor. */
- virtual void OnWrite();
- /** Called on socket exception. */
- virtual void OnException();
- /** Called before a socket class is deleted by the ISocketHandler. */
- virtual void OnDelete();
- /** Called when a connection has completed. */
- virtual void OnConnect();
- /** Called when an incoming connection has been completed. */
- virtual void OnAccept();
- /** Called when a complete line has been read and the socket is in
- * line protocol mode. */
- virtual void OnLine(const std::string& );
- /** Called on connect timeout (5s). */
- virtual void OnConnectFailed();
- /** Called when a client socket is created, to set socket options.
- \param family AF_INET, AF_INET6, etc
- \param type SOCK_STREAM, SOCK_DGRAM, etc
- \param protocol Protocol number (tcp, udp, sctp, etc)
- \param s Socket file descriptor
- */
- virtual void OnOptions(int family,int type,int protocol,SOCKET s) = 0;
- /** Connection retry callback - return false to abort connection attempts */
- virtual bool OnConnectRetry();
-#ifdef ENABLE_RECONNECT
- /** a reconnect has been made */
- virtual void OnReconnect();
-#endif
- /** TcpSocket: When a disconnect has been detected (recv/SSL_read returns 0 bytes). */
- virtual void OnDisconnect();
- /** Timeout callback. */
- virtual void OnTimeout();
- /** Connection timeout. */
- virtual void OnConnectTimeout();
- //@}
-
- /** \name Socket mode flags, set/reset */
- //@{
- /** Set delete by handler true when you want the sockethandler to
- delete the socket instance after use. */
- void SetDeleteByHandler(bool = true);
- /** Check delete by handler flag.
- \return true if this instance should be deleted by the sockethandler */
- bool DeleteByHandler();
-
- // LIST_CLOSE - conditional event queue
-
- /** Set close and delete to terminate the connection. */
- void SetCloseAndDelete(bool = true);
- /** Check close and delete flag.
- \return true if this socket should be closed and the instance removed */
- bool CloseAndDelete();
-
- /** Return number of seconds since socket was ordered to close. \sa SetCloseAndDelete */
- time_t TimeSinceClose();
-
- /** Ignore read events for an output only socket. */
- void DisableRead(bool x = true);
- /** Check ignore read events flag.
- \return true if read events should be ignored */
- bool IsDisableRead();
-
- /** Set connected status. */
- void SetConnected(bool = true);
- /** Check connected status.
- \return true if connected */
- bool IsConnected();
-
- /** Connection lost - error while reading/writing from a socket - TcpSocket only. */
- void SetLost();
- /** Check connection lost status flag, used by TcpSocket only.
- \return true if there was an error while r/w causing the socket to close */
- bool Lost();
-
- /** Set flag indicating the socket is being actively deleted by the sockethandler. */
- void SetErasedByHandler(bool x = true);
- /** Get value of flag indicating socket is deleted by sockethandler. */
- bool ErasedByHandler();
-
- //@}
-
- /** \name Information about remote connection */
- //@{
- /** Returns address of remote end. */
- std::auto_ptr GetRemoteSocketAddress();
- /** Returns address of remote end: ipv4. */
- ipaddr_t GetRemoteIP4();
-#ifdef ENABLE_IPV6
- /** Returns address of remote end: ipv6. */
-#ifdef IPPROTO_IPV6
- struct in6_addr GetRemoteIP6();
-#endif
-#endif
- /** Returns remote port number: ipv4 and ipv6. */
- port_t GetRemotePort();
- /** Returns remote ip as string? ipv4 and ipv6. */
- std::string GetRemoteAddress();
- /** ipv4 and ipv6(not implemented) */
- std::string GetRemoteHostname();
- //@}
-
- /** Returns local port number for bound socket file descriptor. */
- port_t GetSockPort();
- /** Returns local ipv4 address for bound socket file descriptor. */
- ipaddr_t GetSockIP4();
- /** Returns local ipv4 address as text for bound socket file descriptor. */
- std::string GetSockAddress();
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- /** Returns local ipv6 address for bound socket file descriptor. */
- struct in6_addr GetSockIP6();
- /** Returns local ipv6 address as text for bound socket file descriptor. */
- std::string GetSockAddress6();
-#endif
-#endif
- // --------------------------------------------------------------------------
- /** @name IP options
- When an ip or socket option is available on all of the operating systems
- I'm testing on (linux 2.4.x, _win32, macosx, solaris9 intel) they are not
- checked with an #ifdef below.
- This might cause a compile error on other operating systems. */
- // --------------------------------------------------------------------------
-
- // IP options
- //@{
-
- bool SetIpOptions(const void *p, socklen_t len);
- bool SetIpTOS(unsigned char tos);
- unsigned char IpTOS();
- bool SetIpTTL(int ttl);
- int IpTTL();
- bool SetIpHdrincl(bool x = true);
- bool SetIpMulticastTTL(int);
- int IpMulticastTTL();
- bool SetMulticastLoop(bool x = true);
- bool IpAddMembership(struct ip_mreq&);
- bool IpDropMembership(struct ip_mreq&);
-
-#ifdef IP_PKTINFO
- bool SetIpPktinfo(bool x = true);
-#endif
-#ifdef IP_RECVTOS
- bool SetIpRecvTOS(bool x = true);
-#endif
-#ifdef IP_RECVTTL
- bool SetIpRecvTTL(bool x = true);
-#endif
-#ifdef IP_RECVOPTS
- bool SetIpRecvopts(bool x = true);
-#endif
-#ifdef IP_RETOPTS
- bool SetIpRetopts(bool x = true);
-#endif
-#ifdef IP_RECVERR
- bool SetIpRecverr(bool x = true);
-#endif
-#ifdef IP_MTU_DISCOVER
- bool SetIpMtudiscover(bool x = true);
-#endif
-#ifdef IP_MTU
- int IpMtu();
-#endif
-#ifdef IP_ROUTER_ALERT
- bool SetIpRouterAlert(bool x = true);
-#endif
-#ifdef LINUX
- bool IpAddMembership(struct ip_mreqn&);
-#endif
-#ifdef LINUX
- bool IpDropMembership(struct ip_mreqn&);
-#endif
- //@}
-
- // SOCKET options
- /** @name Socket Options */
- //@{
-
- bool SoAcceptconn();
- bool SetSoBroadcast(bool x = true);
- bool SetSoDebug(bool x = true);
- int SoError();
- bool SetSoDontroute(bool x = true);
- bool SetSoLinger(int onoff, int linger);
- bool SetSoOobinline(bool x = true);
- bool SetSoRcvlowat(int);
- bool SetSoSndlowat(int);
- bool SetSoRcvtimeo(struct timeval&);
- bool SetSoSndtimeo(struct timeval&);
- bool SetSoRcvbuf(int);
- int SoRcvbuf();
- bool SetSoSndbuf(int);
- int SoSndbuf();
- int SoType();
- bool SetSoReuseaddr(bool x = true);
- bool SetSoKeepalive(bool x = true);
-
-#ifdef SO_BSDCOMPAT
- bool SetSoBsdcompat(bool x = true);
-#endif
-#ifdef SO_BINDTODEVICE
- bool SetSoBindtodevice(const std::string& intf);
-#endif
-#ifdef SO_PASSCRED
- bool SetSoPasscred(bool x = true);
-#endif
-#ifdef SO_PEERCRED
- bool SoPeercred(struct ucred& );
-#endif
-#ifdef SO_PRIORITY
- bool SetSoPriority(int);
-#endif
-#ifdef SO_RCVBUFFORCE
- bool SetSoRcvbufforce(int);
-#endif
-#ifdef SO_SNDBUFFORCE
- bool SetSoSndbufforce(int);
-#endif
-#ifdef SO_TIMESTAMP
- bool SetSoTimestamp(bool x = true);
-#endif
-#ifdef SO_NOSIGPIPE
- bool SetSoNosigpipe(bool x = true);
-#endif
- //@}
-
- // TCP options in TcpSocket.h/TcpSocket.cpp
-
-
-#ifdef HAVE_OPENSSL
- /** @name SSL Support */
- //@{
- /** SSL client/server support - internal use. \sa TcpSocket */
- virtual void OnSSLConnect();
- /** SSL client/server support - internal use. \sa TcpSocket */
- virtual void OnSSLAccept();
- /** SSL negotiation failed for client connect. */
- virtual void OnSSLConnectFailed();
- /** SSL negotiation failed for server accept. */
- virtual void OnSSLAcceptFailed();
- /** new SSL support */
- virtual bool SSLNegotiate();
- /** Check if SSL is Enabled for this TcpSocket.
- \return true if this is a TcpSocket with SSL enabled */
- bool IsSSL();
- /** Enable SSL operation for a TcpSocket. */
- void EnableSSL(bool x = true);
- /** Still negotiating ssl connection.
- \return true if ssl negotiating is still in progress */
- bool IsSSLNegotiate();
- /** Set flag indicating ssl handshaking still in progress. */
- void SetSSLNegotiate(bool x = true);
- /** OnAccept called with SSL Enabled.
- \return true if this is a TcpSocket with an incoming SSL connection */
- bool IsSSLServer();
- /** Set flag indicating that this is a TcpSocket with incoming SSL connection. */
- void SetSSLServer(bool x = true);
- /** SSL; Get pointer to ssl context structure. */
- virtual SSL_CTX *GetSslContext() { return NULL; }
- /** SSL; Get pointer to ssl structure. */
- virtual SSL *GetSsl() { return NULL; }
- //@}
-#endif // HAVE_OPENSSL
-
-#ifdef ENABLE_IPV6
- /** Enable ipv6 for this socket. */
- void SetIpv6(bool x = true);
- /** Check ipv6 socket.
- \return true if this is an ipv6 socket */
- bool IsIpv6();
-#endif
-
-#ifdef ENABLE_POOL
- /** @name Connection Pool */
- //@{
- /** Client = connecting TcpSocket. */
- void SetIsClient();
- /** Socket type from socket() call. */
- void SetSocketType(int x);
- /** Socket type from socket() call. */
- int GetSocketType();
- /** Protocol type from socket() call. */
- void SetSocketProtocol(const std::string& x);
- /** Protocol type from socket() call. */
- const std::string& GetSocketProtocol();
- /** Instruct a client socket to stay open in the connection pool after use.
- If you have connected to a server using tcp, you can call SetRetain
- to leave the connection open after your socket instance has been deleted.
- The next connection you make to the same server will reuse the already
- opened connection, if it is still available.
- */
- void SetRetain();
- /** Check retain flag.
- \return true if the socket should be moved to connection pool after use */
- bool Retain();
- /** Copy connection parameters from sock. */
- void CopyConnection(Socket *sock);
- //@}
-#endif // ENABLE_POOL
-
-#ifdef ENABLE_SOCKS4
- /** \name Socks4 support */
- //@{
- /** Socks4 client support internal use. \sa TcpSocket */
- virtual void OnSocks4Connect();
- /** Socks4 client support internal use. \sa TcpSocket */
- virtual void OnSocks4ConnectFailed();
- /** Socks4 client support internal use. \sa TcpSocket */
- virtual bool OnSocks4Read();
- /** Called when the last write caused the tcp output buffer to
- * become empty. */
- /** socket still in socks4 negotiation mode */
- bool Socks4();
- /** Set flag indicating Socks4 handshaking in progress */
- void SetSocks4(bool x = true);
-
- /** Set socks4 server host address to use */
- void SetSocks4Host(ipaddr_t a);
- /** Set socks4 server hostname to use. */
- void SetSocks4Host(const std::string& );
- /** Socks4 server port to use. */
- void SetSocks4Port(port_t p);
- /** Provide a socks4 userid if required by the socks4 server. */
- void SetSocks4Userid(const std::string& x);
- /** Get the ip address of socks4 server to use.
- \return socks4 server host address */
- ipaddr_t GetSocks4Host();
- /** Get the socks4 server port to use.
- \return socks4 server port */
- port_t GetSocks4Port();
- /** Get socks4 userid.
- \return Socks4 userid */
- const std::string& GetSocks4Userid();
- //@}
-#endif // ENABLE_SOCKS4
-
-#ifdef ENABLE_RESOLVER
- /** \name Asynchronous Resolver */
- //@{
- /** Request an asynchronous dns resolution.
- \param host hostname to be resolved
- \param port port number passed along for the ride
- \return Resolve ID */
- int Resolve(const std::string& host,port_t port = 0);
-#ifdef ENABLE_IPV6
- int Resolve6(const std::string& host, port_t port = 0);
-#endif
- /** Callback returning a resolved address.
- \param id Resolve ID from Resolve call
- \param a resolved ip address
- \param port port number passed to Resolve */
- virtual void OnResolved(int id,ipaddr_t a,port_t port);
-#ifdef ENABLE_IPV6
- virtual void OnResolved(int id,in6_addr& a,port_t port);
-#endif
- /** Request asynchronous reverse dns lookup.
- \param a in_addr to be translated */
- int Resolve(ipaddr_t a);
-#ifdef ENABLE_IPV6
- int Resolve(in6_addr& a);
-#endif
- /** Callback returning reverse resolve results.
- \param id Resolve ID
- \param name Resolved hostname */
- virtual void OnReverseResolved(int id,const std::string& name);
- /** Callback indicating failed dns lookup.
- \param id Resolve ID */
- virtual void OnResolveFailed(int id);
- //@}
-#endif // ENABLE_RESOLVER
-
-#ifdef ENABLE_DETACH
- /** \name Thread Support */
- //@{
- /** Callback fires when a new socket thread has started and this
- socket is ready for operation again.
- \sa ResolvSocket */
- virtual void OnDetached();
-
- // LIST_DETACH
-
- /** Internal use. */
- void SetDetach(bool x = true);
- /** Check detach flag.
- \return true if the socket should detach to its own thread */
- bool IsDetach();
-
- /** Internal use. */
- void SetDetached(bool x = true);
- /** Check detached flag.
- \return true if the socket runs in its own thread. */
- const bool IsDetached() const;
- /** Order this socket to start its own thread and call OnDetached
- when ready for operation. */
- bool Detach();
- /** Store the slave sockethandler pointer. */
- void SetSlaveHandler(ISocketHandler *);
- /** Create new thread for this socket to run detached in. */
- void DetachSocket();
- //@}
-#endif // ENABLE_DETACH
-
- /** Write traffic to an IFile. Socket will not delete this object. */
- void SetTrafficMonitor(IFile *p) { m_traffic_monitor = p; }
-
-#ifdef ENABLE_TRIGGERS
- /** \name Triggers */
- //@{
- /** Subscribe to trigger id. */
- void Subscribe(int id);
- /** Unsubscribe from trigger id. */
- void Unsubscribe(int id);
- /** Trigger callback, with data passed from source to destination. */
- virtual void OnTrigger(int id, const TriggerData& data);
- /** Trigger cancelled because source has been deleted (as in delete). */
- virtual void OnCancelled(int id);
- //@}
-#endif
-
-protected:
- /** default constructor not available */
- Socket() : m_handler(m_handler) {}
- /** copy constructor not available */
- Socket(const Socket& s) : m_handler(s.m_handler) {}
-
- /** assignment operator not available. */
- Socket& operator=(const Socket& ) { return *this; }
-
- /** All traffic will be written to this IFile, if set. */
- IFile *GetTrafficMonitor() { return m_traffic_monitor; }
-
-// unsigned long m_flags; ///< boolean flags, replacing old 'bool' members
-
-private:
- ISocketHandler& m_handler; ///< Reference of ISocketHandler in control of this socket
- SOCKET m_socket; ///< File descriptor
- bool m_bDel; ///< Delete by handler flag
- bool m_bClose; ///< Close and delete flag
- time_t m_tCreate; ///< Time in seconds when this socket was created
- Socket *m_parent; ///< Pointer to ListenSocket class, valid for incoming sockets
- bool m_b_disable_read; ///< Disable checking for read events
- bool m_connected; ///< Socket is connected (tcp/udp)
- bool m_b_erased_by_handler; ///< Set by handler before delete
- time_t m_tClose; ///< Time in seconds when ordered to close
- std::auto_ptr m_client_remote_address; ///< Address of last connect()
- std::auto_ptr m_remote_address; ///< Remote end address
- IFile *m_traffic_monitor;
- time_t m_timeout_start; ///< Set by SetTimeout
- time_t m_timeout_limit; ///< Defined by SetTimeout
- bool m_bLost; ///< connection lost
-
-#ifdef _WIN32
-static WSAInitializer m_winsock_init; ///< Winsock initialization singleton class
-#endif
-
-#ifdef HAVE_OPENSSL
- bool m_b_enable_ssl; ///< Enable SSL for this TcpSocket
- bool m_b_ssl; ///< ssl negotiation mode (TcpSocket)
- bool m_b_ssl_server; ///< True if this is an incoming ssl TcpSocket connection
-#endif
-
-#ifdef ENABLE_IPV6
- bool m_ipv6; ///< This is an ipv6 socket if this one is true
-#endif
-
-#ifdef ENABLE_POOL
- int m_socket_type; ///< Type of socket, from socket() call
- std::string m_socket_protocol; ///< Protocol, from socket() call
- bool m_bClient; ///< only client connections are pooled
- bool m_bRetain; ///< keep connection on close
-#endif
-
-#ifdef ENABLE_SOCKS4
- bool m_bSocks4; ///< socks4 negotiation mode (TcpSocket)
- ipaddr_t m_socks4_host; ///< socks4 server address
- port_t m_socks4_port; ///< socks4 server port number
- std::string m_socks4_userid; ///< socks4 server usedid
-#endif
-
-#ifdef ENABLE_DETACH
- bool m_detach; ///< Socket ordered to detach flag
- bool m_detached; ///< Socket has been detached
- SocketThread *m_pThread; ///< Detach socket thread class pointer
- ISocketHandler *m_slave_handler; ///< Actual sockethandler while detached
-#endif
-};
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-
-#endif // _SOCKETS_Socket_H
-
diff --git a/dep/include/sockets/SocketAddress.h b/dep/include/sockets/SocketAddress.h
deleted file mode 100644
index d5a56433b..000000000
--- a/dep/include/sockets/SocketAddress.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- ** \file SocketAddress.h
- ** \date 2006-09-21
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2007 Anders Hedstrom
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_SocketAddress_H
-#define _SOCKETS_SocketAddress_H
-
-#include "sockets-config.h"
-#include
-#include
-#include "socket_include.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-/**
- This class and its subclasses is intended to be used as replacement
- for the internal data type 'ipaddr_t' and various implementations of
- IPv6 addressing found throughout the library.
- 'ipaddr_t' is an IPv4 address in network byte order.
- 'port_t' is the portnumber in host byte order.
- 'struct in6_addr' is an IPv6 address.
- 'struct in_addr' is an IPv4 address.
- \ingroup basic
-*/
-class SocketAddress
-{
-public:
- virtual ~SocketAddress() {}
-
- /** Get a pointer to the address struct. */
- virtual operator struct sockaddr *() = 0;
-
- /** Get length of address struct. */
- virtual operator socklen_t() = 0;
-
- /** Compare two addresses. */
- virtual bool operator==(SocketAddress&) = 0;
-
- /** Set port number.
- \param port Port number in host byte order */
- virtual void SetPort(port_t port) = 0;
-
- /** Get port number.
- \return Port number in host byte order. */
- virtual port_t GetPort() = 0;
-
- /** Set socket address.
- \param sa Pointer to either 'struct sockaddr_in' or 'struct sockaddr_in6'. */
- virtual void SetAddress(struct sockaddr *sa) = 0;
-
- /** Convert address to text. */
- virtual std::string Convert(bool include_port) = 0;
-
- /** Reverse lookup of address. */
- virtual std::string Reverse() = 0;
-
- /** Get address family. */
- virtual int GetFamily() = 0;
-
- /** Address structure is valid. */
- virtual bool IsValid() = 0;
-
- /** Get a copy of this SocketAddress object. */
- virtual std::auto_ptr GetCopy() = 0;
-};
-
-
-
-
-#ifdef SOCKETS_NAMESPACE
-} // namespace SOCKETS_NAMESPACE {
-#endif
-#endif // _SOCKETS_SocketAddress_H
-
diff --git a/dep/include/sockets/SocketHandler.h b/dep/include/sockets/SocketHandler.h
deleted file mode 100644
index c7e20dfde..000000000
--- a/dep/include/sockets/SocketHandler.h
+++ /dev/null
@@ -1,266 +0,0 @@
-/** \file SocketHandler.h
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_SocketHandler_H
-#define _SOCKETS_SocketHandler_H
-
-#include "sockets-config.h"
-#include
-#include
-
-#include "socket_include.h"
-#include "ISocketHandler.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-class Socket;
-#ifdef ENABLE_RESOLVER
-class ResolvServer;
-#endif
-class Mutex;
-
-/** Socket container class, event generator.
- \ingroup basic */
-class SocketHandler : public ISocketHandler
-{
-protected:
- /** Map type for holding file descriptors/socket object pointers. */
- typedef std::map socket_m;
-
-public:
- /** SocketHandler constructor.
- \param log Optional log class pointer */
- SocketHandler(StdLog *log = NULL);
-
- /** SocketHandler threadsafe constructor.
- \param mutex Externally declared mutex variable
- \param log Optional log class pointer */
- SocketHandler(Mutex& mutex,StdLog *log = NULL);
-
- ~SocketHandler();
-
- /** Get mutex reference for threadsafe operations. */
- Mutex& GetMutex() const;
-
- /** Register StdLog object for error callback.
- \param log Pointer to log class */
- void RegStdLog(StdLog *log);
-
- /** Log error to log class for print out / storage. */
- void LogError(Socket *p,const std::string& user_text,int err,const std::string& sys_err,loglevel_t t = LOG_LEVEL_WARNING);
-
- /** Add socket instance to socket map. Removal is always automatic. */
- void Add(Socket *);
-
- /** Get status of read/write/exception file descriptor set for a socket. */
- void Get(SOCKET s,bool& r,bool& w,bool& e);
-
- /** Set read/write/exception file descriptor sets (fd_set). */
- void Set(SOCKET s,bool bRead,bool bWrite,bool bException = true);
-
- /** Wait for events, generate callbacks. */
- int Select(long sec,long usec);
-
- /** This method will not return until an event has been detected. */
- int Select();
-
- /** Wait for events, generate callbacks. */
- int Select(struct timeval *tsel);
-
- /** Check that a socket really is handled by this socket handler. */
- bool Valid(Socket *);
-
- /** Return number of sockets handled by this handler. */
- size_t GetCount();
-
- /** Override and return false to deny all incoming connections.
- \param p ListenSocket class pointer (use GetPort to identify which one) */
- bool OkToAccept(Socket *p);
-
- /** Called by Socket when a socket changes state. */
- void AddList(SOCKET s,list_t which_one,bool add);
-
- // Connection pool
-#ifdef ENABLE_POOL
- /** Find available open connection (used by connection pool). */
- ISocketHandler::PoolSocket *FindConnection(int type,const std::string& protocol,SocketAddress&);
- /** Enable connection pool (by default disabled). */
- void EnablePool(bool x = true);
- /** Check pool status.
- \return true if connection pool is enabled */
- bool PoolEnabled();
-#endif // ENABLE_POOL
-
- // Socks4
-#ifdef ENABLE_SOCKS4
- /** Set socks4 server ip that all new tcp sockets should use. */
- void SetSocks4Host(ipaddr_t);
- /** Set socks4 server hostname that all new tcp sockets should use. */
- void SetSocks4Host(const std::string& );
- /** Set socks4 server port number that all new tcp sockets should use. */
- void SetSocks4Port(port_t);
- /** Set optional socks4 userid. */
- void SetSocks4Userid(const std::string& );
- /** If connection to socks4 server fails, immediately try direct connection to final host. */
- void SetSocks4TryDirect(bool x = true);
- /** Get socks4 server ip.
- \return socks4 server ip */
- ipaddr_t GetSocks4Host();
- /** Get socks4 port number.
- \return socks4 port number */
- port_t GetSocks4Port();
- /** Get socks4 userid (optional).
- \return socks4 userid */
- const std::string& GetSocks4Userid();
- /** Check status of socks4 try direct flag.
- \return true if direct connection should be tried if connection to socks4 server fails */
- bool Socks4TryDirect();
-#endif // ENABLE_SOCKS4
-
- // DNS resolve server
-#ifdef ENABLE_RESOLVER
- /** Enable asynchronous DNS.
- \param port Listen port of asynchronous dns server */
- void EnableResolver(port_t port = 16667);
- /** Check resolver status.
- \return true if resolver is enabled */
- bool ResolverEnabled();
- /** Queue a dns request.
- \param host Hostname to be resolved
- \param port Port number will be echoed in Socket::OnResolved callback */
- int Resolve(Socket *,const std::string& host,port_t port);
-#ifdef ENABLE_IPV6
- int Resolve6(Socket *,const std::string& host,port_t port);
-#endif
- /** Do a reverse dns lookup. */
- int Resolve(Socket *,ipaddr_t a);
-#ifdef ENABLE_IPV6
- int Resolve(Socket *,in6_addr& a);
-#endif
- /** Get listen port of asynchronous dns server. */
- port_t GetResolverPort();
- /** Resolver thread ready for queries. */
- bool ResolverReady();
- /** Returns true if the socket is waiting for a resolve event. */
- bool Resolving(Socket *);
-#endif // ENABLE_RESOLVER
-
-#ifdef ENABLE_TRIGGERS
- /** Fetch unique trigger id. */
- int TriggerID(Socket *src);
- /** Subscribe socket to trigger id. */
- bool Subscribe(int id, Socket *dst);
- /** Unsubscribe socket from trigger id. */
- bool Unsubscribe(int id, Socket *dst);
- /** Execute OnTrigger for subscribed sockets.
- \param id Trigger ID
- \param data Data passed from source to destination
- \param erase Empty trigger id source and destination maps if 'true',
- Leave them in place if 'false' - if a trigger should be called many times */
- void Trigger(int id, Socket::TriggerData& data, bool erase = true);
-#endif // ENABLE_TRIGGERS
-
-#ifdef ENABLE_DETACH
- /** Indicates that the handler runs under SocketThread. */
- void SetSlave(bool x = true);
- /** Indicates that the handler runs under SocketThread. */
- bool IsSlave();
-#endif
-
- /** Sanity check of those accursed lists. */
- void CheckSanity();
-
-protected:
- socket_m m_sockets; ///< Active sockets map
- socket_m m_add; ///< Sockets to be added to sockets map
- std::list m_delete; ///< Sockets to be deleted (failed when Add)
-
-protected:
- StdLog *m_stdlog; ///< Registered log class, or NULL
- Mutex& m_mutex; ///< Thread safety mutex
- bool m_b_use_mutex; ///< Mutex correctly initialized
-
-private:
- void CheckList(socket_v&,const std::string&); ///< Used by CheckSanity
- /** Remove socket from socket map, used by Socket class. */
- void Remove(Socket *);
- SOCKET m_maxsock; ///< Highest file descriptor + 1 in active sockets list
- fd_set m_rfds; ///< file descriptor set monitored for read events
- fd_set m_wfds; ///< file descriptor set monitored for write events
- fd_set m_efds; ///< file descriptor set monitored for exceptions
- int m_preverror; ///< debug select() error
- int m_errcnt; ///< debug select() error
- time_t m_tlast; ///< timeout control
-
- // state lists
- socket_v m_fds; ///< Active file descriptor list
- socket_v m_fds_erase; ///< File descriptors that are to be erased from m_sockets
- socket_v m_fds_callonconnect; ///< checklist CallOnConnect
-#ifdef ENABLE_DETACH
- socket_v m_fds_detach; ///< checklist Detach
-#endif
- socket_v m_fds_timeout; ///< checklist timeout
- socket_v m_fds_retry; ///< checklist retry client connect
- socket_v m_fds_close; ///< checklist close and delete
-
-#ifdef ENABLE_SOCKS4
- ipaddr_t m_socks4_host; ///< Socks4 server host ip
- port_t m_socks4_port; ///< Socks4 server port number
- std::string m_socks4_userid; ///< Socks4 userid
- bool m_bTryDirect; ///< Try direct connection if socks4 server fails
-#endif
-#ifdef ENABLE_RESOLVER
- int m_resolv_id; ///< Resolver id counter
- ResolvServer *m_resolver; ///< Resolver thread pointer
- port_t m_resolver_port; ///< Resolver listen port
- std::map m_resolve_q; ///< resolve queue
-#endif
-#ifdef ENABLE_POOL
- bool m_b_enable_pool; ///< Connection pool enabled if true
-#endif
-#ifdef ENABLE_TRIGGERS
- int m_next_trigger_id; ///< Unique trigger id counter
- std::map m_trigger_src; ///< mapping trigger id to source socket
- std::map > m_trigger_dst; ///< mapping trigger id to destination sockets
-#endif
-#ifdef ENABLE_DETACH
- bool m_slave; ///< Indicates that this is a ISocketHandler run in SocketThread
-#endif
-};
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // _SOCKETS_SocketHandler_H
-
diff --git a/dep/include/sockets/StdLog.h b/dep/include/sockets/StdLog.h
deleted file mode 100644
index c07037bbd..000000000
--- a/dep/include/sockets/StdLog.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/** \file StdLog.h
- ** \date 2004-06-01
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_StdLog_H
-#define _SOCKETS_StdLog_H
-
-#include "sockets-config.h"
-#include
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-/** error level enum. */
-typedef enum
-{
- LOG_LEVEL_WARNING = 0,
- LOG_LEVEL_ERROR,
- LOG_LEVEL_FATAL,
- LOG_LEVEL_INFO
-} loglevel_t;
-
-
-class ISocketHandler;
-class Socket;
-
-/** \defgroup logging Log help classes */
-/** Log class interface.
- \ingroup logging */
-class StdLog
-{
-public:
- virtual ~StdLog() {}
-
- virtual void error(ISocketHandler *,Socket *,
- const std::string& user_text,
- int err,
- const std::string& sys_err,
- loglevel_t = LOG_LEVEL_WARNING) = 0;
-};
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // _SOCKETS_StdLog_H
-
diff --git a/dep/include/sockets/StdoutLog.h b/dep/include/sockets/StdoutLog.h
deleted file mode 100644
index 5f96b340d..000000000
--- a/dep/include/sockets/StdoutLog.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/** \file StdoutLog.h
- ** \date 2004-06-01
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_StdoutLog_H
-#define _SOCKETS_StdoutLog_H
-
-#include "sockets-config.h"
-#include "StdLog.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-/** StdLog implementation, logs to stdout.
- \ingroup logging */
-class StdoutLog : public StdLog
-{
-public:
- void error(ISocketHandler *,Socket *,const std::string& call,int err,const std::string& sys_err,loglevel_t);
-};
-
-
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // _SOCKETS_StdoutLog_H
-
diff --git a/dep/include/sockets/StreamSocket.h b/dep/include/sockets/StreamSocket.h
deleted file mode 100644
index 3c248110b..000000000
--- a/dep/include/sockets/StreamSocket.h
+++ /dev/null
@@ -1,127 +0,0 @@
-#ifndef _StreamSocket_H
-#define _StreamSocket_H
-
-#include "Socket.h"
-
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-/** SOCK_STREAM Socket base class.
- \ingroup basic */
-class StreamSocket : public Socket
-{
-public:
- StreamSocket(ISocketHandler& );
- ~StreamSocket();
-
- /** Socket should Check Connect on next write event from select(). */
- void SetConnecting(bool = true);
-
- /** Check connecting flag.
- \return true if the socket is still trying to connect */
- bool Connecting();
-
- /** Returns true when socket file descriptor is valid,
- socket connection is established, and socket is not about to
- be closed. */
- bool Ready();
-
- /** Set timeout to use for connection attempt.
- \param x Timeout in seconds */
- void SetConnectTimeout(int x);
-
- /** Return number of seconds to wait for a connection.
- \return Connection timeout (seconds) */
- int GetConnectTimeout();
-
- /** Set flush before close to make a tcp socket completely empty its
- output buffer before closing the connection. */
- void SetFlushBeforeClose(bool = true);
-
- /** Check flush before status.
- \return true if the socket should send all data before closing */
- bool GetFlushBeforeClose();
-
- /** Define number of connection retries (tcp only).
- n = 0 - no retry
- n > 0 - number of retries
- n = -1 - unlimited retries */
- void SetConnectionRetry(int n);
-
- /** Get number of maximum connection retries (tcp only). */
- int GetConnectionRetry();
-
- /** Increase number of actual connection retries (tcp only). */
- void IncreaseConnectionRetries();
-
- /** Get number of actual connection retries (tcp only). */
- int GetConnectionRetries();
-
- /** Reset actual connection retries (tcp only). */
- void ResetConnectionRetries();
-
- // LIST_CALLONCONNECT
-
- /** Instruct socket to call OnConnect callback next sockethandler cycle. */
- void SetCallOnConnect(bool x = true);
-
- /** Check call on connect flag.
- \return true if OnConnect() should be called a.s.a.p */
- bool CallOnConnect();
-
- // LIST_RETRY
-
- /** Set flag to initiate a connection attempt after a connection timeout. */
- void SetRetryClientConnect(bool x = true);
-
- /** Check if a connection attempt should be made.
- \return true when another attempt should be made */
- bool RetryClientConnect();
-
- /** Called after OnRead if socket is in line protocol mode.
- \sa SetLineProtocol */
- /** Enable the OnLine callback. Do not create your own OnRead
- * callback when using this. */
- virtual void SetLineProtocol(bool = true);
-
- /** Check line protocol mode.
- \return true if socket is in line protocol mode */
- bool LineProtocol();
-
- /** Set shutdown status. */
- void SetShutdown(int);
-
- /** Get shutdown status. */
- int GetShutdown();
-
- /** Returns IPPROTO_TCP or IPPROTO_SCTP */
- virtual int Protocol() = 0;
-
-protected:
- StreamSocket(const StreamSocket& ) {} // copy constructor
-
-private:
- StreamSocket& operator=(const StreamSocket& ) { return *this; } // assignment operator
-
- bool m_bConnecting; ///< Flag indicating connection in progress
- int m_connect_timeout; ///< Connection timeout (seconds)
- bool m_flush_before_close; ///< Send all data before closing (default true)
- int m_connection_retry; ///< Maximum connection retries (tcp)
- int m_retries; ///< Actual number of connection retries (tcp)
- bool m_call_on_connect; ///< OnConnect will be called next ISocketHandler cycle if true
- bool m_b_retry_connect; ///< Try another connection attempt next ISocketHandler cycle
- bool m_line_protocol; ///< Line protocol mode flag
- int m_shutdown; ///< Shutdown status
-};
-
-
-#ifdef SOCKETS_NAMESPACE
-} // namespace SOCKETS_NAMESPACE {
-#endif
-
-
-#endif // _StreamSocket_H
-
diff --git a/dep/include/sockets/TcpSocket.h b/dep/include/sockets/TcpSocket.h
deleted file mode 100644
index 515f5aa6c..000000000
--- a/dep/include/sockets/TcpSocket.h
+++ /dev/null
@@ -1,358 +0,0 @@
-/** \file TcpSocket.h
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_TcpSocket_H
-#define _SOCKETS_TcpSocket_H
-#include "sockets-config.h"
-#include "StreamSocket.h"
-#ifdef HAVE_OPENSSL
-#include
-#include "SSLInitializer.h"
-#endif
-
-#include
-
-#define TCP_BUFSIZE_READ 16400
-#define TCP_OUTPUT_CAPACITY 1024000
-
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-class SocketAddress;
-
-
-/** Socket implementation for TCP.
- \ingroup basic */
-class TcpSocket : public StreamSocket
-{
- /** \defgroup internal Internal utility */
-protected:
- /** Buffer class containing one read/write circular buffer.
- \ingroup internal */
- class CircularBuffer
- {
- public:
- CircularBuffer(size_t size);
- ~CircularBuffer();
-
- /** append l bytes from p to buffer */
- bool Write(const char *p,size_t l);
- /** copy l bytes from buffer to dest */
- bool Read(char *dest,size_t l);
- /** copy l bytes from buffer to dest, dont touch buffer pointers */
- bool SoftRead(char *dest, size_t l);
- /** skip l bytes from buffer */
- bool Remove(size_t l);
- /** read l bytes from buffer, returns as string. */
- std::string ReadString(size_t l);
-
- /** total buffer length */
- size_t GetLength();
- /** pointer to circular buffer beginning */
- const char *GetStart();
- /** return number of bytes from circular buffer beginning to buffer physical end */
- size_t GetL();
- /** return free space in buffer, number of bytes until buffer overrun */
- size_t Space();
-
- /** return total number of bytes written to this buffer, ever */
- unsigned long ByteCounter(bool clear = false);
-
- private:
- CircularBuffer(const CircularBuffer& /*s*/) {}
- CircularBuffer& operator=(const CircularBuffer& ) { return *this; }
- char *buf;
- size_t m_max;
- size_t m_q;
- size_t m_b;
- size_t m_t;
- unsigned long m_count;
- };
- /** Output buffer struct.
- \ingroup internal */
- struct OUTPUT {
- OUTPUT() : _b(0), _t(0), _q(0) {}
- OUTPUT(const char *buf, size_t len) : _b(0), _t(len), _q(len) {
- memcpy(_buf, buf, len);
- }
- size_t Space() {
- return TCP_OUTPUT_CAPACITY - _t;
- }
- void Add(const char *buf, size_t len) {
- memcpy(_buf + _t, buf, len);
- _t += len;
- _q += len;
- }
- size_t Remove(size_t len) {
- _b += len;
- _q -= len;
- return _q;
- }
- const char *Buf() {
- return _buf + _b;
- }
- size_t Len() {
- return _q;
- }
- size_t _b;
- size_t _t;
- size_t _q;
- char _buf[TCP_OUTPUT_CAPACITY];
- };
- typedef std::list output_l;
-
-public:
- /** Constructor with standard values on input/output buffers. */
- TcpSocket(ISocketHandler& );
- /** Constructor with custom values for i/o buffer.
- \param h ISocketHandler reference
- \param isize Input buffer size
- \param osize Output buffer size */
- TcpSocket(ISocketHandler& h,size_t isize,size_t osize);
- ~TcpSocket();
-
- /** Open a connection to a remote server.
- If you want your socket to connect to a server,
- always call Open before Add'ing a socket to the sockethandler.
- If not, the connection attempt will not be monitored by the
- socket handler...
- \param ip IP address
- \param port Port number
- \param skip_socks Do not use socks4 even if configured */
- bool Open(ipaddr_t ip,port_t port,bool skip_socks = false);
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- /** Open connection.
- \param ip Ipv6 address
- \param port Port number
- \param skip_socks Do not use socks4 even if configured */
- bool Open(in6_addr ip,port_t port,bool skip_socks = false);
-#endif
-#endif
- bool Open(SocketAddress&,bool skip_socks = false);
- bool Open(SocketAddress&,SocketAddress& bind_address,bool skip_socks = false);
- /** Open connection.
- \param host Hostname
- \param port Port number */
- bool Open(const std::string &host,port_t port);
-
- /** Connect timeout callback. */
- void OnConnectTimeout();
-#ifdef _WIN32
- /** Connection failed reported as exception on win32 */
- void OnException();
-#endif
-
- /** Close file descriptor - internal use only.
- \sa SetCloseAndDelete */
- int Close();
-
- /** Send a string.
- \param s String to send
- \param f Dummy flags -- not used */
- void Send(const std::string &s,int f = 0);
- /** Send string using printf formatting. */
- void Sendf(const char *format, ...);
- /** Send buffer of bytes.
- \param buf Buffer pointer
- \param len Length of data
- \param f Dummy flags -- not used */
- void SendBuf(const char *buf,size_t len,int f = 0);
- /** This callback is executed after a successful read from the socket.
- \param buf Pointer to the data
- \param len Length of the data */
- virtual void OnRawData(const char *buf,size_t len);
-
- /** Called when output buffer has been sent.
- Note: Will only be called IF the output buffer has been used.
- Send's that was successful without needing the output buffer
- will not generate a call to this method. */
- virtual void OnWriteComplete();
- /** Number of bytes in input buffer. */
- size_t GetInputLength();
- /** Number of bytes in output buffer. */
- size_t GetOutputLength();
-
- /** Callback fires when a socket in line protocol has read one full line.
- \param line Line read */
- void OnLine(const std::string& line);
- /** Get counter of number of bytes received. */
- uint64_t GetBytesReceived(bool clear = false);
- /** Get counter of number of bytes sent. */
- uint64_t GetBytesSent(bool clear = false);
-
- /** Socks4 specific callback. */
- void OnSocks4Connect();
- /** Socks4 specific callback. */
- void OnSocks4ConnectFailed();
- /** Socks4 specific callback.
- \return 'need_more' */
- bool OnSocks4Read();
-
-#ifdef ENABLE_RESOLVER
- /** Callback executed when resolver thread has finished a resolve request. */
- void OnResolved(int id,ipaddr_t a,port_t port);
-#ifdef ENABLE_IPV6
- void OnResolved(int id,in6_addr& a,port_t port);
-#endif
-#endif
-#ifdef HAVE_OPENSSL
- /** Callback for 'New' ssl support - replaces SSLSocket. Internal use. */
- void OnSSLConnect();
- /** Callback for 'New' ssl support - replaces SSLSocket. Internal use. */
- void OnSSLAccept();
- /** This method must be implemented to initialize
- the ssl context for an outgoing connection. */
- virtual void InitSSLClient();
- /** This method must be implemented to initialize
- the ssl context for an incoming connection. */
- virtual void InitSSLServer();
-#endif
-
-#ifdef ENABLE_RECONNECT
- /** Flag that says a broken connection will try to reconnect. */
- void SetReconnect(bool = true);
- /** Check reconnect on lost connection flag status. */
- bool Reconnect();
- /** Flag to determine if a reconnect is in progress. */
- void SetIsReconnect(bool x = true);
- /** Socket is reconnecting. */
- bool IsReconnect();
-#endif
-
- void DisableInputBuffer(bool = true);
-
- void OnOptions(int,int,int,SOCKET);
-
- void SetLineProtocol(bool = true);
-
- // TCP options
- bool SetTcpNodelay(bool = true);
-
- virtual int Protocol();
-
- /** Trigger limit for callback OnTransferLimit. */
- void SetTransferLimit(size_t sz);
- /** This callback fires when the output buffer drops below the value
- set by SetTransferLimit. Default: 0 (disabled). */
- virtual void OnTransferLimit();
-
-protected:
- TcpSocket(const TcpSocket& );
- void OnRead();
- void OnRead( char *buf, size_t n );
- void OnWrite();
-#ifdef HAVE_OPENSSL
- /** SSL; Initialize ssl context for a client socket.
- \param meth_in SSL method */
- void InitializeContext(const std::string& context, SSL_METHOD *meth_in = NULL);
- /** SSL; Initialize ssl context for a server socket.
- \param keyfile Combined private key/certificate file
- \param password Password for private key
- \param meth_in SSL method */
- void InitializeContext(const std::string& context, const std::string& keyfile, const std::string& password, SSL_METHOD *meth_in = NULL);
- /** SSL; Initialize ssl context for a server socket.
- \param certfile Separate certificate file
- \param keyfile Combined private key/certificate file
- \param password Password for private key
- \param meth_in SSL method */
- void InitializeContext(const std::string& context, const std::string& certfile, const std::string& keyfile, const std::string& password, SSL_METHOD *meth_in = NULL);
- /** SSL; Password callback method. */
-static int SSL_password_cb(char *buf,int num,int rwflag,void *userdata);
- /** SSL; Get pointer to ssl context structure. */
- virtual SSL_CTX *GetSslContext();
- /** SSL; Get pointer to ssl structure. */
- virtual SSL *GetSsl();
- /** ssl; still negotiating connection. */
- bool SSLNegotiate();
- /** SSL; Get ssl password. */
- const std::string& GetPassword();
-#endif
-
- CircularBuffer ibuf; ///< Circular input buffer
-
-private:
- TcpSocket& operator=(const TcpSocket& ) { return *this; }
-
- /** the actual send() */
- int TryWrite(const char *buf, size_t len);
- /** add data to output buffer top */
- void Buffer(const char *buf, size_t len);
-
- //
- bool m_b_input_buffer_disabled;
- uint64_t m_bytes_sent;
- uint64_t m_bytes_received;
- bool m_skip_c; ///< Skip second char of CRLF or LFCR sequence in OnRead
- char m_c; ///< First char in CRLF or LFCR sequence
- std::string m_line; ///< Current line in line protocol mode
-#ifdef SOCKETS_DYNAMIC_TEMP
- char *m_buf; ///< temporary read buffer
-#endif
- output_l m_obuf; ///< output buffer
- OUTPUT *m_obuf_top; ///< output buffer on top
- size_t m_transfer_limit;
- size_t m_output_length;
-
-#ifdef HAVE_OPENSSL
-static SSLInitializer m_ssl_init;
- SSL_CTX *m_ssl_ctx; ///< ssl context
- SSL *m_ssl; ///< ssl 'socket'
- BIO *m_sbio; ///< ssl bio
- std::string m_password; ///< ssl password
-#endif
-
-#ifdef ENABLE_SOCKS4
- int m_socks4_state; ///< socks4 support
- char m_socks4_vn; ///< socks4 support, temporary variable
- char m_socks4_cd; ///< socks4 support, temporary variable
- unsigned short m_socks4_dstport; ///< socks4 support
- unsigned long m_socks4_dstip; ///< socks4 support
-#endif
-
-#ifdef ENABLE_RESOLVER
- int m_resolver_id; ///< Resolver id (if any) for current Open call
-#endif
-
-#ifdef ENABLE_RECONNECT
- bool m_b_reconnect; ///< Reconnect on lost connection flag
- bool m_b_is_reconnect; ///< Trying to reconnect
-#endif
-
-};
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // _SOCKETS_TcpSocket_H
-
diff --git a/dep/include/sockets/Thread.h b/dep/include/sockets/Thread.h
deleted file mode 100644
index d784a1594..000000000
--- a/dep/include/sockets/Thread.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/** \file Thread.h
- ** \date 2004-10-30
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_Thread_H
-#define _SOCKETS_Thread_H
-
-#include "sockets-config.h"
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-#ifdef _WIN32
-// to be
-//typedef DWORD threadfunc_t;
-//typedef LPVOID threadparam_t;
-//#define STDPREFIX WINAPI
-typedef unsigned threadfunc_t;
-typedef void * threadparam_t;
-#define STDPREFIX __stdcall
-#else
-#include
-
-typedef void * threadfunc_t;
-typedef void * threadparam_t;
-#define STDPREFIX
-#endif
-
-/** \defgroup threading Threading */
-/** Thread base class.
-The Thread class is used by the resolver (ResolvServer) and running a detached socket (SocketThread).
-When you know some processing will take a long time and will freeze up a socket, there is always the
-possibility to call Detach() on that socket before starting the processing.
-When the OnDetached() callback is later called the processing can continue, now in its own thread.
- \ingroup threading */
-class Thread
-{
-public:
- Thread(bool release = true);
- virtual ~Thread();
-
- static threadfunc_t STDPREFIX StartThread(threadparam_t);
-
- virtual void Run() = 0;
-
- bool IsRunning();
- void SetRunning(bool x);
- bool IsReleased();
- void SetRelease(bool x);
- bool DeleteOnExit();
- void SetDeleteOnExit(bool x = true);
- bool IsDestructor();
-
-private:
- Thread(const Thread& ) {}
- Thread& operator=(const Thread& ) { return *this; }
-#ifdef _WIN32
- HANDLE m_thread;
- unsigned m_dwThreadId;
-#else
- pthread_t m_thread;
-#endif
- bool m_running;
- bool m_release;
- bool m_b_delete_on_exit;
- bool m_b_destructor;
-};
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // _SOCKETS_Thread_H
-
diff --git a/dep/include/sockets/UdpSocket.h b/dep/include/sockets/UdpSocket.h
deleted file mode 100644
index d32aabf67..000000000
--- a/dep/include/sockets/UdpSocket.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/** \file UdpSocket.h
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_UdpSocket_H
-#define _SOCKETS_UdpSocket_H
-
-#include "sockets-config.h"
-#include "Socket.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-/** Socket implementation for UDP.
- \ingroup basic */
-class UdpSocket : public Socket
-{
-public:
- /** Constructor.
- \param h ISocketHandler reference
- \param ibufsz Maximum size of receive message (extra bytes will be truncated)
- \param ipv6 'true' if this is an ipv6 socket */
- UdpSocket(ISocketHandler& h,int ibufsz = 16384,bool ipv6 = false, int retries = 0);
- ~UdpSocket();
-
- /** Called when incoming data has been received.
- \param buf Pointer to data
- \param len Length of data
- \param sa Pointer to sockaddr struct of sender
- \param sa_len Length of sockaddr struct */
- virtual void OnRawData(const char *buf,size_t len,struct sockaddr *sa,socklen_t sa_len);
-
- /** Called when incoming data has been received and read timestamp is enabled.
- \param buf Pointer to data
- \param len Length of data
- \param sa Pointer to sockaddr struct of sender
- \param sa_len Length of sockaddr struct
- \param ts Timestamp from message */
- virtual void OnRawData(const char *buf,size_t len,struct sockaddr *sa,socklen_t sa_len,struct timeval *ts);
-
- /** To receive incoming data, call Bind to setup an incoming port.
- \param port Incoming port number
- \param range Port range to try if ports already in use
- \return 0 if bind succeeded */
- int Bind(port_t& port,int range = 1);
- /** To receive data on a specific interface:port, use this.
- \param intf Interface ip/hostname
- \param port Port number
- \param range Port range
- \return 0 if bind succeeded */
- int Bind(const std::string& intf,port_t& port,int range = 1);
- /** To receive data on a specific interface:port, use this.
- \param a Ip address
- \param port Port number
- \param range Port range
- \return 0 if bind succeeded */
- int Bind(ipaddr_t a,port_t& port,int range = 1);
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- /** To receive data on a specific interface:port, use this.
- \param a Ipv6 address
- \param port Port number
- \param range Port range
- \return 0 if bind succeeded */
- int Bind(in6_addr a,port_t& port,int range = 1);
-#endif
-#endif
- /** To receive data on a specific interface:port, use this.
- \param ad Socket address
- \param range Port range
- \return 0 if bind succeeded */
- int Bind(SocketAddress& ad,int range = 1);
-
- /** Define remote host.
- \param l Address of remote host
- \param port Port of remote host
- \return true if successful */
- bool Open(ipaddr_t l,port_t port);
- /** Define remote host.
- \param host Hostname
- \param port Port number
- \return true if successful */
- bool Open(const std::string& host,port_t port);
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- /** Define remote host.
- \param a Address of remote host, ipv6
- \param port Port of remote host
- \return true if successful */
- bool Open(struct in6_addr& a,port_t port);
-#endif
-#endif
- /** Define remote host.
- \param ad Socket address
- \return true if successful */
- bool Open(SocketAddress& ad);
-
- /** Send to specified host */
- void SendToBuf(const std::string& ,port_t,const char *data,int len,int flags = 0);
- /** Send to specified address */
- void SendToBuf(ipaddr_t,port_t,const char *data,int len,int flags = 0);
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- /** Send to specified ipv6 address */
- void SendToBuf(in6_addr,port_t,const char *data,int len,int flags = 0);
-#endif
-#endif
- /** Send to specified socket address */
- void SendToBuf(SocketAddress& ad,const char *data,int len,int flags = 0);
-
- /** Send string to specified host */
- void SendTo(const std::string&,port_t,const std::string&,int flags = 0);
- /** Send string to specified address */
- void SendTo(ipaddr_t,port_t,const std::string&,int flags = 0);
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- /** Send string to specified ipv6 address */
- void SendTo(in6_addr,port_t,const std::string&,int flags = 0);
-#endif
-#endif
- /** Send string to specified socket address */
- void SendTo(SocketAddress& ad,const std::string&,int flags = 0);
-
- /** Send to connected address */
- void SendBuf(const char *data,size_t,int flags = 0);
- /** Send string to connected address. */
- void Send(const std::string& ,int flags = 0);
-
- /** Set broadcast */
- void SetBroadcast(bool b = true);
- /** Check broadcast flag.
- \return true broadcast is enabled. */
- bool IsBroadcast();
-
- /** multicast */
- void SetMulticastTTL(int ttl = 1);
- int GetMulticastTTL();
- void SetMulticastLoop(bool = true);
- bool IsMulticastLoop();
- void AddMulticastMembership(const std::string& group,const std::string& intf = "0.0.0.0",int if_index = 0);
- void DropMulticastMembership(const std::string& group,const std::string& intf = "0.0.0.0",int if_index = 0);
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- /** multicast, ipv6 only */
- void SetMulticastHops(int = -1);
- /** multicast, ipv6 only */
- int GetMulticastHops();
-#endif
-#endif
- /** Returns true if Bind succeeded. */
- bool IsBound();
- /** Return Bind port number */
- port_t GetPort();
-
- void OnOptions(int,int,int,SOCKET) {}
-
- int GetLastSizeWritten();
-
- /** Also read timestamp information from incoming message */
- void SetTimestamp(bool = true);
-
-protected:
- UdpSocket(const UdpSocket& s) : Socket(s) {}
- void OnRead();
-#if defined(LINUX) || defined(MACOSX)
- /** This method emulates socket recvfrom, but uses messages so we can get the timestamp */
- int ReadTS(char *ioBuf, int inBufSize, struct sockaddr *from, socklen_t fromlen, struct timeval *ts);
-#endif
-
-private:
- UdpSocket& operator=(const UdpSocket& ) { return *this; }
- /** create before using sendto methods */
- void CreateConnection();
- char *m_ibuf; ///< Input buffer
- int m_ibufsz; ///< Size of input buffer
- bool m_bind_ok; ///< Bind completed successfully
- port_t m_port; ///< Bind port number
- int m_last_size_written;
- int m_retries;
- bool m_b_read_ts;
-};
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // _SOCKETS_UdpSocket_H
-
diff --git a/dep/include/sockets/Utility.h b/dep/include/sockets/Utility.h
deleted file mode 100644
index 0fbccd3df..000000000
--- a/dep/include/sockets/Utility.h
+++ /dev/null
@@ -1,186 +0,0 @@
-/** \file Utility.h
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_Utility_H
-#define _SOCKETS_Utility_H
-
-#include "sockets-config.h"
-#include
-#include
-#include
-#include "socket_include.h"
-#include
-#include
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-#define TWIST_LEN 624
-
-class SocketAddress;
-
-/** Conversion utilities.
- \ingroup util */
-class Utility
-{
- /**
- The Mersenne Twister
- http://www.math.keio.ac.jp/~matumoto/emt.html
- */
- class Rng {
- public:
- Rng(unsigned long seed);
-
- unsigned long Get();
-
- private:
- int m_value;
- unsigned long m_tmp[TWIST_LEN];
- };
- class ncmap_compare {
- public:
- bool operator()(const std::string& x, const std::string& y) const {
- return strcasecmp(x.c_str(), y.c_str()) < 0;
- }
- };
-public:
- template class ncmap : public std::map {
- public:
- ncmap() {}
- };
-public:
- static std::string base64(const std::string& str_in);
- static std::string base64d(const std::string& str_in);
- static std::string l2string(long l);
- static std::string bigint2string(uint64_t l);
- static uint64_t atoi64(const std::string& str);
- static unsigned int hex2unsigned(const std::string& str);
- static std::string rfc1738_encode(const std::string& src);
- static std::string rfc1738_decode(const std::string& src);
-
- /** Checks whether a string is a valid ipv4/ipv6 ip number. */
- static bool isipv4(const std::string&);
- /** Checks whether a string is a valid ipv4/ipv6 ip number. */
- static bool isipv6(const std::string&);
-
- /** Hostname to ip resolution ipv4, not asynchronous. */
- static bool u2ip(const std::string&, ipaddr_t&);
- static bool u2ip(const std::string&, struct sockaddr_in& sa, int ai_flags = 0);
-
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- /** Hostname to ip resolution ipv6, not asynchronous. */
- static bool u2ip(const std::string&, struct in6_addr&);
- static bool u2ip(const std::string&, struct sockaddr_in6& sa, int ai_flags = 0);
-#endif
-#endif
-
- /** Reverse lookup of address to hostname */
- static bool reverse(struct sockaddr *sa, socklen_t sa_len, std::string&, int flags = 0);
- static bool reverse(struct sockaddr *sa, socklen_t sa_len, std::string& hostname, std::string& service, int flags = 0);
-
- static bool u2service(const std::string& name, int& service, int ai_flags = 0);
-
- /** Convert binary ip address to string: ipv4. */
- static void l2ip(const ipaddr_t,std::string& );
- static void l2ip(const in_addr&,std::string& );
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- /** Convert binary ip address to string: ipv6. */
- static void l2ip(const struct in6_addr&,std::string& ,bool mixed = false);
-
- /** ipv6 address compare. */
- static int in6_addr_compare(in6_addr,in6_addr);
-#endif
-#endif
- /** ResolveLocal (hostname) - call once before calling any GetLocal method. */
- static void ResolveLocal();
- /** Returns local hostname, ResolveLocal must be called once before using.
- \sa ResolveLocal */
- static const std::string& GetLocalHostname();
- /** Returns local ip, ResolveLocal must be called once before using.
- \sa ResolveLocal */
- static ipaddr_t GetLocalIP();
- /** Returns local ip number as string.
- \sa ResolveLocal */
- static const std::string& GetLocalAddress();
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- /** Returns local ipv6 ip.
- \sa ResolveLocal */
- static const struct in6_addr& GetLocalIP6();
- /** Returns local ipv6 address.
- \sa ResolveLocal */
- static const std::string& GetLocalAddress6();
-#endif
-#endif
- /** Set environment variable.
- \param var Name of variable to set
- \param value Value */
- static void SetEnv(const std::string& var,const std::string& value);
- /** Convert sockaddr struct to human readable string.
- \param sa Ptr to sockaddr struct */
- static std::string Sa2String(struct sockaddr *sa);
-
- /** Get current time in sec/microseconds. */
- static void GetTime(struct timeval *);
-
- static std::auto_ptr CreateAddress(struct sockaddr *,socklen_t);
-
- static unsigned long ThreadID();
-
- static std::string ToLower(const std::string& str);
- static std::string ToUpper(const std::string& str);
-
- static std::string ToString(double d);
-
- /** Returns a random 32-bit integer */
- static unsigned long Rnd();
-
-private:
- static std::string m_host; ///< local hostname
- static ipaddr_t m_ip; ///< local ip address
- static std::string m_addr; ///< local ip address in string format
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- static struct in6_addr m_local_ip6; ///< local ipv6 address
-#endif
- static std::string m_local_addr6; ///< local ipv6 address in string format
-#endif
- static bool m_local_resolved; ///< ResolveLocal has been called if true
-};
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // _SOCKETS_Utility_H
-
diff --git a/dep/include/sockets/socket_include.h b/dep/include/sockets/socket_include.h
deleted file mode 100644
index 5ffaebbff..000000000
--- a/dep/include/sockets/socket_include.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/** \file socket_include.h
- ** \date 2005-04-12
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_socket_include_H
-#define _SOCKETS_socket_include_H
-#include "sockets-config.h"
-
-#ifdef _MSC_VER
-#pragma warning(disable:4514)
-#endif
-
-// common defines affecting library and applications using library
-
-/* Define SOCKETS_DYNAMIC_TEMP to use dynamically allocated buffers
- in read operations - helps on ECOS */
-#define SOCKETS_DYNAMIC_TEMP
-
-
-// platform specific stuff
-#if (defined(__unix__) || defined(unix)) && !defined(USG)
-#include
-#endif
-#include
-
-// int64
-#ifdef _WIN32
-typedef unsigned __int64 uint64_t;
-#else
-#include
-#ifdef SOLARIS
-# include
-#else
-# include
-#endif
-#endif
-
-#ifndef _WIN32
-// ----------------------------------------
-// common unix includes / defines
-#include
-#include
-#include
-#include
-#include
-#include
-//#include
-
-// all typedefs in this file will be declared outside the sockets namespace,
-// because some os's will already have one or more of the type defined.
-typedef int SOCKET;
-#define Errno errno
-#define StrError strerror
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-// WIN32 adapt
-#define closesocket close
-#define INVALID_SOCKET -1
-#define SOCKET_ERROR -1
-
-#ifndef INADDR_NONE
-#define INADDR_NONE ((unsigned long) -1)
-#endif // INADDR_NONE
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // !_WIN32
-
-
-// ----------------------------------------
-// Generic
-#ifndef SOL_IP
-#define SOL_IP IPPROTO_IP
-#endif
-
-
-// ----------------------------------------
-// OS specific adaptions
-
-#ifdef SOLARIS
-// ----------------------------------------
-// Solaris
-typedef unsigned short port_t;
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-// no defs
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#define s6_addr16 _S6_un._S6_u8
-#define MSG_NOSIGNAL 0
-
-#elif defined __FreeBSD__
-// ----------------------------------------
-// FreeBSD
-# if __FreeBSD_version >= 400014
-# define s6_addr16 __u6_addr.__u6_addr16
-# if !defined(MSG_NOSIGNAL)
-# define MSG_NOSIGNAL 0
-# endif
-# include
-typedef in_addr_t ipaddr_t;
-typedef in_port_t port_t;
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-// no defs
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-# define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
-# define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
-# else
-# error FreeBSD versions prior to 400014 does not support ipv6
-# endif
-
-#elif defined (__NetBSD__) || defined (__OpenBSD__)
-# if !defined(MSG_NOSIGNAL)
-# define MSG_NOSIGNAL 0
-# endif
-# include
-typedef in_addr_t ipaddr_t;
-typedef in_port_t port_t;
-#elif defined MACOSX
-// ----------------------------------------
-// Mac OS X
-#include
-#ifdef __DARWIN_UNIX03
-typedef unsigned short port_t;
-#else
-#include
-#endif // __DARWIN_UNIX03
-typedef unsigned long ipaddr_t;
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-// no defs
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#define s6_addr16 __u6_addr.__u6_addr16
-#define MSG_NOSIGNAL 0 // oops - thanks Derek
-#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
-#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
-
-#elif defined _WIN32
-// ----------------------------------------
-// Win32
-#ifdef _MSC_VER
-#pragma comment(lib, "wsock32.lib")
-#endif
-#define strcasecmp _stricmp
-
-typedef unsigned long ipaddr_t;
-typedef unsigned short port_t;
-typedef int socklen_t;
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-// no defs
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-// 1.8.6: define FD_SETSIZE to something bigger than 64 if there are a lot of
-// simultaneous connections (must be done before including winsock.h)
-#ifndef FD_SETSIZE
-#define FD_SETSIZE 1024
-#endif
-
-// windows 2000 with ipv6 preview installed:
-// http://msdn.microsoft.com/downloads/sdks/platform/tpipv6.asp
-// see the FAQ on how to install
-#define WIN32_LEAN_AND_MEAN
-#include
-#include
-#if _MSC_VER < 1200
-#ifndef __CYGWIN__
-#ifdef ENABLE_IPV6
-#include // For IPv6 Tech Preview.
-#endif
-#endif
-#endif // _MSC_VER < 1200
-
-
-#define MSG_NOSIGNAL 0
-//#define SHUT_RDWR 2
-#define SHUT_WR 1
-
-#define Errno WSAGetLastError()
-const char *StrError(int x);
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-// class WSAInitializer is a part of the Socket class (on win32)
-// as a static instance - so whenever an application uses a Socket,
-// winsock is initialized
-class WSAInitializer // Winsock Initializer
-{
-public:
- WSAInitializer() {
- if (WSAStartup(0x101,&m_wsadata))
- {
- exit(-1);
- }
- }
- ~WSAInitializer() {
- WSACleanup();
- }
-private:
- WSADATA m_wsadata;
-};
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#elif defined(sun) || defined(__sun__)
-
-#define MSG_NOSIGNAL 0
-typedef unsigned short port_t;
-
-#else
-// ----------------------------------------
-// LINUX
-typedef unsigned long ipaddr_t;
-typedef unsigned short port_t;
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-// no defs
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-
-#endif
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
- /** List type containing file descriptors. */
- typedef std::list socket_v;
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-
-// getaddrinfo / getnameinfo replacements
-#ifdef NO_GETADDRINFO
-#ifndef AI_NUMERICHOST
-#define AI_NUMERICHOST 1
-#endif
-#ifndef NI_NUMERICHOST
-#define NI_NUMERICHOST 1
-#endif
-#endif
-
-
-#endif // _SOCKETS_socket_include_H
-
diff --git a/dep/include/sockets/sockets-config.h b/dep/include/sockets/sockets-config.h
deleted file mode 100644
index fffc2bbe7..000000000
--- a/dep/include/sockets/sockets-config.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- ** \file sockets-config.h
- ** \date 2007-04-14
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2007 Anders Hedstrom
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifndef _SOCKETS_CONFIG_H
-#define _SOCKETS_CONFIG_H
-
-#ifndef _RUN_DP
-/* First undefine symbols if already defined. */
-#undef HAVE_OPENSSL
-#undef ENABLE_IPV6
-#undef USE_SCTP
-#undef NO_GETADDRINFO
-#undef ENABLE_POOL
-#undef ENABLE_SOCKS4
-#undef ENABLE_RESOLVER
-#undef ENABLE_RECONNECT
-#undef ENABLE_DETACH
-#undef ENABLE_TRIGGERS
-#undef ENABLE_EXCEPTIONS
-#endif // _RUN_DP
-
-// define MACOSX for internal socket library checks
-#if defined(__APPLE__) && defined(__MACH__) && !defined(MACOSX)
-#define MACOSX
-#endif
-
-/* OpenSSL support. */
-//#define HAVE_OPENSSL
-
-
-/* Ipv6 support. */
-//#define ENABLE_IPV6
-
-
-/* SCTP support. */
-//#define USE_SCTP
-
-
-/* Define NO_GETADDRINFO if your operating system does not support
- the "getaddrinfo" and "getnameinfo" function calls. */
-#define NO_GETADDRINFO
-
-
-/* Connection pool support. */
-#define ENABLE_POOL
-
-
-/* Socks4 client support. */
-//#define ENABLE_SOCKS4
-
-
-/* Asynchronous resolver. */
-#define ENABLE_RESOLVER
-
-
-/* Enable TCP reconnect on lost connection.
- Socket::OnReconnect
- Socket::OnDisconnect
-*/
-#define ENABLE_RECONNECT
-
-
-/* Enable socket thread detach functionality. */
-#define ENABLE_DETACH
-
-
-/* Enable socket to socket triggers. Not yet in use. */
-//#define ENABLE_TRIGGERS
-
-
-/* Enabled exceptions. */
-//#define ENABLE_EXCEPTIONS
-
-
-/* Resolver uses the detach function so either enable both or disable both. */
-#ifndef ENABLE_DETACH
-#undef ENABLE_RESOLVER
-#endif
-
-
-#endif // _SOCKETS_CONFIG_H
-
diff --git a/dep/src/Makefile.am b/dep/src/Makefile.am
index ac4f90523..b5648b3cd 100644
--- a/dep/src/Makefile.am
+++ b/dep/src/Makefile.am
@@ -17,7 +17,7 @@
## Process this file with automake to produce Makefile.in
## Sub-directories to parse
-SUBDIRS = g3dlite sockets gsoap zlib
+SUBDIRS = g3dlite gsoap zlib
## Additional files to include when running 'make dist'
# Nothing yet.
diff --git a/dep/src/sockets/Base64.cpp b/dep/src/sockets/Base64.cpp
deleted file mode 100644
index b8cf12371..000000000
--- a/dep/src/sockets/Base64.cpp
+++ /dev/null
@@ -1,272 +0,0 @@
-/** \file Base64.cpp
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#include "Base64.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-const char *Base64::bstr =
- "ABCDEFGHIJKLMNOPQ"
- "RSTUVWXYZabcdefgh"
- "ijklmnopqrstuvwxy"
- "z0123456789+/";
-
-const char Base64::rstr[] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 63,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0,
- 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0};
-
-
-Base64::Base64()
-{
-}
-
-
-void Base64::encode(FILE *fil, std::string& output, bool add_crlf)
-{
- size_t remain;
- size_t i = 0;
- size_t o = 0;
- char input[4];
-
- output = "";
- remain = fread(input,1,3,fil);
- while (remain > 0)
- {
- if (add_crlf && o && o % 76 == 0)
- output += "\n";
- switch (remain)
- {
- case 1:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) ];
- output += "==";
- break;
- case 2:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ];
- output += bstr[ ((input[i + 1] << 2) & 0x3c) ];
- output += "=";
- break;
- default:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ];
- output += bstr[ ((input[i + 1] << 2) & 0x3c) + ((input[i + 2] >> 6) & 0x03) ];
- output += bstr[ (input[i + 2] & 0x3f) ];
- }
- o += 4;
- //
- remain = fread(input,1,3,fil);
- }
-}
-
-
-void Base64::encode(const std::string& str_in, std::string& str_out, bool add_crlf)
-{
- encode(str_in.c_str(), str_in.size(), str_out, add_crlf);
-}
-
-
-void Base64::encode(const char* input,size_t l,std::string& output, bool add_crlf)
-{
- size_t i = 0;
- size_t o = 0;
-
- output = "";
- while (i < l)
- {
- size_t remain = l - i;
- if (add_crlf && o && o % 76 == 0)
- output += "\n";
- switch (remain)
- {
- case 1:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) ];
- output += "==";
- break;
- case 2:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ];
- output += bstr[ ((input[i + 1] << 2) & 0x3c) ];
- output += "=";
- break;
- default:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ];
- output += bstr[ ((input[i + 1] << 2) & 0x3c) + ((input[i + 2] >> 6) & 0x03) ];
- output += bstr[ (input[i + 2] & 0x3f) ];
- }
- o += 4;
- i += 3;
- }
-}
-
-
-void Base64::encode(const unsigned char* input,size_t l,std::string& output,bool add_crlf)
-{
- size_t i = 0;
- size_t o = 0;
-
- output = "";
- while (i < l)
- {
- size_t remain = l - i;
- if (add_crlf && o && o % 76 == 0)
- output += "\n";
- switch (remain)
- {
- case 1:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) ];
- output += "==";
- break;
- case 2:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ];
- output += bstr[ ((input[i + 1] << 2) & 0x3c) ];
- output += "=";
- break;
- default:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ];
- output += bstr[ ((input[i + 1] << 2) & 0x3c) + ((input[i + 2] >> 6) & 0x03) ];
- output += bstr[ (input[i + 2] & 0x3f) ];
- }
- o += 4;
- i += 3;
- }
-}
-
-
-void Base64::decode(const std::string& input,std::string& output)
-{
- size_t i = 0;
- size_t l = input.size();
-
- output = "";
- while (i < l)
- {
- while (i < l && (input[i] == 13 || input[i] == 10))
- i++;
- if (i < l)
- {
- char b1 = (char)((rstr[(int)input[i]] << 2 & 0xfc) +
- (rstr[(int)input[i + 1]] >> 4 & 0x03));
- output += b1;
- if (input[i + 2] != '=')
- {
- char b2 = (char)((rstr[(int)input[i + 1]] << 4 & 0xf0) +
- (rstr[(int)input[i + 2]] >> 2 & 0x0f));
- output += b2;
- }
- if (input[i + 3] != '=')
- {
- char b3 = (char)((rstr[(int)input[i + 2]] << 6 & 0xc0) +
- rstr[(int)input[i + 3]]);
- output += b3;
- }
- i += 4;
- }
- }
-}
-
-
-void Base64::decode(const std::string& input, unsigned char *output, size_t& sz)
-{
- size_t i = 0;
- size_t l = input.size();
- size_t j = 0;
-
- while (i < l)
- {
- while (i < l && (input[i] == 13 || input[i] == 10))
- i++;
- if (i < l)
- {
- unsigned char b1 = (unsigned char)((rstr[(int)input[i]] << 2 & 0xfc) +
- (rstr[(int)input[i + 1]] >> 4 & 0x03));
- if (output)
- {
- output[j] = b1;
- }
- j++;
- if (input[i + 2] != '=')
- {
- unsigned char b2 = (unsigned char)((rstr[(int)input[i + 1]] << 4 & 0xf0) +
- (rstr[(int)input[i + 2]] >> 2 & 0x0f));
- if (output)
- {
- output[j] = b2;
- }
- j++;
- }
- if (input[i + 3] != '=')
- {
- unsigned char b3 = (unsigned char)((rstr[(int)input[i + 2]] << 6 & 0xc0) +
- rstr[(int)input[i + 3]]);
- if (output)
- {
- output[j] = b3;
- }
- j++;
- }
- i += 4;
- }
- }
- sz = j;
-}
-
-
-size_t Base64::decode_length(const std::string& str64)
-{
- if (str64.empty() || str64.size() % 4)
- return 0;
- size_t l = 3 * (str64.size() / 4 - 1) + 1;
- if (str64[str64.size() - 2] != '=')
- l++;
- if (str64[str64.size() - 1] != '=')
- l++;
- return l;
-}
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-
diff --git a/dep/src/sockets/Exception.cpp b/dep/src/sockets/Exception.cpp
deleted file mode 100644
index a005669e4..000000000
--- a/dep/src/sockets/Exception.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- ** \file Exception.cpp
- ** \date 2007-09-28
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2007 Anders Hedstrom
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef _MSC_VER
-#pragma warning(disable:4786)
-#endif
-#include "Exception.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-
-Exception::Exception(const std::string& description) : m_description(description)
-{
-}
-
-
-const std::string Exception::ToString() const
-{
- return m_description;
-}
-
-
-#ifdef SOCKETS_NAMESPACE
-} // namespace SOCKETS_NAMESPACE {
-#endif
-
diff --git a/dep/src/sockets/Ipv4Address.cpp b/dep/src/sockets/Ipv4Address.cpp
deleted file mode 100644
index 58f25e53b..000000000
--- a/dep/src/sockets/Ipv4Address.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/**
- ** \file Ipv4Address.cpp
- ** \date 2006-09-21
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2007 Anders Hedstrom
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#include "Ipv4Address.h"
-#include "Utility.h"
-#include "Parse.h"
-#ifndef _WIN32
-#include
-#endif
-
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-
-Ipv4Address::Ipv4Address(port_t port) : m_valid(true)
-{
- memset(&m_addr, 0, sizeof(m_addr));
- m_addr.sin_family = AF_INET;
- m_addr.sin_port = htons( port );
-}
-
-
-Ipv4Address::Ipv4Address(ipaddr_t a,port_t port) : m_valid(true)
-{
- memset(&m_addr, 0, sizeof(m_addr));
- m_addr.sin_family = AF_INET;
- m_addr.sin_port = htons( port );
- memcpy(&m_addr.sin_addr, &a, sizeof(struct in_addr));
-}
-
-
-Ipv4Address::Ipv4Address(struct in_addr& a,port_t port) : m_valid(true)
-{
- memset(&m_addr, 0, sizeof(m_addr));
- m_addr.sin_family = AF_INET;
- m_addr.sin_port = htons( port );
- m_addr.sin_addr = a;
-}
-
-
-Ipv4Address::Ipv4Address(const std::string& host,port_t port) : m_valid(false)
-{
- memset(&m_addr, 0, sizeof(m_addr));
- m_addr.sin_family = AF_INET;
- m_addr.sin_port = htons( port );
- {
- ipaddr_t a;
- if (Utility::u2ip(host, a))
- {
- memcpy(&m_addr.sin_addr, &a, sizeof(struct in_addr));
- m_valid = true;
- }
- }
-}
-
-
-Ipv4Address::Ipv4Address(struct sockaddr_in& sa)
-{
- m_addr = sa;
- m_valid = sa.sin_family == AF_INET;
-}
-
-
-Ipv4Address::~Ipv4Address()
-{
-}
-
-
-Ipv4Address::operator struct sockaddr *()
-{
- return (struct sockaddr *)&m_addr;
-}
-
-
-Ipv4Address::operator socklen_t()
-{
- return sizeof(struct sockaddr_in);
-}
-
-
-void Ipv4Address::SetPort(port_t port)
-{
- m_addr.sin_port = htons( port );
-}
-
-
-port_t Ipv4Address::GetPort()
-{
- return ntohs( m_addr.sin_port );
-}
-
-
-bool Ipv4Address::Resolve(const std::string& hostname,struct in_addr& a)
-{
- struct sockaddr_in sa;
- memset(&a, 0, sizeof(a));
- if (Utility::isipv4(hostname))
- {
- if (!Utility::u2ip(hostname, sa, AI_NUMERICHOST))
- return false;
- a = sa.sin_addr;
- return true;
- }
- if (!Utility::u2ip(hostname, sa))
- return false;
- a = sa.sin_addr;
- return true;
-}
-
-
-bool Ipv4Address::Reverse(struct in_addr& a,std::string& name)
-{
- struct sockaddr_in sa;
- memset(&sa, 0, sizeof(sa));
- sa.sin_family = AF_INET;
- sa.sin_addr = a;
- return Utility::reverse((struct sockaddr *)&sa, sizeof(sa), name);
-}
-
-
-std::string Ipv4Address::Convert(bool include_port)
-{
- if (include_port)
- return Convert(m_addr.sin_addr) + ":" + Utility::l2string(GetPort());
- return Convert(m_addr.sin_addr);
-}
-
-
-std::string Ipv4Address::Convert(struct in_addr& a)
-{
- struct sockaddr_in sa;
- memset(&sa, 0, sizeof(sa));
- sa.sin_family = AF_INET;
- sa.sin_addr = a;
- std::string name;
- Utility::reverse((struct sockaddr *)&sa, sizeof(sa), name, NI_NUMERICHOST);
- return name;
-}
-
-
-void Ipv4Address::SetAddress(struct sockaddr *sa)
-{
- memcpy(&m_addr, sa, sizeof(struct sockaddr_in));
-}
-
-
-int Ipv4Address::GetFamily()
-{
- return m_addr.sin_family;
-}
-
-
-bool Ipv4Address::IsValid()
-{
- return m_valid;
-}
-
-
-bool Ipv4Address::operator==(SocketAddress& a)
-{
- if (a.GetFamily() != GetFamily())
- return false;
- if ((socklen_t)a != sizeof(m_addr))
- return false;
- struct sockaddr *sa = a;
- struct sockaddr_in *p = (struct sockaddr_in *)sa;
- if (p -> sin_port != m_addr.sin_port)
- return false;
- if (memcmp(&p -> sin_addr, &m_addr.sin_addr, 4))
- return false;
- return true;
-}
-
-
-std::auto_ptr Ipv4Address::GetCopy()
-{
- return std::auto_ptr(new Ipv4Address(m_addr));
-}
-
-
-std::string Ipv4Address::Reverse()
-{
- std::string tmp;
- Reverse(m_addr.sin_addr, tmp);
- return tmp;
-}
-
-
-#ifdef SOCKETS_NAMESPACE
-} // namespace SOCKETS_NAMESPACE {
-#endif
-
diff --git a/dep/src/sockets/Ipv6Address.cpp b/dep/src/sockets/Ipv6Address.cpp
deleted file mode 100644
index 2e0f1e9ac..000000000
--- a/dep/src/sockets/Ipv6Address.cpp
+++ /dev/null
@@ -1,270 +0,0 @@
-/**
- ** \file Ipv6Address.cpp
- ** \date 2006-09-21
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2007 Anders Hedstrom
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#include "Ipv6Address.h"
-#ifdef ENABLE_IPV6
-
-#include "Utility.h"
-#include "Parse.h"
-#ifndef _WIN32
-#include
-#endif
-#ifdef IPPROTO_IPV6
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-Ipv6Address::Ipv6Address(port_t port) : m_valid(true)
-{
- memset(&m_addr, 0, sizeof(m_addr));
- m_addr.sin6_family = AF_INET6;
- m_addr.sin6_port = htons( port );
-}
-
-
-Ipv6Address::Ipv6Address(struct in6_addr& a,port_t port) : m_valid(true)
-{
- memset(&m_addr, 0, sizeof(m_addr));
- m_addr.sin6_family = AF_INET6;
- m_addr.sin6_port = htons( port );
- m_addr.sin6_addr = a;
-}
-
-
-Ipv6Address::Ipv6Address(const std::string& host,port_t port) : m_valid(false)
-{
- memset(&m_addr, 0, sizeof(m_addr));
- m_addr.sin6_family = AF_INET6;
- m_addr.sin6_port = htons( port );
- {
- struct in6_addr a;
- if (Utility::u2ip(host, a))
- {
- m_addr.sin6_addr = a;
- m_valid = true;
- }
- }
-}
-
-
-Ipv6Address::Ipv6Address(struct sockaddr_in6& sa)
-{
- m_addr = sa;
- m_valid = sa.sin6_family == AF_INET6;
-}
-
-
-Ipv6Address::~Ipv6Address()
-{
-}
-
-
-Ipv6Address::operator struct sockaddr *()
-{
- return (struct sockaddr *)&m_addr;
-}
-
-
-Ipv6Address::operator socklen_t()
-{
- return sizeof(struct sockaddr_in6);
-}
-
-
-void Ipv6Address::SetPort(port_t port)
-{
- m_addr.sin6_port = htons( port );
-}
-
-
-port_t Ipv6Address::GetPort()
-{
- return ntohs( m_addr.sin6_port );
-}
-
-
-bool Ipv6Address::Resolve(const std::string& hostname,struct in6_addr& a)
-{
- struct sockaddr_in6 sa;
- memset(&a, 0, sizeof(a));
- if (Utility::isipv6(hostname))
- {
- if (!Utility::u2ip(hostname, sa, AI_NUMERICHOST))
- return false;
- a = sa.sin6_addr;
- return true;
- }
- if (!Utility::u2ip(hostname, sa))
- return false;
- a = sa.sin6_addr;
- return true;
-}
-
-
-bool Ipv6Address::Reverse(struct in6_addr& a,std::string& name)
-{
- struct sockaddr_in6 sa;
- memset(&sa, 0, sizeof(sa));
- sa.sin6_family = AF_INET6;
- sa.sin6_addr = a;
- return Utility::reverse((struct sockaddr *)&sa, sizeof(sa), name);
-}
-
-
-std::string Ipv6Address::Convert(bool include_port)
-{
- if (include_port)
- return Convert(m_addr.sin6_addr) + ":" + Utility::l2string(GetPort());
- return Convert(m_addr.sin6_addr);
-}
-
-
-std::string Ipv6Address::Convert(struct in6_addr& a,bool mixed)
-{
- char slask[100]; // l2ip temporary
- *slask = 0;
- unsigned int prev = 0;
- bool skipped = false;
- bool ok_to_skip = true;
- if (mixed)
- {
- unsigned short x;
- unsigned short addr16[8];
- memcpy(addr16, &a, sizeof(addr16));
- for (size_t i = 0; i < 6; i++)
- {
- x = ntohs(addr16[i]);
- if (*slask && (x || !ok_to_skip || prev))
- strcat(slask,":");
- if (x || !ok_to_skip)
- {
- sprintf(slask + strlen(slask),"%x", x);
- if (x && skipped)
- ok_to_skip = false;
- }
- else
- {
- skipped = true;
- }
- prev = x;
- }
- x = ntohs(addr16[6]);
- sprintf(slask + strlen(slask),":%u.%u",x / 256,x & 255);
- x = ntohs(addr16[7]);
- sprintf(slask + strlen(slask),".%u.%u",x / 256,x & 255);
- }
- else
- {
- struct sockaddr_in6 sa;
- memset(&sa, 0, sizeof(sa));
- sa.sin6_family = AF_INET6;
- sa.sin6_addr = a;
- std::string name;
- Utility::reverse((struct sockaddr *)&sa, sizeof(sa), name, NI_NUMERICHOST);
- return name;
- }
- return slask;
-}
-
-
-void Ipv6Address::SetAddress(struct sockaddr *sa)
-{
- memcpy(&m_addr, sa, sizeof(struct sockaddr_in6));
-}
-
-
-int Ipv6Address::GetFamily()
-{
- return m_addr.sin6_family;
-}
-
-
-void Ipv6Address::SetFlowinfo(uint32_t x)
-{
- m_addr.sin6_flowinfo = x;
-}
-
-
-uint32_t Ipv6Address::GetFlowinfo()
-{
- return m_addr.sin6_flowinfo;
-}
-
-
-#ifndef _WIN32
-void Ipv6Address::SetScopeId(uint32_t x)
-{
- m_addr.sin6_scope_id = x;
-}
-
-
-uint32_t Ipv6Address::GetScopeId()
-{
- return m_addr.sin6_scope_id;
-}
-#endif
-
-
-bool Ipv6Address::IsValid()
-{
- return m_valid;
-}
-
-
-bool Ipv6Address::operator==(SocketAddress& a)
-{
- if (a.GetFamily() != GetFamily())
- return false;
- if ((socklen_t)a != sizeof(m_addr))
- return false;
- struct sockaddr *sa = a;
- struct sockaddr_in6 *p = (struct sockaddr_in6 *)sa;
- if (p -> sin6_port != m_addr.sin6_port)
- return false;
- if (memcmp(&p -> sin6_addr, &m_addr.sin6_addr, sizeof(struct in6_addr)))
- return false;
- return true;
-}
-
-
-std::auto_ptr Ipv6Address::GetCopy()
-{
- return std::auto_ptr(new Ipv6Address(m_addr));
-}
-
-
-std::string Ipv6Address::Reverse()
-{
- std::string tmp;
- Reverse(m_addr.sin6_addr, tmp);
- return tmp;
-}
-
-
-#ifdef SOCKETS_NAMESPACE
-} // namespace SOCKETS_NAMESPACE {
-#endif
-#endif // IPPROTO_IPV6
-#endif // ENABLE_IPV6
-
diff --git a/dep/src/sockets/Lock.cpp b/dep/src/sockets/Lock.cpp
deleted file mode 100644
index 3f7902e23..000000000
--- a/dep/src/sockets/Lock.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/** \file Lock.cpp
- ** \date 2005-08-22
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2005,2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#include "Mutex.h"
-#include "Lock.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-Lock::Lock(Mutex& m) : m_mutex(m)
-{
- m_mutex.Lock();
-}
-
-
-Lock::~Lock()
-{
- m_mutex.Unlock();
-}
-
-
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
diff --git a/dep/src/sockets/Makefile.am b/dep/src/sockets/Makefile.am
deleted file mode 100644
index d4f1ad21c..000000000
--- a/dep/src/sockets/Makefile.am
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright (C) 2005-2010 MaNGOS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-## Process this file with automake to produce Makefile.in
-
-## Sub-directories to parse
-
-## CPP flags for includes, defines, etc.
-AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/../../include/sockets
-
-## Build MaNGOS shared library and its parts as convenience library.
-# All libraries will be convenience libraries. Might be changed to shared
-# later.
-noinst_LIBRARIES = libmangossockets.a
-
-libmangossockets_a_SOURCES = \
- Base64.cpp \
- Exception.cpp \
- Ipv4Address.cpp \
- Ipv6Address.cpp \
- Lock.cpp \
- Mutex.cpp \
- Parse.cpp \
- ResolvServer.cpp \
- ResolvSocket.cpp \
- Socket.cpp \
- SocketHandler.cpp \
- StdoutLog.cpp \
- StreamSocket.cpp \
- TcpSocket.cpp \
- Thread.cpp \
- UdpSocket.cpp \
- Utility.cpp \
- socket_include.cpp
diff --git a/dep/src/sockets/Mutex.cpp b/dep/src/sockets/Mutex.cpp
deleted file mode 100644
index f7a03c7d9..000000000
--- a/dep/src/sockets/Mutex.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/** \file Mutex.cpp
- ** \date 2004-10-30
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#include "Mutex.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-Mutex::Mutex()
-{
-#ifdef _WIN32
- m_mutex = ::CreateMutex(NULL, FALSE, NULL);
-#else
- pthread_mutex_init(&m_mutex, NULL);
-#endif
-}
-
-
-Mutex::~Mutex()
-{
-#ifdef _WIN32
- ::CloseHandle(m_mutex);
-#else
- pthread_mutex_destroy(&m_mutex);
-#endif
-}
-
-
-void Mutex::Lock()
-{
-#ifdef _WIN32
- /*DWORD d =*/ WaitForSingleObject(m_mutex, INFINITE);
- /// \todo check 'd' for result
-#else
- pthread_mutex_lock(&m_mutex);
-#endif
-}
-
-
-void Mutex::Unlock()
-{
-#ifdef _WIN32
- ::ReleaseMutex(m_mutex);
-#else
- pthread_mutex_unlock(&m_mutex);
-#endif
-}
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
diff --git a/dep/src/sockets/Parse.cpp b/dep/src/sockets/Parse.cpp
deleted file mode 100644
index 58122c0c9..000000000
--- a/dep/src/sockets/Parse.cpp
+++ /dev/null
@@ -1,321 +0,0 @@
-/** \file Parse.cpp - parse a string
- **
- ** Written: 1999-Feb-10 grymse@alhem.net
- **/
-
-/*
-Copyright (C) 1999-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#include
-#include
-
-#include "Parse.h"
-
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-/* implementation of class Parse */
-
-Parse::Parse()
-:pa_the_str("")
-,pa_splits("")
-,pa_ord("")
-,pa_the_ptr(0)
-,pa_breakchar(0)
-,pa_enable(0)
-,pa_disable(0)
-,pa_nospace(0)
-,pa_quote(false)
-{
-}
-
-Parse::Parse(const std::string&s)
-:pa_the_str(s)
-,pa_splits("")
-,pa_ord("")
-,pa_the_ptr(0)
-,pa_breakchar(0)
-,pa_enable(0)
-,pa_disable(0)
-,pa_nospace(0)
-,pa_quote(false)
-{
-}
-
-Parse::Parse(const std::string&s,const std::string&sp)
-:pa_the_str(s)
-,pa_splits(sp)
-,pa_ord("")
-,pa_the_ptr(0)
-,pa_breakchar(0)
-,pa_enable(0)
-,pa_disable(0)
-,pa_nospace(0)
-,pa_quote(false)
-{
-}
-
-Parse::Parse(const std::string&s,const std::string&sp,short /*nospace*/)
-:pa_the_str(s)
-,pa_splits(sp)
-,pa_ord("")
-,pa_the_ptr(0)
-,pa_breakchar(0)
-,pa_enable(0)
-,pa_disable(0)
-,pa_nospace(1)
-,pa_quote(false)
-{
-}
-
-
-Parse::~Parse()
-{
-}
-
-#define C ((pa_the_ptr l(h);
-
- if (l.Bind("127.0.0.1", m_port))
- {
- return;
- }
- h.Add(&l);
-
- m_ready = true;
- while (!m_quit && IsRunning() )
- {
- h.Select(0, 500000);
- }
- SetRunning(false);
-}
-
-
-void ResolvServer::Quit()
-{
- m_quit = true;
-}
-
-
-bool ResolvServer::Ready()
-{
- return m_ready;
-}
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // ENABLE_RESOLVER
-
diff --git a/dep/src/sockets/ResolvSocket.cpp b/dep/src/sockets/ResolvSocket.cpp
deleted file mode 100644
index 2d9d31d5a..000000000
--- a/dep/src/sockets/ResolvSocket.cpp
+++ /dev/null
@@ -1,436 +0,0 @@
-/** \file ResolvSocket.cpp
- ** \date 2005-03-24
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef _WIN32
-#ifdef _MSC_VER
-#pragma warning(disable:4786)
-#pragma warning(disable:4503)
-#endif
-#else
-#include
-#endif
-#include "ResolvSocket.h"
-#ifdef ENABLE_RESOLVER
-#include "Utility.h"
-#include "Parse.h"
-#include "ISocketHandler.h"
-#include "Lock.h"
-#include "Mutex.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-//#ifdef _DEBUG
-//#define DEB(x) x
-//#else
-#define DEB(x)
-//#endif
-
-
-// static
-ResolvSocket::cache_t ResolvSocket::m_cache;
-ResolvSocket::timeout_t ResolvSocket::m_cache_to;
-Mutex ResolvSocket::m_cache_mutex;
-
-
-ResolvSocket::ResolvSocket(ISocketHandler& h)
-:TcpSocket(h)
-,m_bServer(false)
-,m_parent(NULL)
-#ifdef ENABLE_IPV6
-,m_resolve_ipv6(false)
-#endif
-,m_cached(false)
-{
- SetLineProtocol();
-}
-
-
-ResolvSocket::ResolvSocket(ISocketHandler& h, Socket *parent, const std::string& host, port_t port, bool ipv6)
-:TcpSocket(h)
-,m_bServer(false)
-,m_parent(parent)
-,m_resolv_host(host)
-,m_resolv_port(port)
-#ifdef ENABLE_IPV6
-,m_resolve_ipv6(ipv6)
-#endif
-,m_cached(false)
-{
- SetLineProtocol();
-}
-
-
-ResolvSocket::ResolvSocket(ISocketHandler& h, Socket *parent, ipaddr_t a)
-:TcpSocket(h)
-,m_bServer(false)
-,m_parent(parent)
-,m_resolv_port(0)
-,m_resolv_address(a)
-#ifdef ENABLE_IPV6
-,m_resolve_ipv6(false)
-#endif
-,m_cached(false)
-{
- SetLineProtocol();
-}
-
-
-#ifdef ENABLE_IPV6
-ResolvSocket::ResolvSocket(ISocketHandler& h, Socket *parent, in6_addr& a)
-:TcpSocket(h)
-,m_bServer(false)
-,m_parent(parent)
-,m_resolv_port(0)
-,m_resolve_ipv6(true)
-,m_resolv_address6(a)
-,m_cached(false)
-{
- SetLineProtocol();
-}
-#endif
-
-
-ResolvSocket::~ResolvSocket()
-{
-}
-
-
-void ResolvSocket::OnLine(const std::string& line)
-{
- Parse pa(line, ":");
- if (m_bServer)
- {
- m_query = pa.getword();
- m_data = pa.getrest();
-DEB( fprintf(stderr, " *** ResolvSocket server; query=%s, data=%s\n", m_query.c_str(), m_data.c_str());)
- // %! check cache
- {
- Lock lock(m_cache_mutex);
- if (m_cache[m_query].find(m_data) != m_cache[m_query].end())
- {
- if (time(NULL) - m_cache_to[m_query][m_data] < 3600) // ttl
- {
- std::string result = m_cache[m_query][m_data];
-DEB(fprintf(stderr, " *** Returning cache for [%s][%s] = '%s'\n", m_query.c_str(), m_data.c_str(), result.c_str());)
- Send("Cached\n");
- if (!result.size()) /* failed */
- {
- Send("Failed\n\n");
- SetCloseAndDelete();
- return;
- }
- else
- if (m_query == "gethostbyname")
- {
- Send("A: " + result + "\n\n");
- SetCloseAndDelete();
- return;
- }
- else
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (m_query == "gethostbyname2")
- {
- Send("AAAA: " + result + "\n\n");
- SetCloseAndDelete();
- return;
- }
- else
-#endif
-#endif
- if (m_query == "gethostbyaddr")
- {
- Send("Name: " + result + "\n\n");
- SetCloseAndDelete();
- return;
- }
- }
- }
- }
- if (!Detach()) // detach failed?
- {
- SetCloseAndDelete();
- }
- return;
- }
- std::string key = pa.getword();
- std::string value = pa.getrest();
-DEB( fprintf(stderr, " *** ResolvSocket response; %s: %s\n", key.c_str(), value.c_str());)
-
- if (key == "Cached")
- {
- m_cached = true;
- }
- else
- if (key == "Failed" && m_parent)
- {
-DEB( fprintf(stderr, " ************ Resolve failed\n");)
- if (Handler().Resolving(m_parent) || Handler().Valid(m_parent))
- {
- m_parent -> OnResolveFailed(m_resolv_id);
- }
- // update cache
- if (!m_cached)
- {
- Lock lock(m_cache_mutex);
-DEB(fprintf(stderr, " *** Update cache for [%s][%s] = '%s'\n", m_query.c_str(), m_data.c_str(), value.c_str());)
- m_cache[m_query][m_data] = value;
- m_cache_to[m_query][m_data] = time(NULL);
- }
- m_parent = NULL;
- }
- else
- if (key == "Name" && !m_resolv_host.size() && m_parent)
- {
- if (Handler().Resolving(m_parent) || Handler().Valid(m_parent))
- {
- m_parent -> OnReverseResolved(m_resolv_id, value);
- }
- // update cache
- if (!m_cached)
- {
- Lock lock(m_cache_mutex);
-DEB(fprintf(stderr, " *** Update cache for [%s][%s] = '%s'\n", m_query.c_str(), m_data.c_str(), value.c_str());)
- m_cache[m_query][m_data] = value;
- m_cache_to[m_query][m_data] = time(NULL);
- }
- m_parent = NULL;
- }
- else
- if (key == "A" && m_parent)
- {
- if (Handler().Resolving(m_parent) || Handler().Valid(m_parent))
- {
- ipaddr_t l;
- Utility::u2ip(value, l); // ip2ipaddr_t
- m_parent -> OnResolved(m_resolv_id, l, m_resolv_port);
- }
- // update cache
- if (!m_cached)
- {
- Lock lock(m_cache_mutex);
-DEB(fprintf(stderr, " *** Update cache for [%s][%s] = '%s'\n", m_query.c_str(), m_data.c_str(), value.c_str());)
- m_cache[m_query][m_data] = value;
- m_cache_to[m_query][m_data] = time(NULL);
- }
- m_parent = NULL; // always use first ip in case there are several
- }
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- else
- if (key == "AAAA" && m_parent)
- {
- if (Handler().Resolving(m_parent) || Handler().Valid(m_parent))
- {
- in6_addr a;
- Utility::u2ip(value, a);
- m_parent -> OnResolved(m_resolv_id, a, m_resolv_port);
- }
- // update cache
- if (!m_cached)
- {
- Lock lock(m_cache_mutex);
-DEB(fprintf(stderr, " *** Update cache for [%s][%s] = '%s'\n", m_query.c_str(), m_data.c_str(), value.c_str());)
- m_cache[m_query][m_data] = value;
- m_cache_to[m_query][m_data] = time(NULL);
- }
- m_parent = NULL;
- }
-#endif
-#endif
-}
-
-
-void ResolvSocket::OnDetached()
-{
-DEB( fprintf(stderr, " *** ResolvSocket::OnDetached(); query=%s, data=%s\n", m_query.c_str(), m_data.c_str());)
- if (m_query == "gethostbyname")
- {
- struct sockaddr_in sa;
- if (Utility::u2ip(m_data, sa))
- {
- std::string ip;
- Utility::l2ip(sa.sin_addr, ip);
- Send("A: " + ip + "\n");
- }
- else
- {
- Send("Failed\n");
- }
- Send("\n");
- }
- else
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (m_query == "gethostbyname2")
- {
- struct sockaddr_in6 sa;
- if (Utility::u2ip(m_data, sa))
- {
- std::string ip;
- Utility::l2ip(sa.sin6_addr, ip);
- Send("AAAA: " + ip + "\n");
- }
- else
- {
- Send("Failed\n");
- }
- Send("\n");
- }
- else
-#endif
-#endif
- if (m_query == "gethostbyaddr")
- {
- if (Utility::isipv4( m_data ))
- {
- struct sockaddr_in sa;
- if (!Utility::u2ip(m_data, sa, AI_NUMERICHOST))
- {
- Send("Failed: convert to sockaddr_in failed\n");
- }
- else
- {
- std::string name;
- if (!Utility::reverse( (struct sockaddr *)&sa, sizeof(sa), name))
- {
- Send("Failed: ipv4 reverse lookup of " + m_data + "\n");
- }
- else
- {
- Send("Name: " + name + "\n");
- }
- }
- }
- else
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (Utility::isipv6( m_data ))
- {
- struct sockaddr_in6 sa;
- if (!Utility::u2ip(m_data, sa, AI_NUMERICHOST))
- {
- Send("Failed: convert to sockaddr_in6 failed\n");
- }
- else
- {
- std::string name;
- if (!Utility::reverse( (struct sockaddr *)&sa, sizeof(sa), name))
- {
- Send("Failed: ipv6 reverse lookup of " + m_data + "\n");
- }
- else
- {
- Send("Name: " + name + "\n");
- }
- }
- }
- else
-#endif
-#endif
- {
- Send("Failed: malformed address\n");
- }
- Send("\n");
- }
- else
- {
- std::string msg = "Unknown query type: " + m_query;
- Handler().LogError(this, "OnDetached", 0, msg);
- Send("Unknown\n\n");
- }
- SetCloseAndDelete();
-}
-
-
-void ResolvSocket::OnConnect()
-{
- if (!m_resolv_host.empty())
- {
-#ifdef ENABLE_IPV6
- std::string msg = (m_resolve_ipv6 ? "gethostbyname2 " : "gethostbyname ") + m_resolv_host + "\n";
- m_query = m_resolve_ipv6 ? "gethostbyname2" : "gethostbyname";
-#else
- std::string msg = "gethostbyname " + m_resolv_host + "\n";
- m_query = "gethostbyname";
-#endif
- m_data = m_resolv_host;
- Send( msg );
- return;
- }
-#ifdef ENABLE_IPV6
- if (m_resolve_ipv6)
- {
- std::string tmp;
- Utility::l2ip(m_resolv_address6, tmp);
- m_query = "gethostbyaddr";
- m_data = tmp;
- std::string msg = "gethostbyaddr " + tmp + "\n";
- Send( msg );
- }
-#endif
- std::string tmp;
- Utility::l2ip(m_resolv_address, tmp);
- m_query = "gethostbyaddr";
- m_data = tmp;
- std::string msg = "gethostbyaddr " + tmp + "\n";
- Send( msg );
-}
-
-
-void ResolvSocket::OnDelete()
-{
- if (m_parent)
- {
- if (Handler().Resolving(m_parent) || Handler().Valid(m_parent))
- {
- m_parent -> OnResolveFailed(m_resolv_id);
- }
- // update cache
- if (!m_cached)
- {
- Lock lock(m_cache_mutex);
- std::string value;
-DEB(fprintf(stderr, " *** Update cache for [%s][%s] = '%s'\n", m_query.c_str(), m_data.c_str(), value.c_str());)
- m_cache[m_query][m_data] = value;
- m_cache_to[m_query][m_data] = time(NULL);
- }
- m_parent = NULL;
- }
-}
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // ENABLE_RESOLVER
-
diff --git a/dep/src/sockets/Socket.cpp b/dep/src/sockets/Socket.cpp
deleted file mode 100644
index 883363eb1..000000000
--- a/dep/src/sockets/Socket.cpp
+++ /dev/null
@@ -1,1898 +0,0 @@
-/** \file Socket.cpp
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#include "Socket.h"
-#ifdef _WIN32
-#ifdef _MSC_VER
-#pragma warning(disable:4786)
-#endif
-#include
-#else
-#include
-#include
-#endif
-#include
-#include
-
-#include "ISocketHandler.h"
-#include "Utility.h"
-
-#include "SocketAddress.h"
-#include "SocketHandler.h"
-#ifdef ENABLE_EXCEPTIONS
-#include "Exception.h"
-#endif
-#include "Ipv4Address.h"
-
-//#ifdef _DEBUG
-//#define DEB(x) x; fflush(stderr);
-//#else
-#define DEB(x)
-//#endif
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-// statics
-#ifdef _WIN32
-WSAInitializer Socket::m_winsock_init;
-#endif
-
-
-Socket::Socket(ISocketHandler& h)
-//:m_flags(0)
-:m_handler(h)
-,m_socket( INVALID_SOCKET )
-,m_bDel(false)
-,m_bClose(false)
-,m_tCreate(time(NULL))
-,m_parent(NULL)
-,m_b_disable_read(false)
-,m_connected(false)
-,m_b_erased_by_handler(false)
-,m_tClose(0)
-,m_client_remote_address(NULL)
-,m_remote_address(NULL)
-,m_traffic_monitor(NULL)
-,m_bLost(false)
-#ifdef HAVE_OPENSSL
-,m_b_enable_ssl(false)
-,m_b_ssl(false)
-,m_b_ssl_server(false)
-#endif
-#ifdef ENABLE_IPV6
-,m_ipv6(false)
-#endif
-#ifdef ENABLE_POOL
-,m_socket_type(0)
-,m_bClient(false)
-,m_bRetain(false)
-#endif
-#ifdef ENABLE_SOCKS4
-,m_bSocks4(false)
-,m_socks4_host(h.GetSocks4Host())
-,m_socks4_port(h.GetSocks4Port())
-,m_socks4_userid(h.GetSocks4Userid())
-#endif
-#ifdef ENABLE_DETACH
-,m_detach(false)
-,m_detached(false)
-,m_pThread(NULL)
-,m_slave_handler(NULL)
-#endif
-{
-}
-
-
-Socket::~Socket()
-{
- Handler().Remove(this);
- if (m_socket != INVALID_SOCKET
-#ifdef ENABLE_POOL
- && !m_bRetain
-#endif
- )
- {
- Close();
- }
-}
-
-
-void Socket::Init()
-{
-}
-
-
-void Socket::OnRead()
-{
-}
-
-
-void Socket::OnWrite()
-{
-}
-
-
-void Socket::OnException()
-{
- // %! exception doesn't always mean something bad happened, this code should be reworked
- // errno valid here?
- int err = SoError();
- Handler().LogError(this, "exception on select", err, StrError(err), LOG_LEVEL_FATAL);
- SetCloseAndDelete();
-}
-
-
-void Socket::OnDelete()
-{
-}
-
-
-void Socket::OnConnect()
-{
-}
-
-
-void Socket::OnAccept()
-{
-}
-
-
-int Socket::Close()
-{
- if (m_socket == INVALID_SOCKET) // this could happen
- {
- Handler().LogError(this, "Socket::Close", 0, "file descriptor invalid", LOG_LEVEL_WARNING);
- return 0;
- }
- int n;
- if ((n = closesocket(m_socket)) == -1)
- {
- // failed...
- Handler().LogError(this, "close", Errno, StrError(Errno), LOG_LEVEL_ERROR);
- }
- Handler().Set(m_socket, false, false, false); // remove from fd_set's
- Handler().AddList(m_socket, LIST_CALLONCONNECT, false);
-#ifdef ENABLE_DETACH
- Handler().AddList(m_socket, LIST_DETACH, false);
-#endif
- Handler().AddList(m_socket, LIST_TIMEOUT, false);
- Handler().AddList(m_socket, LIST_RETRY, false);
- Handler().AddList(m_socket, LIST_CLOSE, false);
- m_socket = INVALID_SOCKET;
- return n;
-}
-
-
-SOCKET Socket::CreateSocket(int af,int type, const std::string& protocol)
-{
- struct protoent *p = NULL;
- SOCKET s;
-
-#ifdef ENABLE_POOL
- m_socket_type = type;
- m_socket_protocol = protocol;
-#endif
- if (!protocol.empty())
- {
- p = getprotobyname( protocol.c_str() );
- if (!p)
- {
- Handler().LogError(this, "getprotobyname", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- SetCloseAndDelete();
-#ifdef ENABLE_EXCEPTIONS
- throw Exception(std::string("getprotobyname() failed: ") + StrError(Errno));
-#endif
- return INVALID_SOCKET;
- }
- }
- int protno = p ? p -> p_proto : 0;
-
- s = socket(af, type, protno);
- if (s == INVALID_SOCKET)
- {
- Handler().LogError(this, "socket", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- SetCloseAndDelete();
-#ifdef ENABLE_EXCEPTIONS
- throw Exception(std::string("socket() failed: ") + StrError(Errno));
-#endif
- return INVALID_SOCKET;
- }
- Attach(s);
- OnOptions(af, type, protno, s);
- Attach(INVALID_SOCKET);
- return s;
-}
-
-
-void Socket::Attach(SOCKET s)
-{
- m_socket = s;
-}
-
-
-SOCKET Socket::GetSocket()
-{
- return m_socket;
-}
-
-
-void Socket::SetDeleteByHandler(bool x)
-{
- m_bDel = x;
-}
-
-
-bool Socket::DeleteByHandler()
-{
- return m_bDel;
-}
-
-
-void Socket::SetCloseAndDelete(bool x)
-{
- if (x != m_bClose)
- {
- Handler().AddList(m_socket, LIST_CLOSE, x);
- m_bClose = x;
- if (x)
- {
- m_tClose = time(NULL);
- }
- }
-}
-
-
-bool Socket::CloseAndDelete()
-{
- return m_bClose;
-}
-
-
-void Socket::SetRemoteAddress(SocketAddress& ad) //struct sockaddr* sa, socklen_t l)
-{
- m_remote_address = ad.GetCopy();
-}
-
-
-std::auto_ptr Socket::GetRemoteSocketAddress()
-{
- return m_remote_address -> GetCopy();
-}
-
-
-ISocketHandler& Socket::Handler() const
-{
-#ifdef ENABLE_DETACH
- if (IsDetached())
- return *m_slave_handler;
-#endif
- return m_handler;
-}
-
-
-ISocketHandler& Socket::MasterHandler() const
-{
- return m_handler;
-}
-
-
-ipaddr_t Socket::GetRemoteIP4()
-{
- ipaddr_t l = 0;
-#ifdef ENABLE_IPV6
- if (m_ipv6)
- {
- Handler().LogError(this, "GetRemoteIP4", 0, "get ipv4 address for ipv6 socket", LOG_LEVEL_WARNING);
- }
-#endif
- if (m_remote_address.get() != NULL)
- {
- struct sockaddr *p = *m_remote_address;
- struct sockaddr_in *sa = (struct sockaddr_in *)p;
- memcpy(&l, &sa -> sin_addr, sizeof(struct in_addr));
- }
- return l;
-}
-
-
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
-struct in6_addr Socket::GetRemoteIP6()
-{
- if (!m_ipv6)
- {
- Handler().LogError(this, "GetRemoteIP6", 0, "get ipv6 address for ipv4 socket", LOG_LEVEL_WARNING);
- }
- struct sockaddr_in6 fail;
- if (m_remote_address.get() != NULL)
- {
- struct sockaddr *p = *m_remote_address;
- memcpy(&fail, p, sizeof(struct sockaddr_in6));
- }
- else
- {
- memset(&fail, 0, sizeof(struct sockaddr_in6));
- }
- return fail.sin6_addr;
-}
-#endif
-#endif
-
-
-port_t Socket::GetRemotePort()
-{
- if (!m_remote_address.get())
- {
- return 0;
- }
- return m_remote_address -> GetPort();
-}
-
-
-std::string Socket::GetRemoteAddress()
-{
- if (!m_remote_address.get())
- {
- return "";
- }
- return m_remote_address -> Convert(false);
-}
-
-
-std::string Socket::GetRemoteHostname()
-{
- if (!m_remote_address.get())
- {
- return "";
- }
- return m_remote_address -> Reverse();
-}
-
-
-bool Socket::SetNonblocking(bool bNb)
-{
-#ifdef _WIN32
- unsigned long l = bNb ? 1 : 0;
- int n = ioctlsocket(m_socket, FIONBIO, &l);
- if (n != 0)
- {
- Handler().LogError(this, "ioctlsocket(FIONBIO)", Errno, "");
- return false;
- }
- return true;
-#else
- if (bNb)
- {
- if (fcntl(m_socket, F_SETFL, O_NONBLOCK) == -1)
- {
- Handler().LogError(this, "fcntl(F_SETFL, O_NONBLOCK)", Errno, StrError(Errno), LOG_LEVEL_ERROR);
- return false;
- }
- }
- else
- {
- if (fcntl(m_socket, F_SETFL, 0) == -1)
- {
- Handler().LogError(this, "fcntl(F_SETFL, 0)", Errno, StrError(Errno), LOG_LEVEL_ERROR);
- return false;
- }
- }
- return true;
-#endif
-}
-
-
-bool Socket::SetNonblocking(bool bNb, SOCKET s)
-{
-#ifdef _WIN32
- unsigned long l = bNb ? 1 : 0;
- int n = ioctlsocket(s, FIONBIO, &l);
- if (n != 0)
- {
- Handler().LogError(this, "ioctlsocket(FIONBIO)", Errno, "");
- return false;
- }
- return true;
-#else
- if (bNb)
- {
- if (fcntl(s, F_SETFL, O_NONBLOCK) == -1)
- {
- Handler().LogError(this, "fcntl(F_SETFL, O_NONBLOCK)", Errno, StrError(Errno), LOG_LEVEL_ERROR);
- return false;
- }
- }
- else
- {
- if (fcntl(s, F_SETFL, 0) == -1)
- {
- Handler().LogError(this, "fcntl(F_SETFL, 0)", Errno, StrError(Errno), LOG_LEVEL_ERROR);
- return false;
- }
- }
- return true;
-#endif
-}
-
-
-void Socket::Set(bool bRead, bool bWrite, bool bException)
-{
- Handler().Set(m_socket, bRead, bWrite, bException);
-}
-
-
-bool Socket::Ready()
-{
- if (m_socket != INVALID_SOCKET && !CloseAndDelete())
- return true;
- return false;
-}
-
-
-void Socket::OnLine(const std::string& )
-{
-}
-
-
-void Socket::OnConnectFailed()
-{
-}
-
-
-Socket *Socket::GetParent()
-{
- return m_parent;
-}
-
-
-void Socket::SetParent(Socket *x)
-{
- m_parent = x;
-}
-
-
-port_t Socket::GetPort()
-{
- Handler().LogError(this, "GetPort", 0, "GetPort only implemented for ListenSocket", LOG_LEVEL_WARNING);
- return 0;
-}
-
-
-bool Socket::OnConnectRetry()
-{
- return true;
-}
-
-
-#ifdef ENABLE_RECONNECT
-void Socket::OnReconnect()
-{
-}
-#endif
-
-
-time_t Socket::Uptime()
-{
- return time(NULL) - m_tCreate;
-}
-
-
-#ifdef ENABLE_IPV6
-void Socket::SetIpv6(bool x)
-{
- m_ipv6 = x;
-}
-
-
-bool Socket::IsIpv6()
-{
- return m_ipv6;
-}
-#endif
-
-
-void Socket::DisableRead(bool x)
-{
- m_b_disable_read = x;
-}
-
-
-bool Socket::IsDisableRead()
-{
- return m_b_disable_read;
-}
-
-
-void Socket::SendBuf(const char *,size_t,int)
-{
-}
-
-
-void Socket::Send(const std::string&,int)
-{
-}
-
-
-void Socket::SetConnected(bool x)
-{
- m_connected = x;
-}
-
-
-bool Socket::IsConnected()
-{
- return m_connected;
-}
-
-
-void Socket::OnDisconnect()
-{
-}
-
-
-void Socket::SetLost()
-{
- m_bLost = true;
-}
-
-
-bool Socket::Lost()
-{
- return m_bLost;
-}
-
-
-void Socket::SetErasedByHandler(bool x)
-{
- m_b_erased_by_handler = x;
-}
-
-
-bool Socket::ErasedByHandler()
-{
- return m_b_erased_by_handler;
-}
-
-
-time_t Socket::TimeSinceClose()
-{
- return time(NULL) - m_tClose;
-}
-
-
-void Socket::SetClientRemoteAddress(SocketAddress& ad)
-{
- if (!ad.IsValid())
- {
- Handler().LogError(this, "SetClientRemoteAddress", 0, "remote address not valid", LOG_LEVEL_ERROR);
- }
- m_client_remote_address = ad.GetCopy();
-}
-
-
-std::auto_ptr Socket::GetClientRemoteAddress()
-{
- if (!m_client_remote_address.get())
- {
- Handler().LogError(this, "GetClientRemoteAddress", 0, "remote address not yet set", LOG_LEVEL_ERROR);
- }
- return m_client_remote_address -> GetCopy();
-}
-
-
-uint64_t Socket::GetBytesSent(bool)
-{
- return 0;
-}
-
-
-uint64_t Socket::GetBytesReceived(bool)
-{
- return 0;
-}
-
-
-#ifdef HAVE_OPENSSL
-void Socket::OnSSLConnect()
-{
-}
-
-
-void Socket::OnSSLAccept()
-{
-}
-
-
-bool Socket::SSLNegotiate()
-{
- return false;
-}
-
-
-bool Socket::IsSSL()
-{
- return m_b_enable_ssl;
-}
-
-
-void Socket::EnableSSL(bool x)
-{
- m_b_enable_ssl = x;
-}
-
-
-bool Socket::IsSSLNegotiate()
-{
- return m_b_ssl;
-}
-
-
-void Socket::SetSSLNegotiate(bool x)
-{
- m_b_ssl = x;
-}
-
-
-bool Socket::IsSSLServer()
-{
- return m_b_ssl_server;
-}
-
-
-void Socket::SetSSLServer(bool x)
-{
- m_b_ssl_server = x;
-}
-
-
-void Socket::OnSSLConnectFailed()
-{
-}
-
-
-void Socket::OnSSLAcceptFailed()
-{
-}
-#endif // HAVE_OPENSSL
-
-
-#ifdef ENABLE_POOL
-void Socket::CopyConnection(Socket *sock)
-{
- Attach( sock -> GetSocket() );
-#ifdef ENABLE_IPV6
- SetIpv6( sock -> IsIpv6() );
-#endif
- SetSocketType( sock -> GetSocketType() );
- SetSocketProtocol( sock -> GetSocketProtocol() );
-
- SetClientRemoteAddress( *sock -> GetClientRemoteAddress() );
- SetRemoteAddress( *sock -> GetRemoteSocketAddress() );
-}
-
-
-void Socket::SetIsClient()
-{
- m_bClient = true;
-}
-
-
-void Socket::SetSocketType(int x)
-{
- m_socket_type = x;
-}
-
-
-int Socket::GetSocketType()
-{
- return m_socket_type;
-}
-
-
-void Socket::SetSocketProtocol(const std::string& x)
-{
- m_socket_protocol = x;
-}
-
-
-const std::string& Socket::GetSocketProtocol()
-{
- return m_socket_protocol;
-}
-
-
-void Socket::SetRetain()
-{
- if (m_bClient) m_bRetain = true;
-}
-
-
-bool Socket::Retain()
-{
- return m_bRetain;
-}
-
-
-#endif // ENABLE_POOL
-
-
-#ifdef ENABLE_SOCKS4
-void Socket::OnSocks4Connect()
-{
- Handler().LogError(this, "OnSocks4Connect", 0, "Use with TcpSocket only");
-}
-
-
-void Socket::OnSocks4ConnectFailed()
-{
- Handler().LogError(this, "OnSocks4ConnectFailed", 0, "Use with TcpSocket only");
-}
-
-
-bool Socket::OnSocks4Read()
-{
- Handler().LogError(this, "OnSocks4Read", 0, "Use with TcpSocket only");
- return true;
-}
-
-
-void Socket::SetSocks4Host(const std::string& host)
-{
- Utility::u2ip(host, m_socks4_host);
-}
-
-
-bool Socket::Socks4()
-{
- return m_bSocks4;
-}
-
-
-void Socket::SetSocks4(bool x)
-{
- m_bSocks4 = x;
-}
-
-
-void Socket::SetSocks4Host(ipaddr_t a)
-{
- m_socks4_host = a;
-}
-
-
-void Socket::SetSocks4Port(port_t p)
-{
- m_socks4_port = p;
-}
-
-
-void Socket::SetSocks4Userid(const std::string& x)
-{
- m_socks4_userid = x;
-}
-
-
-ipaddr_t Socket::GetSocks4Host()
-{
- return m_socks4_host;
-}
-
-
-port_t Socket::GetSocks4Port()
-{
- return m_socks4_port;
-}
-
-
-const std::string& Socket::GetSocks4Userid()
-{
- return m_socks4_userid;
-}
-#endif // ENABLE_SOCKS4
-
-
-#ifdef ENABLE_DETACH
-bool Socket::Detach()
-{
- if (!DeleteByHandler())
- return false;
- if (m_pThread)
- return false;
- if (m_detached)
- return false;
- SetDetach();
- return true;
-}
-
-
-void Socket::DetachSocket()
-{
- SetDetached();
- m_pThread = new SocketThread(this);
- m_pThread -> SetRelease(true);
-}
-
-
-void Socket::OnDetached()
-{
-}
-
-
-void Socket::SetDetach(bool x)
-{
- Handler().AddList(m_socket, LIST_DETACH, x);
- m_detach = x;
-}
-
-
-bool Socket::IsDetach()
-{
- return m_detach;
-}
-
-
-void Socket::SetDetached(bool x)
-{
- m_detached = x;
-}
-
-
-const bool Socket::IsDetached() const
-{
- return m_detached;
-}
-
-
-void Socket::SetSlaveHandler(ISocketHandler *p)
-{
- m_slave_handler = p;
-}
-
-
-Socket::SocketThread::SocketThread(Socket *p)
-:Thread(false)
-,m_socket(p)
-{
- // Creator will release
-}
-
-
-Socket::SocketThread::~SocketThread()
-{
- if (IsRunning())
- {
- SetRelease(true);
- SetRunning(false);
-#ifdef _WIN32
- Sleep(1000);
-#else
- sleep(1);
-#endif
- }
-}
-
-
-void Socket::SocketThread::Run()
-{
- SocketHandler h;
- h.SetSlave();
- h.Add(m_socket);
- m_socket -> SetSlaveHandler(&h);
- m_socket -> OnDetached();
- while (h.GetCount() && IsRunning())
- {
- h.Select(0, 500000);
- }
- // m_socket now deleted oops
- // yeah oops m_socket delete its socket thread, that means this
- // so Socket will no longer delete its socket thread, instead we do this:
- SetDeleteOnExit();
-}
-#endif // ENABLE_DETACH
-
-
-#ifdef ENABLE_RESOLVER
-int Socket::Resolve(const std::string& host,port_t port)
-{
- return Handler().Resolve(this, host, port);
-}
-
-
-#ifdef ENABLE_IPV6
-int Socket::Resolve6(const std::string& host,port_t port)
-{
- return Handler().Resolve6(this, host, port);
-}
-#endif
-
-
-int Socket::Resolve(ipaddr_t a)
-{
- return Handler().Resolve(this, a);
-}
-
-
-#ifdef ENABLE_IPV6
-int Socket::Resolve(in6_addr& a)
-{
- return Handler().Resolve(this, a);
-}
-#endif
-
-
-void Socket::OnResolved(int,ipaddr_t,port_t)
-{
-}
-
-
-#ifdef ENABLE_IPV6
-void Socket::OnResolved(int,in6_addr&,port_t)
-{
-}
-#endif
-
-
-void Socket::OnReverseResolved(int,const std::string&)
-{
-}
-
-
-void Socket::OnResolveFailed(int)
-{
-}
-#endif // ENABLE_RESOLVER
-
-
-/* IP options */
-
-
-bool Socket::SetIpOptions(const void *p, socklen_t len)
-{
-#ifdef IP_OPTIONS
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_OPTIONS, (char *)p, len) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_OPTIONS)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "ip option not available", 0, "IP_OPTIONS", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-#ifdef IP_PKTINFO
-bool Socket::SetIpPktinfo(bool x)
-{
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_PKTINFO, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_PKTINFO)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-#ifdef IP_RECVTOS
-bool Socket::SetIpRecvTOS(bool x)
-{
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_RECVTOS, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_RECVTOS)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-#ifdef IP_RECVTTL
-bool Socket::SetIpRecvTTL(bool x)
-{
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_RECVTTL, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_RECVTTL)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-#ifdef IP_RECVOPTS
-bool Socket::SetIpRecvopts(bool x)
-{
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_RECVOPTS, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_RECVOPTS)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-#ifdef IP_RETOPTS
-bool Socket::SetIpRetopts(bool x)
-{
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_RETOPTS, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_RETOPTS)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-bool Socket::SetIpTOS(unsigned char tos)
-{
-#ifdef IP_TOS
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(tos)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_TOS)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "ip option not available", 0, "IP_TOS", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-unsigned char Socket::IpTOS()
-{
- unsigned char tos = 0;
-#ifdef IP_TOS
- socklen_t len = sizeof(tos);
- if (getsockopt(GetSocket(), IPPROTO_IP, IP_TOS, (char *)&tos, &len) == -1)
- {
- Handler().LogError(this, "getsockopt(IPPROTO_IP, IP_TOS)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- }
-#else
- Handler().LogError(this, "ip option not available", 0, "IP_TOS", LOG_LEVEL_INFO);
-#endif
- return tos;
-}
-
-
-bool Socket::SetIpTTL(int ttl)
-{
-#ifdef IP_TTL
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_TTL, (char *)&ttl, sizeof(ttl)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_TTL)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "ip option not available", 0, "IP_TTL", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-int Socket::IpTTL()
-{
- int ttl = 0;
-#ifdef IP_TTL
- socklen_t len = sizeof(ttl);
- if (getsockopt(GetSocket(), IPPROTO_IP, IP_TTL, (char *)&ttl, &len) == -1)
- {
- Handler().LogError(this, "getsockopt(IPPROTO_IP, IP_TTL)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- }
-#else
- Handler().LogError(this, "ip option not available", 0, "IP_TTL", LOG_LEVEL_INFO);
-#endif
- return ttl;
-}
-
-
-bool Socket::SetIpHdrincl(bool x)
-{
-#ifdef IP_HDRINCL
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_HDRINCL, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_HDRINCL)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "ip option not available", 0, "IP_HDRINCL", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-#ifdef IP_RECVERR
-bool Socket::SetIpRecverr(bool x)
-{
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_RECVERR, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_RECVERR)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-#ifdef IP_MTU_DISCOVER
-bool Socket::SetIpMtudiscover(bool x)
-{
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_MTU_DISCOVER, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_MTU_DISCOVER)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-#ifdef IP_MTU
-int Socket::IpMtu()
-{
- int mtu = 0;
- socklen_t len = sizeof(mtu);
- if (getsockopt(GetSocket(), IPPROTO_IP, IP_MTU, (char *)&mtu, &len) == -1)
- {
- Handler().LogError(this, "getsockopt(IPPROTO_IP, IP_MTU)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- }
- return mtu;
-}
-#endif
-
-
-#ifdef IP_ROUTER_ALERT
-bool Socket::SetIpRouterAlert(bool x)
-{
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_ROUTER_ALERT, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_ROUTER_ALERT)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-bool Socket::SetIpMulticastTTL(int ttl)
-{
-#ifdef IP_MULTICAST_TTL
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_MULTICAST_TTL, (char *)&ttl, sizeof(ttl)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_MULTICAST_TTL)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "ip option not available", 0, "IP_MULTICAST_TTL", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-int Socket::IpMulticastTTL()
-{
- int ttl = 0;
-#ifdef IP_MULTICAST_TTL
- socklen_t len = sizeof(ttl);
- if (getsockopt(GetSocket(), IPPROTO_IP, IP_MULTICAST_TTL, (char *)&ttl, &len) == -1)
- {
- Handler().LogError(this, "getsockopt(IPPROTO_IP, IP_MULTICAST_TTL)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- }
-#else
- Handler().LogError(this, "ip option not available", 0, "IP_MULTICAST_TTL", LOG_LEVEL_INFO);
-#endif
- return ttl;
-}
-
-
-bool Socket::SetMulticastLoop(bool x)
-{
-#ifdef IP_MULTICAST_LOOP
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_MULTICAST_LOOP, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_MULTICAST_LOOP)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "ip option not available", 0, "IP_MULTICAST_LOOP", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-#ifdef LINUX
-bool Socket::IpAddMembership(struct ip_mreqn& ref)
-{
-#ifdef IP_ADD_MEMBERSHIP
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&ref, sizeof(struct ip_mreqn)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_ADD_MEMBERSHIP)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "ip option not available", 0, "IP_ADD_MEMBERSHIP", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-#endif
-
-
-bool Socket::IpAddMembership(struct ip_mreq& ref)
-{
-#ifdef IP_ADD_MEMBERSHIP
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&ref, sizeof(struct ip_mreq)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_ADD_MEMBERSHIP)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "ip option not available", 0, "IP_ADD_MEMBERSHIP", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-#ifdef LINUX
-bool Socket::IpDropMembership(struct ip_mreqn& ref)
-{
-#ifdef IP_DROP_MEMBERSHIP
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_DROP_MEMBERSHIP, (char *)&ref, sizeof(struct ip_mreqn)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_DROP_MEMBERSHIP)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "ip option not available", 0, "IP_DROP_MEMBERSHIP", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-#endif
-
-
-bool Socket::IpDropMembership(struct ip_mreq& ref)
-{
-#ifdef IP_DROP_MEMBERSHIP
- if (setsockopt(GetSocket(), IPPROTO_IP, IP_DROP_MEMBERSHIP, (char *)&ref, sizeof(struct ip_mreq)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_IP, IP_DROP_MEMBERSHIP)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "ip option not available", 0, "IP_DROP_MEMBERSHIP", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-/* SOCKET options */
-
-
-bool Socket::SetSoReuseaddr(bool x)
-{
-#ifdef SO_REUSEADDR
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_REUSEADDR, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_REUSEADDR)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_REUSEADDR", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-bool Socket::SetSoKeepalive(bool x)
-{
-#ifdef SO_KEEPALIVE
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_KEEPALIVE, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_KEEPALIVE)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_KEEPALIVE", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-#ifdef SO_NOSIGPIPE
-bool Socket::SetSoNosigpipe(bool x)
-{
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_NOSIGPIPE, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_NOSIGPIPE)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-bool Socket::SoAcceptconn()
-{
- int value = 0;
-#ifdef SO_ACCEPTCONN
- socklen_t len = sizeof(value);
- if (getsockopt(GetSocket(), SOL_SOCKET, SO_ACCEPTCONN, (char *)&value, &len) == -1)
- {
- Handler().LogError(this, "getsockopt(SOL_SOCKET, SO_ACCEPTCONN)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- }
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_ACCEPTCONN", LOG_LEVEL_INFO);
-#endif
- return value ? true : false;
-}
-
-
-#ifdef SO_BSDCOMPAT
-bool Socket::SetSoBsdcompat(bool x)
-{
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_BSDCOMPAT, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_BSDCOMPAT)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-#ifdef SO_BINDTODEVICE
-bool Socket::SetSoBindtodevice(const std::string& intf)
-{
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_BINDTODEVICE, (char *)intf.c_str(), intf.size()) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_BINDTODEVICE)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-bool Socket::SetSoBroadcast(bool x)
-{
-#ifdef SO_BROADCAST
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_BROADCAST, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_BROADCAST)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_BROADCAST", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-bool Socket::SetSoDebug(bool x)
-{
-#ifdef SO_DEBUG
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_DEBUG, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_DEBUG)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_DEBUG", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-int Socket::SoError()
-{
- int value = 0;
-#ifdef SO_ERROR
- socklen_t len = sizeof(value);
- if (getsockopt(GetSocket(), SOL_SOCKET, SO_ERROR, (char *)&value, &len) == -1)
- {
- Handler().LogError(this, "getsockopt(SOL_SOCKET, SO_ERROR)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- }
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_ERROR", LOG_LEVEL_INFO);
-#endif
- return value;
-}
-
-
-bool Socket::SetSoDontroute(bool x)
-{
-#ifdef SO_DONTROUTE
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_DONTROUTE, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_DONTROUTE)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_DONTROUTE", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-bool Socket::SetSoLinger(int onoff, int linger)
-{
-#ifdef SO_LINGER
- struct linger stl;
- stl.l_onoff = onoff;
- stl.l_linger = linger;
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_LINGER, (char *)&stl, sizeof(stl)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_LINGER)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_LINGER", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-bool Socket::SetSoOobinline(bool x)
-{
-#ifdef SO_OOBINLINE
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_OOBINLINE, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_OOBINLINE)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_OOBINLINE", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-#ifdef SO_PASSCRED
-bool Socket::SetSoPasscred(bool x)
-{
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_PASSCRED, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_PASSCRED)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-#ifdef SO_PEERCRED
-bool Socket::SoPeercred(struct ucred& ucr)
-{
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_PEERCRED, (char *)&ucr, sizeof(ucr)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_PEERCRED)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-#ifdef SO_PRIORITY
-bool Socket::SetSoPriority(int x)
-{
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_PRIORITY, (char *)&x, sizeof(x)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_PRIORITY)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-bool Socket::SetSoRcvlowat(int x)
-{
-#ifdef SO_RCVLOWAT
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_RCVLOWAT, (char *)&x, sizeof(x)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_RCVLOWAT)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_RCVLOWAT", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-bool Socket::SetSoSndlowat(int x)
-{
-#ifdef SO_SNDLOWAT
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_SNDLOWAT, (char *)&x, sizeof(x)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_SNDLOWAT)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_SNDLOWAT", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-bool Socket::SetSoRcvtimeo(struct timeval& tv)
-{
-#ifdef SO_RCVTIMEO
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(tv)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_RCVTIMEO)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_RCVTIMEO", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-bool Socket::SetSoSndtimeo(struct timeval& tv)
-{
-#ifdef SO_SNDTIMEO
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(tv)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_SNDTIMEO)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_SNDTIMEO", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-bool Socket::SetSoRcvbuf(int x)
-{
-#ifdef SO_RCVBUF
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_RCVBUF, (char *)&x, sizeof(x)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_RCVBUF)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_RCVBUF", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-int Socket::SoRcvbuf()
-{
- int value = 0;
-#ifdef SO_RCVBUF
- socklen_t len = sizeof(value);
- if (getsockopt(GetSocket(), SOL_SOCKET, SO_RCVBUF, (char *)&value, &len) == -1)
- {
- Handler().LogError(this, "getsockopt(SOL_SOCKET, SO_RCVBUF)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- }
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_RCVBUF", LOG_LEVEL_INFO);
-#endif
- return value;
-}
-
-
-#ifdef SO_RCVBUFFORCE
-bool Socket::SetSoRcvbufforce(int x)
-{
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_RCVBUFFORCE, (char *)&x, sizeof(x)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_RCVBUFFORCE)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-bool Socket::SetSoSndbuf(int x)
-{
-#ifdef SO_SNDBUF
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_SNDBUF, (char *)&x, sizeof(x)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_SNDBUF)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_SNDBUF", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-int Socket::SoSndbuf()
-{
- int value = 0;
-#ifdef SO_SNDBUF
- socklen_t len = sizeof(value);
- if (getsockopt(GetSocket(), SOL_SOCKET, SO_SNDBUF, (char *)&value, &len) == -1)
- {
- Handler().LogError(this, "getsockopt(SOL_SOCKET, SO_SNDBUF)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- }
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_SNDBUF", LOG_LEVEL_INFO);
-#endif
- return value;
-}
-
-
-#ifdef SO_SNDBUFFORCE
-bool Socket::SetSoSndbufforce(int x)
-{
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_SNDBUFFORCE, (char *)&x, sizeof(x)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_SNDBUFFORCE)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-#ifdef SO_TIMESTAMP
-bool Socket::SetSoTimestamp(bool x)
-{
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_TIMESTAMP, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(SOL_SOCKET, SO_TIMESTAMP)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-}
-#endif
-
-
-int Socket::SoType()
-{
- int value = 0;
-#ifdef SO_TYPE
- socklen_t len = sizeof(value);
- if (getsockopt(GetSocket(), SOL_SOCKET, SO_TYPE, (char *)&value, &len) == -1)
- {
- Handler().LogError(this, "getsockopt(SOL_SOCKET, SO_TYPE)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- }
-#else
- Handler().LogError(this, "socket option not available", 0, "SO_TYPE", LOG_LEVEL_INFO);
-#endif
- return value;
-}
-
-
-#ifdef ENABLE_TRIGGERS
-void Socket::Subscribe(int id)
-{
- Handler().Subscribe(id, this);
-}
-
-
-void Socket::Unsubscribe(int id)
-{
- Handler().Unsubscribe(id, this);
-}
-
-
-void Socket::OnTrigger(int, const TriggerData&)
-{
-}
-
-
-void Socket::OnCancelled(int)
-{
-}
-#endif
-
-
-void Socket::SetTimeout(time_t secs)
-{
- if (!secs)
- {
- Handler().AddList(m_socket, LIST_TIMEOUT, false);
- return;
- }
- Handler().AddList(m_socket, LIST_TIMEOUT, true);
- m_timeout_start = time(NULL);
- m_timeout_limit = secs;
-}
-
-
-void Socket::OnTimeout()
-{
-}
-
-
-void Socket::OnConnectTimeout()
-{
-}
-
-
-bool Socket::Timeout(time_t tnow)
-{
- if (tnow - m_timeout_start > m_timeout_limit)
- return true;
- return false;
-}
-
-
-/** Returns local port number for bound socket file descriptor. */
-port_t Socket::GetSockPort()
-{
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- struct sockaddr_in6 sa;
- socklen_t sockaddr_length = sizeof(struct sockaddr_in6);
- if (getsockname(GetSocket(), (struct sockaddr *)&sa, (socklen_t*)&sockaddr_length) == -1)
- memset(&sa, 0, sizeof(sa));
- return ntohs(sa.sin6_port);
- }
-#endif
-#endif
- struct sockaddr_in sa;
- socklen_t sockaddr_length = sizeof(struct sockaddr_in);
- if (getsockname(GetSocket(), (struct sockaddr *)&sa, (socklen_t*)&sockaddr_length) == -1)
- memset(&sa, 0, sizeof(sa));
- return ntohs(sa.sin_port);
-}
-
-
-/** Returns local ipv4 address for bound socket file descriptor. */
-ipaddr_t Socket::GetSockIP4()
-{
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- return 0;
- }
-#endif
-#endif
- struct sockaddr_in sa;
- socklen_t sockaddr_length = sizeof(struct sockaddr_in);
- if (getsockname(GetSocket(), (struct sockaddr *)&sa, (socklen_t*)&sockaddr_length) == -1)
- memset(&sa, 0, sizeof(sa));
- ipaddr_t a;
- memcpy(&a, &sa.sin_addr, 4);
- return a;
-}
-
-
-/** Returns local ipv4 address as text for bound socket file descriptor. */
-std::string Socket::GetSockAddress()
-{
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- return "";
- }
-#endif
-#endif
- struct sockaddr_in sa;
- socklen_t sockaddr_length = sizeof(struct sockaddr_in);
- if (getsockname(GetSocket(), (struct sockaddr *)&sa, (socklen_t*)&sockaddr_length) == -1)
- memset(&sa, 0, sizeof(sa));
- Ipv4Address addr( sa );
- return addr.Convert();
-}
-
-
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
-/** Returns local ipv6 address for bound socket file descriptor. */
-struct in6_addr Socket::GetSockIP6()
-{
- if (IsIpv6())
- {
- struct sockaddr_in6 sa;
- socklen_t sockaddr_length = sizeof(struct sockaddr_in6);
- if (getsockname(GetSocket(), (struct sockaddr *)&sa, (socklen_t*)&sockaddr_length) == -1)
- memset(&sa, 0, sizeof(sa));
- return sa.sin6_addr;
- }
- struct in6_addr a;
- memset(&a, 0, sizeof(a));
- return a;
-}
-
-
-/** Returns local ipv6 address as text for bound socket file descriptor. */
-std::string Socket::GetSockAddress6()
-{
- if (IsIpv6())
- {
- struct sockaddr_in6 sa;
- socklen_t sockaddr_length = sizeof(struct sockaddr_in6);
- if (getsockname(GetSocket(), (struct sockaddr *)&sa, (socklen_t*)&sockaddr_length) == -1)
- memset(&sa, 0, sizeof(sa));
- Ipv6Address addr( sa );
- return addr.Convert();
- }
- return "";
-}
-#endif
-#endif
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
diff --git a/dep/src/sockets/SocketHandler.cpp b/dep/src/sockets/SocketHandler.cpp
deleted file mode 100644
index f2a4f7c30..000000000
--- a/dep/src/sockets/SocketHandler.cpp
+++ /dev/null
@@ -1,1423 +0,0 @@
-/** \file SocketHandler.cpp
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef _WIN32
-#ifdef _MSC_VER
-#pragma warning(disable:4786)
-#endif
-#endif
-#include
-#include
-#include
-
-#include "SocketHandler.h"
-#include "UdpSocket.h"
-#include "ResolvSocket.h"
-#include "ResolvServer.h"
-#include "TcpSocket.h"
-#include "Mutex.h"
-#include "Utility.h"
-#include "SocketAddress.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-//#ifdef _DEBUG
-//#define DEB(x) x; fflush(stderr);
-//#else
-#define DEB(x)
-//#endif
-
-
-SocketHandler::SocketHandler(StdLog *p)
-:m_stdlog(p)
-,m_mutex(m_mutex)
-,m_b_use_mutex(false)
-,m_maxsock(0)
-,m_preverror(-1)
-,m_errcnt(0)
-,m_tlast(0)
-#ifdef ENABLE_SOCKS4
-,m_socks4_host(0)
-,m_socks4_port(0)
-,m_bTryDirect(false)
-#endif
-#ifdef ENABLE_RESOLVER
-,m_resolv_id(0)
-,m_resolver(NULL)
-#endif
-#ifdef ENABLE_POOL
-,m_b_enable_pool(false)
-#endif
-#ifdef ENABLE_TRIGGERS
-,m_next_trigger_id(0)
-#endif
-#ifdef ENABLE_DETACH
-,m_slave(false)
-#endif
-{
- FD_ZERO(&m_rfds);
- FD_ZERO(&m_wfds);
- FD_ZERO(&m_efds);
-}
-
-
-SocketHandler::SocketHandler(Mutex& mutex,StdLog *p)
-:m_stdlog(p)
-,m_mutex(mutex)
-,m_b_use_mutex(true)
-,m_maxsock(0)
-,m_preverror(-1)
-,m_errcnt(0)
-,m_tlast(0)
-#ifdef ENABLE_SOCKS4
-,m_socks4_host(0)
-,m_socks4_port(0)
-,m_bTryDirect(false)
-#endif
-#ifdef ENABLE_RESOLVER
-,m_resolv_id(0)
-,m_resolver(NULL)
-#endif
-#ifdef ENABLE_POOL
-,m_b_enable_pool(false)
-#endif
-#ifdef ENABLE_TRIGGERS
-,m_next_trigger_id(0)
-#endif
-#ifdef ENABLE_DETACH
-,m_slave(false)
-#endif
-{
- m_mutex.Lock();
- FD_ZERO(&m_rfds);
- FD_ZERO(&m_wfds);
- FD_ZERO(&m_efds);
-}
-
-
-SocketHandler::~SocketHandler()
-{
-#ifdef ENABLE_RESOLVER
- if (m_resolver)
- {
- m_resolver -> Quit();
- }
-#endif
- {
- while (m_sockets.size())
- {
-DEB( fprintf(stderr, "Emptying sockets list in SocketHandler destructor, %d instances\n", (int)m_sockets.size());)
- socket_m::iterator it = m_sockets.begin();
- Socket *p = it -> second;
- if (p)
- {
-DEB( fprintf(stderr, " fd %d\n", p -> GetSocket());)
- p -> Close();
-DEB( fprintf(stderr, " fd closed %d\n", p -> GetSocket());)
-// p -> OnDelete(); // hey, I turn this back on. what's the worst that could happen??!!
- // MinionSocket breaks, calling MinderHandler methods in OnDelete -
- // MinderHandler is already gone when that happens...
-
- // only delete socket when controlled
- // ie master sockethandler can delete non-detached sockets
- // and a slave sockethandler can only delete a detach socket
- if (p -> DeleteByHandler()
-#ifdef ENABLE_DETACH
- && !(m_slave ^ p -> IsDetached())
-#endif
- )
- {
- p -> SetErasedByHandler();
- delete p;
- }
- m_sockets.erase(it);
- }
- else
- {
- m_sockets.erase(it);
- }
-DEB( fprintf(stderr, "next\n");)
- }
-DEB( fprintf(stderr, "/Emptying sockets list in SocketHandler destructor, %d instances\n", (int)m_sockets.size());)
- }
-#ifdef ENABLE_RESOLVER
- if (m_resolver)
- {
- delete m_resolver;
- }
-#endif
- if (m_b_use_mutex)
- {
- m_mutex.Unlock();
- }
-}
-
-
-Mutex& SocketHandler::GetMutex() const
-{
- return m_mutex;
-}
-
-
-#ifdef ENABLE_DETACH
-void SocketHandler::SetSlave(bool x)
-{
- m_slave = x;
-}
-
-
-bool SocketHandler::IsSlave()
-{
- return m_slave;
-}
-#endif
-
-
-void SocketHandler::RegStdLog(StdLog *log)
-{
- m_stdlog = log;
-}
-
-
-void SocketHandler::LogError(Socket *p,const std::string& user_text,int err,const std::string& sys_err,loglevel_t t)
-{
- if (m_stdlog)
- {
- m_stdlog -> error(this, p, user_text, err, sys_err, t);
- }
-}
-
-
-void SocketHandler::Add(Socket *p)
-{
- if (p -> GetSocket() == INVALID_SOCKET)
- {
- LogError(p, "Add", -1, "Invalid socket", LOG_LEVEL_WARNING);
- if (p -> CloseAndDelete())
- {
- m_delete.push_back(p);
- }
- return;
- }
- if (m_add.find(p -> GetSocket()) != m_add.end())
- {
- LogError(p, "Add", (int)p -> GetSocket(), "Attempt to add socket already in add queue", LOG_LEVEL_FATAL);
- m_delete.push_back(p);
- return;
- }
- m_add[p -> GetSocket()] = p;
-}
-
-
-void SocketHandler::Get(SOCKET s,bool& r,bool& w,bool& e)
-{
- if (s >= 0)
- {
- r = FD_ISSET(s, &m_rfds) ? true : false;
- w = FD_ISSET(s, &m_wfds) ? true : false;
- e = FD_ISSET(s, &m_efds) ? true : false;
- }
-}
-
-
-void SocketHandler::Set(SOCKET s,bool bRead,bool bWrite,bool bException)
-{
-DEB( fprintf(stderr, "Set(%d, %s, %s, %s)\n", s, bRead ? "true" : "false", bWrite ? "true" : "false", bException ? "true" : "false");)
- if (s >= 0)
- {
- if (bRead)
- {
- if (!FD_ISSET(s, &m_rfds))
- {
- FD_SET(s, &m_rfds);
- }
- }
- else
- {
- FD_CLR(s, &m_rfds);
- }
- if (bWrite)
- {
- if (!FD_ISSET(s, &m_wfds))
- {
- FD_SET(s, &m_wfds);
- }
- }
- else
- {
- FD_CLR(s, &m_wfds);
- }
- if (bException)
- {
- if (!FD_ISSET(s, &m_efds))
- {
- FD_SET(s, &m_efds);
- }
- }
- else
- {
- FD_CLR(s, &m_efds);
- }
- }
-}
-
-
-int SocketHandler::Select(long sec,long usec)
-{
- struct timeval tv;
- tv.tv_sec = sec;
- tv.tv_usec = usec;
- return Select(&tv);
-}
-
-
-int SocketHandler::Select()
-{
- if (!m_fds_callonconnect.empty() ||
-#ifdef ENABLE_DETACH
- (!m_slave && !m_fds_detach.empty()) ||
-#endif
- !m_fds_timeout.empty() ||
- !m_fds_retry.empty() ||
- !m_fds_close.empty() ||
- !m_fds_erase.empty())
- {
- return Select(0, 200000);
- }
- return Select(NULL);
-}
-
-
-int SocketHandler::Select(struct timeval *tsel)
-{
- size_t ignore = 0;
- while (m_add.size() > ignore)
- {
- if (m_sockets.size() >= FD_SETSIZE)
- {
- LogError(NULL, "Select", (int)m_sockets.size(), "FD_SETSIZE reached", LOG_LEVEL_WARNING);
- break;
- }
- socket_m::iterator it = m_add.begin();
- SOCKET s = it -> first;
- Socket *p = it -> second;
-DEB( fprintf(stderr, "Trying to add fd %d, m_add.size() %d, ignore %d\n", (int)s, (int)m_add.size(), (int)ignore);)
- //
- if (m_sockets.find(p -> GetSocket()) != m_sockets.end())
- {
- LogError(p, "Add", (int)p -> GetSocket(), "Attempt to add socket already in controlled queue", LOG_LEVEL_FATAL);
- // %! it's a dup, don't add to delete queue, just ignore it
- m_delete.push_back(p);
- m_add.erase(it);
-// ignore++;
- continue;
- }
- if (!p -> CloseAndDelete())
- {
- StreamSocket *scp = dynamic_cast(p);
- if (scp && scp -> Connecting()) // 'Open' called before adding socket
- {
- Set(s,false,true);
- }
- else
- {
- TcpSocket *tcp = dynamic_cast(p);
- bool bWrite = tcp ? tcp -> GetOutputLength() != 0 : false;
- if (p -> IsDisableRead())
- {
- Set(s, false, bWrite);
- }
- else
- {
- Set(s, true, bWrite);
- }
- }
- m_maxsock = (s > m_maxsock) ? s : m_maxsock;
- }
- else
- {
- LogError(p, "Add", (int)p -> GetSocket(), "Trying to add socket with SetCloseAndDelete() true", LOG_LEVEL_WARNING);
- }
- // only add to m_fds (process fd_set events) if
- // slave handler and detached/detaching socket
- // master handler and non-detached socket
-#ifdef ENABLE_DETACH
- if (!(m_slave ^ p -> IsDetach()))
-#endif
- {
- m_fds.push_back(s);
- }
- m_sockets[s] = p;
- //
- m_add.erase(it);
- }
-#ifdef MACOSX
- fd_set rfds;
- fd_set wfds;
- fd_set efds;
- FD_COPY(&m_rfds, &rfds);
- FD_COPY(&m_wfds, &wfds);
- FD_COPY(&m_efds, &efds);
-#else
- fd_set rfds = m_rfds;
- fd_set wfds = m_wfds;
- fd_set efds = m_efds;
-#endif
- int n;
- if (m_b_use_mutex)
- {
- m_mutex.Unlock();
- n = select( (int)(m_maxsock + 1),&rfds,&wfds,&efds,tsel);
- m_mutex.Lock();
- }
- else
- {
- n = select( (int)(m_maxsock + 1),&rfds,&wfds,&efds,tsel);
- }
- if (n == -1)
- {
- /*
- EBADF An invalid file descriptor was given in one of the sets.
- EINTR A non blocked signal was caught.
- EINVAL n is negative. Or struct timeval contains bad time values (<0).
- ENOMEM select was unable to allocate memory for internal tables.
- */
- if (Errno != m_preverror || m_errcnt++ % 10000 == 0)
- {
- LogError(NULL, "select", Errno, StrError(Errno));
-DEB( fprintf(stderr, "m_maxsock: %d\n", m_maxsock);
- fprintf(stderr, "%s\n", Errno == EINVAL ? "EINVAL" :
- Errno == EINTR ? "EINTR" :
- Errno == EBADF ? "EBADF" :
- Errno == ENOMEM ? "ENOMEM" : "");
- // test bad fd
- for (SOCKET i = 0; i <= m_maxsock; i++)
- {
- bool t = false;
- FD_ZERO(&rfds);
- FD_ZERO(&wfds);
- FD_ZERO(&efds);
- if (FD_ISSET(i, &m_rfds))
- {
- FD_SET(i, &rfds);
- t = true;
- }
- if (FD_ISSET(i, &m_wfds))
- {
- FD_SET(i, &wfds);
- t = true;
- }
- if (FD_ISSET(i, &m_efds))
- {
- FD_SET(i, &efds);
- t = true;
- }
- if (t && m_sockets.find(i) == m_sockets.end())
- {
- fprintf(stderr, "Bad fd in fd_set: %d\n", i);
- }
- }
-) // DEB
- m_preverror = Errno;
- }
- /// \todo rebuild fd_set's from active sockets list (m_sockets) here
- }
- else
- if (!n)
- {
- m_preverror = -1;
- }
- else
- if (n > 0)
- {
- for (socket_v::iterator it2 = m_fds.begin(); it2 != m_fds.end() && n; it2++)
- {
- SOCKET i = *it2;
- if (FD_ISSET(i, &rfds))
- {
- socket_m::iterator itmp = m_sockets.find(i);
- if (itmp != m_sockets.end()) // found
- {
- Socket *p = itmp -> second;
- // new SSL negotiate method
-#ifdef HAVE_OPENSSL
- if (p -> IsSSLNegotiate())
- {
- p -> SSLNegotiate();
- }
- else
-#endif
- {
- p -> OnRead();
- }
- }
- else
- {
- LogError(NULL, "GetSocket/handler/1", (int)i, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING);
- }
- n--;
- }
- if (FD_ISSET(i, &wfds))
- {
- socket_m::iterator itmp = m_sockets.find(i);
- if (itmp != m_sockets.end()) // found
- {
- Socket *p = itmp -> second;
- // new SSL negotiate method
-#ifdef HAVE_OPENSSL
- if (p -> IsSSLNegotiate())
- {
- p -> SSLNegotiate();
- }
- else
-#endif
- {
- p -> OnWrite();
- }
- }
- else
- {
- LogError(NULL, "GetSocket/handler/2", (int)i, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING);
- }
- n--;
- }
- if (FD_ISSET(i, &efds))
- {
- socket_m::iterator itmp = m_sockets.find(i);
- if (itmp != m_sockets.end()) // found
- {
- Socket *p = itmp -> second;
- p -> OnException();
- }
- else
- {
- LogError(NULL, "GetSocket/handler/3", (int)i, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING);
- }
- n--;
- }
- } // m_fds loop
- m_preverror = -1;
- } // if (n > 0)
-
- // check CallOnConnect - EVENT
- if (!m_fds_callonconnect.empty())
- {
- socket_v tmp = m_fds_callonconnect;
- for (socket_v::iterator it = tmp.begin(); it != tmp.end(); it++)
- {
- Socket *p = NULL;
- {
- socket_m::iterator itmp = m_sockets.find(*it);
- if (itmp != m_sockets.end()) // found
- {
- p = itmp -> second;
- }
- else
- {
- LogError(NULL, "GetSocket/handler/4", (int)*it, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING);
- }
- }
- if (p)
- {
-// if (p -> CallOnConnect() && p -> Ready() )
- {
- p -> SetConnected(); // moved here from inside if (tcp) check below
-#ifdef HAVE_OPENSSL
- if (p -> IsSSL()) // SSL Enabled socket
- p -> OnSSLConnect();
- else
-#endif
-#ifdef ENABLE_SOCKS4
- if (p -> Socks4())
- p -> OnSocks4Connect();
- else
-#endif
- {
- TcpSocket *tcp = dynamic_cast(p);
- if (tcp)
- {
- if (tcp -> GetOutputLength())
- {
- p -> OnWrite();
- }
- }
-#ifdef ENABLE_RECONNECT
- if (tcp && tcp -> IsReconnect())
- p -> OnReconnect();
- else
-#endif
- {
-// LogError(p, "Calling OnConnect", 0, "Because CallOnConnect", LOG_LEVEL_INFO);
- p -> OnConnect();
- }
- }
-// p -> SetCallOnConnect( false );
- AddList(p -> GetSocket(), LIST_CALLONCONNECT, false);
- }
- }
- }
- }
-#ifdef ENABLE_DETACH
- // check detach of socket if master handler - EVENT
- if (!m_slave && !m_fds_detach.empty())
- {
- // %! why not using tmp list here??!?
- for (socket_v::iterator it = m_fds_detach.begin(); it != m_fds_detach.end(); it++)
- {
- Socket *p = NULL;
- {
- socket_m::iterator itmp = m_sockets.find(*it);
- if (itmp != m_sockets.end()) // found
- {
- p = itmp -> second;
- }
- else
- {
- LogError(NULL, "GetSocket/handler/5", (int)*it, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING);
- }
- }
- if (p)
- {
-// if (p -> IsDetach())
- {
- Set(p -> GetSocket(), false, false, false);
- // After DetachSocket(), all calls to Handler() will return a reference
- // to the new slave SocketHandler running in the new thread.
- p -> DetachSocket();
- // Adding the file descriptor to m_fds_erase will now also remove the
- // socket from the detach queue - tnx knightmad
- m_fds_erase.push_back(p -> GetSocket());
- }
- }
- }
- }
-#endif
- // check Connecting - connection timeout - conditional event
- if (m_fds_timeout.size())
- {
- time_t tnow = time(NULL);
- if (tnow != m_tlast)
- {
- socket_v tmp = m_fds_timeout;
-DEB( fprintf(stderr, "Checking %d socket(s) for timeout\n", tmp.size());)
- for (socket_v::iterator it = tmp.begin(); it != tmp.end(); it++)
- {
- Socket *p = NULL;
- {
- socket_m::iterator itmp = m_sockets.find(*it);
- if (itmp != m_sockets.end()) // found
- {
- p = itmp -> second;
- }
- else
- {
- itmp = m_add.find(*it);
- if (itmp != m_add.end())
- {
- p = itmp -> second;
- }
- else
- {
- LogError(NULL, "GetSocket/handler/6", (int)*it, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING);
- }
- }
- }
- if (p)
- {
- if (p -> Timeout(tnow))
- {
- StreamSocket *scp = dynamic_cast(p);
- if (scp && scp -> Connecting())
- p -> OnConnectTimeout();
- else
- p -> OnTimeout();
- p -> SetTimeout(0);
- }
- }
- }
- m_tlast = tnow;
- } // tnow != tlast
- }
- // check retry client connect - EVENT
- if (!m_fds_retry.empty())
- {
- socket_v tmp = m_fds_retry;
- for (socket_v::iterator it = tmp.begin(); it != tmp.end(); it++)
- {
- Socket *p = NULL;
- {
- socket_m::iterator itmp = m_sockets.find(*it);
- if (itmp != m_sockets.end()) // found
- {
- p = itmp -> second;
- }
- else
- {
- LogError(NULL, "GetSocket/handler/7", (int)*it, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING);
- }
- }
- if (p)
- {
-// if (p -> RetryClientConnect())
- {
- TcpSocket *tcp = dynamic_cast(p);
- SOCKET nn = *it; //(*it3).first;
- tcp -> SetRetryClientConnect(false);
-DEB( fprintf(stderr, "Close() before retry client connect\n");)
- p -> Close(); // removes from m_fds_retry
- std::auto_ptr ad = p -> GetClientRemoteAddress();
- if (ad.get())
- {
- tcp -> Open(*ad);
- }
- else
- {
- LogError(p, "RetryClientConnect", 0, "no address", LOG_LEVEL_ERROR);
- }
- Add(p);
- m_fds_erase.push_back(nn);
- }
- }
- }
- }
- // check close and delete - conditional event
- if (!m_fds_close.empty())
- {
- socket_v tmp = m_fds_close;
-DEB( fprintf(stderr, "m_fds_close.size() == %d\n", (int)m_fds_close.size());)
- for (socket_v::iterator it = tmp.begin(); it != tmp.end(); it++)
- {
- Socket *p = NULL;
- {
- socket_m::iterator itmp = m_sockets.find(*it);
- if (itmp != m_sockets.end()) // found
- {
- p = itmp -> second;
- }
- else
- {
- itmp = m_add.find(*it);
- if (itmp != m_add.end())
- {
- p = itmp -> second;
- }
- else
- {
- LogError(NULL, "GetSocket/handler/8", (int)*it, "Did not find expected socket using file descriptor", LOG_LEVEL_WARNING);
- }
- }
- }
- if (p)
- {
-// if (p -> CloseAndDelete() )
- {
- TcpSocket *tcp = dynamic_cast(p);
- // new graceful tcp - flush and close timeout 5s
- if (tcp && p -> IsConnected() && tcp -> GetFlushBeforeClose() &&
-#ifdef HAVE_OPENSSL
- !tcp -> IsSSL() &&
-#endif
- p -> TimeSinceClose() < 5)
- {
-DEB( fprintf(stderr, " close(1)\n");)
- if (tcp -> GetOutputLength())
- {
- LogError(p, "Closing", (int)tcp -> GetOutputLength(), "Sending all data before closing", LOG_LEVEL_INFO);
- }
- else // shutdown write when output buffer is empty
- if (!(tcp -> GetShutdown() & SHUT_WR))
- {
- SOCKET nn = *it;
- if (nn != INVALID_SOCKET && shutdown(nn, SHUT_WR) == -1)
- {
- LogError(p, "graceful shutdown", Errno, StrError(Errno), LOG_LEVEL_ERROR);
- }
- tcp -> SetShutdown(SHUT_WR);
- }
- }
- else
-#ifdef ENABLE_RECONNECT
- if (tcp && p -> IsConnected() && tcp -> Reconnect())
- {
- SOCKET nn = *it; //(*it3).first;
-DEB( fprintf(stderr, " close(2) fd %d\n", nn);)
- p -> SetCloseAndDelete(false);
- tcp -> SetIsReconnect();
- p -> SetConnected(false);
-DEB( fprintf(stderr, "Close() before reconnect\n");)
- p -> Close(); // dispose of old file descriptor (Open creates a new)
- p -> OnDisconnect();
- std::auto_ptr ad = p -> GetClientRemoteAddress();
- if (ad.get())
- {
- tcp -> Open(*ad);
- }
- else
- {
- LogError(p, "Reconnect", 0, "no address", LOG_LEVEL_ERROR);
- }
- tcp -> ResetConnectionRetries();
- Add(p);
- m_fds_erase.push_back(nn);
- }
- else
-#endif
- {
- SOCKET nn = *it; //(*it3).first;
-DEB( fprintf(stderr, " close(3) fd %d GetSocket() %d\n", nn, p -> GetSocket());)
- if (tcp && p -> IsConnected() && tcp -> GetOutputLength())
- {
- LogError(p, "Closing", (int)tcp -> GetOutputLength(), "Closing socket while data still left to send", LOG_LEVEL_WARNING);
- }
-#ifdef ENABLE_POOL
- if (p -> Retain() && !p -> Lost())
- {
- PoolSocket *p2 = new PoolSocket(*this, p);
- p2 -> SetDeleteByHandler();
- Add(p2);
- //
- p -> SetCloseAndDelete(false); // added - remove from m_fds_close
- }
- else
-#endif // ENABLE_POOL
- {
- Set(p -> GetSocket(),false,false,false);
-DEB( fprintf(stderr, "Close() before OnDelete\n");)
- p -> Close();
- }
- p -> OnDelete();
- if (p -> DeleteByHandler())
- {
- p -> SetErasedByHandler();
- }
- m_fds_erase.push_back(nn);
- }
- }
- }
- }
- }
-
- // check erased sockets
- bool check_max_fd = false;
- while (!m_fds_erase.empty())
- {
- socket_v::iterator it = m_fds_erase.begin();
- SOCKET nn = *it;
-#ifdef ENABLE_DETACH
- {
- for (socket_v::iterator it = m_fds_detach.begin(); it != m_fds_detach.end(); it++)
- {
- if (*it == nn)
- {
- m_fds_detach.erase(it);
- break;
- }
- }
- }
-#endif
- {
- for (socket_v::iterator it = m_fds.begin(); it != m_fds.end(); it++)
- {
- if (*it == nn)
- {
- m_fds.erase(it);
- break;
- }
- }
- }
- {
- socket_m::iterator it = m_sockets.find(nn);
- if (it != m_sockets.end())
- {
- Socket *p = it -> second;
- /* Sometimes a SocketThread class can finish its run before the master
- sockethandler gets here. In that case, the SocketThread has set the
- 'ErasedByHandler' flag on the socket which will make us end up with a
- double delete on the socket instance.
- The fix is to make sure that the master sockethandler only can delete
- non-detached sockets, and a slave sockethandler only can delete
- detach sockets. */
- if (p -> ErasedByHandler()
-#ifdef ENABLE_DETACH
- && !(m_slave ^ p -> IsDetached())
-#endif
- )
- {
-#ifdef ENABLE_TRIGGERS
- bool again = false;
- do
- {
- again = false;
- for (std::map::iterator it = m_trigger_src.begin(); it != m_trigger_src.end(); it++)
- {
- int id = it -> first;
- Socket *src = it -> second;
- if (src == p)
- {
- for (std::map::iterator it = m_trigger_dst[id].begin(); it != m_trigger_dst[id].end(); it++)
- {
- Socket *dst = it -> first;
- if (Valid(dst))
- {
- dst -> OnCancelled(id);
- }
- }
- m_trigger_src.erase(m_trigger_src.find(id));
- m_trigger_dst.erase(m_trigger_dst.find(id));
- again = true;
- break;
- }
- }
- } while (again);
-#endif
- delete p;
- }
- m_sockets.erase(it);
- }
- }
- m_fds_erase.erase(it);
- check_max_fd = true;
- }
- // calculate max file descriptor for select() call
- if (check_max_fd)
- {
- m_maxsock = 0;
- for (socket_v::iterator it = m_fds.begin(); it != m_fds.end(); it++)
- {
- SOCKET s = *it;
- m_maxsock = s > m_maxsock ? s : m_maxsock;
- }
- }
- // remove Add's that fizzed
- while (!m_delete.empty())
- {
- std::list::iterator it = m_delete.begin();
- Socket *p = *it;
- p -> OnDelete();
- m_delete.erase(it);
- if (p -> DeleteByHandler()
-#ifdef ENABLE_DETACH
- && !(m_slave ^ p -> IsDetached())
-#endif
- )
- {
- p -> SetErasedByHandler();
-#ifdef ENABLE_TRIGGERS
- bool again = false;
- do
- {
- again = false;
- for (std::map::iterator it = m_trigger_src.begin(); it != m_trigger_src.end(); it++)
- {
- int id = it -> first;
- Socket *src = it -> second;
- if (src == p)
- {
- for (std::map::iterator it = m_trigger_dst[id].begin(); it != m_trigger_dst[id].end(); it++)
- {
- Socket *dst = it -> first;
- if (Valid(dst))
- {
- dst -> OnCancelled(id);
- }
- }
- m_trigger_src.erase(m_trigger_src.find(id));
- m_trigger_dst.erase(m_trigger_dst.find(id));
- again = true;
- break;
- }
- }
- } while (again);
-#endif
- delete p;
- }
- }
- return n;
-}
-
-
-#ifdef ENABLE_RESOLVER
-bool SocketHandler::Resolving(Socket *p0)
-{
- std::map::iterator it = m_resolve_q.find(p0);
- return it != m_resolve_q.end();
-}
-#endif
-
-
-bool SocketHandler::Valid(Socket *p0)
-{
- for (socket_m::iterator it = m_sockets.begin(); it != m_sockets.end(); it++)
- {
- Socket *p = it -> second;
- if (p0 == p)
- return true;
- }
- return false;
-}
-
-
-bool SocketHandler::OkToAccept(Socket *)
-{
- return true;
-}
-
-
-size_t SocketHandler::GetCount()
-{
-/*
-printf(" m_sockets : %d\n", m_sockets.size());
-printf(" m_add : %d\n", m_add.size());
-printf(" m_delete : %d\n", m_delete.size());
-*/
- return m_sockets.size() + m_add.size() + m_delete.size();
-}
-
-
-#ifdef ENABLE_SOCKS4
-void SocketHandler::SetSocks4Host(ipaddr_t a)
-{
- m_socks4_host = a;
-}
-
-
-void SocketHandler::SetSocks4Host(const std::string& host)
-{
- Utility::u2ip(host, m_socks4_host);
-}
-
-
-void SocketHandler::SetSocks4Port(port_t port)
-{
- m_socks4_port = port;
-}
-
-
-void SocketHandler::SetSocks4Userid(const std::string& id)
-{
- m_socks4_userid = id;
-}
-#endif
-
-
-#ifdef ENABLE_RESOLVER
-int SocketHandler::Resolve(Socket *p,const std::string& host,port_t port)
-{
- // check cache
- ResolvSocket *resolv = new ResolvSocket(*this, p, host, port);
- resolv -> SetId(++m_resolv_id);
- resolv -> SetDeleteByHandler();
- ipaddr_t local;
- Utility::u2ip("127.0.0.1", local);
- if (!resolv -> Open(local, m_resolver_port))
- {
- LogError(resolv, "Resolve", -1, "Can't connect to local resolve server", LOG_LEVEL_FATAL);
- }
- Add(resolv);
- m_resolve_q[p] = true;
-DEB( fprintf(stderr, " *** Resolve '%s:%d' id#%d m_resolve_q size: %d p: %p\n", host.c_str(), port, resolv -> GetId(), m_resolve_q.size(), p);)
- return resolv -> GetId();
-}
-
-
-#ifdef ENABLE_IPV6
-int SocketHandler::Resolve6(Socket *p,const std::string& host,port_t port)
-{
- // check cache
- ResolvSocket *resolv = new ResolvSocket(*this, p, host, port, true);
- resolv -> SetId(++m_resolv_id);
- resolv -> SetDeleteByHandler();
- ipaddr_t local;
- Utility::u2ip("127.0.0.1", local);
- if (!resolv -> Open(local, m_resolver_port))
- {
- LogError(resolv, "Resolve", -1, "Can't connect to local resolve server", LOG_LEVEL_FATAL);
- }
- Add(resolv);
- m_resolve_q[p] = true;
- return resolv -> GetId();
-}
-#endif
-
-
-int SocketHandler::Resolve(Socket *p,ipaddr_t a)
-{
- // check cache
- ResolvSocket *resolv = new ResolvSocket(*this, p, a);
- resolv -> SetId(++m_resolv_id);
- resolv -> SetDeleteByHandler();
- ipaddr_t local;
- Utility::u2ip("127.0.0.1", local);
- if (!resolv -> Open(local, m_resolver_port))
- {
- LogError(resolv, "Resolve", -1, "Can't connect to local resolve server", LOG_LEVEL_FATAL);
- }
- Add(resolv);
- m_resolve_q[p] = true;
- return resolv -> GetId();
-}
-
-
-#ifdef ENABLE_IPV6
-int SocketHandler::Resolve(Socket *p,in6_addr& a)
-{
- // check cache
- ResolvSocket *resolv = new ResolvSocket(*this, p, a);
- resolv -> SetId(++m_resolv_id);
- resolv -> SetDeleteByHandler();
- ipaddr_t local;
- Utility::u2ip("127.0.0.1", local);
- if (!resolv -> Open(local, m_resolver_port))
- {
- LogError(resolv, "Resolve", -1, "Can't connect to local resolve server", LOG_LEVEL_FATAL);
- }
- Add(resolv);
- m_resolve_q[p] = true;
- return resolv -> GetId();
-}
-#endif
-
-
-void SocketHandler::EnableResolver(port_t port)
-{
- if (!m_resolver)
- {
- m_resolver_port = port;
- m_resolver = new ResolvServer(port);
- }
-}
-
-
-bool SocketHandler::ResolverReady()
-{
- return m_resolver ? m_resolver -> Ready() : false;
-}
-#endif // ENABLE_RESOLVER
-
-
-#ifdef ENABLE_SOCKS4
-void SocketHandler::SetSocks4TryDirect(bool x)
-{
- m_bTryDirect = x;
-}
-
-
-ipaddr_t SocketHandler::GetSocks4Host()
-{
- return m_socks4_host;
-}
-
-
-port_t SocketHandler::GetSocks4Port()
-{
- return m_socks4_port;
-}
-
-
-const std::string& SocketHandler::GetSocks4Userid()
-{
- return m_socks4_userid;
-}
-
-
-bool SocketHandler::Socks4TryDirect()
-{
- return m_bTryDirect;
-}
-#endif
-
-
-#ifdef ENABLE_RESOLVER
-bool SocketHandler::ResolverEnabled()
-{
- return m_resolver ? true : false;
-}
-
-
-port_t SocketHandler::GetResolverPort()
-{
- return m_resolver_port;
-}
-#endif // ENABLE_RESOLVER
-
-
-#ifdef ENABLE_POOL
-ISocketHandler::PoolSocket *SocketHandler::FindConnection(int type,const std::string& protocol,SocketAddress& ad)
-{
- for (socket_m::iterator it = m_sockets.begin(); it != m_sockets.end() && !m_sockets.empty(); it++)
- {
- PoolSocket *pools = dynamic_cast(it -> second);
- if (pools)
- {
- if (pools -> GetSocketType() == type &&
- pools -> GetSocketProtocol() == protocol &&
-// %! pools -> GetClientRemoteAddress() &&
- *pools -> GetClientRemoteAddress() == ad)
- {
- m_sockets.erase(it);
- pools -> SetRetain(); // avoid Close in Socket destructor
- return pools; // Caller is responsible that this socket is deleted
- }
- }
- }
- return NULL;
-}
-
-
-void SocketHandler::EnablePool(bool x)
-{
- m_b_enable_pool = x;
-}
-
-
-bool SocketHandler::PoolEnabled()
-{
- return m_b_enable_pool;
-}
-#endif
-
-
-void SocketHandler::Remove(Socket *p)
-{
-#ifdef ENABLE_RESOLVER
- std::map::iterator it4 = m_resolve_q.find(p);
- if (it4 != m_resolve_q.end())
- m_resolve_q.erase(it4);
-#endif
- if (p -> ErasedByHandler())
- {
- return;
- }
- for (socket_m::iterator it = m_sockets.begin(); it != m_sockets.end(); it++)
- {
- if (it -> second == p)
- {
- LogError(p, "Remove", -1, "Socket destructor called while still in use", LOG_LEVEL_WARNING);
- m_sockets.erase(it);
- return;
- }
- }
- for (socket_m::iterator it2 = m_add.begin(); it2 != m_add.end(); it2++)
- {
- if ((*it2).second == p)
- {
- LogError(p, "Remove", -2, "Socket destructor called while still in use", LOG_LEVEL_WARNING);
- m_add.erase(it2);
- return;
- }
- }
- for (std::list::iterator it3 = m_delete.begin(); it3 != m_delete.end(); it3++)
- {
- if (*it3 == p)
- {
- LogError(p, "Remove", -3, "Socket destructor called while still in use", LOG_LEVEL_WARNING);
- m_delete.erase(it3);
- return;
- }
- }
-}
-
-
-void SocketHandler::CheckSanity()
-{
- CheckList(m_fds, "active sockets"); // active sockets
- CheckList(m_fds_erase, "sockets to be erased"); // should always be empty anyway
- CheckList(m_fds_callonconnect, "checklist CallOnConnect");
-#ifdef ENABLE_DETACH
- CheckList(m_fds_detach, "checklist Detach");
-#endif
- CheckList(m_fds_timeout, "checklist Timeout");
- CheckList(m_fds_retry, "checklist retry client connect");
- CheckList(m_fds_close, "checklist close and delete");
-}
-
-
-void SocketHandler::CheckList(socket_v& ref,const std::string& listname)
-{
- for (socket_v::iterator it = ref.begin(); it != ref.end(); it++)
- {
- SOCKET s = *it;
- if (m_sockets.find(s) != m_sockets.end())
- continue;
- if (m_add.find(s) != m_add.end())
- continue;
- bool found = false;
- for (std::list::iterator it = m_delete.begin(); it != m_delete.end(); it++)
- {
- Socket *p = *it;
- if (p -> GetSocket() == s)
- {
- found = true;
- break;
- }
- }
- if (!found)
- {
- fprintf(stderr, "CheckList failed for \"%s\": fd %d\n", listname.c_str(), s);
- }
- }
-}
-
-
-void SocketHandler::AddList(SOCKET s,list_t which_one,bool add)
-{
- if (s == INVALID_SOCKET)
- {
-DEB( fprintf(stderr, "AddList: invalid_socket\n");)
- return;
- }
- socket_v& ref =
- (which_one == LIST_CALLONCONNECT) ? m_fds_callonconnect :
-#ifdef ENABLE_DETACH
- (which_one == LIST_DETACH) ? m_fds_detach :
-#endif
- (which_one == LIST_TIMEOUT) ? m_fds_timeout :
- (which_one == LIST_RETRY) ? m_fds_retry :
- (which_one == LIST_CLOSE) ? m_fds_close : m_fds_close;
- if (add)
- {
-#ifdef ENABLE_DETACH
-DEB( fprintf(stderr, "AddList; %5d: %s: %s\n", s, (which_one == LIST_CALLONCONNECT) ? "CallOnConnect" :
- (which_one == LIST_DETACH) ? "Detach" :
- (which_one == LIST_TIMEOUT) ? "Timeout" :
- (which_one == LIST_RETRY) ? "Retry" :
- (which_one == LIST_CLOSE) ? "Close" : "",
- add ? "Add" : "Remove");)
-#else
-DEB( fprintf(stderr, "AddList; %5d: %s: %s\n", s, (which_one == LIST_CALLONCONNECT) ? "CallOnConnect" :
- (which_one == LIST_TIMEOUT) ? "Timeout" :
- (which_one == LIST_RETRY) ? "Retry" :
- (which_one == LIST_CLOSE) ? "Close" : "",
- add ? "Add" : "Remove");)
-#endif
- }
- if (add)
- {
- for (socket_v::iterator it = ref.begin(); it != ref.end(); it++)
- {
- if (*it == s) // already there
- {
- return;
- }
- }
- ref.push_back(s);
- return;
- }
- // remove
- for (socket_v::iterator it = ref.begin(); it != ref.end(); it++)
- {
- if (*it == s)
- {
- ref.erase(it);
- break;
- }
- }
-//DEB( fprintf(stderr, "/AddList\n");)
-}
-
-
-#ifdef ENABLE_TRIGGERS
-int SocketHandler::TriggerID(Socket *src)
-{
- int id = m_next_trigger_id++;
- m_trigger_src[id] = src;
- return id;
-}
-
-
-bool SocketHandler::Subscribe(int id, Socket *dst)
-{
- if (m_trigger_src.find(id) != m_trigger_src.end())
- {
- std::map::iterator it = m_trigger_dst[id].find(dst);
- if (it != m_trigger_dst[id].end())
- {
- m_trigger_dst[id][dst] = true;
- return true;
- }
- LogError(dst, "Subscribe", id, "Already subscribed", LOG_LEVEL_INFO);
- return false;
- }
- LogError(dst, "Subscribe", id, "Trigger id not found", LOG_LEVEL_INFO);
- return false;
-}
-
-
-bool SocketHandler::Unsubscribe(int id, Socket *dst)
-{
- if (m_trigger_src.find(id) != m_trigger_src.end())
- {
- std::map::iterator it = m_trigger_dst[id].find(dst);
- if (it != m_trigger_dst[id].end())
- {
- m_trigger_dst[id].erase(it);
- return true;
- }
- LogError(dst, "Unsubscribe", id, "Not subscribed", LOG_LEVEL_INFO);
- return false;
- }
- LogError(dst, "Unsubscribe", id, "Trigger id not found", LOG_LEVEL_INFO);
- return false;
-}
-
-
-void SocketHandler::Trigger(int id, Socket::TriggerData& data, bool erase)
-{
- if (m_trigger_src.find(id) != m_trigger_src.end())
- {
- data.SetSource( m_trigger_src[id] );
- for (std::map::iterator it = m_trigger_dst[id].begin(); it != m_trigger_dst[id].end(); it++)
- {
- Socket *dst = it -> first;
- if (Valid(dst))
- {
- dst -> OnTrigger(id, data);
- }
- }
- if (erase)
- {
- m_trigger_src.erase(m_trigger_src.find(id));
- m_trigger_dst.erase(m_trigger_dst.find(id));
- }
- }
- else
- {
- LogError(NULL, "Trigger", id, "Trigger id not found", LOG_LEVEL_INFO);
- }
-}
-#endif // ENABLE_TRIGGERS
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
diff --git a/dep/src/sockets/StdoutLog.cpp b/dep/src/sockets/StdoutLog.cpp
deleted file mode 100644
index f9251c326..000000000
--- a/dep/src/sockets/StdoutLog.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/** \file StdoutLog.cpp
- ** \date 2004-06-01
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#include
-
-#ifdef _MSC_VER
-#pragma warning(disable:4786)
-#endif
-#include "ISocketHandler.h"
-#include "Socket.h"
-#include "StdoutLog.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-
-
-void StdoutLog::error(ISocketHandler *,Socket *sock,const std::string& call,int err,const std::string& sys_err,loglevel_t lvl)
-{
- time_t t = time(NULL);
- struct tm tp;
-#ifdef _WIN32
- memcpy(&tp, localtime(&t), sizeof(tp));
-#else
- localtime_r(&t, &tp);
-#endif
- std::string level;
-
- switch (lvl)
- {
- case LOG_LEVEL_WARNING:
- level = "Warning";
- break;
- case LOG_LEVEL_ERROR:
- level = "Error";
- break;
- case LOG_LEVEL_FATAL:
- level = "Fatal";
- break;
- case LOG_LEVEL_INFO:
- level = "Info";
- break;
- }
- if (sock)
- {
- printf("%d-%02d-%02d %02d:%02d:%02d :: fd %d :: %s: %d %s (%s)\n",
- tp.tm_year + 1900,
- tp.tm_mon + 1,
- tp.tm_mday,
- tp.tm_hour,tp.tm_min,tp.tm_sec,
- sock -> GetSocket(),
- call.c_str(),err,sys_err.c_str(),level.c_str());
- }
- else
- {
- printf("%d-%02d-%02d %02d:%02d:%02d :: %s: %d %s (%s)\n",
- tp.tm_year + 1900,
- tp.tm_mon + 1,
- tp.tm_mday,
- tp.tm_hour,tp.tm_min,tp.tm_sec,
- call.c_str(),err,sys_err.c_str(),level.c_str());
- }
-}
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-
diff --git a/dep/src/sockets/StreamSocket.cpp b/dep/src/sockets/StreamSocket.cpp
deleted file mode 100644
index 5c5780e30..000000000
--- a/dep/src/sockets/StreamSocket.cpp
+++ /dev/null
@@ -1,169 +0,0 @@
-#include "StreamSocket.h"
-#include "ISocketHandler.h"
-
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-StreamSocket::StreamSocket(ISocketHandler& h) : Socket(h)
-,m_bConnecting(false)
-,m_connect_timeout(5)
-,m_flush_before_close(true)
-,m_connection_retry(0)
-,m_retries(0)
-,m_call_on_connect(false)
-,m_b_retry_connect(false)
-,m_line_protocol(false)
-,m_shutdown(0)
-{
-}
-
-
-StreamSocket::~StreamSocket()
-{
-}
-
-
-void StreamSocket::SetConnecting(bool x)
-{
- if (x != m_bConnecting)
- {
- m_bConnecting = x;
- if (x)
- {
- SetTimeout( GetConnectTimeout() );
- }
- else
- {
- SetTimeout( 0 );
- }
- }
-}
-
-
-bool StreamSocket::Connecting()
-{
- return m_bConnecting;
-}
-
-
-bool StreamSocket::Ready()
-{
- if (GetSocket() != INVALID_SOCKET && !Connecting() && !CloseAndDelete())
- return true;
- return false;
-}
-
-
-void StreamSocket::SetConnectTimeout(int x)
-{
- m_connect_timeout = x;
-}
-
-
-int StreamSocket::GetConnectTimeout()
-{
- return m_connect_timeout;
-}
-
-
-void StreamSocket::SetFlushBeforeClose(bool x)
-{
- m_flush_before_close = x;
-}
-
-
-bool StreamSocket::GetFlushBeforeClose()
-{
- return m_flush_before_close;
-}
-
-
-int StreamSocket::GetConnectionRetry()
-{
- return m_connection_retry;
-}
-
-
-void StreamSocket::SetConnectionRetry(int x)
-{
- m_connection_retry = x;
-}
-
-
-int StreamSocket::GetConnectionRetries()
-{
- return m_retries;
-}
-
-
-void StreamSocket::IncreaseConnectionRetries()
-{
- m_retries++;
-}
-
-
-void StreamSocket::ResetConnectionRetries()
-{
- m_retries = 0;
-}
-
-
-void StreamSocket::SetCallOnConnect(bool x)
-{
- Handler().AddList(GetSocket(), LIST_CALLONCONNECT, x);
- m_call_on_connect = x;
-}
-
-
-bool StreamSocket::CallOnConnect()
-{
- return m_call_on_connect;
-}
-
-
-void StreamSocket::SetRetryClientConnect(bool x)
-{
- Handler().AddList(GetSocket(), LIST_RETRY, x);
- m_b_retry_connect = x;
-}
-
-
-bool StreamSocket::RetryClientConnect()
-{
- return m_b_retry_connect;
-}
-
-
-void StreamSocket::SetLineProtocol(bool x)
-{
- m_line_protocol = x;
-}
-
-
-bool StreamSocket::LineProtocol()
-{
- return m_line_protocol;
-}
-
-
-void StreamSocket::SetShutdown(int x)
-{
- m_shutdown = x;
-}
-
-
-int StreamSocket::GetShutdown()
-{
- return m_shutdown;
-}
-
-
-
-
-#ifdef SOCKETS_NAMESPACE
-} // namespace SOCKETS_NAMESPACE {
-#endif
-
diff --git a/dep/src/sockets/TcpSocket.cpp b/dep/src/sockets/TcpSocket.cpp
deleted file mode 100644
index 64bb1009e..000000000
--- a/dep/src/sockets/TcpSocket.cpp
+++ /dev/null
@@ -1,1746 +0,0 @@
-/** \file TcpSocket.cpp
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef _WIN32
-#ifdef _MSC_VER
-#pragma warning(disable:4786)
-#endif
-#include
-#else
-#include
-#endif
-#include "ISocketHandler.h"
-#include
-#include
-#include
-#include
-#ifdef HAVE_OPENSSL
-#include
-#include
-#endif
-#include
-
-#include "TcpSocket.h"
-#include "Utility.h"
-#include "Ipv4Address.h"
-#include "Ipv6Address.h"
-#include "Mutex.h"
-#include "IFile.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-//#ifdef _DEBUG
-//#define DEB(x) x
-//#else
-#define DEB(x)
-//#endif
-
-
-// statics
-#ifdef HAVE_OPENSSL
-SSLInitializer TcpSocket::m_ssl_init;
-#endif
-
-
-// thanks, q
-#ifdef _MSC_VER
-#pragma warning(disable:4355)
-#endif
-TcpSocket::TcpSocket(ISocketHandler& h) : StreamSocket(h)
-,ibuf(TCP_BUFSIZE_READ)
-,m_b_input_buffer_disabled(false)
-,m_bytes_sent(0)
-,m_bytes_received(0)
-,m_skip_c(false)
-#ifdef SOCKETS_DYNAMIC_TEMP
-,m_buf(new char[TCP_BUFSIZE_READ + 1])
-#endif
-,m_obuf_top(NULL)
-,m_transfer_limit(0)
-,m_output_length(0)
-#ifdef HAVE_OPENSSL
-,m_ssl_ctx(NULL)
-,m_ssl(NULL)
-,m_sbio(NULL)
-#endif
-#ifdef ENABLE_SOCKS4
-,m_socks4_state(0)
-#endif
-#ifdef ENABLE_RESOLVER
-,m_resolver_id(0)
-#endif
-#ifdef ENABLE_RECONNECT
-,m_b_reconnect(false)
-,m_b_is_reconnect(false)
-#endif
-{
-}
-#ifdef _MSC_VER
-#pragma warning(default:4355)
-#endif
-
-
-#ifdef _MSC_VER
-#pragma warning(disable:4355)
-#endif
-TcpSocket::TcpSocket(ISocketHandler& h,size_t isize,size_t osize) : StreamSocket(h)
-,ibuf(isize)
-,m_b_input_buffer_disabled(false)
-,m_bytes_sent(0)
-,m_bytes_received(0)
-,m_skip_c(false)
-#ifdef SOCKETS_DYNAMIC_TEMP
-,m_buf(new char[TCP_BUFSIZE_READ + 1])
-#endif
-,m_obuf_top(NULL)
-,m_transfer_limit(0)
-,m_output_length(0)
-#ifdef HAVE_OPENSSL
-,m_ssl_ctx(NULL)
-,m_ssl(NULL)
-,m_sbio(NULL)
-#endif
-#ifdef ENABLE_SOCKS4
-,m_socks4_state(0)
-#endif
-#ifdef ENABLE_RESOLVER
-,m_resolver_id(0)
-#endif
-#ifdef ENABLE_RECONNECT
-,m_b_reconnect(false)
-,m_b_is_reconnect(false)
-#endif
-{
-}
-#ifdef _MSC_VER
-#pragma warning(default:4355)
-#endif
-
-
-TcpSocket::~TcpSocket()
-{
-#ifdef SOCKETS_DYNAMIC_TEMP
- delete[] m_buf;
-#endif
- // %! empty m_obuf
- while (m_obuf.size())
- {
- output_l::iterator it = m_obuf.begin();
- OUTPUT *p = *it;
- delete p;
- m_obuf.erase(it);
- }
-#ifdef HAVE_OPENSSL
- if (m_ssl)
- {
- SSL_free(m_ssl);
- }
-#endif
-}
-
-
-bool TcpSocket::Open(ipaddr_t ip,port_t port,bool skip_socks)
-{
- Ipv4Address ad(ip, port);
- Ipv4Address local;
- return Open(ad, local, skip_socks);
-}
-
-
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
-bool TcpSocket::Open(in6_addr ip,port_t port,bool skip_socks)
-{
- Ipv6Address ad(ip, port);
- return Open(ad, skip_socks);
-}
-#endif
-#endif
-
-
-bool TcpSocket::Open(SocketAddress& ad,bool skip_socks)
-{
- Ipv4Address bind_ad("0.0.0.0", 0);
- return Open(ad, bind_ad, skip_socks);
-}
-
-
-bool TcpSocket::Open(SocketAddress& ad,SocketAddress& bind_ad,bool skip_socks)
-{
- if (!ad.IsValid())
- {
- Handler().LogError(this, "Open", 0, "Invalid SocketAddress", LOG_LEVEL_FATAL);
- SetCloseAndDelete();
- return false;
- }
- if (Handler().GetCount() >= FD_SETSIZE)
- {
- Handler().LogError(this, "Open", 0, "no space left in fd_set", LOG_LEVEL_FATAL);
- SetCloseAndDelete();
- return false;
- }
- SetConnecting(false);
-#ifdef ENABLE_SOCKS4
- SetSocks4(false);
-#endif
- // check for pooling
-#ifdef ENABLE_POOL
- if (Handler().PoolEnabled())
- {
- ISocketHandler::PoolSocket *pools = Handler().FindConnection(SOCK_STREAM, "tcp", ad);
- if (pools)
- {
- CopyConnection( pools );
- delete pools;
-
- SetIsClient();
- SetCallOnConnect(); // ISocketHandler must call OnConnect
- Handler().LogError(this, "SetCallOnConnect", 0, "Found pooled connection", LOG_LEVEL_INFO);
- return true;
- }
- }
-#endif
- // if not, create new connection
- SOCKET s = CreateSocket(ad.GetFamily(), SOCK_STREAM, "tcp");
- if (s == INVALID_SOCKET)
- {
- return false;
- }
- // socket must be nonblocking for async connect
- if (!SetNonblocking(true, s))
- {
- SetCloseAndDelete();
- closesocket(s);
- return false;
- }
-#ifdef ENABLE_POOL
- SetIsClient(); // client because we connect
-#endif
- SetClientRemoteAddress(ad);
- int n = 0;
- if (bind_ad.GetPort() != 0)
- {
- bind(s, bind_ad, bind_ad);
- }
-#ifdef ENABLE_SOCKS4
- if (!skip_socks && GetSocks4Host() && GetSocks4Port())
- {
- Ipv4Address sa(GetSocks4Host(), GetSocks4Port());
- {
- std::string sockshost;
- Utility::l2ip(GetSocks4Host(), sockshost);
- Handler().LogError(this, "Open", 0, "Connecting to socks4 server @ " + sockshost + ":" +
- Utility::l2string(GetSocks4Port()), LOG_LEVEL_INFO);
- }
- SetSocks4();
- n = connect(s, sa, sa);
- SetRemoteAddress(sa);
- }
- else
-#endif
- {
- n = connect(s, ad, ad);
- SetRemoteAddress(ad);
- }
- if (n == -1)
- {
- // check error code that means a connect is in progress
-#ifdef _WIN32
- if (Errno == WSAEWOULDBLOCK)
-#else
- if (Errno == EINPROGRESS)
-#endif
- {
- Attach(s);
- SetConnecting( true ); // this flag will control fd_set's
- }
- else
-#ifdef ENABLE_SOCKS4
- if (Socks4() && Handler().Socks4TryDirect() ) // retry
- {
- closesocket(s);
- return Open(ad, true);
- }
- else
-#endif
-#ifdef ENABLE_RECONNECT
- if (Reconnect())
- {
- Handler().LogError(this, "connect: failed, reconnect pending", Errno, StrError(Errno), LOG_LEVEL_INFO);
- Attach(s);
- SetConnecting( true ); // this flag will control fd_set's
- }
- else
-#endif
- {
- Handler().LogError(this, "connect: failed", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- SetCloseAndDelete();
- closesocket(s);
- return false;
- }
- }
- else
- {
- Attach(s);
- SetCallOnConnect(); // ISocketHandler must call OnConnect
- }
-
- // 'true' means connected or connecting(not yet connected)
- // 'false' means something failed
- return true; //!Connecting();
-}
-
-
-bool TcpSocket::Open(const std::string &host,port_t port)
-{
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
-#ifdef ENABLE_RESOLVER
- if (!Handler().ResolverEnabled() || Utility::isipv6(host) )
- {
-#endif
- in6_addr a;
- if (!Utility::u2ip(host, a))
- {
- SetCloseAndDelete();
- return false;
- }
- Ipv6Address ad(a, port);
- Ipv6Address local;
- return Open(ad, local);
-#ifdef ENABLE_RESOLVER
- }
- m_resolver_id = Resolve6(host, port);
- return true;
-#endif
- }
-#endif
-#endif
-#ifdef ENABLE_RESOLVER
- if (!Handler().ResolverEnabled() || Utility::isipv4(host) )
- {
-#endif
- ipaddr_t l;
- if (!Utility::u2ip(host,l))
- {
- SetCloseAndDelete();
- return false;
- }
- Ipv4Address ad(l, port);
- Ipv4Address local;
- return Open(ad, local);
-#ifdef ENABLE_RESOLVER
- }
- // resolve using async resolver thread
- m_resolver_id = Resolve(host, port);
- return true;
-#endif
-}
-
-
-#ifdef ENABLE_RESOLVER
-void TcpSocket::OnResolved(int id,ipaddr_t a,port_t port)
-{
-DEB( fprintf(stderr, "TcpSocket::OnResolved id %d addr %x port %d\n", id, a, port);)
- if (id == m_resolver_id)
- {
- if (a && port)
- {
- Ipv4Address ad(a, port);
- Ipv4Address local;
- if (Open(ad, local))
- {
- if (!Handler().Valid(this))
- {
- Handler().Add(this);
- }
- }
- }
- else
- {
- Handler().LogError(this, "OnResolved", 0, "Resolver failed", LOG_LEVEL_FATAL);
- SetCloseAndDelete();
- }
- }
- else
- {
- Handler().LogError(this, "OnResolved", id, "Resolver returned wrong job id", LOG_LEVEL_FATAL);
- SetCloseAndDelete();
- }
-}
-
-
-#ifdef ENABLE_IPV6
-void TcpSocket::OnResolved(int id,in6_addr& a,port_t port)
-{
- if (id == m_resolver_id)
- {
- Ipv6Address ad(a, port);
- if (ad.IsValid())
- {
- Ipv6Address local;
- if (Open(ad, local))
- {
- if (!Handler().Valid(this))
- {
- Handler().Add(this);
- }
- }
- }
- }
- else
- {
- Handler().LogError(this, "OnResolved", id, "Resolver returned wrong job id", LOG_LEVEL_FATAL);
- SetCloseAndDelete();
- }
-}
-#endif
-#endif
-
-
-void TcpSocket::OnRead()
-{
- int n = 0;
-#ifdef SOCKETS_DYNAMIC_TEMP
- char *buf = m_buf;
-#else
- char buf[TCP_BUFSIZE_READ];
-#endif
-#ifdef HAVE_OPENSSL
- if (IsSSL())
- {
- if (!Ready())
- return;
- n = SSL_read(m_ssl, buf, TCP_BUFSIZE_READ);
- if (n == -1)
- {
- n = SSL_get_error(m_ssl, n);
- switch (n)
- {
- case SSL_ERROR_NONE:
- case SSL_ERROR_WANT_READ:
- case SSL_ERROR_WANT_WRITE:
- break;
- case SSL_ERROR_ZERO_RETURN:
-DEB( fprintf(stderr, "SSL_read() returns zero - closing socket\n");)
- OnDisconnect();
- SetCloseAndDelete(true);
- SetFlushBeforeClose(false);
- SetLost();
- break;
- default:
-DEB( fprintf(stderr, "SSL read problem, errcode = %d\n",n);)
- OnDisconnect();
- SetCloseAndDelete(true);
- SetFlushBeforeClose(false);
- SetLost();
- }
- return;
- }
- else
- if (!n)
- {
- OnDisconnect();
- SetCloseAndDelete(true);
- SetFlushBeforeClose(false);
- SetLost();
- SetShutdown(SHUT_WR);
- return;
- }
- else
- if (n > 0 && n <= TCP_BUFSIZE_READ)
- {
- m_bytes_received += n;
- if (GetTrafficMonitor())
- {
- GetTrafficMonitor() -> fwrite(buf, 1, n);
- }
- if (!m_b_input_buffer_disabled && !ibuf.Write(buf,n))
- {
- Handler().LogError(this, "OnRead(ssl)", 0, "ibuf overflow", LOG_LEVEL_WARNING);
- }
- }
- else
- {
- Handler().LogError(this, "OnRead(ssl)", n, "abnormal value from SSL_read", LOG_LEVEL_ERROR);
- }
- }
- else
-#endif // HAVE_OPENSSL
- {
- n = recv(GetSocket(), buf, TCP_BUFSIZE_READ, MSG_NOSIGNAL);
- if (n == -1)
- {
- Handler().LogError(this, "read", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- OnDisconnect();
- SetCloseAndDelete(true);
- SetFlushBeforeClose(false);
- SetLost();
- return;
- }
- else
- if (!n)
- {
- OnDisconnect();
- SetCloseAndDelete(true);
- SetFlushBeforeClose(false);
- SetLost();
- SetShutdown(SHUT_WR);
- return;
- }
- else
- if (n > 0 && n <= TCP_BUFSIZE_READ)
- {
- m_bytes_received += n;
- if (GetTrafficMonitor())
- {
- GetTrafficMonitor() -> fwrite(buf, 1, n);
- }
- if (!m_b_input_buffer_disabled && !ibuf.Write(buf,n))
- {
- Handler().LogError(this, "OnRead", 0, "ibuf overflow", LOG_LEVEL_WARNING);
- }
- }
- else
- {
- Handler().LogError(this, "OnRead", n, "abnormal value from recv", LOG_LEVEL_ERROR);
- }
- }
- //
- OnRead( buf, n );
-}
-
-
-void TcpSocket::OnRead( char *buf, size_t n )
-{
- // unbuffered
- if (n > 0 && n <= TCP_BUFSIZE_READ)
- {
- if (LineProtocol())
- {
- buf[n] = 0;
- size_t i = 0;
- if (m_skip_c && (buf[i] == 13 || buf[i] == 10) && buf[i] != m_c)
- {
- m_skip_c = false;
- i++;
- }
- size_t x = i;
- for (; i < n && LineProtocol(); i++)
- {
- while ((buf[i] == 13 || buf[i] == 10) && LineProtocol())
- {
- char c = buf[i];
- buf[i] = 0;
- if (buf[x])
- {
- m_line += (buf + x);
- }
- OnLine( m_line );
- i++;
- m_skip_c = true;
- m_c = c;
- if (i < n && (buf[i] == 13 || buf[i] == 10) && buf[i] != c)
- {
- m_skip_c = false;
- i++;
- }
- x = i;
- m_line = "";
- }
- if (!LineProtocol())
- {
- break;
- }
- }
- if (!LineProtocol())
- {
- if (i < n)
- {
- OnRawData(buf + i, n - i);
- }
- }
- else
- if (buf[x])
- {
- m_line += (buf + x);
- }
- }
- else
- {
- OnRawData(buf, n);
- }
- }
- if (m_b_input_buffer_disabled)
- {
- return;
- }
- // further processing: socks4
-#ifdef ENABLE_SOCKS4
- if (Socks4())
- {
- bool need_more = false;
- while (GetInputLength() && !need_more && !CloseAndDelete())
- {
- need_more = OnSocks4Read();
- }
- }
-#endif
-}
-
-
-void TcpSocket::OnWriteComplete()
-{
-}
-
-
-void TcpSocket::OnWrite()
-{
- if (Connecting())
- {
- int err = SoError();
-
- // don't reset connecting flag on error here, we want the OnConnectFailed timeout later on
- if (!err) // ok
- {
- Set(!IsDisableRead(), false);
- SetConnecting(false);
- SetCallOnConnect();
- return;
- }
- Handler().LogError(this, "tcp: connect failed", err, StrError(err), LOG_LEVEL_FATAL);
- Set(false, false); // no more monitoring because connection failed
-
- // failed
-#ifdef ENABLE_SOCKS4
- if (Socks4())
- {
- // %! leave 'Connecting' flag set?
- OnSocks4ConnectFailed();
- return;
- }
-#endif
- if (GetConnectionRetry() == -1 ||
- (GetConnectionRetry() && GetConnectionRetries() < GetConnectionRetry()) )
- {
- // even though the connection failed at once, only retry after
- // the connection timeout.
- // should we even try to connect again, when CheckConnect returns
- // false it's because of a connection error - not a timeout...
- return;
- }
- SetConnecting(false);
- SetCloseAndDelete( true );
- /// \todo state reason why connect failed
- OnConnectFailed();
- return;
- }
- // try send next block in buffer
- // if full block is sent, repeat
- // if all blocks are sent, reset m_wfds
-
- bool repeat = false;
- size_t sz = m_transfer_limit ? GetOutputLength() : 0;
- do
- {
- output_l::iterator it = m_obuf.begin();
- OUTPUT *p = *it;
- repeat = false;
- int n = TryWrite(p -> Buf(), p -> Len());
- if (n > 0)
- {
- size_t left = p -> Remove(n);
- m_output_length -= n;
- if (!left)
- {
- delete p;
- m_obuf.erase(it);
- if (!m_obuf.size())
- {
- m_obuf_top = NULL;
- OnWriteComplete();
- }
- else
- {
- repeat = true;
- }
- }
- }
- } while (repeat);
-
- if (m_transfer_limit && sz > m_transfer_limit && GetOutputLength() < m_transfer_limit)
- {
- OnTransferLimit();
- }
-
- // check output buffer set, set/reset m_wfds accordingly
- {
- bool br;
- bool bw;
- bool bx;
- Handler().Get(GetSocket(), br, bw, bx);
- if (m_obuf.size())
- Set(br, true);
- else
- Set(br, false);
- }
-}
-
-
-int TcpSocket::TryWrite(const char *buf, size_t len)
-{
- int n = 0;
-#ifdef HAVE_OPENSSL
- if (IsSSL())
- {
- n = SSL_write(m_ssl, buf, (int)len);
- if (n == -1)
- {
- int errnr = SSL_get_error(m_ssl, n);
- if ( errnr != SSL_ERROR_WANT_READ && errnr != SSL_ERROR_WANT_WRITE )
- {
- OnDisconnect();
- SetCloseAndDelete(true);
- SetFlushBeforeClose(false);
- SetLost();
- const char *errbuf = ERR_error_string(errnr, NULL);
- Handler().LogError(this, "OnWrite/SSL_write", errnr, errbuf, LOG_LEVEL_FATAL);
- }
- return 0;
- }
- else
- if (!n)
- {
- OnDisconnect();
- SetCloseAndDelete(true);
- SetFlushBeforeClose(false);
- SetLost();
-DEB( int errnr = SSL_get_error(m_ssl, n);
- const char *errbuf = ERR_error_string(errnr, NULL);
- fprintf(stderr, "SSL_write() returns 0: %d : %s\n",errnr, errbuf);)
- }
- }
- else
-#endif // HAVE_OPENSSL
- {
- n = send(GetSocket(), buf, (int)len, MSG_NOSIGNAL);
- if (n == -1)
- {
- // normal error codes:
- // WSAEWOULDBLOCK
- // EAGAIN or EWOULDBLOCK
-#ifdef _WIN32
- if (Errno != WSAEWOULDBLOCK)
-#else
- if (Errno != EWOULDBLOCK)
-#endif
- {
- Handler().LogError(this, "send", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- OnDisconnect();
- SetCloseAndDelete(true);
- SetFlushBeforeClose(false);
- SetLost();
- }
- return 0;
- }
- }
- if (n > 0)
- {
- m_bytes_sent += n;
- if (GetTrafficMonitor())
- {
- GetTrafficMonitor() -> fwrite(buf, 1, n);
- }
- }
- return n;
-}
-
-
-void TcpSocket::Buffer(const char *buf, size_t len)
-{
- size_t ptr = 0;
- m_output_length += len;
- while (ptr < len)
- {
- // buf/len => pbuf/sz
- size_t space = 0;
- if (m_obuf_top && (space = m_obuf_top -> Space()) > 0)
- {
- const char *pbuf = buf + ptr;
- size_t sz = len - ptr;
- if (space >= sz)
- {
- m_obuf_top -> Add(pbuf, sz);
- ptr += sz;
- }
- else
- {
- m_obuf_top -> Add(pbuf, space);
- ptr += space;
- }
- }
- else
- {
- m_obuf_top = new OUTPUT;
- m_obuf.push_back( m_obuf_top );
- }
- }
-}
-
-
-void TcpSocket::Send(const std::string &str,int i)
-{
- SendBuf(str.c_str(),str.size(),i);
-}
-
-
-void TcpSocket::SendBuf(const char *buf,size_t len,int)
-{
- if (!Ready() && !Connecting())
- {
- Handler().LogError(this, "SendBuf", -1, "Attempt to write to a non-ready socket" ); // warning
- if (GetSocket() == INVALID_SOCKET)
- Handler().LogError(this, "SendBuf", 0, " * GetSocket() == INVALID_SOCKET", LOG_LEVEL_INFO);
- if (Connecting())
- Handler().LogError(this, "SendBuf", 0, " * Connecting()", LOG_LEVEL_INFO);
- if (CloseAndDelete())
- Handler().LogError(this, "SendBuf", 0, " * CloseAndDelete()", LOG_LEVEL_INFO);
- return;
- }
- if (!IsConnected())
- {
- Handler().LogError(this, "SendBuf", -1, "Attempt to write to a non-connected socket, will be sent on connect" ); // warning
- Buffer(buf, len);
- return;
- }
- if (m_obuf_top)
- {
- Buffer(buf, len);
- return;
- }
- int n = TryWrite(buf, len);
- if (n >= 0 && n < (int)len)
- {
- Buffer(buf + n, len - n);
- }
- // if ( data in buffer || !IsConnected )
- // {
- // add to buffer
- // }
- // else
- // try_send
- // if any data is unsent, buffer it and set m_wfds
-
- // check output buffer set, set/reset m_wfds accordingly
- {
- bool br;
- bool bw;
- bool bx;
- Handler().Get(GetSocket(), br, bw, bx);
- if (m_obuf.size())
- Set(br, true);
- else
- Set(br, false);
- }
-}
-
-
-void TcpSocket::OnLine(const std::string& )
-{
-}
-
-
-#ifdef _MSC_VER
-#pragma warning(disable:4355)
-#endif
-TcpSocket::TcpSocket(const TcpSocket& s)
-:StreamSocket(s)
-,ibuf(0)
-{
-}
-#ifdef _MSC_VER
-#pragma warning(default:4355)
-#endif
-
-
-#ifdef ENABLE_SOCKS4
-void TcpSocket::OnSocks4Connect()
-{
- char request[1000];
- memset(request, 0, sizeof(request));
- request[0] = 4; // socks v4
- request[1] = 1; // command code: CONNECT
- {
- std::auto_ptr ad = GetClientRemoteAddress();
- if (ad.get())
- {
- struct sockaddr *p0 = (struct sockaddr *)*ad;
- struct sockaddr_in *p = (struct sockaddr_in *)p0;
- if (p -> sin_family == AF_INET)
- {
- memcpy(request + 2, &p -> sin_port, 2); // nwbo is ok here
- memcpy(request + 4, &p -> sin_addr, sizeof(struct in_addr));
- }
- else
- {
- /// \todo warn
- }
- }
- else
- {
- /// \todo warn
- }
- }
- strcpy(request + 8, GetSocks4Userid().c_str());
- size_t length = GetSocks4Userid().size() + 8 + 1;
- SendBuf(request, length);
- m_socks4_state = 0;
-}
-
-
-void TcpSocket::OnSocks4ConnectFailed()
-{
- Handler().LogError(this,"OnSocks4ConnectFailed",0,"connection to socks4 server failed, trying direct connection",LOG_LEVEL_WARNING);
- if (!Handler().Socks4TryDirect())
- {
- SetConnecting(false);
- SetCloseAndDelete();
- OnConnectFailed(); // just in case
- }
- else
- {
- SetRetryClientConnect();
- }
-}
-
-
-bool TcpSocket::OnSocks4Read()
-{
- switch (m_socks4_state)
- {
- case 0:
- ibuf.Read(&m_socks4_vn, 1);
- m_socks4_state = 1;
- break;
- case 1:
- ibuf.Read(&m_socks4_cd, 1);
- m_socks4_state = 2;
- break;
- case 2:
- if (GetInputLength() > 1)
- {
- ibuf.Read( (char *)&m_socks4_dstport, 2);
- m_socks4_state = 3;
- }
- else
- {
- return true;
- }
- break;
- case 3:
- if (GetInputLength() > 3)
- {
- ibuf.Read( (char *)&m_socks4_dstip, 4);
- SetSocks4(false);
-
- switch (m_socks4_cd)
- {
- case 90:
- OnConnect();
- Handler().LogError(this, "OnSocks4Read", 0, "Connection established", LOG_LEVEL_INFO);
- break;
- case 91:
- case 92:
- case 93:
- Handler().LogError(this,"OnSocks4Read",m_socks4_cd,"socks4 server reports connect failed",LOG_LEVEL_FATAL);
- SetConnecting(false);
- SetCloseAndDelete();
- OnConnectFailed();
- break;
- default:
- Handler().LogError(this,"OnSocks4Read",m_socks4_cd,"socks4 server unrecognized response",LOG_LEVEL_FATAL);
- SetCloseAndDelete();
- break;
- }
- }
- else
- {
- return true;
- }
- break;
- }
- return false;
-}
-#endif
-
-
-void TcpSocket::Sendf(const char *format, ...)
-{
- va_list ap;
- va_start(ap, format);
- char slask[5000]; // vsprintf / vsnprintf temporary
-#ifdef _WIN32
- vsprintf(slask, format, ap);
-#else
- vsnprintf(slask, 5000, format, ap);
-#endif
- va_end(ap);
- Send( slask );
-}
-
-
-#ifdef HAVE_OPENSSL
-void TcpSocket::OnSSLConnect()
-{
- SetNonblocking(true);
- {
- if (m_ssl_ctx)
- {
-DEB( fprintf(stderr, "SSL Context already initialized - closing socket\n");)
- SetCloseAndDelete(true);
- return;
- }
- InitSSLClient();
- }
- if (m_ssl_ctx)
- {
- /* Connect the SSL socket */
- m_ssl = SSL_new(m_ssl_ctx);
- if (!m_ssl)
- {
-DEB( fprintf(stderr, " m_ssl is NULL\n");)
- SetCloseAndDelete(true);
- return;
- }
- SSL_set_mode(m_ssl, SSL_MODE_AUTO_RETRY);
- m_sbio = BIO_new_socket((int)GetSocket(), BIO_NOCLOSE);
- if (!m_sbio)
- {
-DEB( fprintf(stderr, " m_sbio is NULL\n");)
- SetCloseAndDelete(true);
- return;
- }
- SSL_set_bio(m_ssl, m_sbio, m_sbio);
- if (!SSLNegotiate())
- {
- SetSSLNegotiate();
- }
- }
- else
- {
- SetCloseAndDelete();
- }
-}
-
-
-void TcpSocket::OnSSLAccept()
-{
- SetNonblocking(true);
- {
- if (m_ssl_ctx)
- {
-DEB( fprintf(stderr, "SSL Context already initialized - closing socket\n");)
- SetCloseAndDelete(true);
- return;
- }
- InitSSLServer();
- SetSSLServer();
- }
- if (m_ssl_ctx)
- {
- m_ssl = SSL_new(m_ssl_ctx);
- if (!m_ssl)
- {
-DEB( fprintf(stderr, " m_ssl is NULL\n");)
- SetCloseAndDelete(true);
- return;
- }
- SSL_set_mode(m_ssl, SSL_MODE_AUTO_RETRY);
- m_sbio = BIO_new_socket((int)GetSocket(), BIO_NOCLOSE);
- if (!m_sbio)
- {
-DEB( fprintf(stderr, " m_sbio is NULL\n");)
- SetCloseAndDelete(true);
- return;
- }
- SSL_set_bio(m_ssl, m_sbio, m_sbio);
-// if (!SSLNegotiate())
- {
- SetSSLNegotiate();
- }
- }
-}
-
-
-bool TcpSocket::SSLNegotiate()
-{
- if (!IsSSLServer()) // client
- {
- int r = SSL_connect(m_ssl);
- if (r > 0)
- {
- SetSSLNegotiate(false);
- /// \todo: resurrect certificate check... client
-// CheckCertificateChain( "");//ServerHOST);
- SetNonblocking(false);
- //
- {
- SetConnected();
- if (GetOutputLength())
- {
- OnWrite();
- }
- }
-#ifdef ENABLE_RECONNECT
- if (IsReconnect())
- OnReconnect();
- else
-#endif
- {
- OnConnect();
- }
- Handler().LogError(this, "SSLNegotiate/SSL_connect", 0, "Connection established", LOG_LEVEL_INFO);
- return true;
- }
- else
- if (!r)
- {
- Handler().LogError(this, "SSLNegotiate/SSL_connect", 0, "Connection failed", LOG_LEVEL_INFO);
- SetSSLNegotiate(false);
- SetCloseAndDelete();
- OnSSLConnectFailed();
- }
- else
- {
- r = SSL_get_error(m_ssl, r);
- if (r != SSL_ERROR_WANT_READ && r != SSL_ERROR_WANT_WRITE)
- {
- Handler().LogError(this, "SSLNegotiate/SSL_connect", -1, "Connection failed", LOG_LEVEL_INFO);
-DEB( fprintf(stderr, "SSL_connect() failed - closing socket, return code: %d\n",r);)
- SetSSLNegotiate(false);
- SetCloseAndDelete(true);
- OnSSLConnectFailed();
- }
- }
- }
- else // server
- {
- int r = SSL_accept(m_ssl);
- if (r > 0)
- {
- SetSSLNegotiate(false);
- /// \todo: resurrect certificate check... server
-// CheckCertificateChain( "");//ClientHOST);
- SetNonblocking(false);
- //
- {
- SetConnected();
- if (GetOutputLength())
- {
- OnWrite();
- }
- }
- OnAccept();
- Handler().LogError(this, "SSLNegotiate/SSL_accept", 0, "Connection established", LOG_LEVEL_INFO);
- return true;
- }
- else
- if (!r)
- {
- Handler().LogError(this, "SSLNegotiate/SSL_accept", 0, "Connection failed", LOG_LEVEL_INFO);
- SetSSLNegotiate(false);
- SetCloseAndDelete();
- OnSSLAcceptFailed();
- }
- else
- {
- r = SSL_get_error(m_ssl, r);
- if (r != SSL_ERROR_WANT_READ && r != SSL_ERROR_WANT_WRITE)
- {
- Handler().LogError(this, "SSLNegotiate/SSL_accept", -1, "Connection failed", LOG_LEVEL_INFO);
-DEB( fprintf(stderr, "SSL_accept() failed - closing socket, return code: %d\n",r);)
- SetSSLNegotiate(false);
- SetCloseAndDelete(true);
- OnSSLAcceptFailed();
- }
- }
- }
- return false;
-}
-
-
-void TcpSocket::InitSSLClient()
-{
- InitializeContext("", SSLv23_method());
-}
-
-
-void TcpSocket::InitSSLServer()
-{
- Handler().LogError(this, "InitSSLServer", 0, "You MUST implement your own InitSSLServer method", LOG_LEVEL_FATAL);
- SetCloseAndDelete();
-}
-
-
-void TcpSocket::InitializeContext(const std::string& context, SSL_METHOD *meth_in)
-{
- /* Create our context*/
- static std::map client_contexts;
- if (client_contexts.find(context) == client_contexts.end())
- {
- SSL_METHOD *meth = meth_in ? meth_in : SSLv3_method();
- m_ssl_ctx = client_contexts[context] = SSL_CTX_new(meth);
- SSL_CTX_set_mode(m_ssl_ctx, SSL_MODE_AUTO_RETRY);
- }
- else
- {
- m_ssl_ctx = client_contexts[context];
- }
-}
-
-
-void TcpSocket::InitializeContext(const std::string& context,const std::string& keyfile,const std::string& password,SSL_METHOD *meth_in)
-{
- /* Create our context*/
- static std::map server_contexts;
- if (server_contexts.find(context) == server_contexts.end())
- {
- SSL_METHOD *meth = meth_in ? meth_in : SSLv3_method();
- m_ssl_ctx = server_contexts[context] = SSL_CTX_new(meth);
- SSL_CTX_set_mode(m_ssl_ctx, SSL_MODE_AUTO_RETRY);
- // session id
- if (!context.empty())
- SSL_CTX_set_session_id_context(m_ssl_ctx, (const unsigned char *)context.c_str(), (unsigned int)context.size());
- else
- SSL_CTX_set_session_id_context(m_ssl_ctx, (const unsigned char *)"--empty--", 9);
- }
- else
- {
- m_ssl_ctx = server_contexts[context];
- }
-
- /* Load our keys and certificates*/
- if (!(SSL_CTX_use_certificate_file(m_ssl_ctx, keyfile.c_str(), SSL_FILETYPE_PEM)))
- {
- Handler().LogError(this, "TcpSocket InitializeContext", 0, "Couldn't read certificate file " + keyfile, LOG_LEVEL_FATAL);
- }
-
- m_password = password;
- SSL_CTX_set_default_passwd_cb(m_ssl_ctx, SSL_password_cb);
- SSL_CTX_set_default_passwd_cb_userdata(m_ssl_ctx, this);
- if (!(SSL_CTX_use_PrivateKey_file(m_ssl_ctx, keyfile.c_str(), SSL_FILETYPE_PEM)))
- {
- Handler().LogError(this, "TcpSocket InitializeContext", 0, "Couldn't read private key file " + keyfile, LOG_LEVEL_FATAL);
- }
-}
-
-
-void TcpSocket::InitializeContext(const std::string& context,const std::string& certfile,const std::string& keyfile,const std::string& password,SSL_METHOD *meth_in)
-{
- /* Create our context*/
- static std::map server_contexts;
- if (server_contexts.find(context) == server_contexts.end())
- {
- SSL_METHOD *meth = meth_in ? meth_in : SSLv3_method();
- m_ssl_ctx = server_contexts[context] = SSL_CTX_new(meth);
- SSL_CTX_set_mode(m_ssl_ctx, SSL_MODE_AUTO_RETRY);
- // session id
- if (context.size())
- SSL_CTX_set_session_id_context(m_ssl_ctx, (const unsigned char *)context.c_str(), (unsigned int)context.size());
- else
- SSL_CTX_set_session_id_context(m_ssl_ctx, (const unsigned char *)"--empty--", 9);
- }
- else
- {
- m_ssl_ctx = server_contexts[context];
- }
-
- /* Load our keys and certificates*/
- if (!(SSL_CTX_use_certificate_file(m_ssl_ctx, certfile.c_str(), SSL_FILETYPE_PEM)))
- {
- Handler().LogError(this, "TcpSocket InitializeContext", 0, "Couldn't read certificate file " + keyfile, LOG_LEVEL_FATAL);
- }
-
- m_password = password;
- SSL_CTX_set_default_passwd_cb(m_ssl_ctx, SSL_password_cb);
- SSL_CTX_set_default_passwd_cb_userdata(m_ssl_ctx, this);
- if (!(SSL_CTX_use_PrivateKey_file(m_ssl_ctx, keyfile.c_str(), SSL_FILETYPE_PEM)))
- {
- Handler().LogError(this, "TcpSocket InitializeContext", 0, "Couldn't read private key file " + keyfile, LOG_LEVEL_FATAL);
- }
-}
-
-
-int TcpSocket::SSL_password_cb(char *buf,int num,int rwflag,void *userdata)
-{
- Socket *p0 = static_cast(userdata);
- TcpSocket *p = dynamic_cast(p0);
- std::string pw = p ? p -> GetPassword() : "";
- if ( (size_t)num < pw.size() + 1)
- {
- return 0;
- }
- strcpy(buf,pw.c_str());
- return (int)pw.size();
-}
-#endif // HAVE_OPENSSL
-
-
-int TcpSocket::Close()
-{
- if (GetSocket() == INVALID_SOCKET) // this could happen
- {
- Handler().LogError(this, "Socket::Close", 0, "file descriptor invalid", LOG_LEVEL_WARNING);
- return 0;
- }
- int n;
- SetNonblocking(true);
- if (!Lost() && IsConnected() && !(GetShutdown() & SHUT_WR))
- {
- if (shutdown(GetSocket(), SHUT_WR) == -1)
- {
- // failed...
- Handler().LogError(this, "shutdown", Errno, StrError(Errno), LOG_LEVEL_ERROR);
- }
- }
- //
- char tmp[1000];
- if (!Lost() && (n = recv(GetSocket(),tmp,1000,0)) >= 0)
- {
- if (n)
- {
- Handler().LogError(this, "read() after shutdown", n, "bytes read", LOG_LEVEL_WARNING);
- }
- }
-#ifdef HAVE_OPENSSL
- if (IsSSL() && m_ssl)
- SSL_shutdown(m_ssl);
- if (m_ssl)
- {
- SSL_free(m_ssl);
- m_ssl = NULL;
- }
-#endif
- return Socket::Close();
-}
-
-
-#ifdef HAVE_OPENSSL
-SSL_CTX *TcpSocket::GetSslContext()
-{
- if (!m_ssl_ctx)
- Handler().LogError(this, "GetSslContext", 0, "SSL Context is NULL; check InitSSLServer/InitSSLClient", LOG_LEVEL_WARNING);
- return m_ssl_ctx;
-}
-
-SSL *TcpSocket::GetSsl()
-{
- if (!m_ssl)
- Handler().LogError(this, "GetSsl", 0, "SSL is NULL; check InitSSLServer/InitSSLClient", LOG_LEVEL_WARNING);
- return m_ssl;
-}
-#endif
-
-
-#ifdef ENABLE_RECONNECT
-void TcpSocket::SetReconnect(bool x)
-{
- m_b_reconnect = x;
-}
-#endif
-
-
-void TcpSocket::OnRawData(const char *buf_in,size_t len)
-{
-}
-
-
-size_t TcpSocket::GetInputLength()
-{
- return ibuf.GetLength();
-}
-
-
-size_t TcpSocket::GetOutputLength()
-{
- return m_output_length;
-}
-
-
-uint64_t TcpSocket::GetBytesReceived(bool clear)
-{
- uint64_t z = m_bytes_received;
- if (clear)
- m_bytes_received = 0;
- return z;
-}
-
-
-uint64_t TcpSocket::GetBytesSent(bool clear)
-{
- uint64_t z = m_bytes_sent;
- if (clear)
- m_bytes_sent = 0;
- return z;
-}
-
-
-#ifdef ENABLE_RECONNECT
-bool TcpSocket::Reconnect()
-{
- return m_b_reconnect;
-}
-
-
-void TcpSocket::SetIsReconnect(bool x)
-{
- m_b_is_reconnect = x;
-}
-
-
-bool TcpSocket::IsReconnect()
-{
- return m_b_is_reconnect;
-}
-#endif
-
-
-#ifdef HAVE_OPENSSL
-const std::string& TcpSocket::GetPassword()
-{
- return m_password;
-}
-#endif
-
-
-void TcpSocket::DisableInputBuffer(bool x)
-{
- m_b_input_buffer_disabled = x;
-}
-
-
-void TcpSocket::OnOptions(int family,int type,int protocol,SOCKET s)
-{
-DEB( fprintf(stderr, "Socket::OnOptions()\n");)
-#ifdef SO_NOSIGPIPE
- SetSoNosigpipe(true);
-#endif
- SetSoReuseaddr(true);
- SetSoKeepalive(true);
-}
-
-
-void TcpSocket::SetLineProtocol(bool x)
-{
- StreamSocket::SetLineProtocol(x);
- DisableInputBuffer(x);
-}
-
-
-bool TcpSocket::SetTcpNodelay(bool x)
-{
-#ifdef TCP_NODELAY
- int optval = x ? 1 : 0;
- if (setsockopt(GetSocket(), IPPROTO_TCP, TCP_NODELAY, (char *)&optval, sizeof(optval)) == -1)
- {
- Handler().LogError(this, "setsockopt(IPPROTO_TCP, TCP_NODELAY)", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- return false;
- }
- return true;
-#else
- Handler().LogError(this, "socket option not available", 0, "TCP_NODELAY", LOG_LEVEL_INFO);
- return false;
-#endif
-}
-
-
-TcpSocket::CircularBuffer::CircularBuffer(size_t size)
-:buf(new char[2 * size])
-,m_max(size)
-,m_q(0)
-,m_b(0)
-,m_t(0)
-,m_count(0)
-{
-}
-
-
-TcpSocket::CircularBuffer::~CircularBuffer()
-{
- delete[] buf;
-}
-
-
-bool TcpSocket::CircularBuffer::Write(const char *s,size_t l)
-{
- if (m_q + l > m_max)
- {
- return false; // overflow
- }
- m_count += (unsigned long)l;
- if (m_t + l > m_max) // block crosses circular border
- {
- size_t l1 = m_max - m_t; // size left until circular border crossing
- // always copy full block to buffer(buf) + top pointer(m_t)
- // because we have doubled the buffer size for performance reasons
- memcpy(buf + m_t, s, l);
- memcpy(buf, s + l1, l - l1);
- m_t = l - l1;
- m_q += l;
- }
- else
- {
- memcpy(buf + m_t, s, l);
- memcpy(buf + m_max + m_t, s, l);
- m_t += l;
- if (m_t >= m_max)
- m_t -= m_max;
- m_q += l;
- }
- return true;
-}
-
-
-bool TcpSocket::CircularBuffer::Read(char *s,size_t l)
-{
- if (l > m_q)
- {
- return false; // not enough chars
- }
- if (m_b + l > m_max) // block crosses circular border
- {
- size_t l1 = m_max - m_b;
- if (s)
- {
- memcpy(s, buf + m_b, l1);
- memcpy(s + l1, buf, l - l1);
- }
- m_b = l - l1;
- m_q -= l;
- }
- else
- {
- if (s)
- {
- memcpy(s, buf + m_b, l);
- }
- m_b += l;
- if (m_b >= m_max)
- m_b -= m_max;
- m_q -= l;
- }
- if (!m_q)
- {
- m_b = m_t = 0;
- }
- return true;
-}
-
-bool TcpSocket::CircularBuffer::SoftRead(char *s, size_t l)
-{
- if (l > m_q)
- {
- return false;
- }
- if (m_b + l > m_max) // block crosses circular border
- {
- size_t l1 = m_max - m_b;
- if (s)
- {
- memcpy(s, buf + m_b, l1);
- memcpy(s + l1, buf, l - l1);
- }
- }
- else
- {
- if (s)
- {
- memcpy(s, buf + m_b, l);
- }
- }
- return true;
-}
-
-bool TcpSocket::CircularBuffer::Remove(size_t l)
-{
- return Read(NULL, l);
-}
-
-
-size_t TcpSocket::CircularBuffer::GetLength()
-{
- return m_q;
-}
-
-
-const char *TcpSocket::CircularBuffer::GetStart()
-{
- return buf + m_b;
-}
-
-
-size_t TcpSocket::CircularBuffer::GetL()
-{
- return (m_b + m_q > m_max) ? m_max - m_b : m_q;
-}
-
-
-size_t TcpSocket::CircularBuffer::Space()
-{
- return m_max - m_q;
-}
-
-
-unsigned long TcpSocket::CircularBuffer::ByteCounter(bool clear)
-{
- if (clear)
- {
- unsigned long x = m_count;
- m_count = 0;
- return x;
- }
- return m_count;
-}
-
-
-std::string TcpSocket::CircularBuffer::ReadString(size_t l)
-{
- char *sz = new char[l + 1];
- if (!Read(sz, l)) // failed, debug printout in Read() method
- {
- delete[] sz;
- return "";
- }
- sz[l] = 0;
- std::string tmp = sz;
- delete[] sz;
- return tmp;
-}
-
-
-void TcpSocket::OnConnectTimeout()
-{
- Handler().LogError(this, "connect", -1, "connect timeout", LOG_LEVEL_FATAL);
-#ifdef ENABLE_SOCKS4
- if (Socks4())
- {
- OnSocks4ConnectFailed();
- // retry direct connection
- }
- else
-#endif
- if (GetConnectionRetry() == -1 ||
- (GetConnectionRetry() && GetConnectionRetries() < GetConnectionRetry()) )
- {
- IncreaseConnectionRetries();
- // ask socket via OnConnectRetry callback if we should continue trying
- if (OnConnectRetry())
- {
- SetRetryClientConnect();
- }
- else
- {
- SetCloseAndDelete( true );
- /// \todo state reason why connect failed
- OnConnectFailed();
- }
- }
- else
- {
- SetCloseAndDelete(true);
- /// \todo state reason why connect failed
- OnConnectFailed();
- }
- //
- SetConnecting(false);
-}
-
-
-#ifdef _WIN32
-void TcpSocket::OnException()
-{
- if (Connecting())
- {
-#ifdef ENABLE_SOCKS4
- if (Socks4())
- OnSocks4ConnectFailed();
- else
-#endif
- if (GetConnectionRetry() == -1 ||
- (GetConnectionRetry() &&
- GetConnectionRetries() < GetConnectionRetry() ))
- {
- // even though the connection failed at once, only retry after
- // the connection timeout
- // should we even try to connect again, when CheckConnect returns
- // false it's because of a connection error - not a timeout...
- }
- else
- {
- SetConnecting(false); // tnx snibbe
- SetCloseAndDelete();
- OnConnectFailed();
- }
- return;
- }
- // %! exception doesn't always mean something bad happened, this code should be reworked
- // errno valid here?
- int err = SoError();
- Handler().LogError(this, "exception on select", err, StrError(err), LOG_LEVEL_FATAL);
- SetCloseAndDelete();
-}
-#endif // _WIN32
-
-
-int TcpSocket::Protocol()
-{
- return IPPROTO_TCP;
-}
-
-
-void TcpSocket::SetTransferLimit(size_t sz)
-{
- m_transfer_limit = sz;
-}
-
-
-void TcpSocket::OnTransferLimit()
-{
-}
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
diff --git a/dep/src/sockets/Thread.cpp b/dep/src/sockets/Thread.cpp
deleted file mode 100644
index 2717e32d0..000000000
--- a/dep/src/sockets/Thread.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-/** \file Thread.cpp
- ** \date 2004-10-30
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#include
-#ifdef _WIN32
-#include
-#include "socket_include.h"
-#else
-#include
-#endif
-
-#include "Thread.h"
-
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-Thread::Thread(bool release)
-:m_thread(0)
-,m_running(true)
-,m_release(false)
-,m_b_delete_on_exit(false)
-,m_b_destructor(false)
-{
-#ifdef _WIN32
-// m_thread = ::CreateThread(NULL, 0, StartThread, this, 0, &m_dwThreadId);
- m_thread = (HANDLE)_beginthreadex(NULL, 0, &StartThread, this, 0, &m_dwThreadId);
-#else
- pthread_attr_t attr;
-
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED);
- if (pthread_create(&m_thread,&attr, StartThread,this) == -1)
- {
- perror("Thread: create failed");
- SetRunning(false);
- }
-// pthread_attr_destroy(&attr);
-#endif
- m_release = release;
-}
-
-
-Thread::~Thread()
-{
- m_b_destructor = true;
- if (m_running)
- {
- SetRelease(true);
- SetRunning(false);
-#ifdef _WIN32
- Sleep(1000);
-#else
- sleep(1);
-#endif
- }
-#ifdef _WIN32
- if (m_thread)
- ::CloseHandle(m_thread);
-#endif
-}
-
-
-threadfunc_t STDPREFIX Thread::StartThread(threadparam_t zz)
-{
- Thread *p = (Thread *)zz;
-
- while (p -> m_running && !p -> m_release)
- {
-#ifdef _WIN32
- Sleep(1000);
-#else
- sleep(1);
-#endif
- }
- if (p -> m_running)
- {
- p -> Run();
- }
- p -> SetRunning(false); // if return
- if (p -> DeleteOnExit() && !p -> IsDestructor())
- {
- delete p;
- }
-#ifdef _WIN32
- _endthreadex(0);
-#endif
- return (threadfunc_t)NULL;
-}
-
-
-bool Thread::IsRunning()
-{
- return m_running;
-}
-
-
-void Thread::SetRunning(bool x)
-{
- m_running = x;
-}
-
-
-bool Thread::IsReleased()
-{
- return m_release;
-}
-
-
-void Thread::SetRelease(bool x)
-{
- m_release = x;
-}
-
-
-bool Thread::DeleteOnExit()
-{
- return m_b_delete_on_exit;
-}
-
-
-void Thread::SetDeleteOnExit(bool x)
-{
- m_b_delete_on_exit = x;
-}
-
-
-bool Thread::IsDestructor()
-{
- return m_b_destructor;
-}
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-
diff --git a/dep/src/sockets/UdpSocket.cpp b/dep/src/sockets/UdpSocket.cpp
deleted file mode 100644
index 5d949496b..000000000
--- a/dep/src/sockets/UdpSocket.cpp
+++ /dev/null
@@ -1,852 +0,0 @@
-/** \file UdpSocket.cpp
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#ifdef _WIN32
-#ifdef _MSC_VER
-#pragma warning(disable:4786)
-#endif
-#include
-#else
-#include
-#endif
-
-#include "ISocketHandler.h"
-#include "UdpSocket.h"
-#include "Utility.h"
-#include "Ipv4Address.h"
-#include "Ipv6Address.h"
-#ifdef ENABLE_EXCEPTIONS
-#include "Exception.h"
-#endif
-// include this to see strange sights
-//#include
-
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-UdpSocket::UdpSocket(ISocketHandler& h, int ibufsz, bool ipv6, int retries) : Socket(h)
-, m_ibuf(new char[ibufsz])
-, m_ibufsz(ibufsz)
-, m_bind_ok(false)
-, m_port(0)
-, m_last_size_written(-1)
-, m_retries(retries)
-, m_b_read_ts(false)
-{
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- SetIpv6(ipv6);
-#endif
-#endif
-}
-
-
-UdpSocket::~UdpSocket()
-{
- Close();
- delete[] m_ibuf;
-}
-
-
-int UdpSocket::Bind(port_t &port, int range)
-{
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- Ipv6Address ad(port);
- return Bind(ad, range);
- }
-#endif
-#endif
- Ipv4Address ad(port);
- return Bind(ad, range);
-}
-
-
-int UdpSocket::Bind(const std::string& intf, port_t &port, int range)
-{
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- Ipv6Address ad(intf, port);
- if (ad.IsValid())
- {
- return Bind(ad, range);
- }
- SetCloseAndDelete();
- return -1;
- }
-#endif
-#endif
- Ipv4Address ad(intf, port);
- if (ad.IsValid())
- {
- return Bind(ad, range);
- }
- SetCloseAndDelete();
- return -1;
-}
-
-
-int UdpSocket::Bind(ipaddr_t a, port_t &port, int range)
-{
- Ipv4Address ad(a, port);
- return Bind(ad, range);
-}
-
-
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
-int UdpSocket::Bind(in6_addr a, port_t &port, int range)
-{
- Ipv6Address ad(a, port);
- return Bind(ad, range);
-}
-#endif
-#endif
-
-
-int UdpSocket::Bind(SocketAddress& ad, int range)
-{
- if (GetSocket() == INVALID_SOCKET)
- {
- Attach(CreateSocket(ad.GetFamily(), SOCK_DGRAM, "udp"));
- }
- if (GetSocket() != INVALID_SOCKET)
- {
- SetNonblocking(true);
- int n = bind(GetSocket(), ad, ad);
- int tries = range;
- while (n == -1 && tries--)
- {
- ad.SetPort(ad.GetPort() + 1);
- n = bind(GetSocket(), ad, ad);
- }
- if (n == -1)
- {
- Handler().LogError(this, "bind", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- SetCloseAndDelete();
-#ifdef ENABLE_EXCEPTIONS
- throw Exception("bind() failed for UdpSocket, port:range: " + Utility::l2string(ad.GetPort()) + ":" + Utility::l2string(range));
-#endif
- return -1;
- }
- m_bind_ok = true;
- m_port = ad.GetPort();
- return 0;
- }
- return -1;
-}
-
-
-/** if you wish to use Send, first Open a connection */
-bool UdpSocket::Open(ipaddr_t l, port_t port)
-{
- Ipv4Address ad(l, port);
- return Open(ad);
-}
-
-
-bool UdpSocket::Open(const std::string& host, port_t port)
-{
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- Ipv6Address ad(host, port);
- if (ad.IsValid())
- {
- return Open(ad);
- }
- return false;
- }
-#endif
-#endif
- Ipv4Address ad(host, port);
- if (ad.IsValid())
- {
- return Open(ad);
- }
- return false;
-}
-
-
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
-bool UdpSocket::Open(struct in6_addr& a, port_t port)
-{
- Ipv6Address ad(a, port);
- return Open(ad);
-}
-#endif
-#endif
-
-
-bool UdpSocket::Open(SocketAddress& ad)
-{
- if (GetSocket() == INVALID_SOCKET)
- {
- Attach(CreateSocket(ad.GetFamily(), SOCK_DGRAM, "udp"));
- }
- if (GetSocket() != INVALID_SOCKET)
- {
- SetNonblocking(true);
- if (connect(GetSocket(), ad, ad) == -1)
- {
- Handler().LogError(this, "connect", Errno, StrError(Errno), LOG_LEVEL_FATAL);
- SetCloseAndDelete();
- return false;
- }
- SetConnected();
- return true;
- }
- return false;
-}
-
-
-void UdpSocket::CreateConnection()
-{
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- if (GetSocket() == INVALID_SOCKET)
- {
- SOCKET s = CreateSocket(AF_INET6, SOCK_DGRAM, "udp");
- if (s == INVALID_SOCKET)
- {
- return;
- }
- SetNonblocking(true, s);
- Attach(s);
- }
- return;
- }
-#endif
-#endif
- if (GetSocket() == INVALID_SOCKET)
- {
- SOCKET s = CreateSocket(AF_INET, SOCK_DGRAM, "udp");
- if (s == INVALID_SOCKET)
- {
- return;
- }
- SetNonblocking(true, s);
- Attach(s);
- }
-}
-
-
-/** send to specified address */
-void UdpSocket::SendToBuf(const std::string& h, port_t p, const char *data, int len, int flags)
-{
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- Ipv6Address ad(h, p);
- if (ad.IsValid())
- {
- SendToBuf(ad, data, len, flags);
- }
- return;
- }
-#endif
-#endif
- Ipv4Address ad(h, p);
- if (ad.IsValid())
- {
- SendToBuf(ad, data, len, flags);
- }
-}
-
-
-/** send to specified address */
-void UdpSocket::SendToBuf(ipaddr_t a, port_t p, const char *data, int len, int flags)
-{
- Ipv4Address ad(a, p);
- SendToBuf(ad, data, len, flags);
-}
-
-
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
-void UdpSocket::SendToBuf(in6_addr a, port_t p, const char *data, int len, int flags)
-{
- Ipv6Address ad(a, p);
- SendToBuf(ad, data, len, flags);
-}
-#endif
-#endif
-
-
-void UdpSocket::SendToBuf(SocketAddress& ad, const char *data, int len, int flags)
-{
- if (GetSocket() == INVALID_SOCKET)
- {
- Attach(CreateSocket(ad.GetFamily(), SOCK_DGRAM, "udp"));
- }
- if (GetSocket() != INVALID_SOCKET)
- {
- SetNonblocking(true);
- if ((m_last_size_written = sendto(GetSocket(), data, len, flags, ad, ad)) == -1)
- {
- Handler().LogError(this, "sendto", Errno, StrError(Errno), LOG_LEVEL_ERROR);
- }
- }
-}
-
-
-void UdpSocket::SendTo(const std::string& a, port_t p, const std::string& str, int flags)
-{
- SendToBuf(a, p, str.c_str(), (int)str.size(), flags);
-}
-
-
-void UdpSocket::SendTo(ipaddr_t a, port_t p, const std::string& str, int flags)
-{
- SendToBuf(a, p, str.c_str(), (int)str.size(), flags);
-}
-
-
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
-void UdpSocket::SendTo(in6_addr a, port_t p, const std::string& str, int flags)
-{
- SendToBuf(a, p, str.c_str(), (int)str.size(), flags);
-}
-#endif
-#endif
-
-
-void UdpSocket::SendTo(SocketAddress& ad, const std::string& str, int flags)
-{
- SendToBuf(ad, str.c_str(), (int)str.size(), flags);
-}
-
-
-/** send to connected address */
-void UdpSocket::SendBuf(const char *data, size_t len, int flags)
-{
- if (!IsConnected())
- {
- Handler().LogError(this, "SendBuf", 0, "not connected", LOG_LEVEL_ERROR);
- return;
- }
- if ((m_last_size_written = send(GetSocket(), data, (int)len, flags)) == -1)
- {
- Handler().LogError(this, "send", Errno, StrError(Errno), LOG_LEVEL_ERROR);
- }
-}
-
-
-void UdpSocket::Send(const std::string& str, int flags)
-{
- SendBuf(str.c_str(), (int)str.size(), flags);
-}
-
-
-#if defined(LINUX) || defined(MACOSX)
-int UdpSocket::ReadTS(char *ioBuf, int inBufSize, struct sockaddr *from, socklen_t fromlen, struct timeval *ts)
-{
- struct msghdr msg;
- struct iovec vec[1];
- union {
- struct cmsghdr cm;
-#ifdef MACOSX
-#ifdef __DARWIN_UNIX03
-#define ALIGNBYTES __DARWIN_ALIGNBYTES
-#endif
-#define myALIGN(p) (((unsigned int)(p) + ALIGNBYTES) &~ ALIGNBYTES)
-#define myCMSG_SPACE(l) (myALIGN(sizeof(struct cmsghdr)) + myALIGN(l))
- char data[ myCMSG_SPACE(sizeof(struct timeval)) ];
-#else
- char data[ CMSG_SPACE(sizeof(struct timeval)) ];
-#endif
- } cmsg_un;
- struct cmsghdr *cmsg;
- struct timeval *tv;
-
- vec[0].iov_base = ioBuf;
- vec[0].iov_len = inBufSize;
-
- memset(&msg, 0, sizeof(msg));
- memset(from, 0, fromlen);
- memset(ioBuf, 0, inBufSize);
- memset(&cmsg_un, 0, sizeof(cmsg_un));
-
- msg.msg_name = (caddr_t)from;
- msg.msg_namelen = fromlen;
- msg.msg_iov = vec;
- msg.msg_iovlen = 1;
- msg.msg_control = cmsg_un.data;
- msg.msg_controllen = sizeof(cmsg_un.data);
- msg.msg_flags = 0;
-
- // Original version - for reference only
- //int n = recvfrom(GetSocket(), m_ibuf, m_ibufsz, 0, (struct sockaddr *)&sa, &sa_len);
-
- int n = recvmsg(GetSocket(), &msg, MSG_DONTWAIT);
-
- // now ioBuf will contain the data, as if we used recvfrom
-
- // Now get the time
- if(n != -1 && msg.msg_controllen >= sizeof(struct cmsghdr) && !(msg.msg_flags & MSG_CTRUNC))
- {
- tv = 0;
- for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; cmsg = CMSG_NXTHDR(&msg, cmsg))
- {
- if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_TIMESTAMP)
- {
- tv = (struct timeval *)CMSG_DATA(cmsg);
- }
- }
- if (tv)
- {
- memcpy(ts, tv, sizeof(struct timeval));
- }
- }
- // The address is in network order, but that's OK right now
- return n;
-}
-#endif
-
-
-void UdpSocket::OnRead()
-{
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- struct sockaddr_in6 sa;
- socklen_t sa_len = sizeof(sa);
- if (m_b_read_ts)
- {
- struct timeval ts;
- Utility::GetTime(&ts);
-#if !defined(LINUX) && !defined(MACOSX)
- int n = recvfrom(GetSocket(), m_ibuf, m_ibufsz, 0, (struct sockaddr *)&sa, &sa_len);
-#else
- int n = ReadTS(m_ibuf, m_ibufsz, (struct sockaddr *)&sa, sa_len, &ts);
-#endif
- if (n > 0)
- {
- this -> OnRawData(m_ibuf, n, (struct sockaddr *)&sa, sa_len, &ts);
- }
- else
- if (n == -1)
- {
-#ifdef _WIN32
- if (Errno != WSAEWOULDBLOCK)
-#else
- if (Errno != EWOULDBLOCK)
-#endif
- Handler().LogError(this, "recvfrom", Errno, StrError(Errno), LOG_LEVEL_ERROR);
- }
- return;
- }
- int n = recvfrom(GetSocket(), m_ibuf, m_ibufsz, 0, (struct sockaddr *)&sa, &sa_len);
- int q = m_retries; // receive max 10 at one cycle
- while (n > 0)
- {
- if (sa_len != sizeof(sa))
- {
- Handler().LogError(this, "recvfrom", 0, "unexpected address struct size", LOG_LEVEL_WARNING);
- }
- this -> OnRawData(m_ibuf, n, (struct sockaddr *)&sa, sa_len);
- if (!q--)
- break;
- //
- n = recvfrom(GetSocket(), m_ibuf, m_ibufsz, 0, (struct sockaddr *)&sa, &sa_len);
- }
- if (n == -1)
- {
-#ifdef _WIN32
- if (Errno != WSAEWOULDBLOCK)
-#else
- if (Errno != EWOULDBLOCK)
-#endif
- Handler().LogError(this, "recvfrom", Errno, StrError(Errno), LOG_LEVEL_ERROR);
- }
- return;
- }
-#endif
-#endif
- struct sockaddr_in sa;
- socklen_t sa_len = sizeof(sa);
- if (m_b_read_ts)
- {
- struct timeval ts;
- Utility::GetTime(&ts);
-#if !defined(LINUX) && !defined(MACOSX)
- int n = recvfrom(GetSocket(), m_ibuf, m_ibufsz, 0, (struct sockaddr *)&sa, &sa_len);
-#else
- int n = ReadTS(m_ibuf, m_ibufsz, (struct sockaddr *)&sa, sa_len, &ts);
-#endif
- if (n > 0)
- {
- this -> OnRawData(m_ibuf, n, (struct sockaddr *)&sa, sa_len, &ts);
- }
- else
- if (n == -1)
- {
-#ifdef _WIN32
- if (Errno != WSAEWOULDBLOCK)
-#else
- if (Errno != EWOULDBLOCK)
-#endif
- Handler().LogError(this, "recvfrom", Errno, StrError(Errno), LOG_LEVEL_ERROR);
- }
- return;
- }
- int n = recvfrom(GetSocket(), m_ibuf, m_ibufsz, 0, (struct sockaddr *)&sa, &sa_len);
- int q = m_retries;
- while (n > 0)
- {
- if (sa_len != sizeof(sa))
- {
- Handler().LogError(this, "recvfrom", 0, "unexpected address struct size", LOG_LEVEL_WARNING);
- }
- this -> OnRawData(m_ibuf, n, (struct sockaddr *)&sa, sa_len);
- if (!q--)
- break;
- //
- n = recvfrom(GetSocket(), m_ibuf, m_ibufsz, 0, (struct sockaddr *)&sa, &sa_len);
- }
- if (n == -1)
- {
-#ifdef _WIN32
- if (Errno != WSAEWOULDBLOCK)
-#else
- if (Errno != EWOULDBLOCK)
-#endif
- Handler().LogError(this, "recvfrom", Errno, StrError(Errno), LOG_LEVEL_ERROR);
- }
-}
-
-
-void UdpSocket::SetBroadcast(bool b)
-{
- int one = 1;
- int zero = 0;
-
- if (GetSocket() == INVALID_SOCKET)
- {
- CreateConnection();
- }
- if (b)
- {
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_BROADCAST, (char *) &one, sizeof(one)) == -1)
- {
- Handler().LogError(this, "SetBroadcast", Errno, StrError(Errno), LOG_LEVEL_WARNING);
- }
- }
- else
- {
- if (setsockopt(GetSocket(), SOL_SOCKET, SO_BROADCAST, (char *) &zero, sizeof(zero)) == -1)
- {
- Handler().LogError(this, "SetBroadcast", Errno, StrError(Errno), LOG_LEVEL_WARNING);
- }
- }
-}
-
-
-bool UdpSocket::IsBroadcast()
-{
- int is_broadcast = 0;
- socklen_t size;
-
- if (GetSocket() == INVALID_SOCKET)
- {
- CreateConnection();
- }
- if (getsockopt(GetSocket(), SOL_SOCKET, SO_BROADCAST, (char *)&is_broadcast, &size) == -1)
- {
- Handler().LogError(this, "IsBroadcast", Errno, StrError(Errno), LOG_LEVEL_WARNING);
- }
- return is_broadcast != 0;
-}
-
-
-void UdpSocket::SetMulticastTTL(int ttl)
-{
- if (GetSocket() == INVALID_SOCKET)
- {
- CreateConnection();
- }
- if (setsockopt(GetSocket(), SOL_IP, IP_MULTICAST_TTL, (char *)&ttl, sizeof(int)) == -1)
- {
- Handler().LogError(this, "SetMulticastTTL", Errno, StrError(Errno), LOG_LEVEL_WARNING);
- }
-}
-
-
-int UdpSocket::GetMulticastTTL()
-{
- int ttl = 0;
- socklen_t size = sizeof(int);
-
- if (GetSocket() == INVALID_SOCKET)
- {
- CreateConnection();
- }
- if (getsockopt(GetSocket(), SOL_IP, IP_MULTICAST_TTL, (char *)&ttl, &size) == -1)
- {
- Handler().LogError(this, "GetMulticastTTL", Errno, StrError(Errno), LOG_LEVEL_WARNING);
- }
- return ttl;
-}
-
-
-void UdpSocket::SetMulticastLoop(bool x)
-{
- if (GetSocket() == INVALID_SOCKET)
- {
- CreateConnection();
- }
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- int val = x ? 1 : 0;
- if (setsockopt(GetSocket(), IPPROTO_IPV6, IPV6_MULTICAST_LOOP, (char *)&val, sizeof(int)) == -1)
- {
- Handler().LogError(this, "SetMulticastLoop", Errno, StrError(Errno), LOG_LEVEL_WARNING);
- }
- return;
- }
-#endif
-#endif
- int val = x ? 1 : 0;
- if (setsockopt(GetSocket(), SOL_IP, IP_MULTICAST_LOOP, (char *)&val, sizeof(int)) == -1)
- {
- Handler().LogError(this, "SetMulticastLoop", Errno, StrError(Errno), LOG_LEVEL_WARNING);
- }
-}
-
-
-bool UdpSocket::IsMulticastLoop()
-{
- if (GetSocket() == INVALID_SOCKET)
- {
- CreateConnection();
- }
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- int is_loop = 0;
- socklen_t size = sizeof(int);
- if (getsockopt(GetSocket(), IPPROTO_IPV6, IPV6_MULTICAST_LOOP, (char *)&is_loop, &size) == -1)
- {
- Handler().LogError(this, "IsMulticastLoop", Errno, StrError(Errno), LOG_LEVEL_WARNING);
- }
- return is_loop ? true : false;
- }
-#endif
-#endif
- int is_loop = 0;
- socklen_t size = sizeof(int);
- if (getsockopt(GetSocket(), SOL_IP, IP_MULTICAST_LOOP, (char *)&is_loop, &size) == -1)
- {
- Handler().LogError(this, "IsMulticastLoop", Errno, StrError(Errno), LOG_LEVEL_WARNING);
- }
- return is_loop ? true : false;
-}
-
-
-void UdpSocket::AddMulticastMembership(const std::string& group, const std::string& local_if, int if_index)
-{
- if (GetSocket() == INVALID_SOCKET)
- {
- CreateConnection();
- }
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- struct ipv6_mreq x;
- struct in6_addr addr;
- if (Utility::u2ip( group, addr ))
- {
- x.ipv6mr_multiaddr = addr;
- x.ipv6mr_interface = if_index;
- if (setsockopt(GetSocket(), IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, (char *)&x, sizeof(struct ipv6_mreq)) == -1)
- {
- Handler().LogError(this, "AddMulticastMembership", Errno, StrError(Errno), LOG_LEVEL_WARNING);
- }
- }
- return;
- }
-#endif
-#endif
- struct ip_mreq x; // ip_mreqn
- ipaddr_t addr;
- if (Utility::u2ip( group, addr ))
- {
- memcpy(&x.imr_multiaddr.s_addr, &addr, sizeof(addr));
- Utility::u2ip( local_if, addr);
- memcpy(&x.imr_interface.s_addr, &addr, sizeof(addr));
-// x.imr_ifindex = if_index;
- if (setsockopt(GetSocket(), SOL_IP, IP_ADD_MEMBERSHIP, (char *)&x, sizeof(struct ip_mreq)) == -1)
- {
- Handler().LogError(this, "AddMulticastMembership", Errno, StrError(Errno), LOG_LEVEL_WARNING);
- }
- }
-}
-
-
-void UdpSocket::DropMulticastMembership(const std::string& group, const std::string& local_if, int if_index)
-{
- if (GetSocket() == INVALID_SOCKET)
- {
- CreateConnection();
- }
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (IsIpv6())
- {
- struct ipv6_mreq x;
- struct in6_addr addr;
- if (Utility::u2ip( group, addr ))
- {
- x.ipv6mr_multiaddr = addr;
- x.ipv6mr_interface = if_index;
- if (setsockopt(GetSocket(), IPPROTO_IPV6, IPV6_DROP_MEMBERSHIP, (char *)&x, sizeof(struct ipv6_mreq)) == -1)
- {
- Handler().LogError(this, "DropMulticastMembership", Errno, StrError(Errno), LOG_LEVEL_WARNING);
- }
- }
- return;
- }
-#endif
-#endif
- struct ip_mreq x; // ip_mreqn
- ipaddr_t addr;
- if (Utility::u2ip( group, addr ))
- {
- memcpy(&x.imr_multiaddr.s_addr, &addr, sizeof(addr));
- Utility::u2ip( local_if, addr);
- memcpy(&x.imr_interface.s_addr, &addr, sizeof(addr));
-// x.imr_ifindex = if_index;
- if (setsockopt(GetSocket(), SOL_IP, IP_DROP_MEMBERSHIP, (char *)&x, sizeof(struct ip_mreq)) == -1)
- {
- Handler().LogError(this, "DropMulticastMembership", Errno, StrError(Errno), LOG_LEVEL_WARNING);
- }
- }
-}
-
-
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
-void UdpSocket::SetMulticastHops(int hops)
-{
- if (GetSocket() == INVALID_SOCKET)
- {
- CreateConnection();
- }
- if (!IsIpv6())
- {
- Handler().LogError(this, "SetMulticastHops", 0, "Ipv6 only", LOG_LEVEL_ERROR);
- return;
- }
- if (setsockopt(GetSocket(), IPPROTO_IPV6, IPV6_MULTICAST_HOPS, (char *)&hops, sizeof(int)) == -1)
- {
- Handler().LogError(this, "SetMulticastHops", Errno, StrError(Errno), LOG_LEVEL_WARNING);
- }
-}
-
-
-int UdpSocket::GetMulticastHops()
-{
- if (GetSocket() == INVALID_SOCKET)
- {
- CreateConnection();
- }
- if (!IsIpv6())
- {
- Handler().LogError(this, "SetMulticastHops", 0, "Ipv6 only", LOG_LEVEL_ERROR);
- return -1;
- }
- int hops = 0;
- socklen_t size = sizeof(int);
- if (getsockopt(GetSocket(), IPPROTO_IPV6, IPV6_MULTICAST_HOPS, (char *)&hops, &size) == -1)
- {
- Handler().LogError(this, "GetMulticastHops", Errno, StrError(Errno), LOG_LEVEL_WARNING);
- }
- return hops;
-}
-#endif // IPPROTO_IPV6
-#endif
-
-
-bool UdpSocket::IsBound()
-{
- return m_bind_ok;
-}
-
-
-void UdpSocket::OnRawData(const char *buf, size_t len, struct sockaddr *sa, socklen_t sa_len)
-{
-}
-
-
-void UdpSocket::OnRawData(const char *buf, size_t len, struct sockaddr *sa, socklen_t sa_len, struct timeval *ts)
-{
-}
-
-
-port_t UdpSocket::GetPort()
-{
- return m_port;
-}
-
-
-int UdpSocket::GetLastSizeWritten()
-{
- return m_last_size_written;
-}
-
-
-void UdpSocket::SetTimestamp(bool x)
-{
- m_b_read_ts = x;
-}
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-
diff --git a/dep/src/sockets/Utility.cpp b/dep/src/sockets/Utility.cpp
deleted file mode 100644
index c1327035d..000000000
--- a/dep/src/sockets/Utility.cpp
+++ /dev/null
@@ -1,999 +0,0 @@
-/** \file Utility.cpp
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#include "Utility.h"
-#include "Parse.h"
-#include "Ipv4Address.h"
-#include "Ipv6Address.h"
-#include "Base64.h"
-#include
-#ifdef _WIN32
-#include
-#else
-#include
-#include
-#endif
-#include
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-// defines for the random number generator
-#define TWIST_IA 397
-#define TWIST_IB (TWIST_LEN - TWIST_IA)
-#define UMASK 0x80000000
-#define LMASK 0x7FFFFFFF
-#define MATRIX_A 0x9908B0DF
-#define TWIST(b,i,j) ((b)[i] & UMASK) | ((b)[j] & LMASK)
-#define MAGIC_TWIST(s) (((s) & 1) * MATRIX_A)
-
-
-// statics
-std::string Utility::m_host;
-bool Utility::m_local_resolved = false;
-ipaddr_t Utility::m_ip = 0;
-std::string Utility::m_addr;
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
-struct in6_addr Utility::m_local_ip6;
-std::string Utility::m_local_addr6;
-#endif
-#endif
-
-
-std::string Utility::base64(const std::string& str_in)
-{
- std::string str;
- Base64 m_b;
- m_b.encode(str_in, str, false); // , false == do not add cr/lf
- return str;
-}
-
-
-std::string Utility::base64d(const std::string& str_in)
-{
- std::string str;
- Base64 m_b;
- m_b.decode(str_in, str);
- return str;
-}
-
-
-std::string Utility::l2string(long l)
-{
- std::string str;
- char tmp[100];
- sprintf(tmp,"%ld",l);
- str = tmp;
- return str;
-}
-
-
-std::string Utility::bigint2string(uint64_t l)
-{
- std::string str;
- uint64_t tmp = l;
- while (tmp)
- {
- uint64_t a = tmp % 10;
- str = (char)(a + 48) + str;
- tmp /= 10;
- }
- if (str.empty())
- {
- str = "0";
- }
- return str;
-}
-
-
-uint64_t Utility::atoi64(const std::string& str)
-{
- uint64_t l = 0;
- for (size_t i = 0; i < str.size(); i++)
- {
- l = l * 10 + str[i] - 48;
- }
- return l;
-}
-
-
-unsigned int Utility::hex2unsigned(const std::string& str)
-{
- unsigned int r = 0;
- for (size_t i = 0; i < str.size(); i++)
- {
- r = r * 16 + str[i] - 48 - ((str[i] >= 'A') ? 7 : 0) - ((str[i] >= 'a') ? 32 : 0);
- }
- return r;
-}
-
-
-/*
-* Encode string per RFC1738 URL encoding rules
-* tnx rstaveley
-*/
-std::string Utility::rfc1738_encode(const std::string& src)
-{
-static char hex[] = "0123456789ABCDEF";
- std::string dst;
- for (size_t i = 0; i < src.size(); i++)
- {
- if (isalnum(src[i]))
- {
- dst += src[i];
- }
- else
- if (src[i] == ' ')
- {
- dst += '+';
- }
- else
- {
- unsigned char c = static_cast(src[i]);
- dst += '%';
- dst += hex[c / 16];
- dst += hex[c % 16];
- }
- }
- return dst;
-} // rfc1738_encode
-
-
-/*
-* Decode string per RFC1738 URL encoding rules
-* tnx rstaveley
-*/
-std::string Utility::rfc1738_decode(const std::string& src)
-{
- std::string dst;
- for (size_t i = 0; i < src.size(); i++)
- {
- if (src[i] == '%' && isxdigit(src[i + 1]) && isxdigit(src[i + 2]))
- {
- char c1 = src[++i];
- char c2 = src[++i];
- c1 = c1 - 48 - ((c1 >= 'A') ? 7 : 0) - ((c1 >= 'a') ? 32 : 0);
- c2 = c2 - 48 - ((c2 >= 'A') ? 7 : 0) - ((c2 >= 'a') ? 32 : 0);
- dst += (char)(c1 * 16 + c2);
- }
- else
- if (src[i] == '+')
- {
- dst += ' ';
- }
- else
- {
- dst += src[i];
- }
- }
- return dst;
-} // rfc1738_decode
-
-
-bool Utility::isipv4(const std::string& str)
-{
- int dots = 0;
- // %! ignore :port?
- for (size_t i = 0; i < str.size(); i++)
- {
- if (str[i] == '.')
- dots++;
- else
- if (!isdigit(str[i]))
- return false;
- }
- if (dots != 3)
- return false;
- return true;
-}
-
-
-bool Utility::isipv6(const std::string& str)
-{
- size_t qc = 0;
- size_t qd = 0;
- for (size_t i = 0; i < str.size(); i++)
- {
- qc += (str[i] == ':') ? 1 : 0;
- qd += (str[i] == '.') ? 1 : 0;
- }
- if (qc > 7)
- {
- return false;
- }
- if (qd && qd != 3)
- {
- return false;
- }
- Parse pa(str,":.");
- std::string tmp = pa.getword();
- while (!tmp.empty())
- {
- if (tmp.size() > 4)
- {
- return false;
- }
- for (size_t i = 0; i < tmp.size(); i++)
- {
- if (tmp[i] < '0' || (tmp[i] > '9' && tmp[i] < 'A') ||
- (tmp[i] > 'F' && tmp[i] < 'a') || tmp[i] > 'f')
- {
- return false;
- }
- }
- //
- tmp = pa.getword();
- }
- return true;
-}
-
-
-bool Utility::u2ip(const std::string& str, ipaddr_t& l)
-{
- struct sockaddr_in sa;
- bool r = Utility::u2ip(str, sa);
- memcpy(&l, &sa.sin_addr, sizeof(l));
- return r;
-}
-
-
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
-bool Utility::u2ip(const std::string& str, struct in6_addr& l)
-{
- struct sockaddr_in6 sa;
- bool r = Utility::u2ip(str, sa);
- l = sa.sin6_addr;
- return r;
-}
-#endif
-#endif
-
-
-void Utility::l2ip(const ipaddr_t ip, std::string& str)
-{
- struct sockaddr_in sa;
- memset(&sa, 0, sizeof(sa));
- sa.sin_family = AF_INET;
- memcpy(&sa.sin_addr, &ip, sizeof(sa.sin_addr));
- Utility::reverse( (struct sockaddr *)&sa, sizeof(sa), str, NI_NUMERICHOST);
-}
-
-
-void Utility::l2ip(const in_addr& ip, std::string& str)
-{
- struct sockaddr_in sa;
- memset(&sa, 0, sizeof(sa));
- sa.sin_family = AF_INET;
- sa.sin_addr = ip;
- Utility::reverse( (struct sockaddr *)&sa, sizeof(sa), str, NI_NUMERICHOST);
-}
-
-
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
-void Utility::l2ip(const struct in6_addr& ip, std::string& str,bool mixed)
-{
- char slask[100]; // l2ip temporary
- *slask = 0;
- unsigned int prev = 0;
- bool skipped = false;
- bool ok_to_skip = true;
- if (mixed)
- {
- unsigned short x;
- unsigned short addr16[8];
- memcpy(addr16, &ip, sizeof(addr16));
- for (size_t i = 0; i < 6; i++)
- {
- x = ntohs(addr16[i]);
- if (*slask && (x || !ok_to_skip || prev))
- strcat(slask,":");
- if (x || !ok_to_skip)
- {
- sprintf(slask + strlen(slask),"%x", x);
- if (x && skipped)
- ok_to_skip = false;
- }
- else
- {
- skipped = true;
- }
- prev = x;
- }
- x = ntohs(addr16[6]);
- sprintf(slask + strlen(slask),":%u.%u",x / 256,x & 255);
- x = ntohs(addr16[7]);
- sprintf(slask + strlen(slask),".%u.%u",x / 256,x & 255);
- }
- else
- {
- struct sockaddr_in6 sa;
- memset(&sa, 0, sizeof(sa));
- sa.sin6_family = AF_INET6;
- sa.sin6_addr = ip;
- Utility::reverse( (struct sockaddr *)&sa, sizeof(sa), str, NI_NUMERICHOST);
- return;
- }
- str = slask;
-}
-
-
-int Utility::in6_addr_compare(in6_addr a,in6_addr b)
-{
- for (size_t i = 0; i < 16; i++)
- {
- if (a.s6_addr[i] < b.s6_addr[i])
- return -1;
- if (a.s6_addr[i] > b.s6_addr[i])
- return 1;
- }
- return 0;
-}
-#endif
-#endif
-
-
-void Utility::ResolveLocal()
-{
- char h[256];
-
- // get local hostname and translate into ip-address
- *h = 0;
- gethostname(h,255);
- {
- if (Utility::u2ip(h, m_ip))
- {
- Utility::l2ip(m_ip, m_addr);
- }
- }
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- memset(&m_local_ip6, 0, sizeof(m_local_ip6));
- {
- if (Utility::u2ip(h, m_local_ip6))
- {
- Utility::l2ip(m_local_ip6, m_local_addr6);
- }
- }
-#endif
-#endif
- m_host = h;
- m_local_resolved = true;
-}
-
-
-const std::string& Utility::GetLocalHostname()
-{
- if (!m_local_resolved)
- {
- ResolveLocal();
- }
- return m_host;
-}
-
-
-ipaddr_t Utility::GetLocalIP()
-{
- if (!m_local_resolved)
- {
- ResolveLocal();
- }
- return m_ip;
-}
-
-
-const std::string& Utility::GetLocalAddress()
-{
- if (!m_local_resolved)
- {
- ResolveLocal();
- }
- return m_addr;
-}
-
-
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
-const struct in6_addr& Utility::GetLocalIP6()
-{
- if (!m_local_resolved)
- {
- ResolveLocal();
- }
- return m_local_ip6;
-}
-
-
-const std::string& Utility::GetLocalAddress6()
-{
- if (!m_local_resolved)
- {
- ResolveLocal();
- }
- return m_local_addr6;
-}
-#endif
-#endif
-
-
-void Utility::SetEnv(const std::string& var,const std::string& value)
-{
-#if (defined(SOLARIS8) || defined(SOLARIS))
- {
- static std::map vmap;
- if (vmap.find(var) != vmap.end())
- {
- delete[] vmap[var];
- }
- vmap[var] = new char[var.size() + 1 + value.size() + 1];
- sprintf(vmap[var], "%s=%s", var.c_str(), value.c_str());
- putenv( vmap[var] );
- }
-#elif defined _WIN32
- {
- std::string slask = var + "=" + value;
- _putenv( (char *)slask.c_str());
- }
-#else
- setenv(var.c_str(), value.c_str(), 1);
-#endif
-}
-
-
-std::string Utility::Sa2String(struct sockaddr *sa)
-{
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- if (sa -> sa_family == AF_INET6)
- {
- struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa;
- std::string tmp;
- Utility::l2ip(sa6 -> sin6_addr, tmp);
- return tmp + ":" + Utility::l2string(ntohs(sa6 -> sin6_port));
- }
-#endif
-#endif
- if (sa -> sa_family == AF_INET)
- {
- struct sockaddr_in *sa4 = (struct sockaddr_in *)sa;
- ipaddr_t a;
- memcpy(&a, &sa4 -> sin_addr, 4);
- std::string tmp;
- Utility::l2ip(a, tmp);
- return tmp + ":" + Utility::l2string(ntohs(sa4 -> sin_port));
- }
- return "";
-}
-
-
-void Utility::GetTime(struct timeval *p)
-{
-#ifdef _WIN32
- FILETIME ft; // Contains a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).
- GetSystemTimeAsFileTime(&ft);
- uint64_t tt;
- memcpy(&tt, &ft, sizeof(tt));
- tt /= 10; // make it usecs
- p->tv_sec = (long)tt / 1000000;
- p->tv_usec = (long)tt % 1000000;
-#else
- gettimeofday(p, NULL);
-#endif
-}
-
-
-std::auto_ptr Utility::CreateAddress(struct sockaddr *sa,socklen_t sa_len)
-{
- switch (sa -> sa_family)
- {
- case AF_INET:
- if (sa_len == sizeof(struct sockaddr_in))
- {
- struct sockaddr_in *p = (struct sockaddr_in *)sa;
- return std::auto_ptr(new Ipv4Address(*p));
- }
- break;
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
- case AF_INET6:
- if (sa_len == sizeof(struct sockaddr_in6))
- {
- struct sockaddr_in6 *p = (struct sockaddr_in6 *)sa;
- return std::auto_ptr(new Ipv6Address(*p));
- }
- break;
-#endif
-#endif
- }
- return std::auto_ptr(NULL);
-}
-
-
-bool Utility::u2ip(const std::string& host, struct sockaddr_in& sa, int ai_flags)
-{
- memset(&sa, 0, sizeof(sa));
- sa.sin_family = AF_INET;
-#ifdef NO_GETADDRINFO
- if ((ai_flags & AI_NUMERICHOST) != 0 || isipv4(host))
- {
- Parse pa((char *)host.c_str(), ".");
- union {
- struct {
- unsigned char b1;
- unsigned char b2;
- unsigned char b3;
- unsigned char b4;
- } a;
- ipaddr_t l;
- } u;
- u.a.b1 = static_cast(pa.getvalue());
- u.a.b2 = static_cast(pa.getvalue());
- u.a.b3 = static_cast(pa.getvalue());
- u.a.b4 = static_cast(pa.getvalue());
- memcpy(&sa.sin_addr, &u.l, sizeof(sa.sin_addr));
- return true;
- }
-#ifndef LINUX
- struct hostent *he = gethostbyname( host.c_str() );
- if (!he)
- {
- return false;
- }
- memcpy(&sa.sin_addr, he -> h_addr, sizeof(sa.sin_addr));
-#else
- struct hostent he;
- struct hostent *result = NULL;
- int myerrno = 0;
- char buf[2000];
- int n = gethostbyname_r(host.c_str(), &he, buf, sizeof(buf), &result, &myerrno);
- if (n || !result)
- {
- return false;
- }
- if (he.h_addr_list && he.h_addr_list[0])
- memcpy(&sa.sin_addr, he.h_addr, 4);
- else
- return false;
-#endif
- return true;
-#else
- struct addrinfo hints;
- memset(&hints, 0, sizeof(hints));
- // AI_NUMERICHOST
- // AI_CANONNAME
- // AI_PASSIVE - server
- // AI_ADDRCONFIG
- // AI_V4MAPPED
- // AI_ALL
- // AI_NUMERICSERV
- hints.ai_flags = ai_flags;
- hints.ai_family = AF_INET;
- hints.ai_socktype = 0;
- hints.ai_protocol = 0;
- struct addrinfo *res;
- if (Utility::isipv4(host))
- hints.ai_flags |= AI_NUMERICHOST;
- int n = getaddrinfo(host.c_str(), NULL, &hints, &res);
- if (!n)
- {
- std::vector vec;
- struct addrinfo *ai = res;
- while (ai)
- {
- if (ai -> ai_addrlen == sizeof(sa))
- vec.push_back( ai );
- ai = ai -> ai_next;
- }
- if (vec.empty())
- return false;
- ai = vec[Utility::Rnd() % vec.size()];
- {
- memcpy(&sa, ai -> ai_addr, ai -> ai_addrlen);
- }
- freeaddrinfo(res);
- return true;
- }
- std::string error = "Error: ";
-#ifndef __CYGWIN__
- error += gai_strerror(n);
-#endif
- return false;
-#endif // NO_GETADDRINFO
-}
-
-
-#ifdef ENABLE_IPV6
-#ifdef IPPROTO_IPV6
-bool Utility::u2ip(const std::string& host, struct sockaddr_in6& sa, int ai_flags)
-{
- memset(&sa, 0, sizeof(sa));
- sa.sin6_family = AF_INET6;
-#ifdef NO_GETADDRINFO
- if ((ai_flags & AI_NUMERICHOST) != 0 || isipv6(host))
- {
- std::list vec;
- size_t x = 0;
- for (size_t i = 0; i <= host.size(); i++)
- {
- if (i == host.size() || host[i] == ':')
- {
- std::string s = host.substr(x, i - x);
- //
- if (strstr(s.c_str(),".")) // x.x.x.x
- {
- Parse pa(s,".");
- char slask[100]; // u2ip temporary hex2string conversion
- unsigned long b0 = static_cast(pa.getvalue());
- unsigned long b1 = static_cast(pa.getvalue());
- unsigned long b2 = static_cast(pa.getvalue());
- unsigned long b3 = static_cast(pa.getvalue());
- sprintf(slask,"%lx",b0 * 256 + b1);
- vec.push_back(slask);
- sprintf(slask,"%lx",b2 * 256 + b3);
- vec.push_back(slask);
- }
- else
- {
- vec.push_back(s);
- }
- //
- x = i + 1;
- }
- }
- size_t sz = vec.size(); // number of byte pairs
- size_t i = 0; // index in in6_addr.in6_u.u6_addr16[] ( 0 .. 7 )
- unsigned short addr16[8];
- for (std::list::iterator it = vec.begin(); it != vec.end(); it++)
- {
- std::string bytepair = *it;
- if (!bytepair.empty())
- {
- addr16[i++] = htons(Utility::hex2unsigned(bytepair));
- }
- else
- {
- addr16[i++] = 0;
- while (sz++ < 8)
- {
- addr16[i++] = 0;
- }
- }
- }
- memcpy(&sa.sin6_addr, addr16, sizeof(addr16));
- return true;
- }
-#ifdef SOLARIS
- int errnum = 0;
- struct hostent *he = getipnodebyname( host.c_str(), AF_INET6, 0, &errnum );
-#else
- struct hostent *he = gethostbyname2( host.c_str(), AF_INET6 );
-#endif
- if (!he)
- {
- return false;
- }
- memcpy(&sa.sin6_addr,he -> h_addr_list[0],he -> h_length);
-#ifdef SOLARIS
- free(he);
-#endif
- return true;
-#else
- struct addrinfo hints;
- memset(&hints, 0, sizeof(hints));
- hints.ai_flags = ai_flags;
- hints.ai_family = AF_INET6;
- hints.ai_socktype = 0;
- hints.ai_protocol = 0;
- struct addrinfo *res;
- if (Utility::isipv6(host))
- hints.ai_flags |= AI_NUMERICHOST;
- int n = getaddrinfo(host.c_str(), NULL, &hints, &res);
- if (!n)
- {
- std::vector vec;
- struct addrinfo *ai = res;
- while (ai)
- {
- if (ai -> ai_addrlen == sizeof(sa))
- vec.push_back( ai );
- ai = ai -> ai_next;
- }
- if (vec.empty())
- return false;
- ai = vec[Utility::Rnd() % vec.size()];
- {
- memcpy(&sa, ai -> ai_addr, ai -> ai_addrlen);
- }
- freeaddrinfo(res);
- return true;
- }
- std::string error = "Error: ";
-#ifndef __CYGWIN__
- error += gai_strerror(n);
-#endif
- return false;
-#endif // NO_GETADDRINFO
-}
-#endif // IPPROTO_IPV6
-#endif // ENABLE_IPV6
-
-
-bool Utility::reverse(struct sockaddr *sa, socklen_t sa_len, std::string& hostname, int flags)
-{
- std::string service;
- return Utility::reverse(sa, sa_len, hostname, service, flags);
-}
-
-
-bool Utility::reverse(struct sockaddr *sa, socklen_t sa_len, std::string& hostname, std::string& service, int flags)
-{
- hostname = "";
- service = "";
-#ifdef NO_GETADDRINFO
- switch (sa -> sa_family)
- {
- case AF_INET:
- if (flags & NI_NUMERICHOST)
- {
- union {
- struct {
- unsigned char b1;
- unsigned char b2;
- unsigned char b3;
- unsigned char b4;
- } a;
- ipaddr_t l;
- } u;
- struct sockaddr_in *sa_in = (struct sockaddr_in *)sa;
- memcpy(&u.l, &sa_in -> sin_addr, sizeof(u.l));
- char tmp[100];
- sprintf(tmp, "%u.%u.%u.%u", u.a.b1, u.a.b2, u.a.b3, u.a.b4);
- hostname = tmp;
- return true;
- }
- else
- {
- struct sockaddr_in *sa_in = (struct sockaddr_in *)sa;
- struct hostent *h = gethostbyaddr( (const char *)&sa_in -> sin_addr, sizeof(sa_in -> sin_addr), AF_INET);
- if (h)
- {
- hostname = h -> h_name;
- return true;
- }
- }
- break;
-#ifdef ENABLE_IPV6
- case AF_INET6:
- if (flags & NI_NUMERICHOST)
- {
- char slask[100]; // l2ip temporary
- *slask = 0;
- unsigned int prev = 0;
- bool skipped = false;
- bool ok_to_skip = true;
- {
- unsigned short addr16[8];
- struct sockaddr_in6 *sa_in6 = (struct sockaddr_in6 *)sa;
- memcpy(addr16, &sa_in6 -> sin6_addr, sizeof(addr16));
- for (size_t i = 0; i < 8; i++)
- {
- unsigned short x = ntohs(addr16[i]);
- if (*slask && (x || !ok_to_skip || prev))
- strcat(slask,":");
- if (x || !ok_to_skip)
- {
- sprintf(slask + strlen(slask),"%x", x);
- if (x && skipped)
- ok_to_skip = false;
- }
- else
- {
- skipped = true;
- }
- prev = x;
- }
- }
- if (!*slask)
- strcpy(slask, "::");
- hostname = slask;
- return true;
- }
- else
- {
- // %! TODO: ipv6 reverse lookup
- struct sockaddr_in6 *sa_in = (struct sockaddr_in6 *)sa;
- struct hostent *h = gethostbyaddr( (const char *)&sa_in -> sin6_addr, sizeof(sa_in -> sin6_addr), AF_INET6);
- if (h)
- {
- hostname = h -> h_name;
- return true;
- }
- }
- break;
-#endif
- }
- return false;
-#else
- char host[NI_MAXHOST];
- char serv[NI_MAXSERV];
- // NI_NOFQDN
- // NI_NUMERICHOST
- // NI_NAMEREQD
- // NI_NUMERICSERV
- // NI_DGRAM
- int n = getnameinfo(sa, sa_len, host, sizeof(host), serv, sizeof(serv), flags);
- if (n)
- {
- // EAI_AGAIN
- // EAI_BADFLAGS
- // EAI_FAIL
- // EAI_FAMILY
- // EAI_MEMORY
- // EAI_NONAME
- // EAI_OVERFLOW
- // EAI_SYSTEM
- return false;
- }
- hostname = host;
- service = serv;
- return true;
-#endif // NO_GETADDRINFO
-}
-
-
-bool Utility::u2service(const std::string& name, int& service, int ai_flags)
-{
-#ifdef NO_GETADDRINFO
- // %!
- return false;
-#else
- struct addrinfo hints;
- service = 0;
- memset(&hints, 0, sizeof(hints));
- // AI_NUMERICHOST
- // AI_CANONNAME
- // AI_PASSIVE - server
- // AI_ADDRCONFIG
- // AI_V4MAPPED
- // AI_ALL
- // AI_NUMERICSERV
- hints.ai_flags = ai_flags;
- hints.ai_family = AF_UNSPEC;
- hints.ai_socktype = 0;
- hints.ai_protocol = 0;
- struct addrinfo *res;
- int n = getaddrinfo(NULL, name.c_str(), &hints, &res);
- if (!n)
- {
- service = res -> ai_protocol;
- freeaddrinfo(res);
- return true;
- }
- return false;
-#endif // NO_GETADDRINFO
-}
-
-
-unsigned long Utility::ThreadID()
-{
-#ifdef _WIN32
- return GetCurrentThreadId();
-#else
- return (unsigned long)pthread_self();
-#endif
-}
-
-
-std::string Utility::ToLower(const std::string& str)
-{
- std::string r;
- for (size_t i = 0; i < str.size(); i++)
- {
- if (str[i] >= 'A' && str[i] <= 'Z')
- r += str[i] | 32;
- else
- r += str[i];
- }
- return r;
-}
-
-
-std::string Utility::ToUpper(const std::string& str)
-{
- std::string r;
- for (size_t i = 0; i < str.size(); i++)
- {
- if (str[i] >= 'a' && str[i] <= 'z')
- r += (char)(str[i] - 32);
- else
- r += str[i];
- }
- return r;
-}
-
-
-std::string Utility::ToString(double d)
-{
- char tmp[100];
- sprintf(tmp, "%f", d);
- return tmp;
-}
-
-
-unsigned long Utility::Rnd()
-{
-static Utility::Rng generator( (unsigned long)time(NULL) );
- return generator.Get();
-}
-
-
-Utility::Rng::Rng(unsigned long seed) : m_value( 0 )
-{
- m_tmp[0]= seed & 0xffffffffUL;
- for (int i = 1; i < TWIST_LEN; i++)
- {
- m_tmp[i] = (1812433253UL * (m_tmp[i - 1] ^ (m_tmp[i - 1] >> 30)) + i);
- }
-}
-
-
-unsigned long Utility::Rng::Get()
-{
- unsigned long val = m_tmp[m_value];
- ++m_value;
- if (m_value == TWIST_LEN)
- {
- for (int i = 0; i < TWIST_IB; ++i)
- {
- unsigned long s = TWIST(m_tmp, i, i + 1);
- m_tmp[i] = m_tmp[i + TWIST_IA] ^ (s >> 1) ^ MAGIC_TWIST(s);
- }
- {
- for (int i = 0; i < TWIST_LEN - 1; ++i)
- {
- unsigned long s = TWIST(m_tmp, i, i + 1);
- m_tmp[i] = m_tmp[i - TWIST_IB] ^ (s >> 1) ^ MAGIC_TWIST(s);
- }
- }
- unsigned long s = TWIST(m_tmp, TWIST_LEN - 1, 0);
- m_tmp[TWIST_LEN - 1] = m_tmp[TWIST_IA - 1] ^ (s >> 1) ^ MAGIC_TWIST(s);
-
- m_value = 0;
- }
- return val;
-}
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
diff --git a/dep/src/sockets/network_kist.txt b/dep/src/sockets/network_kist.txt
deleted file mode 100644
index f6597bf9c..000000000
--- a/dep/src/sockets/network_kist.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-The following are the only .cpp files used from the new network library (v2.2.8) This file is just for future reference.
-
-Base64.cpp
-Exception.cpp
-Ipv4Address.cpp
-Ipv6Address.cpp
-Lock.cpp
-Mutex.cpp
-Parse.cpp
-ResolvServer.cpp
-ResolvSocket.cpp
-Socket.cpp
-SocketHandler.cpp
-socket_include.cpp
-StdoutLog.cpp
-StreamSocket.cpp
-TcpSocket.cpp
-Thread.cpp
-UdpSocket.cpp
-Utility.cpp
diff --git a/dep/src/sockets/socket_include.cpp b/dep/src/sockets/socket_include.cpp
deleted file mode 100644
index 07b986b02..000000000
--- a/dep/src/sockets/socket_include.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/** \file socket_include.cpp
- ** \date 2004-11-28
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004-2007 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-#include
-
-// only to be included in win32 projects
-const char *StrError(int x)
-{
-static char tmp[100];
- switch (x)
- {
- case 10004: return "Interrupted function call.";
- case 10013: return "Permission denied.";
- case 10014: return "Bad address.";
- case 10022: return "Invalid argument.";
- case 10024: return "Too many open files.";
- case 10035: return "Resource temporarily unavailable.";
- case 10036: return "Operation now in progress.";
- case 10037: return "Operation already in progress.";
- case 10038: return "Socket operation on nonsocket.";
- case 10039: return "Destination address required.";
- case 10040: return "Message too long.";
- case 10041: return "Protocol wrong type for socket.";
- case 10042: return "Bad protocol option.";
- case 10043: return "Protocol not supported.";
- case 10044: return "Socket type not supported.";
- case 10045: return "Operation not supported.";
- case 10046: return "Protocol family not supported.";
- case 10047: return "Address family not supported by protocol family.";
- case 10048: return "Address already in use.";
- case 10049: return "Cannot assign requested address.";
- case 10050: return "Network is down.";
- case 10051: return "Network is unreachable.";
- case 10052: return "Network dropped connection on reset.";
- case 10053: return "Software caused connection abort.";
- case 10054: return "Connection reset by peer.";
- case 10055: return "No buffer space available.";
- case 10056: return "Socket is already connected.";
- case 10057: return "Socket is not connected.";
- case 10058: return "Cannot send after socket shutdown.";
- case 10060: return "Connection timed out.";
- case 10061: return "Connection refused.";
- case 10064: return "Host is down.";
- case 10065: return "No route to host.";
- case 10067: return "Too many processes.";
- case 10091: return "Network subsystem is unavailable.";
- case 10092: return "Winsock.dll version out of range.";
- case 10093: return "Successful WSAStartup not yet performed.";
- case 10101: return "Graceful shutdown in progress.";
- case 10109: return "Class type not found.";
- case 11001: return "Host not found.";
- case 11002: return "Nonauthoritative host not found.";
- case 11003: return "This is a nonrecoverable error.";
- case 11004: return "Valid name, no data record of requested type.";
-
- default:
- break;
- }
- sprintf(tmp, "Winsock error code: %d", x);
- return tmp;
-}
-
-
-
diff --git a/sql/characters.sql b/sql/characters.sql
index 10442ba6c..7df7f57d4 100644
--- a/sql/characters.sql
+++ b/sql/characters.sql
@@ -21,7 +21,7 @@
DROP TABLE IF EXISTS `character_db_version`;
CREATE TABLE `character_db_version` (
- `required_9849_01_characters_saved_variables` bit(1) default NULL
+ `required_10007_01_characters_pet_aura` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
--
@@ -1033,7 +1033,7 @@ CREATE TABLE `groups` (
`icon6` int(11) unsigned NOT NULL,
`icon7` int(11) unsigned NOT NULL,
`icon8` int(11) unsigned NOT NULL,
- `isRaid` tinyint(1) unsigned NOT NULL,
+ `groupType` tinyint(1) unsigned NOT NULL,
`difficulty` tinyint(3) unsigned NOT NULL default '0',
`raiddifficulty` int(11) UNSIGNED NOT NULL default '0',
PRIMARY KEY (`groupId`),
diff --git a/sql/mangos.sql b/sql/mangos.sql
index 51eb08168..d6de4e8d6 100644
--- a/sql/mangos.sql
+++ b/sql/mangos.sql
@@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
`version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL,
`cache_id` int(10) default '0',
- `required_9854_01_mangos_spell_bonus_data` bit(1) default NULL
+ `required_10044_02_mangos_spell_proc_event` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
--
@@ -632,6 +632,9 @@ INSERT INTO `command` VALUES
('list object',3,'Syntax: .list object #gameobject_id [#max_count]\r\n\r\nOutput gameobjects with gameobject id #gameobject_id found in world. Output gameobject guids and coordinates sorted by distance from character. Will be output maximum #max_count gameobject. If #max_count not provided use 10 as default value.'),
('list talents',3,'Syntax: .list talents\r\n\r\nShow list all really known (as learned spells) talent rank spells for selected player or self.'),
('loadscripts',3,'Syntax: .loadscripts $scriptlibraryname\r\n\r\nUnload current and load the script library $scriptlibraryname or reload current if $scriptlibraryname omitted, in case you changed it while the server was running.'),
+('lookup account email',2,'Syntax: .lookup account email $emailpart [#limit] \r\n\r\n Searchs accounts, which email including $emailpart with optional parametr #limit of results. If #limit not provided expected 100.'),
+('lookup account ip',2,'Syntax: lookup account ip $ippart [#limit] \r\n\r\n Searchs accounts, which last used ip inluding $ippart (textual) with optional parametr #$limit of results. If #limit not provided expected 100.'),
+('lookup account name',2,'Syntax: .lookup account name $accountpart [#limit] \r\n\r\n Searchs accounts, which username including $accountpart with optional parametr #limit of results. If #limit not provided expected 100.'),
('lookup area',1,'Syntax: .lookup area $namepart\r\n\r\nLooks up an area by $namepart, and returns all matches with their area ID\'s.'),
('lookup creature',3,'Syntax: .lookup creature $namepart\r\n\r\nLooks up a creature by $namepart, and returns all matches with their creature ID\'s.'),
('lookup event',2,'Syntax: .lookup event $name\r\nAttempts to find the ID of the event with the provided $name.'),
@@ -639,9 +642,9 @@ INSERT INTO `command` VALUES
('lookup item',3,'Syntax: .lookup item $itemname\r\n\r\nLooks up an item by $itemname, and returns all matches with their Item ID\'s.'),
('lookup itemset',3,'Syntax: .lookup itemset $itemname\r\n\r\nLooks up an item set by $itemname, and returns all matches with their Item set ID\'s.'),
('lookup object',3,'Syntax: .lookup object $objname\r\n\r\nLooks up an gameobject by $objname, and returns all matches with their Gameobject ID\'s.'),
-('lookup player account',2,'Syntax: .lookup player account $account ($limit) \r\n\r\n Searchs players, which account username is $account with optional parametr $limit of results.'),
-('lookup player ip',2,'Syntax: .lookup player ip $ip ($limit) \r\n\r\n Searchs players, which account ast_ip is $ip with optional parametr $limit of results.'),
-('lookup player email',2,'Syntax: .lookup player email $email ($limit) \r\n\r\n Searchs players, which account email is $email with optional parametr $limit of results.'),
+('lookup player account',2,'Syntax: .lookup player account $accountpart [#limit] \r\n\r\n Searchs players, which account username including $accountpart with optional parametr #limit of results. If #limit not provided expected 100.'),
+('lookup player email',2,'Syntax: .lookup player email $emailpart [#limit] \r\n\r\n Searchs players, which account email including $emailpart with optional parametr #limit of results. If #limit not provided expected 100.'),
+('lookup player ip',2,'Syntax: .lookup player ip $ippart [#limit] \r\n\r\n Searchs players, which account last used ip inluding $ippart (textual) with optional parametr #limit of results. If #limit not provided expected 100.'),
('lookup quest',3,'Syntax: .lookup quest $namepart\r\n\r\nLooks up a quest by $namepart, and returns all matches with their quest ID\'s.'),
('lookup skill',3,'Syntax: .lookup skill $$namepart\r\n\r\nLooks up a skill by $namepart, and returns all matches with their skill ID\'s.'),
('lookup spell',3,'Syntax: .lookup spell $namepart\r\n\r\nLooks up a spell by $namepart, and returns all matches with their spell ID\'s.'),
@@ -751,11 +754,12 @@ INSERT INTO `command` VALUES
('server idleshutdown cancel',3,'Syntax: .server idleshutdown cancel\r\n\r\nCancel the restart/shutdown timer if any.'),
('server idlerestart',3,'Syntax: .server idlerestart #delay\r\n\r\nRestart the server after #delay seconds if no active connections are present (no players). Use #exist_code or 2 as program exist code.'),
('server idlerestart cancel',3,'Syntax: .server idlerestart cancel\r\n\r\nCancel the restart/shutdown timer if any.'),
+('server log filter',4,'Syntax: .server log filter [($filtername|all) (on|off)]\r\n\r\nShow or set server log filters. If used "all" then all filters will be set to on/off state.'),
+('server log level',4,'Syntax: .server log level [#level]\r\n\r\nShow or set server log level (0 - errors only, 1 - basic, 2 - detail, 3 - debug).'),
('server motd',0,'Syntax: .server motd\r\n\r\nShow server Message of the day.'),
('server plimit',3,'Syntax: .server plimit [#num|-1|-2|-3|reset|player|moderator|gamemaster|administrator]\r\n\r\nWithout arg show current player amount and security level limitations for login to server, with arg set player linit ($num > 0) or securiti limitation ($num < 0 or security leme name. With `reset` sets player limit to the one in the config file'),
('server restart',3,'Syntax: .server restart #delay\r\n\r\nRestart the server after #delay seconds. Use #exist_code or 2 as program exist code.'),
('server restart cancel',3,'Syntax: .server restart cancel\r\n\r\nCancel the restart/shutdown timer if any.'),
-('server set loglevel',4,'Syntax: .server set loglevel #level\r\n\r\nSet server log level (0 - errors only, 1 - basic, 2 - detail, 3 - debug).'),
('server set motd',3,'Syntax: .server set motd $MOTD\r\n\r\nSet server Message of the day.'),
('server shutdown',3,'Syntax: .server shutdown #delay [#exit_code]\r\n\r\nShut the server down after #delay seconds. Use #exit_code or 0 as program exit code.'),
('server shutdown cancel',3,'Syntax: .server shutdown cancel\r\n\r\nCancel the restart/shutdown timer if any.'),
@@ -981,6 +985,7 @@ CREATE TABLE `creature_movement` (
`position_y` float NOT NULL default '0',
`position_z` float NOT NULL default '0',
`waittime` int(10) unsigned NOT NULL default '0',
+ `script_id` int(10) unsigned NOT NULL default '0',
`textid1` int(11) NOT NULL default '0',
`textid2` int(11) NOT NULL default '0',
`textid3` int(11) NOT NULL default '0',
@@ -1004,6 +1009,36 @@ LOCK TABLES `creature_movement` WRITE;
/*!40000 ALTER TABLE `creature_movement` ENABLE KEYS */;
UNLOCK TABLES;
+--
+-- Table structure for table `creature_movement_scripts`
+--
+
+DROP TABLE IF EXISTS `creature_movement_scripts`;
+CREATE TABLE `creature_movement_scripts` (
+ `id` mediumint(8) unsigned NOT NULL default '0',
+ `delay` int(10) unsigned NOT NULL default '0',
+ `command` mediumint(8) unsigned NOT NULL default '0',
+ `datalong` mediumint(8) unsigned NOT NULL default '0',
+ `datalong2` int(10) unsigned NOT NULL default '0',
+ `datalong3` int(10) unsigned NOT NULL default '0',
+ `datalong4` int(10) unsigned NOT NULL default '0',
+ `data_flags` tinyint(3) unsigned NOT NULL default '0',
+ `dataint` int(11) NOT NULL default '0',
+ `x` float NOT NULL default '0',
+ `y` float NOT NULL default '0',
+ `z` float NOT NULL default '0',
+ `o` float NOT NULL default '0'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+--
+-- Dumping data for table `creature_movement_scripts`
+--
+
+LOCK TABLES `creature_movement_scripts` WRITE;
+/*!40000 ALTER TABLE `creature_movement_scripts` DISABLE KEYS */;
+/*!40000 ALTER TABLE `creature_movement_scripts` ENABLE KEYS */;
+UNLOCK TABLES;
+
--
-- Table structure for table `creature_onkill_reputation`
--
@@ -1366,6 +1401,9 @@ CREATE TABLE `event_scripts` (
`command` mediumint(8) unsigned NOT NULL default '0',
`datalong` mediumint(8) unsigned NOT NULL default '0',
`datalong2` int(10) unsigned NOT NULL default '0',
+ `datalong3` int(10) unsigned NOT NULL default '0',
+ `datalong4` int(10) unsigned NOT NULL default '0',
+ `data_flags` tinyint(3) unsigned NOT NULL default '0',
`dataint` int(11) NOT NULL default '0',
`x` float NOT NULL default '0',
`y` float NOT NULL default '0',
@@ -1510,8 +1548,8 @@ CREATE TABLE `game_event` (
`entry` mediumint(8) unsigned NOT NULL COMMENT 'Entry of the game event',
`start_time` timestamp NOT NULL default '0000-00-00 00:00:00' COMMENT 'Absolute start date, the event will never start before',
`end_time` timestamp NOT NULL default '0000-00-00 00:00:00' COMMENT 'Absolute end date, the event will never start afler',
- `occurence` bigint(20) unsigned NOT NULL default '86400' COMMENT 'Delay in hours between occurences of the event',
- `length` bigint(20) unsigned NOT NULL default '43200' COMMENT 'Length in hours of the event',
+ `occurence` bigint(20) unsigned NOT NULL default '86400' COMMENT 'Delay in minutes between occurences of the event',
+ `length` bigint(20) unsigned NOT NULL default '43200' COMMENT 'Length in minutes of the event',
`holiday` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Client side holiday id',
`description` varchar(255) default NULL COMMENT 'Description of the event displayed in console',
PRIMARY KEY (`entry`)
@@ -1843,6 +1881,9 @@ CREATE TABLE `gameobject_scripts` (
`command` mediumint(8) unsigned NOT NULL default '0',
`datalong` mediumint(8) unsigned NOT NULL default '0',
`datalong2` int(10) unsigned NOT NULL default '0',
+ `datalong3` int(10) unsigned NOT NULL default '0',
+ `datalong4` int(10) unsigned NOT NULL default '0',
+ `data_flags` tinyint(3) unsigned NOT NULL default '0',
`dataint` int(11) NOT NULL default '0',
`x` float NOT NULL default '0',
`y` float NOT NULL default '0',
@@ -2013,6 +2054,9 @@ CREATE TABLE `gossip_scripts` (
`command` mediumint(8) unsigned NOT NULL default '0',
`datalong` mediumint(8) unsigned NOT NULL default '0',
`datalong2` int(10) unsigned NOT NULL default '0',
+ `datalong3` int(10) unsigned NOT NULL default '0',
+ `datalong4` int(10) unsigned NOT NULL default '0',
+ `data_flags` tinyint(3) unsigned NOT NULL default '0',
`dataint` int(11) NOT NULL default '0',
`x` float NOT NULL default '0',
`y` float NOT NULL default '0',
@@ -3072,7 +3116,7 @@ INSERT INTO `mangos_string` VALUES
(207,'Item \'%i\' not found in database.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(208,'Item \'%i\' \'%s\' deleted from vendor list',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(209,'Item \'%i\' not found in vendor list.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
-(210,'Item \'%i\' (with extended cost %u) already in vendor list.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(210,'Item \'%i\' (with extended cost %i) already in vendor list.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(211,'Spells of %s reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(212,'Spells of %s will reset at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(213,'Talents of %s reset.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
@@ -3576,10 +3620,9 @@ INSERT INTO `mangos_string` VALUES
(1007,'Account %s NOT created (probably sql file format was updated)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1008,'Account %s NOT created (unknown error)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1009,'Player %s (Guid: %u) Account %s (Id: %u) deleted.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
-(1010,'| Account | Character | IP | GM | Expansion |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
-(1011,'| | %20s | || |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
-(1012,'===========================================================================',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
-(1013,'|%15s| %20s | %15s |%4d| %9d |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1010,'| ID | Account | Character | IP | GM | Expansion |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1012,'========================================================================================',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1013,'| %10u |%15s| %20s | %15s |%4d| %9d |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1014,'No online players.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1015,'Used not fully typed quit command, need type it fully (quit), or command used not in RA command line.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1016, '| GUID | Name | Account | Delete Date |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
@@ -3593,6 +3636,8 @@ INSERT INTO `mangos_string` VALUES
(1024, 'Character \'%s\' (GUID: %u Account %u) can\'t be restored: account character list full!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1025, 'Character \'%s\' (GUID: %u Account %u) can\'t be restored: new name already used!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1026, 'GUID: %u Name: %s Account: %s (%u) Date: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1027, 'Log filters state:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1028, 'All log filters set to: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1100,'Account %s (Id: %u) have up to %u expansion allowed now.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1101,'Message of the day changed to:\r\n%s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1102,'Message sent to %s: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
@@ -3635,6 +3680,7 @@ INSERT INTO `mangos_string` VALUES
(1139, '| GUID | Name | Race | Class | Level |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1140, '| %10u | %20s | %15s | %15s | %5u |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1141, '%u - |cffffffff|Hplayer:%s|h[%s]|h|r %s %s %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1142,'%u - %s (Online:%s IP:%s GM:%u Expansion:%u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1200,'You try to view cinemitic %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1201,'You try to view movie %u but it doesn\'t exist.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `mangos_string` ENABLE KEYS */;
@@ -3843,7 +3889,7 @@ CREATE TABLE `npc_vendor` (
`item` mediumint(8) unsigned NOT NULL default '0',
`maxcount` tinyint(3) unsigned NOT NULL default '0',
`incrtime` int(10) unsigned NOT NULL default '0',
- `ExtendedCost` mediumint(8) unsigned NOT NULL default '0',
+ `ExtendedCost` mediumint(8) NOT NULL default '0' COMMENT 'negative if cost must exclude normal money cost',
PRIMARY KEY (`entry`,`item`,`ExtendedCost`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Npc System';
@@ -13716,6 +13762,9 @@ CREATE TABLE `quest_end_scripts` (
`command` mediumint(8) unsigned NOT NULL default '0',
`datalong` mediumint(8) unsigned NOT NULL default '0',
`datalong2` int(10) unsigned NOT NULL default '0',
+ `datalong3` int(10) unsigned NOT NULL default '0',
+ `datalong4` int(10) unsigned NOT NULL default '0',
+ `data_flags` tinyint(3) unsigned NOT NULL default '0',
`dataint` int(11) NOT NULL default '0',
`x` float NOT NULL default '0',
`y` float NOT NULL default '0',
@@ -13791,6 +13840,9 @@ CREATE TABLE `quest_start_scripts` (
`command` mediumint(8) unsigned NOT NULL default '0',
`datalong` mediumint(8) unsigned NOT NULL default '0',
`datalong2` int(10) unsigned NOT NULL default '0',
+ `datalong3` int(10) unsigned NOT NULL default '0',
+ `datalong4` int(10) unsigned NOT NULL default '0',
+ `data_flags` tinyint(3) unsigned NOT NULL default '0',
`dataint` int(11) NOT NULL default '0',
`x` float NOT NULL default '0',
`y` float NOT NULL default '0',
@@ -14152,12 +14204,10 @@ LOCK TABLES `spell_bonus_data` WRITE;
INSERT INTO `spell_bonus_data` VALUES
/* Death Knight */
(48721, 0, 0, 0.04, 'Death Knight - Blood Boil'),
-(55078, 0, 0, 0.055, 'Death Knight - Blood Plague Dummy Proc'),
(50444, 0, 0, 0.105, 'Death Knight - Corpse Explosion Triggered'),
(52212, 0, 0, 0.0475,'Death Knight - Death and Decay Triggered'),
(47632, 0, 0, 0.15, 'Death Knight - Death Coil Damage'),
(47633, 0, 0, 0.15, 'Death Knight - Death Coil Heal'),
-(55095, 0, 0, 0.055, 'Death Knight - Frost Fever'),
(49184, 0, 0, 0.1, 'Death Knight - Howling Blast'),
(45477, 0, 0, 0.1, 'Death Knight - Icy Touch'),
(56903, 0, 0, 0, 'Death Knight - Lichflame'),
@@ -14176,36 +14226,26 @@ INSERT INTO `spell_bonus_data` VALUES
(8921, 0.1515, 0.13, 0, 'Druid - Moonfire'),
(50464, 0.6611, 0, 0, 'Druid - Nourish'),
(8936, 0.539, 0.188, 0, 'Druid - Regrowth'),
-(774, 0, 0.37604, 0, 'Druid - Rejuvenation'),
(50288, 0.05, 0, 0, 'Druid - Starfall'),
(50294, 0.012, 0, 0, 'Druid - Starfall AOE'),
-(2912, 1, 0, 0, 'Druid - Starfire'),
(18562, 0, 0, 0, 'Druid - Swiftmend'),
(44203, 0.538, 0, 0, 'Druid - Tranquility Triggered'),
-(61391, 0.193, 0, 0, 'Druid - Typhoon'),
(48438, 0, 0.11505, 0, 'Druid - Wild Growth'),
(5176, 0.5714, 0, 0, 'Druid - Wrath'),
/* Generic */
(54757, 0, 0, 0, 'Generic - Pyro Rocket'),
/* Mage */
(44425, 0.714286,0, 0, 'Mage - Arcane Barrage'),
-(30451, 0.7143, 0, 0, 'Mage - Arcane Blast'),
-(1449, 0.2128, 0, 0, 'Mage - Arcane Explosion'),
(7268, 0.2857, 0, 0, 'Mage - Arcane Missiles Triggered Spell'),
(42208, 0.1437, 0, 0, 'Mage - Blizzard Triggered'),
-(2136, 0.4286, 0, 0, 'Mage - Fire Blast'),
(133, 1, 0, 0, 'Mage - Fire Ball'),
(2120, 0.2357, 0.122, 0, 'Mage - Flamestrike'),
-(122, 0.193, 0, 0, 'Mage - Frost Nova'),
(116, 0.8143, 0, 0, 'Mage - Frost Bolt'),
(44614, 0.8571, 0, 0, 'Mage - Frostfire Bolt'),
-(11426, 0.8053, 0, 0, 'Mage - Ice Barrier'),
(30455, 0.1429, 0, 0, 'Mage - Ice Lance'),
-(44457, 0.4, 0.2, 0, 'Mage - Living Bomb'),
(1463, 0.8053, 0, 0, 'Mage - Mana Shield'),
(34913, 0, 0, 0, 'Mage - Molten Armor Triggered'),
(11366, 1.15, 0.05, 0, 'Mage - Pyroblast'),
-(2948, 0.4286, 0, 0, 'Mage - Scorch'),
/* Paladin */
(26573, 0, 0.04, 0.04, 'Paladin - Consecration'),
(879, 0.15, 0, 0.15, 'Paladin - Exorcism'),
@@ -14213,7 +14253,6 @@ INSERT INTO `spell_bonus_data` VALUES
(19750, 1, 0, 0, 'Paladin - Flash of Light'),
(53595, 0, 0, 0, 'Paladin - Hammer of the Righteous'),
(635, 1.66, 0, 0, 'Paladin - Holy Light'),
-(25912, 0.4286, 0, 0, 'Paladin - Holy Shock Triggered Hurt'),
(20925, 0.09, 0, 0.056, 'Paladin - Holy Shield'),
(2812, 0.07, 0, 0.07, 'Paladin - Holy Wrath'),
(54158, 0.25, 0, 0, 'Paladin - Judgement'),
@@ -14222,34 +14261,24 @@ INSERT INTO `spell_bonus_data` VALUES
(20267, 0.1, 0, 0.1, 'Paladin - Judgement of Light Proc'),
(31804, 0, 0, 0, 'Paladin - Judgement of Vengeance'),
(20424, 0, 0, 0, 'Paladin - Seal of Command Proc'),
-(53739, 0, 0.00156, 0.003, 'Paladin - Seal of Corruption (full stack proc)'),
+(53739, 0, 0, 0.003, 'Paladin - Seal of Corruption (full stack proc)'),
(25742, 0.07, 0, 0.039, 'Paladin - Seal of Righteousness Dummy Proc'),
-(42463, 0, 0.00156, 0.003, 'Paladin - Seal of Vengeance (full stack proc)'),
+(42463, 0, 0, 0.003, 'Paladin - Seal of Vengeance (full stack proc)'),
(53600, 0, 0, 0, 'Paladin - Shield of Righteousness'),
/* Priest */
-(32546, 0.8068, 0, 0, 'Priest - Binding Heal'),
(27813, 0, 0, 0, 'Priest - Blessed Recovery'),
-(34861, 0.402, 0, 0, 'Priest - Circle of Healing'),
-(19236, 0.8068, 0, 0, 'Priest - Desperate Prayer'),
(2944, 0, 0.1849, 0, 'Priest - Devouring Plague'),
(63544, 0, 0, 0, 'Priest - Empowered Renew Triggered'),
(14914, 0.5711, 0.024, 0, 'Priest - Holy Fire'),
(15237, 0.1606, 0, 0, 'Priest - Holy Nova Damage'),
-(2061, 0.8068, 0, 0, 'Priest - Flash Heal'),
-(2060, 1.6135, 0, 0, 'Priest - Greater Heal'),
(23455, 0.3035, 0, 0, 'Priest - Holy Nova Heal'),
(63675, 0, 0, 0, 'Priest - Improved Devouring Plague Triggered'),
(8129, 0, 0, 0, 'Priest - Mana Burn'),
(58381, 0.257143,0, 0, 'Priest - Mind Flay Triggered'),
-(49821, 0.14286,0, 0, 'Priest - Mind Sear Trigger'),
+(49821, 0.2857, 0, 0, 'Priest - Mind Sear Trigger'),
(47666, 0.229, 0, 0, 'Priest - Penance dmg effect'),
(47750, 0.537, 0, 0, 'Priest - Penance heal effect'),
-(17, 0.8068, 0, 0, 'Priest - Power Word: Shield'),
-(33110, 0.8068, 0, 0, 'Priest - Prayer of Mending Heal Proc'),
(33619, 0, 0, 0, 'Priest - Reflective Shield'),
-(139, 0, 0.376, 0, 'Priest - Renew'),
-(32379, 0.4296, 0, 0, 'Priest - Shadow Word: Death'),
-(589, 0, 0.1829, 0, 'Priest - Shadow Word: Pain'),
(34433, 0.65, 0, 0, 'Priest - Shadowfiend'),
(585, 0.714, 0, 0, 'Priest - Smite'),
(34914, 0, 0.4, 0, 'Priest - Vampiric Touch'),
@@ -14257,8 +14286,6 @@ INSERT INTO `spell_bonus_data` VALUES
/* Shaman */
(974, 0.4762, 0, 0, 'Shaman - Earth Shield'),
(379, 0, 0, 0, 'Shaman - Earth Shield Triggered'),
-(1064, 1.34, 0, 0, 'Shaman - Chain Heal'),
-(421, 0.57, 0, 0, 'Shaman - Chain Lightning'),
(8042, 0.3858, 0, 0, 'Shaman - Earth Shock'),
(8050, 0.2142, 0.1, 0, 'Shaman - Flame Shock'),
(8026, 0.1, 0, 0, 'Shaman - Flametongue Weapon Proc'),
@@ -14266,8 +14293,6 @@ INSERT INTO `spell_bonus_data` VALUES
(8034, 0.1, 0, 0, 'Shaman - Frostbrand Attack Rank 1'),
(52042, 0.045, 0, 0, 'Shaman - Healing Stream Totem Triggered Heal'),
(331, 1.6106, 0, 0, 'Shaman - Healing Wave'),
-(51505, 0.5714, 0, 0, 'Shaman - Lava Burst'),
-(8004, 0.8082, 0, 0, 'Shaman - Lesser Healing Wave'),
(403, 0.7143, 0, 0, 'Shaman - Lightning Bolt'),
(26364, 0.33, 0, 0, 'Shaman - Lightning Shield Proc'),
(8188, 0.1, 0, 0, 'Shaman - Magma Totam Passive'),
@@ -14537,9 +14562,6 @@ INSERT INTO spell_chain VALUES
(38692,27070,133,14,0),
(42832,38692,133,15,0),
(42833,42832,133,16,0),
-/*Fiery Payback*/
-(64353,0,64353,1,0),
-(64357,64353,64353,2,0),
/*Flamestrike*/
(2120,0,2120,1,0),
(2121,2120,2120,2,0),
@@ -14631,10 +14653,6 @@ INSERT INTO spell_chain VALUES
(25208,11574,772,8,0),
(46845,25208,772,9,0),
(47465,46845,772,10,0),
-/*Taste for Blood*/
-(56636,0,56636,1,0),
-(56637,56636,56636,2,0),
-(56638,56637,56636,3,0),
/*Thunder Clap*/
(6343,0,6343,1,0),
(8198,6343,6343,2,0),
@@ -14765,10 +14783,6 @@ INSERT INTO spell_chain VALUES
(27067,20910,19306,4,0),
(48998,27067,19306,5,0),
(48999,48998,19306,6,0),
-/*Entrapment*/
-(19184,0,19184,1,0),
-(19387,19184,19184,2,0),
-(19388,19387,19184,3,0),
/*Explosive Shot*/
(53301,0,53301,1,0),
(60051,53301,53301,2,0),
@@ -14785,10 +14799,6 @@ INSERT INTO spell_chain VALUES
(1499,0,1499,1,0),
(14310,1499,1499,2,0),
(14311,14310,1499,3,0),
-/*Hunting Party*/
-(53290,0,53290,1,0),
-(53291,53290,53290,2,0),
-(53292,53291,53290,3,0),
/*Immolation Trap*/
(13795,0,13795,1,0),
(14302,13795,13795,2,0),
@@ -14798,12 +14808,6 @@ INSERT INTO spell_chain VALUES
(27023,14305,13795,6,0),
(49055,27023,13795,7,0),
(49056,49055,13795,8,0),
-/**Master Tactician*/
-(34506,0,34506,1,0),
-(34507,34506,34506,2,0),
-(34508,34507,34506,3,0),
-(34838,34508,34506,4,0),
-(34839,34838,34506,5,0),
/*Mongoose Bite*/
(1495,0,1495,1,0),
(14269,1495,1495,2,0),
@@ -14837,9 +14841,6 @@ INSERT INTO spell_chain VALUES
(32546,0,32546,1,0),
(48119,32546,32546,2,0),
(48120,48119,32546,3,0),
-/*Body and Soul*/
-(64127,0,64127,1,0),
-(64129,64127,64127,2,0),
/*Blessed Recovery Proc*/
(27813,0,27813,1,0),
(27817,27813,27813,2,0),
@@ -14862,10 +14863,6 @@ INSERT INTO spell_chain VALUES
(25437,19243,19236,7,0),
(48172,25437,19236,8,0),
(48173,48172,19236,9,0),
-/*Empowered Renew*/
-(63534,0,63534,1,0),
-(63542,63534,63534,2,0),
-(63543,63542,63534,3,0),
/*Flash Heal*/
(2061,0,2061,1,0),
(9472,2061,2061,2,0),
@@ -14969,10 +14966,6 @@ INSERT INTO spell_chain VALUES
(20770,10881,2006,5,0),
(25435,20770,2006,6,0),
(48171,25435,2006,7,0),
-/*Serendipity*/
-(63730,0,63730,1,0),
-(63733,63730,63730,2,0),
-(63737,63733,63730,3,0),
/*Smite*/
(585,0,585,1,0),
(591,585,585,2,0),
@@ -14999,13 +14992,6 @@ INSERT INTO spell_chain VALUES
(25467,19280,2944,7,0),
(48299,25467,2944,8,0),
(48300,48299,2944,9,0),
-/*Improved Devouring Plague*/
-(63625,0,63625,1,0),
-(63626,63625,63625,2,0),
-(63627,63626,63625,3,0),
-/*Improved Shadowform*/
-(47569,0,47569,1,0),
-(47570,47569,47569,2,0),
/*Mind Blast*/
(8092,0,8092,1,0),
(8102,8092,8092,2,0),
@@ -15256,9 +15242,6 @@ INSERT INTO spell_chain VALUES
(27019,14287,3044,9,0),
(49044,27019,3044,10,0),
(49045,49044,3044,11,0),
-/*Concussive Barrage*/
-(35100,0,35100,1,0),
-(35102,35100,35100,2,0),
/*Hunter's Mark*/
(1130,0,1130,1,0),
(14323,1130,1130,2,0),
@@ -15388,10 +15371,6 @@ INSERT INTO spell_chain VALUES
(27180,24239,24275,4,0),
(48805,27180,24275,5,0),
(48806,48805,24275,6,0),
-/*Heart of the Crusader*/
-(20335, 0, 20335, 1, 0),
-(20336, 20335, 20335, 2, 0),
-(20337, 20336, 20335, 3, 0),
/*Retribution Aura*/
(7294,0,7294,1,0),
(10298,7294,7294,2,0),
@@ -15400,13 +15379,6 @@ INSERT INTO spell_chain VALUES
(10301,10300,7294,5,0),
(27150,10301,7294,6,0),
(54043,27150,7294,7,0),
-/*Righteous Vengeance*/
-(53380,0,53380,1,0),
-(53381,53380,53380,2,0),
-(53382,53381,53380,3,0),
-/*The Art of War*/
-(53486,0,53486,1,0),
-(53488,53486,53486,2,0),
/*------------------
-- (185) Cooking
------------------*/
@@ -15813,6 +15785,10 @@ INSERT INTO spell_chain VALUES
(10140,10139,5504,7,0),
(37420,10140,5504,8,0),
(27090,37420,5504,9,0),
+/*Dalaran Intellect*/
+(61024,0,61024,1,27126),
+/*Dalaran Brilliance*/
+(61316,0,61316,1,27127),
/*DampenMagic*/
(604,0,604,1,0),
(8450,604,604,2,0),
@@ -15911,9 +15887,6 @@ INSERT INTO spell_chain VALUES
(34413,34412,1329,4,0),
(48663,34413,1329,5,0),
(48666,48663,1329,6,0),
-/*Quick Recovery*/
-(31244,0,31244,1,0),
-(31245,31244,31244,2,0),
/*Rupture*/
(1943,0,1943,1,0),
(8639,1943,1943,2,0),
@@ -15940,10 +15913,6 @@ INSERT INTO spell_chain VALUES
(25289,11551,6673,7,0),
(2048,25289,6673,8,0),
(47436,2048,6673,9,0),
-/*Bloodsurge*/
-(46913,0,46913,1,0),
-(46914,46913,46913,2,0),
-(46915,46914,46913,3,0),
/*Cleave*/
(845,0,845,1,0),
(7369,845,845,2,0),
@@ -16022,15 +15991,6 @@ INSERT INTO spell_chain VALUES
(32700,32699,31935,3,0),
(48826,32700,31935,4,0),
(48827,48826,31935,5,0),
-/*Divine Guardian*/
-(53527,0,53527,1,0),
-(53530,53527,53527,2, 0),
-/*Divinity*/
-(63646,0,63646,1,0),
-(63647,63646,63646,2,0),
-(63648,63647,63646,3,0),
-(63649,63648,63646,4,0),
-(63650,63649,63646,5,0),
/*Devotion Aura*/
(465,0,465,1,0),
(10290,465,465,2,0),
@@ -16085,13 +16045,6 @@ INSERT INTO spell_chain VALUES
/*Shield of Righteousness*/
(53600,0,53600,1,0),
(61411,53600,53600,2,0),
-/*Spiritual Attunement*/
-(31785,0,31785,1,0),
-(33776,31785,31785,2,0),
-/*Shield of the Templar*/
-(53709,0,53709,1,0),
-(53710,53709,53709,2,0),
-(53711,53710,53709,3,0),
/*------------------
--(270)Pet-GenericHunter
------------------*/
@@ -16103,10 +16056,6 @@ INSERT INTO spell_chain VALUES
(1756,1755,1742,5,0),
(16697,1756,1742,6,0),
(27048,16697,1742,7,0),
-/*Great Resistance*/
-(53427,0,53427,1,0),
-(53429,53427,53427,2,0),
-(53430,53429,53427,3,0),
/*Growl*/
(2649,0,2649,1,0),
(14916,2649,2649,2,0),
@@ -16117,15 +16066,6 @@ INSERT INTO spell_chain VALUES
(14921,14920,2649,7,0),
(27047,14921,2649,8,0),
(61676,27047,2649,9,0),
-/*Shark Attack*/
-(62759,0,62759,1,0),
-(62760,62759,62759,2,0),
-/*Silverback*/
-(62764,0,62764,1,0),
-(62765,62764,62764,2,0),
-/*Wild Hunt*/
-(62758,0,62758,1,0),
-(62762,62758,62758,2,0),
/*------------------
-- (333) Enchanting
------------------*/
@@ -16174,9 +16114,6 @@ INSERT INTO spell_chain VALUES
(28172,17728,2362,4,0),
(47886,28172,2362,5,0),
(47888,47886,2362,6,0),
-/*Decimation*/
-(63156,0,63156,1,0),
-(63158,63156,63156,2,0),
/*DemonArmor*/
(706,0,706,1,0),
(1086,706,706,2,0),
@@ -16209,10 +16146,6 @@ INSERT INTO spell_chain VALUES
(11695,11694,755,7,0),
(27259,11695,755,8,0),
(47856,27259,755,9,0),
-/*Nemesis*/
-(63117,0,63117,1,0),
-(63121,63117,63117,2,0),
-(63123,63121,63117,3,0),
/*RitualofSouls*/
(29893,0,29893,1,0),
(58887,29893,29893,2,0),
@@ -16316,12 +16249,6 @@ INSERT INTO spell_chain VALUES
(27243,0,27243,1,0),
(47835,27243,27243,2,0),
(47836,47835,27243,3,0),
-/* Shadow embrace */
-(32385,0,32385,1,0),
-(32387,32385,32385,2,0),
-(32392,32387,32385,3,0),
-(32393,32392,32385,4,0),
-(32394,32393,32385,5,0),
/*Unstable Affliction*/
(30108,0,30108,1,0),
(30404,30108,30108,2,0),
@@ -16385,12 +16312,6 @@ INSERT INTO spell_chain VALUES
(58794,25500,8033,7,0),
(58795,58794,8033,8,0),
(58796,58795,8033,9,0),
-/*Frozen Power*/
-(63373,0,63373,1,0),
-(63374,63373,63373,2,0),
-/*Improved Stormstrike*/
-(51521,0,51521,1,0),
-(51522,51521,51521,2,0),
/*Life Tap*/
(1454,0,1454,1,0),
(1455,1454,1454,2,0),
@@ -16424,12 +16345,6 @@ INSERT INTO spell_chain VALUES
(26372,26371,26364,9,0),
(49278,26372,26364,10,0),
(49279,49278,26364,11,0),
-/*Maelstrom Weapon*/
-(51528,0,51528,1,0),
-(51529,51528,51528,2,0),
-(51530,51529,51528,3,0),
-(51531,51530,51528,4,0),
-(51532,51531,51528,5,0),
/*Nature Resistance Totem*/
(10595,0,10595,1,0),
(10600,10595,10595,2,0),
@@ -16565,9 +16480,6 @@ INSERT INTO spell_chain VALUES
/*------------------
-- (375) Elemental Combat
------------------*/
-/*Booming Echoes*/
-(63370,0,63370,1,0),
-(63372,63370,63370,2,0),
/*Chain Lightning*/
(421,0,421,1,0),
(930,421,421,2,0),
@@ -16718,9 +16630,6 @@ INSERT INTO spell_chain VALUES
(26979,26978,5185,13,0),
(48377,26979,5185,14,0),
(48378,48377,5185,15,0),
-/*Improved Barkskin*/
-(63410,0,63410,1,0),
-(63411,63410,63410,2,0),
/*Lifebloom*/
(33763,0,33763,1,0),
(48450,33763,33763,2,0),
@@ -16774,10 +16683,6 @@ INSERT INTO spell_chain VALUES
(26982,26981,774,13,0),
(48440,26982,774,14,0),
(48441,48440,774,15,0),
-/*Revitalize*/
-(48539,0,48539,1,0),
-(48544,48539,48539,2,0),
-(48545,48544,48539,3,0),
/*Revive*/
(50769,0,50769,1,0),
(50768,50769,50769,2,0),
@@ -16955,10 +16860,6 @@ INSERT INTO spell_chain VALUES
(32231,29722,29722,2,0),
(47837,32231,29722,3,0),
(47838,47837,29722,4,0),
-/*Molten Skin*/
-(63349,0,63349,1,0),
-(63350,63349,63349,2,0),
-(63351,63350,63349,3,0),
/*Rain of Fire*/
(5740,0,5740,1,0),
(6219,5740,5740,2,0),
@@ -17146,10 +17047,6 @@ INSERT INTO spell_chain VALUES
(27841,14819,14752,4,0),
(25312,27841,14752,5,0),
(48073,25312,14752,6,0),
-/*Improved Flash Heal*/
-(63504,0,63504,1,0),
-(63505,63504,63504,2,0),
-(63506,63505,63504,3,0),
/*InnerFire*/
(588,0,588,1,0),
(7128,588,588,2,0),
@@ -17208,10 +17105,6 @@ INSERT INTO spell_chain VALUES
(27681,14752,14752,2,0),
(32999,27681,14752,3,0),
(48074,32999,14752,4,0),
-/*Rapture*/
-(47535,0,47535,1,0),
-(47536,47535,47535,2,0),
-(47537,47536,47535,3,0),
/*ShackleUndead*/
(9484,0,9484,1,0),
(9485,9484,9484,2,0),
@@ -17361,16 +17254,6 @@ INSERT INTO spell_chain VALUES
(55260,55259,55050,4,0),
(55261,55260,55050,5,0),
(55262,55261,55050,6,0),
-/*Improved Blood Presence*/
-(50365,0,50365,1,0),
-(50371,50365,50365,2,0),
-/*Improved Death Strike*/
-(62905,0,62905,1,0),
-(62908,62905,62905,2,0),
-/*Improved Rune Tap*/
-(48985,0,48985,1,0),
-(49488,48985,48985,2,0),
-(49489,49488,48985,3,0),
/*Pestilence*/
(50842,0,50842,1,0),
(51426,50842,50842,2,0),
@@ -17383,10 +17266,6 @@ INSERT INTO spell_chain VALUES
(49914,49913,47476,3,0),
(49915,49914,47476,4,0),
(49916,49915,47476,5,0),
-/*Vendetta*/
-(49015,0,49015,1,0),
-(50154,49015,49015,2,0),
-(55136,50154,49015,3,0),
/*------------------
--(771)Frost
------------------*/
@@ -17405,38 +17284,17 @@ INSERT INTO spell_chain VALUES
(51409,49184,49184,2,0),
(51410,51409,49184,3,0),
(51411,51410,49184,4,0),
-/*IcyTalons*/
-(50880,0,50880,1,0),
-(50884,50880,50880,2,0),
-(50885,50884,50880,3,0),
-(50886,50885,50880,4,0),
-(50887,50886,50880,5,0),
/*IcyTouch*/
(45477,0,45477,1,0),
(49896,45477,45477,2,0),
(49903,49896,45477,3,0),
(49904,49903,45477,4,0),
(49909,49904,45477,5,0),
-/*Improved Frost Presence*/
-(50384,0,50384,1,0),
-(50385,50384,50384,2,0),
-/*Improved Icy Touch*/
-(49175,0,49175,1,0),
-(50031,49175,49175,2,0),
-(51456,50031,49175,3,0),
/*Obliterate*/
(49020,0,49020,1,0),
(51423,49020,49020,2,0),
(51424,51423,49020,3,0),
(51425,51424,49020,4,0),
-/*Rime*/
-(49188,0,49188,1,0),
-(56822,49188,49188,2,0),
-(59057,56822,49188,3,0),
-/*Threat of Thassarian*/
-(65661,0,65661,1,0),
-(66191,65661,65661,2,0),
-(66192,66191,65661,3,0),
/*------------------
--(772)Unholy
------------------*/
@@ -17463,20 +17321,6 @@ INSERT INTO spell_chain VALUES
(45463,49999,49998,3,0),
(49923,45463,49998,4,0),
(49924,49923,49998,5,0),
-/* Desecration */
-(55666,0,55666,1,0),
-(55667,55666,55666,2,0),
-/*Improved Unholy Presence*/
-(50391,0,50391,1,0),
-(50392,50391,50391,2,0),
-/*Magic Suppression*/
-(49224,0,49224,1,0),
-(49610,49224,49224,2,0),
-(49611,49610,49224,3,0),
-/*Outbreak*/
-(49013,0,49013,1,0),
-(55236,49013,49013,2,0),
-(55237,55236,49013,3,0),
/*PlagueStrike*/
(45462,0,45462,1,0),
(49917,45462,45462,2,0),
@@ -17884,7 +17728,7 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `spell_proc_event`;
CREATE TABLE `spell_proc_event` (
`entry` mediumint(8) unsigned NOT NULL default '0',
- `SchoolMask` tinyint(4) NOT NULL default '0',
+ `SchoolMask` tinyint(4) unsigned NOT NULL default '0',
`SpellFamilyName` smallint(5) unsigned NOT NULL default '0',
`SpellFamilyMask0` int(10) unsigned NOT NULL default '0',
`SpellFamilyMask1` int(10) unsigned NOT NULL default '0',
@@ -17904,806 +17748,571 @@ CREATE TABLE `spell_proc_event` (
LOCK TABLES `spell_proc_event` WRITE;
/*!40000 ALTER TABLE `spell_proc_event` DISABLE KEYS */;
INSERT INTO `spell_proc_event` VALUES
-( 324, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
-( 974, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
-( 1463, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
-( 3232, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-( 5952, 0x00000000, 8, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-( 6346, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0.000000, 0.000000, 0),
-( 7383, 0x00000001, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0.000000, 0.000000, 0),
-( 7434, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-( 8178, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-( 9452, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-( 9782, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-( 9784, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-( 9799, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(11095, 0x00000000, 3, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(11119, 0x00000004, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(11120, 0x00000004, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(11129, 0x00000004, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(11180, 0x00000010, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(11185, 0x00000000, 3, 0x00000080, 0x00000000, 0x00000000, 0x00050000, 0x00000000, 0.000000, 0.000000, 0),
-(11255, 0x00000000, 3, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(12169, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(12281, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
-(12289, 0x00000000, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(12298, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(12311, 0x00000000, 4, 0x00000800, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(12317, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(12319, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(12322, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
-(12487, 0x00000000, 3, 0x00000080, 0x00000000, 0x00000000, 0x00050000, 0x00000000, 0.000000, 0.000000, 0),
-(12488, 0x00000000, 3, 0x00000080, 0x00000000, 0x00000000, 0x00050000, 0x00000000, 0.000000, 0.000000, 0),
-(12598, 0x00000000, 3, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(12668, 0x00000000, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(12724, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(12725, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(12726, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(12727, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(12797, 0x00000000, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(12799, 0x00000000, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(12812, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
-(12813, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
-(12814, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
-(12815, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
-(12834, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(12846, 0x00000004, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(12847, 0x00000004, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(12848, 0x00000004, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(12849, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(12867, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(12872, 0x00000000, 3, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(12873, 0x00000000, 3, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(12958, 0x00000000, 4, 0x00000800, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(12966, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(12967, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(12968, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(12969, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(12970, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(12971, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(12972, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(12973, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(12974, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(12999, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 4.000000, 0.000000, 0),
-(13000, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6.000000, 0.000000, 0),
-(13001, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 8.000000, 0.000000, 0),
-(13002, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,10.000000, 0.000000, 0),
-(13045, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(13046, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(13047, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(13048, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(13163, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0),
-(13165, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(13754, 0x00000000, 8, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(13867, 0x00000000, 8, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(13983, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000018, 0.000000, 0.000000, 0),
-(14070, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000018, 0.000000, 0.000000, 0),
-(14071, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000018, 0.000000, 0.000000, 0),
-(14156, 0x00000000, 8, 0x003E0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(14160, 0x00000000, 8, 0x003E0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(14161, 0x00000000, 8, 0x003E0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(14186, 0x00000000, 8, 0x40800508, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(14190, 0x00000000, 8, 0x40800508, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(14193, 0x00000000, 8, 0x40800508, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(14194, 0x00000000, 8, 0x40800508, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(14195, 0x00000000, 8, 0x40800508, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(14531, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(14774, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(14892, 0x00000000, 6, 0x10001E00, 0x00010004, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(15088, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(15128, 0x00000004, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(15277, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6.000000, 0.000000, 0),
-(15286, 0x00000020, 6, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(15337, 0x00000000, 6, 0x00002000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(15338, 0x00000000, 6, 0x00002000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(15346, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6.000000, 0.000000, 0),
-(15362, 0x00000000, 6, 0x10001E00, 0x00010004, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(15363, 0x00000000, 6, 0x10001E00, 0x00010004, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(15600, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.000000, 0.000000, 0),
-(16164, 0x00000000, 11, 0x901000C3, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16176, 0x00000000, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16180, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16196, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16198, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16235, 0x00000000, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16240, 0x00000000, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16256, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16257, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(16277, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(16278, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(16279, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(16280, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(16281, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16282, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16283, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16284, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16487, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16489, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16492, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16550, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16620, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
-(16624, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(16850, 0x00000000, 7, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(16864, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
-(16880, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16923, 0x00000000, 7, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(16924, 0x00000000, 7, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(16952, 0x00000000, 7, 0x00039000, 0x00000400, 0x00040000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16954, 0x00000000, 7, 0x00039000, 0x00000400, 0x00040000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16958, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(16961, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(17106, 0x00000000, 7, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(17107, 0x00000000, 7, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(17108, 0x00000000, 7, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(17364, 0x00000008, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(17495, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(17793, 0x00000000, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(17796, 0x00000000, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(17801, 0x00000000, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(17802, 0x00000000, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(17803, 0x00000000, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(18073, 0x00000000, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(18094, 0x00000000, 5, 0x0000000A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(18095, 0x00000000, 5, 0x0000000A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(18096, 0x00000000, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(18119, 0x00000000, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(18120, 0x00000000, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(18820, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(19184, 0x00000000, 9, 0x00000010, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(19572, 0x00000000, 9, 0x00800000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
-(19573, 0x00000000, 9, 0x00800000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
-(20049, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(20056, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(20057, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(20128, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(20131, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(20132, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(20164, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 5.000000, 0.000000, 0),
-(20165, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,20.000000, 0.000000, 0),
-(20166, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,15.000000, 0.000000, 0),
-(20182, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(20210, 0x00000000, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(20212, 0x00000000, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(20213, 0x00000000, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(20214, 0x00000000, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(20215, 0x00000000, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(20234, 0x00000000, 10, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(20235, 0x00000000, 10, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(20335, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000008, 0x00000100, 0x00000000, 0.000000, 100.000000,0),
-(20375, 0x00000001, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 1),
-(20500, 0x00000000, 4, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(20501, 0x00000000, 4, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(20705, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(20784, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(20911, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
-(20925, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(21084, 0x00000001, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(21185, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
-(21882, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(21890, 0x00000000, 4, 0x2A764EEF, 0x0000036C, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(22007, 0x00000000, 3, 0x00200021, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(22618, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(22648, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(23547, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
-(23548, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(23551, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(23552, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
-(23572, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(23578, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
-(23581, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
-(23602, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(23686, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
-(23688, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(23689, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 4.000000, 0.000000, 0),
-(23695, 0x00000000, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(23721, 0x00000000, 9, 0x00000800, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(23920, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
-(24353, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(24389, 0x00000000, 3, 0x00C00017, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(24658, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00014110, 0x00000000, 0.000000, 0.000000, 0),
-(24905, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002,15.000000, 0.000000, 0),
-(24932, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 6),
-(25050, 0x00000004, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(25669, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.000000, 0.000000, 0),
-(25988, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(26016, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
-(26107, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000064, 0.000000, 0.000000, 0),
-(26119, 0x00000000, 10, 0x90100003, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(26128, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0.000000, 0.000000, 0),
-(26135, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(26480, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(26605, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(27419, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(27498, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(27521, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(27656, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(27774, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(27787, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(27811, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(27815, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(27816, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(28592, 0x00000010, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(28593, 0x00000010, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(28716, 0x00000000, 7, 0x00000010, 0x00000000, 0x00000000, 0x00048000, 0x00000000, 0.000000, 0.000000, 0),
-(28719, 0x00000000, 7, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(28744, 0x00000000, 7, 0x00000040, 0x00000000, 0x00000000, 0x00044000, 0x00000000, 0.000000, 0.000000, 0),
-(28752, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(28789, 0x00000000, 10, 0xC0000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(28802, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(28809, 0x00000000, 6, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(28812, 0x00000000, 8, 0x02000006, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(28816, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(28823, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(28847, 0x00000000, 7, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(28849, 0x00000000, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(29074, 0x00000014, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(29075, 0x00000014, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(29076, 0x00000014, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(29150, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(29179, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(29180, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(29385, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7.000000, 0.000000, 0),
-(29441, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0.000000, 0.000000, 1),
-(29444, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0.000000, 0.000000, 1),
-(29455, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(29501, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(29593, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
-(29594, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
-(29624, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(29625, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(29626, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(29632, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(29633, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(29634, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(29635, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(29636, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(29637, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(29834, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(29838, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(29977, 0x00000000, 3, 0x00C00017, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(30003, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
-(30160, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(30293, 0x00000000, 5, 0x00000181, 0x008200C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(30295, 0x00000000, 5, 0x00000181, 0x008200C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(30296, 0x00000000, 5, 0x00000181, 0x008200C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(30299, 0x0000007E, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(30301, 0x0000007E, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(30302, 0x0000007E, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(30675, 0x00000000, 11, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(30678, 0x00000000, 11, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(30679, 0x00000000, 11, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(30701, 0x0000001C, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(30705, 0x0000001C, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(30823, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 10.500000, 0.000000, 0),
-(30881, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 5),
-(30883, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 5),
-(30884, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 5),
-(30885, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 5),
-(30886, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 5),
-(30937, 0x00000020, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(31124, 0x00000000, 8, 0x2000000E, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(31126, 0x00000000, 8, 0x2000000E, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(31244, 0x00000000, 8, 0x003E0000, 0x00000009, 0x00000000, 0x00000000, 0x00002034, 0.000000, 0.000000, 0),
-(31394, 0x00000020, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(31569, 0x00000000, 3, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(31570, 0x00000000, 3, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(31785, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00008800, 0x00000000, 0.000000, 0.000000, 0),
-(31794, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(31801, 0x00000001, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(31833, 0x00000000, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(31835, 0x00000000, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(31836, 0x00000000, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(31871, 0x00000000, 10, 0x00000010, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
-(31872, 0x00000000, 10, 0x00000010, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
-(31876, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000008, 0x00004110, 0x00000000, 0.000000, 0.000000, 0),
-(31877, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000008, 0x00004110, 0x00000000, 0.000000, 0.000000, 0),
-(31878, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000008, 0x00004110, 0x00000000, 0.000000, 0.000000, 0),
-(31904, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(32385, 0x00000000, 5, 0x00000001, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(32409, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(32587, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(32642, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(32734, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
-(32748, 0x00000000, 8, 0x00000000, 0x00000001, 0x00000000, 0x00000140, 0x00000000, 0.000000, 0.000000, 0),
-(32776, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(32777, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(32837, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 45),
-(32844, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
-(32885, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(33076, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 0),
-(33089, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(33127, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7.000000, 0.000000, 0),
-(33142, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(33145, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(33146, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(33150, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(33151, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(33154, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(33191, 0x00000000, 6, 0x00808000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(33192, 0x00000000, 6, 0x00808000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(33193, 0x00000000, 6, 0x00808000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(33297, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(33299, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(33510, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 5.000000, 0.000000, 0),
-(33648, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(33719, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
-(33746, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
-(33757, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
-(33759, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
-(33881, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(33882, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(33883, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(33953, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 45),
-(34074, 0x00000000, 9, 0x0007FA43, 0x00881081, 0x00000201, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(34080, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0.000000, 0.000000, 0),
-(34138, 0x00000000, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(34139, 0x00000000, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(34258, 0x00000000, 10, 0x00000400, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(34262, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(34320, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 45),
-(34355, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
-(34497, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(34498, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(34499, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(34500, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(34502, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(34503, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(34506, 0x00000000, 9, 0x0007FA01, 0x00801081, 0x08000201, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(34584, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
-(34586, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.500000, 0.000000, 0),
-(34598, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(34749, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0.000000, 0.000000, 0),
-(34753, 0x00000000, 6, 0x00001800, 0x00000004, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(34774, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.500000, 0.000000, 20),
-(34783, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
-(34827, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
-(34859, 0x00000000, 6, 0x00001800, 0x00000004, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(34860, 0x00000000, 6, 0x00001800, 0x00000004, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(34914, 0x00000000, 6, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(34935, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 8),
-(34938, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 8),
-(34939, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 8),
-(34950, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(34954, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(35077, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
-(35080, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.000000, 0.000000, 60),
-(35083, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
-(35086, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
-(35100, 0x00000000, 9, 0x00001000, 0x00000000, 0x00000001, 0x00000100, 0x00000000, 0.000000, 0.000000, 0),
-(35121, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(36096, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
-(36111, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(36541, 0x00000004, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(37165, 0x00000000, 8, 0x00200400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(37168, 0x00000000, 8, 0x003E0000, 0x00000009, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(37170, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.000000, 0.000000, 0),
-(37173, 0x00000000, 8, 0x2CBC0598, 0x00000106, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
-(37189, 0x00000000, 10, 0xC0000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 60),
-(37193, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(37195, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(37197, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 45),
-(37213, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(37214, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(37227, 0x00000000, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 60),
-(37237, 0x00000000, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(37247, 0x00000008, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 45),
-(37377, 0x00000020, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(37379, 0x00000020, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(37384, 0x00000000, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(37443, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(37514, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
-(37516, 0x00000000, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(37519, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000030, 0.000000, 0.000000, 0),
-(37523, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(37528, 0x00000000, 4, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(37536, 0x00000000, 4, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(37568, 0x00000000, 6, 0x00000800, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(37594, 0x00000000, 6, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(37600, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(37601, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(37603, 0x00000000, 6, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(37655, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
-(37657, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 3),
-(38026, 0x00000001, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0.000000, 0.000000, 0),
-(38031, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(38290, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.600000, 0.000000, 0),
-(38299, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 12),
-(38326, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(38327, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(38334, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
-(38347, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 45),
-(38350, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(38394, 0x00000000, 5, 0x00000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(38857, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(39027, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
-(39372, 0x00000030, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(39437, 0x00000004, 5, 0x00001364, 0x000000C0, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(39442, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0.000000, 0.000000, 0),
-(39443, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(39530, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(39958, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.700000, 0.000000, 40),
-(40407, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6.000000, 0.000000, 0),
-(40438, 0x00000000, 6, 0x00008040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(40442, 0x00000000, 7, 0x00000014, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(40444, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(40458, 0x00000000, 4, 0x02000000, 0x00000601, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(40463, 0x00000000, 11, 0x00000081, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(40470, 0x00000000, 10, 0xC0800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(40475, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
-(40478, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(40482, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(40485, 0x00000000, 9, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(40899, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
-(41034, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
-(41260, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
-(41262, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
-(41381, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0.000000, 0.000000, 0),
-(41393, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
-(41434, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 45),
-(41469, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7.000000, 0.000000, 0),
-(41635, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 0),
-(41989, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.500000, 0.000000, 0),
-(42083, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 45),
-(42135, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 90),
-(42136, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 90),
-(42368, 0x00000000, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(42370, 0x00000000, 11, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(42770, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(43338, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(43443, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
-(43726, 0x00000000, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(43728, 0x00000000, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(43737, 0x00000000, 7, 0x00000000, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
-(43739, 0x00000000, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(43741, 0x00000000, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(43745, 0x00000000, 10, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(43748, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(43750, 0x00000000, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(43819, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(44404, 0x00000000, 3, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(44442, 0x00000000, 3, 0x00800000, 0x00000040, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 1),
-(44443, 0x00000000, 3, 0x00800000, 0x00000040, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 1),
-(44445, 0x00000000, 3, 0x00000013, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(44446, 0x00000000, 3, 0x00000013, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(44448, 0x00000000, 3, 0x00000013, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(44449, 0x00000000, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(44469, 0x00000000, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(44470, 0x00000000, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(44471, 0x00000000, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(44472, 0x00000000, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(44546, 0x00000000, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(44548, 0x00000000, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(44549, 0x00000000, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(44835, 0x00000000, 7, 0x00000000, 0x00000080, 0x00000000, 0x00000010, 0x00000000, 0.000000, 0.000000, 0),
-(45054, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 15),
-(45057, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
-(45234, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(45243, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(45244, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(45354, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(45355, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(45481, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(45482, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(45483, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(45484, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 45),
-(46025, 0x00000020, 6, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(46092, 0x00000000, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(46098, 0x00000000, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(46569, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(46662, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 20),
-(46832, 0x00000000, 7, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(46854, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(46855, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(46867, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(46913, 0x00000000, 4, 0x00000040, 0x00000404, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(46916, 0x00000000, 4, 0x00000000, 0x00000400, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(46951, 0x00000000, 4, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(46952, 0x00000000, 0, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(46953, 0x00000000, 0, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(47195, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
-(47196, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
-(47197, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
-(47201, 0x00000000, 5, 0x00000008, 0x00040000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(47202, 0x00000000, 5, 0x00000008, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(47203, 0x00000000, 5, 0x00000008, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(47204, 0x00000000, 5, 0x00000008, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(47205, 0x00000000, 5, 0x00000008, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(47245, 0x00000020, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(47246, 0x00000020, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(47247, 0x00000020, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(47258, 0x00000000, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(47259, 0x00000000, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(47260, 0x00000000, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(47263, 0x00000020, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 20),
-(47264, 0x00000020, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 20),
-(47265, 0x00000020, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 20),
-(47509, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(47511, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(47515, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(47516, 0x00000000, 6, 0x00001800, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(47517, 0x00000000, 6, 0x00001800, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(47569, 0x00000000, 6, 0x00004000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
-(47580, 0x00000000, 6, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(47581, 0x00000000, 6, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(47582, 0x00000000, 6, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(48110, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 0),
-(48111, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 0),
-(48483, 0x00000000, 7, 0x00008800, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(48484, 0x00000000, 7, 0x00008800, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(48485, 0x00000000, 7, 0x00008800, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(48496, 0x00000000, 7, 0x00000060, 0x02000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(48499, 0x00000000, 7, 0x00000060, 0x02000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(48500, 0x00000000, 7, 0x00000060, 0x02000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(48506, 0x00000000, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(48510, 0x00000000, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(48511, 0x00000000, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(48516, 0x00000000, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 30),
-(48521, 0x00000000, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 30),
-(48525, 0x00000000, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 30),
-(48539, 0x00000000, 7, 0x00000010, 0x04000000, 0x00000000, 0x00040000, 0x00000000, 0.000000, 0.000000, 0),
-(48833, 0x00000000, 7, 0x00000000, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(48835, 0x00000000, 10, 0x00000000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(48837, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(48988, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(49018, 0x00000000, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(49188, 0x00000000, 15, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(49208, 0x00000000, 15, 0x00440000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(49222, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
-(49503, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(49504, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(49529, 0x00000000, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(49530, 0x00000000, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(49622, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
-(50781, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 6),
-(50880, 0x00000010, 15, 0x00000000, 0x00000800, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(51123, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(51127, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(51128, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(51129, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(51130, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(51346, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
-(51349, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
-(51352, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
-(51359, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
-(51414, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(51470, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(51474, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(51478, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(51479, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(51483, 0x00000001, 11, 0x20000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
-(51485, 0x00000001, 11, 0x20000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
-(51486, 0x00000001, 11, 0x20000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
-(51521, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 1),
-(51528, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,12.500000, 0.000000, 0),
-(51556, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(51557, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(51558, 0x00000000, 11, 0x000000C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(51562, 0x00000000, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(51563, 0x00000000, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(51564, 0x00000000, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(51565, 0x00000000, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(51566, 0x00000000, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(51625, 0x00000000, 8, 0x1000A000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(51626, 0x00000000, 8, 0x1000A000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(51627, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
-(51628, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
-(51629, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
-(51634, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(51635, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(51636, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(51664, 0x00000000, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(51665, 0x00000000, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(51667, 0x00000000, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(51668, 0x00000000, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(51669, 0x00000000, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(51672, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 1),
-(51674, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 1),
-(51679, 0x00000000, 8, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(51692, 0x00000000, 8, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(51696, 0x00000000, 8, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(51698, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 1),
-(51700, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 1),
-(51701, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 1),
-(51940, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000,20.000000, 0),
-(51989, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000,20.000000, 0),
-(52004, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000,20.000000, 0),
-(52005, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000,20.000000, 0),
-(52007, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000,20.000000, 0),
-(52008, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000,20.000000, 0),
-(52020, 0x00000000, 7, 0x00008000, 0x00100000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(52127, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
-(52420, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
-(52423, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
-(53527, 0x00000000, 10, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(52795, 0x00000000, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(52797, 0x00000000, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(52798, 0x00000000, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(52799, 0x00000000, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(52800, 0x00000000, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(52898, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53215, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(53216, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(53217, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(53221, 0x00000000, 9, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(53222, 0x00000000, 9, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(53224, 0x00000000, 9, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(53228, 0x00000000, 9, 0x00000020, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(53232, 0x00000000, 9, 0x00000020, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(53234, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53237, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53238, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53256, 0x00000000, 9, 0x00000800, 0x00800001, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53259, 0x00000000, 9, 0x00000800, 0x00800001, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53260, 0x00000000, 9, 0x00000800, 0x00800001, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53290, 0x00000000, 9, 0x00000800, 0x00000001, 0x00000200, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53380, 0x00000000, 10, 0x00800000, 0x00028000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53397, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53486, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53501, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53502, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53503, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53551, 0x00000000, 10, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(53552, 0x00000000, 10, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(53553, 0x00000000, 10, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(53569, 0x00000000, 10, 0x00200000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53576, 0x00000000, 10, 0x00200000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53601, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 6),
-(53646, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(53671, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(53673, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(53709, 0x00000000, 10, 0x00004000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0.000000, 0.000000, 0),
-(53817, 0x00000000, 11, 0x000001C3, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(54149, 0x00000000, 10, 0x00200000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(54151, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(54154, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(54155, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(54278, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(54486, 0x00000000, 0, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(54488, 0x00000000, 0, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(54489, 0x00000000, 0, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(54490, 0x00000000, 0, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(54646, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00015400, 0x00000002, 0.000000, 0.000000, 0),
-(54695, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(54707, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
-(54738, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 45),
-(54747, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(54749, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(54754, 0x00000000, 7, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(54808, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
-(54838, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(54841, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 3),
-(54937, 0x00000000, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(54939, 0x00000000, 10, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(55166, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(55380, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(55440, 0x00000000, 11, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(55640, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(55666, 0x00000000, 15, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(55677, 0x00000000, 6, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(55680, 0x00000000, 6, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(55689, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(55747, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(55768, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(55776, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(56218, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(56342, 0x00000000, 9, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(56343, 0x00000000, 9, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(56344, 0x00000000, 9, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(56355, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(56364, 0x00000000, 3, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(56372, 0x00000000, 3, 0x00000000, 0x00000080, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
-(56375, 0x00000000, 3, 0x01000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0),
-(56451, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
-(56611, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(56612, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(56613, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(56614, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(56636, 0x00000000, 4, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
-(56816, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000030, 0.000000, 0.000000, 0),
-(56821, 0x00000000, 8, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(56834, 0x00000000, 15, 0x00440000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(56835, 0x00000000, 15, 0x00440000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(57345, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(57352, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00010154, 0x00000003, 0.000000, 0.000000, 45),
-(57470, 0x00000000, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(57472, 0x00000000, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(57499, 0x00000000, 4, 0x40000001, 0x00010000, 0x00000000, 0x00014000, 0x00000000, 0.000000, 0.000000, 0),
-(57870, 0x00000000, 9, 0x00800000, 0x00000000, 0x00000000, 0x00040000, 0x00000000, 0.000000, 0.000000, 0),
-(57878, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0),
-(57880, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0),
-(57881, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0),
-(57989, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0.000000, 0.000000, 0),
-(58357, 0x00000000, 4, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(58364, 0x00000000, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(58372, 0x00000000, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(58386, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
-(58442, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 15),
-(58444, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 5),
-(58597, 0x00000000, 10, 0x40000000, 0x00000000, 0x00000000, 0x00008000, 0x00000000, 0.000000, 100.000000,6),
-(58616, 0x00000000, 15, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(58620, 0x00000000, 15, 0x00000000, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(58626, 0x00000000, 15, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(58644, 0x00000000, 15, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(58647, 0x00000000, 15, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(58677, 0x00000000, 15, 0x00002000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
-(58872, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(58874, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
-(58901, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 45),
-(59176, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(59327, 0x00000000, 15, 0x08000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(59345, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(59630, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(59725, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
-(60061, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(60063, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(60066, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(60132, 0x00000000, 15, 0x00000000, 0x08020000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60170, 0x00000000, 5, 0x00000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60172, 0x00000000, 5, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
-(60221, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(60301, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(60306, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(60317, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(60436, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(60442, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(60473, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(60482, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(60487, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 15),
-(60490, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(60493, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(60503, 0x00000000, 4, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60519, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(60529, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(60537, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 45),
-(60564, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60571, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60572, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60573, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60574, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60575, 0x00000000, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60617, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
-(60710, 0x00000000, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60717, 0x00000000, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60719, 0x00000000, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60722, 0x00000000, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60724, 0x00000000, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60726, 0x00000000, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60770, 0x00000000, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60818, 0x00000000, 10, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(60826, 0x00000000, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(61062, 0x00000000, 3, 0x00000000, 0x00000100, 0x00000000, 0x00004000, 0x00010000, 0.000000, 0.000000, 0),
-(61188, 0x00000000, 5, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(61257, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000202A8, 0x00010000, 0.000000, 0.000000, 0),
-(61324, 0x00000000, 10, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(61345, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(61346, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(61356, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x000002A8, 0x00000002, 0.000000, 0.000000, 45),
-(61618, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(61846, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(62600, 0x00000000, 7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(63108, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(63156, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(63245, 0x00000000, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(63280, 0x00000000, 11, 0x20000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0x000000, 0.000000, 0),
-(63320, 0x00000000, 5, 0x00040000, 0x00000000, 0x00008000, 0x00004000, 0x00000001, 0.000000, 0.000000, 0),
-(63373, 0x00000000, 11, 0x80000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0),
-(63534, 0x00000000, 6, 0x00000040, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
-(63611, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00050014, 0x00000000, 0.000000, 0.000000, 0),
-(63625, 0x00000000, 6, 0x02000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0),
-(63730, 0x00000000, 6, 0x00000800, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(64928, 0x00000000, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
-(64976, 0x00000000, 4, 0x00000001, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0),
-(65661, 0x00000000, 15, 0x00400011 ,0x20020004 ,0x00000000, 0x00000010, 0x00000000, 0.000000, 100.000000,0),
-(64127, 0x00000000, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(67228, 0x00000004, 11, 0x00000000, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(67353, 0x00000000, 7, 0x00008000, 0x00100500, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
-(67361, 0x00000040, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
-(67667, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(67672, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 50),
-(67702, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(67771, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
-(70664, 0x00000000, 7, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000, 2.000000, 0),
-(70748, 0x00000000, 3, 0x00000000, 0x00200000, 0x00000000, 0x00000000, 0x00000000, 0x000000, 0.000000, 0);
+( 324, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+( 974, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+( 3232, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+( 5952, 0x00, 8, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+( 6346, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0.000000, 0.000000, 0),
+( 7383, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0.000000, 0.000000, 0),
+( 7434, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+( 8178, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+( 9452, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+( 9782, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+( 9784, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+( 9799, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(11095, 0x00, 3, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(11119, 0x04, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(11129, 0x04, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(11180, 0x10, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(11185, 0x00, 3, 0x00000080, 0x00000000, 0x00000000, 0x00050000, 0x00000000, 0.000000, 0.000000, 0),
+(11255, 0x00, 3, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(12169, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(12281, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
+(12289, 0x00, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(12298, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(12311, 0x00, 4, 0x00000800, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(12317, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(12319, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(12322, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
+(12797, 0x00, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(12834, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(12966, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(12967, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(12968, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(12969, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(12970, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(12999, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 4.000000, 0.000000, 0),
+(13000, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6.000000, 0.000000, 0),
+(13001, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 8.000000, 0.000000, 0),
+(13002, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,10.000000, 0.000000, 0),
+(13165, 0x00, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(13754, 0x00, 8, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(13983, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000018, 0.000000, 0.000000, 0),
+(14156, 0x00, 8, 0x003E0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(14186, 0x00, 8, 0x40800508, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(14531, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(14892, 0x00, 6, 0x10001E00, 0x00010004, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(15088, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(15128, 0x04, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(15277, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6.000000, 0.000000, 0),
+(15286, 0x20, 6, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(15337, 0x00, 6, 0x00002000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(15346, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6.000000, 0.000000, 0),
+(15600, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.000000, 0.000000, 0),
+(16164, 0x1C, 11, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000002, 0.000000, 0.000000, 0),
+(16176, 0x00, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16180, 0x00, 11, 0x000001C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16246, 0x00, 11, 0x981001C3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(16256, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16257, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(16277, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(16278, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(16279, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(16280, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(16487, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16550, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16620, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
+(16624, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(16850, 0x00, 7, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(16864, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
+(16880, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16952, 0x00, 7, 0x00039000, 0x00000400, 0x00040000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16954, 0x00, 7, 0x00039000, 0x00000400, 0x00040000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16958, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(16961, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(17106, 0x00, 7, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(17364, 0x08, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(17495, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(17793, 0x00, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(18094, 0x00, 5, 0x0000000A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(18096, 0x00, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(18119, 0x00, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(18820, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(19184, 0x00, 9, 0x00000010, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(19572, 0x00, 9, 0x00800000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
+(20049, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(20128, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(20131, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(20132, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(20164, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 5.000000, 0.000000, 0),
+(20165, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,20.000000, 0.000000, 0),
+(20166, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,15.000000, 0.000000, 0),
+(20210, 0x00, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(20234, 0x00, 10, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(20335, 0x00, 10, 0x00800000, 0x00000000, 0x00000008, 0x00000100, 0x00000000, 0.000000, 100.000000,0),
+(20375, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 1),
+(20500, 0x00, 4, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(20705, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(20784, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(20911, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
+(20925, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(21084, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(21185, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(21882, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(21890, 0x00, 4, 0x2A764EEF, 0x0000036C, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(22007, 0x00, 3, 0x00200021, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(22618, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(22648, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(23547, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
+(23548, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(23551, 0x00, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(23552, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(23572, 0x00, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(23578, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
+(23581, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
+(23602, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(23686, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
+(23688, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(23689, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 4.000000, 0.000000, 0),
+(23721, 0x00, 9, 0x00000800, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(23920, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
+(24353, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(24389, 0x00, 3, 0x00C00017, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(24658, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00014110, 0x00000000, 0.000000, 0.000000, 0),
+(24905, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002,15.000000, 0.000000, 0),
+(24932, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 6),
+(25050, 0x04, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(25669, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.000000, 0.000000, 0),
+(26016, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
+(26107, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000064, 0.000000, 0.000000, 0),
+(26119, 0x00, 10, 0x90100003, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(26128, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0.000000, 0.000000, 0),
+(26135, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(26480, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(26605, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(27419, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(27498, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(27521, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(27656, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(27774, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(27787, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(27811, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(28716, 0x00, 7, 0x00000010, 0x00000000, 0x00000000, 0x00048000, 0x00000000, 0.000000, 0.000000, 0),
+(28719, 0x00, 7, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(28744, 0x00, 7, 0x00000040, 0x00000000, 0x00000000, 0x00044000, 0x00000000, 0.000000, 0.000000, 0),
+(28752, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(28789, 0x00, 10, 0xC0000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(28802, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(28809, 0x00, 6, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(28812, 0x00, 8, 0x02000006, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(28816, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(28823, 0x00, 11, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(28847, 0x00, 7, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(28849, 0x00, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(29074, 0x14, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(29150, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29385, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7.000000, 0.000000, 0),
+(29441, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0.000000, 0.000000, 1),
+(29455, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(29501, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29593, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
+(29624, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29625, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29626, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29632, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29633, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29634, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29635, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29636, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29637, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(29834, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(29977, 0x00, 3, 0x00C00017, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30003, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
+(30160, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(30293, 0x00, 5, 0x00000181, 0x008200C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30299, 0x7E, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30675, 0x00, 11, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30701, 0x1C, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30705, 0x1C, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(30823, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 10.500000, 0.000000, 0),
+(30881, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
+(30937, 0x20, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31124, 0x00, 8, 0x2000000E, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31244, 0x00, 8, 0x003E0000, 0x00000009, 0x00000000, 0x00000000, 0x00002034, 0.000000, 0.000000, 0),
+(31394, 0x20, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31569, 0x00, 3, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31785, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00008800, 0x00000000, 0.000000, 0.000000, 0),
+(31794, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(31801, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31833, 0x00, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(31871, 0x00, 10, 0x00000010, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
+(31876, 0x00, 10, 0x00800000, 0x00000000, 0x00000008, 0x00004110, 0x00000000, 0.000000, 0.000000, 0),
+(31904, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(32385, 0x00, 5, 0x00000001, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(32587, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(32642, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(32734, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(32748, 0x00, 8, 0x00000000, 0x00000001, 0x00000000, 0x00000140, 0x00000000, 0.000000, 0.000000, 0),
+(32776, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(32777, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(32837, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 45),
+(32844, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 0),
+(32885, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33076, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 0),
+(33089, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(33127, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7.000000, 0.000000, 0),
+(33142, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33150, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33151, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33191, 0x00, 6, 0x00808000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(33297, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(33299, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(33510, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 5.000000, 0.000000, 0),
+(33648, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33719, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
+(33746, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(33757, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(33759, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(33881, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(33953, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 45),
+(34074, 0x00, 9, 0x0007FA43, 0x00881081, 0x00000201, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(34080, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0.000000, 0.000000, 0),
+(34138, 0x00, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(34139, 0x00, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(34258, 0x00, 10, 0x00000400, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(34262, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(34320, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 45),
+(34355, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(34497, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(34500, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(34506, 0x00, 9, 0x0007FA01, 0x00801081, 0x08000201, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(34584, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
+(34586, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.500000, 0.000000, 0),
+(34598, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(34749, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0.000000, 0.000000, 0),
+(34753, 0x00, 6, 0x00001800, 0x00000004, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(34774, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.500000, 0.000000, 20),
+(34783, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
+(34827, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(34914, 0x00, 6, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(34935, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 8),
+(34950, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(35077, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
+(35080, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.000000, 0.000000, 60),
+(35083, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
+(35086, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
+(35100, 0x00, 9, 0x00001000, 0x00000000, 0x00000001, 0x00000100, 0x00000000, 0.000000, 0.000000, 0),
+(35121, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(36096, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
+(36541, 0x04, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37165, 0x00, 8, 0x00200400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37168, 0x00, 8, 0x003E0000, 0x00000009, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37170, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.000000, 0.000000, 0),
+(37173, 0x00, 8, 0x2CBC0598, 0x00000106, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
+(37189, 0x00, 10, 0xC0000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 60),
+(37193, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(37195, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37197, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 45),
+(37213, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(37214, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(37227, 0x00, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 60),
+(37237, 0x00, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(37247, 0x08, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 45),
+(37377, 0x20, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(37379, 0x20, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37384, 0x00, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37443, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(37514, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
+(37516, 0x00, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37519, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000030, 0.000000, 0.000000, 0),
+(37523, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(37528, 0x00, 4, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37536, 0x00, 4, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37568, 0x00, 6, 0x00000800, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37594, 0x00, 6, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37600, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(37601, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(37603, 0x00, 6, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(37655, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
+(37657, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 3),
+(38026, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0.000000, 0.000000, 0),
+(38031, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(38290, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1.600000, 0.000000, 0),
+(38299, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 12),
+(38326, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(38327, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(38334, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
+(38347, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 45),
+(38350, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(38394, 0x00, 5, 0x00000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(38857, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(39027, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(39372, 0x30, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(39437, 0x04, 5, 0x00001364, 0x000000C0, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(39442, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0.000000, 0.000000, 0),
+(39443, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(39530, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(39958, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.700000, 0.000000, 40),
+(40407, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 6.000000, 0.000000, 0),
+(40438, 0x00, 6, 0x00008040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(40442, 0x00, 7, 0x00000014, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(40444, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(40458, 0x00, 4, 0x02000000, 0x00000601, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(40463, 0x00, 11, 0x00000081, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(40470, 0x00, 10, 0xC0800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(40475, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 3.000000, 0.000000, 0),
+(40478, 0x00, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(40482, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(40485, 0x00, 9, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(40899, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(41034, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0),
+(41260, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(41262, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(41381, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0.000000, 0.000000, 0),
+(41393, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
+(41434, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.000000, 0.000000, 45),
+(41469, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 7.000000, 0.000000, 0),
+(41635, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 0),
+(41989, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.500000, 0.000000, 0),
+(42083, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 45),
+(42135, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 90),
+(42136, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 90),
+(42368, 0x00, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(42370, 0x00, 11, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(42770, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(43338, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(43443, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
+(43726, 0x00, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(43728, 0x00, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(43737, 0x00, 7, 0x00000000, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(43739, 0x00, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(43741, 0x00, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(43745, 0x00, 10, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(43748, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(43750, 0x00, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(43819, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(44404, 0x00, 3, 0x20000021, 0x00009000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(44442, 0x00, 3, 0x00800000, 0x00000040, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 1),
+(44445, 0x00, 3, 0x00000013, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(44449, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(44546, 0x00, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(44835, 0x00, 7, 0x00000000, 0x00000080, 0x00000000, 0x00000010, 0x00000000, 0.000000, 0.000000, 0),
+(45054, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 15),
+(45057, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
+(45234, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(45354, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(45355, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(45481, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(45482, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(45483, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(45484, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 45),
+(46025, 0x20, 6, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(46092, 0x00, 10, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(46098, 0x00, 11, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(46569, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(46662, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 20),
+(46832, 0x00, 7, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(46854, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(46867, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(46913, 0x00, 4, 0x00000040, 0x00000404, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(46916, 0x00, 4, 0x00000000, 0x00000400, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(46951, 0x00, 4, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47195, 0x00, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
+(47201, 0x00, 5, 0x00000008, 0x00040000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(47245, 0x20, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47258, 0x00, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(47263, 0x20, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 20),
+(47264, 0x20, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 20),
+(47265, 0x20, 5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 20),
+(47509, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(47516, 0x00, 6, 0x00001800, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(47569, 0x00, 6, 0x00004000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
+(47580, 0x00, 6, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(48110, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 0),
+(48111, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 0),
+(48483, 0x00, 7, 0x00008800, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48496, 0x00, 7, 0x00000060, 0x02000002, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(48506, 0x00, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48516, 0x00, 7, 0x00000005, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 30),
+(48539, 0x00, 7, 0x00000010, 0x04000000, 0x00000000, 0x00040000, 0x00000000, 0.000000, 0.000000, 0),
+(48833, 0x00, 7, 0x00000000, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48835, 0x00, 10, 0x00000000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48837, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(48988, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(49018, 0x00, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(49188, 0x00, 15, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(49208, 0x00, 15, 0x00440000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(49222, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(49622, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
+(50781, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 6),
+(50880, 0x10, 15, 0x00000000, 0x00000800, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51123, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51346, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(51349, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(51352, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(51359, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10),
+(51414, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(51474, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(51483, 0x01, 11, 0x20000000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
+(51521, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 1),
+(51528, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,12.500000, 0.000000, 0),
+(51556, 0x00, 11, 0x000000C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51562, 0x00, 11, 0x00000100, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51625, 0x00, 8, 0x1000A000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51627, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0),
+(51634, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51664, 0x00, 8, 0x00020000, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(51672, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 1),
+(51692, 0x00, 8, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(51698, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 1),
+(51940, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000,20.000000, 0),
+(51989, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000,20.000000, 0),
+(52004, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000,20.000000, 0),
+(52005, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000,20.000000, 0),
+(52007, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000,20.000000, 0),
+(52008, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000,20.000000, 0),
+(52020, 0x00, 7, 0x00008000, 0x00100000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(52127, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(52420, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30),
+(52423, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
+(53527, 0x00, 10, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(52795, 0x00, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(52898, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53215, 0x00, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53221, 0x00, 9, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53228, 0x00, 9, 0x00000020, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53234, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53256, 0x00, 9, 0x00000800, 0x00800001, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53290, 0x00, 9, 0x00000800, 0x00000001, 0x00000200, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53380, 0x00, 10, 0x00800000, 0x00028000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53397, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53486, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53501, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53551, 0x00, 10, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53569, 0x00, 10, 0x00200000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53601, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000A02A8, 0x00000000, 0.000000, 0.000000, 6),
+(53646, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(53671, 0x00, 10, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(53709, 0x00, 10, 0x00004000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0.000000, 0.000000, 0),
+(53817, 0x00, 11, 0x000001C3, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(54149, 0x00, 10, 0x00200000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(54278, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(54646, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(54695, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(54707, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
+(54738, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 45),
+(54747, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(54754, 0x00, 7, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(54808, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 60),
+(54838, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(54841, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 3),
+(54937, 0x00, 10, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(54939, 0x00, 10, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55166, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(55380, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(55440, 0x00, 11, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55640, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(55666, 0x00, 15, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55677, 0x00, 6, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55680, 0x00, 6, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(55689, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(55747, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(55768, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(55776, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(56218, 0x00, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56342, 0x00, 9, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56355, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(56364, 0x00, 3, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(56372, 0x00, 3, 0x00000000, 0x00000080, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
+(56375, 0x00, 3, 0x01000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0),
+(56451, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3),
+(56636, 0x00, 4, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
+(56816, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000030, 0.000000, 0.000000, 0),
+(56821, 0x00, 8, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(57345, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(57352, 0x00, 0, 0x00000001, 0x00000040, 0x00000000, 0x00010154, 0x00000003, 0.000000, 0.000000, 45),
+(57470, 0x00, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(57499, 0x00, 4, 0x40000001, 0x00010000, 0x00000000, 0x00014000, 0x00000000, 0.000000, 0.000000, 0),
+(57870, 0x00, 9, 0x00800000, 0x00000000, 0x00000000, 0x00040000, 0x00000000, 0.000000, 0.000000, 0),
+(57878, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0),
+(57989, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0.000000, 0.000000, 0),
+(58357, 0x00, 4, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(58364, 0x00, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58372, 0x00, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58386, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
+(58442, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 15),
+(58444, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 5),
+(58597, 0x00, 10, 0x40000000, 0x00000000, 0x00000000, 0x00008000, 0x00000000, 0.000000, 100.000000,6),
+(58616, 0x00, 15, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58620, 0x00, 15, 0x00000000, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58626, 0x00, 15, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58644, 0x00, 15, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58647, 0x00, 15, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(58677, 0x00, 15, 0x00002000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
+(58872, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0),
+(58901, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 45),
+(59176, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(59327, 0x00, 15, 0x08000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(59345, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(59630, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(59725, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0),
+(60061, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60063, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60066, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60132, 0x00, 15, 0x00000000, 0x08020000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60170, 0x00, 5, 0x00000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60172, 0x00, 5, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0),
+(60221, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60301, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60306, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60317, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60436, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60442, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60473, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60482, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60487, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 15),
+(60490, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60493, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60503, 0x00, 4, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60519, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60529, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(60537, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 45),
+(60564, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60571, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60572, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60573, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60574, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60575, 0x00, 11, 0x90100000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60617, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
+(60710, 0x00, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60717, 0x00, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60719, 0x00, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60722, 0x00, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60724, 0x00, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60726, 0x00, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60770, 0x00, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60818, 0x00, 10, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(60826, 0x00, 15, 0x01400000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(61062, 0x00, 3, 0x00000000, 0x00000100, 0x00000000, 0x00004000, 0x00010000, 0.000000, 0.000000, 0),
+(61188, 0x00, 5, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(61257, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000202A8, 0x00010000, 0.000000, 0.000000, 0),
+(61324, 0x00, 10, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(61356, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000002A8, 0x00000002, 0.000000, 0.000000, 45),
+(61618, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(61846, 0x00, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(62600, 0x00, 7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(63108, 0x00, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(63156, 0x00, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(63280, 0x00, 11, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(63320, 0x00, 5, 0x00040000, 0x00000000, 0x00008000, 0x00004000, 0x00000001, 0.000000, 0.000000, 0),
+(63373, 0x00, 11, 0x80000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0),
+(63534, 0x00, 6, 0x00000040, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0),
+(63611, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00050014, 0x00000000, 0.000000, 0.000000, 0),
+(63625, 0x00, 6, 0x02000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0),
+(63730, 0x00, 6, 0x00000800, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(64928, 0x00, 11, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(64976, 0x00, 4, 0x00000001, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0),
+(65661, 0x00, 15, 0x00400011 ,0x20020004 ,0x00000000, 0x00000010, 0x00000000, 0.000000, 100.000000,0),
+(64127, 0x00, 6, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(67228, 0x04, 11, 0x00000000, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(67353, 0x00, 7, 0x00008000, 0x00100500, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(67361, 0x40, 7, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 6),
+(67667, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(67672, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 50),
+(67702, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(67771, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45),
+(70664, 0x00, 7, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(70748, 0x00, 3, 0x00000000, 0x00200000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0);
/*!40000 ALTER TABLE `spell_proc_event` ENABLE KEYS */;
UNLOCK TABLES;
@@ -18764,6 +18373,9 @@ CREATE TABLE `spell_scripts` (
`command` mediumint(8) unsigned NOT NULL default '0',
`datalong` mediumint(8) unsigned NOT NULL default '0',
`datalong2` int(10) unsigned NOT NULL default '0',
+ `datalong3` int(10) unsigned NOT NULL default '0',
+ `datalong4` int(10) unsigned NOT NULL default '0',
+ `data_flags` tinyint(3) unsigned NOT NULL default '0',
`dataint` int(11) NOT NULL default '0',
`x` float NOT NULL default '0',
`y` float NOT NULL default '0',
diff --git a/sql/mangos_spell_check.sql b/sql/mangos_spell_check.sql
index b612bd4f3..17c1a618d 100644
--- a/sql/mangos_spell_check.sql
+++ b/sql/mangos_spell_check.sql
@@ -16,8 +16,9 @@
/* re-adding before command use. So need just adding new line to file. */
/* Current table fill progress state: */
-/* SpellEffect.cpp from start until end of Spell::EffectTameCreature */
-/* at 9ba5ff723a68e397a53b3ffe5ec8d749e8ba3eab [9690] state */
+/* SpellEffect.cpp from start until end of Spell::EffectTameCreature */
+/* Spell.cpp */
+/* at 6ee669d1d52581d4707c6475b512e6cc53844121 [9944] state */
DROP TABLE IF EXISTS spell_check;
CREATE TABLE `spell_check` (
@@ -39,11 +40,13 @@ CREATE TABLE `spell_check` (
INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMaskB,SpellIcon,SpellVisual,SpellCategory,EffectType,EffectAura,EffectIdx,Name,Code) VALUES
/* sorted by spell ids */
/*id fm familyMaskA fmMaskB icon vis cat eff aur ef name code */
-(1454, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'),
-(1455, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'),
-(1456, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'),
(1535, 11, -1, -1, 33, -1, -1, 3, -1,-1,'Fire Nova', 'Spell::EffectDummy'),
+(1784, 8, -1, -1, -1, -1, -1, -1, -1,-1,'Stealth', 'Spell::EffectTriggerSpell'),
(2584, -1, -1, -1, -1, -1, -1, -1, 4,-1,'Waiting to Resurrect', 'Spell::EffectSpiritHeal'),
+(2641, -1, -1, -1, -1, -1, -1, -1, -1,-1,'Dismiss Pet', 'Spell::CheckTargetCreatureType'),
+(2764, -1, -1, -1, -1, -1, -1, -1, -1,-1,'Throw', 'Spell::CheckCast'),
+(2825, 11, -1, -1, -1, -1, -1, -1, -1,-1,'Bloodlust', 'Spell::cast'),
+(6788, -1, -1, -1, -1, -1, -1, -1, -1,-1,'Weakened Soul', 'Spell::cast'),
(9512, -1, -1, -1, -1, -1, -1, 30, -1,-1,'Restore Energy', 'Spell::EffectEnergize'),
(4073, -1, -1, -1, -1, -1, -1, -1, -1,-1,'Mechanical Dragonling', 'Spell::EffectDummy'),
(5938, 8, -1, -1, -1, -1, -1, 3, -1,-1,'Shiv', 'Spell::EffectDummy'),
@@ -73,9 +76,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(11307,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Fire Nova', 'Spell::EffectDummy'),
(11314,11, -1, -1, 33, -1, -1, 3, -1,-1,'Fire Nova', 'Spell::EffectDummy'),
(11315,11, -1, -1, 33, -1, -1, 3, -1,-1,'Fire Nova', 'Spell::EffectDummy'),
-(11687, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'),
-(11688, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'),
-(11689, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'),
+(11196,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Recently Bandaged', 'Spell::cast'),
(11958, 3, -1, -1, -1, -1, -1, 3, -1,-1,'Cold Snap', 'Spell::EffectDummy'),
(12749,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Mithril Mechanical Dragonling', 'Spell::EffectDummy'),
(12975, 4, -1, -1, -1, -1, -1, 3, -1,-1,'Last Stand', 'Spell::EffectDummy'),
@@ -86,30 +87,34 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(13166,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Gnomish Battle Chicken', 'Spell::EffectDummy'),
(13567, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Dummy Trigger', 'Spell::EffectDummy'),
(14185, 8, -1, -1, -1, -1, -1, 3, -1,-1,'Preparation', 'Spell::EffectDummy'),
+(14278, 8, -1, -1, -1, -1, -1, -1, -1,-1,'Ghostly Strike', 'Spell::EffectWeaponDmg'),
+(15237, 6, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
+(15430, 6, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
+(15431, 6, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
(15998, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Capture Worg Pup', 'Spell::EffectDummy'),
(16566,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Net-o-Matic', 'Spell::EffectDummy'),
(16589, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Noggenfogger Elixir', 'Spell::EffectDummy'),
(16591,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Noggenfogger Elixir', 'Spell::EffectDummy'),
(16593,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Noggenfogger Elixir', 'Spell::EffectDummy'),
(16595,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Noggenfogger Elixir', 'Spell::EffectDummy'),
+(16857, 7, -1, -1, -1, -1, -1, -1, -1,-1,'Faerie Fire', 'Spell::cast'),
(17251, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Spirit Healer Res', 'Spell::EffectDummy'),
(17269,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Create Resonating Skull', 'Spell::EffectDummy'),
(17270,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Create Bone Dust', 'Spell::EffectDummy'),
(17271, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Test Fetid Skull', 'Spell::EffectDummy'),
-(18788,-1, -1, -1, -1, -1, -1, 1, -1,-1,'Demonic Sacrifice', 'Spell::EffectInstaKill'),
-(18789,-1, -1, -1, -1, -1, -1, -1, -1,-1,'', 'Spell::EffectInstaKill'),
-(18790,-1, -1, -1, -1, -1, -1, -1, -1,-1,'', 'Spell::EffectInstaKill'),
-(18791,-1, -1, -1, -1, -1, -1, -1, -1,-1,'', 'Spell::EffectInstaKill'),
-(18792,-1, -1, -1, -1, -1, -1, -1, -1,-1,'', 'Spell::EffectInstaKill'),
(19658,-1, -1, -1, -1, -1, -1, 10, -1,-1,'Devour Magic Effect', 'Spell::EffectDispel'),
(19804,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Arcanite Dragonling', 'Spell::EffectDummy'),
(19823,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Fire Nova Visual', 'Spell::EffectDummy'),
(20167,-1, -1, -1, -1, -1, -1, 10, -1,-1,'Seal of Light', 'Spell::EffectHeal'),
(20187,10, -1, -1, -1, -1, -1, 2, -1,-1,'Judgement of Righteousness', 'Spell::EffectSchoolDMG'),
(20253, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Intercept', 'Spell::EffectSchoolDMG'),
+(20424,10, -1, -1, -1, -1, -1, -1, -1,-1,'Seal of Command', 'Spell::SetTargetMap'),
(20473,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
+(20577,-1, -1, -1, -1, -1, -1, 3, -1,-1,'Cannibalize', 'Spell::CheckTarget'),
(20577, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Cannibalize', 'Spell::EffectDummy'),
+(20577,-1, -1, -1, -1, -1, -1, 3, -1,-1,'Cannibalize', 'Spell::SetTargetMap'),
(20578,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Cannibalize', 'Spell::EffectDummy'),
+(20594, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Stoneskin', 'Spell::cast'),
(20647,-1, -1, -1, -1, -1, -1, 2, -1, 0,'Execute', 'Spell::EffectDummy'),
(20929,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
(20930,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
@@ -122,6 +127,9 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(23076, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Mechanical Dragonling', 'Spell::EffectDummy'),
(23133, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Gnomish Battle Chicken', 'Spell::EffectDummy'),
(23170,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Brood Affliction: Bronze', 'Spell::EffectDummy'),
+(23334,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Horde Flag Drop', 'Spell::CheckCasterAuras'),
+(23336,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Alliance Flag Drop', 'Spell::CheckCasterAuras'),
+(23356,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Taming Lesson', 'Spell::CheckTargetCreatureType'),
(23441,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Gadgetzan Transporter', 'Spell::EffectDummy'),
(23442,-1, -1, -1, -1, -1, -1, 5, -1,-1,'Everlook Transporter', 'Spell::EffectTeleportUnits'),
(23444,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Transporter Malfunction', 'Spell::EffectDummy'),
@@ -131,6 +139,9 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(23448, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Transporter Arrival', 'Spell::EffectDummy'),
(23449,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Transporter Malfunction', 'Spell::EffectTeleportUnits'),
(23453, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Gnomish Transporter', 'Spell::EffectDummy'),
+(23455,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
+(23458,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
+(23459,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
(23645, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Hourglass Sand', 'Spell::EffectDummy'),
(23725, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Gift of Life', 'Spell::EffectDummy'),
(23782,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Gift of Life', 'Spell::EffectDummy'),
@@ -142,11 +153,15 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(24532,-1, -1, -1, -1, -1, -1, 30, -1,-1,'Burst of Energy', 'Spell::EffectEnergize'),
(24571,-1, -1, -1, -1, -1, -1, 30, -1,-1,'Blood Fury', 'Spell::EffectEnergize'),
(24575,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Brittle Armor', 'Spell::EffectTriggerSpell'),
+(25329,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
+(25331, 6, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
(25535,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Fire Nova', 'Spell::EffectDummy'),
(25537,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Fire Nova', 'Spell::EffectDummy'),
(25546,11, -1, -1, 33, -1, -1, 3, -1,-1,'Fire Nova', 'Spell::EffectDummy'),
(25547,11, -1, -1, 33, -1, -1, 3, -1,-1,'Fire Nova', 'Spell::EffectDummy'),
(25599, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Thundercrash', 'Spell::EffectSchoolDMG'),
+(25771,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Forbearance', 'Spell::cast'),
+(25771,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Forbearance', 'Spell::CheckCast'),
(25858,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Reindeer', 'Spell::EffectDummy'),
(25859,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Reindeer', 'Spell::EffectDummy'),
(25860, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Reindeer Transformation', 'Spell::EffectDummy'),
@@ -156,6 +171,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(25912,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
(25913,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
(25914,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
+(25991, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Poison Bolt Volley (Pincess Huhuran)','Spell::SetTargetMap'),
(26074, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Holiday Cheer', 'Spell::EffectDummy'),
(26464,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Mercurial Shield', 'Spell::EffectTriggerSpell'),
(26467,-1, -1, -1, -1, -1, -1, 6, 42, 0,'Persistent Shield', 'Spell::EffectDummy'),
@@ -164,11 +180,19 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(27174,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
(27175,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
(27176,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
-(27222, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'),
+(27799, 6, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
+(27800, 6, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
+(27801, 6, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
+(27803,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
+(27804,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
+(27805,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
(28006, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Arcane Cloaking', 'Spell::EffectDummy'),
(28305,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Mana Leech', 'Spell::EffectTriggerSpell'),
+(28542, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Life Drain', 'Spell::SetTargetMap'),
+(28796, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Poison Bolt Volley', 'Spell::SetTargetMap'),
(28884, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor', 'Spell::EffectSchoolDMG'),
(29142, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Eyesore Blaster', 'Spell::EffectSchoolDMG'),
+(29213, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Curse of the Plaguebringer', 'Spell::SetTargetMap'),
(29294,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Naxxramas Entry Flag Effect DND', 'Spell::EffectDummy'),
(29200, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Purify Helboar Meat', 'Spell::EffectDummy'),
(29277,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Summon Purified Helboar Meat', 'Spell::EffectDummy'),
@@ -183,8 +207,12 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(30501,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Poultryized!', 'Spell::EffectDummy'),
(30504,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Poultryized!', 'Spell::EffectDummy'),
(30507, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Poultryizer', 'Spell::EffectDummy'),
+(30708,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Totem of Wrath', 'Spell::cast'),
+(30843, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Enfeeble', 'Spell::SetTargetMap'),
(31225, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Shimmering Vessel', 'Spell::EffectDummy'),
(31231, 8, -1, -1, -1, -1, -1, 3, -1,-1,'Cheat Death', 'Spell::EffectDummy'),
+(31298, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Sleep', 'Spell::SetTargetMap'),
+(31347, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Doom', 'Spell::SetTargetMap'),
(31436, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Malevolent Cleave', 'Spell::EffectSchoolDMG'),
(31687, 3, -1, -1, -1, -1, -1, 3, -1,-1,'Summon Water Elemental', 'Spell::EffectDummy'),
(31789,10, -1, -1, -1, -1, -1, 3, -1, 0,'Righteous Defense', 'Spell::EffectDummy'),
@@ -192,8 +220,10 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(31803,-1, -1, -1, -1, -1, -1, 6, 3,-1,'Holy Vengeance', 'Spell::EffectSchoolDMG'),
(31818,-1, -1, -1, -1, -1, -1, 30, -1, 0,'Life Tap', 'Spell::EffectDummy'),
(31930,-1, -1, -1, -1, -1, -1, 30, -1,-1,'Judgements of the Wise', 'Spell::EffectEnergize'),
+(32182,11, -1, -1, -1, -1, -1, -1, -1,-1,'Heroism', 'Spell::cast'),
(32409,-1, -1, -1, -1, -1, -1, 6, 3,-1,'Shadow Word: Death', 'Spell::EffectSchoolDMG'),
(32553,-1, -1, -1, -1, -1, -1, 30, -1, 0,'Life Tap', 'Spell::EffectDummy'),
+(32752,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Summoning Disorientation', 'Spell::CheckCast'),
(32813,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Squirrel Form', 'Spell::EffectDummy'),
(32816,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Giraffe Form', 'Spell::EffectDummy'),
(32817,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Serpent Form', 'Spell::EffectDummy'),
@@ -211,10 +241,11 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(33072,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
(33073,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
(33074,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
+(33711, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Murmur\'s Touch', 'Spell::SetTargetMap'),
(34846,-1, -1, -1, -1, -1, -1, 30, -1, 0,'Charge', 'Spell::EffectDummy'),
+(34991,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Summon Netherstorm Flag', 'Spell::CheckCasterAuras'),
(35139, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Throw Boom\'s Doom', 'Spell::EffectSchoolDMG'),
(35181, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Dive Bomb', 'Spell::EffectSchoolDMG'),
-(35701,-1, -1, -1, -1, -1, -1, -1, -1,-1,'', 'Spell::EffectInstaKill'),
(35743,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Socrethar Portal', 'Spell::EffectDummy'),
(35744,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Socrethar Portal', 'Spell::EffectDummy'),
(35745, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Socrethar\'s Stone', 'Spell::EffectDummy'),
@@ -250,16 +281,24 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(37881,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Blessing of Lower City', 'Spell::EffectDummy'),
(38441, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Cataclysmic Bolt', 'Spell::EffectSchoolDMG'),
(38615,-1, -1, -1, -1, -1, -1, 54, -1,-1,'Poison', 'Spell::EffectEnchantItemTmp'),
+(38794, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Murmur\'s Touch (h)', 'Spell::SetTargetMap'),
(38903, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor', 'Spell::EffectSchoolDMG'),
(39609,-1, -1, -1, -1, -1, -1, 30, -1, 0,'Mana Tide Totem', 'Spell::EffectDummy'),
(39610,11, -1, -1, -1, -1, -1, 3, -1,-1,'Mana Tide Totem effect', 'Spell::EffectDummy'),
(40802, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Mingo\'s Fortune Generator', 'Spell::EffectDummy'),
(40810, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Saber Lash', 'Spell::EffectSchoolDMG'),
(41276, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor', 'Spell::EffectSchoolDMG'),
+(41425,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Hypothermia', 'Spell::cast'),
+(41617,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Cenarion Mana Salve', 'Spell::SendCastResult'),
+(41618,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Bottled Nethergon Energy', 'Spell::SendCastResult'),
+(41619,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Cenarion Healing Salve', 'Spell::SendCastResult'),
+(41620,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Bottled Nethergon Vapor', 'Spell::SendCastResult'),
(41637,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Prayer of Mending', 'Spell::cast'),
+(42005, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Bloodboil', 'Spell::SetTargetMap'),
(42287, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Salvage Wreckage', 'Spell::EffectDummy'),
(42288,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Salvage Wreckage', 'Spell::EffectDummy'),
(42289,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Salvage Wreckage', 'Spell::EffectDummy'),
+(42292,-1, -1, -1, -1, -1, -1, -1, -1,-1,'PvP Trinket', 'Spell::CheckCasterAuras'),
(42337,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Raptor Capture Credit', 'Spell::EffectDummy'),
(42384, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Brutal Swipe', 'Spell::EffectSchoolDMG'),
(43036, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Dismembering Corpse', 'Spell::EffectDummy'),
@@ -277,6 +316,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(43900,-1, -1, -1, -1, -1, -1, -1, 78,-1,'Swift Brewfest Ram', 'Spell::EffectDummy'),
(44454, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Tasty Reef Fish', 'Spell::EffectDummy'),
(44455,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Tasty Reef Fish', 'Spell::EffectDummy'),
+(44462, 0, -1, -1, -1, -1, -1, 77, -1,-1,'The Way to His Heart...: Cast Quest Complete on Master','Spell::EffectScriptEffect'),
(44824,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Flying Reindeer', 'Spell::EffectDummy'),
(44825,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Flying Reindeer', 'Spell::EffectDummy'),
(44827,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Flying Reindeer', 'Spell::EffectDummy'),
@@ -289,6 +329,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(45088,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Emissary of Hate Credit', 'Spell::EffectDummy'),
(45150, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor Slash', 'Spell::EffectSchoolDMG'),
(45182,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Cheat Death', 'Spell::EffectDummy'),
+(45373,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Bloodberry Elixir', 'Spell::SendCastResult'),
(45470,-1, -1, -1, -1, -1, -1, 10, -1, 0,'Intercept', 'Spell::EffectDummy'),
(45672,-1, -1, -1, -1, -1, -1, -1, 61,-1,'Shrunk', 'Spell::EffectDummy'),
(45673,-1, -1, -1, -1, -1, -1, -1, 61,-1,'Bigger!', 'Spell::EffectDummy'),
@@ -304,20 +345,39 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(46167, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Planning for the Future: Create Snowfall Glade Pup Cover','Spell::EffectDummy'),
(46485, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Greatmother\'s Soulcatcher', 'Spell::EffectDummy'),
(46486,-1, -1, -1, -1, -1, -1, -1, -1, 0,'Greatmother\'s Soulcatcher', 'Spell::EffectDummy'),
+(46699,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Requires No Ammo', 'Spell::CheckItems'),
(46606, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Plague Canister Dummy', 'Spell::EffectDummy'),
(46773,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Planning for the Future: Create Snowfall Glade Pup Cover','Spell::EffectDummy'),
(46797, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Quest - Borean Tundra - Set Explosives Cart','Spell::EffectDummy'),
(46798,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Quest - Borean Tundra - Summon Explosives Cart','Spell::EffectDummy'),
+(47390,-1, -1, -1, -1, -1, -1, -1, -1,-1,'The Focus on the Beach: Ley Line Focus Bunny Beam','Spell::EffectDummy'),
+(47391, 0, -1, -1, -1, -1, -1, -1, 4,-1,'Ley Line Information', 'Spell::EffectScriptEffect'),
+(47393, 0, -1, -1, -1, -1, -1, 77, -1,-1,'The Focus on the Beach: Ley Line Focus Bunny Beam','Spell::EffectScriptEffect'),
+(47472,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Atop the Woodlands: Ley Line Focus Bunny Beam','Spell::EffectDummy'),
+(47473, 0, -1, -1, -1, -1, -1, -1, 4,-1,'Ley Line Information', 'Spell::EffectScriptEffect'),
(47540, 6,0x0080000000000000,0x00000000, -1, -1, -1, 3, -1,-1,'Penance', 'Spell::EffectDummy'),
+(47615, 0, -1, -1, -1, -1, -1, 77, -1,-1,'The End of the Line: Ley Line Focus Bunny Beam','Spell::EffectScriptEffect'),
+(47635,-1, -1, -1, -1, -1, -1, -1, -1,-1,'The End of the Line: Ley Line Focus Bunny Beam','Spell::EffectDummy'),
+(47636, 0, -1, -1, -1, -1, -1, -1, 4,-1,'Ley Line Information', 'Spell::EffectScriptEffect'),
+(47638, 0, -1, -1, -1, -1, -1, 77, -1,-1,'Atop the Woodlands: Ley Line Focus Bunny Beam','Spell::EffectScriptEffect'),
(47632,-1, -1, -1, -1, -1, -1, 2, -1, 0,'Death Coil', 'Spell::EffectDummy'),
(47633,-1, -1, -1, -1, -1, -1, 10, -1, 0,'Death Coil', 'Spell::EffectDummy'),
(47757,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Penance', 'Spell::EffectDummy'),
(47758,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Penance', 'Spell::EffectDummy'),
(47897, 5,0x0001000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shadowflame', 'Spell::EffectSchoolDMG'),
(47960,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Shadowflame', 'Spell::EffectSchoolDMG'),
+(48023,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Headless Horseman\'s Mount', 'Aura::HandleAuraDummy'),
+(48024,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Headless Horseman\'s Mount', 'Aura::HandleAuraDummy'),
+(48025,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Headless Horseman\'s Mount', 'Aura::HandleAuraDummy'),
+(48075,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
+(48076,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
+(48077, 6, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
+(48078, 6, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Nova', 'Spell::cast'),
(48301,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Mind Trauma', 'Spell::EffectSchoolDMG'),
(48542,-1, -1, -1, -1, -1, -1, 30, -1,-1,'Revitalize', 'Spell::EffectEnergize'),
+(48743,-1, -1, -1, -1, -1, -1, 1, -1,-1,'Death Pact', 'Spell::CheckCast'),
(48743,-1, -1, -1, -1, -1, -1, 10, -1,-1,'Death Pact', 'Spell::EffectHeal'),
+(48743,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Death Pact', 'Spell::SetTargetMap'),
(48820,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
(48821,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
(48822,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
@@ -334,6 +394,9 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(50246,-1, -1, -1, -1, -1, -1, -1, -1,-1,'01001000', 'Spell::EffectDummy'),
(50286, 7,0x0000000000000000,0x00000100, -1, -1, -1, 3, -1,-1,'Starfall', 'Spell::EffectDummy'),
(50288,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Starfall', 'Spell::EffectDummy'),
+(50546, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Ley Line Focus Control Ring Effect', 'Spell::EffectDummy'),
+(50547, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Ley Line Focus Control Amulet Effect','Spell::EffectDummy'),
+(50548, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Ley Line Focus Control Talisman Effect','Spell::EffectDummy'),
(50737,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Create Drakkari Medallion Cover', 'Spell::EffectDummy'),
(50782,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Slam', 'Spell::EffectDummy'),
(50926, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Gluttonous Lurkers: Create Zul\'Drak Rat Cover','Spell::EffectDummy'),
@@ -353,18 +416,39 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(51366,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Shoot RJR', 'Spell::EffectDummy'),
(51370,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Dig For Treasure', 'Spell::EffectDummy'),
(51582, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Rocket Boots Engaged', 'Spell::EffectDummy'),
+(51582,-1, -1, -1, -1, -1, -1, 3, -1,-1,'Rocket Boots Engaged', 'Spell::CheckCast'),
(51592, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Pickup Primordial Hatchling', 'Spell::EffectDummy'),
(51593,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Pickup Primordial Hatchling', 'Spell::EffectDummy'),
+(51617,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Headless Horseman\'s Mount', 'Aura::HandleAuraDummy'),
+(51621,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Headless Horseman\'s Mount', 'Aura::HandleAuraDummy'),
+(51723, 8, -1, -1, -1, -1, -1, -1, -1,-1,'Fan of Knives', 'Spell::cast'),
+(51836,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Bananas Fall to Ground', 'Spell::EffectDummy'),
+(51837,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Orange Falls to Ground', 'Spell::EffectDummy'),
+(51839,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Papaya Falls to Ground', 'Spell::EffectDummy'),
+(51840, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Despawn Fruit Tosser', 'Spell::EffectDummy'),
+(51866, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Kick Nass', 'Spell::EffectDummy'),
+(51870,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Collect Hair Sample', 'Spell::EffectDummy'),
+(51871,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Nass Kill Credit', 'Spell::EffectDummy'),
+(51872, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Hair Sample Collected', 'Spell::EffectDummy'),
(51961, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Captured Chicken Cover', 'Spell::EffectDummy'),
+(51964, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Tormentor\'s Incense', 'Spell::EffectDummy'),
+(51967, 0, -1, -1, -1, -1, -1, -1,168,-1,'Mojo of Rhunok', 'Spell::EffectScriptEffect'),
(52025,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Cleansing Totem Effect', 'Spell::EffectDummy'),
(52032,-1, -1, -1, -1, -1, -1, 30, -1, 0,'Mana Spring Totem', 'Spell::EffectDummy'),
(52042,-1, -1, -1, -1, -1, -1, 10, -1, 0,'Healing Stream Totem', 'Spell::EffectDummy'),
+(52070,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Summon Adventurous Dwarf', 'Spell::EffectDummy'),
(52308, 0, -1, -1, -1, -1, -1, 3, -1, 0,'Take Sputum Sample', 'Spell::EffectDummy'),
(52308, 0, -1, -1, -1, -1, -1, 3, -1, 1,'Take Sputum Sample', 'Spell::EffectDummy'),
(52437,-1, -1, -1, -1, -1, -1, 6, -1, 0,'Sudden Death', 'Spell::EffectDummy'),
(52752,-1, -1, -1, -1, -1, -1, 10, -1, 0,'Ancestral Awakening', 'Spell::EffectDummy'),
(52759, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Ancestral Awakening', 'Spell::EffectDummy'),
+(52759,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Ancestral Awakening', 'Spell::SetTargetMap'),
(52845,-1, -1, -1, -1, -1, -1, 3, -1,-1,'Brewfest Mount Transformation (Faction Swap)','Spell::EffectDummy'),
+(52874,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Fan of Knives', 'Spell::cast'),
+(52941, 0, -1, -1, -1, -1, -1, 77, -1,-1,'Song of Cleansing', 'Spell::EffectScriptEffect'),
+(52954, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Summon Spirit', 'Spell::EffectScriptEffect'),
+(52958, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Summon Spirit', 'Spell::EffectScriptEffect'),
+(52959, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Summon Spirit', 'Spell::EffectScriptEffect'),
(52986,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Penance', 'Spell::EffectDummy'),
(52987,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Penance', 'Spell::EffectDummy'),
(52988,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Penance', 'Spell::EffectDummy'),
@@ -386,14 +470,23 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(53343, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Rune of Razorice', 'Spell::EffectDummy'),
(53478, 9, -1, -1, -1, -1, -1, 3, -1,-1,'Last Stand', 'Spell::EffectDummy'),
(53479,-1, -1, -1, -1, -1, -1, -1, 34, 0,'Last Stand', 'Spell::EffectDummy'),
+(53563,-1, -1, -1, -1, -1, -1, -1, 23,-1,'Beacon of Light', 'Aura::HandlePeriodicTriggerSpell'),
+(53563,-1, -1, -1, -1, -1, -1, -1, 23,-1,'Beacon of Light', 'Unit::HandleDummyAuraProc'),
+(53805, 0, -1, -1, -1, -1, -1, -1,239,-1,'Pygmy Oil', 'Spell::EffectDummy'),
+(53806,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Pygmy Oil', 'Spell::EffectDummy'),
+(53808,-1, -1, -1, -1, -1, -1, 3, -1,-1,'Pygmy Oil', 'Spell::EffectDummy'),
(54049, 5,0x0040000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shadow Bite', 'Spell::EffectSchoolDMG'),
(54050, 5,0x0040000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shadow Bite', 'Spell::EffectSchoolDMG'),
(54051, 5,0x0040000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shadow Bite', 'Spell::EffectSchoolDMG'),
(54052, 5,0x0040000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shadow Bite', 'Spell::EffectSchoolDMG'),
(54053, 5,0x0040000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shadow Bite', 'Spell::EffectSchoolDMG'),
+(54098, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Poison Bolt Volley (h)', 'Spell::SetTargetMap'),
+(54182, 0, -1, -1, -1, -1, -1, 77, -1,-1,'An End to the Suffering: Quest Completion Script','Spell::EffectScriptEffect'),
(54216,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Master''s Call', 'Spell::EffectDummy'),
(54586,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Runeforging Credit', 'Spell::EffectDummy'),
+(54646,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Focus Magic', 'Spell::CheckCast'),
(54824,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Swiftmend', 'Spell::EffectHeal'),
+(54835, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Curse of the Plaguebringer (h)', 'Spell::SetTargetMap'),
(54861,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Nitro Boosts', 'Spell::EffectDummy'),
(55004, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Nitro Boosts', 'Spell::EffectDummy'),
(55078,-1, -1, -1, -1, -1, -1, -1, 3,-1,'Blood Plague', 'Spell::EffectScriptEffect'),
@@ -407,28 +500,47 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(55441,11, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Mana Tide', 'Spell::EffectDummy'),
(55456,11, -1, -1, -1, -1, -1, -1, -1,-1,'Glyph of Healing Stream Totem', 'Spell::EffectDummy'),
(55528,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Hurl Boulder', 'Spell::EffectDummy'),
+(55665, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Life Drain (h)', 'Spell::SetTargetMap'),
+(55675,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Circle of Healing', 'Spell::SetTargetMap'),
(55818, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Hurl Boulder', 'Spell::EffectDummy'),
+(56153,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Guardian Aura - Ahn\'Kahet', 'Spell::SetTargetMap'),
(56235,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Glyph of Conflagrate', 'Spell::EffectSchoolDMG'),
(56446,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Disengage', 'Spell::EffectDummy'),
+(57085,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Refreshment', 'Spell::EffectScriptEffect'),
+(57292,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Refreshment', 'Spell::EffectScriptEffect'),
+(57337, 0, -1, -1, -1, -1, -1, 77, -1,-1,'Great Feast', 'Spell::EffectScriptEffect'),
+(57397, 0, -1, -1, -1, -1, -1, 77, -1,-1,'Fish Feast', 'Spell::EffectScriptEffect'),
+(57467, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor', 'Spell::EffectSchoolDMG'),
(57627,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Charge', 'Spell::EffectSchoolDMG'),
(57635, 9, -1, -1, -1, -1, -1, 3, -1,-1,'Disengage', 'Spell::EffectDummy'),
(57636,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Disengage', 'Spell::EffectDummy'),
-(57946, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'),
+(57669,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Replenishment', 'Spell::SetTargetMap'),
+(57723,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Exhaustion', 'Spell::cast'),
+(57724,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Sated', 'Spell::cast'),
+(57908, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Stain Cloth', 'Spell::EffectDummy'),
+(57915,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Create Cloth', 'Spell::EffectDummy'),
+(58067,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Refreshment', 'Spell::EffectScriptEffect'),
(58367,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Execution', 'Spell::EffectDummy'),
(58418, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Portal to Orgrimmar', 'Spell::EffectDummy'),
(58420, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Portal to Stormwind', 'Spell::EffectDummy'),
+(58466, 0, -1, -1, -1, -1, -1, 77, -1,-1,'Gigantic Feast', 'Spell::EffectScriptEffect'),
+(58475, 0, -1, -1, -1, -1, -1, 77, -1,-1,'Small Feast', 'Spell::EffectScriptEffect'),
(58601, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Remove Flight Auras', 'Spell::EffectDummy'),
(58657,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Plague Strike', 'Spell::EffectWeaponDmg'),
+(58875,11, -1, -1, -1, -1, -1, -1, -1,-1,'Spirit Walk', 'Spell::cast'),
+(58876,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Spirit Walk', 'Spell::cast'),
(59336,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Death Strike', 'Spell::EffectWeaponDmg'),
(59332,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Blood Strike', 'Spell::EffectWeaponDmg'),
(59640, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Underbelly Elixir', 'Spell::EffectDummy'),
(59645,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Underbelly Elixir', 'Spell::EffectDummy'),
(59831,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Underbelly Elixir', 'Spell::EffectDummy'),
(59843,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Underbelly Elixir', 'Spell::EffectDummy'),
+(60089,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Faerie Fire', 'Spell::cast'),
(60932, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Disengage', 'Spell::EffectDummy'),
(60934,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Disengage', 'Spell::EffectDummy'),
(61290, 5,0x0001000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shadowflame', 'Spell::EffectSchoolDMG'),
(61291,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Shadowflame', 'Spell::EffectSchoolDMG'),
+(61336,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Survival Instincts', 'Spell::CheckCast'),
(61491, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Intercept', 'Spell::EffectSchoolDMG'),
(61507, 9, -1, -1, -1, -1, -1, 3, -1,-1,'Disengage', 'Spell::EffectDummy'),
(61508,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Disengage', 'Spell::EffectDummy'),
@@ -436,6 +548,10 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(61650,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Fire Nova', 'Spell::EffectDummy'),
(61654,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Fire Nova', 'Spell::EffectDummy'),
(61657,11, -1, -1, 33, -1, -1, 3, -1,-1,'Fire Nova', 'Spell::EffectDummy'),
+(61832, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Rifle the Bodies: Create Magehunter Personal Effects Cover','Spell::EffectDummy'),
+(61987,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Avenging Wrath Marker', 'Spell::cast'),
+(61987,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Avenging Wrath Marker', 'Spell::CheckCast'),
+(62124,10, -1, -1, -1, -1, -1, -1, -1,-1,'Hand of Reckoning', 'Spell::cast'),
(62305,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Master''s Call', 'Spell::EffectScriptEffect'),
(62775, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Tympanic Tantrum', 'Spell::EffectSchoolDMG'),
(63334,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Disease', 'Spell::EffectScriptEffect'),
@@ -444,6 +560,13 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(64688, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor Slash', 'Spell::EffectSchoolDMG'),
(66765,-1, -1, -1, -1, -1, -1, 31, -1,-1,'Meteor Fists', 'Spell::EffectWeaponDmg'),
(66809,-1, -1, -1, -1, -1, -1, 31, -1,-1,'Meteor Fists', 'Spell::EffectWeaponDmg'),
+(64844,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Divine Hymn', 'Spell::SetTargetMap'),
+(64904,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Hymn of Hope', 'Spell::SetTargetMap'),
+(65116,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Stoneskin', 'Spell::cast'),
+(65422,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Food', 'Spell::EffectScriptEffect'),
+(66013, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Penetrating Cold', 'Spell::SetTargetMap'),
+(66477, 0, -1, -1, -1, -1, -1, 77, -1,-1,'Bountiful Feast', 'Spell::EffectScriptEffect'),
+(66622,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Refreshment', 'Spell::EffectScriptEffect'),
(67016,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Flask of the North', 'Spell::EffectDummy'),
(67017,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Flask of the North', 'Spell::EffectDummy'),
(67018,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Flask of the North', 'Spell::EffectDummy'),
@@ -451,7 +574,11 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(67331,-1, -1, -1, -1, -1, -1, 31, -1,-1,'Meteor Fists', 'Spell::EffectWeaponDmg'),
(67333,-1, -1, -1, -1, -1, -1, 31, -1,-1,'Meteor Fists', 'Spell::EffectWeaponDmg'),
(67485, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Hand of Rekoning', 'Spell::EffectSchoolDMG'),
+(67485,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Hand of Rekoning', 'Spell::cast'),
+(67700, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Penetrating Cold', 'Spell::SetTargetMap'),
(68082,-1, -1, -1, -1, -1, -1, 30, -1,-1,'Glyph of Seal of Command', 'Spell::EffectEnergize'),
+(68509, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Penetrating Cold', 'Spell::SetTargetMap'),
+(68510, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Penetrating Cold', 'Spell::SetTargetMap'),
(69055,-1, -1, -1, -1, -1, -1, 31, -1,-1,'Bone Slice', 'Spell::EffectWeaponDmg'),
(70492, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Ooze Eruption', 'Spell::EffectSchoolDMG'),
(70907,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Summon Water Elemental', 'Spell::EffectDummy'),
@@ -459,17 +586,34 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(70937,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Eternal Water', 'Spell::EffectDummy'),
(71021,-1, -1, -1, -1, -1, -1, 31, -1,-1,'Saber Lash', 'Spell::EffectWeaponDmg'),
(71904, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Chaos Bane', 'Spell::EffectSchoolDMG'),
+(71904, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Chaos Bane', 'Spell::cast'),
+(72281, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Invincible', 'Aura::HandleAuraDummy'),
+(72282, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Invincible', 'Aura::HandleAuraDummy'),
+(72283, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Invincible', 'Aura::HandleAuraDummy'),
+(72284, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Invincible', 'Aura::HandleAuraDummy'),
+(72286, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Invincible', 'Aura::HandleAuraDummy'),
(72505, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Ooze Eruption', 'Spell::EffectSchoolDMG'),
(72624, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Ooze Eruption', 'Spell::EffectSchoolDMG'),
(72625, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Ooze Eruption', 'Spell::EffectSchoolDMG'),
(73422, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Chaos Bane', 'Spell::cast'),
-
+(73422,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Chaos Bane', 'Spell::cast'),
+(74854, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Blazing Hippogryph', 'Aura::HandleAuraDummy'),
+(74855, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Blazing Hippogryph', 'Aura::HandleAuraDummy'),
+(74856, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Blazing Hippogryph', 'Aura::HandleAuraDummy'),
+(75614, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Celestial Steed', 'Aura::HandleAuraDummy'),
+(75617, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Celestial Steed', 'Aura::HandleAuraDummy'),
+(75618, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Celestial Steed', 'Aura::HandleAuraDummy'),
+(75619, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Celestial Steed', 'Aura::HandleAuraDummy'),
+(75620, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Celestial Steed', 'Aura::HandleAuraDummy'),
+(76153, 0, -1, -1, -1, -1, -1, -1, -1,-1,'Celestial Steed', 'Aura::HandleAuraDummy'),
/*id fm familyMaskA fmMaskB icon vis cat eff aur ef name code */
/* sorted by spell names */
/*id fm familyMaskA fmMaskB icon vis cat eff aur ef name code */
( 0, 3,0x0000000020000000,0x00000000, -1, -1, -1, 2, -1,-1,'Arcane Blast', 'Spell::EffectSchoolDMG'),
+( 0, 3,0x0000000000200080,0x00000000, -1, -1, -1, -1, -1,-1,'Arcane Missles / Blizzard', 'Spell::prepareDataForTriggerSystem'),
( 0, 9,0x0000000000000800,0x00000000, -1, -1, -1, 2, -1,-1,'Arcane Shot', 'Spell::EffectSchoolDMG'),
+( 0,10,0x0000200000000000,0x00000000, -1, -1, -1, -1, -1,-1,'Avenging Wrath', 'Spell::cast'),
( 0,15,0x0000000000400000,0x00000000, -1, -1, -1, 31, -1,-1,'Blood Strike', 'Spell::EffectWeaponDmg'),
( 0,15, -1, -1,1736, -1, -1, 31, -1,-1,'Blood-Caked Strike', 'Spell::EffectWeaponDmg'),
( 0, 5,0x0000000000004000,0x00000000, -1, -1, -1, -1, -1,-1,'Drain Soul', 'Unit::SpellDamageBonus'),
@@ -477,32 +621,48 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
( 0, 4,0x0000040000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Bloodthirst', 'Spell::EffectSchoolDMG'),
( 0,11,0x0000000000000100,0x00000000, -1, -1, -1, 10, -1,-1,'Chain Healing', 'Spell::EffectHeal'),
( 0, 4,0x0000000000000001,0x00000000, -1, 867, -1, 3, -1,-1,'Charge', 'Spell::EffectDummy'),
+( 0, 6, -1, -1, -1,8253, -1, -1, -1,-1,'Circle of Healing', 'Spell::SetTargetMap'),
( 0,11,0x0000000004000000,0x00000000,1673, -1, -1, 3, -1,-1,'Cleansing Totem', 'Spell::EffectDummy'),
+( 0, 3,0x0000000200000000,0x00000008, -1, -1, -1, -1, -1,-1,'Clearcasting', 'Spell::prepareDataForTriggerSystem'),
( 0, 4,0x0000000004000000,0x00000000, -1, -1, -1, 3, -1,-1,'Concussion Blow', 'Spell::EffectDummy'),
( 0, 3, -1, -1, -1, -1, -1, 3, -1, 1,'Conjure Mana Gem', 'Spell::EffectDummy'), /*part 1*/
( 0, 3, -1, -1, -1, -1, -1, 24, -1, 0,'Conjure Mana Gem', 'Spell::EffectDummy'), /*part 2*/
+( 0, 3, -1, -1, -1, -1, -1, 24, -1, 0,'Conjure Mana Gem', 'Spell::CheckItems'),
( 0, 9,0x0008000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Counterattack', 'Spell::EffectSchoolDMG'),
+( 0, 5, -1, -1, -1, -1,1179, -1, -1,-1,'Curse of Doom', 'Spell::CheckTargetCreatureType'),
( 0, 8,0x0000000000010000,0x00000000, -1, -1, -1, -1, 3,-1,'Deadly poison', 'Spell::EffectSchoolDMG'),
( 0,15,0x0000000000002000,0x00000000, -1, -1, -1, 3, -1,-1,'Death Coil', 'Spell::EffectDummy'),
( 0,15,0x0000000000000010,0x00000000, -1, -1, -1, 31, -1, 1,'Death Strike', 'Spell::EffectWeaponDmg'),
( 0,15,0x0000000000000010,0x00000000, -1, -1, -1, 3, -1, 2,'Death Strike', 'Spell::EffectDummy'),
( 0, 5, -1, -1, -1, -1, 12, 38, -1,-1,'Devour Magic', 'Spell::EffectDispel'),
( 0, 9,0x0000400000000000,0x00000000, -1, -1, -1, 3, -1,-1,'Disengage', 'Spell::EffectDummy'),
+( 0,10,0x0000000000400080,0x00000000, -1, -1, -1, -1, -1,-1,'Divine Shield, Divine Protection or Hand of Protection','Spell::cast'),
( 0, 8,0x0000000800000000,0x00000000, -1, -1, -1, 2, -1,-1,'Envenom', 'Spell::EffectSchoolDMG'),
( 0, 8,0x0000000000020000,0x00000000, -1, -1, -1, 2, -1,-1,'Eviscerate', 'Spell::EffectSchoolDMG'),
( 0, 4,0x0000000020000000,0x00000000, -1, -1, -1, 3, -1,-1,'Execute', 'Spell::EffectDummy'),
+( 0,-1, -1, -1,1648, -1, -1, 3, -1,-1,'Execute', 'Spell::CheckCast'),
( 0, 9,0x0000000000000004,0x00000000, -1, -1, -1, 2, -1,-1,'Explosive Trap Effect', 'Spell::EffectSchoolDMG'),
( 0, 7,0x0000000000800000,0x00000000, -1,6587, -1, 2, -1,-1,'Ferocious Bite', 'Spell::EffectSchoolDMG'),
+( 0,11, -1, -1, 33, -1, -1, 3, -1,-1,'Fire Nova', 'Spell::CheckCast'),
+( 0, 5, -1, -1, 16, -1, -1, -1, -1,-1,'Fire Shield', 'Spell::CheckCast'),
( 0,11,0x0000000000200000,0x00000000, -1, -1, -1, -1, -1,-1,'Flametongue', 'Spell::EffectDummy'),
( 0, 9, -1, -1,1578, -1, -1, 2, -1,-1,'Gore', 'Spell::EffectSchoolDMG'),
( 0, 8,0x0000000000000008,0x00000000, -1, -1, -1, 2, -1,-1,'Gouge', 'Spell::EffectSchoolDMG'),
( 0,10,0x0000008000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Hammer of Wrath', 'Spell::EffectSchoolDMG'),
+( 0,-1, -1, -1, -1,7250, -1, 2, -1,-1,'Hammer of Wrath', 'Spell::CheckCast'),
( 0,10,0x0004000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Hammer of the Righteous', 'Spell::EffectSchoolDMG'),
+( 0, 5,0x0004000000000000,0x00000000,3172, -1, -1, -1, 4,-1,'Haunt', 'Spell::DoAllEffectOnTarget'),
( 0,11,0x0000000000002000,0x00000000, -1, -1, -1, 3, -1,-1,'Healing Stream Totem', 'Spell::EffectDummy'),
+( 0, 4,0x0000800000000060,0x00000000, -1, -1, -1, -1, -1,-1,'Hellfire Effect / Rain of Fire / Seed of Corruption','Spell::prepareDataForTriggerSystem'),
+( 0, 8,0x0000000002800000,0x00000000, -1, -1, -1, -1, -1,-1,'Hemorrhage', 'Spell::EffectWeaponDmg'),
( 0, 4,0x0000000100000000,0x00000000, -1, -1, -1, 2, -1,-1,'Heroic Throw', 'Spell::EffectSchoolDMG'),
( 0,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
+( 0,-1, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::CheckCast'),
( 0,15,0x0000100000000000,0x00000000, -1, -1, -1, 3, -1,-1,'Hungering Cold', 'Spell::EffectDummy'),
+( 0, 9,0x0100200000000214,0x00000200, -1, -1, -1, -1, -1,-1,'Hunter Rapid Killing/Explosive Trap Effect/Immolation Trap Effect/Frost Trap Aura/Snake Trap Effect/Explosive Shot', 'Spell::prepareDataForTriggerSystem'),
+( 0, 3,0x0000008000000000,0x00000000, -1, -1, -1, -1, -1,-1,'Ice Block', 'Spell::cast'),
( 0, 5,0x0000000000000004,0x00000000, -1, -1, -1, -1, 3,-1,'Immolate', 'Spell::EffectSchoolDMG'),
+( 0, 9,0x000020000000001C,0x00000000, -1, -1, -1, -1, -1,-1,'Immolation Trap, Frost Trap, Explosive Trap, and Snake Trap','Spell::prepareDataForTriggerSystem'),
( 0,15, -1, -1,2751, -1, -1, -1,107, 1,'Improved Death Strike', 'Spell::EffectDummy'),
( 0,15, -1, -1,2751, -1, -1, 0, 0, 2,'Improved Death Strike', 'Spell::EffectDummy'),
( 0, 5, -1, -1, 208, -1, -1, -1, 4,-1,'Improved Life Tap', 'Spell::EffectDummy'),
@@ -511,8 +671,11 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
( 0, 8,0x0000000000002000,0x00000000, -1, -1, -1, 2, -1,-1,'Instant Poison', 'Spell::EffectSchoolDMG'),
( 0,10, -1, -1, 561, -1, -1, 3, -1,-1,'Judgement of command', 'Spell::EffectDummy'),
( 0,10,0x0000000800000000,0x00000000,2292, -1, -1, 2, -1,-1,'Judgement of Vengeance', 'Spell::EffectSchoolDMG'),
+( 0,10,0x0001000900B80400,0x00000000, -1, -1, -1, -1, -1,-1,'Judgements (all) / Holy Shock', 'Spell::prepareDataForTriggerSystem'),
( 0, 7,0x0000010000000000,0x00000000,2246, -1, -1, 2, -1,-1,'Lacerate', 'Spell::EffectSchoolDMG'),
( 0,11,0x0000000000000000,0x00000004, -1, -1, -1, 3, -1,-1,'Lava Lash', 'Spell::EffectDummy'),
+( 0,10,0x0000000000008000,0x00000000, -1, -1, -1, -1, -1,-1,'Lay on Hands', 'Spell::cast'),
+( 0,10,0x0000000000008000,0x00000000, -1, -1, -1, -1, -1,-1,'Lay on Hands', 'Spell::CheckCast'),
( 0, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'),
( 0, 5, -1, -1,1982, -1, -1, -1,107,-1,'Mana Feed', 'Spell::EffectDummy'),
( 0,11,0x0000000000004000,0x00000000, -1, -1, -1, 3, -1,-1,'Mana Spring Totem', 'Spell::EffectDummy'),
@@ -520,16 +683,23 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
( 0, 8, -1, -1,1960, -1, -1, 0,246,-1,'Master Poisoner', 'Spell::EffectSchoolDMG'),
( 0, 6,0x0000000000002000,0x00000000, -1, -1, -1, 2, -1,-1,'Mind Blast', 'Spell::EffectSchoolDMG'),
( 0, 9,0x0000000000000002,0x00000000, -1, 342, -1, 2, -1,-1,'Mongoose Bite', 'Spell::EffectSchoolDMG'),
+( 0, 8,0x0020000000000000,0x00000000, -1, -1, -1, -1, -1,-1,'Mutilate', 'Spell::CheckCast'),
( 0, 6,0x0080000000000000,0x00000000, -1, -1, -1, 3, -1,-1,'Penance', 'Spell::EffectDummy'),
+( 0, 6,0x0001800000800000,0x00000040, -1, -1, -1, -1, -1,-1,'Penance,Mind Sear,Mind Flay', 'Spell::prepareDataForTriggerSystem'),
( 0,15,0x0000000000000001,0x00000000, -1, -1, -1, 31, -1,-1,'Plague Strike', 'Spell::EffectWeaponDmg'),
+( 0, 8,0x000000101001E000,0x00000000, -1, -1, -1, -1, -1,-1,'poisons', 'Spell::prepareDataForTriggerSystem'),
+( 0, 7,0x0000000000020000,0x00000000, -1, -1, -1, -1, -1,-1,'Pounce', 'Spell::CheckCast'),
+( 0, 6,0x0000000000000001,0x00000000, -1, -1, -1, -1, -1,-1,'Power Word: Shield', 'Spell::cast'),
+( 0, 6,0x0000002000000000,0x00000000, -1, -1, -1, -1, -1,-1,'Prayer of Mending', 'Spell::cast'),
( 0, 6,0x0000002000000000,0x00000000, -1, -1, -1, 6, -1,-1,'Prayer of Mending', 'Spell::cast'),
( 0, 8,0x0000024000000860,0x00000000, -1, -1, -1, -1, -1,-1,'Preparation (affected spells)', 'Spell::EffectDummy'),
-( 0, 7,0x0000000000000040,0x00000000, -1, -1, -1, -1, 8,-1,'Regrowth', 'Spell::EffectHeal'),
-( 0, 7,0x0000000000000010,0x00000000, -1, -1, -1, -1, 8,-1,'Rejuvenation', 'Spell::EffectHeal'),
( 0, 7,0x0000000000001000,0x00000000, -1, -1, -1, 2, -1,-1,'Rake', 'Spell::EffectSchoolDMG'), /* used in */
( 0, 7,0x0000000000001000,0x00000000, -1, -1, -1, 80, -1, 2,'Rake', 'Spell::EffectSchoolDMG'), /* exactly selected */
( 0, 7,0x0000000000001000,0x00000000, -1, -1, -1, -1, 3,-1,'Rake', 'Aura::HandlePeriodicDamage'), /* used in */
( 0, 7,0x0000000000001000,0x00000000, -1, -1, -1, 80, -1, 2,'Rake', 'Aura::HandlePeriodicDamage'), /* exactly selected */
+( 0, 7,0x0000000000000040,0x00000000, -1, -1, -1, -1, 8,-1,'Regrowth', 'Spell::EffectHeal'),
+( 0, 7,0x0000000000000010,0x00000000, -1, -1, -1, -1, 8,-1,'Rejuvenation', 'Spell::EffectHeal'),
+( 0, 3,0x0000010000000000,0x00000000, -1, -1, -1, -1, -1,-1,'Replenish Mana', 'Spell::prepareDataForTriggerSystem'),
( 0,11,0x0000000000000000,0x00000010, -1, -1, -1, -1, 8,-1,'Riptide', 'Spell::EffectHeal'),
( 0,11, -1, -1, 338, -1, -1, -1, 4, 1,'Restorative Totems', 'Spell::EffectSchoolDMG'), /*part 1*/
( 0, 4,0x0000000000000400,0x00000000, -1, -1, -1, 2, -1,-1,'Revenge', 'Spell::EffectSchoolDMG'),
@@ -546,16 +716,14 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
( 0, 7,0x0000000000008000,0x00000000, -1, -1, -1, -1, -1,-1,'Shred', 'Unit::MeleeDamageBonus'),
( 0, 4,0x0000000000200000,0x00000000, -1, -1, -1, 3, -1,-1,'Slam', 'Spell::EffectDummy'),
( 0, 7,0x0000000000000000,0x00000100, -1, -1, -1, 3, -1,-1,'Starfall', 'Spell::EffectDummy'),
+( 0, 7,0x0000000000000000,0x00000100, -1, -1, -1, -1, -1,-1,'Starfall', 'Spell::SetTargetMap'),
( 0, 9,0x0000000100000000,0x00000000, -1, -1, -1, 2, -1,-1,'Steady Shot', 'Spell::EffectSchoolDMG'),
( 0, 9,0x0000000100000000,0x00000000, -1, -1, -1, 3, -1,-1,'Steady Shot', 'Spell::EffectDummy'),
-( 0, 8,0x0000000000400000,0x00000000, -1, -1, -1, -1, -1,-1,'Stealth', 'Spell::EffectTriggerSpell'),
( 0,-1, -1, -1,1989, -1, -1, -1, 42, 0,'Sudden Death', 'Spell::EffectDummy'),
( 0, 7,0x0010000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Swipe', 'Spell::EffectSchoolDMG'),
( 0, 4,0x0000000000000080,0x00000000, -1, -1, -1, 2, -1,-1,'Thunder Clap', 'Spell::EffectSchoolDMG'),
+( 0,11,0x0000000004000000,0x00000000, -1, -1, -1, -1, -1,-1,'Totem of Wrath', 'Spell::cast'),
( 0, 4,0x0000010000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Victory Rush', 'Spell::EffectSchoolDMG'),
-( 0, 8,0x0000000010000000,0x00000000, -1, -1, -1, 2, -1,-1,'Wound Poison', 'Spell::EffectSchoolDMG'),
-
-/* some random spells from not proccessed files sorted by spell ids */
+( 0, 7, -1, -1,2864, -1, -1, 0, -1, 2,'Wild Growth', 'Spell::SetTargetMap'),
+( 0, 8,0x0000000010000000,0x00000000, -1, -1, -1, 2, -1,-1,'Wound Poison', 'Spell::EffectSchoolDMG');
/*id fm familyMaskA fmMaskB icon vis cat eff aur ef name code */
-(53563,-1, -1, -1, -1, -1, -1, -1, 23,-1,'Beacon of Light', 'Aura::HandlePeriodicTriggerSpell'),
-(53563,-1, -1, -1, -1, -1, -1, -1, 23,-1,'Beacon of Light', 'Unit::HandleDummyAuraProc');
diff --git a/sql/realmd.sql b/sql/realmd.sql
index e9d5bf478..c25bfa4de 100644
--- a/sql/realmd.sql
+++ b/sql/realmd.sql
@@ -21,7 +21,7 @@
DROP TABLE IF EXISTS `realmd_db_version`;
CREATE TABLE `realmd_db_version` (
- `required_9748_01_realmd_realmlist` bit(1) default NULL
+ `required_10008_01_realmd_realmd_db_version` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
--
diff --git a/sql/updates/0.16/9136_01_characters_account_data.sql b/sql/updates/0.16/09136_01_characters_account_data.sql
similarity index 100%
rename from sql/updates/0.16/9136_01_characters_account_data.sql
rename to sql/updates/0.16/09136_01_characters_account_data.sql
diff --git a/sql/updates/0.16/9136_02_mangos_quest_poi.sql b/sql/updates/0.16/09136_02_mangos_quest_poi.sql
similarity index 100%
rename from sql/updates/0.16/9136_02_mangos_quest_poi.sql
rename to sql/updates/0.16/09136_02_mangos_quest_poi.sql
diff --git a/sql/updates/0.16/9136_03_characters_character_ticket.sql b/sql/updates/0.16/09136_03_characters_character_ticket.sql
similarity index 100%
rename from sql/updates/0.16/9136_03_characters_character_ticket.sql
rename to sql/updates/0.16/09136_03_characters_character_ticket.sql
diff --git a/sql/updates/0.16/9136_04_mangos_spell_chain.sql b/sql/updates/0.16/09136_04_mangos_spell_chain.sql
similarity index 100%
rename from sql/updates/0.16/9136_04_mangos_spell_chain.sql
rename to sql/updates/0.16/09136_04_mangos_spell_chain.sql
diff --git a/sql/updates/0.16/9136_05_mangos_spell_bonus_data.sql b/sql/updates/0.16/09136_05_mangos_spell_bonus_data.sql
similarity index 100%
rename from sql/updates/0.16/9136_05_mangos_spell_bonus_data.sql
rename to sql/updates/0.16/09136_05_mangos_spell_bonus_data.sql
diff --git a/sql/updates/0.16/9136_06_mangos_spell_proc_event.sql b/sql/updates/0.16/09136_06_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9136_06_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09136_06_mangos_spell_proc_event.sql
diff --git a/sql/updates/0.16/9136_07_characters_characters.sql b/sql/updates/0.16/09136_07_characters_characters.sql
similarity index 100%
rename from sql/updates/0.16/9136_07_characters_characters.sql
rename to sql/updates/0.16/09136_07_characters_characters.sql
diff --git a/sql/updates/0.16/9148_01_mangos_spell_bonus_data.sql b/sql/updates/0.16/09148_01_mangos_spell_bonus_data.sql
similarity index 100%
rename from sql/updates/0.16/9148_01_mangos_spell_bonus_data.sql
rename to sql/updates/0.16/09148_01_mangos_spell_bonus_data.sql
diff --git a/sql/updates/0.16/9149_01_mangos_spell_bonus_data.sql b/sql/updates/0.16/09149_01_mangos_spell_bonus_data.sql
similarity index 100%
rename from sql/updates/0.16/9149_01_mangos_spell_bonus_data.sql
rename to sql/updates/0.16/09149_01_mangos_spell_bonus_data.sql
diff --git a/sql/updates/0.16/9150_01_mangos_spell_bonus_data.sql b/sql/updates/0.16/09150_01_mangos_spell_bonus_data.sql
similarity index 100%
rename from sql/updates/0.16/9150_01_mangos_spell_bonus_data.sql
rename to sql/updates/0.16/09150_01_mangos_spell_bonus_data.sql
diff --git a/sql/updates/0.16/9153_01_mangos_spell_bonus_data.sql b/sql/updates/0.16/09153_01_mangos_spell_bonus_data.sql
similarity index 100%
rename from sql/updates/0.16/9153_01_mangos_spell_bonus_data.sql
rename to sql/updates/0.16/09153_01_mangos_spell_bonus_data.sql
diff --git a/sql/updates/0.16/9155_01_mangos_spell_proc_event.sql b/sql/updates/0.16/09155_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9155_01_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09155_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/0.16/9156_01_mangos_spell_chain.sql b/sql/updates/0.16/09156_01_mangos_spell_chain.sql
similarity index 100%
rename from sql/updates/0.16/9156_01_mangos_spell_chain.sql
rename to sql/updates/0.16/09156_01_mangos_spell_chain.sql
diff --git a/sql/updates/0.16/9156_02_mangos_spell_proc_event.sql b/sql/updates/0.16/09156_02_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9156_02_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09156_02_mangos_spell_proc_event.sql
diff --git a/sql/updates/0.16/9160_01_mangos_spell_proc_event.sql b/sql/updates/0.16/09160_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9160_01_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09160_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/0.16/9160_02_mangos_spell_chain.sql b/sql/updates/0.16/09160_02_mangos_spell_chain.sql
similarity index 100%
rename from sql/updates/0.16/9160_02_mangos_spell_chain.sql
rename to sql/updates/0.16/09160_02_mangos_spell_chain.sql
diff --git a/sql/updates/0.16/9198_01_mangos_mangos_string.sql b/sql/updates/0.16/09198_01_mangos_mangos_string.sql
similarity index 100%
rename from sql/updates/0.16/9198_01_mangos_mangos_string.sql
rename to sql/updates/0.16/09198_01_mangos_mangos_string.sql
diff --git a/sql/updates/0.16/9220_01_mangos_spell_proc_event.sql b/sql/updates/0.16/09220_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9220_01_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09220_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/0.16/9220_02_mangos_spell_chain.sql b/sql/updates/0.16/09220_02_mangos_spell_chain.sql
similarity index 100%
rename from sql/updates/0.16/9220_02_mangos_spell_chain.sql
rename to sql/updates/0.16/09220_02_mangos_spell_chain.sql
diff --git a/sql/updates/0.16/9222_01_mangos_playercreateinfo_spell.sql b/sql/updates/0.16/09222_01_mangos_playercreateinfo_spell.sql
similarity index 100%
rename from sql/updates/0.16/9222_01_mangos_playercreateinfo_spell.sql
rename to sql/updates/0.16/09222_01_mangos_playercreateinfo_spell.sql
diff --git a/sql/updates/0.16/9244_01_mangos_spell_proc_event.sql b/sql/updates/0.16/09244_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9244_01_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09244_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/0.16/9244_02_mangos_spell_chain.sql b/sql/updates/0.16/09244_02_mangos_spell_chain.sql
similarity index 100%
rename from sql/updates/0.16/9244_02_mangos_spell_chain.sql
rename to sql/updates/0.16/09244_02_mangos_spell_chain.sql
diff --git a/sql/updates/0.16/9246_01_characters_character.sql b/sql/updates/0.16/09246_01_characters_character.sql
similarity index 100%
rename from sql/updates/0.16/9246_01_characters_character.sql
rename to sql/updates/0.16/09246_01_characters_character.sql
diff --git a/sql/updates/0.16/9250_01_characters_character.sql b/sql/updates/0.16/09250_01_characters_character.sql
similarity index 100%
rename from sql/updates/0.16/9250_01_characters_character.sql
rename to sql/updates/0.16/09250_01_characters_character.sql
diff --git a/sql/updates/0.16/9262_01_mangos_quest_template.sql b/sql/updates/0.16/09262_01_mangos_quest_template.sql
similarity index 100%
rename from sql/updates/0.16/9262_01_mangos_quest_template.sql
rename to sql/updates/0.16/09262_01_mangos_quest_template.sql
diff --git a/sql/updates/0.16/9277_01_mangos_spell_bonus_data.sql b/sql/updates/0.16/09277_01_mangos_spell_bonus_data.sql
similarity index 100%
rename from sql/updates/0.16/9277_01_mangos_spell_bonus_data.sql
rename to sql/updates/0.16/09277_01_mangos_spell_bonus_data.sql
diff --git a/sql/updates/0.16/9288_01_mangos_spell_bonus_data.sql b/sql/updates/0.16/09288_01_mangos_spell_bonus_data.sql
similarity index 100%
rename from sql/updates/0.16/9288_01_mangos_spell_bonus_data.sql
rename to sql/updates/0.16/09288_01_mangos_spell_bonus_data.sql
diff --git a/sql/updates/0.16/9289_01_mangos_spell_proc_event.sql b/sql/updates/0.16/09289_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9289_01_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09289_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/0.16/9291_01_mangos_quest_template.sql b/sql/updates/0.16/09291_01_mangos_quest_template.sql
similarity index 100%
rename from sql/updates/0.16/9291_01_mangos_quest_template.sql
rename to sql/updates/0.16/09291_01_mangos_quest_template.sql
diff --git a/sql/updates/0.16/9291_02_mangos_locales_quest.sql b/sql/updates/0.16/09291_02_mangos_locales_quest.sql
similarity index 100%
rename from sql/updates/0.16/9291_02_mangos_locales_quest.sql
rename to sql/updates/0.16/09291_02_mangos_locales_quest.sql
diff --git a/sql/updates/0.16/9296_01_mangos_spell_chain.sql b/sql/updates/0.16/09296_01_mangos_spell_chain.sql
similarity index 100%
rename from sql/updates/0.16/9296_01_mangos_spell_chain.sql
rename to sql/updates/0.16/09296_01_mangos_spell_chain.sql
diff --git a/sql/updates/0.16/9297_01_mangos_item_template.sql b/sql/updates/0.16/09297_01_mangos_item_template.sql
similarity index 100%
rename from sql/updates/0.16/9297_01_mangos_item_template.sql
rename to sql/updates/0.16/09297_01_mangos_item_template.sql
diff --git a/sql/updates/0.16/9309_01_mangos_quest_template.sql b/sql/updates/0.16/09309_01_mangos_quest_template.sql
similarity index 100%
rename from sql/updates/0.16/9309_01_mangos_quest_template.sql
rename to sql/updates/0.16/09309_01_mangos_quest_template.sql
diff --git a/sql/updates/0.16/9310_01_mangos_spell_elixir.sql b/sql/updates/0.16/09310_01_mangos_spell_elixir.sql
similarity index 100%
rename from sql/updates/0.16/9310_01_mangos_spell_elixir.sql
rename to sql/updates/0.16/09310_01_mangos_spell_elixir.sql
diff --git a/sql/updates/0.16/9312_01_mangos_quest_template.sql b/sql/updates/0.16/09312_01_mangos_quest_template.sql
similarity index 100%
rename from sql/updates/0.16/9312_01_mangos_quest_template.sql
rename to sql/updates/0.16/09312_01_mangos_quest_template.sql
diff --git a/sql/updates/0.16/9329_01_mangos_spell_chain.sql b/sql/updates/0.16/09329_01_mangos_spell_chain.sql
similarity index 100%
rename from sql/updates/0.16/9329_01_mangos_spell_chain.sql
rename to sql/updates/0.16/09329_01_mangos_spell_chain.sql
diff --git a/sql/updates/0.16/9331_01_mangos_quest_template.sql b/sql/updates/0.16/09331_01_mangos_quest_template.sql
similarity index 100%
rename from sql/updates/0.16/9331_01_mangos_quest_template.sql
rename to sql/updates/0.16/09331_01_mangos_quest_template.sql
diff --git a/sql/updates/0.16/9339_01_characters_group.sql b/sql/updates/0.16/09339_01_characters_group.sql
similarity index 100%
rename from sql/updates/0.16/9339_01_characters_group.sql
rename to sql/updates/0.16/09339_01_characters_group.sql
diff --git a/sql/updates/0.16/9349_01_characters_character_action.sql b/sql/updates/0.16/09349_01_characters_character_action.sql
similarity index 100%
rename from sql/updates/0.16/9349_01_characters_character_action.sql
rename to sql/updates/0.16/09349_01_characters_character_action.sql
diff --git a/sql/updates/0.16/9354_01_characters_character_action.sql b/sql/updates/0.16/09354_01_characters_character_action.sql
similarity index 100%
rename from sql/updates/0.16/9354_01_characters_character_action.sql
rename to sql/updates/0.16/09354_01_characters_character_action.sql
diff --git a/sql/updates/0.16/9359_01_characters_characters.sql b/sql/updates/0.16/09359_01_characters_characters.sql
similarity index 100%
rename from sql/updates/0.16/9359_01_characters_characters.sql
rename to sql/updates/0.16/09359_01_characters_characters.sql
diff --git a/sql/updates/0.16/9366_01_mangos_spell_bonus_data.sql b/sql/updates/0.16/09366_01_mangos_spell_bonus_data.sql
similarity index 100%
rename from sql/updates/0.16/9366_01_mangos_spell_bonus_data.sql
rename to sql/updates/0.16/09366_01_mangos_spell_bonus_data.sql
diff --git a/sql/updates/0.16/9366_02_mangos_spell_proc_event.sql b/sql/updates/0.16/09366_02_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9366_02_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09366_02_mangos_spell_proc_event.sql
diff --git a/sql/updates/0.16/9374_01_characters_character_glyphs.sql b/sql/updates/0.16/09374_01_characters_character_glyphs.sql
similarity index 100%
rename from sql/updates/0.16/9374_01_characters_character_glyphs.sql
rename to sql/updates/0.16/09374_01_characters_character_glyphs.sql
diff --git a/sql/updates/0.16/9375_01_characters_character_glyphs.sql b/sql/updates/0.16/09375_01_characters_character_glyphs.sql
similarity index 100%
rename from sql/updates/0.16/9375_01_characters_character_glyphs.sql
rename to sql/updates/0.16/09375_01_characters_character_glyphs.sql
diff --git a/sql/updates/0.16/9379_01_mangos_spell_proc_event.sql b/sql/updates/0.16/09379_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9379_01_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09379_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/0.16/9380_01_mangos_command.sql b/sql/updates/0.16/09380_01_mangos_command.sql
similarity index 100%
rename from sql/updates/0.16/9380_01_mangos_command.sql
rename to sql/updates/0.16/09380_01_mangos_command.sql
diff --git a/sql/updates/0.16/9382_01_mangos_command.sql b/sql/updates/0.16/09382_01_mangos_command.sql
similarity index 100%
rename from sql/updates/0.16/9382_01_mangos_command.sql
rename to sql/updates/0.16/09382_01_mangos_command.sql
diff --git a/sql/updates/0.16/9385_01_mangos_command.sql b/sql/updates/0.16/09385_01_mangos_command.sql
similarity index 100%
rename from sql/updates/0.16/9385_01_mangos_command.sql
rename to sql/updates/0.16/09385_01_mangos_command.sql
diff --git a/sql/updates/0.16/9450_01_mangos_spell_proc_event.sql b/sql/updates/0.16/09450_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9450_01_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09450_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/0.16/9460_01_mangos_spell_bonus_data.sql b/sql/updates/0.16/09460_01_mangos_spell_bonus_data.sql
similarity index 100%
rename from sql/updates/0.16/9460_01_mangos_spell_bonus_data.sql
rename to sql/updates/0.16/09460_01_mangos_spell_bonus_data.sql
diff --git a/sql/updates/0.16/9460_02_mangos_spell_chain.sql b/sql/updates/0.16/09460_02_mangos_spell_chain.sql
similarity index 100%
rename from sql/updates/0.16/9460_02_mangos_spell_chain.sql
rename to sql/updates/0.16/09460_02_mangos_spell_chain.sql
diff --git a/sql/updates/0.16/9464_01_mangos_spell_proc_event.sql b/sql/updates/0.16/09464_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9464_01_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09464_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/0.16/9466_01_mangos_mangos_string.sql b/sql/updates/0.16/09466_01_mangos_mangos_string.sql
similarity index 100%
rename from sql/updates/0.16/9466_01_mangos_mangos_string.sql
rename to sql/updates/0.16/09466_01_mangos_mangos_string.sql
diff --git a/sql/updates/0.16/9477_01_mangos_spell_proc_event.sql b/sql/updates/0.16/09477_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9477_01_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09477_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/0.16/9482_01_mangos_spell_proc_event.sql b/sql/updates/0.16/09482_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9482_01_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09482_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/0.16/9509_01_mangos_item_template.sql b/sql/updates/0.16/09509_01_mangos_item_template.sql
similarity index 100%
rename from sql/updates/0.16/9509_01_mangos_item_template.sql
rename to sql/updates/0.16/09509_01_mangos_item_template.sql
diff --git a/sql/updates/0.16/9512_01_mangos_spell_proc_event.sql b/sql/updates/0.16/09512_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9512_01_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09512_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/0.16/9526_01_mangos_spell_proc_event.sql b/sql/updates/0.16/09526_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9526_01_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09526_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/0.16/9528_01_mangos_spell_bonus_data.sql b/sql/updates/0.16/09528_01_mangos_spell_bonus_data.sql
similarity index 100%
rename from sql/updates/0.16/9528_01_mangos_spell_bonus_data.sql
rename to sql/updates/0.16/09528_01_mangos_spell_bonus_data.sql
diff --git a/sql/updates/0.16/9539_01_mangos_spell_bonus_data.sql b/sql/updates/0.16/09539_01_mangos_spell_bonus_data.sql
similarity index 100%
rename from sql/updates/0.16/9539_01_mangos_spell_bonus_data.sql
rename to sql/updates/0.16/09539_01_mangos_spell_bonus_data.sql
diff --git a/sql/updates/0.16/9589_01_mangos_creature_template.sql b/sql/updates/0.16/09589_01_mangos_creature_template.sql
similarity index 100%
rename from sql/updates/0.16/9589_01_mangos_creature_template.sql
rename to sql/updates/0.16/09589_01_mangos_creature_template.sql
diff --git a/sql/updates/0.16/9590_01_mangos_db_script_string.sql b/sql/updates/0.16/09590_01_mangos_db_script_string.sql
similarity index 100%
rename from sql/updates/0.16/9590_01_mangos_db_script_string.sql
rename to sql/updates/0.16/09590_01_mangos_db_script_string.sql
diff --git a/sql/updates/0.16/9611_01_characters.sql b/sql/updates/0.16/09611_01_characters.sql
similarity index 100%
rename from sql/updates/0.16/9611_01_characters.sql
rename to sql/updates/0.16/09611_01_characters.sql
diff --git a/sql/updates/0.16/9622_01_mangos_gameobject.sql b/sql/updates/0.16/09622_01_mangos_gameobject.sql
similarity index 100%
rename from sql/updates/0.16/9622_01_mangos_gameobject.sql
rename to sql/updates/0.16/09622_01_mangos_gameobject.sql
diff --git a/sql/updates/0.16/9630_01_characters_characters.sql b/sql/updates/0.16/09630_01_characters_characters.sql
similarity index 100%
rename from sql/updates/0.16/9630_01_characters_characters.sql
rename to sql/updates/0.16/09630_01_characters_characters.sql
diff --git a/sql/updates/0.16/9632_01_characters_characters.sql b/sql/updates/0.16/09632_01_characters_characters.sql
similarity index 100%
rename from sql/updates/0.16/9632_01_characters_characters.sql
rename to sql/updates/0.16/09632_01_characters_characters.sql
diff --git a/sql/updates/0.16/9634_01_characters_corpse.sql b/sql/updates/0.16/09634_01_characters_corpse.sql
similarity index 100%
rename from sql/updates/0.16/9634_01_characters_corpse.sql
rename to sql/updates/0.16/09634_01_characters_corpse.sql
diff --git a/sql/updates/0.16/9635_01_characters_characters.sql b/sql/updates/0.16/09635_01_characters_characters.sql
similarity index 100%
rename from sql/updates/0.16/9635_01_characters_characters.sql
rename to sql/updates/0.16/09635_01_characters_characters.sql
diff --git a/sql/updates/0.16/9636_01_mangos_item_template.sql b/sql/updates/0.16/09636_01_mangos_item_template.sql
similarity index 100%
rename from sql/updates/0.16/9636_01_mangos_item_template.sql
rename to sql/updates/0.16/09636_01_mangos_item_template.sql
diff --git a/sql/updates/0.16/9646_01_characters_characters.sql b/sql/updates/0.16/09646_01_characters_characters.sql
similarity index 100%
rename from sql/updates/0.16/9646_01_characters_characters.sql
rename to sql/updates/0.16/09646_01_characters_characters.sql
diff --git a/sql/updates/0.16/9651_01_mangos_quest_poi.sql b/sql/updates/0.16/09651_01_mangos_quest_poi.sql
similarity index 100%
rename from sql/updates/0.16/9651_01_mangos_quest_poi.sql
rename to sql/updates/0.16/09651_01_mangos_quest_poi.sql
diff --git a/sql/updates/0.16/9656_01_mangos_command.sql b/sql/updates/0.16/09656_01_mangos_command.sql
similarity index 100%
rename from sql/updates/0.16/9656_01_mangos_command.sql
rename to sql/updates/0.16/09656_01_mangos_command.sql
diff --git a/sql/updates/0.16/9656_02_mangos_mangos_string.sql b/sql/updates/0.16/09656_02_mangos_mangos_string.sql
similarity index 100%
rename from sql/updates/0.16/9656_02_mangos_mangos_string.sql
rename to sql/updates/0.16/09656_02_mangos_mangos_string.sql
diff --git a/sql/updates/0.16/9661_01_characters_character_talent.sql b/sql/updates/0.16/09661_01_characters_character_talent.sql
similarity index 100%
rename from sql/updates/0.16/9661_01_characters_character_talent.sql
rename to sql/updates/0.16/09661_01_characters_character_talent.sql
diff --git a/sql/updates/0.16/9663_01_mangos_mangos_string.sql b/sql/updates/0.16/09663_01_mangos_mangos_string.sql
similarity index 100%
rename from sql/updates/0.16/9663_01_mangos_mangos_string.sql
rename to sql/updates/0.16/09663_01_mangos_mangos_string.sql
diff --git a/sql/updates/0.16/9680_01_characters_character_stats.sql b/sql/updates/0.16/09680_01_characters_character_stats.sql
similarity index 100%
rename from sql/updates/0.16/9680_01_characters_character_stats.sql
rename to sql/updates/0.16/09680_01_characters_character_stats.sql
diff --git a/sql/updates/0.16/9686_01_characters_character_queststatus_weekly.sql b/sql/updates/0.16/09686_01_characters_character_queststatus_weekly.sql
similarity index 100%
rename from sql/updates/0.16/9686_01_characters_character_queststatus_weekly.sql
rename to sql/updates/0.16/09686_01_characters_character_queststatus_weekly.sql
diff --git a/sql/updates/0.16/9687_01_characters_character_queststatus_daily.sql b/sql/updates/0.16/09687_01_characters_character_queststatus_daily.sql
similarity index 100%
rename from sql/updates/0.16/9687_01_characters_character_queststatus_daily.sql
rename to sql/updates/0.16/09687_01_characters_character_queststatus_daily.sql
diff --git a/sql/updates/0.16/9690_01_mangos_spell_proc_event.sql b/sql/updates/0.16/09690_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/0.16/9690_01_mangos_spell_proc_event.sql
rename to sql/updates/0.16/09690_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/9010_01_realmd_realmlist.sql b/sql/updates/09010_01_realmd_realmlist.sql
similarity index 100%
rename from sql/updates/9010_01_realmd_realmlist.sql
rename to sql/updates/09010_01_realmd_realmlist.sql
diff --git a/sql/updates/9692_01_characters_mail.sql b/sql/updates/09692_01_characters_mail.sql
similarity index 100%
rename from sql/updates/9692_01_characters_mail.sql
rename to sql/updates/09692_01_characters_mail.sql
diff --git a/sql/updates/9692_02_characters_mail.sql b/sql/updates/09692_02_characters_mail.sql
similarity index 100%
rename from sql/updates/9692_02_characters_mail.sql
rename to sql/updates/09692_02_characters_mail.sql
diff --git a/sql/updates/9692_03_mangos_spell_proc_event.sql b/sql/updates/09692_03_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/9692_03_mangos_spell_proc_event.sql
rename to sql/updates/09692_03_mangos_spell_proc_event.sql
diff --git a/sql/updates/9702_01_characters_item.sql b/sql/updates/09702_01_characters_item.sql
similarity index 100%
rename from sql/updates/9702_01_characters_item.sql
rename to sql/updates/09702_01_characters_item.sql
diff --git a/sql/updates/9704_01_mangos_achievement_reward.sql b/sql/updates/09704_01_mangos_achievement_reward.sql
similarity index 100%
rename from sql/updates/9704_01_mangos_achievement_reward.sql
rename to sql/updates/09704_01_mangos_achievement_reward.sql
diff --git a/sql/updates/9710_01_mangos_command.sql b/sql/updates/09710_01_mangos_command.sql
similarity index 100%
rename from sql/updates/9710_01_mangos_command.sql
rename to sql/updates/09710_01_mangos_command.sql
diff --git a/sql/updates/9716_01_mangos_npc_vendor.sql b/sql/updates/09716_01_mangos_npc_vendor.sql
similarity index 100%
rename from sql/updates/9716_01_mangos_npc_vendor.sql
rename to sql/updates/09716_01_mangos_npc_vendor.sql
diff --git a/sql/updates/9716_02_mangos_mangos_string.sql b/sql/updates/09716_02_mangos_mangos_string.sql
similarity index 100%
rename from sql/updates/9716_02_mangos_mangos_string.sql
rename to sql/updates/09716_02_mangos_mangos_string.sql
diff --git a/sql/updates/9720_01_mangos_spell_proc_event.sql b/sql/updates/09720_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/9720_01_mangos_spell_proc_event.sql
rename to sql/updates/09720_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/9728_01_mangos_gossip_menu_option.sql b/sql/updates/09728_01_mangos_gossip_menu_option.sql
similarity index 100%
rename from sql/updates/9728_01_mangos_gossip_menu_option.sql
rename to sql/updates/09728_01_mangos_gossip_menu_option.sql
diff --git a/sql/updates/9735_01_mangos_spell_proc_event.sql b/sql/updates/09735_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/9735_01_mangos_spell_proc_event.sql
rename to sql/updates/09735_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/9735_02_mangos_spell_chain.sql b/sql/updates/09735_02_mangos_spell_chain.sql
similarity index 100%
rename from sql/updates/9735_02_mangos_spell_chain.sql
rename to sql/updates/09735_02_mangos_spell_chain.sql
diff --git a/sql/updates/9746_01_realmd_realmlist.sql b/sql/updates/09746_01_realmd_realmlist.sql
similarity index 100%
rename from sql/updates/9746_01_realmd_realmlist.sql
rename to sql/updates/09746_01_realmd_realmlist.sql
diff --git a/sql/updates/9747_01_mangos_battleground_template.sql b/sql/updates/09747_01_mangos_battleground_template.sql
similarity index 100%
rename from sql/updates/9747_01_mangos_battleground_template.sql
rename to sql/updates/09747_01_mangos_battleground_template.sql
diff --git a/sql/updates/9748_01_realmd_realmlist.sql b/sql/updates/09748_01_realmd_realmlist.sql
similarity index 100%
rename from sql/updates/9748_01_realmd_realmlist.sql
rename to sql/updates/09748_01_realmd_realmlist.sql
diff --git a/sql/updates/9751_01_characters.sql b/sql/updates/09751_01_characters.sql
similarity index 100%
rename from sql/updates/9751_01_characters.sql
rename to sql/updates/09751_01_characters.sql
diff --git a/sql/updates/9752_01_mangos_gameobject_template.sql b/sql/updates/09752_01_mangos_gameobject_template.sql
similarity index 100%
rename from sql/updates/9752_01_mangos_gameobject_template.sql
rename to sql/updates/09752_01_mangos_gameobject_template.sql
diff --git a/sql/updates/9753_01_mangos_instance_template.sql b/sql/updates/09753_01_mangos_instance_template.sql
similarity index 100%
rename from sql/updates/9753_01_mangos_instance_template.sql
rename to sql/updates/09753_01_mangos_instance_template.sql
diff --git a/sql/updates/9755_01_mangos_instance_template.sql b/sql/updates/09755_01_mangos_instance_template.sql
similarity index 100%
rename from sql/updates/9755_01_mangos_instance_template.sql
rename to sql/updates/09755_01_mangos_instance_template.sql
diff --git a/sql/updates/9761_01_mangos_mangos_string.sql b/sql/updates/09761_01_mangos_mangos_string.sql
similarity index 100%
rename from sql/updates/9761_01_mangos_mangos_string.sql
rename to sql/updates/09761_01_mangos_mangos_string.sql
diff --git a/sql/updates/9763_01_mangos_battleground_template.sql b/sql/updates/09763_01_mangos_battleground_template.sql
similarity index 100%
rename from sql/updates/9763_01_mangos_battleground_template.sql
rename to sql/updates/09763_01_mangos_battleground_template.sql
diff --git a/sql/updates/9766_01_mangos_spell_proc_event.sql b/sql/updates/09766_01_mangos_spell_proc_event.sql
similarity index 100%
rename from sql/updates/9766_01_mangos_spell_proc_event.sql
rename to sql/updates/09766_01_mangos_spell_proc_event.sql
diff --git a/sql/updates/9767_01_mangos_mangos_string.sql b/sql/updates/09767_01_mangos_mangos_string.sql
similarity index 100%
rename from sql/updates/9767_01_mangos_mangos_string.sql
rename to sql/updates/09767_01_mangos_mangos_string.sql
diff --git a/sql/updates/9767_02_mangos_command.sql b/sql/updates/09767_02_mangos_command.sql
similarity index 100%
rename from sql/updates/9767_02_mangos_command.sql
rename to sql/updates/09767_02_mangos_command.sql
diff --git a/sql/updates/9767_03_characters_characters.sql b/sql/updates/09767_03_characters_characters.sql
similarity index 100%
rename from sql/updates/9767_03_characters_characters.sql
rename to sql/updates/09767_03_characters_characters.sql
diff --git a/sql/updates/9768_01_mangos_command.sql b/sql/updates/09768_01_mangos_command.sql
similarity index 100%
rename from sql/updates/9768_01_mangos_command.sql
rename to sql/updates/09768_01_mangos_command.sql
diff --git a/sql/updates/9794_01_mangos_mangos_string.sql b/sql/updates/09794_01_mangos_mangos_string.sql
similarity index 100%
rename from sql/updates/9794_01_mangos_mangos_string.sql
rename to sql/updates/09794_01_mangos_mangos_string.sql
diff --git a/sql/updates/9794_02_mangos_command.sql b/sql/updates/09794_02_mangos_command.sql
similarity index 100%
rename from sql/updates/9794_02_mangos_command.sql
rename to sql/updates/09794_02_mangos_command.sql
diff --git a/sql/updates/9803_01_mangos_spell_bonus_data.sql b/sql/updates/09803_01_mangos_spell_bonus_data.sql
similarity index 100%
rename from sql/updates/9803_01_mangos_spell_bonus_data.sql
rename to sql/updates/09803_01_mangos_spell_bonus_data.sql
diff --git a/sql/updates/9826_01_mangos_spell_script_target.sql b/sql/updates/09826_01_mangos_spell_script_target.sql
similarity index 100%
rename from sql/updates/9826_01_mangos_spell_script_target.sql
rename to sql/updates/09826_01_mangos_spell_script_target.sql
diff --git a/sql/updates/9849_01_characters_saved_variables.sql b/sql/updates/09849_01_characters_saved_variables.sql
similarity index 100%
rename from sql/updates/9849_01_characters_saved_variables.sql
rename to sql/updates/09849_01_characters_saved_variables.sql
diff --git a/sql/updates/9854_01_mangos_spell_bonus_data.sql b/sql/updates/09854_01_mangos_spell_bonus_data.sql
similarity index 100%
rename from sql/updates/9854_01_mangos_spell_bonus_data.sql
rename to sql/updates/09854_01_mangos_spell_bonus_data.sql
diff --git a/sql/updates/09881_01_mangos_scripts.sql b/sql/updates/09881_01_mangos_scripts.sql
new file mode 100644
index 000000000..276e9807b
--- /dev/null
+++ b/sql/updates/09881_01_mangos_scripts.sql
@@ -0,0 +1,25 @@
+ALTER TABLE db_version CHANGE COLUMN required_9854_01_mangos_spell_bonus_data required_9881_01_mangos_scripts bit;
+
+ALTER TABLE event_scripts ADD COLUMN datalong3 INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong2;
+ALTER TABLE event_scripts ADD COLUMN datalong4 INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong3;
+ALTER TABLE event_scripts ADD COLUMN data_flags TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong4;
+
+ALTER TABLE gameobject_scripts ADD COLUMN datalong3 INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong2;
+ALTER TABLE gameobject_scripts ADD COLUMN datalong4 INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong3;
+ALTER TABLE gameobject_scripts ADD COLUMN data_flags TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong4;
+
+ALTER TABLE gossip_scripts ADD COLUMN datalong3 INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong2;
+ALTER TABLE gossip_scripts ADD COLUMN datalong4 INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong3;
+ALTER TABLE gossip_scripts ADD COLUMN data_flags TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong4;
+
+ALTER TABLE quest_end_scripts ADD COLUMN datalong3 INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong2;
+ALTER TABLE quest_end_scripts ADD COLUMN datalong4 INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong3;
+ALTER TABLE quest_end_scripts ADD COLUMN data_flags TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong4;
+
+ALTER TABLE quest_start_scripts ADD COLUMN datalong3 INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong2;
+ALTER TABLE quest_start_scripts ADD COLUMN datalong4 INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong3;
+ALTER TABLE quest_start_scripts ADD COLUMN data_flags TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong4;
+
+ALTER TABLE spell_scripts ADD COLUMN datalong3 INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong2;
+ALTER TABLE spell_scripts ADD COLUMN datalong4 INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong3;
+ALTER TABLE spell_scripts ADD COLUMN data_flags TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER datalong4;
diff --git a/sql/updates/09883_01_mangos_scripts.sql b/sql/updates/09883_01_mangos_scripts.sql
new file mode 100644
index 000000000..5252b3e9b
--- /dev/null
+++ b/sql/updates/09883_01_mangos_scripts.sql
@@ -0,0 +1,25 @@
+ALTER TABLE db_version CHANGE COLUMN required_9881_01_mangos_scripts required_9883_01_mangos_scripts bit;
+
+-- convert to CHAT_TYPE_WHISPER
+UPDATE event_scripts SET datalong=4 WHERE command=0 AND datalong=1;
+UPDATE gameobject_scripts SET datalong=4 WHERE command=0 AND datalong=1;
+UPDATE gossip_scripts SET datalong=4 WHERE command=0 AND datalong=1;
+UPDATE quest_end_scripts SET datalong=4 WHERE command=0 AND datalong=1;
+UPDATE quest_start_scripts SET datalong=4 WHERE command=0 AND datalong=1;
+UPDATE spell_scripts SET datalong=4 WHERE command=0 AND datalong=1;
+
+-- convert to CHAT_TYPE_YELL
+UPDATE event_scripts SET datalong=1 WHERE command=0 AND datalong=2;
+UPDATE gameobject_scripts SET datalong=1 WHERE command=0 AND datalong=2;
+UPDATE gossip_scripts SET datalong=1 WHERE command=0 AND datalong=2;
+UPDATE quest_end_scripts SET datalong=1 WHERE command=0 AND datalong=2;
+UPDATE quest_start_scripts SET datalong=1 WHERE command=0 AND datalong=2;
+UPDATE spell_scripts SET datalong=1 WHERE command=0 AND datalong=2;
+
+-- convert to CHAT_TYPE_TEXT_EMOTE
+UPDATE event_scripts SET datalong=2 WHERE command=0 AND datalong=3;
+UPDATE gameobject_scripts SET datalong=2 WHERE command=0 AND datalong=3;
+UPDATE gossip_scripts SET datalong=2 WHERE command=0 AND datalong=3;
+UPDATE quest_end_scripts SET datalong=2 WHERE command=0 AND datalong=3;
+UPDATE quest_start_scripts SET datalong=2 WHERE command=0 AND datalong=3;
+UPDATE spell_scripts SET datalong=2 WHERE command=0 AND datalong=3;
diff --git a/sql/updates/09886_01_mangos_mangos_string.sql b/sql/updates/09886_01_mangos_mangos_string.sql
new file mode 100644
index 000000000..126aaf779
--- /dev/null
+++ b/sql/updates/09886_01_mangos_mangos_string.sql
@@ -0,0 +1,8 @@
+ALTER TABLE db_version CHANGE COLUMN required_9883_01_mangos_scripts required_9886_01_mangos_mangos_string bit;
+
+DELETE FROM mangos_string WHERE entry IN (1011,1010,1012,1013,1142);
+INSERT INTO mangos_string VALUES
+(1010,'| ID | Account | Character | IP | GM | Expansion |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1012,'========================================================================================',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1013,'| %10u |%15s| %20s | %15s |%4d| %9d |',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1142,'%u - %s (Online:%s IP:%s GM:%u Expansion:%u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
diff --git a/sql/updates/09886_02_mangos_command.sql b/sql/updates/09886_02_mangos_command.sql
new file mode 100644
index 000000000..7d3c9c8de
--- /dev/null
+++ b/sql/updates/09886_02_mangos_command.sql
@@ -0,0 +1,10 @@
+ALTER TABLE db_version CHANGE COLUMN required_9886_01_mangos_mangos_string required_9886_02_mangos_command bit;
+
+DELETE FROM command WHERE name IN('lookup account email','lookup account ip','lookup account name','lookup player account','lookup player ip','lookup player email');
+INSERT INTO command (name, security, help) VALUES
+('lookup account email',2,'Syntax: .lookup account email $emailpart [#limit] \r\n\r\n Searchs accounts, which email including $emailpart with optional parametr #limit of results. If #limit not provided expected 100.'),
+('lookup account ip',2,'Syntax: lookup account ip $ippart [#limit] \r\n\r\n Searchs accounts, which last used ip inluding $ippart (textual) with optional parametr #$limit of results. If #limit not provided expected 100.'),
+('lookup account name',2,'Syntax: .lookup account name $accountpart [#limit] \r\n\r\n Searchs accounts, which username including $accountpart with optional parametr #limit of results. If #limit not provided expected 100.'),
+('lookup player account',2,'Syntax: .lookup player account $accountpart [#limit] \r\n\r\n Searchs players, which account username including $accountpart with optional parametr #limit of results. If #limit not provided expected 100.'),
+('lookup player email',2,'Syntax: .lookup player email $emailpart [#limit] \r\n\r\n Searchs players, which account email including $emailpart with optional parametr #limit of results. If #limit not provided expected 100.'),
+('lookup player ip',2,'Syntax: .lookup player ip $ippart [#limit] \r\n\r\n Searchs players, which account last used ip inluding $ippart (textual) with optional parametr #limit of results. If #limit not provided expected 100.');
diff --git a/sql/updates/09891_01_mangos_creature_movement.sql b/sql/updates/09891_01_mangos_creature_movement.sql
new file mode 100644
index 000000000..89d38f270
--- /dev/null
+++ b/sql/updates/09891_01_mangos_creature_movement.sql
@@ -0,0 +1,3 @@
+ALTER TABLE db_version CHANGE COLUMN required_9886_02_mangos_command required_9891_01_mangos_creature_movement bit;
+
+ALTER TABLE creature_movement ADD COLUMN script_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER waittime;
diff --git a/sql/updates/09891_02_mangos_creature_movement_scripts.sql b/sql/updates/09891_02_mangos_creature_movement_scripts.sql
new file mode 100644
index 000000000..e37fba3ce
--- /dev/null
+++ b/sql/updates/09891_02_mangos_creature_movement_scripts.sql
@@ -0,0 +1,18 @@
+ALTER TABLE db_version CHANGE COLUMN required_9891_01_mangos_creature_movement required_9891_02_mangos_creature_movement_scripts bit;
+
+DROP TABLE IF EXISTS `creature_movement_scripts`;
+CREATE TABLE `creature_movement_scripts` (
+ `id` mediumint(8) unsigned NOT NULL default '0',
+ `delay` int(10) unsigned NOT NULL default '0',
+ `command` mediumint(8) unsigned NOT NULL default '0',
+ `datalong` mediumint(8) unsigned NOT NULL default '0',
+ `datalong2` int(10) unsigned NOT NULL default '0',
+ `datalong3` int(10) unsigned NOT NULL default '0',
+ `datalong4` int(10) unsigned NOT NULL default '0',
+ `data_flags` tinyint(3) unsigned NOT NULL default '0',
+ `dataint` int(11) NOT NULL default '0',
+ `x` float NOT NULL default '0',
+ `y` float NOT NULL default '0',
+ `z` float NOT NULL default '0',
+ `o` float NOT NULL default '0'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
diff --git a/sql/updates/09899_01_mangos_spell_bonus_data.sql b/sql/updates/09899_01_mangos_spell_bonus_data.sql
new file mode 100644
index 000000000..c481cbc06
--- /dev/null
+++ b/sql/updates/09899_01_mangos_spell_bonus_data.sql
@@ -0,0 +1,11 @@
+ALTER TABLE db_version CHANGE COLUMN required_9891_02_mangos_creature_movement_scripts required_9899_01_mangos_spell_bonus_data bit;
+
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (
+ 17,122,139,421,589,774,1064,1449,2060,2061,2136,2912,2948,8004,
+ 11426,19236,25912,30451,32379,32546,33110,34861,42463,44457,
+ 49821,51505,53739,61391);
+
+INSERT INTO `spell_bonus_data` VALUES
+(53739, 0, 0, 0.003, 'Paladin - Seal of Corruption (full stack proc)'),
+(42463, 0, 0, 0.003, 'Paladin - Seal of Vengeance (full stack proc)'),
+(49821, 0.2857,0, 0, 'Priest - Mind Sear Trigger');
diff --git a/sql/updates/09924_01_mangos_mangos_string.sql b/sql/updates/09924_01_mangos_mangos_string.sql
new file mode 100644
index 000000000..ee57f8dd8
--- /dev/null
+++ b/sql/updates/09924_01_mangos_mangos_string.sql
@@ -0,0 +1,6 @@
+ALTER TABLE db_version CHANGE COLUMN required_9899_01_mangos_spell_bonus_data required_9924_01_mangos_mangos_string bit;
+
+DELETE FROM mangos_string WHERE entry IN (1027,1028);
+INSERT INTO mangos_string VALUES
+(1027, 'Log filters state:',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1028, 'All log filters set to: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
diff --git a/sql/updates/09924_02_mangos_command.sql b/sql/updates/09924_02_mangos_command.sql
new file mode 100644
index 000000000..d0c0ab3ff
--- /dev/null
+++ b/sql/updates/09924_02_mangos_command.sql
@@ -0,0 +1,6 @@
+ALTER TABLE db_version CHANGE COLUMN required_9924_01_mangos_mangos_string required_9924_02_mangos_command bit;
+
+DELETE FROM command WHERE name IN('server set loglevel','server log level','server log filter');
+INSERT INTO command (name, security, help) VALUES
+('server log filter',4,'Syntax: .server log filter [($filtername|all) (on|off)]\r\n\r\nShow or set server log filters. If used "all" then all filters will be set to on/off state.'),
+('server log level',4,'Syntax: .server log level [#level]\r\n\r\nShow or set server log level (0 - errors only, 1 - basic, 2 - detail, 3 - debug).');
diff --git a/sql/updates/09957_01_mangos_mangos_string.sql b/sql/updates/09957_01_mangos_mangos_string.sql
new file mode 100644
index 000000000..cc3c99285
--- /dev/null
+++ b/sql/updates/09957_01_mangos_mangos_string.sql
@@ -0,0 +1,5 @@
+ALTER TABLE db_version CHANGE COLUMN required_9924_02_mangos_command required_9957_01_mangos_mangos_string bit;
+
+DELETE FROM mangos_string WHERE entry IN (210);
+INSERT INTO mangos_string VALUES
+(210,'Item \'%i\' (with extended cost %i) already in vendor list.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
diff --git a/sql/updates/09957_02_mangos_npc_vendor.sql b/sql/updates/09957_02_mangos_npc_vendor.sql
new file mode 100644
index 000000000..25c829702
--- /dev/null
+++ b/sql/updates/09957_02_mangos_npc_vendor.sql
@@ -0,0 +1,4 @@
+ALTER TABLE db_version CHANGE COLUMN required_9957_01_mangos_mangos_string required_9957_02_mangos_npc_vendor bit;
+
+ALTER TABLE npc_vendor
+ CHANGE COLUMN `ExtendedCost` `ExtendedCost` mediumint(8) NOT NULL default '0' COMMENT 'negative if cost must exclude normal money cost';
diff --git a/sql/updates/09967_01_mangos_spell_proc_event.sql b/sql/updates/09967_01_mangos_spell_proc_event.sql
new file mode 100644
index 000000000..2fb01cafa
--- /dev/null
+++ b/sql/updates/09967_01_mangos_spell_proc_event.sql
@@ -0,0 +1,4 @@
+ALTER TABLE db_version CHANGE COLUMN required_9957_02_mangos_npc_vendor required_9967_01_mangos_spell_proc_event bit;
+
+delete from `spell_proc_event` where entry = 16164;
+insert into `spell_proc_event` values (16164, 0x0000001C, 11, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000002, 0.000000, 0.000000, 0);
\ No newline at end of file
diff --git a/sql/updates/09974_01_characters_group.sql b/sql/updates/09974_01_characters_group.sql
new file mode 100644
index 000000000..9bdc5ada8
--- /dev/null
+++ b/sql/updates/09974_01_characters_group.sql
@@ -0,0 +1,8 @@
+ALTER TABLE character_db_version CHANGE COLUMN required_9849_01_characters_saved_variables required_9974_01_characters_group bit;
+
+ALTER TABLE groups
+ CHANGE COLUMN isRaid groupType tinyint(1) unsigned NOT NULL;
+
+/* now fixed bug in past can save raids as 1 (BG group) */
+UPDATE groups
+ SET groupType = 2 WHERE groupType = 1;
\ No newline at end of file
diff --git a/sql/updates/09977_01_mangos_spell_proc_event.sql b/sql/updates/09977_01_mangos_spell_proc_event.sql
new file mode 100644
index 000000000..9627bfd86
--- /dev/null
+++ b/sql/updates/09977_01_mangos_spell_proc_event.sql
@@ -0,0 +1,7 @@
+ALTER TABLE db_version CHANGE COLUMN required_9967_01_mangos_spell_proc_event required_9977_01_mangos_spell_proc_event bit;
+
+DELETE FROM `spell_proc_event` WHERE `entry` IN (16180,16196,16198);
+INSERT INTO `spell_proc_event` VALUES
+(16180,0x00000000,11,0x000001C0,0x00000000,0x00000010,0x00000000,0x00000002,0.000000,0.000000, 0),
+(16196,0x00000000,11,0x000001C0,0x00000000,0x00000010,0x00000000,0x00000002,0.000000,0.000000, 0),
+(16198,0x00000000,11,0x000001C0,0x00000000,0x00000010,0x00000000,0x00000002,0.000000,0.000000, 0);
diff --git a/sql/updates/09978_01_mangos_spell_bonus_data.sql b/sql/updates/09978_01_mangos_spell_bonus_data.sql
new file mode 100644
index 000000000..d873ebd2e
--- /dev/null
+++ b/sql/updates/09978_01_mangos_spell_bonus_data.sql
@@ -0,0 +1,3 @@
+ALTER TABLE db_version CHANGE COLUMN required_9977_01_mangos_spell_proc_event required_9978_01_mangos_spell_bonus_data bit;
+
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (55078,55095);
diff --git a/sql/updates/09988_01_mangos_spell_chain.sql b/sql/updates/09988_01_mangos_spell_chain.sql
new file mode 100644
index 000000000..bf9c62735
--- /dev/null
+++ b/sql/updates/09988_01_mangos_spell_chain.sql
@@ -0,0 +1,8 @@
+ALTER TABLE db_version CHANGE COLUMN required_9978_01_mangos_spell_bonus_data required_9988_01_mangos_spell_chain bit;
+
+DELETE FROM `spell_chain` WHERE `spell_id` IN (61024,61316);
+INSERT INTO `spell_chain` (`spell_id`, `prev_spell`, `first_spell`, `rank`, `req_spell`) VALUES
+/*Dalaran Intellect*/
+(61024,61024,61024,1,27126),
+/*Dalaran Brilliance*/
+(61316,61316,61316,1,27127);
diff --git a/sql/updates/09990_01_mangos_spell_chain.sql b/sql/updates/09990_01_mangos_spell_chain.sql
new file mode 100644
index 000000000..83f09ba96
--- /dev/null
+++ b/sql/updates/09990_01_mangos_spell_chain.sql
@@ -0,0 +1,8 @@
+ALTER TABLE db_version CHANGE COLUMN required_9988_01_mangos_spell_chain required_9990_01_mangos_spell_chain bit;
+
+DELETE FROM `spell_chain` WHERE `spell_id` IN (61024,61316);
+INSERT INTO `spell_chain` (`spell_id`, `prev_spell`, `first_spell`, `rank`, `req_spell`) VALUES
+/*Dalaran Intellect*/
+(61024,0,61024,1,27126),
+/*Dalaran Brilliance*/
+(61316,0,61316,1,27127);
diff --git a/sql/updates/10007_01_characters_pet_aura.sql b/sql/updates/10007_01_characters_pet_aura.sql
new file mode 100644
index 000000000..cc8b44ae2
--- /dev/null
+++ b/sql/updates/10007_01_characters_pet_aura.sql
@@ -0,0 +1,3 @@
+ALTER TABLE character_db_version CHANGE COLUMN required_9974_01_characters_group required_10007_01_characters_pet_aura bit;
+
+UPDATE `pet_aura` SET remaincharges = 0 WHERE remaincharges = 255;
\ No newline at end of file
diff --git a/sql/updates/10008_01_mangos_db_verison.sql b/sql/updates/10008_01_mangos_db_verison.sql
new file mode 100644
index 000000000..5ea62ce67
--- /dev/null
+++ b/sql/updates/10008_01_mangos_db_verison.sql
@@ -0,0 +1,2 @@
+ALTER TABLE db_version CHANGE COLUMN required_9990_01_mangos_spell_chain required_10008_01_mangos_db_verison bit;
+
diff --git a/sql/updates/10008_01_realmd_realmd_db_version.sql b/sql/updates/10008_01_realmd_realmd_db_version.sql
new file mode 100644
index 000000000..ca60b3f0c
--- /dev/null
+++ b/sql/updates/10008_01_realmd_realmd_db_version.sql
@@ -0,0 +1,2 @@
+ALTER TABLE realmd_db_version CHANGE COLUMN required_9748_01_realmd_realmlist required_10008_01_realmd_realmd_db_version bit;
+
diff --git a/sql/updates/10011_01_mangos_spell_proc_event.sql b/sql/updates/10011_01_mangos_spell_proc_event.sql
new file mode 100644
index 000000000..a13492ecc
--- /dev/null
+++ b/sql/updates/10011_01_mangos_spell_proc_event.sql
@@ -0,0 +1,6 @@
+ALTER TABLE db_version CHANGE COLUMN required_10008_01_mangos_db_verison required_10011_01_mangos_spell_proc_event bit;
+
+DELETE FROM `spell_proc_event` WHERE `entry` IN (54646,63280);
+INSERT INTO `spell_proc_event` VALUES
+(54646, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(63280, 0x00000000, 11, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000, 0.000000, 0);
diff --git a/sql/updates/10012_01_mangos_spell_proc_event.sql b/sql/updates/10012_01_mangos_spell_proc_event.sql
new file mode 100644
index 000000000..a966067e9
--- /dev/null
+++ b/sql/updates/10012_01_mangos_spell_proc_event.sql
@@ -0,0 +1,4 @@
+ALTER TABLE db_version CHANGE COLUMN required_10011_01_mangos_spell_proc_event required_10012_01_mangos_spell_proc_event bit;
+
+DELETE FROM `spell_proc_event` WHERE `entry` = 16246;
+INSERT INTO `spell_proc_event` VALUES (16246, 0x00000000, 11, 0x981001C3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0);
\ No newline at end of file
diff --git a/sql/updates/10015_01_mangos_spell_proc_event.sql b/sql/updates/10015_01_mangos_spell_proc_event.sql
new file mode 100644
index 000000000..7d4fb7967
--- /dev/null
+++ b/sql/updates/10015_01_mangos_spell_proc_event.sql
@@ -0,0 +1,7 @@
+ALTER TABLE db_version CHANGE COLUMN required_10012_01_mangos_spell_proc_event required_10015_01_mangos_spell_proc_event bit;
+
+DELETE FROM `spell_proc_event` WHERE `entry` IN (1463, 13163, 32409, 36111, 70664);
+
+INSERT INTO `spell_proc_event` VALUES
+(70664, 0x00000000, 7, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000, 0.000000, 0);
+
diff --git a/sql/updates/10017_01_mangos_spell_proc_event.sql b/sql/updates/10017_01_mangos_spell_proc_event.sql
new file mode 100644
index 000000000..e00c87e4a
--- /dev/null
+++ b/sql/updates/10017_01_mangos_spell_proc_event.sql
@@ -0,0 +1,6 @@
+ALTER TABLE db_version CHANGE COLUMN required_10015_01_mangos_spell_proc_event required_10017_01_mangos_spell_proc_event bit;
+
+ALTER TABLE spell_proc_event
+ CHANGE COLUMN `SchoolMask` `SchoolMask` tinyint(4) unsigned NOT NULL default '0';
+
+
diff --git a/sql/updates/10036_01_mangos_spell_chain.sql b/sql/updates/10036_01_mangos_spell_chain.sql
new file mode 100644
index 000000000..7414f40f8
--- /dev/null
+++ b/sql/updates/10036_01_mangos_spell_chain.sql
@@ -0,0 +1,11 @@
+ALTER TABLE db_version CHANGE COLUMN required_10017_01_mangos_spell_proc_event required_10036_01_mangos_spell_chain bit;
+
+DELETE FROM `spell_chain` WHERE `spell_id` IN (30881,30883,30884,30885,30886);
+
+INSERT INTO `spell_chain` (`spell_id`, `prev_spell`, `first_spell`, `rank`, `req_spell`) VALUES
+/*Nature's Guardian*/
+(30881,0,30881,1,0),
+(30883,30881,30881,2,0),
+(30884,30883,30881,3,0),
+(30885,30884,30881,4,0),
+(30886,30885,30881,5,0);
diff --git a/sql/updates/10036_01_mangos_spell_proc_event.sql b/sql/updates/10036_01_mangos_spell_proc_event.sql
new file mode 100644
index 000000000..626155c04
--- /dev/null
+++ b/sql/updates/10036_01_mangos_spell_proc_event.sql
@@ -0,0 +1,5 @@
+ALTER TABLE db_version CHANGE COLUMN required_10036_01_mangos_spell_chain required_10036_01_mangos_spell_proc_event bit;
+
+DELETE FROM `spell_proc_event` WHERE `entry` IN (30881,30883,30884,30885,30886);
+INSERT INTO `spell_proc_event` VALUES
+(30881, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 30);
diff --git a/sql/updates/10044_01_mangos_spell_chain.sql b/sql/updates/10044_01_mangos_spell_chain.sql
new file mode 100644
index 000000000..e860b745d
--- /dev/null
+++ b/sql/updates/10044_01_mangos_spell_chain.sql
@@ -0,0 +1,25 @@
+ALTER TABLE db_version CHANGE COLUMN required_10036_01_mangos_spell_proc_event required_10044_01_mangos_spell_chain bit;
+
+DELETE FROM `spell_chain` WHERE `spell_id` IN (
+ 62908, 62905, 50371, 50365, 63506, 63505, 63504,
+ 31785, 33776, 53427, 53429, 53430, 63351, 63350,
+ 63349, 63411, 63410, 63372, 63370, 63374, 63373,
+ 63123, 63121, 63117, 63158, 63156, 62762, 62758,
+ 62765, 62764, 62760, 62759, 63650, 63649, 63648,
+ 63647, 63646, 63627, 63626, 63625, 48985, 49488,
+ 49489, 49015, 50154, 55136, 63737, 63733, 63730,
+ 63543, 63542, 50880, 50884, 50885, 50886, 50887,
+ 49175, 50031, 51456, 63534, 64129, 64127, 64357,
+ 64353, 49013, 55236, 55237, 50384, 50385, 50391,
+ 50392, 49224, 49610, 49611, 47535, 47536, 47537,
+ 49188, 53530, 53527, 31245, 31244, 55667, 55666,
+ 32385, 32387, 32392, 32393, 32394, 51528, 51529,
+ 51530, 51531, 51532, 47569, 47570, 65661, 66191,
+ 66192, 20335, 20336, 20337, 56636, 56637, 56638,
+ 34506, 34507, 34508, 34838, 34839, 53290, 53291,
+ 53292, 46913, 46914, 46915, 19184, 19387, 19388,
+ 35100, 35102, 51521, 51522, 48539, 48544, 48545,
+ 53380, 53381, 53382, 53486, 53488, 56822, 59057,
+ 53709, 53710, 53711, 30881, 30883, 30884, 30885,
+ 30886
+);
diff --git a/sql/updates/10044_02_mangos_spell_proc_event.sql b/sql/updates/10044_02_mangos_spell_proc_event.sql
new file mode 100644
index 000000000..03370f87c
--- /dev/null
+++ b/sql/updates/10044_02_mangos_spell_proc_event.sql
@@ -0,0 +1,38 @@
+ALTER TABLE db_version CHANGE COLUMN required_10044_01_mangos_spell_chain required_10044_02_mangos_spell_proc_event bit;
+
+DELETE FROM `spell_proc_event` WHERE `entry` IN (
+ 11120, 12487, 12488, 12598, 12668, 12724, 12725,
+ 12726, 12727, 12799, 12812, 12813, 12814, 12815,
+ 12846, 12847, 12848, 12849, 12867, 12872, 12873,
+ 12958, 12971, 12972, 12973, 12974, 13045, 13046,
+ 13047, 13048, 13867, 14070, 14071, 14160, 14161,
+ 14190, 14193, 14194, 14195, 14774, 15338, 15362,
+ 15363, 16196, 16198, 16235, 16240, 16281, 16282,
+ 16283, 16284, 16489, 16492, 16923, 16924, 17107,
+ 17108, 17796, 17801, 17802, 17803, 18073, 18095,
+ 18120, 19573, 20056, 20057, 20182, 20212, 20213,
+ 20214, 20215, 20235, 20501, 23695, 25988, 27815,
+ 27816, 28592, 28593, 29075, 29076, 29179, 29180,
+ 29444, 29594, 29838, 30295, 30296, 30301, 30302,
+ 30678, 30679, 31126, 31570, 31835, 31836, 31872,
+ 31877, 31878, 33145, 33146, 33154, 33192, 33193,
+ 33882, 33883, 34498, 34499, 34502, 34503, 34859,
+ 34860, 34938, 34939, 34954, 44443, 44446, 44448,
+ 44469, 44470, 44471, 44472, 44548, 44549, 45243,
+ 45244, 46855, 46952, 46953, 47196, 47197, 47202,
+ 47203, 47204, 47205, 47246, 47247, 47259, 47260,
+ 47511, 47515, 47517, 47581, 47582, 48484, 48485,
+ 48499, 48500, 48510, 48511, 48521, 48525, 49503,
+ 49504, 49529, 49530, 51127, 51128, 51129, 51130,
+ 51470, 51478, 51479, 51485, 51486, 51557, 51558,
+ 51563, 51564, 51565, 51566, 51626, 51628, 51629,
+ 51635, 51636, 51665, 51667, 51668, 51669, 51674,
+ 51679, 51696, 51700, 51701, 52797, 52798, 52799,
+ 52800, 53216, 53217, 53222, 53224, 53232, 53237,
+ 53238, 53259, 53260, 53502, 53503, 53552, 53553,
+ 53576, 53673, 54151, 54154, 54155, 54486, 54488,
+ 54489, 54490, 54749, 56343, 56344, 56611, 56612,
+ 56613, 56614, 56834, 56835, 57472, 57880, 57881,
+ 58874, 61345, 61346, 63245
+);
+
diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am
index 6da2e96e3..1b15eca02 100644
--- a/sql/updates/Makefile.am
+++ b/sql/updates/Makefile.am
@@ -25,75 +25,131 @@ pkgdatadir = $(datadir)/mangos/sql/updates
## Files to be installed
# Install basic SQL files to datadir
pkgdata_DATA = \
- 9010_01_realmd_realmlist.sql \
- 9692_01_characters_mail.sql \
- 9692_02_characters_mail.sql \
- 9692_03_mangos_spell_proc_event.sql \
- 9702_01_characters_item.sql \
- 9704_01_mangos_achievement_reward.sql \
- 9710_01_mangos_command.sql \
- 9716_01_mangos_npc_vendor.sql \
- 9716_02_mangos_mangos_string.sql \
- 9720_01_mangos_spell_proc_event.sql \
- 9728_01_mangos_gossip_menu_option.sql \
- 9735_01_mangos_spell_proc_event.sql \
- 9735_02_mangos_spell_chain.sql \
- 9746_01_realmd_realmlist.sql \
- 9747_01_mangos_battleground_template.sql \
- 9748_01_realmd_realmlist.sql \
- 9751_01_characters.sql \
- 9752_01_mangos_gameobject_template.sql \
- 9753_01_mangos_instance_template.sql \
- 9755_01_mangos_instance_template.sql \
- 9761_01_mangos_mangos_string.sql \
- 9763_01_mangos_battleground_template.sql \
- 9766_01_mangos_spell_proc_event.sql \
- 9767_01_mangos_mangos_string.sql \
- 9767_02_mangos_command.sql \
- 9767_03_characters_characters.sql \
- 9768_01_mangos_command.sql \
- 9794_01_mangos_mangos_string.sql \
- 9794_02_mangos_command.sql \
- 9803_01_mangos_spell_bonus_data.sql \
- 9826_01_mangos_spell_script_target.sql \
- 9849_01_characters_saved_variables.sql \
- 9854_01_mangos_spell_bonus_data.sql \
+ 09010_01_realmd_realmlist.sql \
+ 09692_01_characters_mail.sql \
+ 09692_02_characters_mail.sql \
+ 09692_03_mangos_spell_proc_event.sql \
+ 09702_01_characters_item.sql \
+ 09704_01_mangos_achievement_reward.sql \
+ 09710_01_mangos_command.sql \
+ 09716_01_mangos_npc_vendor.sql \
+ 09716_02_mangos_mangos_string.sql \
+ 09720_01_mangos_spell_proc_event.sql \
+ 09728_01_mangos_gossip_menu_option.sql \
+ 09735_01_mangos_spell_proc_event.sql \
+ 09735_02_mangos_spell_chain.sql \
+ 09746_01_realmd_realmlist.sql \
+ 09747_01_mangos_battleground_template.sql \
+ 09748_01_realmd_realmlist.sql \
+ 09751_01_characters.sql \
+ 09752_01_mangos_gameobject_template.sql \
+ 09753_01_mangos_instance_template.sql \
+ 09755_01_mangos_instance_template.sql \
+ 09761_01_mangos_mangos_string.sql \
+ 09763_01_mangos_battleground_template.sql \
+ 09766_01_mangos_spell_proc_event.sql \
+ 09767_01_mangos_mangos_string.sql \
+ 09767_02_mangos_command.sql \
+ 09767_03_characters_characters.sql \
+ 09768_01_mangos_command.sql \
+ 09794_01_mangos_mangos_string.sql \
+ 09794_02_mangos_command.sql \
+ 09803_01_mangos_spell_bonus_data.sql \
+ 09826_01_mangos_spell_script_target.sql \
+ 09849_01_characters_saved_variables.sql \
+ 09854_01_mangos_spell_bonus_data.sql \
+ 09881_01_mangos_scripts.sql \
+ 09883_01_mangos_scripts.sql \
+ 09886_01_mangos_mangos_string.sql \
+ 09886_02_mangos_command.sql \
+ 09891_01_mangos_creature_movement.sql \
+ 09891_02_mangos_creature_movement_scripts.sql \
+ 09899_01_mangos_spell_bonus_data.sql \
+ 09924_01_mangos_mangos_string.sql \
+ 09924_02_mangos_command.sql \
+ 09957_01_mangos_mangos_string.sql \
+ 09957_02_mangos_npc_vendor.sql \
+ 09967_01_mangos_spell_proc_event.sql \
+ 09974_01_characters_group.sql \
+ 09977_01_mangos_spell_proc_event.sql \
+ 09978_01_mangos_spell_bonus_data.sql \
+ 09988_01_mangos_spell_chain.sql \
+ 09990_01_mangos_spell_chain.sql \
+ 10007_01_characters_pet_aura.sql \
+ 10008_01_mangos_db_verison.sql \
+ 10008_01_realmd_realmd_db_version.sql \
+ 10011_01_mangos_spell_proc_event.sql \
+ 10012_01_mangos_spell_proc_event.sql \
+ 10015_01_mangos_spell_proc_event.sql \
+ 10017_01_mangos_spell_proc_event.sql \
+ 10036_01_mangos_spell_chain.sql \
+ 10036_01_mangos_spell_proc_event.sql \
+ 10044_01_mangos_spell_chain.sql \
+ 10044_02_mangos_spell_proc_event.sql \
README
## Additional files to include when running 'make dist'
# SQL update files, to upgrade database schema from older revisions
EXTRA_DIST = \
- 9010_01_realmd_realmlist.sql \
- 9692_01_characters_mail.sql \
- 9692_02_characters_mail.sql \
- 9692_03_mangos_spell_proc_event.sql \
- 9702_01_characters_item.sql \
- 9704_01_mangos_achievement_reward.sql \
- 9710_01_mangos_command.sql \
- 9716_01_mangos_npc_vendor.sql \
- 9716_02_mangos_mangos_string.sql \
- 9720_01_mangos_spell_proc_event.sql \
- 9728_01_mangos_gossip_menu_option.sql \
- 9735_01_mangos_spell_proc_event.sql \
- 9735_02_mangos_spell_chain.sql \
- 9746_01_realmd_realmlist.sql \
- 9747_01_mangos_battleground_template.sql \
- 9748_01_realmd_realmlist.sql \
- 9751_01_characters.sql \
- 9752_01_mangos_gameobject_template.sql \
- 9753_01_mangos_instance_template.sql \
- 9755_01_mangos_instance_template.sql \
- 9761_01_mangos_mangos_string.sql \
- 9763_01_mangos_battleground_template.sql \
- 9766_01_mangos_spell_proc_event.sql \
- 9767_01_mangos_mangos_string.sql \
- 9767_02_mangos_command.sql \
- 9767_03_characters_characters.sql \
- 9768_01_mangos_command.sql \
- 9794_01_mangos_mangos_string.sql \
- 9794_02_mangos_command.sql \
- 9803_01_mangos_spell_bonus_data.sql \
- 9826_01_mangos_spell_script_target.sql \
- 9849_01_characters_saved_variables.sql \
- 9854_01_mangos_spell_bonus_data.sql \
+ 09010_01_realmd_realmlist.sql \
+ 09692_01_characters_mail.sql \
+ 09692_02_characters_mail.sql \
+ 09692_03_mangos_spell_proc_event.sql \
+ 09702_01_characters_item.sql \
+ 09704_01_mangos_achievement_reward.sql \
+ 09710_01_mangos_command.sql \
+ 09716_01_mangos_npc_vendor.sql \
+ 09716_02_mangos_mangos_string.sql \
+ 09720_01_mangos_spell_proc_event.sql \
+ 09728_01_mangos_gossip_menu_option.sql \
+ 09735_01_mangos_spell_proc_event.sql \
+ 09735_02_mangos_spell_chain.sql \
+ 09746_01_realmd_realmlist.sql \
+ 09747_01_mangos_battleground_template.sql \
+ 09748_01_realmd_realmlist.sql \
+ 09751_01_characters.sql \
+ 09752_01_mangos_gameobject_template.sql \
+ 09753_01_mangos_instance_template.sql \
+ 09755_01_mangos_instance_template.sql \
+ 09761_01_mangos_mangos_string.sql \
+ 09763_01_mangos_battleground_template.sql \
+ 09766_01_mangos_spell_proc_event.sql \
+ 09767_01_mangos_mangos_string.sql \
+ 09767_02_mangos_command.sql \
+ 09767_03_characters_characters.sql \
+ 09768_01_mangos_command.sql \
+ 09794_01_mangos_mangos_string.sql \
+ 09794_02_mangos_command.sql \
+ 09803_01_mangos_spell_bonus_data.sql \
+ 09826_01_mangos_spell_script_target.sql \
+ 09849_01_characters_saved_variables.sql \
+ 09854_01_mangos_spell_bonus_data.sql \
+ 09881_01_mangos_scripts.sql \
+ 09883_01_mangos_scripts.sql \
+ 09886_01_mangos_mangos_string.sql \
+ 09886_02_mangos_command.sql \
+ 09891_01_mangos_creature_movement.sql \
+ 09891_02_mangos_creature_movement_scripts.sql \
+ 09899_01_mangos_spell_bonus_data.sql \
+ 09924_01_mangos_mangos_string.sql \
+ 09924_02_mangos_command.sql \
+ 09957_01_mangos_mangos_string.sql \
+ 09957_02_mangos_npc_vendor.sql \
+ 09967_01_mangos_spell_proc_event.sql \
+ 09974_01_characters_group.sql \
+ 09977_01_mangos_spell_proc_event.sql \
+ 09978_01_mangos_spell_bonus_data.sql \
+ 09988_01_mangos_spell_chain.sql \
+ 09990_01_mangos_spell_chain.sql \
+ 10007_01_characters_pet_aura.sql \
+ 10008_01_mangos_db_verison.sql \
+ 10008_01_realmd_realmd_db_version.sql \
+ 10011_01_mangos_spell_proc_event.sql \
+ 10012_01_mangos_spell_proc_event.sql \
+ 10015_01_mangos_spell_proc_event.sql \
+ 10017_01_mangos_spell_proc_event.sql \
+ 10036_01_mangos_spell_chain.sql \
+ 10036_01_mangos_spell_proc_event.sql \
+ 10044_01_mangos_spell_chain.sql \
+ 10044_02_mangos_spell_proc_event.sql \
README
diff --git a/sql/updates/README b/sql/updates/README
index 91f2a124b..588219e25 100644
--- a/sql/updates/README
+++ b/sql/updates/README
@@ -5,17 +5,23 @@ Copyright (c) 2005-2010 MaNGOS
See the COPYING file for copying conditions.
== Database Updates ==
+
This folder contains SQL files which will apply required updates to your MySQL
database, whenever the MaNGOS database structure has been changed or extended.
To see if you need an update, the file names have been given a fixed structure
that should enable you to see if you need an update or not.
-=== File name descriptin ===
-File names are divided into two parts. First part is the revision+counter
-that show commit revision that will be compatible with database after apply update.
-Counter set order in sql updates apply for same revision.
-The second part of the name of the database and the table that needs and update or has been added.
+=== File Name Description ===
+
+File names are divided into two parts.
+
+First part is the revision and counter that shows the commit revision that
+will be compatible with the database after apply that particular update.
+Counter sets the order to apply sql updates for the same revision.
+
+The second part of the name is the database and the table that needs an update or has been added.
+
See an example below:
6936_01_mangos_spell_chain.sql
@@ -27,18 +33,19 @@ See an example below:
| | Name of affected DB (default recommended name)
| | Can be: characters, mangos, realmd
| |
- | Counter show number of sql update in updates list for provided revision
+ | Counter show number of sql updates in updates list for provided revision
| and set proper order for sql updates for same revision
|
- MaNGOS commit revison related to sql update.
+ MaNGOS commit revision related to sql update.
It included in commit description in form [6936] as you can see at http://github.com/mangos/mangos/commits/master
-After appling this update DB compatiable with database that include this sql update.
-SQL update include special protection against multiply and wrong order SQL updates apply.
-So attempt apply sql update to more old DB without previous SQL update in list for targeted database
-or to DB with already applied this or later SQL update will generate error and not applied.
+After applying an update the DB is compatible with the mangos revision of this sql update.
+SQL updates include special protection against multiple and wrong order of update application.
-=== For commiters ====
+Attempts to apply sql updates to an older DB without previous SQL updates in list for the database
+or to DB with already applied this or later SQL update will generate an error and not be applied.
+
+=== For Commiters ====
MaNGOS sources include special tool ( contrib/git_id ) for generation revision info
in commit notes and in src/shared/revision_nr.h file. It have option '-s' that let set
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp
index 8ed0a0420..eb6ba1b2e 100644
--- a/src/game/BattleGround.cpp
+++ b/src/game/BattleGround.cpp
@@ -855,42 +855,30 @@ uint32 BattleGround::GetBattlemasterEntry() const
void BattleGround::RewardMark(Player *plr,uint32 count)
{
- BattleGroundMarks mark;
- bool IsSpell;
switch(GetTypeID())
{
case BATTLEGROUND_AV:
- IsSpell = true;
if (count == ITEM_WINNER_COUNT)
- mark = SPELL_AV_MARK_WINNER;
+ RewardSpellCast(plr,SPELL_AV_MARK_WINNER);
else
- mark = SPELL_AV_MARK_LOSER;
+ RewardSpellCast(plr,SPELL_AV_MARK_LOSER);
break;
case BATTLEGROUND_WS:
- IsSpell = true;
if (count == ITEM_WINNER_COUNT)
- mark = SPELL_WS_MARK_WINNER;
+ RewardSpellCast(plr,SPELL_WS_MARK_WINNER);
else
- mark = SPELL_WS_MARK_LOSER;
+ RewardSpellCast(plr,SPELL_WS_MARK_LOSER);
break;
case BATTLEGROUND_AB:
- IsSpell = true;
if (count == ITEM_WINNER_COUNT)
- mark = SPELL_AB_MARK_WINNER;
+ RewardSpellCast(plr,SPELL_AB_MARK_WINNER);
else
- mark = SPELL_AB_MARK_LOSER;
- break;
- case BATTLEGROUND_EY:
- IsSpell = false;
+ RewardSpellCast(plr,SPELL_AB_MARK_LOSER);
break;
+ case BATTLEGROUND_EY: // no rewards
default:
- return;
+ break;
}
-
- if (IsSpell)
- RewardSpellCast(plr,mark);
- else
- RewardItem(plr,mark,count);
}
void BattleGround::RewardSpellCast(Player *plr, uint32 spell_id)
diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h
index 3d5419a9e..32554e417 100644
--- a/src/game/BattleGround.h
+++ b/src/game/BattleGround.h
@@ -22,6 +22,7 @@
#include "Common.h"
#include "SharedDefines.h"
#include "Map.h"
+#include "ByteBuffer.h"
// magic event-numbers
#define BG_EVENT_NONE 255
@@ -407,7 +408,7 @@ class BattleGround
/* Packet Transfer */
// method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!)
- virtual void FillInitialWorldStates(WorldPacket& /*data*/) {}
+ virtual void FillInitialWorldStates(WorldPacket& /*data*/, uint32& /*count*/) {}
void SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *sender = NULL, bool self = true);
void SendPacketToAll(WorldPacket *packet);
@@ -624,4 +625,43 @@ class BattleGround
float m_TeamStartLocZ[BG_TEAMS_COUNT];
float m_TeamStartLocO[BG_TEAMS_COUNT];
};
+
+// helper functions for world state list fill
+inline void FillInitialWorldState(ByteBuffer& data, uint32& count, uint32 state, uint32 value)
+{
+ data << uint32(state);
+ data << uint32(value);
+ ++count;
+}
+
+inline void FillInitialWorldState(ByteBuffer& data, uint32& count, uint32 state, int32 value)
+{
+ data << uint32(state);
+ data << int32(value);
+ ++count;
+}
+
+inline void FillInitialWorldState(ByteBuffer& data, uint32& count, uint32 state, bool value)
+{
+ data << uint32(state);
+ data << uint32(value?1:0);
+ ++count;
+}
+
+struct WorldStatePair
+{
+ uint32 state;
+ uint32 value;
+};
+
+inline void FillInitialWorldState(ByteBuffer& data, uint32& count, WorldStatePair const* array)
+{
+ for(WorldStatePair const* itr = array; itr->state; ++itr)
+ {
+ data << uint32(itr->state);
+ data << uint32(itr->value);
+ ++count;
+ }
+}
+
#endif
diff --git a/src/game/BattleGroundAB.cpp b/src/game/BattleGroundAB.cpp
index 7f19148ef..58934ec7e 100644
--- a/src/game/BattleGroundAB.cpp
+++ b/src/game/BattleGroundAB.cpp
@@ -257,18 +257,18 @@ int32 BattleGroundAB::_GetNodeNameId(uint8 node)
return 0;
}
-void BattleGroundAB::FillInitialWorldStates(WorldPacket& data)
+void BattleGroundAB::FillInitialWorldStates(WorldPacket& data, uint32& count)
{
const uint8 plusArray[] = {0, 2, 3, 0, 1};
// Node icons
for (uint8 node = 0; node < BG_AB_NODES_MAX; ++node)
- data << uint32(BG_AB_OP_NODEICONS[node]) << uint32((m_Nodes[node]==0)?1:0);
+ FillInitialWorldState(data, count, BG_AB_OP_NODEICONS[node], m_Nodes[node]==0);
// Node occupied states
for (uint8 node = 0; node < BG_AB_NODES_MAX; ++node)
for (uint8 i = 1; i < BG_AB_NODES_MAX; ++i)
- data << uint32(BG_AB_OP_NODESTATES[node] + plusArray[i]) << uint32((m_Nodes[node]==i)?1:0);
+ FillInitialWorldState(data, count, BG_AB_OP_NODESTATES[node] + plusArray[i], m_Nodes[node]==i);
// How many bases each team owns
uint8 ally = 0, horde = 0;
@@ -278,17 +278,17 @@ void BattleGroundAB::FillInitialWorldStates(WorldPacket& data)
else if (m_Nodes[node] == BG_AB_NODE_STATUS_HORDE_OCCUPIED)
++horde;
- data << uint32(BG_AB_OP_OCCUPIED_BASES_ALLY) << uint32(ally);
- data << uint32(BG_AB_OP_OCCUPIED_BASES_HORDE) << uint32(horde);
+ FillInitialWorldState(data, count, BG_AB_OP_OCCUPIED_BASES_ALLY, ally);
+ FillInitialWorldState(data, count, BG_AB_OP_OCCUPIED_BASES_HORDE, horde);
// Team scores
- data << uint32(BG_AB_OP_RESOURCES_MAX) << uint32(BG_AB_MAX_TEAM_SCORE);
- data << uint32(BG_AB_OP_RESOURCES_WARNING) << uint32(BG_AB_WARNING_NEAR_VICTORY_SCORE);
- data << uint32(BG_AB_OP_RESOURCES_ALLY) << uint32(m_TeamScores[BG_TEAM_ALLIANCE]);
- data << uint32(BG_AB_OP_RESOURCES_HORDE) << uint32(m_TeamScores[BG_TEAM_HORDE]);
+ FillInitialWorldState(data, count, BG_AB_OP_RESOURCES_MAX, BG_AB_MAX_TEAM_SCORE);
+ FillInitialWorldState(data, count, BG_AB_OP_RESOURCES_WARNING, BG_AB_WARNING_NEAR_VICTORY_SCORE);
+ FillInitialWorldState(data, count, BG_AB_OP_RESOURCES_ALLY, m_TeamScores[BG_TEAM_ALLIANCE]);
+ FillInitialWorldState(data, count, BG_AB_OP_RESOURCES_HORDE, m_TeamScores[BG_TEAM_HORDE]);
// other unknown
- data << uint32(0x745) << uint32(0x2); // 37 1861 unk
+ FillInitialWorldState(data, count, 0x745, 0x2); // 37 1861 unk
}
void BattleGroundAB::_SendNodeUpdate(uint8 node)
diff --git a/src/game/BattleGroundAB.h b/src/game/BattleGroundAB.h
index d41526c68..63b1f7ec3 100644
--- a/src/game/BattleGroundAB.h
+++ b/src/game/BattleGroundAB.h
@@ -193,7 +193,7 @@ class BattleGroundAB : public BattleGround
/* Scorekeeping */
virtual void UpdatePlayerScore(Player *Source, uint32 type, uint32 value);
- virtual void FillInitialWorldStates(WorldPacket& data);
+ virtual void FillInitialWorldStates(WorldPacket& data, uint32& count);
/* Nodes occupying */
virtual void EventPlayerClickedOnFlag(Player *source, GameObject* target_obj);
diff --git a/src/game/BattleGroundAV.cpp b/src/game/BattleGroundAV.cpp
index 8f45038f6..166ae8111 100644
--- a/src/game/BattleGroundAV.cpp
+++ b/src/game/BattleGroundAV.cpp
@@ -608,7 +608,7 @@ void BattleGroundAV::EventPlayerAssaultsPoint(Player* player, BG_AV_Nodes node)
PlaySoundToAll((team == BG_TEAM_ALLIANCE) ? BG_AV_SOUND_ALLIANCE_ASSAULTS : BG_AV_SOUND_HORDE_ASSAULTS);
}
-void BattleGroundAV::FillInitialWorldStates(WorldPacket& data)
+void BattleGroundAV::FillInitialWorldStates(WorldPacket& data, uint32& count)
{
bool stateok;
for (uint32 i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
@@ -616,28 +616,36 @@ void BattleGroundAV::FillInitialWorldStates(WorldPacket& data)
for (uint8 j = 0; j < BG_AV_MAX_STATES; j++)
{
stateok = (m_Nodes[i].State == j);
- data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j, BG_TEAM_ALLIANCE)]) << uint32((m_Nodes[i].Owner == BG_TEAM_ALLIANCE && stateok) ? 1 : 0);
- data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j, BG_TEAM_HORDE)]) << uint32((m_Nodes[i].Owner == BG_TEAM_HORDE && stateok) ? 1 : 0);
+ FillInitialWorldState(data, count, BG_AV_NodeWorldStates[i][GetWorldStateType(j, BG_TEAM_ALLIANCE)],
+ m_Nodes[i].Owner == BG_TEAM_ALLIANCE && stateok);
+ FillInitialWorldState(data, count, BG_AV_NodeWorldStates[i][GetWorldStateType(j, BG_TEAM_HORDE)],
+ m_Nodes[i].Owner == BG_TEAM_HORDE && stateok);
}
}
if( m_Nodes[BG_AV_NODES_SNOWFALL_GRAVE].Owner == BG_AV_NEUTRAL_TEAM ) // cause neutral teams aren't handled generic
- data << uint32(AV_SNOWFALL_N) << uint32(1);
+ FillInitialWorldState(data, count, AV_SNOWFALL_N, 1);
- data << uint32(BG_AV_Alliance_Score) << uint32(m_TeamScores[BG_TEAM_ALLIANCE]);
- data << uint32(BG_AV_Horde_Score) << uint32(m_TeamScores[BG_TEAM_HORDE]);
+ FillInitialWorldState(data, count, BG_AV_Alliance_Score, m_TeamScores[BG_TEAM_ALLIANCE]);
+ FillInitialWorldState(data, count, BG_AV_Horde_Score, m_TeamScores[BG_TEAM_HORDE]);
if( GetStatus() == STATUS_IN_PROGRESS ) // only if game is running the teamscores are displayed
{
- data << uint32(BG_AV_SHOW_A_SCORE) << uint32(1);
- data << uint32(BG_AV_SHOW_H_SCORE) << uint32(1);
+ FillInitialWorldState(data, count, BG_AV_SHOW_A_SCORE, 1);
+ FillInitialWorldState(data, count, BG_AV_SHOW_H_SCORE, 1);
}
else
{
- data << uint32(BG_AV_SHOW_A_SCORE) << uint32(0);
- data << uint32(BG_AV_SHOW_H_SCORE) << uint32(0);
+ FillInitialWorldState(data, count, BG_AV_SHOW_A_SCORE, 0);
+ FillInitialWorldState(data, count, BG_AV_SHOW_H_SCORE, 0);
}
- SendMineWorldStates(BG_AV_NORTH_MINE);
- SendMineWorldStates(BG_AV_SOUTH_MINE);
+
+ FillInitialWorldState(data, count, BG_AV_MineWorldStates[BG_AV_NORTH_MINE][m_Mine_Owner[BG_AV_NORTH_MINE]], 1);
+ if (m_Mine_Owner[BG_AV_NORTH_MINE] != m_Mine_PrevOwner[BG_AV_NORTH_MINE])
+ FillInitialWorldState(data, count, BG_AV_MineWorldStates[BG_AV_NORTH_MINE][m_Mine_PrevOwner[BG_AV_NORTH_MINE]], 0);
+
+ FillInitialWorldState(data, count, BG_AV_MineWorldStates[BG_AV_SOUTH_MINE][m_Mine_Owner[BG_AV_SOUTH_MINE]], 1);
+ if (m_Mine_Owner[BG_AV_SOUTH_MINE] != m_Mine_PrevOwner[BG_AV_SOUTH_MINE])
+ FillInitialWorldState(data, count, BG_AV_MineWorldStates[BG_AV_SOUTH_MINE][m_Mine_PrevOwner[BG_AV_SOUTH_MINE]], 0);
}
void BattleGroundAV::UpdateNodeWorldState(BG_AV_Nodes node)
diff --git a/src/game/BattleGroundAV.h b/src/game/BattleGroundAV.h
index 7d55bec1a..863062d38 100644
--- a/src/game/BattleGroundAV.h
+++ b/src/game/BattleGroundAV.h
@@ -312,7 +312,7 @@ class BattleGroundAV : public BattleGround
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
// world states
- virtual void FillInitialWorldStates(WorldPacket& data);
+ virtual void FillInitialWorldStates(WorldPacket& data, uint32& count);
void RemovePlayer(Player *plr,uint64 guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
diff --git a/src/game/BattleGroundBE.cpp b/src/game/BattleGroundBE.cpp
index 20538aac8..435109960 100644
--- a/src/game/BattleGroundBE.cpp
+++ b/src/game/BattleGroundBE.cpp
@@ -135,11 +135,11 @@ void BattleGroundBE::HandleAreaTrigger(Player *Source, uint32 Trigger)
// HandleTriggerBuff(buff_guid,Source);
}
-void BattleGroundBE::FillInitialWorldStates(WorldPacket &data)
+void BattleGroundBE::FillInitialWorldStates(WorldPacket &data, uint32& count)
{
- data << uint32(0x9f1) << uint32(GetAlivePlayersCountByTeam(ALLIANCE)); // 7
- data << uint32(0x9f0) << uint32(GetAlivePlayersCountByTeam(HORDE)); // 8
- data << uint32(0x9f3) << uint32(1); // 9
+ FillInitialWorldState(data, count, 0x9f1, GetAlivePlayersCountByTeam(ALLIANCE));
+ FillInitialWorldState(data, count, 0x9f0, GetAlivePlayersCountByTeam(HORDE));
+ FillInitialWorldState(data, count, 0x9f3, 1);
}
void BattleGroundBE::Reset()
diff --git a/src/game/BattleGroundBE.h b/src/game/BattleGroundBE.h
index d58870062..8b2cc33df 100644
--- a/src/game/BattleGroundBE.h
+++ b/src/game/BattleGroundBE.h
@@ -45,7 +45,7 @@ class BattleGroundBE : public BattleGround
void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround();
virtual void Reset();
- virtual void FillInitialWorldStates(WorldPacket &d);
+ virtual void FillInitialWorldStates(WorldPacket &d, uint32& count);
void HandleKillPlayer(Player* player, Player *killer);
bool HandlePlayerUnderMap(Player * plr);
diff --git a/src/game/BattleGroundEY.cpp b/src/game/BattleGroundEY.cpp
index 3651d3f53..ea8e46677 100644
--- a/src/game/BattleGroundEY.cpp
+++ b/src/game/BattleGroundEY.cpp
@@ -33,10 +33,10 @@ BattleGroundEY::BattleGroundEY()
m_BuffChange = true;
m_BgObjects.resize(BG_EY_OBJECT_MAX);
- m_Points_Trigger[FEL_REALVER] = TR_FEL_REALVER_BUFF;
- m_Points_Trigger[BLOOD_ELF] = TR_BLOOD_ELF_BUFF;
- m_Points_Trigger[DRAENEI_RUINS] = TR_DRAENEI_RUINS_BUFF;
- m_Points_Trigger[MAGE_TOWER] = TR_MAGE_TOWER_BUFF;
+ m_Points_Trigger[BG_EY_NODE_FEL_REAVER] = TR_FEL_REAVER_BUFF;
+ m_Points_Trigger[BG_EY_NODE_BLOOD_ELF] = TR_BLOOD_ELF_BUFF;
+ m_Points_Trigger[BG_EY_NODE_DRAENEI_RUINS] = TR_DRAENEI_RUINS_BUFF;
+ m_Points_Trigger[BG_EY_NODE_MAGE_TOWER] = TR_MAGE_TOWER_BUFF;
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_EY_START_ONE_MINUTE;
@@ -107,7 +107,7 @@ void BattleGroundEY::StartingEventOpenDoors()
{
//randomly spawn buff
uint8 buff = urand(0, 2);
- SpawnBGObject(m_BgObjects[BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + buff + i * 3], RESPAWN_IMMEDIATELY);
+ SpawnBGObject(m_BgObjects[BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + buff + i * 3], RESPAWN_IMMEDIATELY);
}
}
@@ -129,12 +129,12 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
for (uint8 i = 0; i < BG_EY_NODES_MAX; ++i)
{
uint8 j = 0;
- while (j < m_PlayersNearPoint[BG_EY_NODES_MAX].size())
+ while (j < m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].size())
{
- Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[BG_EY_NODES_MAX][j]);
+ Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j]);
if (!plr)
{
- sLog.outError("BattleGroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[BG_EY_NODES_MAX][j]));
+ sLog.outError("BattleGroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j]));
++j;
continue;
}
@@ -147,9 +147,9 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[i], plr);
UpdateWorldStateForPlayer(PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_SHOW, plr);
//add player to point
- m_PlayersNearPoint[i].push_back(m_PlayersNearPoint[BG_EY_NODES_MAX][j]);
+ m_PlayersNearPoint[i].push_back(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j]);
//remove player from "free space"
- m_PlayersNearPoint[BG_EY_NODES_MAX].erase(m_PlayersNearPoint[BG_EY_NODES_MAX].begin() + j);
+ m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].erase(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].begin() + j);
}
else
++j;
@@ -172,7 +172,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
{
sLog.outError("BattleGroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
//move not existed player to "free space" - this will cause many error showing in log, but it is a very important bug
- m_PlayersNearPoint[BG_EY_NODES_MAX].push_back(m_PlayersNearPoint[i][j]);
+ m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(m_PlayersNearPoint[i][j]);
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
++j;
continue;
@@ -181,7 +181,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
!plr->IsWithinDist3d(BG_EY_NodePositions[i][0], BG_EY_NodePositions[i][1], BG_EY_NodePositions[i][2], BG_EY_POINT_RADIUS))
//move player out of point (add him to players that are out of points
{
- m_PlayersNearPoint[BG_EY_NODES_MAX].push_back(m_PlayersNearPoint[i][j]);
+ m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(m_PlayersNearPoint[i][j]);
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
UpdateWorldStateForPlayer(PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_DONT_SHOW, plr);
}
@@ -307,7 +307,7 @@ void BattleGroundEY::AddPlayer(Player *plr)
//create score and add it to map
BattleGroundEYScore* sc = new BattleGroundEYScore;
- m_PlayersNearPoint[BG_EY_NODES_MAX].push_back(plr->GetGUID());
+ m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(plr->GetGUID());
m_PlayerScores[plr->GetGUID()] = sc;
}
@@ -347,22 +347,22 @@ void BattleGroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
switch(Trigger)
{
case TR_BLOOD_ELF_POINT:
- if (m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BLOOD_ELF] == Source->GetTeam())
+ if (m_PointState[BG_EY_NODE_BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_BLOOD_ELF] == Source->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source, BG_EY_NODE_BLOOD_ELF);
break;
- case TR_FEL_REALVER_POINT:
- if (m_PointState[FEL_REALVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[FEL_REALVER] == Source->GetTeam())
+ case TR_FEL_REAVER_POINT:
+ if (m_PointState[BG_EY_NODE_FEL_REAVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_FEL_REAVER] == Source->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
- EventPlayerCapturedFlag(Source, BG_EY_NODE_FEL_REALVER);
+ EventPlayerCapturedFlag(Source, BG_EY_NODE_FEL_REAVER);
break;
case TR_MAGE_TOWER_POINT:
- if (m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[MAGE_TOWER] == Source->GetTeam())
+ if (m_PointState[BG_EY_NODE_MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_MAGE_TOWER] == Source->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source, BG_EY_NODE_MAGE_TOWER);
break;
case TR_DRAENEI_RUINS_POINT:
- if (m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[DRAENEI_RUINS] == Source->GetTeam())
+ if (m_PointState[BG_EY_NODE_DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_DRAENEI_RUINS] == Source->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
EventPlayerCapturedFlag(Source, BG_EY_NODE_DRAENEI_RUINS);
break;
@@ -376,6 +376,7 @@ void BattleGroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
case 4569:
case 4570:
case 4571:
+ case 5866:
break;
default:
sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
@@ -395,9 +396,9 @@ bool BattleGroundEY::SetupBattleGround()
sLog.outError("BattleGroundEY: Unknown trigger: %u", m_Points_Trigger[i]);
continue;
}
- if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + i * 3, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
- || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + i * 3 + 1, Buff_Entries[1], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
- || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
+ if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
+ || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
+ || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
)
sLog.outError("BattleGroundEY: Cannot spawn buff");
}
@@ -436,8 +437,8 @@ void BattleGroundEY::Reset()
// the flag in the middle is spawned at beginning
m_ActiveEvents[BG_EY_EVENT_CAPTURE_FLAG] = BG_EY_EVENT2_FLAG_CENTER;
- m_PlayersNearPoint[EY_PLAYERS_OUT_OF_POINTS].clear();
- m_PlayersNearPoint[EY_PLAYERS_OUT_OF_POINTS].reserve(30);
+ m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].clear();
+ m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].reserve(30);
}
void BattleGroundEY::RespawnFlag(bool send_message)
@@ -660,54 +661,41 @@ void BattleGroundEY::UpdatePlayerScore(Player *Source, uint32 type, uint32 value
}
}
-void BattleGroundEY::FillInitialWorldStates(WorldPacket& data)
+void BattleGroundEY::FillInitialWorldStates(WorldPacket& data, uint32& count)
{
- data << uint32(EY_HORDE_BASE) << uint32(m_TeamPointsCount[BG_TEAM_HORDE]);
- data << uint32(EY_ALLIANCE_BASE) << uint32(m_TeamPointsCount[BG_TEAM_ALLIANCE]);
- data << uint32(0xab6) << uint32(0x0);
- data << uint32(0xab5) << uint32(0x0);
- data << uint32(0xab4) << uint32(0x0);
- data << uint32(0xab3) << uint32(0x0);
- data << uint32(0xab2) << uint32(0x0);
- data << uint32(0xab1) << uint32(0x0);
- data << uint32(0xab0) << uint32(0x0);
- data << uint32(0xaaf) << uint32(0x0);
+ FillInitialWorldState(data, count, EY_HORDE_BASE, m_TeamPointsCount[BG_TEAM_HORDE]);
+ FillInitialWorldState(data, count, EY_ALLIANCE_BASE, m_TeamPointsCount[BG_TEAM_ALLIANCE]);
+ FillInitialWorldState(data, count, 0xab6, 0x0);
+ FillInitialWorldState(data, count, 0xab5, 0x0);
+ FillInitialWorldState(data, count, 0xab4, 0x0);
+ FillInitialWorldState(data, count, 0xab3, 0x0);
+ FillInitialWorldState(data, count, 0xab2, 0x0);
+ FillInitialWorldState(data, count, 0xab1, 0x0);
+ FillInitialWorldState(data, count, 0xab0, 0x0);
+ FillInitialWorldState(data, count, 0xaaf, 0x0);
- data << uint32(DRAENEI_RUINS_HORDE_CONTROL) << uint32(m_PointOwnedByTeam[DRAENEI_RUINS] == HORDE && m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL);
-
- data << uint32(DRAENEI_RUINS_ALLIANCE_CONTROL) << uint32(m_PointOwnedByTeam[DRAENEI_RUINS] == ALLIANCE && m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL);
-
- data << uint32(DRAENEI_RUINS_UNCONTROL) << uint32(m_PointState[DRAENEI_RUINS] != EY_POINT_UNDER_CONTROL);
-
- data << uint32(MAGE_TOWER_ALLIANCE_CONTROL) << uint32(m_PointOwnedByTeam[MAGE_TOWER] == ALLIANCE && m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL);
-
- data << uint32(MAGE_TOWER_HORDE_CONTROL) << uint32(m_PointOwnedByTeam[MAGE_TOWER] == HORDE && m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL);
-
- data << uint32(MAGE_TOWER_UNCONTROL) << uint32(m_PointState[MAGE_TOWER] != EY_POINT_UNDER_CONTROL);
-
- data << uint32(FEL_REAVER_HORDE_CONTROL) << uint32(m_PointOwnedByTeam[FEL_REALVER] == HORDE && m_PointState[FEL_REALVER] == EY_POINT_UNDER_CONTROL);
-
- data << uint32(FEL_REAVER_ALLIANCE_CONTROL) << uint32(m_PointOwnedByTeam[FEL_REALVER] == ALLIANCE && m_PointState[FEL_REALVER] == EY_POINT_UNDER_CONTROL);
-
- data << uint32(FEL_REAVER_UNCONTROL) << uint32(m_PointState[FEL_REALVER] != EY_POINT_UNDER_CONTROL);
-
- data << uint32(BLOOD_ELF_HORDE_CONTROL) << uint32(m_PointOwnedByTeam[BLOOD_ELF] == HORDE && m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL);
-
- data << uint32(BLOOD_ELF_ALLIANCE_CONTROL) << uint32(m_PointOwnedByTeam[BLOOD_ELF] == ALLIANCE && m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL);
-
- data << uint32(BLOOD_ELF_UNCONTROL) << uint32(m_PointState[BLOOD_ELF] != EY_POINT_UNDER_CONTROL);
-
- data << uint32(NETHERSTORM_FLAG) << uint32(m_FlagState == BG_EY_FLAG_STATE_ON_BASE);
-
- data << uint32(0xad2) << uint32(0x1);
- data << uint32(0xad1) << uint32(0x1);
- data << uint32(0xabe) << uint32(GetTeamScore(HORDE));
- data << uint32(0xabd) << uint32(GetTeamScore(ALLIANCE));
- data << uint32(0xa05) << uint32(0x8e);
- data << uint32(0xaa0) << uint32(0x0);
- data << uint32(0xa9f) << uint32(0x0);
- data << uint32(0xa9e) << uint32(0x0);
- data << uint32(0xc0d) << uint32(0x17b);
+ FillInitialWorldState(data, count, DRAENEI_RUINS_HORDE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_DRAENEI_RUINS] == HORDE && m_PointState[BG_EY_NODE_DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL);
+ FillInitialWorldState(data, count, DRAENEI_RUINS_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_DRAENEI_RUINS] == ALLIANCE && m_PointState[BG_EY_NODE_DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL);
+ FillInitialWorldState(data, count, DRAENEI_RUINS_UNCONTROL, m_PointState[BG_EY_NODE_DRAENEI_RUINS] != EY_POINT_UNDER_CONTROL);
+ FillInitialWorldState(data, count, MAGE_TOWER_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_MAGE_TOWER] == ALLIANCE && m_PointState[BG_EY_NODE_MAGE_TOWER] == EY_POINT_UNDER_CONTROL);
+ FillInitialWorldState(data, count, MAGE_TOWER_HORDE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_MAGE_TOWER] == HORDE && m_PointState[BG_EY_NODE_MAGE_TOWER] == EY_POINT_UNDER_CONTROL);
+ FillInitialWorldState(data, count, MAGE_TOWER_UNCONTROL, m_PointState[BG_EY_NODE_MAGE_TOWER] != EY_POINT_UNDER_CONTROL);
+ FillInitialWorldState(data, count, FEL_REAVER_HORDE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_FEL_REAVER] == HORDE && m_PointState[BG_EY_NODE_FEL_REAVER] == EY_POINT_UNDER_CONTROL);
+ FillInitialWorldState(data, count, FEL_REAVER_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_FEL_REAVER] == ALLIANCE && m_PointState[BG_EY_NODE_FEL_REAVER] == EY_POINT_UNDER_CONTROL);
+ FillInitialWorldState(data, count, FEL_REAVER_UNCONTROL, m_PointState[BG_EY_NODE_FEL_REAVER] != EY_POINT_UNDER_CONTROL);
+ FillInitialWorldState(data, count, BLOOD_ELF_HORDE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_BLOOD_ELF] == HORDE && m_PointState[BG_EY_NODE_BLOOD_ELF] == EY_POINT_UNDER_CONTROL);
+ FillInitialWorldState(data, count, BLOOD_ELF_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_BLOOD_ELF] == ALLIANCE && m_PointState[BG_EY_NODE_BLOOD_ELF] == EY_POINT_UNDER_CONTROL);
+ FillInitialWorldState(data, count, BLOOD_ELF_UNCONTROL, m_PointState[BG_EY_NODE_BLOOD_ELF] != EY_POINT_UNDER_CONTROL);
+ FillInitialWorldState(data, count, NETHERSTORM_FLAG, m_FlagState == BG_EY_FLAG_STATE_ON_BASE);
+ FillInitialWorldState(data, count, 0xad2, 0x1);
+ FillInitialWorldState(data, count, 0xad1, 0x1);
+ FillInitialWorldState(data, count, 0xabe, GetTeamScore(HORDE));
+ FillInitialWorldState(data, count, 0xabd, GetTeamScore(ALLIANCE));
+ FillInitialWorldState(data, count, 0xa05, 0x8e);
+ FillInitialWorldState(data, count, 0xaa0, 0x0);
+ FillInitialWorldState(data, count, 0xa9f, 0x0);
+ FillInitialWorldState(data, count, 0xa9e, 0x0);
+ FillInitialWorldState(data, count, 0xc0d, 0x17b);
}
WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(Player* player)
@@ -766,10 +754,9 @@ WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(Player* player)
bool BattleGroundEY::IsAllNodesConrolledByTeam(uint32 team) const
{
- uint32 count = 0;
for(int i = 0; i < BG_EY_NODES_MAX; ++i)
- if (m_PointOwnedByTeam[i] == team && m_PointState[i] == EY_POINT_UNDER_CONTROL)
- ++count;
+ if (m_PointState[i] != EY_POINT_UNDER_CONTROL || m_PointOwnedByTeam[i] != team)
+ return false;
- return count == BG_EY_NODES_MAX;
+ return true;
}
diff --git a/src/game/BattleGroundEY.h b/src/game/BattleGroundEY.h
index 1887a73b3..bfd17a53f 100644
--- a/src/game/BattleGroundEY.h
+++ b/src/game/BattleGroundEY.h
@@ -86,11 +86,11 @@ enum BG_EY_Spells
enum EYBattleGroundPointsTrigger
{
TR_BLOOD_ELF_POINT = 4476,
- TR_FEL_REALVER_POINT = 4514,
+ TR_FEL_REAVER_POINT = 4514,
TR_MAGE_TOWER_POINT = 4516,
TR_DRAENEI_RUINS_POINT = 4518,
TR_BLOOD_ELF_BUFF = 4568,
- TR_FEL_REALVER_BUFF = 4569,
+ TR_FEL_REAVER_BUFF = 4569,
TR_MAGE_TOWER_BUFF = 4570,
TR_DRAENEI_RUINS_BUFF = 4571
};
@@ -99,54 +99,47 @@ enum EYBattleGroundGaveyards
{
EY_GRAVEYARD_MAIN_ALLIANCE = 1103,
EY_GRAVEYARD_MAIN_HORDE = 1104,
- EY_GRAVEYARD_FEL_REALVER = 1105,
+ EY_GRAVEYARD_FEL_REAVER = 1105,
EY_GRAVEYARD_BLOOD_ELF = 1106,
EY_GRAVEYARD_DRAENEI_RUINS = 1107,
EY_GRAVEYARD_MAGE_TOWER = 1108
};
-// deprecated
-enum EYBattleGroundPoints
-{
- FEL_REALVER = 0,
- BLOOD_ELF = 1,
- DRAENEI_RUINS = 2,
- MAGE_TOWER = 3,
-
- EY_PLAYERS_OUT_OF_POINTS = 4,
-};
-
enum BG_EY_Nodes
{
- BG_EY_NODE_FEL_REALVER = 0,
- BG_EY_NODE_BLOOD_ELF = 1,
- BG_EY_NODE_DRAENEI_RUINS = 2,
- BG_EY_NODE_MAGE_TOWER = 3,
- BG_EY_NODES_ERROR = 255
+ BG_EY_NODE_FEL_REAVER = 0,
+ BG_EY_NODE_BLOOD_ELF = 1,
+ BG_EY_NODE_DRAENEI_RUINS = 2,
+ BG_EY_NODE_MAGE_TOWER = 3,
+
+ // special internal node
+ BG_EY_PLAYERS_OUT_OF_POINTS = 4, // used for store out of node players data
};
-#define BG_EY_NODES_MAX 4
+
+#define BG_EY_NODES_MAX 4
+#define BG_EY_NODES_MAX_WITH_SPEIAL 5
// node-events work like this: event1:nodeid, event2:state (0alliance,1horde,2neutral)
#define BG_EYE_NEUTRAL_TEAM 2
-#define BG_EY_EVENT_CAPTURE_FLAG 4 // event1=4, event2=nodeid or 4 for the default center spawn
- #define BG_EY_EVENT2_FLAG_CENTER 4 // maximum node is 3 so 4 for center is ok
- // all other event2 are just nodeids, i won't define something here
+#define BG_EY_EVENT_CAPTURE_FLAG 4 // event1=4, event2=nodeid or 4 for the default center spawn
+#define BG_EY_EVENT2_FLAG_CENTER 4 // maximum node is 3 so 4 for center is ok
+// all other event2 are just nodeids, i won't define something here
// x, y, z
// used to check, when player is in range of a node
-const float BG_EY_NodePositions[BG_EY_NODES_MAX][4] = {
- {2024.600708f, 1742.819580f, 1195.157715f}, // FEL_REALVER
- {2050.493164f, 1372.235962f, 1194.563477f}, // BLOOD_ELF
- {2301.010498f, 1386.931641f, 1197.183472f}, // DRAENEI_RUINS
- {2282.121582f, 1760.006958f, 1189.707153f} // MAGE_TOWER
+const float BG_EY_NodePositions[BG_EY_NODES_MAX][3] = {
+ {2024.600708f, 1742.819580f, 1195.157715f}, // BG_EY_NODE_FEL_REAVER
+ {2050.493164f, 1372.235962f, 1194.563477f}, // BG_EY_NODE_BLOOD_ELF
+ {2301.010498f, 1386.931641f, 1197.183472f}, // BG_EY_NODE_DRAENEI_RUINS
+ {2282.121582f, 1760.006958f, 1189.707153f} // BG_EY_NODE_MAGE_TOWER
};
enum EYBattleGroundObjectTypes
{
//buffs
- BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER = 1,
- BG_EY_OBJECT_REGENBUFF_FEL_REALVER = 2,
- BG_EY_OBJECT_BERSERKBUFF_FEL_REALVER = 3,
+ BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER = 1,
+ BG_EY_OBJECT_REGENBUFF_FEL_REAVER = 2,
+ BG_EY_OBJECT_BERSERKBUFF_FEL_REAVER = 3,
BG_EY_OBJECT_SPEEDBUFF_BLOOD_ELF = 4,
BG_EY_OBJECT_REGENBUFF_BLOOD_ELF = 5,
BG_EY_OBJECT_BERSERKBUFF_BLOOD_ELF = 6,
@@ -232,7 +225,7 @@ const BattleGroundEYLoosingPointStruct LoosingPointTypes[BG_EY_NODES_MAX] =
};
const BattleGroundEYCapturingPointStruct CapturingPointTypes[BG_EY_NODES_MAX] =
{
- BattleGroundEYCapturingPointStruct(LANG_BG_EY_HAS_TAKEN_A_F_RUINS, LANG_BG_EY_HAS_TAKEN_H_F_RUINS, EY_GRAVEYARD_FEL_REALVER),
+ BattleGroundEYCapturingPointStruct(LANG_BG_EY_HAS_TAKEN_A_F_RUINS, LANG_BG_EY_HAS_TAKEN_H_F_RUINS, EY_GRAVEYARD_FEL_REAVER),
BattleGroundEYCapturingPointStruct(LANG_BG_EY_HAS_TAKEN_A_B_TOWER, LANG_BG_EY_HAS_TAKEN_H_B_TOWER, EY_GRAVEYARD_BLOOD_ELF),
BattleGroundEYCapturingPointStruct(LANG_BG_EY_HAS_TAKEN_A_D_RUINS, LANG_BG_EY_HAS_TAKEN_H_D_RUINS, EY_GRAVEYARD_DRAENEI_RUINS),
BattleGroundEYCapturingPointStruct(LANG_BG_EY_HAS_TAKEN_A_M_TOWER, LANG_BG_EY_HAS_TAKEN_H_M_TOWER, EY_GRAVEYARD_MAGE_TOWER)
@@ -278,7 +271,7 @@ class BattleGroundEY : public BattleGround
void UpdateTeamScore(uint32 Team);
void EndBattleGround(uint32 winner);
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value);
- virtual void FillInitialWorldStates(WorldPacket& data);
+ virtual void FillInitialWorldStates(WorldPacket& data, uint32& count);
void SetDroppedFlagGUID(uint64 guid) { m_DroppedFlagGUID = guid;}
uint64 GetDroppedFlagGUID() const { return m_DroppedFlagGUID;}
@@ -323,7 +316,7 @@ class BattleGroundEY : public BattleGround
uint8 m_PointState[BG_EY_NODES_MAX];
int32 m_PointBarStatus[BG_EY_NODES_MAX];
typedef std::vector PlayersNearPointType;
- PlayersNearPointType m_PlayersNearPoint[BG_EY_NODES_MAX + 1];
+ PlayersNearPointType m_PlayersNearPoint[BG_EY_NODES_MAX_WITH_SPEIAL];
uint8 m_CurrentPointPlayersCount[2*BG_EY_NODES_MAX];
int32 m_PointAddingTimer;
diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp
index 6cc0ab14a..a7354174e 100644
--- a/src/game/BattleGroundMgr.cpp
+++ b/src/game/BattleGroundMgr.cpp
@@ -148,9 +148,9 @@ bool BattleGroundQueue::SelectionPool::AddGroup(GroupQueueInfo *ginfo, uint32 de
/*********************************************************/
// add group or player (grp == NULL) to bg queue with the given leader and bg specifications
-GroupQueueInfo * BattleGroundQueue::AddGroup(Player *leader, Group* grp, BattleGroundTypeId BgTypeId, PvPDifficultyEntry const* backetEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 arenaRating, uint32 arenateamid)
+GroupQueueInfo * BattleGroundQueue::AddGroup(Player *leader, Group* grp, BattleGroundTypeId BgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 arenaRating, uint32 arenateamid)
{
- BattleGroundBracketId bracketId = backetEntry->GetBracketId();
+ BattleGroundBracketId bracketId = bracketEntry->GetBracketId();
// create new ginfo
GroupQueueInfo* ginfo = new GroupQueueInfo;
@@ -220,8 +220,8 @@ GroupQueueInfo * BattleGroundQueue::AddGroup(Player *leader, Group* grp, BattleG
uint32 MinPlayers = bg->GetMinPlayersPerTeam();
uint32 qHorde = 0;
uint32 qAlliance = 0;
- uint32 q_min_level = backetEntry->minLevel;
- uint32 q_max_level = backetEntry->maxLevel;
+ uint32 q_min_level = bracketEntry->minLevel;
+ uint32 q_max_level = bracketEntry->maxLevel;
GroupsQueueType::const_iterator itr;
for(itr = m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].begin(); itr != m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].end(); ++itr)
if (!(*itr)->IsInvitedToBGInstanceGUID)
@@ -1535,6 +1535,9 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI
return 0;
}
+ // set before Map creating for let use proper difficulty
+ bg->SetBracket(bracketEntry);
+
// will also set m_bgMap, instanceid
sMapMgr.CreateBgMap(bg->GetMapId(), bg);
@@ -1545,7 +1548,6 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI
// start the joining of the bg
bg->SetStatus(STATUS_WAIT_JOIN);
- bg->SetBracket(bracketEntry);
bg->SetArenaType(arenaType);
bg->SetRated(isRated);
@@ -2043,23 +2045,35 @@ void BattleGroundMgr::LoadBattleMastersEntry()
sLog.outString( ">> Loaded %u battlemaster entries", count );
}
-bool BattleGroundMgr::IsBGWeekend(BattleGroundTypeId bgTypeId)
+HolidayIds BattleGroundMgr::BGTypeToWeekendHolidayId(BattleGroundTypeId bgTypeId)
{
switch (bgTypeId)
{
- case BATTLEGROUND_AV:
- return IsHolidayActive(HOLIDAY_CALL_TO_ARMS_AV);
- case BATTLEGROUND_EY:
- return IsHolidayActive(HOLIDAY_CALL_TO_ARMS_EY);
- case BATTLEGROUND_WS:
- return IsHolidayActive(HOLIDAY_CALL_TO_ARMS_WS);
- case BATTLEGROUND_SA:
- return IsHolidayActive(HOLIDAY_CALL_TO_ARMS_SA);
- default:
- return false;
+ case BATTLEGROUND_AV: return HOLIDAY_CALL_TO_ARMS_AV;
+ case BATTLEGROUND_EY: return HOLIDAY_CALL_TO_ARMS_EY;
+ case BATTLEGROUND_WS: return HOLIDAY_CALL_TO_ARMS_WS;
+ case BATTLEGROUND_SA: return HOLIDAY_CALL_TO_ARMS_SA;
+ default: return HOLIDAY_NONE;
}
}
+BattleGroundTypeId BattleGroundMgr::WeekendHolidayIdToBGType(HolidayIds holiday)
+{
+ switch (holiday)
+ {
+ case HOLIDAY_CALL_TO_ARMS_AV: return BATTLEGROUND_AV;
+ case HOLIDAY_CALL_TO_ARMS_EY: return BATTLEGROUND_EY;
+ case HOLIDAY_CALL_TO_ARMS_WS: return BATTLEGROUND_WS;
+ case HOLIDAY_CALL_TO_ARMS_SA: return BATTLEGROUND_SA;
+ default: return BATTLEGROUND_TYPE_NONE;
+ }
+}
+
+bool BattleGroundMgr::IsBGWeekend(BattleGroundTypeId bgTypeId)
+{
+ return IsHolidayActive(BGTypeToWeekendHolidayId(bgTypeId));
+}
+
void BattleGroundMgr::LoadBattleEventIndexes()
{
BattleGroundEventIdx events;
diff --git a/src/game/BattleGroundMgr.h b/src/game/BattleGroundMgr.h
index 2c058d649..a77def119 100644
--- a/src/game/BattleGroundMgr.h
+++ b/src/game/BattleGroundMgr.h
@@ -82,7 +82,7 @@ class BattleGroundQueue
bool CheckPremadeMatch(BattleGroundBracketId bracket_id, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam);
bool CheckNormalMatch(BattleGround* bg_template, BattleGroundBracketId bracket_id, uint32 minPlayers, uint32 maxPlayers);
bool CheckSkirmishForSameFaction(BattleGroundBracketId bracket_id, uint32 minPlayersPerTeam);
- GroupQueueInfo * AddGroup(Player* leader, Group* group, BattleGroundTypeId bgTypeId, PvPDifficultyEntry const* backetEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 ArenaTeamId = 0);
+ GroupQueueInfo * AddGroup(Player* leader, Group* group, BattleGroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 ArenaTeamId = 0);
void RemovePlayer(const uint64& guid, bool decreaseInvitedCount);
bool IsPlayerInvited(const uint64& pl_guid, const uint32 bgInstanceGuid, const uint32 removeTime);
bool GetPlayerGroupInfoData(const uint64& guid, GroupQueueInfo* ginfo);
@@ -272,6 +272,8 @@ class BattleGroundMgr
static BattleGroundTypeId BGTemplateId(BattleGroundQueueTypeId bgQueueTypeId);
static uint8 BGArenaType(BattleGroundQueueTypeId bgQueueTypeId);
+ static HolidayIds BGTypeToWeekendHolidayId(BattleGroundTypeId bgTypeId);
+ static BattleGroundTypeId WeekendHolidayIdToBGType(HolidayIds holiday);
static bool IsBGWeekend(BattleGroundTypeId bgTypeId);
private:
ACE_Thread_Mutex SchedulerLock;
diff --git a/src/game/BattleGroundNA.cpp b/src/game/BattleGroundNA.cpp
index 02d30ba00..336dca557 100644
--- a/src/game/BattleGroundNA.cpp
+++ b/src/game/BattleGroundNA.cpp
@@ -131,11 +131,11 @@ void BattleGroundNA::HandleAreaTrigger(Player *Source, uint32 Trigger)
// HandleTriggerBuff(buff_guid,Source);
}
-void BattleGroundNA::FillInitialWorldStates(WorldPacket &data)
+void BattleGroundNA::FillInitialWorldStates(WorldPacket &data, uint32& count)
{
- data << uint32(0xa0f) << uint32(GetAlivePlayersCountByTeam(ALLIANCE)); // 7
- data << uint32(0xa10) << uint32(GetAlivePlayersCountByTeam(HORDE)); // 8
- data << uint32(0xa11) << uint32(1); // 9
+ FillInitialWorldState(data, count, 0xa0f, GetAlivePlayersCountByTeam(ALLIANCE));
+ FillInitialWorldState(data, count, 0xa10, GetAlivePlayersCountByTeam(HORDE));
+ FillInitialWorldState(data, count, 0xa11, 1);
}
void BattleGroundNA::Reset()
diff --git a/src/game/BattleGroundNA.h b/src/game/BattleGroundNA.h
index 2bc9102e3..cc8cdad56 100644
--- a/src/game/BattleGroundNA.h
+++ b/src/game/BattleGroundNA.h
@@ -46,7 +46,7 @@ class BattleGroundNA : public BattleGround
void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround();
virtual void Reset();
- virtual void FillInitialWorldStates(WorldPacket &d);
+ virtual void FillInitialWorldStates(WorldPacket &d, uint32& count);
void HandleKillPlayer(Player* player, Player *killer);
bool HandlePlayerUnderMap(Player * plr);
};
diff --git a/src/game/BattleGroundRL.cpp b/src/game/BattleGroundRL.cpp
index eb4232081..d54a1195e 100644
--- a/src/game/BattleGroundRL.cpp
+++ b/src/game/BattleGroundRL.cpp
@@ -132,11 +132,11 @@ void BattleGroundRL::HandleAreaTrigger(Player *Source, uint32 Trigger)
// HandleTriggerBuff(buff_guid,Source);
}
-void BattleGroundRL::FillInitialWorldStates(WorldPacket &data)
+void BattleGroundRL::FillInitialWorldStates(WorldPacket &data, uint32& count)
{
- data << uint32(0xbb8) << uint32(GetAlivePlayersCountByTeam(ALLIANCE)); // 7
- data << uint32(0xbb9) << uint32(GetAlivePlayersCountByTeam(HORDE)); // 8
- data << uint32(0xbba) << uint32(1); // 9
+ FillInitialWorldState(data, count, 0xbb8, GetAlivePlayersCountByTeam(ALLIANCE));
+ FillInitialWorldState(data, count, 0xbb9, GetAlivePlayersCountByTeam(HORDE));
+ FillInitialWorldState(data, count, 0xbba, 1);
}
void BattleGroundRL::Reset()
diff --git a/src/game/BattleGroundRL.h b/src/game/BattleGroundRL.h
index 10dce567d..8766a5b1e 100644
--- a/src/game/BattleGroundRL.h
+++ b/src/game/BattleGroundRL.h
@@ -40,7 +40,7 @@ class BattleGroundRL : public BattleGround
/* inherited from BattlegroundClass */
virtual void AddPlayer(Player *plr);
virtual void Reset();
- virtual void FillInitialWorldStates(WorldPacket &d);
+ virtual void FillInitialWorldStates(WorldPacket &d, uint32& count);
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGroundWS.cpp
index c6de4d032..88d25a72a 100644
--- a/src/game/BattleGroundWS.cpp
+++ b/src/game/BattleGroundWS.cpp
@@ -86,6 +86,31 @@ void BattleGroundWS::Update(uint32 diff)
RespawnFlagAfterDrop(HORDE);
}
}
+
+ if (m_EndTimer <= diff)
+ {
+ uint32 allianceScore = GetTeamScore(ALLIANCE);
+ uint32 hordeScore = GetTeamScore(HORDE);
+
+ if (allianceScore > hordeScore)
+ EndBattleGround(ALLIANCE);
+ else if (allianceScore < hordeScore)
+ EndBattleGround(HORDE);
+ else
+ {
+ // if 0 => tie
+ EndBattleGround(m_LastCapturedFlagTeam);
+ }
+ }
+ else
+ {
+ uint32 minutesLeftPrev = GetRemainingTimeInMinutes();
+ m_EndTimer -= diff;
+ uint32 minutesLeft = GetRemainingTimeInMinutes();
+
+ if (minutesLeft != minutesLeftPrev)
+ UpdateWorldState(BG_WS_TIME_REMAINING, minutesLeft);
+ }
}
}
@@ -165,6 +190,8 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
if (GetStatus() != STATUS_IN_PROGRESS)
return;
+ m_LastCapturedFlagTeam = Source->GetTeam();
+
uint32 winner = 0;
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
@@ -526,6 +553,8 @@ void BattleGroundWS::Reset()
m_HonorWinKills = (isBGWeekend) ? 3 : 1;
m_HonorEndKills = (isBGWeekend) ? 4 : 2;
+ m_EndTimer = BG_WS_TIME_LIMIT;
+ m_LastCapturedFlagTeam = 0;
}
void BattleGroundWS::EndBattleGround(uint32 winner)
@@ -596,35 +625,37 @@ WorldSafeLocsEntry const* BattleGroundWS::GetClosestGraveYard(Player* player)
}
}
-void BattleGroundWS::FillInitialWorldStates(WorldPacket& data)
+void BattleGroundWS::FillInitialWorldStates(WorldPacket& data, uint32& count)
{
- data << uint32(BG_WS_FLAG_CAPTURES_ALLIANCE) << uint32(GetTeamScore(ALLIANCE));
- data << uint32(BG_WS_FLAG_CAPTURES_HORDE) << uint32(GetTeamScore(HORDE));
+ FillInitialWorldState(data, count, BG_WS_FLAG_CAPTURES_ALLIANCE, GetTeamScore(ALLIANCE));
+ FillInitialWorldState(data, count, BG_WS_FLAG_CAPTURES_HORDE, GetTeamScore(HORDE));
if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_GROUND)
- data << uint32(BG_WS_FLAG_UNK_ALLIANCE) << uint32(-1);
+ FillInitialWorldState(data, count, BG_WS_FLAG_UNK_ALLIANCE, -1);
else if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_PLAYER)
- data << uint32(BG_WS_FLAG_UNK_ALLIANCE) << uint32(1);
+ FillInitialWorldState(data, count, BG_WS_FLAG_UNK_ALLIANCE, 1);
else
- data << uint32(BG_WS_FLAG_UNK_ALLIANCE) << uint32(0);
+ FillInitialWorldState(data, count, BG_WS_FLAG_UNK_ALLIANCE, 0);
if (m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_GROUND)
- data << uint32(BG_WS_FLAG_UNK_HORDE) << uint32(-1);
+ FillInitialWorldState(data, count, BG_WS_FLAG_UNK_HORDE, -1);
else if (m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_PLAYER)
- data << uint32(BG_WS_FLAG_UNK_HORDE) << uint32(1);
+ FillInitialWorldState(data, count, BG_WS_FLAG_UNK_HORDE, 1);
else
- data << uint32(BG_WS_FLAG_UNK_HORDE) << uint32(0);
+ FillInitialWorldState(data, count, BG_WS_FLAG_UNK_HORDE, 0);
- data << uint32(BG_WS_FLAG_CAPTURES_MAX) << uint32(BG_WS_MAX_TEAM_SCORE);
+ FillInitialWorldState(data, count, BG_WS_FLAG_CAPTURES_MAX, BG_WS_MAX_TEAM_SCORE);
if (m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_ON_PLAYER)
- data << uint32(BG_WS_FLAG_STATE_HORDE) << uint32(2);
+ FillInitialWorldState(data, count, BG_WS_FLAG_STATE_HORDE, 2);
else
- data << uint32(BG_WS_FLAG_STATE_HORDE) << uint32(1);
+ FillInitialWorldState(data, count, BG_WS_FLAG_STATE_HORDE, 1);
if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_PLAYER)
- data << uint32(BG_WS_FLAG_STATE_ALLIANCE) << uint32(2);
+ FillInitialWorldState(data, count, BG_WS_FLAG_STATE_ALLIANCE, 2);
else
- data << uint32(BG_WS_FLAG_STATE_ALLIANCE) << uint32(1);
+ FillInitialWorldState(data, count, BG_WS_FLAG_STATE_ALLIANCE, 1);
+ FillInitialWorldState(data, count, BG_WS_TIME_ENABLED, 1);
+ FillInitialWorldState(data, count, BG_WS_TIME_REMAINING, GetRemainingTimeInMinutes());
}
diff --git a/src/game/BattleGroundWS.h b/src/game/BattleGroundWS.h
index 9cbfae22c..7fe71e060 100644
--- a/src/game/BattleGroundWS.h
+++ b/src/game/BattleGroundWS.h
@@ -24,6 +24,7 @@
#define BG_WS_MAX_TEAM_SCORE 3
#define BG_WS_FLAG_RESPAWN_TIME (23*IN_MILLISECONDS)
#define BG_WS_FLAG_DROP_TIME (10*IN_MILLISECONDS)
+#define BG_WS_TIME_LIMIT (25*MINUTE*IN_MILLISECONDS)
enum BG_WS_Sound
{
@@ -53,7 +54,9 @@ enum BG_WS_WorldStates
BG_WS_FLAG_CAPTURES_HORDE = 1582,
BG_WS_FLAG_CAPTURES_MAX = 1601,
BG_WS_FLAG_STATE_HORDE = 2338,
- BG_WS_FLAG_STATE_ALLIANCE = 2339
+ BG_WS_FLAG_STATE_ALLIANCE = 2339,
+ BG_WS_TIME_ENABLED = 4247,
+ BG_WS_TIME_REMAINING = 4248
};
enum BG_WS_FlagState
@@ -128,13 +131,14 @@ class BattleGroundWS : public BattleGround
virtual void Reset();
void EndBattleGround(uint32 winner);
virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
+ uint32 GetRemainingTimeInMinutes() { return m_EndTimer ? (m_EndTimer-1) / (MINUTE * IN_MILLISECONDS) + 1 : 0; }
void UpdateFlagState(uint32 team, uint32 value);
void UpdateTeamScore(uint32 team);
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value);
void SetDroppedFlagGUID(uint64 guid, uint32 TeamID) { m_DroppedFlagGUID[GetTeamIndexByTeamId(TeamID)] = guid;}
uint64 GetDroppedFlagGUID(uint32 TeamID) { return m_DroppedFlagGUID[GetTeamIndexByTeamId(TeamID)];}
- virtual void FillInitialWorldStates(WorldPacket& data);
+ virtual void FillInitialWorldStates(WorldPacket& data, uint32& count);
/* Scorekeeping */
uint32 GetTeamScore(uint32 TeamID) const { return m_TeamScores[GetTeamIndexByTeamId(TeamID)]; }
@@ -152,5 +156,7 @@ class BattleGroundWS : public BattleGround
uint32 m_ReputationCapture;
uint32 m_HonorWinKills;
uint32 m_HonorEndKills;
+ uint32 m_EndTimer;
+ uint32 m_LastCapturedFlagTeam;
};
#endif
diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp
index 7d5edd6cc..8357ede9e 100644
--- a/src/game/CharacterHandler.cpp
+++ b/src/game/CharacterHandler.cpp
@@ -720,11 +720,8 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder)
pCurrChar->SetInGameTime( getMSTime() );
// announce group about member online (must be after add to player list to receive announce to self)
- if(Group *group = pCurrChar->GetGroup())
- {
- //pCurrChar->groupInfo.group->SendInit(this); // useless
+ if (Group *group = pCurrChar->GetGroup())
group->SendUpdate();
- }
// friend status
sSocialMgr.SendFriendStatus(pCurrChar, FRIEND_ONLINE, pCurrChar->GetGUIDLow(), true);
diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp
index 1047447c2..97506963b 100644
--- a/src/game/Chat.cpp
+++ b/src/game/Chat.cpp
@@ -285,16 +285,25 @@ ChatCommand * ChatHandler::getCommandTable()
{ NULL, 0, false, NULL, "", NULL }
};
+ static ChatCommand lookupAccountCommandTable[] =
+ {
+ { "email", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupAccountEmailCommand, "", NULL },
+ { "ip", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupAccountIpCommand, "", NULL },
+ { "name", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupAccountNameCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
static ChatCommand lookupPlayerCommandTable[] =
{
- { "ip", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupPlayerIpCommand, "", NULL },
- { "account", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupPlayerAccountCommand, "", NULL },
- { "email", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupPlayerEmailCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
+ { "account", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupPlayerAccountCommand, "", NULL },
+ { "email", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupPlayerEmailCommand, "", NULL },
+ { "ip", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupPlayerIpCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
};
static ChatCommand lookupCommandTable[] =
{
+ { "account", SEC_GAMEMASTER, true, NULL, "", lookupAccountCommandTable },
{ "area", SEC_MODERATOR, true, &ChatHandler::HandleLookupAreaCommand, "", NULL },
{ "creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupCreatureCommand, "", NULL },
{ "event", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupEventCommand, "", NULL },
@@ -540,9 +549,15 @@ ChatCommand * ChatHandler::getCommandTable()
{ NULL, 0, false, NULL, "", NULL }
};
+ static ChatCommand serverLogCommandTable[] =
+ {
+ { "filter", SEC_CONSOLE, true, &ChatHandler::HandleServerLogFilterCommand, "", NULL },
+ { "level", SEC_CONSOLE, true, &ChatHandler::HandleServerLogLevelCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
static ChatCommand serverSetCommandTable[] =
{
- { "loglevel", SEC_CONSOLE, true, &ChatHandler::HandleServerSetLogLevelCommand, "", NULL },
{ "motd", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerSetMotdCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
@@ -554,6 +569,7 @@ ChatCommand * ChatHandler::getCommandTable()
{ "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable },
{ "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable },
{ "info", SEC_PLAYER, true, &ChatHandler::HandleServerInfoCommand, "", NULL },
+ { "log", SEC_CONSOLE, true, NULL, "", serverLogCommandTable },
{ "motd", SEC_PLAYER, true, &ChatHandler::HandleServerMotdCommand, "", NULL },
{ "plimit", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerPLimitCommand, "", NULL },
{ "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable },
@@ -602,29 +618,29 @@ ChatCommand * ChatHandler::getCommandTable()
static ChatCommand commandTable[] =
{
{ "account", SEC_PLAYER, true, NULL, "", accountCommandTable },
- { "gm", SEC_MODERATOR, true, NULL, "", gmCommandTable },
- { "npc", SEC_MODERATOR, false, NULL, "", npcCommandTable },
- { "go", SEC_MODERATOR, false, NULL, "", goCommandTable },
- { "learn", SEC_MODERATOR, false, NULL, "", learnCommandTable },
- { "modify", SEC_MODERATOR, false, NULL, "", modifyCommandTable },
- { "debug", SEC_MODERATOR, true, NULL, "", debugCommandTable },
- { "tele", SEC_MODERATOR, true, NULL, "", teleCommandTable },
+ { "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable },
{ "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable},
+ { "debug", SEC_MODERATOR, true, NULL, "", debugCommandTable },
{ "event", SEC_GAMEMASTER, false, NULL, "", eventCommandTable },
- { "gobject", SEC_GAMEMASTER, false, NULL, "", gobjectCommandTable },
+ { "gm", SEC_MODERATOR, true, NULL, "", gmCommandTable },
{ "honor", SEC_GAMEMASTER, false, NULL, "", honorCommandTable },
- { "wp", SEC_GAMEMASTER, false, NULL, "", wpCommandTable },
- { "titles", SEC_GAMEMASTER, false, NULL, "", titlesCommandTable },
- { "quest", SEC_ADMINISTRATOR, false, NULL, "", questCommandTable },
- { "reload", SEC_ADMINISTRATOR, true, NULL, "", reloadCommandTable },
+ { "go", SEC_MODERATOR, false, NULL, "", goCommandTable },
+ { "gobject", SEC_GAMEMASTER, false, NULL, "", gobjectCommandTable },
+ { "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable },
+ { "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable },
+ { "learn", SEC_MODERATOR, false, NULL, "", learnCommandTable },
{ "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable },
{ "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable },
+ { "modify", SEC_MODERATOR, false, NULL, "", modifyCommandTable },
+ { "npc", SEC_MODERATOR, false, NULL, "", npcCommandTable },
{ "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable },
- { "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable },
- { "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable },
+ { "quest", SEC_ADMINISTRATOR, false, NULL, "", questCommandTable },
+ { "reload", SEC_ADMINISTRATOR, true, NULL, "", reloadCommandTable },
{ "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable },
- { "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable },
{ "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable },
+ { "tele", SEC_MODERATOR, true, NULL, "", teleCommandTable },
+ { "titles", SEC_GAMEMASTER, false, NULL, "", titlesCommandTable },
+ { "wp", SEC_GAMEMASTER, false, NULL, "", wpCommandTable },
{ "aura", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAuraCommand, "", NULL },
{ "unaura", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnAuraCommand, "", NULL },
diff --git a/src/game/Chat.h b/src/game/Chat.h
index 88c24e92f..87aa895cf 100644
--- a/src/game/Chat.h
+++ b/src/game/Chat.h
@@ -233,6 +233,9 @@ class ChatHandler
bool HandleListObjectCommand(const char* args);
bool HandleListTalentsCommand(const char * args);
+ bool HandleLookupAccountEmailCommand(const char* args);
+ bool HandleLookupAccountIpCommand(const char* args);
+ bool HandleLookupAccountNameCommand(const char* args);
bool HandleLookupAreaCommand(const char* args);
bool HandleLookupCreatureCommand(const char* args);
bool HandleLookupEventCommand(const char* args);
@@ -422,10 +425,11 @@ class ChatHandler
bool HandleServerIdleRestartCommand(const char* args);
bool HandleServerIdleShutDownCommand(const char* args);
bool HandleServerInfoCommand(const char* args);
+ bool HandleServerLogFilterCommand(const char* args);
+ bool HandleServerLogLevelCommand(const char* args);
bool HandleServerMotdCommand(const char* args);
bool HandleServerPLimitCommand(const char* args);
bool HandleServerRestartCommand(const char* args);
- bool HandleServerSetLogLevelCommand(const char* args);
bool HandleServerSetMotdCommand(const char* args);
bool HandleServerShutDownCommand(const char* args);
bool HandleServerShutDownCancelCommand(const char* args);
@@ -544,7 +548,9 @@ class ChatHandler
// Utility methods for commands
void ShowTicket(uint64 guid, char const* text, char const* time);
- bool LookupPlayerSearchCommand(QueryResult* result, int32 limit);
+ bool ShowAccountListHelper(QueryResult* result, uint32* limit = NULL, bool title = true, bool error = true);
+ bool ShowPlayerListHelper(QueryResult* result, uint32* limit = NULL, bool title = true, bool error = true);
+ bool LookupPlayerSearchCommand(QueryResult* result, uint32* limit = NULL);
bool HandleBanListHelper(QueryResult* result);
bool HandleBanHelper(BanMode mode,char const* args);
bool HandleBanInfoHelper(uint32 accountid, char const* accountname);
diff --git a/src/game/CombatHandler.cpp b/src/game/CombatHandler.cpp
index f71373fcd..ffedc632e 100644
--- a/src/game/CombatHandler.cpp
+++ b/src/game/CombatHandler.cpp
@@ -29,7 +29,7 @@ void WorldSession::HandleAttackSwingOpcode( WorldPacket & recv_data )
ObjectGuid guid;
recv_data >> guid;
- DEBUG_LOG("WORLD: Recvd CMSG_ATTACKSWING Message %s", guid.GetString().c_str());
+ DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "WORLD: Recvd CMSG_ATTACKSWING Message %s", guid.GetString().c_str());
Unit *pEnemy = ObjectAccessor::GetUnit(*_player, guid);
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 774f2454d..6e984a990 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -74,7 +74,7 @@ bool VendorItemData::RemoveItem( uint32 item_id )
return found;
}
-VendorItem const* VendorItemData::FindItemCostPair(uint32 item_id, uint32 extendedCost) const
+VendorItem const* VendorItemData::FindItemCostPair(uint32 item_id, int32 extendedCost) const
{
for(VendorItemList::const_iterator i = m_items.begin(); i != m_items.end(); ++i )
if((*i)->item == item_id && (*i)->ExtendedCost == extendedCost)
@@ -110,8 +110,8 @@ bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
Creature::Creature(CreatureSubtype subtype) :
Unit(), i_AI(NULL),
-lootForPickPocketed(false), lootForBody(false), m_groupLootTimer(0), m_groupLootId(0),
-m_lootMoney(0), m_lootRecipient(0),
+lootForPickPocketed(false), lootForBody(false), lootForSkin(false), m_groupLootTimer(0), m_groupLootId(0),
+m_lootMoney(0), m_lootGroupRecipientId(0),
m_deathTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_respawnradius(5.0f),
m_subtype(subtype), m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0),
m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false),
@@ -168,6 +168,10 @@ void Creature::RemoveCorpse()
m_deathTimer = 0;
setDeathState(DEAD);
UpdateObjectVisibility();
+
+ // stop loot rolling before loot clear and for close client dialogs
+ StopGroupLoot();
+
loot.clear();
uint32 respawnDelay = m_respawnDelay;
if (AI())
@@ -362,10 +366,11 @@ void Creature::Update(uint32 diff)
{
if( m_respawnTime <= time(NULL) )
{
- DEBUG_LOG("Respawning...");
+ DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Respawning...");
m_respawnTime = 0;
lootForPickPocketed = false;
lootForBody = false;
+ lootForSkin = false;
if(m_originalEntry != GetEntry())
UpdateEntry(m_originalEntry);
@@ -407,25 +412,18 @@ void Creature::Update(uint32 diff)
if (IsInWorld()) // can be despawned by update pool
{
RemoveCorpse();
- DEBUG_LOG("Removing corpse... %u ", GetEntry());
+ DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Removing corpse... %u ", GetEntry());
}
}
else
{
m_deathTimer -= diff;
- if (m_groupLootTimer && m_groupLootId)
+ if (m_groupLootId)
{
- if(diff <= m_groupLootTimer)
- {
+ if(diff < m_groupLootTimer)
m_groupLootTimer -= diff;
- }
else
- {
- if (Group* group = sObjectMgr.GetGroupById(m_groupLootId))
- group->EndRoll();
- m_groupLootTimer = 0;
- m_groupLootId = 0;
- }
+ StopGroupLoot();
}
}
@@ -446,7 +444,7 @@ void Creature::Update(uint32 diff)
if (IsInWorld()) // can be despawned by update pool
{
RemoveCorpse();
- DEBUG_LOG("Removing alive corpse... %u ", GetEntry());
+ DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Removing alive corpse... %u ", GetEntry());
}
else
return;
@@ -504,6 +502,25 @@ void Creature::Update(uint32 diff)
}
}
+
+void Creature::StartGroupLoot( Group* group, uint32 timer )
+{
+ m_groupLootId = group->GetId();
+ m_groupLootTimer = timer;
+}
+
+void Creature::StopGroupLoot()
+{
+ if (!m_groupLootId)
+ return;
+
+ if (Group* group = sObjectMgr.GetGroupById(m_groupLootId))
+ group->EndRoll();
+
+ m_groupLootTimer = 0;
+ m_groupLootId = 0;
+}
+
void Creature::RegenerateMana()
{
uint32 curValue = GetPower(POWER_MANA);
@@ -590,7 +607,7 @@ bool Creature::AIM_Initialize()
// make sure nothing can change the AI during AI update
if(m_AI_locked)
{
- DEBUG_LOG("AIM_Initialize: failed to init, locked.");
+ DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "AIM_Initialize: failed to init, locked.");
return false;
}
@@ -794,13 +811,91 @@ void Creature::AI_SendMoveToPacket(float x, float y, float z, uint32 time, Splin
SendMonsterMove(x, y, z, type, flags, time);
}
-Player *Creature::GetLootRecipient() const
+void Creature::PrepareBodyLootState()
{
- if (!m_lootRecipient)
- return NULL;
- else return ObjectAccessor::FindPlayer(m_lootRecipient);
+ loot.clear();
+
+ // if have normal loot then prepare it access
+ if (!isAlive() && !lootForBody)
+ {
+ // have normal loot
+ if (GetCreatureInfo()->maxgold > 0 || GetCreatureInfo()->lootid ||
+ // ... or can have skinning after
+ GetCreatureInfo()->SkinLootId && sWorld.getConfig(CONFIG_BOOL_CORPSE_EMPTY_LOOT_SHOW))
+ {
+ SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ return;
+ }
+ }
+
+ // if not have normal loot allow skinning if need
+ if (!isAlive() && !lootForSkin && GetCreatureInfo()->SkinLootId)
+ {
+ lootForBody = true; // pass this loot mode
+
+ RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
+ return;
+ }
+
+ RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+ RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
}
+
+/**
+ * Return original player who tap creature, it can be different from player/group allowed to loot so not use it for loot code
+ */
+Player* Creature::GetOriginalLootRecipient() const
+{
+ return !m_lootRecipientGuid.IsEmpty() ? ObjectAccessor::FindPlayer(m_lootRecipientGuid) : NULL;
+}
+
+/**
+ * Return group if player tap creature as group member, independent is player after leave group or stil be group member
+ */
+Group* Creature::GetGroupLootRecipient() const
+{
+ // original recipient group if set and not disbanded
+ return m_lootGroupRecipientId ? sObjectMgr.GetGroupById(m_lootGroupRecipientId) : NULL;
+}
+
+/**
+ * Return player who can loot tapped creature (member of group or single player)
+ *
+ * In case when original player tap creature as group member then group tap prefered.
+ * This is for example important if player after tap leave group.
+ * If group not exist or disbanded or player tap creature not as group member return player
+ */
+Player* Creature::GetLootRecipient() const
+{
+ // original recipient group if set and not disbanded
+ Group* group = GetGroupLootRecipient();
+
+ // original recipient player if online
+ Player* player = GetOriginalLootRecipient();
+
+ // if group not set or disbanded return original recipient player if any
+ if (!group)
+ return player;
+
+ // group case
+
+ // return player if it still be in original recipient group
+ if (player && player->GetGroup() == group)
+ return player;
+
+ // find any in group
+ for(GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
+ if (Player *p = itr->getSource())
+ return p;
+
+ return NULL;
+}
+
+/**
+ * Set player and group (if player group member) who tap creature
+ */
void Creature::SetLootRecipient(Unit *unit)
{
// set the player whose group should receive the right
@@ -809,7 +904,8 @@ void Creature::SetLootRecipient(Unit *unit)
if (!unit)
{
- m_lootRecipient = 0;
+ m_lootRecipientGuid.Clear();
+ m_lootGroupRecipientId = 0;
RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED);
return;
}
@@ -818,7 +914,13 @@ void Creature::SetLootRecipient(Unit *unit)
if(!player) // normal creature, no player involved
return;
- m_lootRecipient = player->GetGUID();
+ // set player for non group case or if group will disbanded
+ m_lootRecipientGuid = player->GetObjectGuid();
+
+ // set group for group existed case including if player will leave group at loot time
+ if (Group* group = player->GetGroup())
+ m_lootGroupRecipientId = group->GetId();
+
SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED);
}
@@ -1261,10 +1363,6 @@ void Creature::setDeathState(DeathState s)
SetTargetGUID(0); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState)
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
- if (!isPet() && GetCreatureInfo()->SkinLootId)
- if (LootTemplates_Skinning.HaveLootFor(GetCreatureInfo()->SkinLootId))
- SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
-
if (canFly() && FallGround())
return;
@@ -1526,7 +1624,7 @@ void Creature::SendAIReaction(AiReaction reactionType)
((WorldObject*)this)->SendMessageToSet(&data, true);
- DEBUG_LOG("WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType);
+ DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType);
}
void Creature::CallAssistance()
@@ -1740,7 +1838,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
Aura* AdditionalAura = CreateAura(AdditionalSpellInfo, cAura->effect_idx, NULL, this, this, 0);
AddAura(AdditionalAura);
- DEBUG_LOG("Spell: %u with Aura %u added to creature (GUIDLow: %u Entry: %u )", cAura->spell_id, AdditionalSpellInfo->EffectApplyAuraName[EFFECT_INDEX_0],GetGUIDLow(),GetEntry());
+ DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Spell: %u with Aura %u added to creature (GUIDLow: %u Entry: %u )", cAura->spell_id, AdditionalSpellInfo->EffectApplyAuraName[EFFECT_INDEX_0],GetGUIDLow(),GetEntry());
}
}
return true;
@@ -1933,16 +2031,16 @@ void Creature::GetRespawnCoord( float &x, float &y, float &z, float* ori, float*
void Creature::AllLootRemovedFromCorpse()
{
- if (!HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE))
+ if (lootForBody && !HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE))
{
uint32 nDeathTimer;
CreatureInfo const *cinfo = GetCreatureInfo();
- // corpse was not skinnable -> apply corpse looted timer
- if (!cinfo || !cinfo->SkinLootId)
+ // corpse was not skinned -> apply corpse looted timer
+ if (!lootForSkin)
nDeathTimer = (uint32)((m_corpseDelay * IN_MILLISECONDS) * sWorld.getConfig(CONFIG_FLOAT_RATE_CORPSE_DECAY_LOOTED));
- // corpse skinnable, but without skinning flag, and then skinned, corpse will despawn next update
+ // corpse was skinned, corpse will despawn next update
else
nDeathTimer = 0;
diff --git a/src/game/Creature.h b/src/game/Creature.h
index d8f74fbdf..c6dff5dfc 100644
--- a/src/game/Creature.h
+++ b/src/game/Creature.h
@@ -33,6 +33,7 @@
struct SpellEntry;
class CreatureAI;
+class Group;
class Quest;
class Player;
class WorldSession;
@@ -275,13 +276,17 @@ enum AttackingTarget
// Vendors
struct VendorItem
{
- VendorItem(uint32 _item, uint32 _maxcount, uint32 _incrtime, uint32 _ExtendedCost)
+ VendorItem(uint32 _item, uint32 _maxcount, uint32 _incrtime, int32 _ExtendedCost)
: item(_item), maxcount(_maxcount), incrtime(_incrtime), ExtendedCost(_ExtendedCost) {}
uint32 item;
uint32 maxcount; // 0 for infinity item amount
uint32 incrtime; // time for restore items amount if maxcount != 0
- uint32 ExtendedCost;
+ int32 ExtendedCost; // negative if need exclude normal item money cost
+
+ // helpers
+ uint32 IsExcludeMoneyPrice() const { return ExtendedCost < 0; }
+ uint32 GetExtendedCostId() const { return std::abs(ExtendedCost); }
};
typedef std::vector VendorItemList;
@@ -296,12 +301,12 @@ struct VendorItemData
}
bool Empty() const { return m_items.empty(); }
uint8 GetItemCount() const { return m_items.size(); }
- void AddItem( uint32 item, uint32 maxcount, uint32 ptime, uint32 ExtendedCost)
+ void AddItem( uint32 item, uint32 maxcount, uint32 ptime, int32 ExtendedCost)
{
m_items.push_back(new VendorItem(item, maxcount, ptime, ExtendedCost));
}
bool RemoveItem( uint32 item_id );
- VendorItem const* FindItemCostPair(uint32 item_id, uint32 extendedCost) const;
+ VendorItem const* FindItemCostPair(uint32 item_id, int32 extendedCost) const;
void Clear()
{
@@ -530,11 +535,18 @@ class MANGOS_DLL_SPEC Creature : public Unit
Loot loot;
bool lootForPickPocketed;
bool lootForBody;
- Player *GetLootRecipient() const;
- bool hasLootRecipient() const { return m_lootRecipient!=0; }
+ bool lootForSkin;
- void SetLootRecipient (Unit* unit);
+ void PrepareBodyLootState();
+ ObjectGuid GetLootRecipientGuid() const { return m_lootRecipientGuid; }
+ uint32 GetLootGroupRecipientId() const { return m_lootGroupRecipientId; }
+ Player* GetLootRecipient() const; // use group cases as prefered
+ Group* GetGroupLootRecipient() const;
+ bool HasLootRecipient() const { return m_lootGroupRecipientId || !m_lootRecipientGuid.IsEmpty(); }
+ bool IsGroupLootRecipient() const { return m_lootGroupRecipientId; }
+ void SetLootRecipient(Unit* unit);
void AllLootRemovedFromCorpse();
+ Player* GetOriginalLootRecipient() const; // ignore group changes/etc, not for looting
SpellEntry const *reachWithSpellAttack(Unit *pVictim);
SpellEntry const *reachWithSpellCure(Unit *pVictim);
@@ -583,8 +595,7 @@ class MANGOS_DLL_SPEC Creature : public Unit
float GetRespawnRadius() const { return m_respawnradius; }
void SetRespawnRadius(float dist) { m_respawnradius = dist; }
- uint32 m_groupLootTimer; // (msecs)timer used for group loot
- uint32 m_groupLootId; // used to find group which is looting corpse
+ void StartGroupLoot(Group* group, uint32 timer);
void SendZoneUnderAttackMessage(Player* attacker);
@@ -628,6 +639,10 @@ class MANGOS_DLL_SPEC Creature : public Unit
bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL);
void RelocationNotify();
+ uint32 m_groupLootTimer; // (msecs)timer used for group loot
+ uint32 m_groupLootId; // used to find group which is looting corpse
+ void StopGroupLoot();
+
// vendor items
VendorItemCounts m_vendorItemCounts;
@@ -637,7 +652,8 @@ class MANGOS_DLL_SPEC Creature : public Unit
static float _GetDamageMod(int32 Rank);
uint32 m_lootMoney;
- uint64 m_lootRecipient;
+ ObjectGuid m_lootRecipientGuid; // player who will have rights for looting if m_lootGroupRecipient==0 or group disbanded
+ uint32 m_lootGroupRecipientId; // group who will have rights for looting if set and exist
/// Timers
uint32 m_deathTimer; // (msecs)timer for death or corpse disappearance
diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp
index b7ba302d6..bbb12c602 100644
--- a/src/game/CreatureEventAI.cpp
+++ b/src/game/CreatureEventAI.cpp
@@ -698,7 +698,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
break;
}
case ACTION_T_KILLED_MONSTER:
- //first attempt player who tapped creature
+ //first attempt player/group who tapped creature
if (Player* pPlayer = m_creature->GetLootRecipient())
pPlayer->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, m_creature);
else
diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h
index 73f4c936a..e63ae5ca9 100644
--- a/src/game/DBCStructure.h
+++ b/src/game/DBCStructure.h
@@ -574,7 +574,7 @@ struct BattlemasterListEntry
char* name[16]; // 11-26
//uint32 nameFlags // 27 string flag, unused
uint32 maxGroupSize; // 28 maxGroupSize, used for checking if queue as group
- //uint32 HolidayWorldStateId; // 29 new 3.1
+ uint32 HolidayWorldStateId; // 29 new 3.1
uint32 minLevel; // 30, min level (sync with PvPDifficulty.dbc content)
uint32 maxLevel; // 31, max level (sync with PvPDifficulty.dbc content)
};
diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h
index d4c265164..582494424 100644
--- a/src/game/DBCfmt.h
+++ b/src/game/DBCfmt.h
@@ -27,7 +27,7 @@ const char AreaTriggerEntryfmt[]="niffffffff";
const char AuctionHouseEntryfmt[]="niiixxxxxxxxxxxxxxxxx";
const char BankBagSlotPricesEntryfmt[]="ni";
const char BarberShopStyleEntryfmt[]="nixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiii";
-const char BattlemasterListEntryfmt[]="niiiiiiiiixssssssssssssssssxixii";
+const char BattlemasterListEntryfmt[]="niiiiiiiiixssssssssssssssssxiiii";
const char CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const char CharTitlesEntryfmt[]="nxssssssssssssssssxxxxxxxxxxxxxxxxxxi";
const char ChatChannelsEntryfmt[]="iixssssssssssssssssxxxxxxxxxxxxxxxxxx";
diff --git a/src/game/DuelHandler.cpp b/src/game/DuelHandler.cpp
index da1f4ce03..d94a9a52d 100644
--- a/src/game/DuelHandler.cpp
+++ b/src/game/DuelHandler.cpp
@@ -41,9 +41,9 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
if(pl == pl->duel->initiator || !plTarget || pl == plTarget || pl->duel->startTime != 0 || plTarget->duel->startTime != 0)
return;
- //DEBUG_LOG( "WORLD: received CMSG_DUEL_ACCEPTED" );
- DEBUG_LOG("Player 1 is: %u (%s)", pl->GetGUIDLow(), pl->GetName());
- DEBUG_LOG("Player 2 is: %u (%s)", plTarget->GetGUIDLow(), plTarget->GetName());
+ DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "WORLD: received CMSG_DUEL_ACCEPTED" );
+ DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "Player 1 is: %u (%s)", pl->GetGUIDLow(), pl->GetName());
+ DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "Player 2 is: %u (%s)", plTarget->GetGUIDLow(), plTarget->GetName());
time_t now = time(NULL);
pl->duel->startTimer = now;
diff --git a/src/game/GameEventMgr.cpp b/src/game/GameEventMgr.cpp
index a6994f6b8..04275c311 100644
--- a/src/game/GameEventMgr.cpp
+++ b/src/game/GameEventMgr.cpp
@@ -25,6 +25,7 @@
#include "Language.h"
#include "Log.h"
#include "MapManager.h"
+#include "BattleGroundMgr.h"
#include "Policies/SingletonImp.h"
INSTANTIATE_SINGLETON_1(GameEventMgr);
@@ -143,7 +144,7 @@ void GameEventMgr::LoadFromDB()
pGameEvent.end = time_t(endtime);
pGameEvent.occurence = fields[3].GetUInt32();
pGameEvent.length = fields[4].GetUInt32();
- pGameEvent.holiday_id = fields[5].GetUInt32();
+ pGameEvent.holiday_id = HolidayIds(fields[5].GetUInt32());
if(pGameEvent.length==0) // length>0 is validity check
@@ -152,12 +153,12 @@ void GameEventMgr::LoadFromDB()
continue;
}
- if(pGameEvent.holiday_id)
+ if(pGameEvent.holiday_id != HOLIDAY_NONE)
{
if(!sHolidaysStore.LookupEntry(pGameEvent.holiday_id))
{
sLog.outErrorDb("`game_event` game event id (%i) have not existed holiday id %u.",event_id,pGameEvent.holiday_id);
- pGameEvent.holiday_id = 0;
+ pGameEvent.holiday_id = HOLIDAY_NONE;
}
}
@@ -454,6 +455,7 @@ uint32 GameEventMgr::Update() // return the next e
// disable any event specific quest (for cases where creature is spawned, but event not active).
UpdateEventQuests(itr, false);
+ UpdateWorldStates(itr, false);
}
}
}
@@ -477,6 +479,7 @@ void GameEventMgr::UnApplyEvent(uint16 event_id)
ChangeEquipOrModel(event_id, false);
// Remove quests that are events only to non event npc
UpdateEventQuests(event_id, false);
+ UpdateWorldStates(event_id, false);
}
void GameEventMgr::ApplyNewEvent(uint16 event_id)
@@ -494,6 +497,7 @@ void GameEventMgr::ApplyNewEvent(uint16 event_id)
ChangeEquipOrModel(event_id, true);
// Add quests that are events only to non event npc
UpdateEventQuests(event_id, true);
+ UpdateWorldStates(event_id, true);
}
void GameEventMgr::GameEventSpawn(int16 event_id)
@@ -733,6 +737,25 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool Activate)
}
}
+void GameEventMgr::UpdateWorldStates(uint16 event_id, bool Activate)
+{
+ GameEventData const& event = mGameEvent[event_id];
+ if (event.holiday_id != HOLIDAY_NONE)
+ {
+ BattleGroundTypeId bgTypeId = BattleGroundMgr::WeekendHolidayIdToBGType(event.holiday_id);
+ if (bgTypeId != BATTLEGROUND_TYPE_NONE)
+ {
+ BattlemasterListEntry const * bl = sBattlemasterListStore.LookupEntry(bgTypeId);
+ if (bl && bl->HolidayWorldStateId)
+ {
+ WorldPacket data;
+ sBattleGroundMgr.BuildUpdateWorldStatePacket(&data, bl->HolidayWorldStateId, Activate ? 1 : 0);
+ sWorld.SendGlobalMessage(&data);
+ }
+ }
+ }
+}
+
GameEventMgr::GameEventMgr()
{
m_IsGameEventsInit = false;
@@ -740,6 +763,9 @@ GameEventMgr::GameEventMgr()
MANGOS_DLL_SPEC bool IsHolidayActive( HolidayIds id )
{
+ if (id == HOLIDAY_NONE)
+ return false;
+
GameEventMgr::GameEventDataMap const& events = sGameEventMgr.GetEventMap();
GameEventMgr::ActiveEvents const& ae = sGameEventMgr.GetActiveEventList();
diff --git a/src/game/GameEventMgr.h b/src/game/GameEventMgr.h
index 92428bd58..39480a9f4 100644
--- a/src/game/GameEventMgr.h
+++ b/src/game/GameEventMgr.h
@@ -31,12 +31,12 @@ class GameObject;
struct GameEventData
{
- GameEventData() : start(1),end(0),occurence(0),length(0) {}
+ GameEventData() : start(1),end(0),occurence(0),length(0), holiday_id(HOLIDAY_NONE) {}
time_t start;
time_t end;
- uint32 occurence;
- uint32 length;
- uint32 holiday_id;
+ uint32 occurence; // Delay in minutes between occurences of the event
+ uint32 length; // Length in minutes of the event
+ HolidayIds holiday_id;
std::string description;
bool isValid() const { return length > 0; }
@@ -76,6 +76,7 @@ class GameEventMgr
void GameEventUnspawn(int16 event_id);
void ChangeEquipOrModel(int16 event_id, bool activate);
void UpdateEventQuests(uint16 event_id, bool Activate);
+ void UpdateWorldStates(uint16 event_id, bool Activate);
protected:
typedef std::list GuidList;
typedef std::list IdList;
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index 1d08d73d4..a446784bb 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -1022,7 +1022,7 @@ void GameObject::Use(Unit* user)
if (info->goober.eventId)
{
- DEBUG_LOG("Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow());
+ DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow());
GetMap()->ScriptsStart(sEventScripts, info->goober.eventId, player, this);
}
@@ -1034,7 +1034,8 @@ void GameObject::Use(Unit* user)
break;
}
- player->CastedCreatureOrGO(info->id, GetObjectGuid(), 0);
+ player->RewardPlayerAndGroupAtCast(this);
+
}
if (uint32 trapEntry = info->goober.linkedTrapId)
diff --git a/src/game/GridMap.cpp b/src/game/GridMap.cpp
new file mode 100644
index 000000000..4df4083b6
--- /dev/null
+++ b/src/game/GridMap.cpp
@@ -0,0 +1,617 @@
+/*
+ * Copyright (C) 2005-2010 MaNGOS
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "MapManager.h"
+#include "Log.h"
+#include "GridStates.h"
+#include "CellImpl.h"
+#include "Map.h"
+#include "Config/ConfigEnv.h"
+#include "DBCEnums.h"
+#include "DBCStores.h"
+#include "GridMap.h"
+#include "VMapFactory.h"
+#include "World.h"
+
+char const* MAP_MAGIC = "MAPS";
+char const* MAP_VERSION_MAGIC = "v1.1";
+char const* MAP_AREA_MAGIC = "AREA";
+char const* MAP_HEIGHT_MAGIC = "MHGT";
+char const* MAP_LIQUID_MAGIC = "MLIQ";
+
+GridMap::GridMap()
+{
+ m_flags = 0;
+
+ // Area data
+ m_gridArea = 0;
+ m_area_map = NULL;
+
+ // Height level data
+ m_gridHeight = INVALID_HEIGHT;
+ m_gridGetHeight = &GridMap::getHeightFromFlat;
+ m_V9 = NULL;
+ m_V8 = NULL;
+
+ // Liquid data
+ m_liquidType = 0;
+ m_liquid_offX = 0;
+ m_liquid_offY = 0;
+ m_liquid_width = 0;
+ m_liquid_height = 0;
+ m_liquidLevel = INVALID_HEIGHT;
+ m_liquid_type = NULL;
+ m_liquid_map = NULL;
+}
+
+GridMap::~GridMap()
+{
+ unloadData();
+}
+
+bool GridMap::loadData(char *filename)
+{
+ // Unload old data if exist
+ unloadData();
+
+ GridMapFileHeader header;
+ // Not return error if file not found
+ FILE *in = fopen(filename, "rb");
+ if (!in)
+ return true;
+
+ fread(&header, sizeof(header),1,in);
+ if (header.mapMagic == *((uint32 const*)(MAP_MAGIC)) &&
+ header.versionMagic == *((uint32 const*)(MAP_VERSION_MAGIC)) &&
+ IsAcceptableClientBuild(header.buildMagic))
+ {
+ // loadup area data
+ if (header.areaMapOffset && !loadAreaData(in, header.areaMapOffset, header.areaMapSize))
+ {
+ sLog.outError("Error loading map area data\n");
+ fclose(in);
+ return false;
+ }
+
+ // loadup height data
+ if (header.heightMapOffset && !loadHeightData(in, header.heightMapOffset, header.heightMapSize))
+ {
+ sLog.outError("Error loading map height data\n");
+ fclose(in);
+ return false;
+ }
+
+ // loadup liquid data
+ if (header.liquidMapOffset && !loadGridMapLiquidData(in, header.liquidMapOffset, header.liquidMapSize))
+ {
+ sLog.outError("Error loading map liquids data\n");
+ fclose(in);
+ return false;
+ }
+
+ fclose(in);
+ return true;
+ }
+
+ sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.", filename);
+ fclose(in);
+ return false;
+}
+
+void GridMap::unloadData()
+{
+ if (m_area_map)
+ delete[] m_area_map;
+
+ if (m_V9)
+ delete[] m_V9;
+
+ if (m_V8)
+ delete[] m_V8;
+
+ if (m_liquid_type)
+ delete[] m_liquid_type;
+
+ if (m_liquid_map)
+ delete[] m_liquid_map;
+
+ m_area_map = NULL;
+ m_V9 = NULL;
+ m_V8 = NULL;
+ m_liquid_type = NULL;
+ m_liquid_map = NULL;
+ m_gridGetHeight = &GridMap::getHeightFromFlat;
+}
+
+bool GridMap::loadAreaData(FILE *in, uint32 offset, uint32 /*size*/)
+{
+ GridMapAreaHeader header;
+ fseek(in, offset, SEEK_SET);
+ fread(&header, sizeof(header), 1, in);
+ if (header.fourcc != *((uint32 const*)(MAP_AREA_MAGIC)))
+ return false;
+
+ m_gridArea = header.gridArea;
+ if (!(header.flags & MAP_AREA_NO_AREA))
+ {
+ m_area_map = new uint16 [16*16];
+ fread(m_area_map, sizeof(uint16), 16*16, in);
+ }
+
+ return true;
+}
+
+bool GridMap::loadHeightData(FILE *in, uint32 offset, uint32 /*size*/)
+{
+ GridMapHeightHeader header;
+ fseek(in, offset, SEEK_SET);
+ fread(&header, sizeof(header), 1, in);
+ if (header.fourcc != *((uint32 const*)(MAP_HEIGHT_MAGIC)))
+ return false;
+
+ m_gridHeight = header.gridHeight;
+ if (!(header.flags & MAP_HEIGHT_NO_HEIGHT))
+ {
+ if ((header.flags & MAP_HEIGHT_AS_INT16))
+ {
+ m_uint16_V9 = new uint16 [129*129];
+ m_uint16_V8 = new uint16 [128*128];
+ fread(m_uint16_V9, sizeof(uint16), 129*129, in);
+ fread(m_uint16_V8, sizeof(uint16), 128*128, in);
+ m_gridIntHeightMultiplier = (header.gridMaxHeight - header.gridHeight) / 65535;
+ m_gridGetHeight = &GridMap::getHeightFromUint16;
+ }
+ else if ((header.flags & MAP_HEIGHT_AS_INT8))
+ {
+ m_uint8_V9 = new uint8 [129*129];
+ m_uint8_V8 = new uint8 [128*128];
+ fread(m_uint8_V9, sizeof(uint8), 129*129, in);
+ fread(m_uint8_V8, sizeof(uint8), 128*128, in);
+ m_gridIntHeightMultiplier = (header.gridMaxHeight - header.gridHeight) / 255;
+ m_gridGetHeight = &GridMap::getHeightFromUint8;
+ }
+ else
+ {
+ m_V9 = new float [129*129];
+ m_V8 = new float [128*128];
+ fread(m_V9, sizeof(float), 129*129, in);
+ fread(m_V8, sizeof(float), 128*128, in);
+ m_gridGetHeight = &GridMap::getHeightFromFloat;
+ }
+ }
+ else
+ m_gridGetHeight = &GridMap::getHeightFromFlat;
+
+ return true;
+}
+
+bool GridMap::loadGridMapLiquidData(FILE *in, uint32 offset, uint32 /*size*/)
+{
+ GridMapLiquidHeader header;
+ fseek(in, offset, SEEK_SET);
+ fread(&header, sizeof(header), 1, in);
+ if (header.fourcc != *((uint32 const*)(MAP_LIQUID_MAGIC)))
+ return false;
+
+ m_liquidType = header.liquidType;
+ m_liquid_offX = header.offsetX;
+ m_liquid_offY = header.offsetY;
+ m_liquid_width = header.width;
+ m_liquid_height = header.height;
+ m_liquidLevel = header.liquidLevel;
+
+ if (!(header.flags & MAP_LIQUID_NO_TYPE))
+ {
+ m_liquid_type = new uint8 [16*16];
+ fread(m_liquid_type, sizeof(uint8), 16*16, in);
+ }
+
+ if (!(header.flags & MAP_LIQUID_NO_HEIGHT))
+ {
+ m_liquid_map = new float [m_liquid_width*m_liquid_height];
+ fread(m_liquid_map, sizeof(float), m_liquid_width*m_liquid_height, in);
+ }
+
+ return true;
+}
+
+uint16 GridMap::getArea(float x, float y)
+{
+ if (!m_area_map)
+ return m_gridArea;
+
+ x = 16 * (32 - x/SIZE_OF_GRIDS);
+ y = 16 * (32 - y/SIZE_OF_GRIDS);
+ int lx = (int)x & 15;
+ int ly = (int)y & 15;
+ return m_area_map[lx*16 + ly];
+}
+
+float GridMap::getHeightFromFlat(float /*x*/, float /*y*/) const
+{
+ return m_gridHeight;
+}
+
+float GridMap::getHeightFromFloat(float x, float y) const
+{
+ if (!m_V8 || !m_V9)
+ return m_gridHeight;
+
+ x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
+ y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
+
+ int x_int = (int)x;
+ int y_int = (int)y;
+ x -= x_int;
+ y -= y_int;
+ x_int &= (MAP_RESOLUTION - 1);
+ y_int &= (MAP_RESOLUTION - 1);
+
+ // Height stored as: h5 - its v8 grid, h1-h4 - its v9 grid
+ // +--------------> X
+ // | h1-------h2 Coordinates is:
+ // | | \ 1 / | h1 0,0
+ // | | \ / | h2 0,1
+ // | | 2 h5 3 | h3 1,0
+ // | | / \ | h4 1,1
+ // | | / 4 \ | h5 1/2,1/2
+ // | h3-------h4
+ // V Y
+ // For find height need
+ // 1 - detect triangle
+ // 2 - solve linear equation from triangle points
+ // Calculate coefficients for solve h = a*x + b*y + c
+
+ float a,b,c;
+ // Select triangle:
+ if (x+y < 1)
+ {
+ if (x > y)
+ {
+ // 1 triangle (h1, h2, h5 points)
+ float h1 = m_V9[(x_int )*129 + y_int];
+ float h2 = m_V9[(x_int+1)*129 + y_int];
+ float h5 = 2 * m_V8[x_int*128 + y_int];
+ a = h2-h1;
+ b = h5-h1-h2;
+ c = h1;
+ }
+ else
+ {
+ // 2 triangle (h1, h3, h5 points)
+ float h1 = m_V9[x_int*129 + y_int ];
+ float h3 = m_V9[x_int*129 + y_int+1];
+ float h5 = 2 * m_V8[x_int*128 + y_int];
+ a = h5 - h1 - h3;
+ b = h3 - h1;
+ c = h1;
+ }
+ }
+ else
+ {
+ if (x > y)
+ {
+ // 3 triangle (h2, h4, h5 points)
+ float h2 = m_V9[(x_int+1)*129 + y_int ];
+ float h4 = m_V9[(x_int+1)*129 + y_int+1];
+ float h5 = 2 * m_V8[x_int*128 + y_int];
+ a = h2 + h4 - h5;
+ b = h4 - h2;
+ c = h5 - h4;
+ }
+ else
+ {
+ // 4 triangle (h3, h4, h5 points)
+ float h3 = m_V9[(x_int )*129 + y_int+1];
+ float h4 = m_V9[(x_int+1)*129 + y_int+1];
+ float h5 = 2 * m_V8[x_int*128 + y_int];
+ a = h4 - h3;
+ b = h3 + h4 - h5;
+ c = h5 - h4;
+ }
+ }
+ // Calculate height
+ return a * x + b * y + c;
+}
+
+float GridMap::getHeightFromUint8(float x, float y) const
+{
+ if (!m_uint8_V8 || !m_uint8_V9)
+ return m_gridHeight;
+
+ x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
+ y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
+
+ int x_int = (int)x;
+ int y_int = (int)y;
+ x -= x_int;
+ y -= y_int;
+ x_int &= (MAP_RESOLUTION - 1);
+ y_int &= (MAP_RESOLUTION - 1);
+
+ int32 a, b, c;
+ uint8 *V9_h1_ptr = &m_uint8_V9[x_int*128 + x_int + y_int];
+ if (x+y < 1)
+ {
+ if (x > y)
+ {
+ // 1 triangle (h1, h2, h5 points)
+ int32 h1 = V9_h1_ptr[ 0];
+ int32 h2 = V9_h1_ptr[129];
+ int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
+ a = h2-h1;
+ b = h5-h1-h2;
+ c = h1;
+ }
+ else
+ {
+ // 2 triangle (h1, h3, h5 points)
+ int32 h1 = V9_h1_ptr[0];
+ int32 h3 = V9_h1_ptr[1];
+ int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
+ a = h5 - h1 - h3;
+ b = h3 - h1;
+ c = h1;
+ }
+ }
+ else
+ {
+ if (x > y)
+ {
+ // 3 triangle (h2, h4, h5 points)
+ int32 h2 = V9_h1_ptr[129];
+ int32 h4 = V9_h1_ptr[130];
+ int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
+ a = h2 + h4 - h5;
+ b = h4 - h2;
+ c = h5 - h4;
+ }
+ else
+ {
+ // 4 triangle (h3, h4, h5 points)
+ int32 h3 = V9_h1_ptr[ 1];
+ int32 h4 = V9_h1_ptr[130];
+ int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
+ a = h4 - h3;
+ b = h3 + h4 - h5;
+ c = h5 - h4;
+ }
+ }
+
+ // Calculate height
+ return (float)((a * x) + (b * y) + c)*m_gridIntHeightMultiplier + m_gridHeight;
+}
+
+float GridMap::getHeightFromUint16(float x, float y) const
+{
+ if (!m_uint16_V8 || !m_uint16_V9)
+ return m_gridHeight;
+
+ x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
+ y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
+
+ int x_int = (int)x;
+ int y_int = (int)y;
+ x -= x_int;
+ y -= y_int;
+ x_int &= (MAP_RESOLUTION - 1);
+ y_int &= (MAP_RESOLUTION - 1);
+
+ int32 a, b, c;
+ uint16 *V9_h1_ptr = &m_uint16_V9[x_int*128 + x_int + y_int];
+ if (x+y < 1)
+ {
+ if (x > y)
+ {
+ // 1 triangle (h1, h2, h5 points)
+ int32 h1 = V9_h1_ptr[ 0];
+ int32 h2 = V9_h1_ptr[129];
+ int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
+ a = h2-h1;
+ b = h5-h1-h2;
+ c = h1;
+ }
+ else
+ {
+ // 2 triangle (h1, h3, h5 points)
+ int32 h1 = V9_h1_ptr[0];
+ int32 h3 = V9_h1_ptr[1];
+ int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
+ a = h5 - h1 - h3;
+ b = h3 - h1;
+ c = h1;
+ }
+ }
+ else
+ {
+ if (x > y)
+ {
+ // 3 triangle (h2, h4, h5 points)
+ int32 h2 = V9_h1_ptr[129];
+ int32 h4 = V9_h1_ptr[130];
+ int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
+ a = h2 + h4 - h5;
+ b = h4 - h2;
+ c = h5 - h4;
+ }
+ else
+ {
+ // 4 triangle (h3, h4, h5 points)
+ int32 h3 = V9_h1_ptr[ 1];
+ int32 h4 = V9_h1_ptr[130];
+ int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
+ a = h4 - h3;
+ b = h3 + h4 - h5;
+ c = h5 - h4;
+ }
+ }
+
+ // Calculate height
+ return (float)((a * x) + (b * y) + c)*m_gridIntHeightMultiplier + m_gridHeight;
+}
+
+float GridMap::getLiquidLevel(float x, float y)
+{
+ if (!m_liquid_map)
+ return m_liquidLevel;
+
+ x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
+ y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
+
+ int cx_int = ((int)x & (MAP_RESOLUTION-1)) - m_liquid_offY;
+ int cy_int = ((int)y & (MAP_RESOLUTION-1)) - m_liquid_offX;
+
+ if (cx_int < 0 || cx_int >=m_liquid_height)
+ return INVALID_HEIGHT;
+
+ if (cy_int < 0 || cy_int >=m_liquid_width )
+ return INVALID_HEIGHT;
+
+ return m_liquid_map[cx_int*m_liquid_width + cy_int];
+}
+
+uint8 GridMap::getTerrainType(float x, float y)
+{
+ if (!m_liquid_type)
+ return (uint8)m_liquidType;
+
+ x = 16 * (32 - x/SIZE_OF_GRIDS);
+ y = 16 * (32 - y/SIZE_OF_GRIDS);
+ int lx = (int)x & 15;
+ int ly = (int)y & 15;
+ return m_liquid_type[lx*16 + ly];
+}
+
+// Get water state on map
+GridMapLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, GridMapLiquidData *data)
+{
+ // Check water type (if no water return)
+ if (!m_liquid_type && !m_liquidType)
+ return LIQUID_MAP_NO_WATER;
+
+ // Get cell
+ float cx = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
+ float cy = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
+
+ int x_int = (int)cx & (MAP_RESOLUTION-1);
+ int y_int = (int)cy & (MAP_RESOLUTION-1);
+
+ // Check water type in cell
+ uint8 type = m_liquid_type ? m_liquid_type[(x_int>>3)*16 + (y_int>>3)] : m_liquidType;
+ if (type == 0)
+ return LIQUID_MAP_NO_WATER;
+
+ // Check req liquid type mask
+ if (ReqLiquidType && !(ReqLiquidType&type))
+ return LIQUID_MAP_NO_WATER;
+
+ // Check water level:
+ // Check water height map
+ int lx_int = x_int - m_liquid_offY;
+ if (lx_int < 0 || lx_int >=m_liquid_height)
+ return LIQUID_MAP_NO_WATER;
+
+ int ly_int = y_int - m_liquid_offX;
+ if (ly_int < 0 || ly_int >=m_liquid_width )
+ return LIQUID_MAP_NO_WATER;
+
+ // Get water level
+ float liquid_level = m_liquid_map ? m_liquid_map[lx_int*m_liquid_width + ly_int] : m_liquidLevel;
+
+ // Get ground level (sub 0.2 for fix some errors)
+ float ground_level = getHeight(x, y);
+
+ // Check water level and ground level
+ if (liquid_level < ground_level || z < ground_level - 2)
+ return LIQUID_MAP_NO_WATER;
+
+ // All ok in water -> store data
+ if (data)
+ {
+ data->type = type;
+ data->level = liquid_level;
+ data->depth_level = ground_level;
+ }
+
+ // For speed check as int values
+ int delta = int((liquid_level - z) * 10);
+
+ // Get position delta
+ if (delta > 20) // Under water
+ return LIQUID_MAP_UNDER_WATER;
+
+ if (delta > 0 ) // In water
+ return LIQUID_MAP_IN_WATER;
+
+ if (delta > -1) // Walk on water
+ return LIQUID_MAP_WATER_WALK;
+ // Above water
+ return LIQUID_MAP_ABOVE_WATER;
+}
+
+bool GridMap::ExistMap(uint32 mapid,int gx,int gy)
+{
+ int len = sWorld.GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1;
+ char* tmp = new char[len];
+ snprintf(tmp, len, (char *)(sWorld.GetDataPath()+"maps/%03u%02u%02u.map").c_str(),mapid,gx,gy);
+
+ FILE *pf=fopen(tmp,"rb");
+
+ if(!pf)
+ {
+ sLog.outError("Check existing of map file '%s': not exist!",tmp);
+ delete[] tmp;
+ return false;
+ }
+
+ GridMapFileHeader header;
+ fread(&header, sizeof(header), 1, pf);
+ if (header.mapMagic != *((uint32 const*)(MAP_MAGIC)) ||
+ header.versionMagic != *((uint32 const*)(MAP_VERSION_MAGIC)) ||
+ !IsAcceptableClientBuild(header.buildMagic))
+ {
+ sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.",tmp);
+ delete [] tmp;
+ fclose(pf); //close file before return
+ return false;
+ }
+
+ delete [] tmp;
+ fclose(pf);
+ return true;
+}
+
+bool GridMap::ExistVMap(uint32 mapid,int gx,int gy)
+{
+ if(VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager())
+ {
+ if(vmgr->isMapLoadingEnabled())
+ {
+ // x and y are swapped !! => fixed now
+ bool exists = vmgr->existsMap((sWorld.GetDataPath()+ "vmaps").c_str(), mapid, gx,gy);
+ if(!exists)
+ {
+ std::string name = vmgr->getDirFileName(mapid,gx,gy);
+ sLog.outError("VMap file '%s' is missing or point to wrong version vmap file, redo vmaps with latest vmap_assembler.exe program", (sWorld.GetDataPath()+"vmaps/"+name).c_str());
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
diff --git a/src/game/GridMap.h b/src/game/GridMap.h
new file mode 100644
index 000000000..adc3421fd
--- /dev/null
+++ b/src/game/GridMap.h
@@ -0,0 +1,183 @@
+/*
+ * Copyright (C) 2005-2010 MaNGOS
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MANGOS_GRIDMAP_H
+#define MANGOS_GRIDMAP_H
+
+#include "Platform/Define.h"
+#include "DBCStructure.h"
+#include "GridDefines.h"
+#include "Object.h"
+#include "SharedDefines.h"
+
+#include
+#include
+
+class Creature;
+class Unit;
+class WorldPacket;
+class InstanceData;
+class Group;
+class InstanceSave;
+struct ScriptInfo;
+struct ScriptAction;
+class BattleGround;
+
+struct GridMapFileHeader
+{
+ uint32 mapMagic;
+ uint32 versionMagic;
+ uint32 buildMagic;
+ uint32 areaMapOffset;
+ uint32 areaMapSize;
+ uint32 heightMapOffset;
+ uint32 heightMapSize;
+ uint32 liquidMapOffset;
+ uint32 liquidMapSize;
+};
+
+#define MAP_AREA_NO_AREA 0x0001
+
+struct GridMapAreaHeader
+{
+ uint32 fourcc;
+ uint16 flags;
+ uint16 gridArea;
+};
+
+#define MAP_HEIGHT_NO_HEIGHT 0x0001
+#define MAP_HEIGHT_AS_INT16 0x0002
+#define MAP_HEIGHT_AS_INT8 0x0004
+
+struct GridMapHeightHeader
+{
+ uint32 fourcc;
+ uint32 flags;
+ float gridHeight;
+ float gridMaxHeight;
+};
+
+#define MAP_LIQUID_NO_TYPE 0x0001
+#define MAP_LIQUID_NO_HEIGHT 0x0002
+
+struct GridMapLiquidHeader
+{
+ uint32 fourcc;
+ uint16 flags;
+ uint16 liquidType;
+ uint8 offsetX;
+ uint8 offsetY;
+ uint8 width;
+ uint8 height;
+ float liquidLevel;
+};
+
+enum GridMapLiquidStatus
+{
+ LIQUID_MAP_NO_WATER = 0x00000000,
+ LIQUID_MAP_ABOVE_WATER = 0x00000001,
+ LIQUID_MAP_WATER_WALK = 0x00000002,
+ LIQUID_MAP_IN_WATER = 0x00000004,
+ LIQUID_MAP_UNDER_WATER = 0x00000008
+};
+
+#define MAP_LIQUID_TYPE_NO_WATER 0x00
+#define MAP_LIQUID_TYPE_WATER 0x01
+#define MAP_LIQUID_TYPE_OCEAN 0x02
+#define MAP_LIQUID_TYPE_MAGMA 0x04
+#define MAP_LIQUID_TYPE_SLIME 0x08
+
+#define MAP_ALL_LIQUIDS (MAP_LIQUID_TYPE_WATER | MAP_LIQUID_TYPE_OCEAN | MAP_LIQUID_TYPE_MAGMA | MAP_LIQUID_TYPE_SLIME)
+
+#define MAP_LIQUID_TYPE_DARK_WATER 0x10
+#define MAP_LIQUID_TYPE_WMO_WATER 0x20
+
+struct GridMapLiquidData
+{
+ uint32 type;
+ float level;
+ float depth_level;
+};
+
+class GridMap
+{
+ private:
+
+ uint32 m_flags;
+
+ // Area data
+ uint16 m_gridArea;
+ uint16 *m_area_map;
+
+ // Height level data
+ float m_gridHeight;
+ float m_gridIntHeightMultiplier;
+ union
+ {
+ float *m_V9;
+ uint16 *m_uint16_V9;
+ uint8 *m_uint8_V9;
+ };
+ union
+ {
+ float *m_V8;
+ uint16 *m_uint16_V8;
+ uint8 *m_uint8_V8;
+ };
+
+ // Liquid data
+ uint16 m_liquidType;
+ uint8 m_liquid_offX;
+ uint8 m_liquid_offY;
+ uint8 m_liquid_width;
+ uint8 m_liquid_height;
+ float m_liquidLevel;
+ uint8 *m_liquid_type;
+ float *m_liquid_map;
+
+ bool loadAreaData(FILE *in, uint32 offset, uint32 size);
+ bool loadHeightData(FILE *in, uint32 offset, uint32 size);
+ bool loadGridMapLiquidData(FILE *in, uint32 offset, uint32 size);
+
+ // Get height functions and pointers
+ typedef float (GridMap::*pGetHeightPtr) (float x, float y) const;
+ pGetHeightPtr m_gridGetHeight;
+ float getHeightFromFloat(float x, float y) const;
+ float getHeightFromUint16(float x, float y) const;
+ float getHeightFromUint8(float x, float y) const;
+ float getHeightFromFlat(float x, float y) const;
+
+ public:
+
+ GridMap();
+ ~GridMap();
+
+ bool loadData(char *filaname);
+ void unloadData();
+
+ static bool ExistMap(uint32 mapid, int gx, int gy);
+ static bool ExistVMap(uint32 mapid, int gx, int gy);
+
+ uint16 getArea(float x, float y);
+ float getHeight(float x, float y) { return (this->*m_gridGetHeight)(x, y); }
+ float getLiquidLevel(float x, float y);
+ uint8 getTerrainType(float x, float y);
+ GridMapLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, GridMapLiquidData *data = 0);
+};
+
+#endif
diff --git a/src/game/GridNotifiers.cpp b/src/game/GridNotifiers.cpp
index 390ac7121..30d977c40 100644
--- a/src/game/GridNotifiers.cpp
+++ b/src/game/GridNotifiers.cpp
@@ -53,7 +53,7 @@ VisibleNotifier::Notify()
{
// ignore far sight case
(*itr)->UpdateVisibilityOf((*itr),&i_player);
- i_player.UpdateVisibilityOf(&i_player,(*itr),i_data,i_data_updates,i_visibleNow);
+ i_player.UpdateVisibilityOf(&i_player,(*itr),i_data,i_visibleNow);
i_clientGUIDs.erase((*itr)->GetGUID());
}
}
@@ -68,17 +68,6 @@ VisibleNotifier::Notify()
DEBUG_FILTER_LOG(LOG_FILTER_VISIBILITY_CHANGES, "%s is out of range (no in active cells set) now for player %u",itr->GetString().c_str(),i_player.GetGUIDLow());
}
- // send update to other players (except player updates that already sent using SendUpdateToPlayer)
- for(UpdateDataMapType::iterator iter = i_data_updates.begin(); iter != i_data_updates.end(); ++iter)
- {
- if(iter->first==&i_player)
- continue;
-
- WorldPacket packet;
- iter->second.BuildPacket(&packet);
- iter->first->GetSession()->SendPacket(&packet);
- }
-
if( i_data.HasData() )
{
// send create/outofrange packet to player (except player create updates that already sent using SendUpdateToPlayer)
diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h
index 46b51eb95..cd7614352 100644
--- a/src/game/GridNotifiers.h
+++ b/src/game/GridNotifiers.h
@@ -40,7 +40,6 @@ namespace MaNGOS
{
Player &i_player;
UpdateData i_data;
- UpdateDataMapType i_data_updates;
ObjectGuidSet i_clientGUIDs;
std::set i_visibleNow;
diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h
index 10f6daf1b..192d52f5d 100644
--- a/src/game/GridNotifiersImpl.h
+++ b/src/game/GridNotifiersImpl.h
@@ -29,39 +29,36 @@
#include "DBCEnums.h"
template
-inline void
-MaNGOS::VisibleNotifier::Visit(GridRefManager &m)
+inline void MaNGOS::VisibleNotifier::Visit(GridRefManager &m)
{
WorldObject const* viewPoint = i_player.GetViewPoint();
for(typename GridRefManager::iterator iter = m.begin(); iter != m.end(); ++iter)
{
- i_player.UpdateVisibilityOf(viewPoint,iter->getSource(),i_data,i_data_updates,i_visibleNow);
+ i_player.UpdateVisibilityOf(viewPoint,iter->getSource(), i_data, i_visibleNow);
i_clientGUIDs.erase(iter->getSource()->GetGUID());
}
}
-inline void
-MaNGOS::ObjectUpdater::Visit(CreatureMapType &m)
+inline void MaNGOS::ObjectUpdater::Visit(CreatureMapType &m)
{
- for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
+ for(CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
iter->getSource()->Update(i_timeDiff);
}
-inline void
-MaNGOS::PlayerRelocationNotifier::Visit(PlayerMapType &m)
+inline void MaNGOS::PlayerRelocationNotifier::Visit(PlayerMapType &m)
{
- for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
+ for(PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
- if(&i_player==iter->getSource())
+ if (&i_player==iter->getSource())
continue;
// visibility for players updated by ObjectAccessor::UpdateVisibilityFor calls in appropriate places
// Cancel Trade
- if(i_player.GetTrader()==iter->getSource())
+ if (i_player.GetTrader()==iter->getSource())
// iteraction distance
- if(!i_player.IsWithinDistInMap(iter->getSource(), 5))
+ if (!i_player.IsWithinDistInMap(iter->getSource(), INTERACTION_DISTANCE))
i_player.GetSession()->SendCancelTrade(); // will clode both side trade windows
}
}
@@ -72,44 +69,42 @@ inline void PlayerCreatureRelocationWorker(Player* pl, WorldObject const* viewPo
pl->UpdateVisibilityOf(viewPoint,c);
// Creature AI reaction
- if(!c->hasUnitState(UNIT_STAT_FLEEING))
+ if (!c->hasUnitState(UNIT_STAT_FLEEING))
{
- if( c->AI() && c->AI()->IsVisible(pl) && !c->IsInEvadeMode() )
+ if (c->AI() && c->AI()->IsVisible(pl) && !c->IsInEvadeMode())
c->AI()->MoveInLineOfSight(pl);
}
}
inline void CreatureCreatureRelocationWorker(Creature* c1, Creature* c2)
{
- if(!c1->hasUnitState(UNIT_STAT_FLEEING))
+ if (!c1->hasUnitState(UNIT_STAT_FLEEING))
{
- if( c1->AI() && c1->AI()->IsVisible(c2) && !c1->IsInEvadeMode() )
+ if (c1->AI() && c1->AI()->IsVisible(c2) && !c1->IsInEvadeMode())
c1->AI()->MoveInLineOfSight(c2);
}
- if(!c2->hasUnitState(UNIT_STAT_FLEEING))
+ if (!c2->hasUnitState(UNIT_STAT_FLEEING))
{
- if( c2->AI() && c2->AI()->IsVisible(c1) && !c2->IsInEvadeMode() )
+ if (c2->AI() && c2->AI()->IsVisible(c1) && !c2->IsInEvadeMode())
c2->AI()->MoveInLineOfSight(c1);
}
}
-inline void
-MaNGOS::PlayerRelocationNotifier::Visit(CreatureMapType &m)
+inline void MaNGOS::PlayerRelocationNotifier::Visit(CreatureMapType &m)
{
- if(!i_player.isAlive() || i_player.isInFlight())
+ if (!i_player.isAlive() || i_player.isInFlight())
return;
WorldObject const* viewPoint = i_player.GetViewPoint();
- for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
+ for(CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
if (iter->getSource()->isAlive())
- PlayerCreatureRelocationWorker(&i_player,viewPoint,iter->getSource());
+ PlayerCreatureRelocationWorker(&i_player, viewPoint, iter->getSource());
}
template<>
-inline void
-MaNGOS::CreatureRelocationNotifier::Visit(PlayerMapType &m)
+inline void MaNGOS::CreatureRelocationNotifier::Visit(PlayerMapType &m)
{
if(!i_creature.isAlive())
return;
@@ -121,26 +116,25 @@ MaNGOS::CreatureRelocationNotifier::Visit(PlayerMapType &m)
}
template<>
-inline void
-MaNGOS::CreatureRelocationNotifier::Visit(CreatureMapType &m)
+inline void MaNGOS::CreatureRelocationNotifier::Visit(CreatureMapType &m)
{
- if(!i_creature.isAlive())
+ if (!i_creature.isAlive())
return;
- for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
+ for(CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
Creature* c = iter->getSource();
- if( c != &i_creature && c->isAlive())
+ if (c != &i_creature && c->isAlive())
CreatureCreatureRelocationWorker(c, &i_creature);
}
}
inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
{
- if(!target->isAlive() || target->isInFlight() )
+ if (!target->isAlive() || target->isInFlight() )
return;
- if(target->GetTypeId()==TYPEID_UNIT && ((Creature*)target)->isTotem())
+ if (target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->isTotem())
return;
if (!i_dynobject.IsWithinDistInMap(target, i_dynobject.GetRadius()))
@@ -151,14 +145,14 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
return;
// Evade target
- if( target->GetTypeId()==TYPEID_UNIT && ((Creature*)target)->IsInEvadeMode() )
+ if (target->GetTypeId()==TYPEID_UNIT && ((Creature*)target)->IsInEvadeMode())
return;
//Check player targets and remove if in GM mode or GM invisibility (for not self casting case)
- if( target->GetTypeId()==TYPEID_PLAYER && target != i_check && (((Player*)target)->isGameMaster() || ((Player*)target)->GetVisibility()==VISIBILITY_OFF) )
+ if (target->GetTypeId() == TYPEID_PLAYER && target != i_check && (((Player*)target)->isGameMaster() || ((Player*)target)->GetVisibility() == VISIBILITY_OFF))
return;
- if (i_check->GetTypeId()==TYPEID_PLAYER )
+ if (i_check->GetTypeId() == TYPEID_PLAYER )
{
if (i_check->IsFriendlyTo( target ))
return;
@@ -174,9 +168,11 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
SpellEntry const *spellInfo = sSpellStore.LookupEntry(i_dynobject.GetSpellId());
SpellEffectIndex eff_index = i_dynobject.GetEffIndex();
+
// Check target immune to spell or aura
if (target->IsImmunedToSpell(spellInfo) || target->IsImmunedToSpellEffect(spellInfo, eff_index))
return;
+
// Apply PersistentAreaAura on target
PersistentAreaAura* Aur = new PersistentAreaAura(spellInfo, eff_index, NULL, target, i_dynobject.GetCaster());
target->AddAura(Aur);
@@ -184,18 +180,16 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
}
template<>
-inline void
-MaNGOS::DynamicObjectUpdater::Visit(CreatureMapType &m)
+inline void MaNGOS::DynamicObjectUpdater::Visit(CreatureMapType &m)
{
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
VisitHelper(itr->getSource());
}
template<>
-inline void
-MaNGOS::DynamicObjectUpdater::Visit(PlayerMapType &m)
+inline void MaNGOS::DynamicObjectUpdater::Visit(PlayerMapType &m)
{
- for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ for(PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
VisitHelper(itr->getSource());
}
@@ -207,12 +201,12 @@ template
void MaNGOS::WorldObjectSearcher::Visit(GameObjectMapType &m)
{
// already found
- if(i_object)
+ if (i_object)
return;
- for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ for(GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if(!itr->getSource()->InSamePhase(i_phaseMask))
+ if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
if (i_check(itr->getSource()))
@@ -227,15 +221,15 @@ template
void MaNGOS::WorldObjectSearcher::Visit(PlayerMapType &m)
{
// already found
- if(i_object)
+ if (i_object)
return;
- for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ for(PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if(!itr->getSource()->InSamePhase(i_phaseMask))
+ if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
- if(i_check(itr->getSource()))
+ if (i_check(itr->getSource()))
{
i_object = itr->getSource();
return;
@@ -247,15 +241,15 @@ template
void MaNGOS::WorldObjectSearcher::Visit(CreatureMapType &m)
{
// already found
- if(i_object)
+ if (i_object)
return;
- for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ for(CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if(!itr->getSource()->InSamePhase(i_phaseMask))
+ if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
- if(i_check(itr->getSource()))
+ if (i_check(itr->getSource()))
{
i_object = itr->getSource();
return;
@@ -267,15 +261,15 @@ template
void MaNGOS::WorldObjectSearcher::Visit(CorpseMapType &m)
{
// already found
- if(i_object)
+ if (i_object)
return;
- for(CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ for(CorpseMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if(!itr->getSource()->InSamePhase(i_phaseMask))
+ if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
- if(i_check(itr->getSource()))
+ if (i_check(itr->getSource()))
{
i_object = itr->getSource();
return;
@@ -287,15 +281,15 @@ template
void MaNGOS::WorldObjectSearcher::Visit(DynamicObjectMapType &m)
{
// already found
- if(i_object)
+ if (i_object)
return;
- for(DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ for(DynamicObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if(!itr->getSource()->InSamePhase(i_phaseMask))
+ if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
- if(i_check(itr->getSource()))
+ if (i_check(itr->getSource()))
{
i_object = itr->getSource();
return;
@@ -306,45 +300,45 @@ void MaNGOS::WorldObjectSearcher::Visit(DynamicObjectMapType &m)
template
void MaNGOS::WorldObjectListSearcher::Visit(PlayerMapType &m)
{
- for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(itr->getSource()->InSamePhase(i_phaseMask))
- if(i_check(itr->getSource()))
+ for(PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
+ if (itr->getSource()->InSamePhase(i_phaseMask))
+ if (i_check(itr->getSource()))
i_objects.push_back(itr->getSource());
}
template
void MaNGOS::WorldObjectListSearcher::Visit(CreatureMapType &m)
{
- for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(itr->getSource()->InSamePhase(i_phaseMask))
- if(i_check(itr->getSource()))
+ for(CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
+ if (itr->getSource()->InSamePhase(i_phaseMask))
+ if (i_check(itr->getSource()))
i_objects.push_back(itr->getSource());
}
template
void MaNGOS::WorldObjectListSearcher::Visit(CorpseMapType &m)
{
- for(CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(itr->getSource()->InSamePhase(i_phaseMask))
- if(i_check(itr->getSource()))
+ for(CorpseMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
+ if (itr->getSource()->InSamePhase(i_phaseMask))
+ if (i_check(itr->getSource()))
i_objects.push_back(itr->getSource());
}
template
void MaNGOS::WorldObjectListSearcher::Visit(GameObjectMapType &m)
{
- for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(itr->getSource()->InSamePhase(i_phaseMask))
- if(i_check(itr->getSource()))
+ for(GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
+ if (itr->getSource()->InSamePhase(i_phaseMask))
+ if (i_check(itr->getSource()))
i_objects.push_back(itr->getSource());
}
template
void MaNGOS::WorldObjectListSearcher::Visit(DynamicObjectMapType &m)
{
- for(DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(itr->getSource()->InSamePhase(i_phaseMask))
- if(i_check(itr->getSource()))
+ for(DynamicObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
+ if (itr->getSource()->InSamePhase(i_phaseMask))
+ if (i_check(itr->getSource()))
i_objects.push_back(itr->getSource());
}
@@ -354,15 +348,15 @@ template
void MaNGOS::GameObjectSearcher::Visit(GameObjectMapType &m)
{
// already found
- if(i_object)
+ if (i_object)
return;
- for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ for(GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if(!itr->getSource()->InSamePhase(i_phaseMask))
+ if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
- if(i_check(itr->getSource()))
+ if (i_check(itr->getSource()))
{
i_object = itr->getSource();
return;
@@ -373,12 +367,12 @@ void MaNGOS::GameObjectSearcher::Visit(GameObjectMapType &m)
template
void MaNGOS::GameObjectLastSearcher::Visit(GameObjectMapType &m)
{
- for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ for(GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if(!itr->getSource()->InSamePhase(i_phaseMask))
+ if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
- if(i_check(itr->getSource()))
+ if (i_check(itr->getSource()))
i_object = itr->getSource();
}
}
@@ -386,9 +380,9 @@ void MaNGOS::GameObjectLastSearcher::Visit(GameObjectMapType &m)
template
void MaNGOS::GameObjectListSearcher::Visit(GameObjectMapType &m)
{
- for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(itr->getSource()->InSamePhase(i_phaseMask))
- if(i_check(itr->getSource()))
+ for(GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
+ if (itr->getSource()->InSamePhase(i_phaseMask))
+ if (i_check(itr->getSource()))
i_objects.push_back(itr->getSource());
}
@@ -398,15 +392,15 @@ template
void MaNGOS::UnitSearcher::Visit(CreatureMapType &m)
{
// already found
- if(i_object)
+ if (i_object)
return;
- for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ for(CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if(!itr->getSource()->InSamePhase(i_phaseMask))
+ if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
- if(i_check(itr->getSource()))
+ if (i_check(itr->getSource()))
{
i_object = itr->getSource();
return;
@@ -418,15 +412,15 @@ template
void MaNGOS::UnitSearcher::Visit(PlayerMapType &m)
{
// already found
- if(i_object)
+ if (i_object)
return;
- for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ for(PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if(!itr->getSource()->InSamePhase(i_phaseMask))
+ if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
- if(i_check(itr->getSource()))
+ if (i_check(itr->getSource()))
{
i_object = itr->getSource();
return;
@@ -437,12 +431,12 @@ void MaNGOS::UnitSearcher::Visit(PlayerMapType &m)
template
void MaNGOS::UnitLastSearcher::Visit(CreatureMapType &m)
{
- for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ for(CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if(!itr->getSource()->InSamePhase(i_phaseMask))
+ if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
- if(i_check(itr->getSource()))
+ if (i_check(itr->getSource()))
i_object = itr->getSource();
}
}
@@ -450,12 +444,12 @@ void MaNGOS::UnitLastSearcher::Visit(CreatureMapType &m)
template
void MaNGOS::UnitLastSearcher::Visit(PlayerMapType &m)
{
- for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ for(PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if(!itr->getSource()->InSamePhase(i_phaseMask))
+ if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
- if(i_check(itr->getSource()))
+ if (i_check(itr->getSource()))
i_object = itr->getSource();
}
}
@@ -463,18 +457,18 @@ void MaNGOS::UnitLastSearcher::Visit(PlayerMapType &m)
template
void MaNGOS::UnitListSearcher::Visit(PlayerMapType &m)
{
- for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(itr->getSource()->InSamePhase(i_phaseMask))
- if(i_check(itr->getSource()))
+ for(PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
+ if (itr->getSource()->InSamePhase(i_phaseMask))
+ if (i_check(itr->getSource()))
i_objects.push_back(itr->getSource());
}
template
void MaNGOS::UnitListSearcher::Visit(CreatureMapType &m)
{
- for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(itr->getSource()->InSamePhase(i_phaseMask))
- if(i_check(itr->getSource()))
+ for(CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
+ if (itr->getSource()->InSamePhase(i_phaseMask))
+ if (i_check(itr->getSource()))
i_objects.push_back(itr->getSource());
}
@@ -484,15 +478,15 @@ template
void MaNGOS::CreatureSearcher::Visit(CreatureMapType &m)
{
// already found
- if(i_object)
+ if (i_object)
return;
- for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ for(CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if(!itr->getSource()->InSamePhase(i_phaseMask))
+ if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
- if(i_check(itr->getSource()))
+ if (i_check(itr->getSource()))
{
i_object = itr->getSource();
return;
@@ -503,12 +497,12 @@ void MaNGOS::CreatureSearcher::Visit(CreatureMapType &m)
template
void MaNGOS::CreatureLastSearcher::Visit(CreatureMapType &m)
{
- for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ for(CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if(!itr->getSource()->InSamePhase(i_phaseMask))
+ if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
- if(i_check(itr->getSource()))
+ if (i_check(itr->getSource()))
i_object = itr->getSource();
}
}
@@ -516,9 +510,9 @@ void MaNGOS::CreatureLastSearcher::Visit(CreatureMapType &m)
template
void MaNGOS::CreatureListSearcher::Visit(CreatureMapType &m)
{
- for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
- if(itr->getSource()->InSamePhase(i_phaseMask))
- if( i_check(itr->getSource()))
+ for(CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
+ if (itr->getSource()->InSamePhase(i_phaseMask))
+ if (i_check(itr->getSource()))
i_objects.push_back(itr->getSource());
}
@@ -526,15 +520,15 @@ template
void MaNGOS::PlayerSearcher::Visit(PlayerMapType &m)
{
// already found
- if(i_object)
+ if (i_object)
return;
- for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ for(PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if(!itr->getSource()->InSamePhase(i_phaseMask))
+ if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
- if(i_check(itr->getSource()))
+ if (i_check(itr->getSource()))
{
i_object = itr->getSource();
return;
@@ -550,14 +544,14 @@ void MaNGOS::LocalizedPacketDo::operator()( Player* p )
WorldPacket* data;
// create if not cached yet
- if(i_data_cache.size() < cache_idx+1 || !i_data_cache[cache_idx])
+ if (i_data_cache.size() < cache_idx+1 || !i_data_cache[cache_idx])
{
- if(i_data_cache.size() < cache_idx+1)
+ if (i_data_cache.size() < cache_idx+1)
i_data_cache.resize(cache_idx+1);
data = new WorldPacket(SMSG_MESSAGECHAT, 200);
- i_builder(*data,loc_idx);
+ i_builder(*data, loc_idx);
i_data_cache[cache_idx] = data;
}
@@ -575,14 +569,14 @@ void MaNGOS::LocalizedPacketListDo::operator()( Player* p )
WorldPacketList* data_list;
// create if not cached yet
- if(i_data_cache.size() < cache_idx+1 || i_data_cache[cache_idx].empty())
+ if (i_data_cache.size() < cache_idx+1 || i_data_cache[cache_idx].empty())
{
- if(i_data_cache.size() < cache_idx+1)
+ if (i_data_cache.size() < cache_idx+1)
i_data_cache.resize(cache_idx+1);
data_list = &i_data_cache[cache_idx];
- i_builder(*data_list,loc_idx);
+ i_builder(*data_list, loc_idx);
}
else
data_list = &i_data_cache[cache_idx];
diff --git a/src/game/GridStates.h b/src/game/GridStates.h
index c41853c5b..503b9df15 100644
--- a/src/game/GridStates.h
+++ b/src/game/GridStates.h
@@ -24,21 +24,7 @@
class MANGOS_DLL_DECL GridState
{
public:
-#ifdef MANGOS_DEBUG
-#define MAGIC_TESTVAL 0xFBE823BA
- GridState() { i_Magic = MAGIC_TESTVAL; }
- bool checkMagic()
- {
- if(i_Magic != MAGIC_TESTVAL)
- {
- sLog.outError("!!! GridState: Magic value gone !!!");
- return false;
- }
- return true;
- }
- void setMagic() { i_Magic = MAGIC_TESTVAL; }
- unsigned int i_Magic;
-#endif
+
virtual void Update(Map &, NGridType&, GridInfo &, const uint32 &x, const uint32 &y, const uint32 &t_diff) const = 0;
};
@@ -69,4 +55,5 @@ class MANGOS_DLL_DECL RemovalState : public GridState
void Update(Map &, NGridType &, GridInfo &, const uint32 &x, const uint32 &y, const uint32 &t_diff) const;
};
+
#endif
diff --git a/src/game/Group.cpp b/src/game/Group.cpp
index 1433a0237..7aa97e10b 100644
--- a/src/game/Group.cpp
+++ b/src/game/Group.cpp
@@ -34,12 +34,14 @@
#include "Util.h"
#include "LootMgr.h"
+#define LOOT_ROLL_TIMEOUT (1*MINUTE*IN_MILLISECONDS)
+
Group::Group() : m_Id(0), m_leaderGuid(0), m_mainTank(0), m_mainAssistant(0), m_groupType(GROUPTYPE_NORMAL),
m_dungeonDifficulty(REGULAR_DIFFICULTY), m_raidDifficulty(REGULAR_DIFFICULTY),
m_bgGroup(NULL), m_lootMethod(FREE_FOR_ALL), m_looterGuid(0), m_lootThreshold(ITEM_QUALITY_UNCOMMON),
m_subGroupsCounts(NULL)
{
- for (int i = 0; i < TARGETICONCOUNT; ++i)
+ for (int i = 0; i < TARGET_ICON_COUNT; ++i)
m_targetIcons[i] = 0;
}
@@ -109,10 +111,10 @@ bool Group::Create(const uint64 &guid, const char * name)
CharacterDatabase.BeginTransaction();
CharacterDatabase.PExecute("DELETE FROM groups WHERE groupId ='%u'", m_Id);
CharacterDatabase.PExecute("DELETE FROM group_member WHERE groupId ='%u'", m_Id);
- CharacterDatabase.PExecute("INSERT INTO groups (groupId,leaderGuid,mainTank,mainAssistant,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,isRaid,difficulty,raiddifficulty) "
+ CharacterDatabase.PExecute("INSERT INTO groups (groupId,leaderGuid,mainTank,mainAssistant,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,groupType,difficulty,raiddifficulty) "
"VALUES ('%u','%u','%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u','%u','%u')",
m_Id, GUID_LOPART(m_leaderGuid), GUID_LOPART(m_mainTank), GUID_LOPART(m_mainAssistant), uint32(m_lootMethod),
- GUID_LOPART(m_looterGuid), uint32(m_lootThreshold), m_targetIcons[0], m_targetIcons[1], m_targetIcons[2], m_targetIcons[3], m_targetIcons[4], m_targetIcons[5], m_targetIcons[6], m_targetIcons[7], uint8(m_groupType), uint32(m_dungeonDifficulty), m_raidDifficulty);
+ GUID_LOPART(m_looterGuid), uint32(m_lootThreshold), m_targetIcons[0], m_targetIcons[1], m_targetIcons[2], m_targetIcons[3], m_targetIcons[4], m_targetIcons[5], m_targetIcons[6], m_targetIcons[7], uint8(m_groupType), uint32(m_dungeonDifficulty), uint32(m_raidDifficulty));
}
if(!AddMember(guid, name))
@@ -126,8 +128,8 @@ bool Group::Create(const uint64 &guid, const char * name)
bool Group::LoadGroupFromDB(Field* fields)
{
- // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
- // result = CharacterDatabase.Query("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, isRaid, difficulty, raiddifficulty, leaderGuid, groupId FROM groups");
+ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
+ // result = CharacterDatabase.Query("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, groupType, difficulty, raiddifficulty, leaderGuid, groupId FROM groups");
m_Id = fields[17].GetUInt32();
m_leaderGuid = MAKE_NEW_GUID(fields[16].GetUInt32(),0,HIGHGUID_PLAYER);
@@ -157,7 +159,7 @@ bool Group::LoadGroupFromDB(Field* fields)
m_looterGuid = MAKE_NEW_GUID(fields[3].GetUInt32(), 0, HIGHGUID_PLAYER);
m_lootThreshold = (ItemQualities)fields[4].GetUInt16();
- for(int i = 0; i < TARGETICONCOUNT; ++i)
+ for(int i = 0; i < TARGET_ICON_COUNT; ++i)
m_targetIcons[i] = fields[5+i].GetUInt64();
return true;
@@ -188,7 +190,7 @@ void Group::ConvertToRaid()
_initRaidSubGroupsCounter();
if(!isBGGroup())
- CharacterDatabase.PExecute("UPDATE groups SET isRaid = 1 WHERE groupId='%u'", m_Id);
+ CharacterDatabase.PExecute("UPDATE groups SET groupType = %u WHERE groupId='%u'", uint8(m_groupType), m_Id);
SendUpdate();
// update quest related GO states (quest activity dependent from raid membership)
@@ -538,133 +540,56 @@ void Group::SendLootAllPassed(Roll const& r)
}
}
-void Group::GroupLoot(ObjectGuid const& playerGUID, Loot *loot, Creature *creature)
+void Group::GroupLoot(Creature *creature, Loot *loot)
{
- std::vector::iterator i;
- ItemPrototype const *item;
- uint8 itemSlot = 0;
- Player *player = sObjectMgr.GetPlayer(playerGUID);
- Group *group = player->GetGroup();
-
- for (i = loot->items.begin(); i != loot->items.end(); ++i, ++itemSlot)
+ for(uint8 itemSlot = 0; itemSlot < loot->items.size(); ++itemSlot)
{
- item = ObjectMgr::GetItemPrototype(i->itemid);
- if (!item)
+ LootItem& lootItem = loot->items[itemSlot];
+ ItemPrototype const *itemProto = ObjectMgr::GetItemPrototype(lootItem.itemid);
+ if (!itemProto)
{
- //DEBUG_LOG("Group::GroupLoot: missing item prototype for item with id: %d", i->itemid);
+ DEBUG_LOG("Group::GroupLoot: missing item prototype for item with id: %d", lootItem.itemid);
continue;
}
//roll for over-threshold item if it's one-player loot
- if (item->Quality >= uint32(m_lootThreshold) && !i->freeforall)
- {
- Roll* r = new Roll(creature->GetGUID(), *i);
-
- //a vector is filled with only near party members
- for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
- {
- Player *member = itr->getSource();
- if(!member || !member->GetSession())
- continue;
- if ( i->AllowedForPlayer(member) )
- {
- if (member->IsWithinDist(creature, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
- {
- r->playerVote[member->GetGUID()] = ROLL_NOT_EMITED_YET;
- ++r->totalPlayersRolling;
- }
- }
- }
-
- if (r->totalPlayersRolling > 0) // has looters
- {
- r->setLoot(loot);
- r->itemSlot = itemSlot;
-
- if (r->totalPlayersRolling == 1) // single looter
- r->playerVote.begin()->second = ROLL_NEED;
- else
- {
- group->SendLootStartRoll(60000, creature->GetMapId(), *r);
-
- loot->items[itemSlot].is_blocked = true;
-
- creature->m_groupLootTimer = 60000;
- creature->m_groupLootId = GetId();
- }
-
- RollId.push_back(r);
- }
- else // no looters??
- delete r;
- }
+ if (itemProto->Quality >= uint32(m_lootThreshold) && !lootItem.freeforall)
+ StartLootRool(creature,loot,itemSlot,false);
else
- i->is_underthreshold = 1;
+ lootItem.is_underthreshold = 1;
}
}
-void Group::NeedBeforeGreed(ObjectGuid const& playerGUID, Loot *loot, Creature *creature)
+void Group::NeedBeforeGreed(Creature *creature, Loot *loot)
{
- ItemPrototype const *item;
- Player *player = sObjectMgr.GetPlayer(playerGUID);
- Group *group = player->GetGroup();
-
- uint8 itemSlot = 0;
- for(std::vector::iterator i = loot->items.begin(); i != loot->items.end(); ++i, ++itemSlot)
+ for(uint8 itemSlot = 0; itemSlot < loot->items.size(); ++itemSlot)
{
- item = ObjectMgr::GetItemPrototype(i->itemid);
+ LootItem& lootItem = loot->items[itemSlot];
+ ItemPrototype const *itemProto = ObjectMgr::GetItemPrototype(lootItem.itemid);
+ if (!itemProto)
+ {
+ DEBUG_LOG("Group::NeedBeforeGreed: missing item prototype for item with id: %d", lootItem.itemid);
+ continue;
+ }
//only roll for one-player items, not for ones everyone can get
- if (item->Quality >= uint32(m_lootThreshold) && !i->freeforall)
- {
- Roll* r = new Roll(creature->GetGUID(), *i);
-
- for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
- {
- Player *playerToRoll = itr->getSource();
- if(!playerToRoll || !playerToRoll->GetSession())
- continue;
-
- if (playerToRoll->CanUseItem(item) && i->AllowedForPlayer(playerToRoll) )
- {
- if (playerToRoll->IsWithinDist(creature, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
- {
- r->playerVote[playerToRoll->GetGUID()] = ROLL_NOT_EMITED_YET;
- ++r->totalPlayersRolling;
- }
- }
- }
-
- if (r->totalPlayersRolling > 0) // has looters
- {
- r->setLoot(loot);
- r->itemSlot = itemSlot;
-
- if (r->totalPlayersRolling == 1) // single looter
- r->playerVote.begin()->second = ROLL_NEED;
- else
- {
- group->SendLootStartRoll(60000, creature->GetMapId(), *r);
- loot->items[itemSlot].is_blocked = true;
- }
-
- RollId.push_back(r);
- }
- else // no looters??
- delete r;
- }
+ if (itemProto->Quality >= uint32(m_lootThreshold) && !lootItem.freeforall)
+ StartLootRool(creature, loot, itemSlot, true);
else
- i->is_underthreshold = 1;
+ lootItem.is_underthreshold = 1;
}
}
-void Group::MasterLoot(ObjectGuid const& playerGUID, Loot* /*loot*/, Creature *creature)
+void Group::MasterLoot(Creature *creature, Loot* loot)
{
- Player *player = sObjectMgr.GetPlayer(playerGUID);
- if(!player)
- return;
-
- DEBUG_LOG("Group::MasterLoot (SMSG_LOOT_MASTER_LIST, 330) player = [%s].", player->GetName());
+ for (LootItemList::iterator i=loot->items.begin(); i != loot->items.end(); ++i)
+ {
+ ItemPrototype const *item = ObjectMgr::GetItemPrototype(i->itemid);
+ if (!item)
+ continue;
+ if (item->Quality < uint32(m_lootThreshold))
+ i->is_underthreshold = 1;
+ }
uint32 real_count = 0;
@@ -763,6 +688,54 @@ bool Group::CountRollVote(ObjectGuid const& playerGUID, Rolls::iterator& rollI,
return false;
}
+void Group::StartLootRool(Creature* lootTarget, Loot* loot, uint8 itemSlot, bool skipIfCanNotUse)
+{
+ if (itemSlot >= loot->items.size())
+ return;
+
+ LootItem const& lootItem = loot->items[itemSlot];
+
+ ItemPrototype const* item = ObjectMgr::GetItemPrototype(lootItem.itemid);
+
+ Roll* r = new Roll(lootTarget->GetGUID(), lootItem);
+
+ //a vector is filled with only near party members
+ for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ {
+ Player *playerToRoll = itr->getSource();
+ if(!playerToRoll || !playerToRoll->GetSession())
+ continue;
+
+ if ((!skipIfCanNotUse || playerToRoll->CanUseItem(item)) && lootItem.AllowedForPlayer(playerToRoll) )
+ {
+ if (playerToRoll->IsWithinDist(lootTarget, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
+ {
+ r->playerVote[playerToRoll->GetGUID()] = ROLL_NOT_EMITED_YET;
+ ++r->totalPlayersRolling;
+ }
+ }
+ }
+
+ if (r->totalPlayersRolling > 0) // has looters
+ {
+ r->setLoot(loot);
+ r->itemSlot = itemSlot;
+
+ if (r->totalPlayersRolling == 1) // single looter
+ r->playerVote.begin()->second = ROLL_NEED;
+ else
+ {
+ SendLootStartRoll(LOOT_ROLL_TIMEOUT, lootTarget->GetMapId(), *r);
+ loot->items[itemSlot].is_blocked = true;
+ lootTarget->StartGroupLoot(this,LOOT_ROLL_TIMEOUT);
+ }
+
+ RollId.push_back(r);
+ }
+ else // no looters??
+ delete r;
+}
+
// called when roll timer expires
void Group::EndRoll()
{
@@ -905,12 +878,12 @@ void Group::CountTheRoll(Rolls::iterator& rollI)
void Group::SetTargetIcon(uint8 id, uint64 whoGuid, uint64 targetGuid)
{
- if(id >= TARGETICONCOUNT)
+ if(id >= TARGET_ICON_COUNT)
return;
// clean other icons
if( targetGuid != 0 )
- for(int i = 0; i < TARGETICONCOUNT; ++i)
+ for(int i = 0; i < TARGET_ICON_COUNT; ++i)
if( m_targetIcons[i] == targetGuid )
SetTargetIcon(i, 0, 0);
@@ -924,26 +897,44 @@ void Group::SetTargetIcon(uint8 id, uint64 whoGuid, uint64 targetGuid)
BroadcastPacket(&data, true);
}
-void Group::GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level, Player* & not_gray_member_with_max_level)
+static void GetDataForXPAtKill_helper(Player* player, Unit const* victim, uint32& sum_level, Player* & member_with_max_level, Player* & not_gray_member_with_max_level)
+{
+ sum_level += player->getLevel();
+ if(!member_with_max_level || member_with_max_level->getLevel() < player->getLevel())
+ member_with_max_level = player;
+
+ uint32 gray_level = MaNGOS::XP::GetGrayLevel(player->getLevel());
+ if( victim->getLevel() > gray_level && (!not_gray_member_with_max_level
+ || not_gray_member_with_max_level->getLevel() < player->getLevel()))
+ not_gray_member_with_max_level = player;
+}
+
+void Group::GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level, Player* & not_gray_member_with_max_level, Player* additional)
{
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* member = itr->getSource();
- if(!member || !member->isAlive()) // only for alive
+ if (!member || !member->isAlive()) // only for alive
continue;
- if(!member->IsAtGroupRewardDistance(victim)) // at req. distance
+ // will proccesed later
+ if (member == additional)
+ continue;
+
+ if (!member->IsAtGroupRewardDistance(victim)) // at req. distance
continue;
++count;
- sum_level += member->getLevel();
- if(!member_with_max_level || member_with_max_level->getLevel() < member->getLevel())
- member_with_max_level = member;
+ GetDataForXPAtKill_helper(member,victim,sum_level,member_with_max_level,not_gray_member_with_max_level);
+ }
- uint32 gray_level = MaNGOS::XP::GetGrayLevel(member->getLevel());
- if( victim->getLevel() > gray_level && (!not_gray_member_with_max_level
- || not_gray_member_with_max_level->getLevel() < member->getLevel()))
- not_gray_member_with_max_level = member;
+ if (additional)
+ {
+ if (additional->IsAtGroupRewardDistance(victim)) // at req. distance
+ {
+ ++count;
+ GetDataForXPAtKill_helper(additional,victim,sum_level,member_with_max_level,not_gray_member_with_max_level);
+ }
}
}
@@ -952,10 +943,10 @@ void Group::SendTargetIconList(WorldSession *session)
if(!session)
return;
- WorldPacket data(MSG_RAID_TARGET_UPDATE, (1+TARGETICONCOUNT*9));
+ WorldPacket data(MSG_RAID_TARGET_UPDATE, (1+TARGET_ICON_COUNT*9));
data << uint8(1); // list targets
- for(int i = 0; i < TARGETICONCOUNT; ++i)
+ for(int i = 0; i < TARGET_ICON_COUNT; ++i)
{
if(m_targetIcons[i] == 0)
continue;
@@ -979,9 +970,9 @@ void Group::SendUpdate()
// guess size
WorldPacket data(SMSG_GROUP_LIST, (1+1+1+1+8+4+GetMembersCount()*20));
data << uint8(m_groupType); // group type (flags in 3.3)
- data << uint8(isBGGroup() ? 1 : 0); // 2.0.x, isBattleGroundGroup?
data << uint8(citr->group); // groupid
- data << uint8(citr->assistant ? 0x01 : 0x00); // 0x2 main assist, 0x4 main tank
+ data << uint8(GetFlags(*citr)); // group flags
+ data << uint8(isBGGroup() ? 1 : 0); // 2.0.x, isBattleGroundGroup?
if(m_groupType & GROUPTYPE_LFD)
{
data << uint8(0);
@@ -1000,10 +991,9 @@ void Group::SendUpdate()
data << citr2->name;
data << uint64(citr2->guid);
- // online-state
- data << uint8(onlineState);
+ data << uint8(onlineState); // online-state
data << uint8(citr2->group); // groupid
- data << uint8(citr2->assistant?0x01:0); // 0x2 main assist, 0x4 main tank
+ data << uint8(GetFlags(*citr2)); // group flags
data << uint8(0); // 3.3, role?
}
@@ -1026,16 +1016,16 @@ void Group::UpdatePlayerOutOfRange(Player* pPlayer)
if(!pPlayer || !pPlayer->IsInWorld())
return;
- Player *player;
+ if (pPlayer->GetGroupUpdateFlag() == GROUP_UPDATE_FLAG_NONE)
+ return;
+
WorldPacket data;
pPlayer->GetSession()->BuildPartyMemberStatsChangedPacket(pPlayer, &data);
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
- {
- player = itr->getSource();
- if (player && player != pPlayer && !pPlayer->isVisibleFor(player,player->GetViewPoint()))
- player->GetSession()->SendPacket(&data);
- }
+ if (Player *player = itr->getSource())
+ if (player != pPlayer && !player->HaveAtClient(pPlayer))
+ player->GetSession()->SendPacket(&data);
}
void Group::BroadcastPacket(WorldPacket *packet, bool ignorePlayersInBGRaid, int group, uint64 ignore)
@@ -1084,9 +1074,9 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant)
if (m_subGroupsCounts)
{
bool groupFound = false;
- for (; groupid < MAXRAIDSIZE / MAXGROUPSIZE; ++groupid)
+ for (; groupid < MAX_RAID_SUBGROUPS; ++groupid)
{
- if (m_subGroupsCounts[groupid] < MAXGROUPSIZE)
+ if (m_subGroupsCounts[groupid] < MAX_GROUP_SIZE)
{
groupFound = true;
break;
@@ -1139,7 +1129,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant, u
if(!isRaidGroup()) // reset targetIcons for non-raid-groups
{
- for(int i = 0; i < TARGETICONCOUNT; ++i)
+ for(int i = 0; i < TARGET_ICON_COUNT; ++i)
m_targetIcons[i] = 0;
}
@@ -1278,7 +1268,7 @@ void Group::_removeRolls(const uint64 &guid)
}
}
-bool Group::_setMembersGroup(const uint64 &guid, const uint8 &group)
+bool Group::_setMembersGroup(const uint64 &guid, uint8 group)
{
member_witerator slot = _getMemberWSlot(guid);
if(slot == m_memberSlots.end())
@@ -1308,29 +1298,47 @@ bool Group::_setAssistantFlag(const uint64 &guid, const bool &state)
bool Group::_setMainTank(const uint64 &guid)
{
- member_citerator slot = _getMemberCSlot(guid);
- if(slot == m_memberSlots.end())
+ if (m_mainTank == guid)
return false;
- if(m_mainAssistant == guid)
- _setMainAssistant(0);
+ if (guid)
+ {
+ member_citerator slot = _getMemberCSlot(guid);
+ if(slot == m_memberSlots.end())
+ return false;
+
+ if(m_mainAssistant == guid)
+ _setMainAssistant(0);
+ }
+
m_mainTank = guid;
+
if(!isBGGroup())
CharacterDatabase.PExecute("UPDATE groups SET mainTank='%u' WHERE groupId='%u'", GUID_LOPART(m_mainTank), m_Id);
+
return true;
}
bool Group::_setMainAssistant(const uint64 &guid)
{
- member_witerator slot = _getMemberWSlot(guid);
- if(slot == m_memberSlots.end())
+ if (m_mainAssistant == guid)
return false;
- if(m_mainTank == guid)
- _setMainTank(0);
+ if (guid)
+ {
+ member_witerator slot = _getMemberWSlot(guid);
+ if(slot == m_memberSlots.end())
+ return false;
+
+ if(m_mainTank == guid)
+ _setMainTank(0);
+ }
+
m_mainAssistant = guid;
+
if(!isBGGroup())
CharacterDatabase.PExecute("UPDATE groups SET mainAssistant='%u' WHERE groupId='%u'", GUID_LOPART(m_mainAssistant), m_Id);
+
return true;
}
@@ -1345,21 +1353,24 @@ bool Group::SameSubGroup(Player const* member1, Player const* member2) const
}
// allows setting subgroup for offline members
-void Group::ChangeMembersGroup(const uint64 &guid, const uint8 &group)
+void Group::ChangeMembersGroup(const uint64 &guid, uint8 group)
{
- if(!isRaidGroup())
+ if (!isRaidGroup())
return;
+
Player *player = sObjectMgr.GetPlayer(guid);
if (!player)
{
- uint8 prevSubGroup;
- prevSubGroup = GetMemberGroup(guid);
-
- SubGroupCounterDecrease(prevSubGroup);
+ uint8 prevSubGroup = GetMemberGroup(guid);
+ if (prevSubGroup == group)
+ return;
if(_setMembersGroup(guid, group))
+ {
+ SubGroupCounterDecrease(prevSubGroup);
SendUpdate();
+ }
}
else
// This methods handles itself groupcounter decrease
@@ -1367,14 +1378,18 @@ void Group::ChangeMembersGroup(const uint64 &guid, const uint8 &group)
}
// only for online members
-void Group::ChangeMembersGroup(Player *player, const uint8 &group)
+void Group::ChangeMembersGroup(Player *player, uint8 group)
{
- if(!player || !isRaidGroup())
+ if (!player || !isRaidGroup())
return;
- if(_setMembersGroup(player->GetGUID(), group))
+
+ uint8 prevSubGroup = player->GetSubGroup();
+ if (prevSubGroup == group)
+ return;
+
+ if (_setMembersGroup(player->GetGUID(), group))
{
- uint8 prevSubGroup = player->GetSubGroup();
- if( player->GetGroup() == this )
+ if (player->GetGroup() == this)
player->GetGroupRef().setSubGroup(group);
//if player is in BG raid, it is possible that he is also in normal raid - and that normal raid is stored in m_originalGroup reference
else
@@ -1727,3 +1742,95 @@ void Group::_homebindIfInstance(Player *player)
player->m_InstanceValid = false;
}
}
+
+static void RewardGroupAtKill_helper(Player* pGroupGuy, Unit* pVictim, uint32 count, bool PvP, float group_rate, uint32 sum_level, bool is_dungeon, Player* not_gray_member_with_max_level, Player* member_with_max_level, uint32 xp )
+{
+ // honor can be in PvP and !PvP (racial leader) cases (for alive)
+ if (pGroupGuy->isAlive())
+ pGroupGuy->RewardHonor(pVictim,count);
+
+ // xp and reputation only in !PvP case
+ if(!PvP)
+ {
+ float rate = group_rate * float(pGroupGuy->getLevel()) / sum_level;
+
+ // if is in dungeon then all receive full reputation at kill
+ // rewarded any alive/dead/near_corpse group member
+ pGroupGuy->RewardReputation(pVictim,is_dungeon ? 1.0f : rate);
+
+ // XP updated only for alive group member
+ if(pGroupGuy->isAlive() && not_gray_member_with_max_level &&
+ pGroupGuy->getLevel() <= not_gray_member_with_max_level->getLevel())
+ {
+ uint32 itr_xp = (member_with_max_level == not_gray_member_with_max_level) ? uint32(xp*rate) : uint32((xp*rate/2)+1);
+
+ pGroupGuy->GiveXP(itr_xp, pVictim);
+ if(Pet* pet = pGroupGuy->GetPet())
+ pet->GivePetXP(itr_xp/2);
+ }
+
+ // quest objectives updated only for alive group member or dead but with not released body
+ if(pGroupGuy->isAlive()|| !pGroupGuy->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
+ {
+ // normal creature (not pet/etc) can be only in !PvP case
+ if(pVictim->GetTypeId()==TYPEID_UNIT)
+ pGroupGuy->KilledMonster(((Creature*)pVictim)->GetCreatureInfo(), pVictim->GetObjectGuid());
+ }
+ }
+}
+
+/** Provide rewards to group members at unit kill
+ *
+ * @param pVictim Killed unit
+ * @param player_tap Player who tap unit if online, it can be group member or can be not if leaved after tap but before kill target
+ *
+ * Rewards received by group members and player_tap
+ */
+void Group::RewardGroupAtKill(Unit* pVictim, Player* player_tap)
+{
+ bool PvP = pVictim->isCharmedOwnedByPlayerOrPlayer();
+
+ // prepare data for near group iteration (PvP and !PvP cases)
+ uint32 xp = 0;
+
+ uint32 count = 0;
+ uint32 sum_level = 0;
+ Player* member_with_max_level = NULL;
+ Player* not_gray_member_with_max_level = NULL;
+
+ GetDataForXPAtKill(pVictim,count,sum_level,member_with_max_level,not_gray_member_with_max_level,player_tap);
+
+ if(member_with_max_level)
+ {
+ /// not get Xp in PvP or no not gray players in group
+ xp = (PvP || !not_gray_member_with_max_level) ? 0 : MaNGOS::XP::Gain(not_gray_member_with_max_level, pVictim);
+
+ /// skip in check PvP case (for speed, not used)
+ bool is_raid = PvP ? false : sMapStore.LookupEntry(pVictim->GetMapId())->IsRaid() && isRaidGroup();
+ bool is_dungeon = PvP ? false : sMapStore.LookupEntry(pVictim->GetMapId())->IsDungeon();
+ float group_rate = MaNGOS::XP::xp_in_group_rate(count,is_raid);
+
+ for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ {
+ Player* pGroupGuy = itr->getSource();
+ if(!pGroupGuy)
+ continue;
+
+ // will proccessed later
+ if(pGroupGuy==player_tap)
+ continue;
+
+ if(!pGroupGuy->IsAtGroupRewardDistance(pVictim))
+ continue; // member (alive or dead) or his corpse at req. distance
+
+ RewardGroupAtKill_helper(pGroupGuy, pVictim, count, PvP, group_rate, sum_level, is_dungeon, not_gray_member_with_max_level, member_with_max_level, xp);
+ }
+
+ if(player_tap)
+ {
+ // member (alive or dead) or his corpse at req. distance
+ if(player_tap->IsAtGroupRewardDistance(pVictim))
+ RewardGroupAtKill_helper(player_tap, pVictim, count, PvP, group_rate, sum_level, is_dungeon, not_gray_member_with_max_level, member_with_max_level, xp);
+ }
+ }
+}
diff --git a/src/game/Group.h b/src/game/Group.h
index 94041dc21..c9cffe335 100644
--- a/src/game/Group.h
+++ b/src/game/Group.h
@@ -28,9 +28,10 @@
#include
#include
-#define MAXGROUPSIZE 5
-#define MAXRAIDSIZE 40
-#define TARGETICONCOUNT 8
+#define MAX_GROUP_SIZE 5
+#define MAX_RAID_SIZE 40
+#define MAX_RAID_SUBGROUPS (MAX_RAID_SIZE / MAX_GROUP_SIZE)
+#define TARGET_ICON_COUNT 8
enum LootMethod
{
@@ -81,6 +82,13 @@ enum GroupType // group type flags?
// 0x10, leave/change group?, I saw this flag when leaving group and after leaving BG while in group
};
+enum GroupFlagMask
+{
+ GROUP_ASSISTANT = 0x01,
+ GROUP_MAIN_ASSISTANT = 0x02,
+ GROUP_MAIN_TANK = 0x04,
+};
+
class BattleGround;
enum GroupUpdateFlags
@@ -196,7 +204,7 @@ class MANGOS_DLL_SPEC Group
// properties accessories
uint32 GetId() const { return m_Id; }
- bool IsFull() const { return (m_groupType == GROUPTYPE_NORMAL) ? (m_memberSlots.size() >= MAXGROUPSIZE) : (m_memberSlots.size() >= MAXRAIDSIZE); }
+ bool IsFull() const { return (m_groupType == GROUPTYPE_NORMAL) ? (m_memberSlots.size() >= MAX_GROUP_SIZE) : (m_memberSlots.size() >= MAX_RAID_SIZE); }
bool isRaidGroup() const { return m_groupType & GROUPTYPE_RAID; }
bool isBGGroup() const { return m_bgGroup != NULL; }
bool IsCreated() const { return GetMembersCount() > 0; }
@@ -251,7 +259,7 @@ class MANGOS_DLL_SPEC Group
bool HasFreeSlotSubGroup(uint8 subgroup) const
{
- return (m_subGroupsCounts && m_subGroupsCounts[subgroup] < MAXGROUPSIZE);
+ return (m_subGroupsCounts && m_subGroupsCounts[subgroup] < MAX_GROUP_SIZE);
}
bool SameSubGroup(Player const* member1, Player const* member2) const;
@@ -259,12 +267,12 @@ class MANGOS_DLL_SPEC Group
MemberSlotList const& GetMemberSlots() const { return m_memberSlots; }
GroupReference* GetFirstMember() { return m_memberMgr.getFirst(); }
uint32 GetMembersCount() const { return m_memberSlots.size(); }
- void GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level, Player* & not_gray_member_with_max_level);
+ void GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level, Player* & not_gray_member_with_max_level, Player* additional = NULL);
uint8 GetMemberGroup(uint64 guid) const
{
member_citerator mslot = _getMemberCSlot(guid);
if(mslot==m_memberSlots.end())
- return (MAXRAIDSIZE/MAXGROUPSIZE+1);
+ return MAX_RAID_SUBGROUPS + 1;
return mslot->group;
}
@@ -275,10 +283,13 @@ class MANGOS_DLL_SPEC Group
void SetBattlegroundGroup(BattleGround *bg) { m_bgGroup = bg; }
GroupJoinBattlegroundResult CanJoinBattleGroundQueue(BattleGround const* bgOrTemplate, BattleGroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot);
- void ChangeMembersGroup(const uint64 &guid, const uint8 &group);
- void ChangeMembersGroup(Player *player, const uint8 &group);
+ void ChangeMembersGroup(const uint64 &guid, uint8 group);
+ void ChangeMembersGroup(Player *player, uint8 group);
- void SetAssistant(uint64 guid, const bool &state)
+ uint64 const& GetMainTank() const { return m_mainTank; }
+ uint64 const& GetMainAssistant() const { return m_mainAssistant; }
+
+ void SetAssistant(uint64 guid, bool state)
{
if(!isRaidGroup())
return;
@@ -313,8 +324,6 @@ class MANGOS_DLL_SPEC Group
bool InCombatToInstance(uint32 instanceId);
void ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo);
- // -no description-
- //void SendInit(WorldSession *session);
void SendTargetIconList(WorldSession *session);
void SendUpdate();
void UpdatePlayerOutOfRange(Player* pPlayer);
@@ -323,6 +332,8 @@ class MANGOS_DLL_SPEC Group
void BroadcastReadyCheck(WorldPacket *packet);
void OfflineReadyCheck();
+ void RewardGroupAtKill(Unit* pVictim, Player* player_tap);
+
/*********************************************************/
/*** LOOT SYSTEM ***/
/*********************************************************/
@@ -331,10 +342,11 @@ class MANGOS_DLL_SPEC Group
void SendLootRoll(ObjectGuid const& targetGuid, uint8 rollNumber, uint8 rollType, const Roll &r);
void SendLootRollWon(ObjectGuid const& targetGuid, uint8 rollNumber, RollVote rollType, const Roll &r);
void SendLootAllPassed(const Roll &r);
- void GroupLoot(ObjectGuid const& playerGUID, Loot *loot, Creature *creature);
- void NeedBeforeGreed(ObjectGuid const& playerGUID, Loot *loot, Creature *creature);
- void MasterLoot(ObjectGuid const& playerGUID, Loot *loot, Creature *creature);
+ void GroupLoot(Creature *creature, Loot *loot);
+ void NeedBeforeGreed(Creature *creature, Loot *loot);
+ void MasterLoot(Creature *creature, Loot *loot);
void CountRollVote(ObjectGuid const& playerGUID, ObjectGuid const& lootedTarget, uint32 itemSlot, RollVote choise);
+ void StartLootRool(Creature* lootTarget, Loot* loot, uint8 itemSlot, bool skipIfCanNotUse);
void EndRoll();
void LinkMember(GroupReference *pRef) { m_memberMgr.insertFirst(pRef); }
@@ -354,7 +366,7 @@ class MANGOS_DLL_SPEC Group
void _removeRolls(const uint64 &guid);
- bool _setMembersGroup(const uint64 &guid, const uint8 &group);
+ bool _setMembersGroup(const uint64 &guid, uint8 group);
bool _setAssistantFlag(const uint64 &guid, const bool &state);
bool _setMainTank(const uint64 &guid);
bool _setMainAssistant(const uint64 &guid);
@@ -365,9 +377,9 @@ class MANGOS_DLL_SPEC Group
{
// Sub group counters initialization
if (!m_subGroupsCounts)
- m_subGroupsCounts = new uint8[MAXRAIDSIZE / MAXGROUPSIZE];
+ m_subGroupsCounts = new uint8[MAX_RAID_SUBGROUPS];
- memset((void*)m_subGroupsCounts, 0, (MAXRAIDSIZE / MAXGROUPSIZE)*sizeof(uint8));
+ memset((void*)m_subGroupsCounts, 0, MAX_RAID_SUBGROUPS * sizeof(uint8));
for (member_citerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr)
++m_subGroupsCounts[itr->group];
@@ -408,6 +420,18 @@ class MANGOS_DLL_SPEC Group
void CountTheRoll(Rolls::iterator& roll); // iterator update to next, in CountRollVote if true
bool CountRollVote(ObjectGuid const& playerGUID, Rolls::iterator& roll, RollVote choise);
+ GroupFlagMask GetFlags(MemberSlot const& slot) const
+ {
+ uint8 flags = 0;
+ if (slot.assistant)
+ flags |= GROUP_ASSISTANT;
+ if (slot.guid == m_mainAssistant)
+ flags |= GROUP_MAIN_ASSISTANT;
+ if (slot.guid == m_mainTank)
+ flags |= GROUP_MAIN_TANK;
+ return GroupFlagMask(flags);
+ }
+
uint32 m_Id; // 0 for not created or BG groups
MemberSlotList m_memberSlots;
GroupRefManager m_memberMgr;
@@ -420,7 +444,7 @@ class MANGOS_DLL_SPEC Group
Difficulty m_dungeonDifficulty;
Difficulty m_raidDifficulty;
BattleGround* m_bgGroup;
- uint64 m_targetIcons[TARGETICONCOUNT];
+ uint64 m_targetIcons[TARGET_ICON_COUNT];
LootMethod m_lootMethod;
ItemQualities m_lootThreshold;
uint64 m_looterGuid;
diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp
index db463a6bf..d73b2330d 100644
--- a/src/game/GroupHandler.cpp
+++ b/src/game/GroupHandler.cpp
@@ -510,6 +510,9 @@ void WorldSession::HandleGroupChangeSubGroupOpcode( WorldPacket & recv_data )
recv_data >> groupNr;
+ if (groupNr >= MAX_RAID_SUBGROUPS)
+ return;
+
// we will get correct pointer for group here, so we don't have to check if group is BG raid
Group *group = GetPlayer()->GetGroup();
if(!group)
@@ -524,7 +527,10 @@ void WorldSession::HandleGroupChangeSubGroupOpcode( WorldPacket & recv_data )
/********************/
// everything is fine, do it
- group->ChangeMembersGroup(sObjectMgr.GetPlayer(name.c_str()), groupNr);
+ if (Player* player = sObjectMgr.GetPlayer(name.c_str()))
+ group->ChangeMembersGroup(player, groupNr);
+ else
+ group->ChangeMembersGroup(sObjectMgr.GetPlayerGUIDByName(name.c_str()), groupNr);
}
void WorldSession::HandleGroupAssistantLeaderOpcode( WorldPacket & recv_data )
@@ -549,9 +555,10 @@ void WorldSession::HandleGroupAssistantLeaderOpcode( WorldPacket & recv_data )
void WorldSession::HandlePartyAssignmentOpcode( WorldPacket & recv_data )
{
- uint8 flag1, flag2;
+ uint8 role;
+ uint8 apply;
uint64 guid;
- recv_data >> flag1 >> flag2;
+ recv_data >> role >> apply; // role 0 = Main Tank, 1 = Main Assistant
recv_data >> guid;
DEBUG_LOG("MSG_PARTY_ASSIGNMENT");
@@ -560,21 +567,28 @@ void WorldSession::HandlePartyAssignmentOpcode( WorldPacket & recv_data )
if(!group)
return;
- // if(flag1) Main Assist
- // 0x4
- // if(flag2) Main Tank
- // 0x2
-
/** error handling **/
if(!group->IsLeader(GetPlayer()->GetGUID()))
return;
/********************/
// everything is fine, do it
- if(flag1 == 1)
- group->SetMainAssistant(guid);
- if(flag2 == 1)
- group->SetMainTank(guid);
+ if (apply)
+ {
+ switch(role)
+ {
+ case 0: group->SetMainTank(guid); break;
+ case 1: group->SetMainAssistant(guid); break;
+ default: break;
+ }
+ }
+ else
+ {
+ if (group->GetMainTank() == guid)
+ group->SetMainTank(0);
+ if (group->GetMainAssistant() == guid)
+ group->SetMainAssistant(0);
+ }
}
void WorldSession::HandleRaidReadyCheckOpcode( WorldPacket & recv_data )
@@ -630,9 +644,6 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
{
uint32 mask = player->GetGroupUpdateFlag();
- if (mask == GROUP_UPDATE_FLAG_NONE)
- return;
-
if (mask & GROUP_UPDATE_FLAG_POWER_TYPE) // if update power type, update current/max power also
mask |= (GROUP_UPDATE_FLAG_CUR_POWER | GROUP_UPDATE_FLAG_MAX_POWER);
diff --git a/src/game/Item.cpp b/src/game/Item.cpp
index 82dc9ffbb..b8d71b7e2 100644
--- a/src/game/Item.cpp
+++ b/src/game/Item.cpp
@@ -278,7 +278,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff)
if (!GetUInt32Value(ITEM_FIELD_DURATION))
return;
- DEBUG_LOG("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)",GetEntry(),GetUInt32Value(ITEM_FIELD_DURATION),diff);
+ //DEBUG_LOG("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)",GetEntry(),GetUInt32Value(ITEM_FIELD_DURATION),diff);
if (GetUInt32Value(ITEM_FIELD_DURATION)<=diff)
{
diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp
index 1d04c1460..41796a76b 100644
--- a/src/game/ItemHandler.cpp
+++ b/src/game/ItemHandler.cpp
@@ -414,13 +414,13 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
data << pProto->Socket[s].Color;
data << pProto->Socket[s].Content;
}
- data << pProto->socketBonus;
- data << pProto->GemProperties;
- data << pProto->RequiredDisenchantSkill;
- data << pProto->ArmorDamageModifier;
- data << pProto->Duration; // added in 2.4.2.8209, duration (seconds)
- data << pProto->ItemLimitCategory; // WotLK, ItemLimitCategory
- data << pProto->HolidayId; // Holiday.dbc?
+ data << uint32(pProto->socketBonus);
+ data << uint32(pProto->GemProperties);
+ data << int32(pProto->RequiredDisenchantSkill);
+ data << float(pProto->ArmorDamageModifier);
+ data << uint32(pProto->Duration); // added in 2.4.2.8209, duration (seconds)
+ data << uint32(pProto->ItemLimitCategory); // WotLK, ItemLimitCategory
+ data << uint32(pProto->HolidayId); // Holiday.dbc?
SendPacket( &data );
}
else
@@ -760,7 +760,7 @@ void WorldSession::SendListInventory(uint64 vendorguid)
++count;
// reputation discount
- uint32 price = uint32(floor(pProto->BuyPrice * discountMod));
+ uint32 price = crItem->IsExcludeMoneyPrice() ? 0 : uint32(floor(pProto->BuyPrice * discountMod));
data << uint32(vendorslot +1); // client size expected counting from 1
data << uint32(crItem->item);
@@ -769,7 +769,7 @@ void WorldSession::SendListInventory(uint64 vendorguid)
data << uint32(price);
data << uint32(pProto->MaxDurability);
data << uint32(pProto->BuyCount);
- data << uint32(crItem->ExtendedCost);
+ data << uint32(crItem->GetExtendedCostId());
}
}
}
@@ -905,6 +905,14 @@ void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket)
return;
}
+ // no-op: placed in same slot
+ if(dest.size() == 1 && dest[0].pos == pItem->GetPos())
+ {
+ // just remove gray item state
+ _player->SendEquipError( EQUIP_ERR_NONE, pItem, NULL );
+ return;
+ }
+
_player->RemoveItem(srcbag, srcslot, true);
_player->BankItem( dest, pItem, true );
}
diff --git a/src/game/ItemPrototype.h b/src/game/ItemPrototype.h
index 97300d914..053c68e7d 100644
--- a/src/game/ItemPrototype.h
+++ b/src/game/ItemPrototype.h
@@ -586,7 +586,7 @@ struct ItemPrototype
_Socket Socket[MAX_ITEM_PROTO_SOCKETS];
uint32 socketBonus; // id from SpellItemEnchantment.dbc
uint32 GemProperties; // id from GemProperties.dbc
- uint32 RequiredDisenchantSkill;
+ int32 RequiredDisenchantSkill;
float ArmorDamageModifier;
uint32 Duration; // negative = realtime, positive = ingame time
uint32 ItemLimitCategory; // id from ItemLimitCategory.dbc
diff --git a/src/game/Language.h b/src/game/Language.h
index d845f3700..38ec3467e 100644
--- a/src/game/Language.h
+++ b/src/game/Language.h
@@ -776,9 +776,9 @@ enum MangosStrings
LANG_ACCOUNT_NOT_CREATED = 1008,
LANG_CHARACTER_DELETED = 1009,
LANG_ACCOUNT_LIST_HEADER = 1010,
- LANG_ACCOUNT_LIST_ERROR = 1011,
+ // = 1011, not used
LANG_ACCOUNT_LIST_BAR = 1012,
- LANG_ACCOUNT_LIST_LINE = 1013,
+ LANG_ACCOUNT_LIST_LINE_CONSOLE = 1013,
LANG_ACCOUNT_LIST_EMPTY = 1014,
LANG_QUIT_WRONG_USE_ERROR = 1015,
LANG_CHARACTER_DELETED_LIST_HEADER = 1016,
@@ -792,7 +792,9 @@ enum MangosStrings
LANG_CHARACTER_DELETED_SKIP_FULL = 1024,
LANG_CHARACTER_DELETED_SKIP_NAME = 1025,
LANG_CHARACTER_DELETED_LIST_LINE_CHAT = 1026,
- // Room for more level 4 1027-1099 not used
+ LANG_LOG_FILTERS_STATE_HEADER = 1027,
+ LANG_ALL_LOG_FILTERS_SET_TO_S = 1028,
+ // Room for more level 4 1029-1099 not used
// Level 3 (continue)
LANG_ACCOUNT_SETADDON = 1100,
@@ -833,11 +835,12 @@ enum MangosStrings
LANG_LIST_TALENTS_TITLE = 1135,
LANG_LIST_TALENTS_COUNT = 1136,
LANG_GO_LIST_CHAT = 1137,
- LANG_ACCOUNT_CHARACTERS_LIST_BAR = 1138,
- LANG_ACCOUNT_CHARACTERS_LIST_HEADER = 1139,
- LANG_ACCOUNT_CHARACTERS_LIST_LINE_CONSOLE = 1140,
- LANG_ACCOUNT_CHARACTERS_LIST_LINE_CHAT = 1141,
- // Room for more level 3 1142-1199 not used
+ LANG_CHARACTERS_LIST_BAR = 1138,
+ LANG_CHARACTERS_LIST_HEADER = 1139,
+ LANG_CHARACTERS_LIST_LINE_CONSOLE = 1140,
+ LANG_CHARACTERS_LIST_LINE_CHAT = 1141,
+ LANG_ACCOUNT_LIST_LINE_CHAT = 1142,
+ // Room for more level 3 1143-1199 not used
// Debug commands
LANG_CINEMATIC_NOT_EXIST = 1200,
diff --git a/src/game/Level0.cpp b/src/game/Level0.cpp
index d0a4effd1..d95043931 100644
--- a/src/game/Level0.cpp
+++ b/src/game/Level0.cpp
@@ -153,21 +153,23 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/)
{
bool first = true;
- HashMapHolder::MapType &m = HashMapHolder::GetContainer();
- HashMapHolder::MapType::const_iterator itr = m.begin();
- for(; itr != m.end(); ++itr)
{
- AccountTypes itr_sec = itr->second->GetSession()->GetSecurity();
- if ((itr->second->isGameMaster() || (itr_sec > SEC_PLAYER && itr_sec <= (AccountTypes)sWorld.getConfig(CONFIG_UINT32_GM_LEVEL_IN_GM_LIST))) &&
- (!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())))
+ HashMapHolder::ReadGuard g(HashMapHolder::GetLock());
+ HashMapHolder::MapType &m = sObjectAccessor.GetPlayers();
+ for(HashMapHolder::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
{
- if(first)
+ AccountTypes itr_sec = itr->second->GetSession()->GetSecurity();
+ if ((itr->second->isGameMaster() || (itr_sec > SEC_PLAYER && itr_sec <= (AccountTypes)sWorld.getConfig(CONFIG_UINT32_GM_LEVEL_IN_GM_LIST))) &&
+ (!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())))
{
- SendSysMessage(LANG_GMS_ON_SRV);
- first = false;
- }
+ if(first)
+ {
+ SendSysMessage(LANG_GMS_ON_SRV);
+ first = false;
+ }
- SendSysMessage(GetNameLink(itr->second).c_str());
+ SendSysMessage(GetNameLink(itr->second).c_str());
+ }
}
}
diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp
index cebb448a0..603032f13 100644
--- a/src/game/Level1.cpp
+++ b/src/game/Level1.cpp
@@ -310,8 +310,8 @@ bool ChatHandler::HandleGPSCommand(const char* args)
int gx=63-p.x_coord;
int gy=63-p.y_coord;
- uint32 have_map = Map::ExistMap(obj->GetMapId(),gx,gy) ? 1 : 0;
- uint32 have_vmap = Map::ExistVMap(obj->GetMapId(),gx,gy) ? 1 : 0;
+ uint32 have_map = GridMap::ExistMap(obj->GetMapId(),gx,gy) ? 1 : 0;
+ uint32 have_vmap = GridMap::ExistVMap(obj->GetMapId(),gx,gy) ? 1 : 0;
PSendSysMessage(LANG_MAP_POSITION,
obj->GetMapId(), (mapEntry ? mapEntry->name[GetSessionDbcLocale()] : "" ),
@@ -336,8 +336,8 @@ bool ChatHandler::HandleGPSCommand(const char* args)
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), obj->GetInstanceId(),
zone_x, zone_y, ground_z, floor_z, have_map, have_vmap );
- LiquidData liquid_status;
- ZLiquidStatus res = map->getLiquidStatus(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), MAP_ALL_LIQUIDS, &liquid_status);
+ GridMapLiquidData liquid_status;
+ GridMapLiquidStatus res = map->getLiquidStatus(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), MAP_ALL_LIQUIDS, &liquid_status);
if (res)
{
PSendSysMessage(LANG_LIQUID_STATUS, liquid_status.level, liquid_status.depth_level, liquid_status.type, res);
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 0f4beb3b1..bba39a064 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -607,7 +607,7 @@ bool ChatHandler::HandleGameObjectTurnCommand(const char* args)
obj->SaveToDB();
obj->Refresh();
- PSendSysMessage(LANG_COMMAND_TURNOBJMESSAGE, obj->GetGUIDLow(), obj->GetGOInfo()->name, obj->GetGUIDLow(), o);
+ PSendSysMessage(LANG_COMMAND_TURNOBJMESSAGE, obj->GetGUIDLow(), obj->GetGOInfo()->name, obj->GetGUIDLow());
return true;
}
@@ -1129,7 +1129,7 @@ bool ChatHandler::HandleNpcAddVendorItemCommand(const char* args)
incrtime = atol(fincrtime);
char* fextendedcost = strtok(NULL, " "); //add ExtendedCost, default: 0
- uint32 extendedcost = fextendedcost ? atol(fextendedcost) : 0;
+ int32 extendedcost = fextendedcost ? atol(fextendedcost) : 0;
Creature* vendor = getSelectedCreature();
@@ -4092,6 +4092,112 @@ bool ChatHandler::HandleLearnAllRecipesCommand(const char* args)
return true;
}
+bool ChatHandler::HandleLookupAccountEmailCommand(const char* args)
+{
+
+ if (!*args)
+ return false;
+
+ std::string email = strtok ((char*)args, " ");
+ char* limit_str = strtok (NULL, " ");
+ uint32 limit = limit_str ? atoi (limit_str) : 100;
+
+ loginDatabase.escape_string (email);
+ // 0 1 2 3 4
+ QueryResult *result = loginDatabase.PQuery("SELECT id, username, last_ip, gmlevel, expansion FROM account WHERE email "_LIKE_" "_CONCAT3_("'%%'","'%s'","'%%'"), email.c_str ());
+
+ return ShowAccountListHelper(result,&limit);
+}
+
+bool ChatHandler::HandleLookupAccountIpCommand(const char* args)
+{
+
+ if (!*args)
+ return false;
+
+ std::string ip = strtok ((char*)args, " ");
+ char* limit_str = strtok (NULL, " ");
+ uint32 limit = limit_str ? atoi (limit_str) : 100;
+
+ loginDatabase.escape_string (ip);
+
+ // 0 1 2 3 4
+ QueryResult *result = loginDatabase.PQuery("SELECT id, username, last_ip, gmlevel, expansion FROM account WHERE last_ip "_LIKE_" "_CONCAT3_("'%%'","'%s'","'%%'"), ip.c_str ());
+
+ return ShowAccountListHelper(result,&limit);
+}
+
+bool ChatHandler::HandleLookupAccountNameCommand(const char* args)
+{
+ if (!*args)
+ return false;
+
+ std::string account = strtok ((char*)args, " ");
+ char* limit_str = strtok (NULL, " ");
+ uint32 limit = limit_str ? atoi (limit_str) : 100;
+
+ if (!AccountMgr::normalizeString (account))
+ return false;
+
+ loginDatabase.escape_string (account);
+ // 0 1 2 3 4
+ QueryResult *result = loginDatabase.PQuery("SELECT id, username, last_ip, gmlevel, expansion FROM account WHERE username "_LIKE_" "_CONCAT3_("'%%'","'%s'","'%%'"), account.c_str ());
+
+ return ShowAccountListHelper(result,&limit);
+}
+
+bool ChatHandler::ShowAccountListHelper(QueryResult* result, uint32* limit, bool title, bool error)
+{
+ if (!result)
+ {
+ if (error)
+ SendSysMessage(LANG_ACCOUNT_LIST_EMPTY);
+ return true;
+ }
+
+ ///- Display the list of account/characters online
+ if (!m_session && title) // not output header for online case
+ {
+ SendSysMessage(LANG_ACCOUNT_LIST_BAR);
+ SendSysMessage(LANG_ACCOUNT_LIST_HEADER);
+ SendSysMessage(LANG_ACCOUNT_LIST_BAR);
+ }
+
+ ///- Circle through accounts
+ do
+ {
+ // check limit
+ if (limit)
+ {
+ if(*limit == 0)
+ break;
+ --*limit;
+ }
+
+ Field *fields = result->Fetch();
+ uint32 account = fields[0].GetUInt32();
+
+ WorldSession* session = sWorld.FindSession(account);
+ Player* player = session ? session->GetPlayer() : NULL;
+ char const* char_name = player ? player->GetName() : " - ";
+
+ if(m_session)
+ PSendSysMessage(LANG_ACCOUNT_LIST_LINE_CHAT,
+ account,fields[1].GetString(),char_name,fields[2].GetString(),fields[3].GetUInt32(),fields[4].GetUInt32());
+ else
+ PSendSysMessage(LANG_ACCOUNT_LIST_LINE_CONSOLE,
+ account,fields[1].GetString(),char_name,fields[2].GetString(),fields[3].GetUInt32(),fields[4].GetUInt32());
+
+ }while(result->NextRow());
+
+ delete result;
+
+ if (!m_session) // not output header for online case
+ SendSysMessage(LANG_ACCOUNT_LIST_BAR);
+
+ return true;
+}
+
bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
{
@@ -4100,13 +4206,13 @@ bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
std::string ip = strtok ((char*)args, " ");
char* limit_str = strtok (NULL, " ");
- int32 limit = limit_str ? atoi (limit_str) : -1;
+ uint32 limit = limit_str ? atoi (limit_str) : 100;
loginDatabase.escape_string (ip);
- QueryResult* result = loginDatabase.PQuery ("SELECT id,username FROM account WHERE last_ip = '%s'", ip.c_str ());
+ QueryResult* result = loginDatabase.PQuery ("SELECT id,username FROM account WHERE last_ip "_LIKE_" "_CONCAT3_("'%%'","'%s'","'%%'"), ip.c_str ());
- return LookupPlayerSearchCommand (result,limit);
+ return LookupPlayerSearchCommand (result,&limit);
}
bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args)
@@ -4116,16 +4222,16 @@ bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args)
std::string account = strtok ((char*)args, " ");
char* limit_str = strtok (NULL, " ");
- int32 limit = limit_str ? atoi (limit_str) : -1;
+ uint32 limit = limit_str ? atoi (limit_str) : 100;
if (!AccountMgr::normalizeString (account))
return false;
loginDatabase.escape_string (account);
- QueryResult* result = loginDatabase.PQuery ("SELECT id,username FROM account WHERE username = '%s'", account.c_str ());
+ QueryResult* result = loginDatabase.PQuery ("SELECT id,username FROM account WHERE username "_LIKE_" "_CONCAT3_("'%%'","'%s'","'%%'"), account.c_str ());
- return LookupPlayerSearchCommand (result,limit);
+ return LookupPlayerSearchCommand (result,&limit);
}
bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args)
@@ -4136,57 +4242,57 @@ bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args)
std::string email = strtok ((char*)args, " ");
char* limit_str = strtok (NULL, " ");
- int32 limit = limit_str ? atoi (limit_str) : -1;
+ uint32 limit = limit_str ? atoi (limit_str) : 100;
loginDatabase.escape_string (email);
- QueryResult* result = loginDatabase.PQuery ("SELECT id,username FROM account WHERE email = '%s'", email.c_str ());
+ QueryResult* result = loginDatabase.PQuery ("SELECT id,username FROM account WHERE email "_LIKE_" "_CONCAT3_("'%%'","'%s'","'%%'"), email.c_str ());
- return LookupPlayerSearchCommand (result,limit);
+ return LookupPlayerSearchCommand (result,&limit);
}
-bool ChatHandler::LookupPlayerSearchCommand(QueryResult* result, int32 limit)
+bool ChatHandler::LookupPlayerSearchCommand(QueryResult* result, uint32* limit)
{
- if(!result)
+ if (!result)
{
PSendSysMessage(LANG_NO_PLAYERS_FOUND);
SetSentErrorMessage(true);
return false;
}
- int i =0;
+ uint32 limit_original = limit ? *limit : 100;
+
+ uint32 limit_local = limit_original;
+
+ if (!limit)
+ limit = &limit_local;
+
do
{
+ if (limit && *limit == 0)
+ break;
+
Field* fields = result->Fetch();
uint32 acc_id = fields[0].GetUInt32();
std::string acc_name = fields[1].GetCppString();
- QueryResult* chars = CharacterDatabase.PQuery("SELECT guid,name FROM characters WHERE account = '%u'", acc_id);
- if(chars)
+ ///- Get the characters for account id
+ QueryResult *chars = CharacterDatabase.PQuery( "SELECT guid, name, race, class, level FROM characters WHERE account = %u", acc_id);
+ if (chars)
{
- PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT,acc_name.c_str(),acc_id);
-
- uint64 guid = 0;
- std::string name;
-
- do
+ if (chars->GetRowCount())
{
- Field* charfields = chars->Fetch();
- guid = charfields[0].GetUInt64();
- name = charfields[1].GetCppString();
-
- PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER,name.c_str(),guid);
- ++i;
-
- } while( chars->NextRow() && ( limit == -1 || i < limit ) );
-
- delete chars;
+ PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT,acc_name.c_str(),acc_id);
+ ShowPlayerListHelper(chars,limit,true,false);
+ }
+ else
+ delete chars;
}
} while(result->NextRow());
delete result;
- if(i==0) // empty accounts only
+ if (*limit==limit_original) // empty accounts only
{
PSendSysMessage(LANG_NO_PLAYERS_FOUND);
SetSentErrorMessage(true);
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index e9e77ff1c..6ed7809e3 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -579,7 +579,7 @@ bool ChatHandler::HandleReloadSpellProcEventCommand(const char*)
bool ChatHandler::HandleReloadSpellBonusesCommand(const char*)
{
sLog.outString( "Re-Loading Spell Bonus Data..." );
- sSpellMgr.LoadSpellBonusess();
+ sSpellMgr.LoadSpellBonuses();
SendGlobalSysMessage("DB table `spell_bonus_data` (spell damage/healing coefficients) reloaded.");
return true;
}
@@ -1832,9 +1832,13 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(const char* /*args*/)
return true;
uint32 family = clsEntry->spellfamily;
- for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i)
+ for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i)
{
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(i);
+ SkillLineAbilityEntry const *entry = sSkillLineAbilityStore.LookupEntry(i);
+ if (!entry)
+ continue;
+
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(entry->spellId);
if(!spellInfo)
continue;
@@ -1859,7 +1863,7 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(const char* /*args*/)
if(!SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer(),false))
continue;
- m_session->GetPlayer()->learnSpell(i, false);
+ m_session->GetPlayer()->learnSpell(spellInfo->Id, false);
}
SendSysMessage(LANG_COMMAND_LEARN_CLASS_SPELLS);
@@ -6136,24 +6140,23 @@ bool ChatHandler::HandleServerSetMotdCommand(const char* args)
return true;
}
-/// Output list of character for account
-bool ChatHandler::HandleAccountCharactersCommand(const char* args)
+bool ChatHandler::ShowPlayerListHelper(QueryResult* result, uint32* limit, bool title, bool error)
{
- ///- Get the command line arguments
- std::string account_name;
- Player* target = NULL; // only for triggering use targeted player account
- uint32 account_id = extractAccountId((char*)args, &account_name, &target);
- if (!account_id )
- return false;
-
- ///- Get the characters for account id
- QueryResult *result = CharacterDatabase.PQuery( "SELECT guid, name, race, class, level FROM characters WHERE account = %u", account_id);
-
- if (!m_session)
+ if (!result)
{
- SendSysMessage(LANG_ACCOUNT_CHARACTERS_LIST_BAR);
- SendSysMessage(LANG_ACCOUNT_CHARACTERS_LIST_HEADER);
- SendSysMessage(LANG_ACCOUNT_CHARACTERS_LIST_BAR);
+ if (error)
+ {
+ PSendSysMessage(LANG_NO_PLAYERS_FOUND);
+ SetSentErrorMessage(true);
+ }
+ return false;
+ }
+
+ if (!m_session && title)
+ {
+ SendSysMessage(LANG_CHARACTERS_LIST_BAR);
+ SendSysMessage(LANG_CHARACTERS_LIST_HEADER);
+ SendSysMessage(LANG_CHARACTERS_LIST_BAR);
}
if (result)
@@ -6161,6 +6164,14 @@ bool ChatHandler::HandleAccountCharactersCommand(const char* args)
///- Circle through them. Display username and GM level
do
{
+ // check limit
+ if (limit)
+ {
+ if(*limit == 0)
+ break;
+ --*limit;
+ }
+
Field *fields = result->Fetch();
uint32 guid = fields[0].GetUInt32();
std::string name = fields[1].GetCppString();
@@ -6175,9 +6186,9 @@ bool ChatHandler::HandleAccountCharactersCommand(const char* args)
char const* class_name = classEntry ? classEntry->name[GetSessionDbcLocale()] : ">";
if (!m_session)
- PSendSysMessage(LANG_ACCOUNT_CHARACTERS_LIST_LINE_CONSOLE, guid, name.c_str(), race_name, class_name, level);
+ PSendSysMessage(LANG_CHARACTERS_LIST_LINE_CONSOLE, guid, name.c_str(), race_name, class_name, level);
else
- PSendSysMessage(LANG_ACCOUNT_CHARACTERS_LIST_LINE_CHAT, guid, name.c_str(), name.c_str(), race_name, class_name, level);
+ PSendSysMessage(LANG_CHARACTERS_LIST_LINE_CHAT, guid, name.c_str(), name.c_str(), race_name, class_name, level);
}while( result->NextRow() );
@@ -6185,11 +6196,28 @@ bool ChatHandler::HandleAccountCharactersCommand(const char* args)
}
if (!m_session)
- SendSysMessage(LANG_ACCOUNT_CHARACTERS_LIST_BAR);
+ SendSysMessage(LANG_CHARACTERS_LIST_BAR);
return true;
}
+
+/// Output list of character for account
+bool ChatHandler::HandleAccountCharactersCommand(const char* args)
+{
+ ///- Get the command line arguments
+ std::string account_name;
+ Player* target = NULL; // only for triggering use targeted player account
+ uint32 account_id = extractAccountId((char*)args, &account_name, &target);
+ if (!account_id )
+ return false;
+
+ ///- Get the characters for account id
+ QueryResult *result = CharacterDatabase.PQuery( "SELECT guid, name, race, class, level FROM characters WHERE account = %u", account_id);
+
+ return ShowPlayerListHelper(result);
+}
+
/// Set/Unset the expansion level for an account
bool ChatHandler::HandleAccountSetAddonCommand(const char* args)
{
diff --git a/src/game/LootHandler.cpp b/src/game/LootHandler.cpp
index 793b5c217..61fded607 100644
--- a/src/game/LootHandler.cpp
+++ b/src/game/LootHandler.cpp
@@ -436,19 +436,17 @@ void WorldSession::DoLootRelease(ObjectGuid lguid)
loot = &pCreature->loot;
// update next looter
- if(Player *recipient = pCreature->GetLootRecipient())
- if(Group* group = recipient->GetGroup())
- if (group->GetLooterGuid() == player->GetGUID())
- group->UpdateLooterGuid(pCreature);
+ if(Group* group = pCreature->GetGroupLootRecipient())
+ if (group->GetLooterGuid() == player->GetGUID())
+ group->UpdateLooterGuid(pCreature);
if (loot->isLooted())
{
- // skip pickpocketing loot for speed, skinning timer redunction is no-op in fact
+ // for example skinning after normal loot
+ pCreature->PrepareBodyLootState();
+
if(!pCreature->isAlive())
pCreature->AllLootRemovedFromCorpse();
-
- pCreature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- loot->clear();
}
break;
}
diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp
index abd73ca34..6002f4cd3 100644
--- a/src/game/LootMgr.cpp
+++ b/src/game/LootMgr.cpp
@@ -724,11 +724,11 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
case ALL_PERMISSION:
case MASTER_PERMISSION:
{
- uint8 slot_type = (lv.permission==MASTER_PERMISSION) ? 2 : 0;
for (uint8 i = 0; i < l.items.size(); ++i)
{
if (!l.items[i].is_looted && !l.items[i].freeforall && !l.items[i].conditionId && l.items[i].AllowedForPlayer(lv.viewer))
{
+ uint8 slot_type = (lv.permission==MASTER_PERMISSION && !l.items[i].is_underthreshold) ? 2 : 0;
b << uint8(i) << l.items[i]; //only send one-player loot items now, free for all will be sent later
b << uint8(slot_type); // 0 - get 2 - master selection
++itemsShown;
diff --git a/src/game/LootMgr.h b/src/game/LootMgr.h
index 35662044a..455195942 100644
--- a/src/game/LootMgr.h
+++ b/src/game/LootMgr.h
@@ -101,6 +101,8 @@ struct LootItem
bool AllowedForPlayer(Player const * player) const;
};
+typedef std::vector LootItemList;
+
struct QuestItem
{
uint8 index; // position in quest_items;
@@ -220,7 +222,7 @@ struct Loot
QuestItemMap const& GetPlayerFFAItems() const { return PlayerFFAItems; }
QuestItemMap const& GetPlayerNonQuestNonFFAConditionalItems() const { return PlayerNonQuestNonFFAConditionalItems; }
- std::vector items;
+ LootItemList items;
uint32 gold;
uint8 unlootedCount;
LootType loot_type; // required for achievement system
@@ -281,7 +283,7 @@ struct Loot
QuestItemList* FillQuestLoot(Player* player);
QuestItemList* FillNonQuestNonFFAConditionalLoot(Player* player);
- std::vector quest_items;
+ LootItemList quest_items;
std::set PlayersLooting;
QuestItemMap PlayerQuestItems;
QuestItemMap PlayerFFAItems;
diff --git a/src/game/Makefile.am b/src/game/Makefile.am
index b9022daf0..f4ef7892f 100644
--- a/src/game/Makefile.am
+++ b/src/game/Makefile.am
@@ -132,6 +132,8 @@ libmangosgame_a_SOURCES = \
GossipDef.cpp \
GossipDef.h \
GridDefines.h \
+ GridMap.cpp \
+ GridMap.h \
GridNotifiers.cpp \
GridNotifiers.h \
GridNotifiersImpl.h \
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index c76dc16b8..bca4cca36 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -35,20 +35,11 @@
#include "Group.h"
#include "MapRefManager.h"
#include "DBCEnums.h"
-
#include "MapInstanced.h"
#include "InstanceSaveMgr.h"
#include "VMapFactory.h"
#include "BattleGroundMgr.h"
-GridState* si_GridStates[MAX_GRID_STATE];
-
-static char const* MAP_MAGIC = "MAPS";
-static char const* MAP_VERSION_MAGIC = "v1.1";
-static char const* MAP_AREA_MAGIC = "AREA";
-static char const* MAP_HEIGHT_MAGIC = "MHGT";
-static char const* MAP_LIQUID_MAGIC = "MLIQ";
-
struct ScriptAction
{
uint64 sourceGUID;
@@ -66,58 +57,6 @@ Map::~Map()
sWorld.DecreaseScheduledScriptCount(m_scriptSchedule.size());
}
-bool Map::ExistMap(uint32 mapid,int gx,int gy)
-{
- int len = sWorld.GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1;
- char* tmp = new char[len];
- snprintf(tmp, len, (char *)(sWorld.GetDataPath()+"maps/%03u%02u%02u.map").c_str(),mapid,gx,gy);
-
- FILE *pf=fopen(tmp,"rb");
-
- if(!pf)
- {
- sLog.outError("Check existing of map file '%s': not exist!",tmp);
- delete[] tmp;
- return false;
- }
-
- map_fileheader header;
- fread(&header, sizeof(header), 1, pf);
- if (header.mapMagic != *((uint32 const*)(MAP_MAGIC)) ||
- header.versionMagic != *((uint32 const*)(MAP_VERSION_MAGIC)) ||
- !IsAcceptableClientBuild(header.buildMagic))
- {
- sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.",tmp);
- delete [] tmp;
- fclose(pf); //close file before return
- return false;
- }
-
- delete [] tmp;
- fclose(pf);
- return true;
-}
-
-bool Map::ExistVMap(uint32 mapid,int gx,int gy)
-{
- if(VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager())
- {
- if(vmgr->isMapLoadingEnabled())
- {
- // x and y are swapped !! => fixed now
- bool exists = vmgr->existsMap((sWorld.GetDataPath()+ "vmaps").c_str(), mapid, gx,gy);
- if(!exists)
- {
- std::string name = vmgr->getDirFileName(mapid,gx,gy);
- sLog.outError("VMap file '%s' is missing or point to wrong version vmap file, redo vmaps with latest vmap_assembler.exe program", (sWorld.GetDataPath()+"vmaps/"+name).c_str());
- return false;
- }
- }
- }
-
- return true;
-}
-
void Map::LoadVMap(int gx,int gy)
{
// x and y are swapped !!
@@ -185,22 +124,6 @@ void Map::LoadMapAndVMap(int gx,int gy)
LoadVMap(gx, gy); // Only load the data for the base map
}
-void Map::InitStateMachine()
-{
- si_GridStates[GRID_STATE_INVALID] = new InvalidState;
- si_GridStates[GRID_STATE_ACTIVE] = new ActiveState;
- si_GridStates[GRID_STATE_IDLE] = new IdleState;
- si_GridStates[GRID_STATE_REMOVAL] = new RemovalState;
-}
-
-void Map::DeleteStateMachine()
-{
- delete si_GridStates[GRID_STATE_INVALID];
- delete si_GridStates[GRID_STATE_ACTIVE];
- delete si_GridStates[GRID_STATE_IDLE];
- delete si_GridStates[GRID_STATE_REMOVAL];
-}
-
Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode, Map* _parent)
: i_mapEntry (sMapStore.LookupEntry(id)), i_spawnMode(SpawnMode),
i_id(id), i_InstanceId(InstanceId), m_unloadTimer(0),
@@ -707,7 +630,7 @@ void Map::Update(const uint32 &t_diff)
GridInfo *info = i->getSource()->getGridInfoRef();
++i; // The update might delete the map and we need the next map before the iterator gets invalid
ASSERT(grid->GetGridState() >= 0 && grid->GetGridState() < MAX_GRID_STATE);
- si_GridStates[grid->GetGridState()]->Update(*this, *grid, *info, grid->getX(), grid->getY(), t_diff);
+ sMapMgr.UpdateGridState(grid->GetGridState(), *this, *grid, *info, grid->getX(), grid->getY(), t_diff);
}
}
@@ -1066,510 +989,6 @@ uint32 Map::GetMaxResetDelay() const
return mapDiff ? mapDiff->resetTime : 0;
}
-//*****************************
-// Grid function
-//*****************************
-GridMap::GridMap()
-{
- m_flags = 0;
- // Area data
- m_gridArea = 0;
- m_area_map = NULL;
- // Height level data
- m_gridHeight = INVALID_HEIGHT;
- m_gridGetHeight = &GridMap::getHeightFromFlat;
- m_V9 = NULL;
- m_V8 = NULL;
- // Liquid data
- m_liquidType = 0;
- m_liquid_offX = 0;
- m_liquid_offY = 0;
- m_liquid_width = 0;
- m_liquid_height = 0;
- m_liquidLevel = INVALID_HEIGHT;
- m_liquid_type = NULL;
- m_liquid_map = NULL;
-}
-
-GridMap::~GridMap()
-{
- unloadData();
-}
-
-bool GridMap::loadData(char *filename)
-{
- // Unload old data if exist
- unloadData();
-
- map_fileheader header;
- // Not return error if file not found
- FILE *in = fopen(filename, "rb");
- if (!in)
- return true;
- fread(&header, sizeof(header),1,in);
- if (header.mapMagic == *((uint32 const*)(MAP_MAGIC)) &&
- header.versionMagic == *((uint32 const*)(MAP_VERSION_MAGIC)) ||
- !IsAcceptableClientBuild(header.buildMagic))
- {
- // loadup area data
- if (header.areaMapOffset && !loadAreaData(in, header.areaMapOffset, header.areaMapSize))
- {
- sLog.outError("Error loading map area data\n");
- fclose(in);
- return false;
- }
- // loadup height data
- if (header.heightMapOffset && !loadHeightData(in, header.heightMapOffset, header.heightMapSize))
- {
- sLog.outError("Error loading map height data\n");
- fclose(in);
- return false;
- }
- // loadup liquid data
- if (header.liquidMapOffset && !loadLiquidData(in, header.liquidMapOffset, header.liquidMapSize))
- {
- sLog.outError("Error loading map liquids data\n");
- fclose(in);
- return false;
- }
- fclose(in);
- return true;
- }
- sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.", filename);
- fclose(in);
- return false;
-}
-
-void GridMap::unloadData()
-{
- if (m_area_map) delete[] m_area_map;
- if (m_V9) delete[] m_V9;
- if (m_V8) delete[] m_V8;
- if (m_liquid_type) delete[] m_liquid_type;
- if (m_liquid_map) delete[] m_liquid_map;
- m_area_map = NULL;
- m_V9 = NULL;
- m_V8 = NULL;
- m_liquid_type = NULL;
- m_liquid_map = NULL;
- m_gridGetHeight = &GridMap::getHeightFromFlat;
-}
-
-bool GridMap::loadAreaData(FILE *in, uint32 offset, uint32 /*size*/)
-{
- map_areaHeader header;
- fseek(in, offset, SEEK_SET);
- fread(&header, sizeof(header), 1, in);
- if (header.fourcc != *((uint32 const*)(MAP_AREA_MAGIC)))
- return false;
-
- m_gridArea = header.gridArea;
- if (!(header.flags & MAP_AREA_NO_AREA))
- {
- m_area_map = new uint16 [16*16];
- fread(m_area_map, sizeof(uint16), 16*16, in);
- }
- return true;
-}
-
-bool GridMap::loadHeightData(FILE *in, uint32 offset, uint32 /*size*/)
-{
- map_heightHeader header;
- fseek(in, offset, SEEK_SET);
- fread(&header, sizeof(header), 1, in);
- if (header.fourcc != *((uint32 const*)(MAP_HEIGHT_MAGIC)))
- return false;
-
- m_gridHeight = header.gridHeight;
- if (!(header.flags & MAP_HEIGHT_NO_HEIGHT))
- {
- if ((header.flags & MAP_HEIGHT_AS_INT16))
- {
- m_uint16_V9 = new uint16 [129*129];
- m_uint16_V8 = new uint16 [128*128];
- fread(m_uint16_V9, sizeof(uint16), 129*129, in);
- fread(m_uint16_V8, sizeof(uint16), 128*128, in);
- m_gridIntHeightMultiplier = (header.gridMaxHeight - header.gridHeight) / 65535;
- m_gridGetHeight = &GridMap::getHeightFromUint16;
- }
- else if ((header.flags & MAP_HEIGHT_AS_INT8))
- {
- m_uint8_V9 = new uint8 [129*129];
- m_uint8_V8 = new uint8 [128*128];
- fread(m_uint8_V9, sizeof(uint8), 129*129, in);
- fread(m_uint8_V8, sizeof(uint8), 128*128, in);
- m_gridIntHeightMultiplier = (header.gridMaxHeight - header.gridHeight) / 255;
- m_gridGetHeight = &GridMap::getHeightFromUint8;
- }
- else
- {
- m_V9 = new float [129*129];
- m_V8 = new float [128*128];
- fread(m_V9, sizeof(float), 129*129, in);
- fread(m_V8, sizeof(float), 128*128, in);
- m_gridGetHeight = &GridMap::getHeightFromFloat;
- }
- }
- else
- m_gridGetHeight = &GridMap::getHeightFromFlat;
- return true;
-}
-
-bool GridMap::loadLiquidData(FILE *in, uint32 offset, uint32 /*size*/)
-{
- map_liquidHeader header;
- fseek(in, offset, SEEK_SET);
- fread(&header, sizeof(header), 1, in);
- if (header.fourcc != *((uint32 const*)(MAP_LIQUID_MAGIC)))
- return false;
-
- m_liquidType = header.liquidType;
- m_liquid_offX = header.offsetX;
- m_liquid_offY = header.offsetY;
- m_liquid_width = header.width;
- m_liquid_height= header.height;
- m_liquidLevel = header.liquidLevel;
-
- if (!(header.flags & MAP_LIQUID_NO_TYPE))
- {
- m_liquid_type = new uint8 [16*16];
- fread(m_liquid_type, sizeof(uint8), 16*16, in);
- }
- if (!(header.flags & MAP_LIQUID_NO_HEIGHT))
- {
- m_liquid_map = new float [m_liquid_width*m_liquid_height];
- fread(m_liquid_map, sizeof(float), m_liquid_width*m_liquid_height, in);
- }
- return true;
-}
-
-uint16 GridMap::getArea(float x, float y)
-{
- if (!m_area_map)
- return m_gridArea;
-
- x = 16 * (32 - x/SIZE_OF_GRIDS);
- y = 16 * (32 - y/SIZE_OF_GRIDS);
- int lx = (int)x & 15;
- int ly = (int)y & 15;
- return m_area_map[lx*16 + ly];
-}
-
-float GridMap::getHeightFromFlat(float /*x*/, float /*y*/) const
-{
- return m_gridHeight;
-}
-
-float GridMap::getHeightFromFloat(float x, float y) const
-{
- if (!m_V8 || !m_V9)
- return m_gridHeight;
-
- x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
- y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
-
- int x_int = (int)x;
- int y_int = (int)y;
- x -= x_int;
- y -= y_int;
- x_int&=(MAP_RESOLUTION - 1);
- y_int&=(MAP_RESOLUTION - 1);
-
- // Height stored as: h5 - its v8 grid, h1-h4 - its v9 grid
- // +--------------> X
- // | h1-------h2 Coordinates is:
- // | | \ 1 / | h1 0,0
- // | | \ / | h2 0,1
- // | | 2 h5 3 | h3 1,0
- // | | / \ | h4 1,1
- // | | / 4 \ | h5 1/2,1/2
- // | h3-------h4
- // V Y
- // For find height need
- // 1 - detect triangle
- // 2 - solve linear equation from triangle points
- // Calculate coefficients for solve h = a*x + b*y + c
-
- float a,b,c;
- // Select triangle:
- if (x+y < 1)
- {
- if (x > y)
- {
- // 1 triangle (h1, h2, h5 points)
- float h1 = m_V9[(x_int )*129 + y_int];
- float h2 = m_V9[(x_int+1)*129 + y_int];
- float h5 = 2 * m_V8[x_int*128 + y_int];
- a = h2-h1;
- b = h5-h1-h2;
- c = h1;
- }
- else
- {
- // 2 triangle (h1, h3, h5 points)
- float h1 = m_V9[x_int*129 + y_int ];
- float h3 = m_V9[x_int*129 + y_int+1];
- float h5 = 2 * m_V8[x_int*128 + y_int];
- a = h5 - h1 - h3;
- b = h3 - h1;
- c = h1;
- }
- }
- else
- {
- if (x > y)
- {
- // 3 triangle (h2, h4, h5 points)
- float h2 = m_V9[(x_int+1)*129 + y_int ];
- float h4 = m_V9[(x_int+1)*129 + y_int+1];
- float h5 = 2 * m_V8[x_int*128 + y_int];
- a = h2 + h4 - h5;
- b = h4 - h2;
- c = h5 - h4;
- }
- else
- {
- // 4 triangle (h3, h4, h5 points)
- float h3 = m_V9[(x_int )*129 + y_int+1];
- float h4 = m_V9[(x_int+1)*129 + y_int+1];
- float h5 = 2 * m_V8[x_int*128 + y_int];
- a = h4 - h3;
- b = h3 + h4 - h5;
- c = h5 - h4;
- }
- }
- // Calculate height
- return a * x + b * y + c;
-}
-
-float GridMap::getHeightFromUint8(float x, float y) const
-{
- if (!m_uint8_V8 || !m_uint8_V9)
- return m_gridHeight;
-
- x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
- y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
-
- int x_int = (int)x;
- int y_int = (int)y;
- x -= x_int;
- y -= y_int;
- x_int&=(MAP_RESOLUTION - 1);
- y_int&=(MAP_RESOLUTION - 1);
-
- int32 a, b, c;
- uint8 *V9_h1_ptr = &m_uint8_V9[x_int*128 + x_int + y_int];
- if (x+y < 1)
- {
- if (x > y)
- {
- // 1 triangle (h1, h2, h5 points)
- int32 h1 = V9_h1_ptr[ 0];
- int32 h2 = V9_h1_ptr[129];
- int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
- a = h2-h1;
- b = h5-h1-h2;
- c = h1;
- }
- else
- {
- // 2 triangle (h1, h3, h5 points)
- int32 h1 = V9_h1_ptr[0];
- int32 h3 = V9_h1_ptr[1];
- int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
- a = h5 - h1 - h3;
- b = h3 - h1;
- c = h1;
- }
- }
- else
- {
- if (x > y)
- {
- // 3 triangle (h2, h4, h5 points)
- int32 h2 = V9_h1_ptr[129];
- int32 h4 = V9_h1_ptr[130];
- int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
- a = h2 + h4 - h5;
- b = h4 - h2;
- c = h5 - h4;
- }
- else
- {
- // 4 triangle (h3, h4, h5 points)
- int32 h3 = V9_h1_ptr[ 1];
- int32 h4 = V9_h1_ptr[130];
- int32 h5 = 2 * m_uint8_V8[x_int*128 + y_int];
- a = h4 - h3;
- b = h3 + h4 - h5;
- c = h5 - h4;
- }
- }
- // Calculate height
- return (float)((a * x) + (b * y) + c)*m_gridIntHeightMultiplier + m_gridHeight;
-}
-
-float GridMap::getHeightFromUint16(float x, float y) const
-{
- if (!m_uint16_V8 || !m_uint16_V9)
- return m_gridHeight;
-
- x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
- y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
-
- int x_int = (int)x;
- int y_int = (int)y;
- x -= x_int;
- y -= y_int;
- x_int&=(MAP_RESOLUTION - 1);
- y_int&=(MAP_RESOLUTION - 1);
-
- int32 a, b, c;
- uint16 *V9_h1_ptr = &m_uint16_V9[x_int*128 + x_int + y_int];
- if (x+y < 1)
- {
- if (x > y)
- {
- // 1 triangle (h1, h2, h5 points)
- int32 h1 = V9_h1_ptr[ 0];
- int32 h2 = V9_h1_ptr[129];
- int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
- a = h2-h1;
- b = h5-h1-h2;
- c = h1;
- }
- else
- {
- // 2 triangle (h1, h3, h5 points)
- int32 h1 = V9_h1_ptr[0];
- int32 h3 = V9_h1_ptr[1];
- int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
- a = h5 - h1 - h3;
- b = h3 - h1;
- c = h1;
- }
- }
- else
- {
- if (x > y)
- {
- // 3 triangle (h2, h4, h5 points)
- int32 h2 = V9_h1_ptr[129];
- int32 h4 = V9_h1_ptr[130];
- int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
- a = h2 + h4 - h5;
- b = h4 - h2;
- c = h5 - h4;
- }
- else
- {
- // 4 triangle (h3, h4, h5 points)
- int32 h3 = V9_h1_ptr[ 1];
- int32 h4 = V9_h1_ptr[130];
- int32 h5 = 2 * m_uint16_V8[x_int*128 + y_int];
- a = h4 - h3;
- b = h3 + h4 - h5;
- c = h5 - h4;
- }
- }
- // Calculate height
- return (float)((a * x) + (b * y) + c)*m_gridIntHeightMultiplier + m_gridHeight;
-}
-
-float GridMap::getLiquidLevel(float x, float y)
-{
- if (!m_liquid_map)
- return m_liquidLevel;
-
- x = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
- y = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
-
- int cx_int = ((int)x & (MAP_RESOLUTION-1)) - m_liquid_offY;
- int cy_int = ((int)y & (MAP_RESOLUTION-1)) - m_liquid_offX;
-
- if (cx_int < 0 || cx_int >=m_liquid_height)
- return INVALID_HEIGHT;
- if (cy_int < 0 || cy_int >=m_liquid_width )
- return INVALID_HEIGHT;
-
- return m_liquid_map[cx_int*m_liquid_width + cy_int];
-}
-
-uint8 GridMap::getTerrainType(float x, float y)
-{
- if (!m_liquid_type)
- return (uint8)m_liquidType;
-
- x = 16 * (32 - x/SIZE_OF_GRIDS);
- y = 16 * (32 - y/SIZE_OF_GRIDS);
- int lx = (int)x & 15;
- int ly = (int)y & 15;
- return m_liquid_type[lx*16 + ly];
-}
-
-// Get water state on map
-inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData *data)
-{
- // Check water type (if no water return)
- if (!m_liquid_type && !m_liquidType)
- return LIQUID_MAP_NO_WATER;
-
- // Get cell
- float cx = MAP_RESOLUTION * (32 - x/SIZE_OF_GRIDS);
- float cy = MAP_RESOLUTION * (32 - y/SIZE_OF_GRIDS);
-
- int x_int = (int)cx & (MAP_RESOLUTION-1);
- int y_int = (int)cy & (MAP_RESOLUTION-1);
-
- // Check water type in cell
- uint8 type = m_liquid_type ? m_liquid_type[(x_int>>3)*16 + (y_int>>3)] : m_liquidType;
- if (type == 0)
- return LIQUID_MAP_NO_WATER;
-
- // Check req liquid type mask
- if (ReqLiquidType && !(ReqLiquidType&type))
- return LIQUID_MAP_NO_WATER;
-
- // Check water level:
- // Check water height map
- int lx_int = x_int - m_liquid_offY;
- int ly_int = y_int - m_liquid_offX;
- if (lx_int < 0 || lx_int >=m_liquid_height)
- return LIQUID_MAP_NO_WATER;
- if (ly_int < 0 || ly_int >=m_liquid_width )
- return LIQUID_MAP_NO_WATER;
-
- // Get water level
- float liquid_level = m_liquid_map ? m_liquid_map[lx_int*m_liquid_width + ly_int] : m_liquidLevel;
- // Get ground level (sub 0.2 for fix some errors)
- float ground_level = getHeight(x, y);
-
- // Check water level and ground level
- if (liquid_level < ground_level || z < ground_level - 2)
- return LIQUID_MAP_NO_WATER;
-
- // All ok in water -> store data
- if (data)
- {
- data->type = type;
- data->level = liquid_level;
- data->depth_level = ground_level;
- }
-
- // For speed check as int values
- int delta = int((liquid_level - z) * 10);
-
- // Get position delta
- if (delta > 20) // Under water
- return LIQUID_MAP_UNDER_WATER;
- if (delta > 0 ) // In water
- return LIQUID_MAP_IN_WATER;
- if (delta > -1) // Walk on water
- return LIQUID_MAP_WATER_WALK;
- // Above water
- return LIQUID_MAP_ABOVE_WATER;
-}
-
inline GridMap *Map::GetGrid(float x, float y)
{
// half opt method
@@ -1899,7 +1318,7 @@ uint8 Map::GetTerrainType(float x, float y ) const
return 0;
}
-ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData *data) const
+GridMapLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, GridMapLiquidData *data) const
{
if(GridMap* gmap = const_cast(this)->GetGrid(x, y))
return gmap->getLiquidStatus(x, y, z, ReqLiquidType, data);
@@ -1948,7 +1367,7 @@ bool Map::IsInWater(float x, float y, float pZ) const
// Check surface in x, y point for liquid
if (const_cast