Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#

language: cpp
cache: ccache

# reduce clone time by only getting the latest commit and not the whole history (default for travis is 100)
git:
Expand All @@ -33,15 +34,20 @@ branches:

os:
- linux
- osx

compiler:
- clang
- gcc

env:
matrix:
- BUILD_TYPE=Release
- BUILD_TYPE=Release PCH_FLAG=ON
- BUILD_TYPE=Release
- BUILD_TYPE=Release PCH_FLAG=ON

matrix:
exclude:
- os: osx
compiler: gcc

addons:
apt:
Expand All @@ -60,18 +66,25 @@ addons:
- libboost-system1.55-dev
- libboost-program-options1.55-dev
- libboost-thread1.55-dev

# overwrite GCC version for GCC build only
before_install:
- if [ $CC = "gcc" ] ; then export CC=gcc-4.8 CXX=g++-4.8 ; fi

script:
- test -d _build || mkdir _build
- test -d _install || mkdir _install
- cd _build
- cmake -DCMAKE_INSTALL_PREFIX=../_install -DBUILD_EXTRACTOR=ON -DBUILD_VMAP_EXTRACTOR=ON -DBUILD_MMAP_EXTRACTOR=ON -DPCH=$PCH_FLAG ..
- make -j4
- make install
install: |-
if [ "$TRAVIS_OS_NAME" == "osx" ]
then
brew update
brew install mysql++
fi

script: |-
mkdir _build
mkdir _install
cd _build
cmake -DCMAKE_INSTALL_PREFIX=../_install -DBUILD_EXTRACTOR=ON -DBUILD_VMAP_EXTRACTOR=ON -DBUILD_MMAP_EXTRACTOR=ON -DPCH=$PCH_FLAG ..
make -j4
make install

# if this configuration file is not in one of the offical CMaNGOS repositories at http://github.com/cmangos/, PLEASE remove the notifications or point them to another IRC channel!

10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ if(UNIX)
find_package(MySQL REQUIRED)
endif()

# If OpenSSL path isn't specified on mac we set the one that homebrew uses
# since that's what most people will be using.
if (APPLE)
if (NOT OPENSSL_ROOT_DIR)
set(OPENSSL_ROOT_DIR /usr/local/opt/openssl/)
endif()
if (NOT OPENSSL_INCLUDE_DIR)
set(OPENSSL_INCLUDE_DIR /usr/local/opt/openssl/include)
endif()
endif()
find_package(OpenSSL REQUIRED)
find_package(ZLIB REQUIRED)
endif()
Expand Down
7 changes: 6 additions & 1 deletion contrib/mmap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ add_library(vmaplib
../../src/game/vmap/ModelInstance.cpp
)

target_link_libraries(vmaplib g3dlite zlib)
IF(APPLE)
FIND_LIBRARY(CORE_SERVICES CoreServices )
SET(EXTRA_LIBS ${CORE_SERVICES})
ENDIF (APPLE)

target_link_libraries(vmaplib g3dlite zlib ${EXTRA_LIBS})

set(SOURCES
./src/IntermediateValues.cpp
Expand Down
1 change: 1 addition & 0 deletions contrib/mmap/src/MMapCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#ifndef WIN32
#include <stddef.h>
#include <dirent.h>
#include <errno.h>
#endif

using namespace std;
Expand Down
7 changes: 6 additions & 1 deletion contrib/vmap_assembler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ add_library(vmap
../../src/game/vmap/ModelInstance.cpp
)

target_link_libraries(vmap g3dlite z)
IF(APPLE)
FIND_LIBRARY(CORE_SERVICES CoreServices )
SET(EXTRA_LIBS ${CORE_SERVICES})
ENDIF (APPLE)

target_link_libraries(vmap g3dlite z ${EXTRA_LIBS})

add_executable(${EXECUTABLE_NAME} vmap_assembler.cpp)
target_link_libraries(${EXECUTABLE_NAME} vmap)
Expand Down
8 changes: 8 additions & 0 deletions contrib/vmap_extractor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ ADD_DEFINITIONS("-Wall")
ADD_DEFINITIONS("-ggdb")
ADD_DEFINITIONS("-O3")

if (APPLE)
add_definitions("-Dfopen64=fopen")
add_definitions("-Dfseeko64=fseeko")
add_definitions("-Dfseek64=fseek")
add_definitions("-Dftell64=ftell")
add_definitions("-Dftello64=ftello")
endif()

include_directories(../../dep/libmpq)

add_subdirectory(vmapextract)
35 changes: 10 additions & 25 deletions contrib/vmap_extractor/vmapextract/loadlib/loadlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,16 @@
#ifndef LOAD_LIB_H
#define LOAD_LIB_H

#ifdef WIN32
typedef __int64 int64;
typedef __int32 int32;
typedef __int16 int16;
typedef __int8 int8;
typedef unsigned __int64 uint64;
typedef unsigned __int32 uint32;
typedef unsigned __int16 uint16;
typedef unsigned __int8 uint8;
#else
#include <stdint.h>
#ifndef uint64_t
#ifndef _WIN32
#include <linux/types.h>
#endif
#endif
typedef int64_t int64;
typedef int32_t int32;
typedef int16_t int16;
typedef int8_t int8;
typedef uint64_t uint64;
typedef uint32_t uint32;
typedef uint16_t uint16;
typedef uint8_t uint8;
#endif
#include <cstdint>

typedef std::int64_t int64;
typedef std::int32_t int32;
typedef std::int16_t int16;
typedef std::int8_t int8;
typedef std::uint64_t uint64;
typedef std::uint32_t uint32;
typedef std::uint16_t uint16;
typedef std::uint8_t uint8;

#define FILE_FORMAT_VERSION 18

Expand Down
2 changes: 1 addition & 1 deletion sql/base/mangos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2670,7 +2670,7 @@ VALUES
(565,0,65,0,25,0,'',0),
(566,0,10,0,50,0,'',0),
(568,0,68,70,10,0,'',1),
(572,0,10,0,50,0,''),
(572,0,10,0,50,0,'',1),
(580,0,70,0,25,0,'',1),
(585,0,65,0,5,0,'',0);
/*!40000 ALTER TABLE `instance_template` ENABLE KEYS */;
Expand Down
2 changes: 2 additions & 0 deletions sql/playerbotai/playerbotai_characters_r6_update.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE `playerbot_saved_data` DROP COLUMN `bot_secondary_order`;
ALTER TABLE playerbot_saved_data CHANGE COLUMN `bot_primary_order` `combat_order` int(11);
1 change: 1 addition & 0 deletions src/game/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
set(LIBRARY_NAME game)

add_definitions(-DDT_POLYREF64)
add_definitions(-D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0)

# include external dependencies libs headers (warnings disabled)
include_directories(SYSTEM
Expand Down
2 changes: 1 addition & 1 deletion src/game/Chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ ChatCommand* ChatHandler::getCommandTable()
{ "repairitems", SEC_GAMEMASTER, true, &ChatHandler::HandleRepairitemsCommand, "", nullptr },
{ "stable", SEC_ADMINISTRATOR, false, &ChatHandler::HandleStableCommand, "", nullptr },
{ "waterwalk", SEC_GAMEMASTER, false, &ChatHandler::HandleWaterwalkCommand, "", nullptr },
//Playerbot mod
// Playerbot mod
{ "bot", SEC_PLAYER, false, &ChatHandler::HandlePlayerbotCommand, "", nullptr },
{ "quit", SEC_CONSOLE, true, &ChatHandler::HandleQuitCommand, "", nullptr },
{ "mmap", SEC_GAMEMASTER, false, nullptr, "", mmapCommandTable },
Expand Down
2 changes: 1 addition & 1 deletion src/game/Group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ bool Group::AddMember(ObjectGuid guid, const char* name)

uint32 Group::RemoveMember(ObjectGuid guid, uint8 method)
{
//Playerbot mod - if master leaves group, all bots leave group
// Playerbot mod - if master leaves group, all bots leave group
{
Player* const player = sObjectMgr.GetPlayer(guid);
if (player && player->GetPlayerbotMgr())
Expand Down
22 changes: 16 additions & 6 deletions src/game/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13625,7 +13625,7 @@ void Player::ItemAddedQuestCheck(uint32 entry, uint32 count)
if (q_status.uState != QUEST_NEW)
q_status.uState = QUEST_CHANGED;

SendQuestUpdateAddItem(qInfo, j, additemcount);
SendQuestUpdateAddItem(qInfo, j, curitemcount, additemcount);
}
if (CanCompleteQuest(questid))
CompleteQuest(questid);
Expand Down Expand Up @@ -14087,24 +14087,33 @@ void Player::SendPushToPartyResponse(Player* pPlayer, uint32 msg) const
}
}

void Player::SendQuestUpdateAddItem(Quest const* pQuest, uint32 item_idx, uint32 count) const
void Player::SendQuestUpdateAddItem(Quest const* pQuest, uint32 item_idx, uint32 current, uint32 count)
{
MANGOS_ASSERT(count < 256 && "Quest slot count store is limited to 8 bits 2^8 = 256 (0..255)");

// Update quest watcher and fire QUEST_WATCH_UPDATE
DEBUG_LOG("WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM");
WorldPacket data(SMSG_QUESTUPDATE_ADD_ITEM, (4 + 4));
data << pQuest->ReqItemId[item_idx];
data << count;
GetSession()->SendPacket(data);

// Update player field and fire UNIT_QUEST_LOG_CHANGED for self
uint16 slot = FindQuestSlot(pQuest->GetQuestId());
if (slot < MAX_QUEST_LOG_SIZE)
SetQuestSlotCounter(slot, uint8(item_idx), uint8(current + count));
}

void Player::SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, ObjectGuid guid, uint32 creatureOrGO_idx, uint32 count)
{
MANGOS_ASSERT(count < 256 && "mob/GO count store in 8 bits 2^8 = 256 (0..256)");
MANGOS_ASSERT(count < 256 && "Quest slot count store is limited to 8 bits 2^8 = 256 (0..255)");

int32 entry = pQuest->ReqCreatureOrGOId[ creatureOrGO_idx ];
if (entry < 0)
// client expected gameobject template id in form (id|0x80000000)
entry = (-entry) | 0x80000000;

// Update quest watcher and fire QUEST_WATCH_UPDATE
WorldPacket data(SMSG_QUESTUPDATE_ADD_KILL, (4 * 4 + 8));
DEBUG_LOG("WORLD: Sent SMSG_QUESTUPDATE_ADD_KILL");
data << uint32(pQuest->GetQuestId());
Expand All @@ -14114,9 +14123,10 @@ void Player::SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, ObjectGuid guid
data << guid;
GetSession()->SendPacket(data);

uint16 log_slot = FindQuestSlot(pQuest->GetQuestId());
if (log_slot < MAX_QUEST_LOG_SIZE)
SetQuestSlotCounter(log_slot, creatureOrGO_idx, count);
// Update player field and fire UNIT_QUEST_LOG_CHANGED for self
uint16 slot = FindQuestSlot(pQuest->GetQuestId());
if (slot < MAX_QUEST_LOG_SIZE)
SetQuestSlotCounter(slot, uint8(creatureOrGO_idx), uint8(count));
}

void Player::SendQuestGiverStatusMultiple() const
Expand Down
10 changes: 6 additions & 4 deletions src/game/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void SendCanTakeQuestResponse(uint32 msg) const;
void SendQuestConfirmAccept(Quest const* pQuest, Player* pReceiver) const;
void SendPushToPartyResponse(Player* pPlayer, uint32 msg) const;
void SendQuestUpdateAddItem(Quest const* pQuest, uint32 item_idx, uint32 count) const;
void SendQuestUpdateAddItem(Quest const* pQuest, uint32 item_idx, uint32 current, uint32 count);
void SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, ObjectGuid guid, uint32 creatureOrGO_idx, uint32 count);
void SendQuestGiverStatusMultiple() const;

Expand All @@ -1342,14 +1342,16 @@ class MANGOS_DLL_SPEC Player : public Unit
void AddTimedQuest(uint32 quest_id) { m_timedquests.insert(quest_id); }
void RemoveTimedQuest(uint32 quest_id) { m_timedquests.erase(quest_id); }

PlayerMails::reverse_iterator GetMailRBegin() { return m_mail.rbegin();}
PlayerMails::reverse_iterator GetMailREnd() { return m_mail.rend();}
void UpdateMail();

// Playerbot mod
void chompAndTrim(std::string& str);
bool getNextQuestId(const std::string& pString, unsigned int& pStartPos, unsigned int& pId);
void skill(std::list<uint32>& m_spellsToLearn);
bool requiredQuests(const char* pQuestIdString);
PlayerMails::reverse_iterator GetMailRBegin() { return m_mail.rbegin();}
PlayerMails::reverse_iterator GetMailREnd() { return m_mail.rend();}
void UpdateMail();
uint32 GetSpec();

/*********************************************************/
/*** LOAD SYSTEM ***/
Expand Down
11 changes: 6 additions & 5 deletions src/game/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3477,13 +3477,14 @@ void Spell::finish(bool ok)
{
switch (ihit->missCondition)
{
case SPELL_MISS_DEFLECT:
case SPELL_MISS_MISS:
case SPELL_MISS_DODGE:
if (m_spellInfo->powerType == POWER_RAGE) // For Warriors only refund on parry/deflect, for rogues on all 4
break;
case SPELL_MISS_PARRY:
{
if (m_caster->GetCharmerOrOwnerOrOwnGuid().IsPlayer())
m_caster->ModifyPower(Powers(m_spellInfo->powerType), int32(m_powerCost * 0.8));
case SPELL_MISS_DEFLECT:
m_caster->ModifyPower(Powers(m_spellInfo->powerType), int32(m_powerCost * 0.8));
break;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/WorldSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class MANGOS_DLL_SPEC WorldSession
Player* GetPlayer() const { return _player; }
char const* GetPlayerName() const;
void SetSecurity(AccountTypes security) { _security = security; }
//playerbot mod: player connected without socket are bot
// Playerbot mod: player connected without socket are bot
const std::string GetRemoteAddress() const { return m_Socket ? m_Socket->GetRemoteAddress() : "bot"; }
void SetPlayer(Player* plr) { _player = plr; }
uint8 Expansion() const { return m_expansion; }
Expand Down
Loading