Exemplo n.º 1
0
function PrintUI($PID)
{
    //printLheader();
    printRheader();
    $LID = getlocation($PID);
    printnav($PID, $LID);
    echo "<div class='accordionclear'>";
    printskills($PID);
    printinv($PID);
    echo "</div>";
    printlog($PID);
    printchat($PID);
    echo "<script>\nvar log = document.getElementById('log');\nlog.scrollTop = log.scrollHeight;\n</script><script>\nvar chat = document.getElementById('chat');\nchat.scrollTop = chat.scrollHeight;\n</script>";
}
Exemplo n.º 2
0
        $getname = mysql_fetch_array(mysql_query("SELECT name, subname FROM " . $mysqlcnf[2]['database'] . ".creature_template WHERE entry='" . $cwitem['id'] . "' LIMIT 1 ", $WDB));
        $getnpc = mysql_fetch_array(mysql_query("SELECT * FROM " . $mysqlcnf[3]['database'] . ".creature WHERE guid='" . $cwitem['guid'] . "' LIMIT 1 ", $WDB));
        $remdone = false;
        # dont change
        if ($cwitem['id'] == $getnpc['id'] and $cwitem['map'] == $getnpc['map'] and $cwitem['position_x'] == $getnpc['position_x'] and $cwitem['position_y'] == $getnpc['position_y'] and $cwitem['position_z'] == $getnpc['position_z']) {
            $remdone = true;
            $count_cwitem++;
            // count creatures/npcs spawn deletes on new world db
            $backup_item = mysql_query("DELETE FROM " . $mysqlcnf[3]['database'] . ".creature WHERE guid='" . $cwitem['guid'] . "' LIMIT 1 ", $WDB);
            echo printlog('----- <i>Custom Creature/NPC Spawn Delete:</i> <b>' . $getname['name'] . '</b> [' . $getname['subname'] . '] - <i>(GUID: ' . $cwitem['guid'] . ') &gt; remove from new world done</i>', 'white');
        } elseif ($getnpc['guid'] == $cwitem['guid'] and $remdone != true) {
            echo printlog('----- <i>Custom Creature/NPC Spawn Delete:</i> <b>' . $getname['name'] . '</b> [' . $getname['subname'] . '] - <i>(GUID: ' . $cwitem['guid'] . ') &gt; is different from new Repack, we better let this one alive!</i>', 'red');
        } else {
            echo printlog('----- <i>Custom Creature/NPC Spawn Delete:</i> <b>' . $getname['name'] . '</b> [' . $getname['subname'] . '] - <i>(GUID: ' . $cwitem['guid'] . ') &gt; is not present on new Repack, no delete needed!</i>', 'red');
        }
        // Entry not given in new World Repack (may deleted allready)
    }
    // 2.1 END (Check Original world repack if Entry present in current Repack)
}
// 2. END (Check for deleted World Creatures/NPCs)
## 2.9A) If no changes...
if ($count_cwitem == 0) {
    echo printlog('----- no changes, orginal repack world is sync! <i>(' . $count_rwitem . ' Creatures/NPC Spawn deletions simular)</i>', 'yellow');
} elseif ($count_cwitem > 0) {
    echo printlog('----- Deleted <b>' . $count_cwitem . '</b> Creatures/NPC Spawns of the new Repack that got removed by GM! <i>(' . $count_rwitem . ' Creatures/NPC Spawns deletions simular)</i>', 'green');
}
# END SIGNAL (LOG)
echo printlog('<B><I>Mod:</I></B> ' . $module['NAME'] . ' <b>exit!</b>', 'turky');
// log output (dont remove!)
echo printlog('#######################################################', 'dark');
        $getname = mysql_fetch_array(mysql_query("SELECT Comment FROM " . $mysqlcnf[2]['database'] . ".spell_dbc WHERE Id='" . $cwitem['Spell'] . "' LIMIT 1 ", $WDB));
        unset($backup_item, $adderror);
        $backup_item = mysql_fetch_array(mysql_query("INSERT INTO " . $mysqlcnf[3]['database'] . ".playercreateinfo_spell SELECT * FROM " . $mysqlcnf[2]['database'] . ".playercreateinfo_spell WHERE racemask='" . $cwitem['racemask'] . "' AND classmask='" . $cwitem['classmask'] . "' AND Spell='" . $cwitem['Spell'] . "' AND Note='" . $cwitem['Note'] . "' LIMIT 1 ", $WDB));
        $adderror = mysql_error();
        if ($adderror > '') {
            echo printlog('----- <i>Custom Starterspell Error:</i> ' . $adderror, 'red');
            $count_cwitem = $count_cwitem - 1;
        }
        # 2.1) Check if added...
        if (!$adderror) {
            echo printlog('----- <i>Custom Starterspell:</i> <b>' . $getname['Comment'] . '</b> (' . $cwitem['Note'] . ') &gt; sync done</i>', 'white');
        } else {
            echo printlog('----- <i>Custom Starterspell:</i> <b>' . $getname['Comment'] . '</b> (' . $cwitem['Note'] . ') &gt; sync failed</i>', 'red');
        }
    }
    // 1.1 END (Check if Entry present in new Repack)
}
// 1. END (Check for live World Starter Spells)
## 3.) If no changes...
if ($count_cwitem == 0) {
    echo printlog('----- no changes, orginal repack world is sync! <i>(' . $count_rwitem . ' Starterspells simular)</i>', 'yellow');
} elseif ($count_cwitem > 0) {
    echo printlog('----- Sync. of <b>' . $count_cwitem . '</b> custom Starterspells done! <i>(' . $count_rwitem . ' Starterspells simular)</i>', 'green');
}
// 3. END - (check for changes)
/*********************************************
 ********** CUSTOM MODULE CODE END ***********
 *********************************************/
# END SIGNAL (LOG, DON'T REMOVE!)
echo printlog('<B><I>Mod:</I></B> ' . $module['NAME'] . ' <b>exit!</b>', 'turky');
// log output
Exemplo n.º 4
0
 * If you used WGE Version 1.0.1b then you have to forget the old modloader.php
 * Now there is a new Way how to add Modules to the Modloader.
 * Please read the new Instructions first... 
 * 
 * IMPORTANT:
 * to disable a module without removing it, you now just need to add a "#" in front of the module line
 * the configuration part inside the main.php is gone now, we dont need it anymore.
 * 
 * example to disable a mod:
 * #'creature-add_del-sync', // custom comment
 * 
 */
$modload_cnf = array('creature-add_del-sync', 'gameobject-add_del-sync', 'item_template-add-sync', 'creature_template-add-sync', '', '', '', '', '', '', '', '', '', '', '', '', 'exit' => true);
# Array exit
$mcount = 1;
# counter start
# Check the Modload Config Array
foreach ($modload_cnf as &$mod) {
    // Check if a Modname is given
    if ($mod > '') {
        // Module Input found, add it to the new array
        $modloader[$mcount] = $mod;
        $mcount++;
        # add counter +1
    }
    // Mod present end
}
// foreach $modload_cnf end
if ($modload_cnf['exit'] != true) {
    exit(printlog("Modloader Configuration invalid! Please fix that!", "red"));
}
Exemplo n.º 5
0
function getFileList($DC, $nick){
    $st = microtime(true);

    if(CONSOLE_OUT_CHARSET){
        printlog(1, @iconv('utf-8',CONSOLE_OUT_CHARSET,$nick)." - ");
    }else{
        printlog(1, $nick." - ");
    }
    
    $bz2Content = $DC->getFile($nick, 'files.xml.bz2');
    if($DC->connectedBack){
        printlog(1, " backconnect ".$DC->connectedBack." - ");
        $DC->connectedBack = false;
    }
    if($bz2Content === false){
        printlog(1, "fail(".$DC->lasterror.")\n");
        return false;
    }elseif($bz2Content === '') {
        printlog(1, "not bz2\n");
        return false;
    }
    $fn = uniqid().'.bz2';
    $fh = fopen(WORKER_TMPDIR.'/'.$fn, 'wb');
    $written = fwrite($fh, $bz2Content);
    fclose($fh);
    if(!$written){
        printlog(1, "nothing written\n");
        if(file_exists(WORKER_TMPDIR.'/'.$fn)) unlink(WORKER_TMPDIR.'/'.$fn);
        return false;
    }
    $et = microtime(true);
    printlog(1, "ok (".sprintf("%01.2f",$et-$st)." s) \n");
    return $fn;
}
Exemplo n.º 6
0
    ### METHOD 1 END
    ### FINISH - CLOSE MYSQL CONNECTION
    $mysql_exit = mysql_close($WDB);
} elseif ($maincnf['LOADER'] == 2) {
    /*
     * METHOD 2 - INTERFACE STYLE
     *****************************
     * 
     * This Loader is based on a Webinterface.
     * Just open Worldguard over a Browser and add your Data manual.
     * With this Method most of the Configuration Options are not used!
     * 
     * !!!!!!!!!!! UNDER DEVELOPMENT - MAY SOON !!!!!!!!!!!!!
     * 
     * Greetings,
     * xcoder
     * 
     */
    echo printlog('Bootloader Nr. 2 failed - This Loader is still under development, please use Loader Nr. 1', 'red');
    // log output
    ### METHOD 2 END
    ### FINISH - CLOSE MYSQL CONNECTION
    $mysql_exit = mysql_close($WDB);
} else {
    exit(printlog('Bootloader incorrect, Error Part: IF-0001', 'red'));
}
// log output - Security Check END, (IF-0001)
echo printlog('<b>Worldguard Terminal - EXIT</b>', 'turky');
// log output - may dont remove!
echo printlog('<i>WorldGuard Engine Shutdown (TS: ' . time() . ')</i>', 'dark');
// log output - may dont remove!
Exemplo n.º 7
0
/**
 * @param boolean $trusted Depreciated.
*/
function getIDFeed($id, $url, $trusted, $lastkill)
{
    // Just in case, check for empty urls.
    if (empty($url)) {
        return '';
    }
    $qry2 = new DBQuery();
    $feedfetch = new IDFeed();
    $feedfetch->setID();
    $feedfetch->setAllKills(1);
    if (!$lastkill) {
        $feedfetch->setStartDate(time() - 60 * 60 * 24 * 7);
    } else {
        $feedfetch->setStartKill($lastkill + 1, true);
    }
    if ($feedfetch->read($url) !== false) {
        $posted = count($feedfetch->getPosted());
        $skipped = count($feedfetch->getSkipped());
        $duplicate = count($feedfetch->getDuplicate());
        if (strrpos(strtolower($url), 'zkillboard')) {
            $newKillID = $feedfetch->getLastReturned();
        } else {
            $newKillID = $feedfetch->getLastInternalReturned();
        }
        if ($newKillID > $lastkill) {
            $qry2->execute("UPDATE kb3_feeds SET feed_lastkill=" . intval($newKillID) . ", feed_updated=NOW()\n\t\t\t\tWHERE feed_kbsite = '" . KB_SITE . "' AND feed_id = {$id}");
        }
        printlog($posted . " kills were posted, " . $duplicate . " duplicate kills and " . $skipped . " were skipped.");
        printlog("Last kill ID returned was {$newKillID}");
        if ($feedfetch->getParseMessages()) {
            foreach ($feedfetch->getParseMessages() as $msg) {
                printlog($msg);
            }
        }
    } else {
        if (!$val['lastkill']) {
            printlog("Start time = " . date('YmdHi', time() - 60 * 60 * 24 * 7));
        } else {
            if ($val['apikills']) {
                printlog("Start kill = " . $val['lastkill']);
            }
        }
        printlog("Error reading feed: " . $feedfetch->errormsg());
    }
    printlog("Fetch url: " . $feedfetch->getFullURL());
}
Exemplo n.º 8
0
        $total_deleted_dirs += $deleted_dirs;
        $total_count++;
        $et = microtime(true);
        printlog(1, round($et - $st, 2) . "s\n");
        sleep(1);
        //win+mysql 5.1: id=0 fixing
    }
}
$get = microtime(true);
printlog(1, "========\n");
printlog(0, "{$total_count} users-ADDED {$total_added_files} files,{$total_added_dirs} dirs;DELETED:{$total_deleted_files} files,{$total_deleted_dirs} dirs-" . sprintf("%01.2f", $get - $gst) . "s\n");
if ($deleted_users = Indexer::delOldUsers()) {
    printlog(0, "{$deleted_users} old(or empty) users deleted from db\n");
}
Indexer::freeXmlReader();
$dir = opendir(WORKER_TMPDIR);
$deleted = 0;
while ($fn = readdir($dir)) {
    if (pathinfo($fn, PATHINFO_EXTENSION) == 'bz2') {
        @unlink(WORKER_TMPDIR . '/' . $fn);
        $deleted++;
    }
}
printlog(1, "{$deleted} bz2 files deleted\n");
function printlog($debugLevel, $message)
{
    $debug = defined('DEBUG') ? constant('DEBUG') : 0;
    if ($debug >= $debugLevel) {
        echo $message;
    }
}
Exemplo n.º 9
0
$rs = sqa($conn2, "select DATESTAT from tbl_pingtable where DATESTAT>'" . $pi2 . "'");
$pi_count = sizeof($rs);
//Если нужно - обновляем
if ($pi_count < 1) {
    //Вычисляем сколько активных сейчас
    $rs = sq($conn2, "select CODE from tbl_base where LASTPING>='" . $ps_activetime2 . "'");
    $pi_count2 = sizeof($rs);
    //Фиксируем данные
    nq($conn2, "insert into tbl_pingtable (DATESTAT,COUNT) values (NOW()," . $pi_count2 . ")");
}
//=================================================================================================================
printlog("записываем дату обновления");
nq($conn2, "update tbl_conf set VALUEDATE=NOW() where PARAM='LASTUPDSCET'");
//=================================================================================================================
//=================================================================================================================
printlog("делаем запись в истории про обновление");
nq($conn2, "insert into tbl_operhist (OPERCODE,DATEOPER,TYPER,PAR1,PAR2,VAL_OLD,VAL_NEW) values (0,NOW(),3,'','','','')");
//=================================================================================================================
printlog("системные операции. ОКОНЧАНИЕ");
printlog("ставим отметку в базе, что обновление завершено");
nq($conn2, "update tbl_conf set VALUEINT=0 where PARAM='ISUPDATEDO'");
printlog("обновление завершено");
printlog('===========================================');
$ps_file101 = $ps_repalllog;
printlog($zver . " Update FINISH at " . date("d.m.Y H:i:s", time()));
printlog('===========================================');
//клоузим БД
mysql_disconnect($conn1);
mysql_disconnect($conn2);
//грохаем PID на выходе
unlink($pidfile);