Part 2: Merge branch 'master' of https://github.com/TrinityCore/TrinityCore into 4.3.4

This commit is contained in:
Shauren
2014-07-19 13:42:43 +02:00
9 changed files with 103 additions and 19 deletions

View File

@@ -49,8 +49,8 @@ add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
message(STATUS "MSVC: Disabled POSIX warnings")
if(NOT WITH_WARNINGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /wd4619")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /wd4619 /wd4800")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /wd4619 /wd4512")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /wd4619 /wd4512")
message(STATUS "MSVC: Disabled generic compiletime warnings")
endif()

View File

@@ -0,0 +1,20 @@
DELETE FROM `creature_addon` WHERE `guid` IN (
132567,
132568,
132566,
132564,
132565,
132553,
132554,
132555,
132556,
132557,
132558,
132559,
132560,
132561,
132562,
132563);
DELETE FROM `creature_template_addon` WHERE `entry`=23051;
INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
(23051, 0, 0x0, 0x1, '');

View File

@@ -0,0 +1,3 @@
DELETE FROM `spell_custom_attr` WHERE `entry`=49882;
INSERT INTO `spell_custom_attr` (`entry`, `attributes`) VALUES
(49882, 32768);

View File

@@ -17,9 +17,36 @@
#include "PacketLog.h"
#include "Config.h"
#include "ByteBuffer.h"
#include "WorldPacket.h"
#pragma pack(push, 1)
// Packet logging structures in PKT 3.1 format
struct LogHeader
{
char Signature[3];
uint16 FormatVersion;
uint8 SnifferId;
uint32 Build;
char Locale[4];
uint8 SessionKey[40];
uint32 SniffStartUnixtime;
uint32 SniffStartTicks;
uint32 OptionalDataSize;
};
struct PacketHeader
{
char Direction[4];
uint32 ConnectionId;
uint32 ArrivalTicks;
uint32 OptionalDataSize;
uint32 Length;
uint32 Opcode;
};
#pragma pack(pop)
PacketLog::PacketLog() : _file(NULL)
{
Initialize();
@@ -38,25 +65,42 @@ void PacketLog::Initialize()
std::string logsDir = sConfigMgr->GetStringDefault("LogsDir", "");
if (!logsDir.empty())
if ((logsDir.at(logsDir.length()-1) != '/') && (logsDir.at(logsDir.length()-1) != '\\'))
if ((logsDir.at(logsDir.length() - 1) != '/') && (logsDir.at(logsDir.length() - 1) != '\\'))
logsDir.push_back('/');
std::string logname = sConfigMgr->GetStringDefault("PacketLogFile", "");
if (!logname.empty())
{
_file = fopen((logsDir + logname).c_str(), "wb");
LogHeader header;
header.Signature[0] = 'P'; header.Signature[1] = 'K'; header.Signature[2] = 'T';
header.FormatVersion = 0x0301;
header.SnifferId = 'T';
header.Build = 12340;
header.Locale[0] = 'e'; header.Locale[1] = 'n'; header.Locale[2] = 'U'; header.Locale[3] = 'S';
std::memset(header.SessionKey, 0, sizeof(header.SessionKey));
header.SniffStartUnixtime = time(NULL);
header.SniffStartTicks = getMSTime();
header.OptionalDataSize = 0;
fwrite(&header, sizeof(header), 1, _file);
}
}
void PacketLog::LogPacket(WorldPacket const& packet, Direction direction)
{
ByteBuffer data(4+4+4+1+packet.size());
data << int32(packet.GetOpcode());
data << int32(packet.size());
data << uint32(time(NULL));
data << uint8(direction);
PacketHeader header;
*reinterpret_cast<uint32*>(header.Direction) = direction == CLIENT_TO_SERVER ? 0x47534d43 : 0x47534d53;
header.ConnectionId = 0;
header.ArrivalTicks = getMSTime();
header.OptionalDataSize = 0;
header.Length = packet.size() + 4;
header.Opcode = packet.GetOpcode();
for (uint32 i = 0; i < packet.size(); i++)
data << packet[i];
fwrite(&header, sizeof(header), 1, _file);
if (!packet.empty())
fwrite(packet.contents(), 1, packet.size(), _file);
fwrite(data.contents(), 1, data.size(), _file);
fflush(_file);
}

View File

@@ -25,6 +25,7 @@
#include "Opcodes.h"
#include "ScriptMgr.h"
#include "SHA1.h"
#include "PacketLog.h"
#include "BattlenetAccountMgr.h"
using boost::asio::ip::tcp;
@@ -110,6 +111,11 @@ void WorldSocket::AsyncReadData(size_t dataSize)
std::memcpy(packet.contents(), &_readBuffer[sizeof(ClientPktHeader)], header->size);
}
if (sPacketLog->CanLogPacket())
sPacketLog->LogPacket(packet, CLIENT_TO_SERVER);
TC_LOG_TRACE("network.opcode", "C->S: %s %s", (_worldSession ? _worldSession->GetPlayerInfo() : GetRemoteIpAddress()).c_str(), GetOpcodeNameForLogging(opcode).c_str());
switch (opcode)
{
case CMSG_PING:
@@ -188,6 +194,11 @@ void WorldSocket::AsyncReadData(size_t dataSize)
void WorldSocket::AsyncWrite(WorldPacket const& packet)
{
if (sPacketLog->CanLogPacket())
sPacketLog->LogPacket(packet, SERVER_TO_CLIENT);
TC_LOG_TRACE("network.opcode", "S->C: %s %s", (_worldSession ? _worldSession->GetPlayerInfo() : GetRemoteIpAddress()).c_str(), GetOpcodeNameForLogging(packet.GetOpcode()).c_str());
ServerPktHeader header(packet.size() + 2, packet.GetOpcode());
_authCrypt.EncryptSend((uint8*)header.header, header.getHeaderLength());

View File

@@ -51,8 +51,8 @@ public:
void Start();
const std::string GetRemoteIpAddress() const { return _socket.remote_endpoint().address().to_string(); };
unsigned short GetRemotePort() const { return _socket.remote_endpoint().port(); }
std::string GetRemoteIpAddress() const { return _socket.remote_endpoint().address().to_string(); };
uint16 GetRemotePort() const { return _socket.remote_endpoint().port(); }
void CloseSocket() { _socket.close(); };
bool IsOpen() { return _socket.is_open(); };

View File

@@ -3319,6 +3319,9 @@ void SpellMgr::LoadSpellInfoCorrections()
/// @todo: remove this when basepoints of all Ride Vehicle auras are calculated correctly
spellInfo->Effects[EFFECT_0].BasePoints = 1;
break;
case 59630: // Black Magic
spellInfo->Attributes |= SPELL_ATTR0_PASSIVE;
break;
// ULDUAR SPELLS
//
case 62374: // Pursued (Flame Leviathan)

View File

@@ -2133,7 +2133,7 @@ class spell_item_complete_raptor_capture : public SpellScriptLoader
enum ImpaleLeviroth
{
NPC_LEVIROTH = 26452,
SPELL_LEVIROTH_SELF_IMPALE = 49882,
SPELL_LEVIROTH_SELF_IMPALE = 49882
};
class spell_item_impale_leviroth : public SpellScriptLoader
@@ -2152,11 +2152,14 @@ class spell_item_impale_leviroth : public SpellScriptLoader
return true;
}
void HandleDummy(SpellEffIndex /* effIndex */)
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitCreature())
if (Creature* target = GetHitCreature())
if (target->GetEntry() == NPC_LEVIROTH && !target->HealthBelowPct(95))
{
target->CastSpell(target, SPELL_LEVIROTH_SELF_IMPALE, true);
target->ResetPlayerDamageReq();
}
}
void Register() override

View File

@@ -414,8 +414,8 @@ PidFile = ""
#
# PacketLogFile
# Description: Binary packet logging file for the world server.
# Filename extension must be .bin to be parsable with WowPacketParser.
# Example: "World.bin" - (Enabled)
# Filename extension must be .pkt to be parsable with WowPacketParser.
# Example: "World.pkt" - (Enabled)
# Default: "" - (Disabled)
PacketLogFile = ""