mirror of
https://github.com/freekode/mod-reward-played-time-improved.git
synced 2026-01-13 00:28:34 +00:00
102
.travis.yml
102
.travis.yml
@@ -1,42 +1,76 @@
|
|||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty # (14.04)
|
dist: bionic # (18.04)
|
||||||
# xenial (16.04) is not supported yet
|
|
||||||
|
|
||||||
language: cpp
|
language: cpp
|
||||||
compiler:
|
|
||||||
- clang
|
cache: ccache
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
update: true
|
||||||
|
|
||||||
|
services:
|
||||||
|
- mysql
|
||||||
|
|
||||||
git:
|
git:
|
||||||
depth: 1
|
depth: 10
|
||||||
|
|
||||||
before_install:
|
stages:
|
||||||
- sudo apt-get -y install build-essential libtool make cmake cmake-data openssl
|
- prepare_cache
|
||||||
- sudo apt-get -y install libssl-dev libmysqlclient-dev libmysql++-dev libreadline6-dev zlib1g-dev libbz2-dev libace-dev
|
- run
|
||||||
- git config user.email "travis@build.bot" && git config user.name "Travis CI"
|
|
||||||
- git tag -a -m "Travis build" init
|
|
||||||
|
|
||||||
install:
|
|
||||||
- cd ..
|
|
||||||
- git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore
|
|
||||||
- mv mod-reward-playtime azerothcore/modules
|
|
||||||
- cd azerothcore
|
|
||||||
- git submodule update --init --recursive
|
|
||||||
|
|
||||||
- mysql -uroot -e 'create database test_mysql;'
|
jobs:
|
||||||
- cd bin
|
include:
|
||||||
- cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=0 -DSCRIPTS=1 -DSERVERS=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=check_install
|
- stage: prepare_cache
|
||||||
- cd ..
|
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
|
||||||
|
|
||||||
script:
|
- stage: run
|
||||||
- $CXX --version
|
env: TRAVIS_BUILD_ID="1"
|
||||||
- mysql -uroot < data/sql/create/create_mysql.sql
|
before_install:
|
||||||
- cat data/sql/base/db_auth/*.sql | mysql -uacore -pacore auth
|
- cd ..
|
||||||
- cat data/sql/base/db_characters/*.sql | mysql -uacore -pacore characters
|
- git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk
|
||||||
- cat data/sql/base/db_world/*.sql | mysql -uacore -pacore world
|
- mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules
|
||||||
- cat data/sql/updates/db_auth/*.sql | mysql -uacore -pacore auth
|
- cd azerothcore-wotlk
|
||||||
- cat data/sql/updates/db_characters/*.sql | mysql -uacore -pacore characters
|
- source ./apps/ci/ci-before_install.sh
|
||||||
- cat data/sql/updates/db_world/*.sql | mysql -uacore -pacore world
|
install:
|
||||||
- mysql -uroot < data/sql/create/drop_mysql.sql
|
- source ./apps/ci/ci-install.sh ON
|
||||||
- cd bin
|
- source ./apps/ci/ci-import-db.sh
|
||||||
- make -j 8 -k && make install
|
script:
|
||||||
- cd check_install/bin
|
- 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
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/reward_system.cpp")
|
|||||||
|
|
||||||
AC_ADD_SCRIPT_LOADER("RewardSystem" "${CMAKE_CURRENT_LIST_DIR}/src/loader.h")
|
AC_ADD_SCRIPT_LOADER("RewardSystem" "${CMAKE_CURRENT_LIST_DIR}/src/loader.h")
|
||||||
|
|
||||||
CU_ADD_HOOK(AFTER_WORLDSERVER_CMAKE "${CMAKE_CURRENT_LIST_DIR}/src/cmake/after_ws_install.cmake")
|
AC_ADD_CONFIG_FILE("${CMAKE_CURRENT_LIST_DIR}/conf/reward_system.conf.dist")
|
||||||
|
|
||||||
message("-- REWARD SYSTEM CONFIGURED --")
|
message("-- REWARD SYSTEM CONFIGURED --")
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
|
#  AzerothCore
|
||||||
# Reward System
|
# Reward System
|
||||||
|
-- Latest build status with azerothcore: [](https://travis-ci.org/azerothcore/mod-reward-played-time)
|
||||||
|
|
||||||
|
|
||||||
This is a module for [AzerothCore](http://www.azerothcore.org) that adds items for players that have stayed logged in the x amount of time.
|
This is a module for [AzerothCore](http://www.azerothcore.org) that adds items for players that have stayed logged in the x amount of time.
|
||||||
|
|
||||||
|
|||||||
9
conf/conf.sh.dist
Normal file
9
conf/conf.sh.dist
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
#
|
||||||
|
# CUSTOM
|
||||||
|
#
|
||||||
|
|
||||||
|
DB_CHARACTERS_CUSTOM_PATHS+=(
|
||||||
|
$MOD_REWARD_SYSTEM_ROOT"/sql/characters/"
|
||||||
|
)
|
||||||
@@ -1,5 +1,12 @@
|
|||||||
[worldserver]
|
[worldserver]
|
||||||
|
|
||||||
|
#
|
||||||
|
# RewardSystemAnnounce
|
||||||
|
# Description: Announce the reward system
|
||||||
|
# Default: 1 - (Enabled)
|
||||||
|
#
|
||||||
|
RewardSystem.Announce = 1
|
||||||
|
|
||||||
#
|
#
|
||||||
# RewardSystemEnable
|
# RewardSystemEnable
|
||||||
# Description: Enable the reward system
|
# Description: Enable the reward system
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
MOD_REWARD_SYSTEM_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/" && pwd )"
|
||||||
|
|
||||||
|
source $MOD_REWARD_SYSTEM_ROOT"/conf/conf.sh.dist"
|
||||||
|
|
||||||
|
if [ -f $MOD_REWARD_SYSTEM_ROOT"/conf/conf.sh" ]; then
|
||||||
|
source $MOD_REWARD_SYSTEM_ROOT"/conf/conf.sh"
|
||||||
|
fi
|
||||||
|
|||||||
@@ -16,9 +16,6 @@ CREATE TABLE IF NOT EXISTS `reward_system` (
|
|||||||
`roll` int(11) NOT NULL,
|
`roll` int(11) NOT NULL,
|
||||||
`item` int(11) NOT NULL,
|
`item` int(11) NOT NULL,
|
||||||
`quantity` int(11)
|
`quantity` int(11)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
|
|
||||||
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
|
|
||||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
|
||||||
@@ -3,10 +3,10 @@
|
|||||||
#include "Configuration/Config.h"
|
#include "Configuration/Config.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "AccountMgr.h"
|
#include "AccountMgr.h"
|
||||||
#include "Chat.h"
|
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
#include "Define.h"
|
#include "Define.h"
|
||||||
#include "GossipDef.h"
|
#include "GossipDef.h"
|
||||||
|
#include "Chat.h"
|
||||||
|
|
||||||
bool RewardSystem_Enable;
|
bool RewardSystem_Enable;
|
||||||
uint32 Max_roll;
|
uint32 Max_roll;
|
||||||
@@ -14,23 +14,21 @@ uint32 Max_roll;
|
|||||||
class reward_system : public PlayerScript
|
class reward_system : public PlayerScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
reward_system() : PlayerScript("rewardsystem") {}
|
reward_system() : PlayerScript("reward_system") {}
|
||||||
|
|
||||||
uint32 RewardTimer;
|
uint32 RewardTimer;
|
||||||
int32 roll;
|
int32 roll;
|
||||||
|
|
||||||
void OnLogin(Player* p)
|
void OnLogin(Player* player) override
|
||||||
{
|
{
|
||||||
if (RewardSystem_Enable)
|
if (sConfigMgr->GetBoolDefault("RewardSystem.Announce", true)) {
|
||||||
{
|
ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00Reward Time Played |rmodule.");
|
||||||
ChatHandler(p->GetSession()).SendSysMessage("This server is running the |cff4CFF00Player Reward System |rmodule.");
|
}
|
||||||
RewardTimer = (sConfigMgr->GetIntDefault("RewardTime", 1)*HOUR*IN_MILLISECONDS);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnBeforeUpdate(Player* player, uint32 p_time)
|
void OnBeforeUpdate(Player* player, uint32 p_time) override
|
||||||
{
|
{
|
||||||
if (RewardSystem_Enable)
|
if (sConfigMgr->GetBoolDefault("RewardSystemEnable", true))
|
||||||
{
|
{
|
||||||
if (RewardTimer > 0)
|
if (RewardTimer > 0)
|
||||||
{
|
{
|
||||||
@@ -89,7 +87,6 @@ public:
|
|||||||
std::string cfg_def_file = cfg_file + ".dist";
|
std::string cfg_def_file = cfg_file + ".dist";
|
||||||
sConfigMgr->LoadMore(cfg_def_file.c_str());
|
sConfigMgr->LoadMore(cfg_def_file.c_str());
|
||||||
sConfigMgr->LoadMore(cfg_file.c_str());
|
sConfigMgr->LoadMore(cfg_file.c_str());
|
||||||
RewardSystem_Enable = sConfigMgr->GetBoolDefault("RewardSystemEnable", true);
|
|
||||||
Max_roll = sConfigMgr->GetIntDefault("MaxRoll", 1000);
|
Max_roll = sConfigMgr->GetIntDefault("MaxRoll", 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,4 +96,4 @@ void AddRewardSystemScripts()
|
|||||||
{
|
{
|
||||||
new reward_system();
|
new reward_system();
|
||||||
new reward_system_conf();
|
new reward_system_conf();
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user