commit
307b60f44b
Binary file not shown.
After Width: | Height: | Size: 369 KiB |
Binary file not shown.
Before Width: | Height: | Size: 62 B |
@ -0,0 +1,37 @@
|
||||
|
||||
if(window.addEventListener)
|
||||
window.addEventListener("load", tabulation, false);
|
||||
else
|
||||
window.attachEvent("onload", tabulation);
|
||||
|
||||
function tabulation(){
|
||||
var textareas = document.getElementsByTagName("textarea");
|
||||
for(var i = 0, t = textareas.length; i < t; i++){
|
||||
textareas[i].onkeydown = function(e){
|
||||
var tab = (e || window.event).keyCode == 9;
|
||||
if(tab){
|
||||
var tabString = String.fromCharCode(9);
|
||||
var scroll = this.scrollTop;
|
||||
|
||||
if(window.ActiveXObject){
|
||||
var textR = document.selection.createRange();
|
||||
var selection = textR.text;
|
||||
textR.text = tabString + selection;
|
||||
textR.moveStart("character",-selection.length);
|
||||
textR.moveEnd("character", 0);
|
||||
textR.select();
|
||||
}
|
||||
else {
|
||||
var beforeSelection = this.value.substring(0, this.selectionStart);
|
||||
var selection = this.value.substring(this.selectionStart, this.selectionEnd);
|
||||
var afterSelection = this.value.substring(this.selectionEnd);
|
||||
this.value = beforeSelection + tabString + selection + afterSelection;
|
||||
this.setSelectionRange(beforeSelection.length + tabString.length, beforeSelection.length + tabString.length + selection.length);
|
||||
}
|
||||
this.focus();
|
||||
this.scrollTop = scroll;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,386 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|
||||
class.Diff.php
|
||||
|
||||
A class containing a diff implementation
|
||||
|
||||
Created by Stephen Morley - http://stephenmorley.org/ - and released under the
|
||||
terms of the CC0 1.0 Universal legal code:
|
||||
|
||||
http://creativecommons.org/publicdomain/zero/1.0/legalcode
|
||||
|
||||
*/
|
||||
|
||||
// A class containing functions for computing diffs and formatting the output.
|
||||
class Diff{
|
||||
|
||||
// define the constants
|
||||
const UNMODIFIED = 0;
|
||||
const DELETED = 1;
|
||||
const INSERTED = 2;
|
||||
|
||||
/* Returns the diff for two strings. The return value is an array, each of
|
||||
* whose values is an array containing two values: a line (or character, if
|
||||
* $compareCharacters is true), and one of the constants DIFF::UNMODIFIED (the
|
||||
* line or character is in both strings), DIFF::DELETED (the line or character
|
||||
* is only in the first string), and DIFF::INSERTED (the line or character is
|
||||
* only in the second string). The parameters are:
|
||||
*
|
||||
* $string1 - the first string
|
||||
* $string2 - the second string
|
||||
* $compareCharacters - true to compare characters, and false to compare
|
||||
* lines; this optional parameter defaults to false
|
||||
*/
|
||||
public static function compare(
|
||||
$string1, $string2, $compareCharacters = false){
|
||||
|
||||
// initialise the sequences and comparison start and end positions
|
||||
$start = 0;
|
||||
if ($compareCharacters){
|
||||
$sequence1 = $string1;
|
||||
$sequence2 = $string2;
|
||||
$end1 = strlen($string1) - 1;
|
||||
$end2 = strlen($string2) - 1;
|
||||
}else{
|
||||
$sequence1 = preg_split('/\R/', $string1);
|
||||
$sequence2 = preg_split('/\R/', $string2);
|
||||
$end1 = count($sequence1) - 1;
|
||||
$end2 = count($sequence2) - 1;
|
||||
}
|
||||
|
||||
// skip any common prefix
|
||||
while ($start <= $end1 && $start <= $end2
|
||||
&& $sequence1[$start] == $sequence2[$start]){
|
||||
$start ++;
|
||||
}
|
||||
|
||||
// skip any common suffix
|
||||
while ($end1 >= $start && $end2 >= $start
|
||||
&& $sequence1[$end1] == $sequence2[$end2]){
|
||||
$end1 --;
|
||||
$end2 --;
|
||||
}
|
||||
|
||||
// compute the table of longest common subsequence lengths
|
||||
$table = self::computeTable($sequence1, $sequence2, $start, $end1, $end2);
|
||||
|
||||
// generate the partial diff
|
||||
$partialDiff =
|
||||
self::generatePartialDiff($table, $sequence1, $sequence2, $start);
|
||||
|
||||
// generate the full diff
|
||||
$diff = array();
|
||||
for ($index = 0; $index < $start; $index ++){
|
||||
$diff[] = array($sequence1[$index], self::UNMODIFIED);
|
||||
}
|
||||
while (count($partialDiff) > 0) $diff[] = array_pop($partialDiff);
|
||||
for ($index = $end1 + 1;
|
||||
$index < ($compareCharacters ? strlen($sequence1) : count($sequence1));
|
||||
$index ++){
|
||||
$diff[] = array($sequence1[$index], self::UNMODIFIED);
|
||||
}
|
||||
|
||||
// return the diff
|
||||
return $diff;
|
||||
|
||||
}
|
||||
|
||||
/* Returns the diff for two files. The parameters are:
|
||||
*
|
||||
* $file1 - the path to the first file
|
||||
* $file2 - the path to the second file
|
||||
* $compareCharacters - true to compare characters, and false to compare
|
||||
* lines; this optional parameter defaults to false
|
||||
*/
|
||||
public static function compareFiles(
|
||||
$file1, $file2, $compareCharacters = false){
|
||||
|
||||
// return the diff of the files
|
||||
return self::compare(
|
||||
file_get_contents($file1),
|
||||
file_get_contents($file2),
|
||||
$compareCharacters);
|
||||
|
||||
}
|
||||
|
||||
/* Returns the table of longest common subsequence lengths for the specified
|
||||
* sequences. The parameters are:
|
||||
*
|
||||
* $sequence1 - the first sequence
|
||||
* $sequence2 - the second sequence
|
||||
* $start - the starting index
|
||||
* $end1 - the ending index for the first sequence
|
||||
* $end2 - the ending index for the second sequence
|
||||
*/
|
||||
private static function computeTable(
|
||||
$sequence1, $sequence2, $start, $end1, $end2){
|
||||
|
||||
// determine the lengths to be compared
|
||||
$length1 = $end1 - $start + 1;
|
||||
$length2 = $end2 - $start + 1;
|
||||
|
||||
// initialise the table
|
||||
$table = array(array_fill(0, $length2 + 1, 0));
|
||||
|
||||
// loop over the rows
|
||||
for ($index1 = 1; $index1 <= $length1; $index1 ++){
|
||||
|
||||
// create the new row
|
||||
$table[$index1] = array(0);
|
||||
|
||||
// loop over the columns
|
||||
for ($index2 = 1; $index2 <= $length2; $index2 ++){
|
||||
|
||||
// store the longest common subsequence length
|
||||
if ($sequence1[$index1 + $start - 1]
|
||||
== $sequence2[$index2 + $start - 1]){
|
||||
$table[$index1][$index2] = $table[$index1 - 1][$index2 - 1] + 1;
|
||||
}else{
|
||||
$table[$index1][$index2] =
|
||||
max($table[$index1 - 1][$index2], $table[$index1][$index2 - 1]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// return the table
|
||||
return $table;
|
||||
|
||||
}
|
||||
|
||||
/* Returns the partial diff for the specificed sequences, in reverse order.
|
||||
* The parameters are:
|
||||
*
|
||||
* $table - the table returned by the computeTable function
|
||||
* $sequence1 - the first sequence
|
||||
* $sequence2 - the second sequence
|
||||
* $start - the starting index
|
||||
*/
|
||||
private static function generatePartialDiff(
|
||||
$table, $sequence1, $sequence2, $start){
|
||||
|
||||
// initialise the diff
|
||||
$diff = array();
|
||||
|
||||
// initialise the indices
|
||||
$index1 = count($table) - 1;
|
||||
$index2 = count($table[0]) - 1;
|
||||
|
||||
// loop until there are no items remaining in either sequence
|
||||
while ($index1 > 0 || $index2 > 0){
|
||||
|
||||
// check what has happened to the items at these indices
|
||||
if ($index1 > 0 && $index2 > 0
|
||||
&& $sequence1[$index1 + $start - 1]
|
||||
== $sequence2[$index2 + $start - 1]){
|
||||
|
||||
// update the diff and the indices
|
||||
$diff[] = array($sequence1[$index1 + $start - 1], self::UNMODIFIED);
|
||||
$index1 --;
|
||||
$index2 --;
|
||||
|
||||
}elseif ($index2 > 0
|
||||
&& $table[$index1][$index2] == $table[$index1][$index2 - 1]){
|
||||
|
||||
// update the diff and the indices
|
||||
$diff[] = array($sequence2[$index2 + $start - 1], self::INSERTED);
|
||||
$index2 --;
|
||||
|
||||
}else{
|
||||
|
||||
// update the diff and the indices
|
||||
$diff[] = array($sequence1[$index1 + $start - 1], self::DELETED);
|
||||
$index1 --;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// return the diff
|
||||
return $diff;
|
||||
|
||||
}
|
||||
|
||||
/* Returns a diff as a string, where unmodified lines are prefixed by ' ',
|
||||
* deletions are prefixed by '- ', and insertions are prefixed by '+ '. The
|
||||
* parameters are:
|
||||
*
|
||||
* $diff - the diff array
|
||||
* $separator - the separator between lines; this optional parameter defaults
|
||||
* to "\n"
|
||||
*/
|
||||
public static function toString($diff, $separator = "\n"){
|
||||
|
||||
// initialise the string
|
||||
$string = '';
|
||||
|
||||
// loop over the lines in the diff
|
||||
foreach ($diff as $line){
|
||||
|
||||
// extend the string with the line
|
||||
switch ($line[1]){
|
||||
#case self::UNMODIFIED : $string .= ' ' . $line[0];break;
|
||||
#case self::DELETED : $string .= '- ' . $line[0];break;
|
||||
case self::INSERTED : $string .= '' . $line[0];break;
|
||||
}
|
||||
|
||||
// extend the string with the separator
|
||||
$string .= $separator;
|
||||
|
||||
}
|
||||
|
||||
// return the string
|
||||
return $string;
|
||||
|
||||
}
|
||||
|
||||
/* Returns a diff as an HTML string, where unmodified lines are contained
|
||||
* within 'span' elements, deletions are contained within 'del' elements, and
|
||||
* insertions are contained within 'ins' elements. The parameters are:
|
||||
*
|
||||
* $diff - the diff array
|
||||
* $separator - the separator between lines; this optional parameter defaults
|
||||
* to '<br>'
|
||||
*/
|
||||
public static function toHTML($diff, $separator = '<br>'){
|
||||
|
||||
// initialise the HTML
|
||||
$html = '';
|
||||
|
||||
// loop over the lines in the diff
|
||||
foreach ($diff as $line){
|
||||
|
||||
// extend the HTML with the line
|
||||
switch ($line[1]){
|
||||
case self::UNMODIFIED : $element = 'span'; break;
|
||||
case self::DELETED : $element = 'del'; break;
|
||||
case self::INSERTED : $element = 'ins'; break;
|
||||
}
|
||||
$html .=
|
||||
'<' . $element . '>'
|
||||
. htmlspecialchars($line[0])
|
||||
. '</' . $element . '>';
|
||||
|
||||
// extend the HTML with the separator
|
||||
$html .= $separator;
|
||||
|
||||
}
|
||||
|
||||
// return the HTML
|
||||
return $html;
|
||||
|
||||
}
|
||||
|
||||
/* Returns a diff as an HTML table. The parameters are:
|
||||
*
|
||||
* $diff - the diff array
|
||||
* $indentation - indentation to add to every line of the generated HTML; this
|
||||
* optional parameter defaults to ''
|
||||
* $separator - the separator between lines; this optional parameter
|
||||
* defaults to '<br>'
|
||||
*/
|
||||
public static function toTable($diff, $indentation = '', $separator = '<br>'){
|
||||
|
||||
// initialise the HTML
|
||||
$html = $indentation . "<table class=\"diff\">\n";
|
||||
|
||||
// loop over the lines in the diff
|
||||
$index = 0;
|
||||
while ($index < count($diff)){
|
||||
|
||||
// determine the line type
|
||||
switch ($diff[$index][1]){
|
||||
|
||||
// display the content on the left and right
|
||||
case self::UNMODIFIED:
|
||||
$leftCell =
|
||||
self::getCellContent(
|
||||
$diff, $indentation, $separator, $index, self::UNMODIFIED);
|
||||
$rightCell = $leftCell;
|
||||
break;
|
||||
|
||||
// display the deleted on the left and inserted content on the right
|
||||
case self::DELETED:
|
||||
$leftCell =
|
||||
self::getCellContent(
|
||||
$diff, $indentation, $separator, $index, self::DELETED);
|
||||
$rightCell =
|
||||
self::getCellContent(
|
||||
$diff, $indentation, $separator, $index, self::INSERTED);
|
||||
break;
|
||||
|
||||
// display the inserted content on the right
|
||||
case self::INSERTED:
|
||||
$leftCell = '';
|
||||
$rightCell =
|
||||
self::getCellContent(
|
||||
$diff, $indentation, $separator, $index, self::INSERTED);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
// extend the HTML with the new row
|
||||
$html .=
|
||||
$indentation
|
||||
. " <tr>\n"
|
||||
. $indentation
|
||||
. ' <td class="diff'
|
||||
. ($leftCell == $rightCell
|
||||
? 'Unmodified'
|
||||
: ($leftCell == '' ? 'Blank' : 'Deleted'))
|
||||
. '">'
|
||||
. $leftCell
|
||||
. "</td>\n"
|
||||
. $indentation
|
||||
. ' <td class="diff'
|
||||
. ($leftCell == $rightCell
|
||||
? 'Unmodified'
|
||||
: ($rightCell == '' ? 'Blank' : 'Inserted'))
|
||||
. '">'
|
||||
. $rightCell
|
||||
. "</td>\n"
|
||||
. $indentation
|
||||
. " </tr>\n";
|
||||
|
||||
}
|
||||
|
||||
// return the HTML
|
||||
return $html . $indentation . "</table>\n";
|
||||
|
||||
}
|
||||
|
||||
/* Returns the content of the cell, for use in the toTable function. The
|
||||
* parameters are:
|
||||
*
|
||||
* $diff - the diff array
|
||||
* $indentation - indentation to add to every line of the generated HTML
|
||||
* $separator - the separator between lines
|
||||
* $index - the current index, passes by reference
|
||||
* $type - the type of line
|
||||
*/
|
||||
private static function getCellContent(
|
||||
$diff, $indentation, $separator, &$index, $type){
|
||||
|
||||
// initialise the HTML
|
||||
$html = '';
|
||||
|
||||
// loop over the matching lines, adding them to the HTML
|
||||
while ($index < count($diff) && $diff[$index][1] == $type){
|
||||
$html .=
|
||||
'<span>'
|
||||
. htmlspecialchars($diff[$index][0])
|
||||
. '</span>'
|
||||
. $separator;
|
||||
$index ++;
|
||||
}
|
||||
|
||||
// return the HTML
|
||||
return $html;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
require_once("diff_class.php");
|
||||
|
||||
$microstart = explode(' ',microtime());
|
||||
$start_time = $microstart[0] + $microstart[1];
|
||||
|
||||
echo Diff::toString(Diff::compareFiles('old_char_346.xml', 'char_346.xml', false));
|
||||
|
||||
$microstop = explode(' ',microtime());
|
||||
$stop_time = $microstop[0] + $microstop[1];
|
||||
|
||||
echo "Expired time: ".($stop_time - $start_time)."<br>";
|
||||
|
||||
echo "Memory load: ".memory_get_usage()." bytes";
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/*
|
||||
* Logging, logging, logging....
|
||||
*/
|
||||
|
||||
class Logfile {
|
||||
private $logfile;
|
||||
|
||||
function Logfile($f = false,$logto = "std") {
|
||||
global $CONF,$MY_PATH;
|
||||
$this->logfile = false;
|
||||
|
||||
if($f != false) {
|
||||
|
||||
|
||||
$ldir = $MY_PATH.$CONF['logfile'].date("Y-m-d",time());
|
||||
|
||||
#$tmp = fopen($MY_PATH."/testlog.txt",'a+');
|
||||
#fwrite($tmp, $ldir.'/'.date("H",time()).".txt\n");
|
||||
#fclose($tmp);
|
||||
|
||||
if(!is_dir($ldir)) {
|
||||
mkdir($ldir,0777,true);
|
||||
}
|
||||
$this->logfile = fopen($ldir.'/'.date("H",time()).'_'.$logto.'.txt','a+');
|
||||
#echo "kk";
|
||||
}
|
||||
}
|
||||
|
||||
function logf($t,$nl = true) {
|
||||
$this->write("[".date("H:i:s")."] ".$t);
|
||||
if($nl == true) {
|
||||
$this->write("\n");
|
||||
}
|
||||
}
|
||||
|
||||
function logi($t,$nl = true) {
|
||||
#echo $t;
|
||||
$this->write("[".date("H:i:s")."] > ".$t);
|
||||
if($nl == true) {
|
||||
$this->write("\n");
|
||||
}
|
||||
}
|
||||
|
||||
function write($txt) {
|
||||
#echo $txt;
|
||||
if($this->logfile != false) {
|
||||
fwrite($this->logfile,$txt);
|
||||
}
|
||||
}
|
||||
|
||||
function close() {
|
||||
if($this->logfile != false) {
|
||||
fclose($this->logfile);
|
||||
}
|
||||
#echo "ii";
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,9 +1,27 @@
|
||||
<?php
|
||||
class Stats {
|
||||
#private $user;
|
||||
private $data;
|
||||
|
||||
function Stats() {
|
||||
global $cdata,$DBc;
|
||||
#$this->user = $user;
|
||||
|
||||
$DBc->sendSQL("INSERT IGNORE INTO stat_players (sp_char) VALUES ('".$cdata['cid']."')","NONE");
|
||||
|
||||
$this->data = array();
|
||||
}
|
||||
|
||||
function setValue($k,$v) {
|
||||
global $DBc;
|
||||
|
||||
$this->data[] = $k."='".$DBc->mre($v)."'";
|
||||
}
|
||||
|
||||
function writeData() {
|
||||
global $DBc,$cdata;
|
||||
|
||||
$DBc->sendSQL("UPDATE stat_players SET ".implode(',',$this->data)." WHERE sp_char='".$cdata['cid']."'","NONE");
|
||||
}
|
||||
|
||||
function register() { // register the stats code
|
@ -0,0 +1,5 @@
|
||||
#!/bin/sh -
|
||||
|
||||
cd /home/api/public_html/server/scripts/achievement_script
|
||||
|
||||
sudo -u api nohup ./parse_new_xml.sh &
|
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd /home/api/public_html/server/scripts/achievement_script
|
||||
|
||||
SRC=/home/api/public_html/server/scripts/achievement_script/new_xml
|
||||
DST=/home/api/public_html/server/scripts/achievement_script/parse_xml
|
||||
|
||||
while true; do
|
||||
|
||||
FN=`inotifywait -r -e close_write --format '%w%f' $SRC`
|
||||
|
||||
for f in $SRC/*; do
|
||||
NAME="$DST/"`basename $f`
|
||||
mv -f $f $DST
|
||||
echo "Processing $NAME"
|
||||
php AchWebParser.php $NAME
|
||||
rm -f $NAME
|
||||
done
|
||||
|
||||
done
|
||||
|
||||
#cd -
|
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
$region = array();
|
||||
|
||||
$region['aeden'] = array("13780 -31556 ","13780 -33532 ","14364 -34876 ","19636 -34860 ","19996 -30660 ","19988 -29724 ","18676 -29452 ","14372 -29444 ","13780 -31556"); // Aeden Aqueous
|
||||
|
||||
$region['desert'] = array("15848 -23868 ","15944 -26572 ","17208 -27026 ","20280 -27020 ","20296 -26364 ","20312 -23868 ","18832 -23840 ","15848 -23868"); // Burning Desert
|
||||
|
||||
$region['verdant'] = array("3432 -4828 ","2920 -6076 ","2904 -7644 ","6048 -7836 ","6232 -6276 ","6176 -5436 ","5256 -3532 ","6240 -804 ","-249456 -348 ","3944 -340 ","376 -324 ","-254400 -1068 ","616 -2668 ","2744 -3100 ","3432 -4828"); // Verdant Heights
|
||||
|
||||
$region['witherings'] = array("6924 -968 ","6892 -2096 ","7028 -4632 ","8180 -4120 ","9628 -5176 ","12084 -5904 ","12420 -5552 ","12300 -2784 ","12460 -1464 ","11444 -984 ","9516 -1400 ","8220 -976 ","6924 -968"); // The Witherings
|
||||
|
||||
$region['nexus'] = array("7852 -6836 ","7860 -7156 ","8604 -8292 ","9140 -8300 ","2712 -6788 ","9724 -6564 ","9556 -6108 ","9012 -6116 ","7852 -6836"); // Nexus
|
||||
|
||||
$region['ichor'] = array("536 -10336 ","488 -11168 ","680 -11320 ","1592 -11320 ","2080 -3708 ","696 -9792 ","536 -10336"); // Abyss of Ichor
|
||||
|
||||
$region['spring'] = array("3484 -9776 ","2572 -10224 ","2620 -11008 ","3260 -11344 ","3804 -10912 ","3836 -10240 ","3484 -9776"); // Under Spring
|
||||
|
||||
$region['wastelands'] = array("204 -14072 ","748 -15336 ","2140 -15816 ","2988 -15704 ","2956 -13144 ","732 -13128 ","172 -13736 ","204 -14072"); // Wastelands
|
||||
|
||||
$region['umbra'] = array("5456 -9788 ","5440 -16936 ","7200 -16952 ","7344 -12472 ","6304 -9624 ","5456 -9788"); // Lands of Umbra
|
||||
|
||||
?>
|
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
$this->registerValue("_money","_statsdb_money");
|
||||
function _statsdb_money($money,$_P,$_CB) {
|
||||
global $cdata,$DBc,$statsdb;
|
||||
$_IDENT = "_money";
|
||||
|
||||
#$DBc->sendSQL("UPDATE stat_players SET sp_money='".$money."' WHERE sp_char='".$cdata['cid']."'","NONE");
|
||||
$statsdb->setValue('sp_money',$money);
|
||||
|
||||
$_P->unregisterValue($_IDENT,$_CB);
|
||||
}
|
||||
|
||||
$this->registerValue("_race","_statsdb_race");
|
||||
function _statsdb_race($race,$_P,$_CB) {
|
||||
global $cdata,$DBc,$statsdb;
|
||||
$_IDENT = "_race";
|
||||
|
||||
$race = "r_".strtolower($race);
|
||||
|
||||
#$DBc->sendSQL("UPDATE stat_players SET sp_race='".$race."' WHERE sp_char='".$cdata['cid']."'","NONE");
|
||||
$statsdb->setValue('sp_race',$race);
|
||||
|
||||
$_P->unregisterValue($_IDENT,$_CB);
|
||||
}
|
||||
|
||||
$this->registerValue("yubopoints","_statsdb_yubototal");
|
||||
function _statsdb_yubototal($yubo,$_P,$_CB) {
|
||||
global $cdata,$DBc,$statsdb;
|
||||
$_IDENT = "yubopoints";
|
||||
|
||||
#$DBc->sendSQL("UPDATE stat_players SET sp_yubototal='".$yubo."' WHERE sp_char='".$cdata['cid']."'","NONE");
|
||||
$statsdb->setValue('sp_yubototal',$yubo);
|
||||
|
||||
$_P->unregisterValue($_IDENT,$_CB);
|
||||
}
|
||||
|
||||
$this->registerValue("petcount","_statsdb_mekcount");
|
||||
function _statsdb_mekcount($count,$_P,$_CB) {
|
||||
global $cdata,$DBc,$statsdb;
|
||||
$_IDENT = "petcount";
|
||||
|
||||
#$DBc->sendSQL("UPDATE stat_players SET sp_mekcount='".$count."' WHERE sp_char='".$cdata['cid']."'","NONE");
|
||||
$statsdb->setValue('sp_mekcount',$count);
|
||||
|
||||
$_P->unregisterValue($_IDENT,$_CB);
|
||||
}
|
||||
|
||||
$this->registerEntity("skilllist","_statsdb_maxlevel");
|
||||
function _statsdb_maxlevel($skills,$_P,$_CB) {
|
||||
global $cdata,$DBc,$log,$statsdb;
|
||||
$_IDENT = "skilllist";
|
||||
|
||||
#$log->logf("rcv skilllist: ".var_export($skills,true));
|
||||
|
||||
$lvl = 0;
|
||||
foreach($skills->skills as $elem) {
|
||||
if($elem->current > $lvl) {
|
||||
$lvl = $elem->current;
|
||||
}
|
||||
}
|
||||
|
||||
#$DBc->sendSQL("UPDATE stat_players SET sp_maxlevel='".$lvl."' WHERE sp_char='".$cdata['cid']."'","NONE");
|
||||
$statsdb->setValue('sp_maxlevel',$lvl);
|
||||
|
||||
$_P->unregisterEntity($_IDENT,$_CB);
|
||||
}
|
||||
|
||||
$this->registerValue("_guildid","_statsdb_guildid");
|
||||
function _statsdb_guildid($id,$_P,$_CB) {
|
||||
global $cdata,$DBc,$statsdb;
|
||||
$_IDENT = "_guildid";
|
||||
|
||||
#$DBc->sendSQL("UPDATE stat_players SET sp_guildid='".$id."' WHERE sp_char='".$cdata['cid']."'","NONE");
|
||||
$statsdb->setValue('sp_guildid',$id);
|
||||
|
||||
$_P->unregisterValue($_IDENT,$_CB);
|
||||
}
|
||||
|
||||
$this->registerValue("itemcount","_statsdb_itemcount");
|
||||
function _statsdb_itemcount($count,$_P,$_CB) {
|
||||
global $cdata,$DBc,$statsdb;
|
||||
$_IDENT = "itemcount";
|
||||
|
||||
#$DBc->sendSQL("UPDATE stat_players SET sp_itemcount='".$count."' WHERE sp_char='".$cdata['cid']."'","NONE");
|
||||
$statsdb->setValue('sp_itemcount',$count);
|
||||
|
||||
$_P->unregisterValue($_IDENT,$_CB);
|
||||
}
|
||||
?>
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
class BillingSummary extends SourceDriver {
|
||||
|
||||
|
||||
function drive($cdata) {
|
||||
/*
|
||||
global $DBc_char,$_DISPATCHER;
|
||||
|
||||
$res = $DBc_char->sendSQL("SELECT SUM(amount) as anz, currency FROM coupons_billing WHERE iduser='".$cdata['aid']."' AND status='captured' GROUP by 'currency'","ARRAY");
|
||||
|
||||
$billed = 0;
|
||||
|
||||
$sz = sizeof($res);
|
||||
for($i=0;$i<$sz;$i++) {
|
||||
if($res[$i]['currency'] == "USD") {
|
||||
$res[$i]['anz'] = $res[$i]['anz']*0.7950;
|
||||
}
|
||||
|
||||
if($res[$i]['currency'] == "GBP") {
|
||||
$res[$i]['anz'] = $res[$i]['anz']*1.2623;
|
||||
}
|
||||
|
||||
$billed += $res[$i]['anz'];
|
||||
}
|
||||
|
||||
$_DISPATCHER->dispatchValue("user_billed_sum",$billed);*/
|
||||
}
|
||||
}
|
||||
?>
|
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
class DeathPenalty extends Entity {
|
||||
|
||||
public $NbDeath;
|
||||
public $CurrentDeathXP;
|
||||
public $DeathXPToGain;
|
||||
public $BonusUpdateTime;
|
||||
|
||||
function DeathPenalty() {
|
||||
$this->setName("death_penalty");
|
||||
}
|
||||
}
|
||||
?>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue