diff --git a/.travis.yml b/.travis.yml index 448455817..fe69b57ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: cpp -before_install: - - bash .travis.sh +# use docker in travis +sudo: false # reduce clone time by only getting the latest commit and not the whole history (default for travis is 100) git: @@ -10,23 +10,30 @@ git: # send notifications to stack as well as email notifications: slack: getmangos:yRgNBSgRQVh8WdfGEbT08Hit - -# only run travis on the master branch -branches: - only: - - master - - develop21 # build on both Linux and OSX (finally) os: - linux - - osx + - osx # build with both gcc and clang to ensure compatibility compiler: - gcc - clang - + +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-4.8 + - g++-4.8 + - clang + +before_install: + - bash .travis.sh + - if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$CC" = "gcc" ] ; then export CC=gcc-4.8 CXX=g++-4.8 ; fi + script: - test -d _build || mkdir _build - test -d _install || mkdir _install diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c5bead2a..277d5edef 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,8 @@ project(MaNGOS) set(MANGOS_VERSION 0.21) - +set(MANGOS_EXP "CATA") +add_definitions(-DCATA) # CMake policies cmake_minimum_required(VERSION 2.8) # Until CMake 3.0 is the standard @@ -50,7 +51,7 @@ option(SCRIPT_LIB_ELUNA "Compile with support for Eluna scripts" OFF) option(SCRIPT_LIB_SD2 "Compile with support for ScriptDev2 scripts" ON) #option(SCRIPT_LIB_SD3 "Compile with support for ScriptDev3 scripts" OFF) option(PLAYERBOTS "Enable Player Bots" OFF) -option(SOAP "Enable remote access via SOAP" ON) +option(SOAP "Enable remote access via SOAP" OFF) # Hidden option to enable/disable PCH. DEV ONLY! set(PCH ON) set(USE_STORMLIB ON) @@ -107,6 +108,9 @@ if(ACE_USE_EXTERNAL) endif() else() include(cmake/ImportACE.cmake) + if(NOT(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")) + add_definitions(-DHAVE_ACE_STACK_TRACE_H) + endif() endif() if(POSTGRESQL) @@ -144,6 +148,8 @@ else() set(GIT_REVISION "Git not found") endif() +set(DEFINITIONS ${DEFINITIONS} CATA) + message(STATUS "MaNGOS-Core revision : ${GIT_REVISION}") message(STATUS "Install server to : ${CMAKE_INSTALL_PREFIX}") message(STATUS "Install configs to : ${CONF_INSTALL_DIR}") diff --git a/README.md b/README.md index 1031fbda8..8daafd308 100644 --- a/README.md +++ b/README.md @@ -150,10 +150,10 @@ respects for all of the code used other than [OpenSSL][48]. [7]: http://www.cppreference.com/ "C / C++ reference" [10]: https://getmangos.eu/ "mangos · project site" -[12]: http://github.com/mangosthree "mangos-three· github organization" -[13]: http://github.com/mangosthree/server "mangos three · server repository" -[15]: http://github.com/mangosthree/database "mangos three · content database repository" -[16]: https://travis-ci.org/mangosthree/server "Travis CI · mangos-three build status" +[12]: http://github.com/mangosthree "MaNGOS Three· github organization" +[13]: http://github.com/mangosthree/server "MaNGOS Three · server repository" +[15]: http://github.com/mangosthree/database "MaNGOS Three · content database repository" +[16]: https://travis-ci.org/mangosthree/server "Travis CI · MaNGOS Three build status" [17]: https://scan.coverity.com/ "Coverity Scan · Static Code Analysis" [19]: http://www.cmake.org/ "CMake · Cross Platform Make" diff --git a/Rel20_Todo.md b/Rel20_Todo.md deleted file mode 100644 index 171ef483a..000000000 --- a/Rel20_Todo.md +++ /dev/null @@ -1,15 +0,0 @@ -ROADMAP and goals for 0.21.0 release ------------- - -* Completely synchronize fixes between mangos repositories (zero, one, two) -* Implement void storage -* Implement archaelogy -* warden system -* Implement passive anticheat (warden system is not enough to stop jockers...). -* Phasing system port from trinitycore -* Add missing opcodes. -* Implement linked_spell_trigger database table implementation (this will accessible in all mangos) for simple spells implementation. -* Implement new gossip script wrapper in scriptmgr to make code style better. -* Implement new event in EVENTAI which would let better integrate gossips -* Rework/retest all classes spells - diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..40624bdf9 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,41 @@ +version: 0.21.{build} + +# Branches to build +branches: + only: + - develop21 + +# Specify platform for MySQL check +platform: + - Win32 + +# By default, AppVeyor only comes with 64bit MySQL, but 32 bit compiler. +# Download standalone MySQL libraries for compilation. +# Probably not the best solution, but it works for now. +install: + - ps: | + if ($env:platform -eq "Win32") + { + Invoke-WebRequest "http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.28-win32.zip" -OutFile mysql-5.6.28-win32.zip + 7z e -y mysql-5.6.28-win32.zip mysql-5.6.28-win32/lib -o"C:\Program Files (x86)\MySql\MySQL Server 5.6\lib" + 7z e -y mysql-5.6.28-win32.zip mysql-5.6.28-win32/include -o"C:\Program Files (x86)\MySql\MySQL Server 5.6\include" + } + +# Clone to the specified folder below, and only clone the latest commit without history. +clone_folder: c:\mzero\server + +clone_depth: 1 + +# Enable parallel builds to speed up the compilation process. +build: + parallel: true + +# Initialize submodules. +before_build: + - git submodule update --init --recursive + +# Build core. +build_script: + - cd c:\mzero\server + - cmake -DCMAKE_INSTALL_PREFIX="c:\mzero\build\bin" -DCMAKE_SIZEOF_VOID_P=8 + - msbuild /m MaNGOS.sln diff --git a/config.h.cmake b/config.h.cmake deleted file mode 100644 index ecda10fd2..000000000 --- a/config.h.cmake +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef HAVE_CONFIG_H -#define HAVE_CONFIG_H - -#cmakedefine HAVE_ACE_STACK_TRACE_H - -#cmakedefine USE_MULTI_THREAD_MAP - -#define VERSION "${MANGOS_VERSION}" - -#endif /* HAVE_CONFIG_H */ diff --git a/doc/AuctionHouseBot.md b/doc/AuctionHouseBot.md index f004a54a2..1e8aba109 100644 --- a/doc/AuctionHouseBot.md +++ b/doc/AuctionHouseBot.md @@ -1,6 +1,6 @@ Auction house bot ----------------- -For testing purposes and low population home servers, *mangos-zero* provides an +For testing purposes and low population home servers, *mangos* provides an auction house bot, which will provide a set of items on the auction houses based on various configuration settings. diff --git a/Authors.md b/doc/Authors.md similarity index 100% rename from Authors.md rename to doc/Authors.md diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 8902632ae..6784e12d9 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -4,7 +4,7 @@ find_package(Doxygen) if(DOXYGEN_FOUND) set(TOP_SRCDIR ${CMAKE_SOURCE_DIR}) - set(PACKAGE "MaNGOS Two") + set(PACKAGE "MaNGOS Three") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) add_custom_target(doc diff --git a/ChangeLog.md b/doc/ChangeLog.md similarity index 99% rename from ChangeLog.md rename to doc/ChangeLog.md index 90ae8ff05..9dd442476 100644 --- a/ChangeLog.md +++ b/doc/ChangeLog.md @@ -1,4 +1,16 @@ -MaNGOS 0.18 (?? ??? 20??) +MaNGOS Three Changelog +====================== +This change log references the relevant changes (bug and security fixes) done +in recent versions. + +0.21 (2016-xx-01) - "The Battle for the Elemental Planes" +--------------------------------------------------------- +Many Thanks to all the groups and individuals who contributed to this release. +- xxx+ Commits since the previous release. + +* TODO: Add full list of fixes from Rel18 to 21 for both Server, Scripts and Database + +MaNGOS 0.18 (?? ??? 20??) MaNGOS 0.18 - adds further improvements to the server core as well as to the majority of game classes and the game content diff --git a/doc/CodingStandard.md b/doc/CodingStandard.md new file mode 100644 index 000000000..bad4b48d8 --- /dev/null +++ b/doc/CodingStandard.md @@ -0,0 +1,149 @@ +Coding standards +================ +It is highly recommended to use a single *coding style* for the whole project +source code. Exceptions are allowed for external libraries used in the project, +but it is generally advisable all contributors to use this style. + +Tab Size +-------- +First of all, we use spaces. Tabs are four-character width. That is, no 8-space +tabs, no 2-space tabs. Four. Unfortunately there's no such thing as 'standard +tab width', and 4-space indenting looks best from our point of view, besides MSVC' +editor has this setting by default. + +Line length +----------- +Then, please use 80-character wide lines. If your line is way longer than that, +please split it. If it's just a little longer, so be it. The continuation text, +if you're splitting text inside the brackets, should be indented to the position +after the opening bracket: + + printf("This is a example of how we split lines longer than %d characters\n" + "into several so that they won't exceed this limit.\n", + max_sourcecode_width); + +If you have long strings, you can split them as shown above, just remember that +C/C++ compilers will glue together several strings that come without any special +characters between them into one. + +Brackets +-------- +Now we use symmetric bracket placement, closing bracket under the opening bracket: + + if (something) + { + ...; + } + else + { + ...; + } + + switch (x) + { + case 1: + printf("X is one!\n"); + break; + case 2: + { + printf("X is two!\n"); + break; + } + } + + for (int i = 1; i < 3; ++i) + { + printf("I is %i!\n", i); + } + +Every bracketed block moves its contents by one tab to right. Labels (but not case +selectors or 'public:/private:/protected' C++ keywords) are placed at the leftmost +indention position for the current block, that is, in the same position where +enclosing brackets are. + +Also please don't use brackets around a single statement because it clutters the +code with unneeded stuff; use brackets only when using non-obvious constructs, +like: + + if (...) + { + if (...) + ...; + } + else + ...; + +Also, please place one space before opening parenthesis. Before, but not after +(the `if ( blah )` style is a no-no!). + +Class declaration and constructors +---------------------------------- +Here is an example: + + class Class : public Parent + { + public: + Class() : Parent(0), + m_field(1) + { + func(); + } + + void func() {} + + private: + int m_field; + }; + +Please follow the following rules for classes: + +* space before and after : in class parents list and constructor body +* next line and indent for class field initialization list +* indent for public:/private:/protected: section with additional indent + for section content +* empty or short function body can be at same line with declaration in + in-class definition case + +Code documentation with Doxygen +------------------------------- +Now, please use DoxyGen-type comments. This is a bit similar to JavaDoc comments +and to other automatic code documentation generation tools. One-line documentation +should be placed in `///` (three slashes) comments if the comment is above the +function/member, if you want the comment on the same line you should use `///<` +instead, multi-line comments should be put in a `/** ... */` block (slash-two-stars). + +Here's a example that shows most useful keywords that you can use in a comment block: + + /** + * This function does something very useful. If used with care, this function + * has the potential to make your programs really really useful. + * + * \arg \c x + * The x argument specifies a integer that is transformed into something useful. + * \arg \c y + * This argument, if not NULL, is a pointer to a free memory area where this + * function will put something really really useful. + * \return + * A useful value, or NULL if error. + * + * Here is a example that you can paste into your code so that it saves you a + * lot of typing: + * + * \verb atim (Remove the space) + * for (int x = 0; x < 100; ++x) + * printf("DoSomethingUseful%d = %s\n", i, + * DoSomethingUseful(i, &ScratchPad)); + * \endve rbatim (Remove the space) + * + * Paragraphs are split from each other by inserting a empty line. Also some HTML + * tags are supported, like
| ID | +Name | +Parameters | +
|---|---|---|
| 0 | SCRIPT_COMMAND_TALK | resultingSource = WorldObject, resultingTarget = Unit/none, `dataint` = text entry from db_script_string -table. `dataint2`-`dataint4` optionally, for random selection of text |
| 1 | SCRIPT_COMMAND_EMOTE | resultingSource = Unit, resultingTarget = Unit/none, `datalong` = emote_id, dataint1-dataint4 = optionally for random selection of emote |
| 2 | SCRIPT_COMMAND_FIELD_SET | source = any, `datalong` = field_id, `datalong2` = field value |
| 3 | SCRIPT_COMMAND_MOVE_TO | resultingSource = Creature. If position is very near to current position, or x=y=z=0, then only orientation is changed. `datalong2` = travel_speed*100 (use 0 for creature default movement). `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: teleport unit to position `x`/`y`/`z`/`o` |
| 4 | SCRIPT_COMMAND_FLAG_SET | source = any. `datalong` = field_id, `datalong2` = bit mask |
| 5 | SCRIPT_COMMAND_FLAG_REMOVE | source = any. `datalong` = field_id, `datalong2` = bit mask |
| 6 | SCRIPT_COMMAND_TELEPORT_TO | source or target with Player. `datalong` = map_id, x/y/z |
| 7 | SCRIPT_COMMAND_QUEST_EXPLORED | one from source or target must be Player, another GO/Creature. `datalong` = quest_id, `datalong2` = distance or 0 |
| 8 | SCRIPT_COMMAND_KILL_CREDIT | source or target with Player. `datalong` = creature entry, or 0; If 0 the entry of the creature source or target is used, `datalong2` = bool (0=personal credit, 1=group credit) |
| 9 | SCRIPT_COMMAND_RESPAWN_GAMEOBJECT | source = any, target = any. `datalong`=db_guid (can be skipped for buddy), `datalong2` = despawn_delay |
| 10 | SCRIPT_COMMAND_TEMP_SUMMON_CREATURE | source = any, target = any. `datalong` = creature entry, `datalong2` = despawn_delay, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: summon as active object |
| 11 | SCRIPT_COMMAND_OPEN_DOOR | source = any. `datalong` = db_guid (can be skipped for buddy), `datalong2` = reset_delay |
| 12 | SCRIPT_COMMAND_CLOSE_DOOR | source = any. `datalong` = db_guid (can be skipped for buddy), `datalong2` = reset_delay |
| 13 | SCRIPT_COMMAND_ACTIVATE_OBJECT | source = unit, target=GO. |
| 14 | SCRIPT_COMMAND_REMOVE_AURA | resultingSource = Unit. `datalong` = spell_id |
| 15 | SCRIPT_COMMAND_CAST_SPELL | resultingSource = Unit, cast spell at resultingTarget = Unit. `datalong` = spell id, `dataint1`-`dataint4` optional. If some of these are set to a spell id, a random spell out of datalong, datint1, ..,dataintX is cast., `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: cast triggered |
| 16 | SCRIPT_COMMAND_PLAY_SOUND | source = any object, target=any/player. `datalong` = sound_id, `datalong2` (bit mask: 0/1=target-player, 0/2=with distance dependent, 0/4=map wide, 0/8=zone wide; so 1 + 2 = 3 is target with distance dependent) |
| 17 | SCRIPT_COMMAND_CREATE_ITEM | source or target must be player. `datalong` = item entry, `datalong2` = amount |
| 18 | SCRIPT_COMMAND_DESPAWN_SELF | resultingSource = Creature. `datalong` = despawn delay |
| 19 | SCRIPT_COMMAND_PLAY_MOVIE | target can only be a player. `datalong` = movie id |
| 20 | SCRIPT_COMMAND_MOVEMENT | resultingSource = Creature. `datalong` = MovementType (0:idle, 1:random or 2:waypoint), `datalong2` = wanderDistance (for random movement), `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: RandomMovement around current position |
| 21 | SCRIPT_COMMAND_SET_ACTIVEOBJECT | resultingSource = Creature. `datalong` = bool 0=off, 1=on |
| 22 | SCRIPT_COMMAND_SET_FACTION | resultingSource = Creature. `datalong` = factionId OR 0 to restore original faction from creature_template, `datalong2` = enum TemporaryFactionFlags |
| 23 | SCRIPT_COMMAND_MORPH_TO_ENTRY_OR_MODEL | resultingSource = Creature. `datalong` = creature entry/modelid (depend on data_flags) OR 0 to demorph, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: use datalong value as modelid explicit |
| 24 | SCRIPT_COMMAND_MOUNT_TO_ENTRY_OR_MODEL | resultingSource = Creature. `datalong` = creature entry/modelid (depend on data_flags) OR 0 to dismount, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL: use datalong value as modelid explicit |
| 25 | SCRIPT_COMMAND_SET_RUN | resultingSource = Creature. `datalong` = bool 0=off, 1=on |
| 26 | SCRIPT_COMMAND_ATTACK_START | resultingSource = Creature, resultingTarget = Unit. |
| 27 | SCRIPT_COMMAND_GO_LOCK_STATE | resultingSource = GO. `datalong` = flag_go_lock = 0x01, flag_go_unlock = 0x02, flag_go_nonInteract = 0x04, flag_go_interact = 0x08 |
| 28 | SCRIPT_COMMAND_STAND_STATE | resultingSource = Creature. `datalong` = stand state (enum UnitStandStateType) |
| 29 | SCRIPT_COMMAND_MODIFY_NPC_FLAGS | resultingSource = Creature. `datalong` = NPCFlags, `datalong2` = 0x00=toggle, 0x01=add, 0x02=remove |
| 30 | SCRIPT_COMMAND_SEND_TAXI_PATH | resultingTarget or Source must be Player. `datalong` = taxi path id |
| 31 | SCRIPT_COMMAND_TERMINATE_SCRIPT | `datalong` = search for npc entry if provided, `datalong2` = search distance, `!(data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL)`: if npc not alive found, terminate script, `data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL`:if npc alive found, terminate script, `dataint` = change of waittime (MILLISECONDS) of a current waypoint movement type (negative values will decrease time) |
| 32 | SCRIPT_COMMAND_PAUSE_WAYPOINTS | resultingSource must be Creature. `datalong` = 0/1 unpause/pause waypoint movement |
| 33 | SCRIPT_COMMAND_RESERVED_1 | reserved for 3.x and later. Do not use! |
| 34 | SCRIPT_COMMAND_TERMINATE_COND | `datalong` = condition_id, `datalong2` = fail-quest (if provided this quest will be failed for a player), `!(data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL)`: terminate when condition is true, `data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL`:terminate when condition is false |
| 35 | SCRIPT_COMMAND_SEND_AI_EVENT_AROUND | resultingSource = Creature, resultingTarget = Unit, datalong = AIEventType - limited only to EventAI supported events, datalong2 = radius |
| 36 | SCRIPT_COMMAND_TURN_TO | resultingSource = Creature, resultingTarget = Unit/none. |
| 37 | SCRIPT_COMMAND_MOVE_DYNAMIC | Move resultingSource to a random point around resultingTarget or to resultingTarget. `resultingSource` = Creature, resultingTarget Worldobject. `datalong` = 0:Move resultingSource towards resultingTarget, `datalong` != 0: Move resultingSource to a random point between datalong2..datalong around resultingTarget. `orientation` != 0: Obtain a random point around resultingTarget in direction of orientation, `data_flags` & SCRIPT_FLAG_COMMAND_ADDITIONAL Obtain a point in direction of resTarget->GetOrientation + orientation for resTarget == resSource and orientation == 0 this will mean resSource moving forward. |
| 38 | SCRIPT_COMMAND_SEND_MAIL | Send a mail from resSource to resTarget. `resultingSource` = Creature OR NULL, resTarget must be Player, `datalong` = mailTemplateId, `datalong2`: AlternativeSenderEntry. Use as sender-Entry of the sent mail, `dataint1`: Delay (>= 0) in Seconds |