- New cronjob "cleanUpCharacterData()" cleans up outdated "kicked until" timestamps
This commit is contained in:
@@ -44,6 +44,9 @@ importSystemData = Cron\CcpSystemsUpdate->importSystemData,
|
||||
; disable outdated maps
|
||||
deactivateMapData = Cron\MapUpdate->deactivateMapData, @hourly
|
||||
|
||||
; clean up character data (kick, ban,..)
|
||||
cleanUpCharacterData = Cron\CharacterUpdate->cleanUpCharacterData, @hourly
|
||||
|
||||
; delete disabled maps
|
||||
deleteMapData = Cron\MapUpdate->deleteMapData, @downtime
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class CharacterUpdate {
|
||||
* @param \Base $f3
|
||||
* @return int
|
||||
*/
|
||||
protected function getCharacterLogActiveTime($f3){
|
||||
protected function getCharacterLogActiveTime(\Base $f3){
|
||||
$logActiveTime = (int)$f3->get('PATHFINDER.CACHE.CHARACTER_LOG_ACTIVE');
|
||||
return ($logActiveTime >= 0) ? $logActiveTime : self::CHARACTER_LOG_ACTIVE;
|
||||
}
|
||||
@@ -32,7 +32,7 @@ class CharacterUpdate {
|
||||
* @param \Base $f3
|
||||
* @return int
|
||||
*/
|
||||
protected function getCharacterLogInactiveTime($f3){
|
||||
protected function getCharacterLogInactiveTime(\Base $f3){
|
||||
$logInactiveTime = (int)$f3->get('PATHFINDER.CACHE.CHARACTER_LOG_INACTIVE');
|
||||
return ($logInactiveTime >= 0) ? $logInactiveTime : self::CHARACTER_LOG_INACTIVE;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ class CharacterUpdate {
|
||||
* >> php index.php "/cron/deactivateLogData"
|
||||
* @param \Base $f3
|
||||
*/
|
||||
function deactivateLogData($f3){
|
||||
public function deactivateLogData(\Base $f3){
|
||||
DB\Database::instance()->getDB('PF');
|
||||
$logActiveTime = $this->getCharacterLogActiveTime($f3);
|
||||
|
||||
@@ -75,7 +75,7 @@ class CharacterUpdate {
|
||||
* >> php index.php "/cron/deleteLogData"
|
||||
* @param \Base $f3
|
||||
*/
|
||||
function deleteLogData($f3){
|
||||
public function deleteLogData(\Base $f3){
|
||||
DB\Database::instance()->getDB('PF');
|
||||
$logInactiveTime = $this->getCharacterLogInactiveTime($f3);
|
||||
|
||||
@@ -101,13 +101,43 @@ class CharacterUpdate {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* clean up outdated character data e.g. kicked until status
|
||||
* >> php index.php "/cron/cleanUpCharacterData"
|
||||
* @param \Base $f3
|
||||
*/
|
||||
public function cleanUpCharacterData(\Base $f3){
|
||||
DB\Database::instance()->getDB('PF');
|
||||
|
||||
/**
|
||||
* @var $characterModel Model\CharacterModel
|
||||
*/
|
||||
$characterModel = Model\BasicModel::getNew('CharacterModel', 0);
|
||||
|
||||
$characters = $characterModel->find([
|
||||
'active = :active AND TIMESTAMPDIFF(SECOND, kicked, NOW() ) > 0',
|
||||
':active' => 1
|
||||
]);
|
||||
|
||||
|
||||
if(is_object($characters)){
|
||||
foreach($characters as $character){
|
||||
/**
|
||||
* @var $character Model\CharacterModel
|
||||
*/
|
||||
$character->kick();
|
||||
$character->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* delete expired character authentication data
|
||||
* authentication data is used for cookie based login
|
||||
* >> php index.php "/cron/deleteAuthenticationData"
|
||||
* @param \Base $f3
|
||||
*/
|
||||
function deleteAuthenticationData($f3){
|
||||
public function deleteAuthenticationData($f3){
|
||||
DB\Database::instance()->getDB('PF');
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,7 @@ define([
|
||||
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
let config = {
|
||||
|
||||
staticLogoId: 'pf-static-logo-svg', // id for "static" logo
|
||||
|
||||
@@ -26,9 +26,9 @@ define([
|
||||
* @param enableHover
|
||||
*/
|
||||
$.fn.drawLogo = function(callback, enableHover){
|
||||
var canvasElement = $(this);
|
||||
let canvasElement = $(this);
|
||||
|
||||
var pathObj = {
|
||||
let pathObj = {
|
||||
logo: {
|
||||
strokepath: [
|
||||
{
|
||||
@@ -61,7 +61,7 @@ define([
|
||||
|
||||
// load Logo svg
|
||||
requirejs(['text!templates/ui/logo.html', 'mustache'], function(template, Mustache) {
|
||||
var logoData = {
|
||||
let logoData = {
|
||||
staticLogoId: config.staticLogoId,
|
||||
logoPartTopRightClass: config.logoPartTopRightClass,
|
||||
logoPartBottomLeftClass: config.logoPartBottomLeftClass,
|
||||
@@ -69,7 +69,7 @@ define([
|
||||
logoPartTopLeftClass: config.logoPartTopLeftClass
|
||||
};
|
||||
|
||||
var logoContent = Mustache.render(template, logoData);
|
||||
let logoContent = Mustache.render(template, logoData);
|
||||
|
||||
canvasElement.html(logoContent);
|
||||
|
||||
@@ -106,17 +106,17 @@ define([
|
||||
|
||||
// init logo animation
|
||||
if(enableHover === true){
|
||||
var logoElements = $('#' + config.staticLogoId + ' path');
|
||||
let logoElements = $('#' + config.staticLogoId + ' path');
|
||||
|
||||
var animate = [];
|
||||
let animate = [];
|
||||
logoElements.on('mouseover', function(e){
|
||||
var currentLogoElement = $(e.target);
|
||||
var currentLogoElementIndex = logoElements.index(currentLogoElement);
|
||||
let currentLogoElement = $(e.target);
|
||||
let currentLogoElementIndex = logoElements.index(currentLogoElement);
|
||||
|
||||
var animationXValue = currentLogoElement.attr('data-animationX');
|
||||
var animationYValue = currentLogoElement.attr('data-animationY');
|
||||
let animationXValue = currentLogoElement.attr('data-animationX');
|
||||
let animationYValue = currentLogoElement.attr('data-animationY');
|
||||
|
||||
var animationConfig = {};
|
||||
let animationConfig = {};
|
||||
animationConfig.opacity = [1, 1];
|
||||
animationConfig.translateZ = [0, 0];
|
||||
animationConfig.translateX = [animationXValue, 0 ];
|
||||
|
||||
@@ -9,7 +9,7 @@ define([
|
||||
|
||||
'use strict';
|
||||
|
||||
var config = {
|
||||
let config = {
|
||||
|
||||
staticLogoId: 'pf-static-logo-svg', // id for "static" logo
|
||||
|
||||
@@ -26,9 +26,9 @@ define([
|
||||
* @param enableHover
|
||||
*/
|
||||
$.fn.drawLogo = function(callback, enableHover){
|
||||
var canvasElement = $(this);
|
||||
let canvasElement = $(this);
|
||||
|
||||
var pathObj = {
|
||||
let pathObj = {
|
||||
logo: {
|
||||
strokepath: [
|
||||
{
|
||||
@@ -61,7 +61,7 @@ define([
|
||||
|
||||
// load Logo svg
|
||||
requirejs(['text!templates/ui/logo.html', 'mustache'], function(template, Mustache) {
|
||||
var logoData = {
|
||||
let logoData = {
|
||||
staticLogoId: config.staticLogoId,
|
||||
logoPartTopRightClass: config.logoPartTopRightClass,
|
||||
logoPartBottomLeftClass: config.logoPartBottomLeftClass,
|
||||
@@ -69,7 +69,7 @@ define([
|
||||
logoPartTopLeftClass: config.logoPartTopLeftClass
|
||||
};
|
||||
|
||||
var logoContent = Mustache.render(template, logoData);
|
||||
let logoContent = Mustache.render(template, logoData);
|
||||
|
||||
canvasElement.html(logoContent);
|
||||
|
||||
@@ -106,17 +106,17 @@ define([
|
||||
|
||||
// init logo animation
|
||||
if(enableHover === true){
|
||||
var logoElements = $('#' + config.staticLogoId + ' path');
|
||||
let logoElements = $('#' + config.staticLogoId + ' path');
|
||||
|
||||
var animate = [];
|
||||
let animate = [];
|
||||
logoElements.on('mouseover', function(e){
|
||||
var currentLogoElement = $(e.target);
|
||||
var currentLogoElementIndex = logoElements.index(currentLogoElement);
|
||||
let currentLogoElement = $(e.target);
|
||||
let currentLogoElementIndex = logoElements.index(currentLogoElement);
|
||||
|
||||
var animationXValue = currentLogoElement.attr('data-animationX');
|
||||
var animationYValue = currentLogoElement.attr('data-animationY');
|
||||
let animationXValue = currentLogoElement.attr('data-animationX');
|
||||
let animationYValue = currentLogoElement.attr('data-animationY');
|
||||
|
||||
var animationConfig = {};
|
||||
let animationConfig = {};
|
||||
animationConfig.opacity = [1, 1];
|
||||
animationConfig.translateZ = [0, 0];
|
||||
animationConfig.translateX = [animationXValue, 0 ];
|
||||
|
||||
Reference in New Issue
Block a user