Skip to content
Permalink
Browse files

new default values for mysql 5.5+ on datetime

  • Loading branch information...
NB-Core committed Jan 1, 2019
1 parent ab7ba8e commit 0258ddd4f4960a0f901379f70506d11b2e39fee9
Showing with 106 additions and 64 deletions.
  1. +1 −0 CHANGELOG.txt
  2. +1 −1 account.php
  3. +17 −15 battle.php
  4. +1 −1 bios.php
  5. +26 −1 common.php
  6. +6 −1 home.php
  7. +25 −25 lib/all_tables.php
  8. +5 −5 lib/bans/case_removeban.php
  9. +1 −1 lib/charcleanup.php
  10. +3 −3 lib/checkban.php
  11. +1 −1 lib/clan_membership.php
  12. +5 −0 lib/constants.php
  13. +2 −2 lib/datetime.php
  14. +1 −1 lib/expire_chars.php
  15. +1 −2 login.php
  16. +1 −1 modules.php
  17. +2 −2 newday.php
  18. +1 −1 paylog.php
  19. +1 −1 settings.php
  20. +2 −0 shades.php
  21. +3 −0 stables.php
@@ -12,6 +12,7 @@ Changes to 1.2.5 +nb
*rawsql.php --> small text adaption for when no changes are made. Also removed error text when an UPDATE/DELETE statement produced no affected rows to show (db_num_rows error on TRUE result)
*superuser.php --> new hook to make the section "switchable"
*stables.php --> If you lack DKs to show an existing available mount, it will display that mount now in the nav as unavailable
*stables.php --> added a mountpoint to influence mount data and cost
[FIXES]
*lib/commentary.php --> forgot a closing > at a </div> - section close
*lib/dbwrapper_* + create.php + modules.php + list.php + logdnet.php --> mysql_real_escape_string depends on server type. made new function to wrappers for mysqli (mysql wrapper is now obsolete with ubuntu 15.04 LTS fyi)
@@ -25,7 +25,7 @@
//pre-fill
$stats=array();
$stats[]=array("title"=>"Account created on:","value"=>($user['regdate']=="0000-00-00 00:00:00"?"Too old to be traced":$user['regdate']));
$stats[]=array("title"=>"Account created on:","value"=>($user['regdate']==DATETIME_DATEMIN?"Too old to be traced":$user['regdate']));
$stats[]=array("title"=>"Last Comment posted:","value"=>$user['recentcomments']);
$stats[]=array("title"=>"Last PvP happened:","value"=>$user['pvpflag']);
$stats[]=array("title"=>"Dragonkills:","value"=>$user['dragonkills']);
@@ -57,7 +57,6 @@
} else if ($auto == 'ten') {
$count = 10;
}
$enemycounter = count($enemies);
$enemies = autosettarget($enemies);
@@ -206,7 +205,7 @@
$newcompanions = array();
foreach ($companions as $name=>$companion) {
if ($companion['hitpoints'] > 0) {
$buffer = report_companion_move(&$badguy,$companion, "heal");
$buffer = report_companion_move($badguy,$companion, "heal");
if ($buffer !== false) {
$newcompanions[$name] = $buffer;
unset($buffer);
@@ -226,7 +225,7 @@
if ($op=="fight" || $op=="run" || $surprised){
// Grab an initial roll.
$roll = rolldamage(&$badguy);
$roll = rolldamage($badguy);
if ($op=="fight" && !$surprised){
$ggchancetodouble = $session['user']['dragonkills'];
$bgchancetodouble = $session['user']['dragonkills'];
@@ -238,7 +237,7 @@
$newcompanions = array();
foreach ($companions as $name=>$companion) {
if ($companion['hitpoints'] > 0) {
$buffer = report_companion_move(&$badguy,$companion, "magic");
$buffer = report_companion_move($badguy,$companion, "magic");
if ($buffer !== false) {
$newcompanions[$name] = $buffer;
unset($buffer);
@@ -276,13 +275,13 @@
$newcompanions = $companions;
$needtostopfighting = true;
}else{
$needtostopfighting = battle_player_attacks(&$badguy);
$needtostopfighting = battle_player_attacks($badguy);
}
$r = mt_rand(0,100);
if ($r < $ggchancetodouble && $badguy['creaturehealth']>0 && $session['user']['hitpoints']>0 && !$needtostopfighting){
$additionalattack = true;
$ggchancetodouble -= ($r+5);
$roll = rolldamage(&$badguy);
$roll = rolldamage($badguy);
}else{
$additionalattack = false;
}
@@ -307,13 +306,13 @@
$buffset = activate_buffs("defense");
do {
$defended = false;
$needtostopfighting = battle_badguy_attacks(&$badguy);
$needtostopfighting = battle_badguy_attacks($badguy);
$r = mt_rand(0,100);
if (!isset($bgchancetodouble)) $bgchancetodouble = 0;
if ($r < $bgchancetodouble && $badguy['creaturehealth']>0 && $session['user']['hitpoints']>0 && !$needtostopfighting){
$additionalattack = true;
$bgchancetodouble -= ($r+5);
$roll = rolldamage(&$badguy);
$roll = rolldamage($badguy);
}else{
$additionalattack = false;
}
@@ -324,7 +323,7 @@
if (is_array($companions)) {
foreach ($companions as $name=>$companion) {
if ($companion['hitpoints'] > 0) {
$buffer = report_companion_move(&$badguy,$companion, "fight");
$buffer = report_companion_move($badguy,$companion, "fight");
if ($buffer !== false) {
$newcompanions[$name] = $buffer;
unset($buffer);
@@ -397,10 +396,13 @@
// experience for graveyard fights.
if (getsetting("instantexp",false) == true && $session['user']['alive'] && $options['type'] != "pvp" && $options['type'] != "train") {
if (!isset($badguy['expgained']) || $badguy['expgained'] == false) {
$session['user']['experience'] += round($badguy['creatureexp']/count($newenemies));
if (isset($badguy['creatureexp'])) output("`#You receive `^%s`# experience!`n`0",round($badguy['creatureexp']/count($newenemies)));
$cr_xp_gain = round($badguy['creatureexp']/count($newenemies));
$args = modulehook("forest-victory-xp",$args=array('experience'=>$cr_xp_gain));
$cr_xp_gain = $args['experience'];
$session['user']['experience'] += $cr_xp_gain;
if (isset($badguy['creatureexp'])) output("`#You receive `^%s`# experience!`n`0",$cr_xp_gain);
$options['experience'][$index] = $badguy['creatureexp'];
$options['experiencegained'][$index] = round($badguy['creatureexp']/count($newenemies));
$options['experiencegained'][$index] = $cr_xp_gain;
$badguy['expgained']=true;
}
} else {
@@ -537,7 +539,7 @@
$session['user']['companions']=createstring($companions);
tlschema();
function battle_player_attacks($badguy) {
function battle_player_attacks(&$badguy) {
global $enemies,$newenemies,$session,$creatureattack,$creatureatkmod, $beta;
global $creaturedefmod,$adjustment,$defmod,$atkmod,$compatkmod,$compdefmod,$buffset,$atk,$def,$options;
global $companions,$companion,$newcompanions,$roll,$count,$needtostopfighting;
@@ -578,7 +580,7 @@ function battle_player_attacks($badguy) {
return $break;
}
function battle_badguy_attacks($badguy) {
function battle_badguy_attacks(&$badguy) {
global $enemies,$newenemies,$session,$creatureattack,$creatureatkmod, $beta;
global $creaturedefmod,$adjustment,$defmod,$atkmod,$compatkmod,$compdefmod,$buffset,$atk,$def,$options;
global $companions,$companion,$newcompanions,$roll,$count,$index,$defended,$needtostopfighting;
@@ -603,7 +605,7 @@ function battle_badguy_attacks($badguy) {
if (is_array($companions)) {
foreach ($companions as $name=>$companion) {
if ($companion['hitpoints'] > 0) {
$buffer = report_companion_move(&$badguy,$companion, "defend");
$buffer = report_companion_move($badguy,$companion, "defend");
if ($buffer !== false) {
$newcompanions[$name] = $buffer;
unset($buffer);
@@ -24,7 +24,7 @@
db_query($sql);
}
if ($op=="unblock"){
$sql = "UPDATE " . db_prefix("accounts") . " SET bio='',biotime='0000-00-00 00:00:00' WHERE acctid='$userid'";
$sql = "UPDATE " . db_prefix("accounts") . " SET bio='',biotime='".DATETIME_DATEMIN."' WHERE acctid='$userid'";
$subj = array("Your bio has been unblocked");
$msg = array("The system administrators have decided to unblock your bio. You can once again enter a bio entry.");
systemmail($userid,$subj,$msg);
@@ -89,7 +89,32 @@
//session_register("session");
//deprecated
session_start();
$time = $_SERVER['REQUEST_TIME'];
/**
* for a 30 minute timeout, specified in seconds
*/
$timeout_duration = 60*60;
/**
* Here we look for the user.s LAST_ACTIVITY timestamp. If
* it.s set and indicates our $timeout_duration has passed,
* blow away any previous $_SESSION data and start a new one.
*/
if (isset($_SESSION['LAST_ACTIVITY']) && ($time - $_SESSION['LAST_ACTIVITY']) > $timeout_duration) {
session_unset();
session_destroy();
}
session_start();
/**
* Finally, update LAST_ACTIVITY so that our timeout
* is based on it and not the user.s login time.
*/
$_SESSION['LAST_ACTIVITY'] = $time;
//session_start();
$session =& $_SESSION['session'];
@@ -64,9 +64,10 @@
addnav("Daily News", "news.php");
addnav("Other Info");
addnav("About LoGD","about.php");
if (getsetting('impressum','')!='') addnav("Imprint","about.php");
addnav("Game Setup Info", "about.php?op=setup");
addnav("LoGD Net","logdnet.php?op=list");
addnav("Legal");
if (getsetting('impressum','')!='') addnav("Imprint","about.php");
modulehook("index", array());
@@ -143,4 +144,8 @@ function md5pass(){
rawoutput("</tr></table></form>");
}
page_footer();
if ($op=="timeout") {
session_unset();
session_destroy(); // destroy if timeout
}
?>

0 comments on commit 0258ddd

Please sign in to comment.
You can’t perform that action at this time.