From 7dcbbbd928c5267a74b1e32c57064ffac4e95e08 Mon Sep 17 00:00:00 2001 From: Micrah Date: Mon, 29 Apr 2019 16:11:34 +1000 Subject: [PATCH] cleaned and ready to work on script --- .editorconfig | 8 +++ .git_commit_template.txt | 49 +++++++++++++++ .gitattributes | 105 +++++++++++++++++++++++++++++++ .gitignore | 48 ++++++++++++++ .travis.yml | 77 +++++++++++++++++++++++ CMakeLists.txt | 9 +++ README.md | 4 ++ conf/SoloLfg.conf.dist.txt | 13 ++++ include.sh | 0 setup_git_commit_template.sh | 4 ++ src/Lfg_Solo.cpp | 32 ++++++++++ src/cmake/after_ws_install.cmake | 15 +++++ src/loader.h | 1 + 13 files changed, 365 insertions(+) create mode 100644 .editorconfig create mode 100644 .git_commit_template.txt create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 CMakeLists.txt create mode 100644 README.md create mode 100644 conf/SoloLfg.conf.dist.txt create mode 100644 include.sh create mode 100644 setup_git_commit_template.sh create mode 100644 src/Lfg_Solo.cpp create mode 100644 src/cmake/after_ws_install.cmake create mode 100644 src/loader.h diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..eb64e2f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +tab_width = 4 +insert_final_newline = true +trim_trailing_whitespace = true +max_line_length = 80 diff --git a/.git_commit_template.txt b/.git_commit_template.txt new file mode 100644 index 0000000..708b551 --- /dev/null +++ b/.git_commit_template.txt @@ -0,0 +1,49 @@ +### TITLE +## Type(Scope/Subscope): Commit ultra short explanation +## |---- Write below the examples with a maximum of 50 characters ----| +## Example 1: fix(DB/SAI): Missing spell to NPC Hogger +## Example 2: fix(CORE/Raid): Phase 2 of Ragnaros +## Example 3: feat(CORE/Commands): New GM command to do something + + +### DESCRIPTION +## Explain why this change is being made, what does it fix etc... +## |---- Write below the examples with a maximum of 72 characters per lines ----| +## Example: Hogger (id: 492) was not charging player when being engaged. + + +## Provide links to any issue, commit, pull request or other resource +## Example 1: Closes issue #23 +## Example 2: Ported from other project's commit (link) +## Example 3: References taken from wowpedia / wowhead / wowwiki / https://wowgaming.altervista.org/aowow/ + + + +## ======================================================= +## EXTRA INFOS +## ======================================================= +## "Type" can be: +## feat (new feature) +## fix (bug fix) +## refactor (refactoring production code) +## style (formatting, missing semi colons, etc; no code change) +## docs (changes to documentation) +## test (adding or refactoring tests; no production code change) +## chore (updating bash scripts, git files etc; no production code change) +## -------------------- +## Remember to +## Capitalize the subject line +## Use the imperative mood in the subject line +## Do not end the subject line with a period +## Separate subject from body with a blank line +## Use the body to explain what and why rather than how +## Can use multiple lines with "-" for bullet points in body +## -------------------- +## More info here https://www.conventionalcommits.org/en/v1.0.0-beta.2/ +## ======================================================= +## "Scope" can be: +## CORE (core related, c++) +## DB (database related, sql) +## ======================================================= +## "Subscope" is optional and depends on the nature of the commit. +## ======================================================= diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..7ef9001 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,105 @@ +## AUTO-DETECT +## Handle line endings automatically for files detected as +## text and leave all files detected as binary untouched. +## This will handle all files NOT defined below. +* text=auto eol=lf + +# Text +*.conf text +*.conf.dist text +*.cmake text + +## Scripts +*.sh text +*.fish text +*.lua text + +## SQL +*.sql text + +## C++ +*.c text +*.cc text +*.cxx text +*.cpp text +*.c++ text +*.hpp text +*.h text +*.h++ text +*.hh text + + +## For documentation + +# Documents +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain + +## DOCUMENTATION +*.markdown text +*.md text +*.mdwn text +*.mdown text +*.mkd text +*.mkdn text +*.mdtxt text +*.mdtext text +*.txt text +AUTHORS text +CHANGELOG text +CHANGES text +CONTRIBUTING text +COPYING text +copyright text +*COPYRIGHT* text +INSTALL text +license text +LICENSE text +NEWS text +readme text +*README* text +TODO text + +## GRAPHICS +*.ai binary +*.bmp binary +*.eps binary +*.gif binary +*.ico binary +*.jng binary +*.jp2 binary +*.jpg binary +*.jpeg binary +*.jpx binary +*.jxr binary +*.pdf binary +*.png binary +*.psb binary +*.psd binary +*.svg text +*.svgz binary +*.tif binary +*.tiff binary +*.wbmp binary +*.webp binary + + +## ARCHIVES +*.7z binary +*.gz binary +*.jar binary +*.rar binary +*.tar binary +*.zip binary + +## EXECUTABLES +*.exe binary +*.pyc binary diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c6e1299 --- /dev/null +++ b/.gitignore @@ -0,0 +1,48 @@ +!.gitignore + +# +#Generic +# + +.directory +.mailmap +*.orig +*.rej +*.*~ +.hg/ +*.kdev* +.DS_Store +CMakeLists.txt.user +*.bak +*.patch +*.diff +*.REMOTE.* +*.BACKUP.* +*.BASE.* +*.LOCAL.* + +# +# IDE & other softwares +# +/.settings/ +/.externalToolBuilders/* +# exclude in all levels +nbproject/ +.sync.ffs_db +*.kate-swp + +# +# Eclipse +# +*.pydevproject +.metadata +.gradle +tmp/ +*.tmp +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.project +.cproject diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c1538c7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,77 @@ +sudo: required +dist: xenial # (16.04) +# bionic (18.04) is not yet available in travis + +language: cpp + +cache: ccache + +addons: + apt: + update: true + +services: + - mysql + +git: + depth: 10 + +stages: + - prepare_cache + - run + +jobs: + include: + - stage: prepare_cache + env: TRAVIS_BUILD_ID="1" + before_install: + - cd .. + - git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk + - mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules + - cd azerothcore-wotlk + - source ./apps/ci/ci-before_install.sh + install: + - source ./apps/ci/ci-install.sh OFF + script: + - source ./apps/ci/ci-compile.sh + + - stage: run + env: TRAVIS_BUILD_ID="1" + before_install: + - cd .. + - git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk + - mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules + - cd azerothcore-wotlk + - source ./apps/ci/ci-before_install.sh + install: + - source ./apps/ci/ci-install.sh ON + - source ./apps/ci/ci-import-db.sh + script: + - source ./apps/ci/ci-compile.sh + - source ./apps/ci/ci-worldserver-dry-run.sh + + - stage: prepare_cache + env: TRAVIS_BUILD_ID="2" + before_install: + - cd .. + - git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk + - mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules + - cd azerothcore-wotlk + - source ./apps/ci/ci-before_install.sh + install: + - source ./apps/ci/ci-install.sh OFF + script: + - source ./apps/ci/ci-compile.sh + + - stage: run + env: TRAVIS_BUILD_ID="2" + before_install: + - cd .. + - git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk + - mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules + - cd azerothcore-wotlk + - source ./apps/ci/ci-before_install.sh + install: + - source ./apps/ci/ci-install.sh ON + script: + - source ./apps/ci/ci-compile.sh diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..59f556d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,9 @@ +CU_SET_PATH("CMAKE_LFG_SOLO_DIR" "${CMAKE_CURRENT_LIST_DIR}") + +AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/Lfg_Solo.cpp") + +AC_ADD_SCRIPT_LOADER("Sc_Lfg_Solo" "${CMAKE_CURRENT_LIST_DIR}/src/loader.h") + +CU_ADD_HOOK(AFTER_WORLDSERVER_CMAKE "${CMAKE_CURRENT_LIST_DIR}/src/cmake/after_ws_install.cmake") + +message("-- Solo LFG CONFIGURED --") \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..2c7a195 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore +# mod-weapon-visual +### This is a module for [AzerothCore](http://www.azerothcore.org) +- Latest build status with azerothcore: [![Build Status](https://travis-ci.org/azerothcore/mod-weapon-visual.svg?branch=master)](https://travis-ci.org/azerothcore/mod-npc-services) diff --git a/conf/SoloLfg.conf.dist.txt b/conf/SoloLfg.conf.dist.txt new file mode 100644 index 0000000..f341cdb --- /dev/null +++ b/conf/SoloLfg.conf.dist.txt @@ -0,0 +1,13 @@ +[worldserver] + +################################################################################################### +# SOLO LFG +################################################################################################### + +# EnableSoloLfg +# Description: Enable the module +# Default: 1 - (Enabled) +# 0 - (Disabled) + + +LFG.SoloMode = 1 \ No newline at end of file diff --git a/include.sh b/include.sh new file mode 100644 index 0000000..e69de29 diff --git a/setup_git_commit_template.sh b/setup_git_commit_template.sh new file mode 100644 index 0000000..7b52062 --- /dev/null +++ b/setup_git_commit_template.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +## Set a local git commit template +git config --local commit.template ".git_commit_template.txt" ; diff --git a/src/Lfg_Solo.cpp b/src/Lfg_Solo.cpp new file mode 100644 index 0000000..55bbdca --- /dev/null +++ b/src/Lfg_Solo.cpp @@ -0,0 +1,32 @@ +/* +** Made by Traesh https://github.com/Traesh +** AzerothCore 2019 http://www.azerothcore.org/ +** Made into a module by Micrah https://github.com/milestorme/ +*/ + +#include "Config.h" +#include "World.h" +#include "LFGMgr.h" +#include "Chat.h" + +class lfg_solo : public PlayerScript +{ +public: + lfg_solo() : PlayerScript("lfg_solo") { } + + void OnLogin(Player* player, bool /*loginFirst*/) + { + if (sConfigMgr->GetBoolDefault("LFG.SoloMode", true)) + { + if (!sLFGMgr->IsTesting()) + { + sLFGMgr->ToggleTesting(); + } + } + } +}; + +void AddScLfg_SoloScripts() +{ + new lfg_solo(); +} \ No newline at end of file diff --git a/src/cmake/after_ws_install.cmake b/src/cmake/after_ws_install.cmake new file mode 100644 index 0000000..efe345d --- /dev/null +++ b/src/cmake/after_ws_install.cmake @@ -0,0 +1,15 @@ +if( WIN32 ) + if ( MSVC ) + add_custom_command(TARGET worldserver + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_MOD_DUELRESET_DIR}/conf/SoloLfg.conf.dist" ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/ + ) + elseif ( MINGW ) + add_custom_command(TARGET worldserver + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_MOD_DUELRESET_DIR}/conf/SoloLfg.conf.dist" ${CMAKE_BINARY_DIR}/bin/ + ) + endif() +endif() + +install(FILES "${CMAKE_LFG_SOLO_DIR}/conf/SoloLfg.conf.dist" DESTINATION ${CONF_DIR}) diff --git a/src/loader.h b/src/loader.h new file mode 100644 index 0000000..000e811 --- /dev/null +++ b/src/loader.h @@ -0,0 +1 @@ +void AddSc_Lfg_SoloScripts(); \ No newline at end of file