public function message($message) { $this->setChatPartner(Shadowcmd::$CURRENT_PLAYER); echo GWF_Debug::backtrace('AIGOT', false); echo "AI GOT: {$message}\n"; return true; }
public static function error($message) { $message = GWF_Debug::backtrace($message, false); echo $message; GWF_Log::rawLog('dog/error', trim($message)); GWF_Log::flush(); return false; }
/** * Remove all items from array that are not a decision. * @param array $args * @return array */ public static function filterDecisions(array &$args) { foreach ($args as $i => $arg) { if (!$arg instanceof SR_AIDecision) { Dog_Log::debug('filterDecisions argument is not a decision.'); GWF_Debug::backtrace('filterDecisions argument is not a decision.', $args); unset($args[$i]); } } return $args; }
/** * Load a language for this basefile by ISO. * @param string $iso * @return boolean */ private function loadLanguage($iso) { if (true === isset($this->trans[$iso])) { return true; # ISO Cache hit } $path1 = $this->base_path . '_' . $iso . '.php'; if (true === Common::isFile($path1)) { $path = $path1; # Load ISO } elseif (true === isset($this->trans[GWF_DEFAULT_LANG])) { $this->trans[$iso] =& $this->trans[GWF_DEFAULT_LANG]; return false; # Copy default cache } else { # Load default $path = $this->base_path . '_' . GWF_DEFAULT_LANG . '.php'; if (false === Common::isFile($path)) { die(GWF_Debug::backtrace(sprintf("A language file is completely missing: %s\n", htmlspecialchars($path)), false)); } } # Load file require $path; $this->trans[$iso] = $lang; return true; }
private function emailOnError($message) { if (GWF_DEBUG_EMAIL & 1) { $message = GWF_HTML::br2nl($message) . PHP_EOL . PHP_EOL; GWF_Mail::sendDebugMail(GWF_SITENAME . ': Database Error!', GWF_Debug::backtrace($message, false)); } }
private static function sendErrorMail($path, $msg) { return GWF_Mail::sendDebugMail(': Smarty Error: ' . $path, GWF_Debug::backtrace($msg, false)); }
public static function logCritical($message) { self::log('critical', $message, self::GWF_CRITICAL); self::log('critical_details', GWF_Debug::backtrace(print_r($_GET, true) . PHP_EOL . self::stripPassword($_POST) . PHP_EOL . $message, false), self::GWF_CRITICAL); // TODO: formating }