\r\n을 \n으로 변경. 메모장에서 열 것도 아니고..
로그인 확인 등 몇몇 유틸 함수 새 db 라이브러리 기준으로 추가 ajax 기반 msgsubmit 작업중
This commit is contained in:
@@ -7,13 +7,13 @@ require_once(ROOT.W.F_FUNC.W.'class._JSON.php');
|
||||
class _Chat {
|
||||
public static function SetChat($type, $name, $msg) {
|
||||
$filename = ROOT.W.D_CHAT.W.$type."Chat.txt";
|
||||
AppendToFile($filename, "{$name}: {$msg}\r\n");
|
||||
AppendToFile($filename, "{$name}: {$msg}\n");
|
||||
}
|
||||
|
||||
public static function GetChat($type, $size=10) {
|
||||
$filename = ROOT.W.D_CHAT.W.$type."Chat.txt";
|
||||
$content = ReadToFileBackward($filename, $size*100);
|
||||
$msgs = explode("\r\n", $content);
|
||||
$msgs = explode("\n", $content);
|
||||
$count = count($msgs) - 1;
|
||||
$start = $count - $size;
|
||||
if($start < 0) $start = 0;
|
||||
|
||||
@@ -10,14 +10,14 @@ class _Log {
|
||||
|
||||
public static function SetLog($type, $log) {
|
||||
$filename = ROOT.W.D_LOG.W.$type."Log.txt";
|
||||
if(_Log::$flagLog) AppendToFile($filename, $log."\r\n");
|
||||
if(_Log::$flagLog) AppendToFile($filename, $log."\n");
|
||||
}
|
||||
|
||||
public static function GetWorldLog($type, $size=10) {
|
||||
$filename = ROOT.W.D_LOG.W.$type."Log.txt";
|
||||
if(_Log::$flagLog) {
|
||||
$content = ReadToFileBackward($filename, $size*150);
|
||||
$logs = explode("\r\n", $content);
|
||||
$logs = explode("\n", $content);
|
||||
$count = count($logs) - 1;
|
||||
$start = $count - $size;
|
||||
if($start < 0) $start = 0;
|
||||
|
||||
+2
-2
@@ -18,12 +18,12 @@ function getmicrotime() {
|
||||
}
|
||||
|
||||
function Error($msg) {
|
||||
AppendToFile(ROOT.'/d_log/err.txt', $msg."\r\n");
|
||||
AppendToFile(ROOT.'/d_log/err.txt', $msg."\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
function ErrorToScreen($msg) {
|
||||
AppendToFile(ROOT.'/d_log/err.txt', $msg."\r\n");
|
||||
AppendToFile(ROOT.'/d_log/err.txt', $msg."\n");
|
||||
echo $msg;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user